From fc97d7cc8098b3a3979ce2900be391d21e207115 Mon Sep 17 00:00:00 2001 From: Ernst Peter Tamminga Date: Tue, 8 May 2018 14:42:44 +0200 Subject: [PATCH] Conversion to C# --- .build/Ionic.Zip.Reduced.dll | Bin 253440 -> 0 bytes AssemblyInfo.vb | 52 - Components/DataProvider.cs | 157 + Components/DataProvider.vb | 170 - Components/EventBase.cs | 1328 ++++ Components/EventBase.vb | 1014 --- Components/EventController.cs | 3254 +++++++++ Components/EventController.vb | 2619 ------- Components/EventInfo.cs | 6087 +++++++++++++++++ Components/EventInfo.vb | 5039 -------------- Components/EventModuleSettings.cs | 3951 +++++++++++ Components/EventModuleSettings.vb | 2856 -------- Components/EventModuleSettingsInfo.cs | 504 ++ Components/EventNotification.cs | 334 + Components/EventNotification.vb | 290 - Components/EventTokenReplace.cs | 1095 +++ Components/EventTokenReplace.vb | 859 --- Components/Integration/Constants.cs | 45 + Components/Integration/Constants.vb | 40 - Components/Integration/Content.cs | 172 + Components/Integration/Content.vb | 157 - Components/Integration/Journal.cs | 206 + Components/Integration/Journal.vb | 185 - Components/SiteMapProvider.cs | 172 + Components/SiteMapProvider.vb | 134 - Components/SqlDataProvider.cs | 430 ++ Components/SqlDataProvider.vb | 392 -- Components/iCalProvider.cs | 1262 ++++ Components/iCalProvider.vb | 1024 --- .../DNNCalendar.cs | 972 +++ .../DNNCalendar.vb | 836 --- ... DotNetNuke.Events.ScheduleControl.csproj} | 54 +- ...NetNuke.Modules.Events.ScheduleControl.xml | 1168 ++++ .../My Project/AssemblyInfo.vb | 35 - .../Properties/AssemblyInfo.cs | 36 + .../baseschedule.cs | 2873 ++++++++ .../baseschedule.vb | 2504 ------- .../calendarpropertybuilder.cs | 638 ++ .../calendarpropertybuilder.resx | 2 +- .../calendarpropertybuilder.vb | 598 -- .../clickabletablecell.cs | 91 + .../clickabletablecell.vb | 73 - .../clickabletablecelleventargs.cs | 79 + .../clickabletablecelleventargs.vb | 65 - .../generalpropertybuilder.resx | 123 - .../generalpropertybuilder.vb | 546 -- .../schedulecalendar.cs | 985 +++ .../schedulecalendar.vb | 823 --- .../schedulecommandeventargs.cs | 70 + .../schedulecommandeventargs.vb | 60 - .../scheduledesigneractionlist.vb | 63 - .../schedulegeneral.cs | 718 ++ .../schedulegeneral.vb | 580 -- .../scheduleitem.cs | 115 + .../scheduleitem.vb | 98 - .../scheduleitemcollection.cs | 108 + .../scheduleitemcollection.vb | 86 - .../scheduleitemeventargs.cs | 60 + .../scheduleitemeventargs.vb | 51 - ....Events.vbproj => DotNetNuke.Events.csproj | 223 +- DotNetNuke.Events.sln | 15 +- EditEvents.ascx | 19 +- EditEvents.ascx.cs | 2666 ++++++++ EditEvents.ascx.designer.cs | 1932 ++++++ EditEvents.ascx.designer.vb | 1934 ------ EditEvents.ascx.vb | 2148 ------ EventDay.ascx | 13 +- EventDay.ascx.cs | 441 ++ EventDay.ascx.designer.cs | 105 + EventDay.ascx.designer.vb | 107 - EventDay.ascx.vb | 348 - EventDetails.ascx | 23 +- EventDetails.ascx.cs | 1605 +++++ EventDetails.ascx.designer.cs | 636 ++ EventDetails.ascx.designer.vb | 638 -- EventDetails.ascx.vb | 1309 ---- EventEditCategories.ascx | 19 +- EventEditCategories.ascx.cs | 361 + EventEditCategories.ascx.designer.cs | 213 + EventEditCategories.ascx.designer.vb | 215 - EventEditCategories.ascx.vb | 301 - EventEditLocations.ascx | 20 +- EventEditLocations.ascx.cs | 410 ++ EventEditLocations.ascx.designer.cs | 213 + EventEditLocations.ascx.designer.vb | 215 - EventEditLocations.ascx.vb | 321 - EventIPN.aspx | 3 +- EventIPN.aspx.cs | 540 ++ EventIPN.aspx.designer.cs | 55 + EventIPN.aspx.designer.vb | 26 - EventIPN.aspx.vb | 429 -- EventList.ascx | 10 +- EventList.ascx.cs | 468 ++ EventList.ascx.designer.cs | 117 + EventList.ascx.designer.vb | 89 - EventList.ascx.vb | 374 - EventModerate.ascx | 15 +- EventModerate.ascx.cs | 614 ++ EventModerate.ascx.designer.cs | 204 + EventModerate.ascx.designer.vb | 206 - EventModerate.ascx.vb | 472 -- EventMonth.ascx | 18 +- EventMonth.ascx.cs | 525 ++ EventMonth.ascx.designer.cs | 96 + EventMonth.ascx.designer.vb | 98 - EventMonth.ascx.vb | 411 -- EventMyEnrollments.ascx | 10 +- EventMyEnrollments.ascx.cs | 269 + EventMyEnrollments.ascx.designer.cs | 108 + EventMyEnrollments.ascx.designer.vb | 80 - EventMyEnrollments.ascx.vb | 220 - EventPPEnroll.ascx | 9 +- EventPPEnroll.ascx.cs | 417 ++ EventPPEnroll.ascx.designer.cs | 222 + EventPPEnroll.ascx.designer.vb | 224 - EventPPEnroll.ascx.vb | 340 - EventRSS.aspx | 3 +- EventRSS.aspx.cs | 504 ++ EventRSS.aspx.designer.cs | 46 + EventRSS.aspx.designer.vb | 19 - EventRSS.aspx.vb | 400 -- EventRpt.ascx | 12 +- EventRpt.ascx.cs | 372 + EventRpt.ascx.designer.cs | 117 + EventRpt.ascx.designer.vb | 89 - EventRpt.ascx.vb | 292 - EventSettings.ascx | 113 +- EventSettings.ascx.cs | 1874 +++++ EventSettings.ascx.designer.cs | 3462 ++++++++++ EventSettings.ascx.designer.vb | 3464 ---------- EventSettings.ascx.vb | 1573 ----- EventTemplateHelp.ascx | 4 +- EventTemplateHelp.ascx.cs | 40 + EventTemplateHelp.ascx.designer.cs | 55 + EventTemplateHelp.ascx.designer.vb | 26 - EventTemplateHelp.ascx.vb | 36 - EventVCal.aspx | 3 +- EventVCal.aspx.cs | 65 + EventVCal.aspx.designer.cs | 54 + EventVCal.aspx.designer.vb | 25 - EventVCal.aspx.vb | 54 - EventWeek.ascx | 13 +- EventWeek.ascx.cs | 368 + EventWeek.ascx.designer.cs | 153 + EventWeek.ascx.designer.vb | 125 - EventWeek.ascx.vb | 305 - Events.ascx | 3 +- Events.ascx.cs | 586 ++ Events.ascx.designer.cs | 73 + Events.ascx.designer.vb | 44 - Events.ascx.vb | 301 - Installation/06.03.02.SqlDataProvider | 208 + Installation/Attributes.cs | 106 + Installation/Attributes.vb | 157 - Installation/CleanUp/Cleanup.06.03.02.txt | 3 + Installation/CleanUp/Cleanup.07.00.00.txt | 8 + Installation/DNN_Events.dnn | 61 +- Installation/License.txt | 21 +- {.build => Installation}/Project.targets | 227 +- .../ReleaseNotes/Release.06.03.02.txt | 7 + .../ReleaseNotes/Release.07.00.00.txt | 11 + Properties/AssemblyInfo.cs | 57 + Settings.ascx | 5 +- Settings.ascx.cs | 263 + Settings.ascx.designer.cs | 99 + Settings.ascx.designer.vb | 71 - Settings.ascx.vb | 213 - .../App_LocalResources/EventIcons.ascx.resx | 2 +- .../EventUserGrid.ascx.resx | 2 +- .../SelectCategory.ascx.resx | 2 +- .../SelectLocation.ascx.resx | 2 +- SubControls/EventIcons.ascx | 16 +- SubControls/EventIcons.ascx.cs | 334 + SubControls/EventIcons.ascx.designer.cs | 171 + SubControls/EventIcons.ascx.designer.vb | 143 - SubControls/EventIcons.ascx.vb | 266 - SubControls/EventUserGrid.ascx | 10 +- SubControls/EventUserGrid.ascx.cs | 345 + SubControls/EventUserGrid.ascx.designer.cs | 99 + SubControls/EventUserGrid.ascx.designer.vb | 71 - SubControls/EventUserGrid.ascx.vb | 231 - SubControls/SelectCategory.ascx | 5 +- SubControls/SelectCategory.ascx.cs | 408 ++ SubControls/SelectCategory.ascx.designer.cs | 73 + SubControls/SelectCategory.ascx.designer.vb | 44 - SubControls/SelectCategory.ascx.vb | 295 - SubControls/SelectLocation.ascx | 5 +- SubControls/SelectLocation.ascx.cs | 409 ++ SubControls/SelectLocation.ascx.designer.cs | 73 + SubControls/SelectLocation.ascx.designer.vb | 44 - SubControls/SelectLocation.ascx.vb | 297 - 191 files changed, 50093 insertions(+), 40901 deletions(-) delete mode 100644 .build/Ionic.Zip.Reduced.dll delete mode 100644 AssemblyInfo.vb create mode 100644 Components/DataProvider.cs delete mode 100644 Components/DataProvider.vb create mode 100644 Components/EventBase.cs delete mode 100644 Components/EventBase.vb create mode 100644 Components/EventController.cs delete mode 100644 Components/EventController.vb create mode 100644 Components/EventInfo.cs delete mode 100644 Components/EventInfo.vb create mode 100644 Components/EventModuleSettings.cs delete mode 100644 Components/EventModuleSettings.vb create mode 100644 Components/EventModuleSettingsInfo.cs create mode 100644 Components/EventNotification.cs delete mode 100644 Components/EventNotification.vb create mode 100644 Components/EventTokenReplace.cs delete mode 100644 Components/EventTokenReplace.vb create mode 100644 Components/Integration/Constants.cs delete mode 100644 Components/Integration/Constants.vb create mode 100644 Components/Integration/Content.cs delete mode 100644 Components/Integration/Content.vb create mode 100644 Components/Integration/Journal.cs delete mode 100644 Components/Integration/Journal.vb create mode 100644 Components/SiteMapProvider.cs delete mode 100644 Components/SiteMapProvider.vb create mode 100644 Components/SqlDataProvider.cs delete mode 100644 Components/SqlDataProvider.vb create mode 100644 Components/iCalProvider.cs delete mode 100644 Components/iCalProvider.vb create mode 100644 Controls/DotNetNuke.Events.ScheduleControl/DNNCalendar.cs delete mode 100644 Controls/DotNetNuke.Events.ScheduleControl/DNNCalendar.vb rename Controls/DotNetNuke.Events.ScheduleControl/{DotNetNuke.Events.ScheduleControl.vbproj => DotNetNuke.Events.ScheduleControl.csproj} (82%) create mode 100644 Controls/DotNetNuke.Events.ScheduleControl/DotNetNuke.Modules.Events.ScheduleControl.xml delete mode 100644 Controls/DotNetNuke.Events.ScheduleControl/My Project/AssemblyInfo.vb create mode 100644 Controls/DotNetNuke.Events.ScheduleControl/Properties/AssemblyInfo.cs create mode 100644 Controls/DotNetNuke.Events.ScheduleControl/baseschedule.cs delete mode 100644 Controls/DotNetNuke.Events.ScheduleControl/baseschedule.vb create mode 100644 Controls/DotNetNuke.Events.ScheduleControl/calendarpropertybuilder.cs delete mode 100644 Controls/DotNetNuke.Events.ScheduleControl/calendarpropertybuilder.vb create mode 100644 Controls/DotNetNuke.Events.ScheduleControl/clickabletablecell.cs delete mode 100644 Controls/DotNetNuke.Events.ScheduleControl/clickabletablecell.vb create mode 100644 Controls/DotNetNuke.Events.ScheduleControl/clickabletablecelleventargs.cs delete mode 100644 Controls/DotNetNuke.Events.ScheduleControl/clickabletablecelleventargs.vb delete mode 100644 Controls/DotNetNuke.Events.ScheduleControl/generalpropertybuilder.resx delete mode 100644 Controls/DotNetNuke.Events.ScheduleControl/generalpropertybuilder.vb create mode 100644 Controls/DotNetNuke.Events.ScheduleControl/schedulecalendar.cs delete mode 100644 Controls/DotNetNuke.Events.ScheduleControl/schedulecalendar.vb create mode 100644 Controls/DotNetNuke.Events.ScheduleControl/schedulecommandeventargs.cs delete mode 100644 Controls/DotNetNuke.Events.ScheduleControl/schedulecommandeventargs.vb delete mode 100644 Controls/DotNetNuke.Events.ScheduleControl/scheduledesigneractionlist.vb create mode 100644 Controls/DotNetNuke.Events.ScheduleControl/schedulegeneral.cs delete mode 100644 Controls/DotNetNuke.Events.ScheduleControl/schedulegeneral.vb create mode 100644 Controls/DotNetNuke.Events.ScheduleControl/scheduleitem.cs delete mode 100644 Controls/DotNetNuke.Events.ScheduleControl/scheduleitem.vb create mode 100644 Controls/DotNetNuke.Events.ScheduleControl/scheduleitemcollection.cs delete mode 100644 Controls/DotNetNuke.Events.ScheduleControl/scheduleitemcollection.vb create mode 100644 Controls/DotNetNuke.Events.ScheduleControl/scheduleitemeventargs.cs delete mode 100644 Controls/DotNetNuke.Events.ScheduleControl/scheduleitemeventargs.vb rename DotNetNuke.Events.vbproj => DotNetNuke.Events.csproj (79%) create mode 100644 EditEvents.ascx.cs create mode 100644 EditEvents.ascx.designer.cs delete mode 100644 EditEvents.ascx.designer.vb delete mode 100644 EditEvents.ascx.vb create mode 100644 EventDay.ascx.cs create mode 100644 EventDay.ascx.designer.cs delete mode 100644 EventDay.ascx.designer.vb delete mode 100644 EventDay.ascx.vb create mode 100644 EventDetails.ascx.cs create mode 100644 EventDetails.ascx.designer.cs delete mode 100644 EventDetails.ascx.designer.vb delete mode 100644 EventDetails.ascx.vb create mode 100644 EventEditCategories.ascx.cs create mode 100644 EventEditCategories.ascx.designer.cs delete mode 100644 EventEditCategories.ascx.designer.vb delete mode 100644 EventEditCategories.ascx.vb create mode 100644 EventEditLocations.ascx.cs create mode 100644 EventEditLocations.ascx.designer.cs delete mode 100644 EventEditLocations.ascx.designer.vb delete mode 100644 EventEditLocations.ascx.vb create mode 100644 EventIPN.aspx.cs create mode 100644 EventIPN.aspx.designer.cs delete mode 100644 EventIPN.aspx.designer.vb delete mode 100644 EventIPN.aspx.vb create mode 100644 EventList.ascx.cs create mode 100644 EventList.ascx.designer.cs delete mode 100644 EventList.ascx.designer.vb delete mode 100644 EventList.ascx.vb create mode 100644 EventModerate.ascx.cs create mode 100644 EventModerate.ascx.designer.cs delete mode 100644 EventModerate.ascx.designer.vb delete mode 100644 EventModerate.ascx.vb create mode 100644 EventMonth.ascx.cs create mode 100644 EventMonth.ascx.designer.cs delete mode 100644 EventMonth.ascx.designer.vb delete mode 100644 EventMonth.ascx.vb create mode 100644 EventMyEnrollments.ascx.cs create mode 100644 EventMyEnrollments.ascx.designer.cs delete mode 100644 EventMyEnrollments.ascx.designer.vb delete mode 100644 EventMyEnrollments.ascx.vb create mode 100644 EventPPEnroll.ascx.cs create mode 100644 EventPPEnroll.ascx.designer.cs delete mode 100644 EventPPEnroll.ascx.designer.vb delete mode 100644 EventPPEnroll.ascx.vb create mode 100644 EventRSS.aspx.cs create mode 100644 EventRSS.aspx.designer.cs delete mode 100644 EventRSS.aspx.designer.vb delete mode 100644 EventRSS.aspx.vb create mode 100644 EventRpt.ascx.cs create mode 100644 EventRpt.ascx.designer.cs delete mode 100644 EventRpt.ascx.designer.vb delete mode 100644 EventRpt.ascx.vb create mode 100644 EventSettings.ascx.cs create mode 100644 EventSettings.ascx.designer.cs delete mode 100644 EventSettings.ascx.designer.vb delete mode 100644 EventSettings.ascx.vb create mode 100644 EventTemplateHelp.ascx.cs create mode 100644 EventTemplateHelp.ascx.designer.cs delete mode 100644 EventTemplateHelp.ascx.designer.vb delete mode 100644 EventTemplateHelp.ascx.vb create mode 100644 EventVCal.aspx.cs create mode 100644 EventVCal.aspx.designer.cs delete mode 100644 EventVCal.aspx.designer.vb delete mode 100644 EventVCal.aspx.vb create mode 100644 EventWeek.ascx.cs create mode 100644 EventWeek.ascx.designer.cs delete mode 100644 EventWeek.ascx.designer.vb delete mode 100644 EventWeek.ascx.vb create mode 100644 Events.ascx.cs create mode 100644 Events.ascx.designer.cs delete mode 100644 Events.ascx.designer.vb delete mode 100644 Events.ascx.vb create mode 100644 Installation/06.03.02.SqlDataProvider create mode 100644 Installation/Attributes.cs delete mode 100644 Installation/Attributes.vb create mode 100644 Installation/CleanUp/Cleanup.06.03.02.txt create mode 100644 Installation/CleanUp/Cleanup.07.00.00.txt rename {.build => Installation}/Project.targets (77%) create mode 100644 Installation/ReleaseNotes/Release.06.03.02.txt create mode 100644 Installation/ReleaseNotes/Release.07.00.00.txt create mode 100644 Properties/AssemblyInfo.cs create mode 100644 Settings.ascx.cs create mode 100644 Settings.ascx.designer.cs delete mode 100644 Settings.ascx.designer.vb delete mode 100644 Settings.ascx.vb create mode 100644 SubControls/EventIcons.ascx.cs create mode 100644 SubControls/EventIcons.ascx.designer.cs delete mode 100644 SubControls/EventIcons.ascx.designer.vb delete mode 100644 SubControls/EventIcons.ascx.vb create mode 100644 SubControls/EventUserGrid.ascx.cs create mode 100644 SubControls/EventUserGrid.ascx.designer.cs delete mode 100644 SubControls/EventUserGrid.ascx.designer.vb delete mode 100644 SubControls/EventUserGrid.ascx.vb create mode 100644 SubControls/SelectCategory.ascx.cs create mode 100644 SubControls/SelectCategory.ascx.designer.cs delete mode 100644 SubControls/SelectCategory.ascx.designer.vb delete mode 100644 SubControls/SelectCategory.ascx.vb create mode 100644 SubControls/SelectLocation.ascx.cs create mode 100644 SubControls/SelectLocation.ascx.designer.cs delete mode 100644 SubControls/SelectLocation.ascx.designer.vb delete mode 100644 SubControls/SelectLocation.ascx.vb diff --git a/.build/Ionic.Zip.Reduced.dll b/.build/Ionic.Zip.Reduced.dll deleted file mode 100644 index 9622cc53ed6f3e6728fe48d34795cfdb7704ed1f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 253440 zcmc${34k0&bvNGI-P1kOv%A{S?9R-tq@9&*t=l_?q+K5?`I3weu)zm5uq$8kEiKsX z^kOg?j}Z6q8DoV&zz8rVm?HraAYcq3+#%dJ<_h*=ju5U82nitv^7s3_S3T2vNOHcw z|1W!|t6p8NUcGwt>ecn69d}xeWmzu%9(~lZ?!%Y=w#o0|fA%4`zj}Ya_5R!!*WcIk z#4oPDWY_Nbv76)QhWM%*$F8~RrkkQ?j$M7-SbWP(W4mt}JM)5z$8Lm*4m|Ehx3nhP?uO)_#dB& z-+bnEw>}g8Pd#Aj#kvCT^uIC7+S!cf<7)s^+<>45&({$*^=}($-Hfk$MudpO)dJ3v z*F($Vosmi=&bvuh{3C9*m9b9QU|S#iLXVXbX!qyBG0WQ5^&Zl-^{IUq-u=bV(g&&+ zyzUEs``*H9?rQ!h`1pgZC-hwN;)BC?#&a+H?=%1L=O3&c`=>uRYHaicpZfX>p1t#t z)-m9_doSRPkjILU;p5y#@-)%{Fn33-7wMoK+h*8&wojN{JkH!`{P&SzxSS( z-1E(2e^t8bOMe+YeDayo@A=B<(;xWkOa9})S5Mpfj`lxZfBC)>o;K=)yKKvwILax9 zyXgSn8$AMW!@s8kfN$~J3`Y?jl`Sin7`4NS`402@R6FF?cG|~)#ca2IG(L#c0u|he zqW~8N07oSNaR9KMfb(s2G#sbaQ*H|kVUi0|C)qJ~$xa-Iu^|D71Ay@aAP&XTn;5qp zml%2z#Z8V?Kx_0^R>2;bKMt_KbD}l)dJ}*%997fsH74BEa3@+P(HJL4;tZQONKAM& zfv@Z2Es5L+7tB2yP6Z4*qM;kxBD|8QMLQsHjrfVv60inLtexip_G9IyE-s`q99~PXdw@DJZxPh z&8SIY@XL4d$|nJ6MJfLiis)(}S~wJO|^1@I`OpyUl;h!p9&=Nz9Q>a z3laFt^A%~|l|1|aTyU5)#s7yis}G&Vu~wu08KLFS{3$|9M-U-1lGfeu(u(113r#<0 z!VlXPpe;$pt|=tz5GtuN#ARXrY@t)NtcV+Wb?5}lT+#`7&^a+_hmiDMv|glzO=b$% zNeKr7IgyAniIL4Yn$rO_J&q9-lNJBTb>i7e(t!ez7iND%Kj@@Eu2i?-a zo}l)m#A^q&?H#uSO(tG9sEsFXBpK8ETCQh`SXbSDF2%^cZBcdpn zyn8jiDf-wgVC3G80mPP3WGPizk2^fk&O&eu^4=VRg%?v!+k@o=poJC$%0S@AxL(8; z)V6BJJ0aLU=v{4xKr#qwO((3u(YM+$fOSp?8U{sowQC^h3fo?IqgIe@aVN4&+Jd+* zX^V{r9>d>h_ygNnwH=@&D-kxN?58H)rg+auyhsPkrV}qjKD@^z-p%4=qexbh;!WeI zeDVYo2-&)v78JN-vf3Ia8bZqjwRKKZ6vvd(JM_GCsj_ht+Od(y#`tEpA$|2 zgL=h|XOYB-uVnii4^SHzxHTW0hYma5jR3nvcX$GVW6<&D___FrFoXp0d+7a8$NOb^ zzt-`7o8IqsyuXA?3ps~*+bw>|^Cz)b$SxOc%l0ABQ~VeI8#4d{q3fXQF6*B?J)K~p zsqE<|z@(E>u+4XQ0A*5#1f7|tdRc^?7YsF_$9PV-1#T2Zl)PvwJb5j7q?z&2neslz z8pnc6wEB>T6CDNe$9WVPuVT5R3`BsImo&hnecQRnFgzK76W?B}PuzBD5Bz%RAADpadczsW_JCIq=# zxw78t#kT+uo~}g`IwH{LEP<8<+Fk;!jtTgAOTc56YgrQVqGcgtCgf$Ekd7>T0E5FS z(q?QQux%3=C)x(g@}=JCKSQ9OmG%p~zFc+t$zXUZSAG2KSs6G=`1=k1IKc4l1pMWy zPo6!C5+99j-GaaA%K+`veNFrd;NabkhUf{mqnP-E@Xuo;2=>?;ltMcNi|JY?9q8~F z(v?lRU!hPf4^({&=|)Vt4|md$!jBabWICBro?D# zlh}83%*&Q%db7Uty3-$j@X<#nRMsr*OP>U}jjVwfI$U46ZN%_}3M$q9j zvUaI`K0$VipN4Oj)vx-*GmsyY56IdJ7(K#xk6a~c-Y?H~hIaXZrc)(h9CbsATnxb{f&nDXkIlG;k-+Ip{n=1>YLWL1YA^j{@< zzG`()(#zrh0T3-F(|;#C6GUqCVno~zaQh3YT8l@0o0Pc(7E*tlya950*;$zsj*|SHC`zpj)W862wz1Fy&1NS=Pei7WG#{DX| zVZzbE-at=aJnx|=Z#*BOr`LEsO;4Zke4Czr8(M-RO>IrT#8~YQn!WUHuzD6`HXS;~S14A)i;+UwX&W5n@DlvKl>xo;FGB+s3x$H;rg$zC2BR0T zNefvSTMC7I!Ocl?7u;d}X8h)4u^>Q2(c* zm_9>?!{uzEju+gDroRvAg;tfr6$gS;X6}+n^I-TilvT_wTrqB-|A6N2K+jH~eQpZc zOrS@np``@6B@ML}Dpo`i0h%KU`*&K(G!kKL3?weXE2;4E z%w6FdknpVpwxP%%0@~~>apYMsNcw~v?{FRqIZAWIoL0UFAuZ~6d;#hZVeT5#kAd6< zROVB&5kyuHLeK?cRQTt16m!#Og29ty7q678vSPBnRI=Glvf5!w>lXTD^sc1P%U4Rh zLZRK%`%|f}>7?HHSjz5XQoA52A8SO0R;e5gU4A!*KBc=i#X_!qhJ|)5 z9;V^9ON6EE{UOlw$n1aUY>OC#*EB~9`H{nQXX!mfjK{H<0WjDF^-YOSc;=`=Z@JJb zJY(n(bM(@&=|sdY_ReE=<`pq$Bi_w$!jW&&{!r*!TC4A)wf3Kp+!2vb zwP7I|Qr#sE(Gpaocjf-n&aPmSv0!-W?Aml86I~9{-BLxzFAf$4eHGY)5Y!?tAq7=% zV&KTfH-ae_z6qp=1&-Wi+-t?t({fy3)#Dh zt{vWiRE<>ySLTjmV(naLUS(o$o_o`-uQwuz5pZ9 zwFm>5t)8{`v4*WT-Df!%^g(C1KWsS|=zEg6Vwz@1hq)ndSuit zMK=QSOtjOQJleUmIp>$|if&>qnt}^CrSOet0AvfAIu_^bD5l`nvyQ0H13h*aAq8b& z&{vztMSs9Np)0~7D61uTx94cJkE4)muX86(vs?T+ZYFvr6OT|@2YV(J96gJ$ z!~@9}Oa!Hl|JHQibLctWBx5mli{;EtJXvAtb!MVHj2JHlx)FqICxyXb)Q)arT(pyX zNl({03G^IhJBei#7Ls{L>|jr6E*Q@HBRli3rdlC z{EHob9;^|8H3C?KD$#S{;4JH_fC}S_HG06>3+V%M{vIUYr zY;E!PQLpemqzY7kv2LUprA7aM40hb+ z3HIn=Ld$mbM=J#{$7k*tiqE7S|1?3H__DrF#dodLY2+1XmmUbl61uE#dEmj-EQ54p z)Z3wgsf~F4V$^$&KfHg8@_C0}**{}k<&LYgALdUK!ZN;!GS-n7C7)mn`B-@^t~Xn9 zs+DUVIFKznfIn(oSskFS0^g%B-Hy^T?2N%}UHQNPUvTUz72Q%XW9LdagQ;}!i#V#C zkt=xnv%~wRrnI!8Zx=8W&2}gi{w0v-2;>~>p*5&cvSH`ZHt39f?&N)iO#O`r?X^7< zI5Y<~B_X`ok-6C-tUF4>jI|TUjiP?5ELzC0$U=?|!WY4vU)>YF7~lE`0_kXAcSfl+ z{}MREm*OX=9V-#J)F|N<6S2Ok8xb>8a^adySu3<*MIbH5xT~z`*p0&2=ON|F$QAj% z95E*}?8;q%Jx7{8dJ~DdD?j!T#Pi3jgCJ!!cg;+%KlTXP@5(jT^!e55l||PZb%^N3sp2b_mq-2xBb(4pH6zv9(uc2r1H1s&9dNC=TG?kO{I7&x zC_h`xU9B9p^Q!>@?nFT4QcbkqBqCoi5meHknn!dp-OjJ(z3RZ#{!T~@j$bFBe3iAe zaVVP~Ma9BbA;CqCdtrJ0kLX$`k9(CV```%l$MQ_z4Nrc3{?!QB!+xo<*tLe&Svl&C zaopoWVncBbN~1DqkIMuc4*=t{OjOibk2;rv5=?zi6m+l;%K3$x`zrI$vS9jy9`RZ@ z>N|4b$0$i4LdMox{=Q~0hPChJepgx|H~%_B+9NDk4K@$Q=Si5hZg>~MOpLMrM4{QS zadhh)GvVtIP?H+@TW)*w(MLVeQBaK4KWN>|dSH|Xw+9pV$A66+=idPLKCqD+|CY6R zBfUH6&1VzuRq#$&d5m9m6vcmun$x}-L0A>%Ma;zs71I0nTij9}O+dZS>~f1f2G0s$0fUcpY;UmiSD1oai&C9U6e+ z#29d6n`?N7{K%O_cylvt`A)n%)9Ar!0W)EwyHS8CJ%c!c7IZPGRic=QM-;OpDJWB!<>wrW29!pUR+=Z3YI$6~C%y*z2O+=pIIXzCHFM2P?VIWx>Z4 zfS^-Cr{(TPOgVH9f@5t)-H&43o%z25MFKDSCO(x*^PY}*?duVD{w+w}oAp}sM1KO0 z=+C4bbRO&IBc=B$GJdviKyp`eDe1?IqvL=w5Kw*+sAr)2^;o}%E+$OH8e*2vB8f&X z1&KqYM>UwK%z$4U)cFk5ng0@kwn*0cq-}?ajDD9OV+%5NOOWwsj`#MEi<#E&;YG;v z7~w-{r|=ts85?l^t)Mv;C>5LNUijLWxwwlVa{{SoFe`-RN!D_CZJBmCl<9$r^obbX z4ZsEKyVXEj@97A}wjO>;`bpX;@!2gTL+drU0NgmXl&@7Z$ltF){(c5wAj2+4$q1A2 zhrN0}-psav9tfJ83jqje_FYy!)83oHX%d29ob;&scg{0_wL zLz4KDO!qbvxCg?Fc|{9IIRAE{fX)nT-a#j3R49wTl1ubX0M+kBf7)?ZqCe}n%h9{w zHnq$nbIn4EAZ~v2ZiKg6k}+%4SZ9xMTb`2T`GhAl0^-VF9>%T7fQ)9D$sZ^WcrsrSxwxT4dTj{GGeS6zGo1iDK>C+P!ao?n_&qjgi*%uPuoS(QVOo}BjRCh~(Y9`oacA;1Ea!XS_mKjFGlp2_j@=tw&!7A; z=1LjswWc0+>v_lx4cM1ML%a{!LEhgA5E$x&F6gmfZ?_hqAH5%$wS}YX);`u!%Su&Z z5j=u&k9wBdEFCy{*5`m@D1BKF^5#E4^fK;jfEsObJZu^s$Yb;n!uA@%W>+Ar?@c|) zZm}Db<~BdhZao(+3^xjz!a$-F^$iM#u81O6Yjjd1O|T@%(x&sJ(zHcV-jjz|FVjx_ zXeU4XAsVXJ%cdIYN7}Bgh0b6dCv*@#HFTh*Y(HBFV_mSvEo~f#-vn>`F2bZoWeEF+ z#V~Mzo0-{|kAKN%;1&=RJ&6=ia!lGKjL)Q%LTB@SW^SY7??x>4e=xdCFsWmC;Xjfg zH%Rg<#&2em75=&qI0Jv^18lp-ahh3a4r9pr03~0JgnLTT*N`#k??oRZ0~kq(jTQt( z_W@S&OIY?~5Ah{$Zl$Vq@?OlSEt04_^}C_bjl@)G1g#~b{5u2QJK6zt_Ms#NWx@{u zInaT9DKpdNXCf20s05w$tJ#_9!nCHedF|rFSxM|=X9GVwLqWxSOVV+b;s#P3i0;-> zNagB)AvdGnJ3GlXgvAG@Y!?}d+`G&p? z-sK>;As^lkx`!XePxKM|1m5W7qch=O!5O~~9HJ9EPICfd=nwxI?gifuKZfr^##Y&9 zO>N^ABg?w=smHH=*$rnMeJ33E+QYBFfZwy>E8oF#eE4xBXzxd<_WTcAY`6JCI=ePp zTQ+_-fZP19LAk(&4EQRUR8=xN`fosuUg=nWjIx@D>$ISjx`9*e)v@gX_?#Ah^O8;P z;%u@e8$Wy=wsehWecF`%6B%Rfo!{@YKnNFhA7j^Pp6IkNl)0lm$^ zftWic;wuS#8|b&kRj~rqX^jJ|Df|!Me$@k9E%`0U<7W?u_T)}}SM7#RPUU@m?@D=J zP3V%m*CFp-94+aVaKMyca{rFbjU3JmI7h(#z4xMgOi(d2d;WgGM&jxQ-^rgqU^*E0 zz`gR%ZjmPF5`Tz~@x0oJz6Hj3qk7Bc^Xeq@ftjTtW0@CbvpdQO9Li)jw~9$ues#5S z?E{)I?AD3a_Zk-Kw82Ky`d*6<+sw5t1$L9tW`vNmQ@>D*4^PviYcpePg`Z`l0 zNX({j{h9sR)|ts))NBVMjTD`U{){CzjDr{rLb%8(o?N9dy*@vvy{0oLzu zpR4WGU5MZ4w_C5rw>kjR9nzL2&aj8(+MfmpvifuQpqYh^!}gLrhp3$$a(}qkA#`*4 zhJG$Xz7EN5e-`9KD&%Pl2}49*5`w80bT7AF@Zy&tj&983PK7*9LNJB!x&~!U)0U8_6+%A95Rn;T{Oaa5?!~{7 zFvvXj_IOdWubixQ$bEs5}j<(Z;7(5zkEN?G>ecS%G6b;yqN-vL+~ z%N!OGKJlyro@E`+eh{6Abx*MdEP_<@yVn97qEU6I2g-5B_0@*y$v+b?(e$BI78e4lLXlu zi`0jU^6n!?VS^tb7bug5kJ80KkuxZ+3^svnat#Xhg?)rc+J7RT4Xuap#jbjO4vX5# z1orXV_Odp$ru*?DGCu_!7sO=CcBOai9QLj()fD8j{-!g=is;m zj@pO`*EQ%_M8cZChDoku#P$dAV-Q1Krq(i~yrGzFe}w_r_E#mm+@?@RJaR;7^Ld^0 zLpL=m0F(LPWEFLU!TBScMyJpQIuKftFnS5lA|2pQ7tW%}Q$=hLZV?@<0M80uwNrrZ zG}2U>fpHB_g-jlCv^1dbQn+CRHHok$7qmZ*Y)}Zv4Gns#1~+l3uVxtxtX5_uQVlI& zAOi{!?3T1s)A4JW5Rx`9GPn|*CkV92{-w=NLH>08KQ}%Ht=cLSoisiH1s^jl3@AOe zo=L&Dp3_WTJv!lW(E!s$(UwKy8FSr3 zv9{mJf|O%9a|9LLXaFM@P0S3#J`cO~Hb!dQi(e-kCJG3ouM-IKE+cmWnE-(RGg>;3 zH2M+=gnuX(W**ns`yHl*-o<5St-^B!^g@89{JjeZ9_VowMU%rF!SZN!W>GXp2(mny zLs~&64cbz-ReEl=E!eKoGqXw>#a-#wdM6NRtg>5dSvkaGnwb5aG@%!(El$$(37qK! zPDes*#OKJ!bd-e?S0Ei7cC{foK`P##nRt{mK$>$ykVf`>m?q1k$uKE-+-gip&O`g| z(K9Tt6Ft}k4Teud<6%O;d_3KO)C2ur8l5@V(Im906abK~k@Hlvr2?WVBO1Oz4IU(B zci1iREjKSViwPo#^mPDHIf;X~^s?5B%P+MXe%Y&pN_3?1{+0>lsVfy>${ketYl0yEHosT>rpNU#A25o{O>XN!$cc#K$3 zSd$(U^Poq@dSZf0$jM1*ZYnt1K&%Pln%!m`zc{_)utUo2XY5D;nEn|%E}h-M{6B2U z;XI3rh8%n_QRG|^pnG!JqTrcj9?=BK&l;7&XwDwWQxGcsXcKJ6obG(EdI(- zIw?x|XLt(Tk)xkWu@Y2to|2gf^0+A6)vD!px)!7LK!DEh}q_Tm8GCka3t z0Q@uohyyafrfo=Mz+m7sTwHvB8*R>{5Y5?oLc7-Is7rPtU>D+_Q}TP5@|Ok&!;69L z#Dr6}6Q^BqI?j=a|;=fwoYZL;JLSWmenKDVj6X|z&ixG7%$q7fC$r&AC|Lb zY8`+X0>2BOmtiWq{XIs&qKf6LJ^9`IGphLEd>kLHLCogs~b?18PNY zwbvaO0jv|~ulBox1%Ss9m|dM!;JwJ#*KLbgU#|^-Ax5?ti$Dhg9OeM}4AQkJ%om1w z;{}xMi)o-Qmz_tS#rm=*!>EilShHnwiB1Wln(hzzly&p*Jwvym4xfO4WJgqC-c=&8 zJ#2%>cLB-4G0B1q|82wF0EhxmgREGU#d2*dcBNQ&m!tsf_ zQc#RsDIYdGJ*kuTvuqJ+oQdZ3zK8I$=yi7ZxA>h{NF}Rd?Xy!(^lOly4zqn1l0}}V zFnE!h**KPb5_aLOB6k=IEq_O<9XbgC|0vb#}NW=!ssm#Ow23KZ7ql7k~{;`B_u^U+QC(L;>4YRAqE@Xrkz4~rDzPpPD&rJi5 zUctlDZGfkPav0F(@ZnBR8Fd;s3ln}GkntLXeTQb;zt-^x7xa0$BQalFZ^xhQ7Q_SC zIv(6p=#$d8noGKE{S~?nxEuG5z}jhGn4($OiyX!PdRx$zmM^Q5gL&*%9>j*@Y^jiy zjq)RUfCNWXhP>FT!17M~d1f&eegUpR)|0R8mBU++TOn5;K+tIjf>9(F;v|HZtDmO0 zVM9Fz4%|i4G-H<#0V;Npxd;^xX-?cMT^&=ateZ?pc66W zX>INW*_=TNVAm#ElCJtXuRh|}v6gci&@haU%Qm3gupc}$VQoJiw7|dX@izf}xf6dV zj|Yo!pi1GeYFh{JHx57laUPG^pLH_$2lJQ@qoC&5w&=1IOeVxJjFSbew;-g_ti=-` zV|*`uQVR`^n(yyIaYEtwr->X(rU960EX}Z~QtFlvO$idd8JT+#bWpDy!>It3bP<{x zdI;C3-UK{P0iM|76`qQw!TnG!K&&pSw+4UP@K?Lmj(-LOwL4)KfO}6?xC#SXylprM z=*uNcmrM7w@`P8~T!`;NJl&$I;~e_oO(@bdMX@rmECzQYO<#k}sB=!E6hDacDIG`c z`xB~z{1Ql>YU;re8=K1(iSuwZfTBoX*^FZWW*;&JU@Q=t_8n5|n*A?KSfrX0;w>)P1$0gLy-F{@*dI zz%hS4zk|vf=O7(AcVQ6R^i`xRPYr;b!7;eU>L55Ms7+`9xmscj&q`tg zu}qJ#g#A zFOY5)`l3bUWg2r=oQTLFuz8C=*58SA9pE?O4;w$M>DNl6^*125QGd+Fx4Fw78^c#` zR=Nz~*W#}hqnup`z1r8q8CTbK#y6v4LG7maS@OL;-YefL;up*Jsqt&&dw%>*`JNqr zM!u)T-;?i&CVn$MDE{$yU=8ydjmP9$igAk~Bo=GlUH)V{lRobRQfH*-gZU5WQ|;e$ zynhx2%Ow7wBUt|E>{&j(qxc)g-}&aRX}*|~TD2$o)nfA`zj}3ZYi(P6z7&6cyhFZc z$GhZvT70W~PmFJuZ!>pV?lC6@!tTn*;l@Hgl*ZT9x%z5LoGnaE&M$Hh(@be!n#k6Ov5RU&)cLPTcB zd?;^Yi}?`>Y1=kjPWAj#j1Aie)EwT zEmpMqRtED7_6%y0>rATEk0my)JdLZbGnX75K z0q{ZI8<`3G@c9U@pR4fhwg6vu3T*O|?E&NQUx7$^NGX-+(j5V%iK;mOsF8F7%`-tW z7;m^6pfus-W^l2NYvWix*ZST49Y;c#_Pa^$4!Gm!gwwKZA11*2sL4{j*pq&hk!zN6(5}P5CCQo-I#e|^~MtyucZ ziqHfnYQewDO6v0d?>5K#h@&i+-Z<2RxS;>Wp($SRhN+F)sb9yDw01Gm0d*XmFdR=b zil;DoirvU&+7RibYDfvlDO~`?LFDtm{OBXJQESo{AW-apOYMbqEb(wXn$g*%ph3zy zaDW*zB+)Ya;@15biM4#J-EMmUecirT^vgIyiQ8yO#bEj(gcY#&znB)Hi)N#^&BiU$zB%JZuO%7P?d+SIEy4p(m1(TQK@s)xkrMC089}Cp>HiTta3;>=mI)IgqD$ z0^J3OD)86G$1Ecfr5#N<1(27+(Y#02!^_V5g`eH=9~ss zbFv|h;i=1X)*%{1vDY3fn6~Na5SU<5m59ED!K50@qPywNhZNZCWgO28*pGF32`e+Rg*6!l1-C3ZO#^ko#2V-A zO4VL-+8r#kCa#V`!IOcoyHilrH0~6T9dF471+E+4iG0ptJ`qiT*jKj(pS&Ga@adIR zo4%axVawUFdoAb7tkJ7OB^r#*rr{2@kMM<{YAze@!-u!m<#JsiAU1G6CzH9HsfoEX zAQ$3tS|Nzfrf*#iCg$VkRFGqEKY$tHz#k2_}V& zLbe*5Fo2tFnr%9pPn!N?c_)QC*$RSS~Qb~5Xl>*BvdjEu~yl6W$g zyBJJ~9S3d*ITEzr0wfeqvEY@Pu<8?5X&x0{Uqu%d-yw1_nFNx7H?|!e80A*Scn;%P zmesSoT*uvC#{LI)|8Ub8s`UyjYMC)MXx=YvEX5x~V%2(O3DVTc_9aTw8LstIHuMU? zbe9=s3!rgQoeipo=0pt@thfWAduGG2z-Ziu0J{DfXFNtXu8Dt*67AN1z?TwKN~9Jn zNsyDj;c1X>f?AZg^o-85`GHR|nQil8Gf}gbp!Z=U5O`v9!V;S z4ke7UC_q?dr2tk;QY7`!N>)0Rd

4Z)dERWh|aoDva@FY|(*m=Ew6Piu2VA4;aUJ z#!)ukiusy#m`6bqT$-bi(`z%lRYy;K;DMh(5|k%EcJT>X>8 z{PPuJ3apc7Vj}D;?F{*q*@R%%7#fs1wBWRSY0(1fWSA7KP=NJjqBMAJ3|<;9itAvckHh9ly((;lPgU0pj0yvu6p4y6*D>MzW%W z34pfP$B|-jj=CGjSWji@xj4!)^ zaKSqL7GYA%7lHyL16JD6w{g7KpUGo_JY-9=Gqs+k#&;&~c(}9iZbZ{@#9-v0zr5{Rs3lKg2U|W0&~%L zaHozfXr$osppssJ;OF#O39Qcl5Va# zF&w*j!M0&FSfqqw@kJ3%<9c0xPNf=HJ#d6nx_q5Vg1f+vki-yTu$cFvp8%!O=J`^w zw^Zye75i#KgetBnp~2ZuRSM~WMuMWEDV__o3J)#oExwdSBZXxq`lc8Y%%{K^k}`j!oyW& zCZkQMjD{!2l8l;DL*0x5vj~{4*_cg2c+xiT9?WGhK}Fr}M1O`bIoAyLXE~_#x%j&s ze;NEuzXU&ef}swv`aV=ystPlv?i4q$=L6F=M`;6Yf0Az5OYX^ipA#mNqtls`?7f&S zU{WUecJmOZWFan-L&}{Ox0;e(Kq6ra2usIytAB#Geone*G!^szpW~11s9j7iPOkt}Q5vre^Lae^U zc%B0+u}NocDqNgFd8%xO>q*vkLC;2bw}23)FR#81oJfbp($%482yw&B0+n+y13FzA z#j2J;5B(!!^@H_c=P5XHPadurYv3;Ad0@iHGX#Uz{wxsY-Gs@0?3^qZV?t;g=NZSa z`Hmb&HlM1BvNo-vOyT)7wgz<3noGS=RcO^kI4|VPj;qXOYUfs)*xoHAnlTn*X2&mM zs7@>wY4LiJ1&j0>WVN$;@XB3nPW*64NFn8&3b0%3ywT5rk*>YbHB~gRWN|Kusq6k3 zw|dRgrX=5gH~A+1q#T^`+d|3@hA;Tfbyu_$pqL zD9m1J-w)KWk^5CBB1t9l(>FUnc<-TFFQu`!^f zjFC`!&Bo~D&tw*x6fZMS26L9M2*~nvrnwjlxS1s^fp=yJ30!8NOY_!g>9V{PygY9M zUy^rs+NxzOp0<{bG)py!I{58>UR zXbvZw{L+q_!&CSgiU}DL0<5}7)@zbcq5;LD_1#X!Q6IY>hmXa{FwZAOYn#Z9qr`A| zST0!)OQzv0zdvUF-!4z8p#VWjLB9k@?~zxqNPDVKIuf&~=KlphZDxQGle4VyRMn8DiA#gtg8;ph z=}jm)*)7NOnV1*JKid&;sONN?h(kq)B{=Nwm+f)7uf~zJOI=NNWDP(K|9b0_3CIGp?FsbWVqs;WWWkx7gii5)prES6%#=k!fZ4F=WGSu4I*UH+7s;V_UNKtJ4!Ch#(w|1Q8KPD zkA99Uvf*n{-??eO)8y>NWO${75=hhpoH0sLw* zFDkI~e(#o9%;D>X8y_tcM{Etnr6o_DVYC)VaE!fUFFa2j@IijT;fd z^GSS5gPX+XkYTF-t(12S>(^wdHB+Z)kw@smE9J2;F}?s339~6rjSlx_M|SpNSEhFD ztaR;*oD1~<1>Dsvv>CAqHOspRw6U!Ft^Uti4&9vpduj9X*(UYY~;l7Vo{V-3X>FPy4KHqflK3*>Z!tim>o4WD2(XMOn+5LERGFReE`8 zZW}ZrG%d$)cwQ_XQgf{+;%wk8R{>bUc1V>zSj)@Ta1w>S)IkmKE~g7}@i91FXA55k zf|!*<FFRnC=iG0c~ZR1ViFR~A&Y`u%ar>~Iir}zza@vE+0Qu30Oqa+ux zd73cNURCcELlJB=@Rfr*%JPz6(WOZo>iR2%9kSe|+WCr!txmZx_+Pw)=veF8jBPIwy6 z-a=kvLlZBp6?#Wzz$&#<@n!{t$6~&EjGgiU@Ef);jm{SQ+0(DaE}@P#2os13+-;b1 zS}Jq5yqiv)GQd1qzf#w&U^19=+fAV84 zR$REC(2oOI{SlZrcnE_vXA&j_e9IGXS6q^V3V1}LY)c;8NwnK-P^xgMf%c-UJc5La zcDu{1vZ6L>rdg|SL!IuceGiZ*;dwjHn5@OlulwcHn!PNnnxEbBk+;!-f0)d$O^0sU2ocMy;ex4=%rSJ+LEbh3 z!Kkhoc zP-X-d^=IsU_d-|Z1Q*rv{cb-FvTO)0@-FK4`ZIXSgj0iyX#4jp9Ei4Nk(c(+(QQM* zm$Vpe3Fy?tMm)$2!(;R4q%QQI#_8Ci@YDXd3n?H*;}#8u_R0)R+!8{{^G^c`(P}si zbO_GU<~7F0)Tw~za>O?N!9zu4Ky+z0BJ;rQ@zE}TaKsS@REb1+9=pr1Syt<%rQ)W? zt~bJFCocgI*XSStFyYdWhTSIHOk_iob!nPx21Cf|tOjllaIzB5zhV;=&sgq!zmS%;Z&AN^WTNuiIj&u<&Ss4I}=Lk$7kBOowBPRtEl8F zGa^cd@!XkQrz4M~-wWD2j9mgoDAljxgX(|8Rug?2ET3ZU6mOgQs;T#oZ0py1VG*HN z7W>S@?*eO;`J|REnA#3@;!9yp_*RzbgsPjr24qxQ4AK(67m=f3&E^T z6eRER)CqR{wPTZWtMa6iP7V2_6W%5*Be%|V2W5kNZ3`yz;Wl7i+lcx5<_^we0bE${ zX3|>E#iOdVJnkpNYg5xBAi#o^-SS23)t}fd^Gu67!z|2`EF4R*NE6P-PeenpVseUW z;(qurX1IEyNV|=iWJ-EfR7vhuv~`C%Wi98a&q98eQVxkWBj*-5_c0TCToL7gO|@@v zPL3x=R$+Q{H=^LfE|S=iwqdSf;nIMA=S-5}^KSu7^2s3%KO6lC{9VOje3^ASTZMRl zn$f)g{6KAu9ljb=8kevSBdmLoI20=uljUv9|Aj*P99C(Md{28iYb7V zL5pqRSYH4x{n7@PqpmnEx+cVw_Hx9;Jt}{Nj2dU@0l!u;$Ovt7n95~N4_kP0 zwpO$T*xAm(Rl~eVAXD&hl>nSYFAKApzE2V0*nlUEi)%fRpKoU)7z5BjsdJ=_akRzF zZF*mamACZ(v+4k@BG9Wi7jLD&qj)fL!?^cM@Xff1a($|G8nci`c&Chfm9)j?e7v1J z@IJuyAb51d1gqAwG`Koo!d0Uhoz){X&oI0&n<}j`b)Fu^gwX30+bzMtE8vQX5pCo$Icj z=5+m(S!o{FL-}~zKdMddnx@aN>CK~W-KNL87I+!3)ASscQcaH=32~qG+@|;H8^n)C zed?@F>mLyBu$Vi>(6K6uplhaaV`IRj($~{hCZy4)j8+2=W}yNDoat zXYbDt)sB7xKi-l34}9upW_c%nP^SD1_?AQv{+9lkApSE>%zf&ryhI0QuX_ZytqC>7j951;b67Yi0|xv1ogSv zl>4?$eV{WQjSIf)@X096tv|(yh(}*-Iu|J(Ee1C>XYlHS-fa|uy8^jbFpu{&q;bY^ zddeGAr+HiYV+(k*GP-Y3I4Qnngrq0%5}OM5b-#!o7aWR>oFt~-5Rz6gF_~~ z=zoC(_hj9Ry!g*aJ&u6+{m+qY#5GvBe?~WV9>Lv@wu??v_W<3Tg#bQC_v6&<(ES8; z^MwdG`3}t%rU*CU1{%a)O*r?|0A3<|jk?QpuY((x+#N+w_%-o_mmqckrz(`&BGc4 z8I~|t8t*R?OW}Nx;*e5!hD*8w@*@wn@D&~mpMo+qfLGClbWa)r_bj0-bXqoqH?f1yw#;K=sT}gmluO~)iFItZ2GD}IMiAGw@N%mH zd^oDK79ZNDd<#{wZU9XTuaB8Are^|&t?GVU#uqQaoQjVV^&$_fb7G87Nnn+Wb)0W@ zadBXOrnLD~eYU8#KhuYYmg4h}HtIuCyxxreqkcGh<;CXGrtdn*7SsTjZBtC6fYPQu zSL&kM9B)mA!Ss6}Fhz7I3U`O1`Zxeg6CD!5-65e;1BMdNCRznN8iO>Oz~?JDeIciU zprljcZ+$yj*9mt5w<6xo+`{Q^!Ij$^YE4|e5Zr|+iOT$A`LuWegARxE@fw!+;TGAb zS3Gco4Nf?J&P0E*6Jm6ey9v41xVN?iTa0_}l3n7DV*vJ%J%XHYXJK~Ca-kdGq49$6 zW@vCM&qxc87x2CzwlHI*06G6PTE`4LJ~*~C7=9D!Wi1z)gS88o^LEE_@BA^~ngCmS zA4WJXm%t0;NOviIv0?h<_!PbAHaG)wCNM|P=PS^khCX89N;U$qZ%{~wagY?0tJ1eL z5uOw6zTnEI*(mk8_0WxB54~9vXt*43HIc*}fm4H=%)$WXWUQ0+kyKg+BxyTtla{k4 zq~)iR_L5q+Tm~d*J8n%YyIfEeRKV+`{X#db1jxHbCX%>K+7plnV1Ak>v%V*~@fr0_ zxe_23RGCQPmbA5AP?KuJ)_V`a8U&xbZ~-a?4}tg+@@x%BU0vr#$D@q~^V!CFr;anl z=+!|n6W@&@VQ$*a#>rs59Nmmq3q_ARK$t)jJvtuBPHcZ7^#r-U&bkW4VSkG%C4dpm zvG7j7KC}ex0sc>b{R)3YxcQGdVudA`3mm| zlRFcI7nSY$YDedU<1igL5hQL5W}}nvt@mbSkC+qP0H4v~zP1o_wYao?R1RdT50#D{ zAZx?Yw(;~tC(Bu9oTqMvJZ;u;s76sgn*q8QVG8p{0c~7=^%2n64u66Ih0gjclieDG zq>z!SfoGh4#yASvj#Nn;=rL{`FH@~;FqppEUqEEiaRL+PsS=02rE$FYPKJfR)4P2& zh@VRD#UGP&5ca97{IT08kZ;Ar1hx zCjfB(098_Bhywt&y1d3fM>4De&cR1&APxXH0trAIC)zFO!0w>lIdZNUqva}d8I^bs zIaFahcL8mT4y;!>Z91_1AI&}ib72j>?(O+}J)sWBidXBm85h_w0t}>l985ta1);P_ z1|5Y$#KHdja3A?opiLe>JMP;HMpmm4Hj#-3I=jgIV zU+t*Xj<5z^KnE@`0j}25bM>5NmR}e{4B?Znflr(?pOogmhdwmH^CrqGXIdNQX+{-Z zIgW@E-)F#&zr)}ga$M`JHL^Ml_9C!2t{v<}ae{a*zfkwove!XtO;+c4pI^Yeyk1s0 zw}X-5GiGg>RoQ`-lt#c20BIlG_sNG&(&PuN=@nXw0|03k5?>r6dmD@ZIC(@OiUWXA z0$ziNbU3i#tA(Lah_6SVO&b=lGty~;o-mB@moGwuMRJa6`h598{m7LOSlk)>5)Eh%;8<7B=i|?1TH!(lt zn|v`>awlSE1g{=H3-RLjGV@Us<_lYnd*CrU+n&`hS%1mYy9^K(p{8e?$tvv|}2X!@=kVLD?)Q*8# zKuE7Dx!JDnhRYlL=#SASYIy5Q+5YdKkYE-7uMFDAj0#EPor^6V3#oA(Qv=osdrD=D zowqjsNpg4YRo0FVC+>oE-`{q}{aZnRn@Epxn*tM0yHLQwSLH{agBqg~&t;DD+clDE z=h}Nbpl!;2y!`KUnOJjKUG7MGr5ywibIMP-Cn~D7UJ<<&?8jx;!UhEHk|K&N0XwoU2 z{l>BWzu*(M!zasIf%5+U2R_Lxq6rKx2`4Yda5@myAT5}fmy`-J4i~JjI)k=b*a_o?FgoC7f;FH$rdW7e``A)QNm z0y<&>6_$j z$DKd^FxiQW*tj&GV+=0yCmt@T)W5kj?a`Vxgm67%B@E50OVi@aG-*J4cQ-BTs_Pf? zLa!4Sw~wRkLnzt@t+l*;mZp>TIYK((hTRTmA1#mPxdpd+f*YnX=)uJ8ka0mAtw$2q zwYUztDBq;rRmYZtTXuL3snA%QTKVnlrRh(0aP^g-2Hxm2J0COi@Di5^wD5r1`Tx3oIZ%Ea!iAg%yyAWGdO^KK4E4K)3rWdyb?6~YJgrY4#;pJ_yG@Z1? zVbl4t4)&~6dAv=6ZIQ091IzLJ$w}p)E~h&V1}O?Tj`{3&i}Fh7kAC;K!z8y`nhEoG z{L(y5%3!V}C_#hShFoyAH1T2)PYJ#PP9{_G5PI5Tyl@Il7>1nkd871`Y`&QmRC|n@_U`CJAAEQY5Qh%O!g1N*CQ!^< zJd`Z>e)utHCl4iKit0#1R(-qWqX-M@g5_`rIvSQb-Eb8g9RPGV&w{y~>w{)}Ex-sh z!NQ#I0z}0TITc3`Bx*)2W~R4e{9K(8ds(knzuYXyU60Xt%_|Vp!?&zT@w?%_r{I<2 z`_xg1Kc|l2_(64y#E+;$o)FV)s*UR7=V9>(`22Lhw~2lYeR|97sE8@&=SXA9!EHs@ z%!4kChqe52mg^OGv}$!W-a3ibsW89CPFTN^jivw>Lo&R>*$8uS@Af-^D7+(CdFMI_ z6-=@bbOuk2?|I~^%?$Njk8DTFiR(ne( zj!KJ0F9?Vng01i4+DZTFOxmKTakjpSm0n8zT!Ouj*fWbt*H2AD zuDab%LU#(LLPajvqrpkOlc~ahslpdfjPxB-1K6Hj>(yun;DYGW~U-2M*JZHnF`V+80QftEH-}#6`*{8anvpM)hdkIT!S@sY*DI?;kzTd zgE{AL4;apuZhC)i%YG0MvX4XNL1HL6}K;%bTZv512!C~itN_k`Cn zXdt!SM+mpDnGYl!X}TA`ZVC&afm-#@i?}d>AB|V1$4d)f7CH)>!Ysn9=Nd| zFKIth{k&KGW^%gN^GnqMrGh_d?u;E0 z2Dt_s;O5*ucsAr4cXR$#iGIs6TI3>}z$j{uFn;A!JG>rEY>GeHj(&jz$zY(kycoDB zTyarM#|)*AlvW5W(6IC!~zcifj+Cz4efD|L5Sbiz$W$ICCL}OalIEq zNvd}s?6>YcsmEC*Ll4|rdz>em{&Nawy|3GUu>Xbn;2@-#JR#(HbKBmFW~m-8Y>mtQ zOFYYg8D21+?J|9}&V`&aK};h^vN@GDTq)00aN}hH2vPvb6_GTI0U=kPo7LX4s2GEi zqT|ou3ES6n$}!#jknuC#T(h2f@*uWPOs<7rxl1P*D)Xl*YnF;ok+d8QZy?)J4ndc& zo(DQsgic^+4kum-=SY-TUTMEq-am#_G7C>g;g0&voBTsWwIePMY1$Wn(72{1`Xx9B z%UGpwHw%=0qW0bAi=42<#@cX8y$hk8SgmN{nM3p-y_F(i4{stnq3b*qD>$mVe*!xQ zgg3}4_05*>497_z!auy*oR4>ah^l`;3ym<_3>q1nS6jG7wshn>3PG<^pU&!XR;I=i zST`VQqMP|SKibKDVb-f2S-f7AUbMyb55v?R_V&Zp35$;n>-I61C2LX*>(sfV4g=P% zTa!A#-Ad}<@GVU1g+i}kob;MhC|l*6C;hJ3I-$Al*+%I_PCQ zHAF=NMo0O^XPpEYCMs&tZb4Vz6Tue%mPF=w*uXq-o8(5#A9vZR0{&Je<(%N**F$N9 zO@96IINwO(q{Od`|C1;VX<6Jqu{hBKc>Tu$ihyZUOx85k!;Xuinqs`h{Rx-gYAI<= zykk)gPemB+Nn;(Odyq~iT#aef?{g)IV1U>UgjteTUyWTqQ0H)W)#^a5PcA|9!m9de-3As~DW zLb21O(VhUxx z2+HIUnpesU@;npSNS9b((56QoIS*fhGO@#R0lC-8$gi-onJ4xC{>fPXcd1(-p5tyFeTlM&|CGdaTna_YKKitLg|C#XYTMTmv7!~; zMDh-{i9lBt4Oo5aROa#B%sI{423e zm%TRukF==v|9jrd8d=Nv&^IeOok?%Ws0lmn*KL6*RCvR8P zslDpdsZ*z_PTBG5h$D9gD53bt#=D3@?~+Tw{r(tZK`u>1Ywm-kau9+yU3!`tL>{waG#Rz+}a z$_7l-cE!2~>RnX$ew6O7sW6hKrz>l#ICMivQ-95oJIMQmHU|vp$gf)naQGe(71yyi z>a&eJqN6@WXH(^)@#^4~TfA1t=i(cVez@_r*3H1y36cE7*LjJJiGk?sqnGGO9RJuD zZ~eqzE|GWx08CIdke8fj>4dep zI6#Lw5{oXxDoJsSyI6gInPC;0h1-s~>j}cV9XBfE?U-qyEjJ$=6Ez8kyYur!T!sSW z$5Yb+P4>jtzdcpG8koB#u`}zQMh!aV(XIScd*WTXSgI_YeLYIKI_MmBj#IV&?FXG% zlcHrUyveF4*08RNABrUBHxk}Po-4>sYp*d5dyCaJ(w&X{jkah3G@>1d# zh_8NBDA#=(Dr0Llxb9n>4OTnhTo(uPR|j2X_A$BBTRo9ff-Z*y1hzi?Jbk)hd7rv) z%P^*G{wq{4Xt&EK^WP7stX1JK$}#^KM`NH9A4xj%F zAd|Ja5WkBplyEVCN-O2^B=|PFzY_b_*$IJa%`w{5c&(i+yUKG_05fR zM)8^5taJpsi*!=ew>Baconu7|E{0>3bh zvVr)C<7nkzMaAZK0ByFY4f42(ZzTI}-OkC6t|R`J37M)2XpP?z6wl+2k26kHUqz6@ znqbZ7p~0FJrF4%aKSY7m%7rzl>Xiyz2nwScg2GB~z%GGDG-4FMOvpflndKQcj>MX> zL(cA?Bj~o_TRnqeTIdOS#?~0^54s)sGU6Zf?0z_vDunjxc@S1llB-C8yMp5UW5_C4 z=QNxISA{HRJ3x`(^ zUOmo>_R{z~>Qhe6Uv3?ugzO+>N1TZDb)gqM0@>ol4`li)j0U4&(0ffVT0NOW3VlHz zT*pJmYWG%KUb%Vh0YRT`apkMX4)cYvN*Ih)A0sQ8Ni+cl{Wh-weJs$iAKcs%j6EGb za#dkG7^eW^Q33k&{A0d4$Ip=|`Z{Rey;aE!1Oq{@-E|BG=9g4aIITSPBkmvD9Yrau zr6iWdDT+5ySqLVoXM=oCyF$6GBTAJhYcD2o1e?LeFj#v{u(24dtNt?)OjL%u7x&{@ z+xY3#pLLUIAJS_qn@E2>j@@Yr6+?)Dn02c zO&<*4iYCJOuaYq2QPV}##HH1?B*>K6%gGl8hps}vWK2(?R4fc}Ty-!gg+VD2ffR;< zA+1@pJQIAVdKF0pLu20}qd_tnY-HPVZZ%%0-F&i}8b(XmVtEJo-5eIsRc}m8=+?x`WjsH+>U{Da_XWm@l%(&_1fq`l1#7 z>U1J;1MsJ@m)W|0c`k5dwTYLkfS(Q=&LietTMlXOq(9rrrwNO= zUT}MOCHdHhZ=XMfzU_B|0ugJNxd!#Uc0;(}ukq(=_(r>#>E0}UeMx={%TYJsSR&sL z0vWesEnea4V85-AyTkH%AY;>=a_(_%iN=0rPdDM|D9(Kd!;y@z{A{HVxr)wpR??j^ zG;xlX9C1$Lo!E2o6EJiM1|kdY?nuu-d$P-$zmm#yt*RXAE+erT`&N(cgjU!Ha<6T0 z0TbGm@A6X3^v7hsoyO#D@GVS0yU9ySCUn!j3|p*{0JS|9;SWT} zRG&cj7J0ngVdqAoyB_^A)hBt{Yi9f%KlzT0{Ef_1DZT8R%FdUuzRN5TNIY8R|2TD7oi6Tz?<`s#@X>XX0*Otkav|Zi) zrv-OucP55g(x$tjaxY8!fCW#xLj+DVwxZy1+8gfGEcbB-PJ8Wv8ilc4Wtxeb<-04I zC2I4|MEO2(`d;Ftq(7|wtg-x0wPoxX9TCGS-=p~|Pw{%{@5{;Mk|UayzGl!@NXqIc(oG{8pPFmq=W6 zkrS11%|>aB^zVKjgXCOf7+&H~{8{}*b>N!u+zG0I<^X*oN>OPy^^No23sz?q$jJu^Suv_7F>txIy? zLbqqb4TaVGu3P=N=qoANZDLkm7XDq9ihnv+Q63 z46?h~WflOi$qrx^0C30-V3zn8JbkA*4b;(_M1f~QY;F~0xS_5$D#BfDrW>T)>9Q#l z*a<4cJ3+P+kl_`JOBiZ^&!k(%v=dZ-A1pY2Fk5|+CLgKt4})0ytSr0QT4iFMJ<_8_ zL5yujA`oMzP0f@9?7R_~@im=6rlo5Uxe+oa)D0%fd%==IKHWQB4Dz-oGSSIdhqE?v z_yLur9y&$~ZQY1++K&7_l}(S`r??xYF|TLGs!zdEax05nI_>kDj zQ3^lEr^^4L>^kL22YIOjD8E9Gc2pqmMy7MgnL#_s=iIvxwfFem=JnuMtWfQhe8{l34CY$@E=X(+(MVR()D8^As8phVG!=?s1;}sh?HQuN5Uq417@4 z-2y@9uX~`T1$HN)k{*w#23fTBroEoCriKodvEH_Q3z;=iMbCwjm7?%gn6h_@$(KO^ zM+(W8gBx0i8(?q$WIcO+bw#QG50I#!jWp>;J?o%;9Fr*F06kH8GH0v&+1^>b*E0!M z%5e1OdgtirMug^LTdg2f)E)vtq155DTBkfSv$@P3*Hb}ig6+JFB|P;**&s`4&JLs# zqs(cS)0CwX-HCv(%}yZMsBh2m0;pB4Y^@bc?w?e8|4`D4f(B~(7M@EwCyWJcuN2$`@wSZHV@~;~xr?rW|G0Is@a^8H z$4a+UcC?214Z)0?-^>C4!HWZ!1pty42QUi&xN-+D3jjE22QUkO?J>YC0Fafq5M}`Y zm+1gz0l;e50n7q`g|P#e1ptdR2QUi&mS+xN767b79Kb99kVHCwS>nl?6VPG#Lr^?;=CV@aMLCd(gIsNDQeLX`BCD zV*>Od-AYWC%dP?Mk~>v@nv7!o88Xs3s%p2G>br4|%+F6eR7c0;@M;Qq(K#@r<-L>> zCZ?t&?Ebr106a4WnB_vR_H+PTGb`55!7~3WQgezsDKpbSYUGo!NsYC0Y^mDooMl+|_z ((qwE}hlBV=(N({}J_M)Qf>0KLh z4$8~eX^u=P-y{b~pGGCy(CVo`dj7;p5l62?<ax@*5_7s`oT3I3KB-wdNuVH8a-W~kFoJ?sP!dUgxKoS zk$h3tGYt$%p3z$|4t#nCjp;3KL62%owkvzK!sq>X$zQH-y#efEZ-_4tUt^0UJFm+F840V9oC;MBUOK{ zxys*F*p_hzN3Kiz<=?7&^Yfpx@n^uAVzi7uyW@GBD-wI}&%@V7+Vin2A89qES<^2( zx+@o5tKvzkg_TpIS%8sS51tb0DKwHT{TmA{BiSO7z~xFn>M+a#U?~Qe1;DuiTzK#- zh-*Oz`qDVASpd8&2ABoFd3T+d1tF-~{4VmfAP?|rFCeHck-kt-ilA=oCD<5QBgiB% z>TO z-S1u(Bf(QhI=apb9_HPhWF@cRAX9idLNzS~cjb9CC4qSByv&R45_glFHI5K&PmXFl zK~%%5Es$)}=c}sVyPH0C2cg}zAZ4*o?zkSNK<1U8sb7pTvjN+?4YcRq6kN7? z^v53Sl(h3H|AD0GG&Qw@aA!MXdfe5f4i}t?HA~hou=>gs z<)~iK0N80wj=YwC0E&+e(MY0DQSC+v*0yGqJIGl#kM6qV;dKwU*Of!IZn<^WRes8x zl?*-cax1gV8JhB+<<&&i$IkW~8oSnTon>07c6~#l$pMur1 zRGkh@+w4WXms5PGg<;`6gnGkrMK9QWb zyn!F{b3RJyRSHSnHAkO-sXvuZJc62aez%JGdx{Vhv!=FlWp&noD(qiiy@|^-;b={A z7n;h{cDp7yTCbv@Kh0T`x7tQ|vn?6Se}VkmCOOKs=aVOK0>m$R<@H3m#^()W_2)%! zMxJe|U*q>V0r^G8vxdILx9xIQA1^^D`*S53Wh%B3*@`PFg;x_sOt&-9s$Q;fTyAy} zq^=lo86_h;+-STCQ5 zR2vsG?bA{zpEhd=+)Q%g`{Gy;>#B3mV19xDxZjv{h}cr@e^t5dFdSR*Lh)(NzpD_D z#DaykbE6@lrTuLH#_jJM*8Z-u=h`a$=p)j&ZI3QK@KCb?WQud#iMsc#Fvr3NUd5_- z<&VK2)YTKN<6I}&#fY1O4Y}TF9)!9%!ONf>xxT3zXaoiA+l>e%Z+O0}yppNXS=wh! zBwn2uyf%@0B+dm_@uD6TQ|&ax$+XowRD0_Ru*osPktka4e$lQbbE3hSSSqM^FfoTY zVws0IOy+^cQaO_D<#EY2R6LVyIFE)<qxWesPz@>&-aPCrBy6VTHsS7j#dF>WpUil~?^&}EOYsN-R zsHB>O3y=HNNC%e|dOgU{{VY|@Y01Px)VchzZ~rzTdd1y8M!Hykx9mhHi9N~{9a z*x0KniP~rQ@!8TS&JE|oiJuDxl)KD-l_?Q~Spa-G2AE|7FRTGz;V$CfBj}e;E1Xm$!gF<`qYJ5%1O^zKge-lL4J#*xscIqqX<47zNY?UC$#!Kx)cTb>?m<=BuPCzz5<`7u*wNJ z9?Q*M;lasRKUd}*Am{fPxHkfy(hAP;l&j+OMV_02RKK2oYL$|J$fd+{7=BWnoz$qS>4oh z9M|fYYjtdBb)4Mlh=RE$tbT*`D?hN2qE~(Z_Uh&a01n}UWb2OQRYeI<$Y8(GFf&|u zBlTcEg1v}FZ$SeZy$DYy{BO5m)=^3Mx$p|!bQtakC;pRd!qE1yi@e2l3MUi?*a*Ci z9B$ACXmNI!H_g?l(@BES@bm=RcrSsft{OgDzre=r(BO@y-gv$MKK^?g5i4GyTR!du z#lX)_UIiwrIzkS~FwWv|5;IOz?z~_7CZ276?OQ6XU;8#jhhO_12I@0vLP%8Q*S;^) z_iI0p$-JYw>0adfWwN940h#%sRS=azTSdAv+QNOj2st;*%MBC1*5eIa+~+mPcH8#l zIR>u#K8~lJuZZ7gSU3doHg!{wHOnk}ryZoj>Gbf*phM}X{YbO;1 zEkWfh&Mid|0s;p?Fhu0UskCR{obL3ZDe=y;*K(v}Ol!z(gDchJ2r=vISuhZDaT zda`_bW)^9bpr`K?-IFMUl_zm^V2NuGsi0V#9o(@b3&tFW|9e2Uz9200XM+BqXKtx5 zP+2SMz&>*q`Z4+@2OGXb9f;EyP#Qt+#;?e?xGxB)UKoT{pUI0zddo982_F{L&VWye zOt5yTur4eNR?Z66QCp7Alt`_#q(kfr9|fbf+3)y+aehqB!Xff6&MrA8B|S7aG&qD; zd;Q>$;LzUkqZvd2OI@B1Bz%yYT*Y1XpcEyyeP1w0i3Wo~SE3h%g~KZSS?0vxV>K0KWGW{whF z5v;ZHPCR>gdCM!x8szTr+rmhRtVqY7TW>XJ0Par;;KUuFNt`hB8 zxQ^~|RAg&iGz8vKJ%%A#1<4XY@yd@7*)`%aI_dh7OJ&FGTCNV&>vxS|b`Y z7U>cL@F7g;6Em`0;cUnf`(qgckLV74COi3ysGJpO$oL$ftt*EI8gKv(P?sHhz7Dj+qBxLP(c%Z?Q8aD%M`;3JZ)`j)sjEvq6{03wQRw zjjo_=V|E4sZUQ1FpFATPilcaiV0EDz+$cabF}g9fT+6g05Y$W{j4c;Opgsq}*fJM^ z`W*;k%Wwo5a3G8=zhsOnt+h;O1xrr0?mb&znrK_763aZO5}Zbl!nG7*2Ohbga5*&X z@-6p^(rGDEyYny3Dg?hiCOe zUZ=>JQ68B}Z$#-0QzOAQ{k{zX!vt7wb zua{in!8EORR(YwVeV$wT`1_LSsUPW~h^fwGYGc+*ZPa}V-d0bhrf^L~F47Xeww-}> z4QVE8Un9?avi5b1wq)%a7!Vmzw+4~%!_>Y^nBJESJ5&3Ls7mZ3G6&$63NVQLW_SyD ziIayMi=A7zmY7o%f8mo@&_tDl=1bYcBcZED-U8N)h|%H_H>&ykr68w)oeMGz8=+^5 zJIz^s6meXy7dU^%tKb=q+HwsWv$Jx4#cQ*G5oYA)#CnYl30&ynmp0-~chIr4j~_WY zg06kM1HL+(cqCjTo_hIf@_jC?_7!QtnJFzO;u?O3A(`#Wy-KT74%jTE6@(l$Y?r4? zOTQak5vXKbgmy)9X#|CRl^1dzxMN}+Z5a6bXu}}G?41sB`^2Zyz#pKOxQXh|ky^(b zWJ5+JZJHbIXIO2k=`qPX1(Lts1$ zJK?G;`S`p#kmK9QdJuQWg<4^@=h;(?&cNkQ5HtkWM%d4r7n*=SP*b%mZt3>op?#`%h1^Wu+TO0JM~2d zd=0vmA{w*@u00#>DXa-O65lIo2T5N;lV*bgP#Hn@72waB>01dHthpj6jDdE9TRrnC zrMEhqoX2elTiiBQp)ETX*#1gg8FUh=Gw{vT!k@2AiL3O64e&`o>AWnueOHY2);v@V_yvFd; zIJ+;AE=VfW>4gJZN8_^0^s{?AG91Lsfe8yA$4@75LG)BO@$WpZI1DnOtX5?*{ZmuZ zkz*F*pF#v~KJS17l-4G5Y|r6HuC3$;Dw+ODs;{!D7v)AlI#Zq#4=T$kSa?^N*6_>! z90MOGOZoB6iO06sW4l?|zisoQJ!tDDtR0}RGhWkF?JvXGiVAPEbYI;D_C zrcm%X<|`>dmh;dVXuBi`{?e?@{s!p@4imG!{7K;FCWnGla(qD2gD@Gu+iugqB!Z}< z&*~3-mZY<{kYg=hIV8yErq(cQ{f%gf3i1n|P+L|Q#@JoE=GCr<3%{;BJD6AIP@_p& zNa(|3{~3%lemavteX8DV<>kTekVZaLyGb=l)xN75@d)M`^jpm)b4#OXez*!UxMN== zEBQ&0+CH4<$V}2EGx5WaIWA<5E8Wf<$7A-oLb6XKKtMrVGuR7R>b!&stu9RdnWy&Y zw~$5Q)e_YdWNGSFETZKgnHnoS`JS076Q5sPDsZET#E6ANR1Mr#EVK*W0ZH0n(~-aN zK2U9cA|yGcs3j%awzNch+k}PWB7#hHLd)cbKm^kEF&cv9d~RCx|}&%1ab!mCWx6E(e~kN5a7sfcDv@7)^<_l8i5K!avIkZB{> z*`RxAxX=?${F{fsWG*N`{tKO{$t1WDOHk62pXN$Hxrl6IP_m7|orNMA9f~_=3q{lkTqFL>e)>@6VO)!0RXWpmZcCE#6suFZ3soa;?t=121_7O*eeDexW1-dxQR{oM+6Q zalSzZ6n`L`xH0I1XrK@y=$`ygPhoAcux{v%&+R=LX%=kXy2}t{m4d;EY*0epv<_*= zIz?O;PTZOe*0xkOmi}nMUkhRzQ-Ne`FG8?F;SfYX5bfZQ%MTFc5DIVzaY$%qmHskFEz>H4C0WEXB3tU(+QGF!)V=wnHhbwPr9l7}Ga5gSn&+!d&RpIoRusLzprsGU|d(GeQ=ByySYwD*BpT5Xvt|KR(jXzyhB09+KWTmFwV1-Lg zEyjKSZp!!873GWebA*HNU)C5R{_$>|CIm`sv_0C<;cA=TAkScfBhOlQ$CZEs0dI43 zB9lagrv&}WnI`f50s7m&6rDquyIMw2}GOR=6dLY4w*-Cdyos za9w+At?q9%-BwxcwzL5?6>9YnnHa){VwZ%BJ>E`&Dg+?j!-J0yUzjN+`@ zM{|v&Z9LC+p(Qc$di|{zKSU+GMJ~^Ho4PjlTvJ$kmwmRA>l&!7z>I+6kM;vAn#kY50W#_tbwWqgely40k>F@LoEa%VZI4wIc;F!Zk$yC8mCYe*AwUqR~k1SxVPFX{oVvFy=>?#a**?nO;q8 zhsKL6!C(Y!NUz51=R1^7MM5uwsXVFNuV-Yw=bz$gwOGCK3ux%dxL1Cm%ni%DUL+7V zS}v5?*5c*sq|~kC&!cEZDA{MKwOj+bBUX7kOm(mzSJUWsmV}+J>filzf}P6|6V;c4 z;O0D_k*9yE9OFD;H-zoJoO;)5Dq4{Pa+^bi(vNt~4`^ zW{A=wreRQqE+s*ZpOv3Qlo9GTJ&-9KHyvh6bJIbtv|(DWX`DRGELEBtudt~n#GOC; zk-A-KwP3Ev+rd~H(pp4CE#Z|HNV5KGwFQSmYB;!PRp(?l=&wOF7C^1kRJ&iSfC72t z3$S`M(HVE%$x#_cOUMeXJ=8r4pwl1q-zZwma;eEaUY>uyl};c#-0T^=^_+8D!rE^M zQ{3U1St^~jy)FP_)eMVvs)5`b_fL)dUDf_WfnAGm9@@%ZGnmD16hxq?AWC=tf~aqG zKU?PJ27aLTq2$#>Pj&M`*njitIGb)Gx6Lzx`9xQLLiEG%jL9!LxAk*kL&AQB(dH*7 zHb#9W%!5lvo5TJNF_I*m_7qeNv*I(xZ4olQ9^ zzR%dxPJilW%!_%yGd=m;1(wn&1j@-=xXAd~nIJbei_`#3xgP6r z)(jF-?a&4d+#S3>1--sgS+-UBl0loN12s#<+2RfyO9YN~MhNx;TRXjt83jHznv0NQ zXf{HQQNUmtQr*xxd>*4^G|%ceWydOc6v8pZEDdh8NeLZftk=@0Fo<>tCjLWfx*4MQ zin49=aHJbMtXjMV;u3_fr3$kwg0yRdpq}J@6f>^aKk1dvuwkm%4mBn@uh06LcWY2_ zsDaK&A;e?DNRg0)bdU%%No5`TjbF=C0||>*A-ChhmO#)p^>tdVvjTI?Mz}4VS><)I zRiNWQo1!?Y_Y}Giv+R*53X}ih+@34+E4g{N@fS$_0~Vt>Ww07+ydWn1kNCAUfZguF zgS-J(%5Ki<6!s#ILe_M6z{_w}Ml|HF>X|LX&f9_>q)y$)#ben;j@B@7R!|7?Q}1HW zBgmJ}r+Of9fje_GaQHo~eW$Fo+C8mhwVR|H`h;Yc-|0H{dw#8**x9{)ts^o!&2)?3 zWck_T>(^EbmUDw6HT4S7D?hQwn&7?7a(G^;*XmvWiH3GfzoG#rHE4i?mGZ`VI@-K- zc5+#W@}lJzkRKDXsJG)&+YQ}#rZjH~vElQ?B=yeNe$F_D zTNboiv*qoKsh&a?$0s7M=^XpV0oyJN{3y&AVFWDh&~8k6>|u>!#|4r|{(n{~#sZ^| zwcctZgySu=Sn{55iv2AP2o<(7;&L3I%E7cX$ul^%X6lQQaR+N0B@Wg^q*wY4;o~?c&sz*s&uCq)$7P2}$oPZre`M($2ePY2#}dncWQ4HA|d2$*6q_ z!OVLR_4+mO#z>3y6hhbS(J8TQEpjdf>8z6vB1NwCsK@eZ$9w=~>e8MClF^?a+ukg? zH~*vtMn=K1Q*A9k$P**KP;}Y30yN}|ExASlxj4f{K#ob&==uCUxW*NF)j>%3w;h3Oscs& zZBBBaH=b|xw#YwV0|%}jnd zQ|lr_cE*bNO6VMH%8R5T{#>%1Rp03C}2Ha97&Nnn9>~41%k=f+uqIqnJ*+>%_uWdmqzTO}p9&?J|OZER2N{03SbjBZK zSR2-VCu>dXlF=Rl{Fe*xCmH4E(TSX3f4&Ukt^W-?KHU1oY39yiON+|u4DJYU-{Yz^5UE;%CLc;mTh(UWrnogJ)TmO1`TPiXy~aE;%59?TRCbQlW4_*Qsp?MQI3{6Pr4c+KXtg?isZ{H?5(rL=JxBd zF%nnUjeXto`imNtzeo&hVqY!GBDcw$#SFE|u(cRzb!+t#T?#Ym;{>@P?fVH~H6`u` z)J(J=P%N+my5zJPK&lM6cW%ult%Vf#-kJzf$Vy#{lqeCaiB_82cC)K$PV}t)a`Rs@ zF+@9XVvhBx1_QDRpQrnh6P;etvSe5Zu6ysv#2{heqXO?@Yy;YV>hLqki%U4JvAr8_ z>Q`Djsg0jRSp5xM_54+dMP*)GEb?2*E$ZIgkVmB!wS`bBE^6H$F6snVaZwEZ+C`lk zDorhFQ@wvt+n~KeSADo6VLbdPvy0klU~5CyQ-*$;Bq41FaL3=>=?lx3iOi$(3N__s zjeSziDLw|-o0CEH)klcz#NVj}6>%z?vb%wklkt%&b)sK+j)#OU;)|JFMhqqA&S6?q9 ztZ$G}<|MkBm-%Z|Vm+plF)6E2?xM;>j`(r{c{Rn0#Z8j&TAPxR>w@M;}I%^|`%RTaZJrQ15KDYN4pfRju$dIBN2n#cI$ z-%*zTo&6G(ZP|WF8ZI`>r(vX2-ef9MeJJ(dA;<9(BLuj+EtAS}Uo?}QYxA?{4hT2C z6q0)wdHJ(-8IdlT2<<3a>+Xc1okm8ymvE?Oad*Y;1Me+J@5ZsTsdyJO7--CH8=WeD zn1rey;fKq~k1OS8rB)z6{}~2bBzylDZgllCo#x9Q=SR0^@1-*8_N-Zc6OnP#)?A;& z4@8mSM(DHy$Z$im{955svQB|oY0jH~Ml{E)O`2m)(HyatCimXmOG)a-D`jWBU(lU-t1U(Mx!oB$^pNDfR_j1c`ApzTo*EDjtS5pwyT*`Cz>+q}A z3F+08NT#}g-6j}+>g!&(``JqK1bo=SJlYvE&N$K;M`5U=Q3DfeSNoxe@Vh2j2(@{d zy#5K);X|6&ZZFi1Aqv#ASU*-tMF5_#yuDDDm)F#~^DD?vuCxRkcL>&5^7835xyQY`FQUL~!FNYt7M- ztEm~hng~a6cKpFEHUiBu1c5eJW?7>@H?t|^(($v?>}j_abf%Yd{hloWMm9f_SF!TB zn&u20ytVj*OfpjJ_xZ=LUQvz3Gl1x$z?wNaM&@AS3L<=FS;5R2>Tx!5>IC zt`*hIM2R>_d9Ky!YP4LBA(F$tTuqarBiB9CK9t?-VSnBlz@89R&_GAuBM4}xZQfp zkNQ(tfD6u9m+NM93mFvI8CT`_ z4dG(qUJrG39PD4zgg=j@g&Co^?c99&f%uSt69FWTuhAd{R|kha^eq| z-^Tql>|etEX~J<)BOzJskAeLL7z8r$4b1Q1J_Y+p_ zPJ9#dyM%u)<{L5JhW`t&t6t~wslKfA6Cc8SG~wTm{l9>J6n7H)#lTn}CqB-{k}$E0 z?>qR-V}K0z`qXs{+J$dR9|RC;_1LP@ZAS@neWTMkaZ+r zg%SgNOo$11$;6lVmiT^8S`P%yfuF<|u-}icyD(MWFJfmom^hO!$EUVnNG0Bn{VM#R zL5UmrPQtz(*mlf+A>QYJ!Rsb2!i29)e4g*)z&G)o$|u~t3csfkKEVDw?85cK_#Th{ zi-9A?u{PR?c`xAXNZ32!Da^gV))0h?U50yOJ{yi?z!dI%lu!6~C7iGmQPad_TnR4%{!n9LN1|>>48)A8hj{KFs$D>|e)x5$4(W zDX%XOj+0l3AK`u{_7kuRSKG1g!~SdFk~N6FD6Hs)aPc>M8}R=lCTFS=m-C55xsdPe zz&^qUgPz!jc`4rxzFYZTh`-`!oC){TXE$OV2Yd_mGx^k4$iWi}z+aF3x8(T&-0IIN zuutM9)X`|)noaPP#ONd z9RDkTixxcw^YNJKuP5`tlqQ}G>>SLm;TD~G4)%?}9?U2FIaP4XUjgS3RpKbVZ<6*i zFf}%>;=7128lR$X8slFBc8k)+ycxIRPx1->Ji)QQ2lH6`9|`QSm>=YO4KVE=oQ=Q6 zn#TVxfr&03%_n*sVh#a+C8oyex!Au69Ns4J2*UQ^zBgut@6&ure-XdUe23vqqI1RY)>tn#V@0j=_@K<1e2li|EK8K&ia}M|ya8L1F0Zjd`d~U{1@&6U~?Sy#( zpT_+ofpfRT`sxjs3xqjqD8a9jEnok`cyYNXCIS7EN!|IfKX3PWIu&@imXfwrwMX4_SDrWu`hew_@b(rw|X*n79SWEho- za-mBmhVF4tnp%m+P9x3*`vwG^PyZ3S>|Vurj*5lCMJ#QhuFTPo6Jw2IHLEC2RMLmr|qg z0DwGeszv=wO6vd%OIYhqGPgBiO%;j)2(a+dW&ms2n(7t>5MY6sFG?Y-zZwALV4$VE z!TL2a%Achgt}UKJIV!XTyVGc9QAzyXt>Klnw`|=r^)r?Qc&Q8-d6{6xnjEioc`5g- zyzGqNg4%uRXD+b?_$GR*c%@S_a}};!{Z;(RT|j3qR+gj8DpB8PZZr8*P3VwX%5!R< zt#S&YCMbVuVm-XDJSfCcWWyAel%XCzcZj&`oJ4S9fm*%Bh8&Pac7FRZ$V5pzN_rAC zah9dOPyM9*ll7R$AbCHtck5+&k9u5&_SLC1erCEooxC)iy7YFBW0$C~DI!}-8@>Ak z;d|PW#mjV5a9ttYU+{Bd`JoGyWV(;@jSK5A*gt^EjQNQtaN2fHaDGJYYkBGU8@*|r8cc{SDb0@ zwDHL{E*2OP zENhRJtoqE;YM7q-J^?hYlALOSTZyZon@w_Bp2>t{5TCdU+yPs@PtgvJEg!|#u%%bW zFI1{B^P1gA2c^b-UU^n_^xhy!VLxw#P=*>Uu@DpW&GlMMD#saa40?tZE5o?j(hv(m ziRHefwz+k#rT!MA=oeC4k|eFCQ3tOEbIhIq)0^&dm}9ms!`d#*s@?S$!<13#UuN&o zZIf2a$Z91Jy-O#qC#>!BAS@C|TzE1+{@f;wA`%y|gv7{4C%arqXKX*iQBhYMSA=0s z4qG9hABu(U#%11|u{CcxLf(Tr36QkhT=F_Vc3PC~ux03*@7%1BYVC^Od10bRQE<)0 z!dv}$3r{4+;ttm_p3&fi%QTFH4PN;h{Gy>zQ^72IFmZWu6YKw)m~7iCX4LlLY1E!^ zSHUaOVWQ`~TW6Dlr!|_Tw#)}z1x=ql7|d4(>oP zfdm$YqMXNzHB4=%3~r366S6V5O(pfm@?IusI8%9&wPxm0&IiT~>U~s{is2J+6SJ4a zC}{2Q6sj#84B4Ba3jz{|7@5ncg{~{CoBBm1V4ya@Z3Z4%B<9p@2Z~{}oVv}+W_ovS z%q$>QNLA7ctn5-xte?X#U0`{?D#|;e8C}ySMGYEJ369$u8Gt1@5S3U#M2t!-W7)t3 z5u?GWW0t48g1p$Uadc)GO&OeX)Wphq!LqUrP9DEJ$-lj*m9i^cILVC}L!+qH`_ z-aL#&3-hMjS185EpO~&Sn!^cRwxQRI$8R0w$uhDE&EgvQZV6DE$6EcMj`4|a^q`62 zVQu!1Qe#!;k~0V9CJ{@=b_Sl-4aJSTariwYXwI=T55l54*&Ih|@e6%(Bu1fUnGBZ_)3YVF4OOs3#tNd-tM}@7ic1*dPTSsE1_%NmOc@84HOI4P>h&+u+40>|u+5ryR;R5w~(q#-A?7bKi=h+QhkVIn7l@#^F~U z>Mfi>+WS?hgGl)A$SnB`}Lx0mJkU3DZ|Gq~vn-jN8SARId6V2Cg_u zIXM#J#+H6ou4_S$hZ(i!;t;>s8n7|Pp30ka_-}JjEEnsA2_BJX zl<=t4?629p?wefsI-Ad254+IlYi-gA2UNb)EnpP4Lg!BXSLZHGWA1wYXe?8;V`3r45z3U`h30)(2*pL6`Q>mY}T8^Jl`y}T0A;dy@f z7KVY7oYW*gu_A7kyp@_bLM23GFf@GU%81{%iR-%0c|>&20`X86F>1(NQ^!hJ*V;s% zk(>9y@Z%V_jELGYLs)Ki*1!KN&DSU$kCUl<*`v0KEW3dimD05AMIcxI#x!A7YDLPs ziM^Hkdi2+RgJD@0(2_QSmX$GcLimHVi$JTUnoS3(93$=Kk|8oxe_e4;Pb@%os6r;+}XGq*mz&( zT^v88Wh_nOXc=Wgi7tfr9m|TsV|^6Djmv-5xQqswpvOMc04@dLz^sLv(+f-j78$py z8%86MmBUva#kmFw$=N&SS|>&*)Kx3BT=v+1kS-jy>gXby>qk_hon*|D6aKdL0`a3N|EayHLSGar_OUAZ~*^2!KtnrIK^m zWC6p#QJ$4xyW48XyipP16g4^NcB?`zoW&27U*4+5fbi|p4x;tXv_=m#B&;L64ng+r8y1#IEW7` z(S!ILdQcy!Y}#C6P*`sS+05Kr2YQp$HFIb!PVpL0(s;~VK?=<#Hbp5Nq_@O~pao!C z#F`9utqRhU=$nLrJW8sz1JFj;zY!gsaDKAteCg|C>L9UMc%B&TOXVMl^FCgSfrZE8 zAC`Y2zylh9&Xj{_?B2?qX`MYp9pXKg;2ttMnPM#KVre0xG8odrZ?7}8 zZnl1bYy^~P0mXb1PzC|Tc;b?;ks)y3%v0)OS)&BmA$y!Q+tjNO$Zf9~zvt3&0OR(G zovF36me&<7f{gws4O_W8NmYHHy!)JEYyFjSrRrMXd7bIHm_Dz}aRfh%*F8FiaH7$K zX48hd*iid8jpEnY{-;};?G4e95E$d>&Umd1ulxhj9Lp^1#D&Oa2S$Cjd@O3%&0*UY z(lhnzlw4SUro76ZA&yu6w0hp{(al;fYgj3+rNXm*&Y_gYVcyN>G&z!`+ebJ*Y?be> zTPtAbN zC!YOWx=ia%Xv(_L?P2(dV=1=eaHxqw5|GYrWm{f)j8&$Z%8YZ$H_ zScGL=Uv267W@^l(np4NZi{432Y<)Vm-B08m^ zMUCmw$f73T(%FleG>15-kysQO3@(aPgo~&1TU>l1zrBkRtA>l(Vks`}GRTwoEp;tE z8KZCUDg3%?sNx!pb&Ob=*+ogL8>fjDpQ@0WLl?DQH1e+KTfbLUDq7Q`RBLDx!3U|S2@+*QOo(l7?!@x2YxIi-%s7;jnOO_eElx-l}vE z=*g_T2C^yLsc*-DR>OY<5n`=|@=w++Kpgr_3Qc=zuX;PC{tgJa z>%`Ff;j@XSI)!}(ajZ0Sr@>0Qye+#p@3-DnNiDzwqIz9JXk&v|2e_IVM0_X}Sgtow zb&vEWDqrbMlo{(yl=q$JO}y;j4e%CnYv_f%t8iEAs=>lR6LS~GqFV+!gSN$5U+u5L z)?Q6s=mlI^*B0O6^fGVph$CU+66l2o%{hKAd&NzMJCAUcYQr6fl)d@R8OFeFdoub; zx!u19d)Z(vUj;h))hF4-A-f1)Wjt_gXvFEJ^b`F2$WD;xo;9$d;tEp0h?bfkNe^a3440G?NGe+S$T$Hl%HOYIMue%4`p1N+VTUl8eLf~kP^7C`DAK!> z0OMR{gCgzUFy`N+NEX^rq~-MJATjR_JyKrDx@87Ev7DDtm?p$1jOfd8uFIl68yioK zu6HpWQtg33Sr0Yt)dNB!&b|R@5 zRkx|S6+eE$Tme+Ps~94hE4AP8GU(cuL@&yLVy;>Epvr2F>IH}<}|y1T25dVoMW5>d8XKwl+F*dqJTiz!pnId}y+ z_M_xcxmoHu^+vg^C@2RTl(P|+#|ymk-a*mJFM@QAb)n^n!tds`MZPX@3l zY|Eo$M-TBW3_I0P7;MYKM0lamVejW&a;9}qkiO(hI_V(uOOZbKd(2aDI(KuP3ZvrO zop~xw?BS3kPSsL6k$4b2a8wqvoqK~F$dvdF?d0yuGx_1nUOMbrRe3CG zhpmEHS6wR?$MRJ&SIA-GhLLA9NlE7E5BQ z92BJ^lE!5vL*Cw&9ptUDzRgc%b0D*BoAmB)tAC0_{NicSC%5>!Nz#e`0bG3z8| ze1-1Y*_Q2_YtIrZBdxkPeKs45*10o3WFNpG5aJ%g3gkE!AI5Mk6^Rf+r^7AuYZ*84Tsy?nA~L@ zL#`rx(+RcIIv%ETz4#jTK6zLE9vd3|Q83xObLz(RGy+=<>QQtzo63hfAM}BL6bwOP z#dy=n=f9S0{Esuf$65qJPi$p3J9^bR*UKLR{EtHgOPw}ggsGbm7PIs9G1UXoR$8|) z?+@%W+vLj8bMpVf=rOU9N;2z;F-xy}LI}%jB$K@ul+Z=*qXSM7HxIdzFML?V9ImOfJf4RbR<@vLiD_zIgXo)gzgJUF zmGV1hr#@VP&sWWt$47~|iytnbF5hC63aCe_iPH(!0WyZhVmhE#GsdT8yo?Qj>WNH2 zNEpuYyH+Jje?dPbJI_RKP}6&6Mu~fDAezclRk~lTu^(C-a|6srRH>!>%!~e^de=8D z!;4x}ts5?77H-1ym$uFJasQ6jrVr}d%bNqdoLlOe7;R-YT#vyK5p8yl>;#0N!VItX9y* zST-amKm!aXc+9hXc0ZKZs490&KbyA}CeB@nv5qf#<^KW&Qz6Eg<0FD)4?*xgf^}c? zcC}v8H zWU``&#*4A0z&^6W(`q$PHSN zAD(%LZM+O>oN&Ye|Gf)g%(ur=dej{vR~*mAiwWZoY$5UYTs#@)r#ZqohTmN^|B5KYI&{; zL$&}mKkgy3wrF*8r7l_e@98ACoYdJCLuc)OOAlJZ!3>{`gE{c9oz3v)>Ixf!>{Jx1 zaG8-PV$}J;=t=>zN?+ki zeDK?*mqB7f>7coT0Cy1J4g%=*rxc;x7WTxxCmcgd;f0&uB|He$e{#%*d^`BxOkIE(9N`-F_zDbV&Yr>>;0uOiO zO?Jd0F<&#mk)JfdQAg4QM}<_fLZOsj)ij*zzRBYEVXC3VHP=HdF#JW71z2Z`5e3uuTpIr-QZSp>3n>%)7$JnJ0+fLOdi#ke~lb3v1~8{aTdA zkVyX@rniP`YPx23)y-*4cqHJUnKdY4Ow@3QF;RoUVPc=P8c(+X`G=|7-N3{6^VR=2 zjYW$Dy>^LJ>xij#EFv&LcCI43fY|9{N5+yo{b_tnYKd1pN9{Q|?s1WcF-PvuLd+cL zxv?GFwLhS@$#{LNd+N)mNXl>H!G+FLd)7znS6H11Rxb^Aj2#tlA#8QTA1RJ=fm{^B zhPs}gE^wJ?HJlN+X>a$DU;54Kg?=`r?KJ2q?E zR+hO!Cr0O7IC)a9StcL2ykTQkr<%EQ&lR!THGAxeeS`MiIYg+^de!iXE!kdomLtnM zsbtA-XB1pJCt$-nv-1ruDH_A99chqs-_D?Yisxi2 zU~S({AQ|O?vU7F14&=1=?XY3PTJSS8a3{xrY*E*gNjB*ux!1?Y4c}gW!FmjSe)7J8V3#6si9o*0nf7qc_$(|Az&k(Sw{V z@~3i~?8+bW3ARfA56ctktmvOXCA+|BmZMmC%MwXl9<$8J6(tK~b5bhtKumYH@DGYn z)9-$F3k7s{IXRrS84<%+k^=!@{r48-c7CgNVkjJ$_iA!#_tU`lCNSa~*-=-(9JrJG z^hYt88AfTlaOiYObN_U5jaR-uu{X?5vml8sgQn_#QI^TL6y23oUeWG%?w%s7<>Qs_ zr)b>r(46}X=3HbjY#=B*n+efK|L8`NVO#0Hkuj zr-fR|7e~?H=juEgXR-yUJ-j$s|0Ag}Td&?WIDRj$)Dd-o5}ZGuO7YAd*5)NzJ5=Kh z)c+gkOpnPw6rg|SAi8+emXk9pQu$IN6$Ls-N?#DCUbM_-J}$d!-M_us&0bkvYu#6~ zTE`D>vj3=p5AN`}V*5A_{VuQjs#BsxYh2eOR4Ts&)k^kCa-|NQ>ApKfJ!lW<(wvnw zv!~R%W7iP4bH`cRo>Ko4S@Hss<-AwIoBwGe@#3bEI#^rj7M|sw-Baq?LH1m)nsvGN zyWH2_gSqQcpXHuwXw!=_A8?t!iizi*s=Dq7TITtPuZ^;{rsC~Vn$6v3UTbCP9a(`k zy5Z%9NN7Vu*OiTMWvlmsh_q+fVeD?iabafuA9wEoURANR0ngs&oPEwoBaM>~NTDQz zG*akYKt!4XilO%^8VNQC!GvJMMi)C`xpom1y@04FD)xdM5wRCgQPJzQ;QzjBW*@eA zz4!aR`~1)UJpWGCn)S}CnORfz>^XbSp8XQfAH_U(B5^B1-NF$82Ugl7iRs ze?x!g#Ur{#S5B88HcsHhfxi*UQ#~LJ@0Bl~9UP6(n3r@PJ_gnaogTNSnI~VY5kU=6!P=~>}-Zddd3Qw@1g*_TE!K1H){O#8eFybcX)1dHoE#lFDo@!{nuvzxYaLn%I>7!dOcne3SL!D7soR{ctkY=Ec z^!F)aoOF2+{5q$ZaqC!Isn4J~0ke%a*uE*@0G~&+LFPW(UaMT|`5d+TEozL%_;o1@ zjIm5}x7LoV4OHNk0TyZ`gzy>f2qx2!wOIa(pVeq3rk500Ta4c?h|HS-P0GGV3gGt& zex0;OP)abn30^RERsCy=W1=}6Nb>Vnj=v0rP6;C2q~Q8AB!RAz5?|Po@A8`Tv3?{T zyGL>Yt@DXbg9?5V`ODvls`=L*RWmXDo>C^oSJqF&6HR=z6Go?Duk^tBw3KjqN?c(Z z?S~(WSUW0NhSydy9KQ>(KF5503KhdGpI?)whhbfdP%3JZfPTj`lLDUXaVM#D=hPh`+a!f~9z=xzJ7uVigU3ImW_bsn1;Q&RW(h2tGPC$>HzKq=fb* zg)OmNdoD7QLZh%)r?a*!4gFnvtc5Zv9El_)l)vt_O+rEpRV*CZ?@cDPSKYJ2>vAA}oGlai&!)wHAOAND`+|;JdyMi2KUS4v_kdoL(DX8aXp2n9^wWj^9EO% zNr4^{i$6F1X|kkj3U8hlM!0#U)N4wt#~+%ZiKao;R=kUQe4}H!?LuXlJHSq;*QJ>J zCBC!8gx9oUQ(_6GFOr>-osyaw@F!rbp)Wpc3Z6e0 zYB3IGLILovtgxAr{YyyzD+Y_3!2em-Kl`^Bz5hv^;x}X^ubdn-#WC3hB6>IZ z#aYN>aW)v*0XHrGMb^a#KsN2P4dLpfac1^bnCfKzTGAvTTz#7BCE44a3+R-sg`03;0m@r}yHwRLyI#oas0G&e=;Jd~Km;$Naz&gk z(tJJg$L~o0O@YYbOuDiU0pGEF6!pVH7rA(d`+kqqz5af6En5JeE!A)F@VvI0X_+0) z&TgUs&!ngpMQ!0}CVcq7yh=uW~Xm4$555a*C1X!yN&lel~~)bKXuOc$X$%g^j`t-ok;3)O%D(1&k{+?`9`MxCXYY$c+g!Yl9mS=nfix7Cxe(i zrVMgWpY_dyaw>@Lfl~emw;jLh_(0lD^beGw1pPZLSYZH!F)+dckX zdzO0q`+M|1hwR$Vba~JnCz6(17@6r`1!CD)UY3Ig^%sexQsxQ<#Ho4 z{UMZuiy^Ku#y&$*#aXprU`e%CN5+hT8 zyT_k*MtM+wxky?bW@PIB3Yr9xzJn`059+hdcu-CPx&6NZvTKib{GSJZ9@H-rNtgEt z$Zq|3`@>|TL;aQ>{hK`g#vDnr-s69qNB={}Zu;K#!WIs4F#TpmW_eeG-2USo{}&h? z>SId>IjFxI#JXVpupW3&XSPUMZf9ib-|z7!=0W|7Mbh$#MrQbTAlH7sM~C&zgK?XJ zs6&~X;kfpD$NzH>#)CQ?Mbh>E9Awvi@AyC6=ukh`qkpHz-+Mk@=p%sUCed9qQle z@%MS;29Mm&$khK7I3*tf99XF`I4&>Iqn+|nqKs+eB=LPlO1iAIkdf-8w z(?!y<+YhP#kjLL!-b+3HgN;o6A3?7D-u`x)N1yG!1H^oJxb^SWGyTt#5UtbM$V~qw zkX!%W@qeaAzpY1qqsQM{pBH)jPw?n}4cWDy`SGAVxZxoOWp|up_tEoJ zdmEYh`#^5}yY0v{tBeli_C}`uqaJ^6c~^M+Px9y=fjkK$Wi?-Zp@4(--zbvyH=^j&dHnkrnff1q-1Hse z&onDNa=MYJzY65`AGe=V|9qoExr>ph|0>AsKS{=)I`uKnKepY_dyaZ^F=`128D*M9fBqt4kN9+W$Xr0erp$gcg~@o<{ap?({W{v95F zuRTjW{{21rUqE*4XIebyjuT1CEsV_aUJYW|*dJI99@JkXl9qcInfmX5-2TRKfCu&G zilpTtBU68?$3M;^U*?gA7@7M21iAM6JUYyi2lGk>x%GcDWVilXL*_x9YLT>DZe*ta z6v(ZA?|3-HquppX$+B?2&sJnfmX6-1_&9|7UviOFa6Ic>EJQ@^X(n%%lGs%MZ}#{bb0p1rkN3iF2v`4?0M}G}uxBqy@{{6hs}$|J(Wh^N8cx?;ZcA!=DG!%oRzu*Ih=YzxRB+(Bpr+ zNB;n1*M7#~L3g}JTFx{w%X=-z?f+~C9@MWDNy|NrO#OF3Zh!NR|7Upgi#_@ed;GoS zz1-tJ)T93kWY>P5N5^Yh3jE#v&;HCX_J`IW9<+bHNLsEiGVR|5a_iqa{!jJjyXjE> zHjls0BR6>DenzJLXCT*p+QftQj1@`C&5ca`D?x7kyXjEB#^_M)Ze;4e1#;`3^}vHV zr;DWJLL*cE?;d||c`x<&5BBK)1F~zsx4)g{(NBZC1H^oJxb^SWGyTt#5UtbM$h7BW zkX!%W@qeaAzpY3AUXQ=GJ}>h4pWxB|2C{2E^W#B#CW@qGcbsJS4IsDvr+RcQ@W{Q5 zO#SykZvDIM$n>j>4(0Ynrv76d|0W)Jg-1Tg$khKGMEhCy9B*0gA_K6VDRbN#>-s0^ z`lLUJ7}Om0{Ylv{#0UljiwU0%wxkMkJuM?pC! zpj;2yVPtF4(e#mI)c$&p{T%J*MH-1KWn>XSrEswqZ*U>-sp*WKccmagb#}23bhNLLwFtu~3l~D$zo{bI(u< z?QZ3O&^}fl&?NPz14%?}aqV$!a_w^4$ZaRu$+mLa%WX5a-Pm?8L5O7`@%f=UAIo8j zn>VmO#e=$h6ey;S&m6NS8Sl@c-h2d^oo&27k9zYdY}EUUs5hU>W@j1gFQeW$Uhe}@ zZ$4p-zVyvCK|c9SgFc46I#GG}PJ-ToFdvFOUyiE7NtIUFd%R>(rM1j_SoXqhY+iwlh07S4%N#I}-S72ha)R zkA@L64BuSibK3l|G%Cxk84N7zw?%+QCwf%-GTJ9r_rn9_>igSc4Rl{5xeyDdB@jw9 zs$dDK4;>1Mlc{(f*!uzlfL7w;bZ) zGO+wbfMfW{R_2|5HW0pKQdnWvP(@o}*GM7rD^aH4{1M<)mqX94VS>S`#gJup1E>61 zJ2L+Qz}ha1JpW^;)*eT(X>AYf;JqNCUfSsm2WG?Wfb2K%ChU$N;coCRa(9S5l2UU5 zadWIo9>{pcBi2qml2Xf{;KG3HK7 zlFV;F_Tl`cv^lo=pQl83pVoC;7{n4c7B3LV%L_z${(>bV*k2)_?m^k!LjC5{L68$M zM$W-lEGJ_7>hmuym?|e(Fd|Fm;Be`8(2-LS=n+B7XUo1E!3_CQ4wuU|3l&AGUqlxT z*6e^ves7db?~08*c!RQ;2VR20;y#`>PUNU()dpw=s~$wj^6nP(&T@4 z`eW2%2@A}g-G!>SQnogcJ%-Of`g^1tZcC@tQt}o1{MbLChQmzNg)l0wX^gKpEIV3; znid9foB>p0>m{drgnQ6Py~xSF&!GGrEL14c`xQjcJt}(6^E|d| zIC`a3mh{oFu`)1!8=`0wk}BI5!uc)fIH3xBzQt>3VU5$Y;=E8y;rynE!@`H8qdSsO$EPS*DgH0R^0pfRp`8n zcJZB!88AK(B01&Bc#n@y%g7jUWH76Gmu5Tpr^Cs^qGCC6sX9k&x5XAT ziiWkcY+o>}>+xUJwWp6Bt#DJ>7qM6DD?yv`0*)n;x{cfuJ8Xx{#RD+|I*WZu%HDxx zAE;VPlPNaj1uEq-U3MFH?wdZXWzN8_y-Af|u4nPQpN=}&%Q}(iOpH_Y5Q^;RVH8`| zunlD_g%<}=cyWqjMp7ptBWa!^uMpzbINxu-SZ(KUGF_g!csiiScBU+utXx?je)dY(!g)<0Cfo1HSTGx^ICD;iQ*$L421${x zf{gYS`D(~mpe*vWkh!H$Yy`_K6MZ%7xQ;u7Zz*BHIbXwGybKCupP@yrM2N5EYVft` z*c&l&y#`!6-DM-{Tx(!Ob&BI)uU6`;7N!%zT4^kwMv{1KBPG@-B;k{1{H*32WKufA z&3(nWsEXWqgi&2F*a*258-Xl@aVNEVTr#wCB~O4A9}~aQ|z=*Ii|7}@2&ZR zMa|*AfhCE-OQ>Rm4i!JM+HdSl49|iGIm*tlwQv2D6Dp)u1;|Z$GVls_1dUO?4)5T=Qu1& z*98fcwD)N_(Tb6oE^qeWUhXH4a6sRR?CYZ!}ZQDen7nms8(#h2*!1dGvc_Wj#_ za}6pft||6Yh}2%i4j{Ew%U%$PFYMuj)5okXYG*n}ZVgqq<~k_KNx?8mvEEmM4?STh zzOFDteRdtL{|<-BcNEV2Q`C@-ih(D+9Q!k3Exs(`&P~Avi(zyvX-`xz(@b(A*O?xG zw+waDH#JS~HvH&XHo8wtOD|u^jr`c#jK|pc!Z@E3u6h=qZQ)wua9aCAA$-_XdVAVh z?4!kQpY{hUu}mDfv8YKgYuEdnG>Pp-;htM^s^rSK!iJ2M`bvt$g4kn&;&f0PmX%A% zq(bo;HmX&+kuIgF!IisBvHdG|=dZySo>n>YI$fm_C9N{anT6L4u1|_b1&QJ2`v)E? zX?J>$=IHi+GA2PAlVIYm#j5E1^Epr_VZ$+Y==_C19A7!+@ZQ7w=sPk(q*cl%LGkk_ zEv_)d2?eq6di3hbv?;T4WA#T3^+56odQDebdckTe0rwZ>6To`UnSws!p7wlABEJTi z&eC1RSGE)Lb^RU*e^*EF<1B6Bq!>GGYNB$|ro{MA--%YF^m8X|Dh>S)2ZmRb00lmGIN znn_N<`vR${O>xLq;P_z+bEF@0G&|(;C59#g%4g2z<%pWwf(d<6cd>gTz^ zbJ{&$cpmc{cF$ej%Zvf>zGVUkw@+ma3T~w-{CrS3pnMQ+rOH~FK5$P4O#*RTtpjZU z?Eviud5>fBWuDBBc`+a6kpp7deL#~yb)X#}8eR8)NPzcSUu1k7N58B%3D?o=Omlnm zAb`I0I+@%X7FXifV6ok_0JqIzeIX~bX7_b`Uo+$nR+fJgEGW-^5=q)sOPH_= zu0X74_PqDXXCXYYo78d6ot;v5u^3)=37i~hxl8GhS$7$n#gx-37gMgRyBs{TZaFwU zkhy|RQr${A$#tvXcs_c`-vqcb%bx?-f0VxjcxRTgJbs3ozXo{Oj6;v&&$=O?7eGaz zyFqh72SF`B*MY`?_JVqVwu2Udeg)Z}C7`~bCqS)0H-V;rJ_O;af_20p{6-65eQ-#X zgYE}agT4dBfGz2DAs%4YUok5cD(10X2dKfcTR%4|FSN z2Ix~z1hft`3iKwZ6X+q(xu73G383YmVW5{lC7_L-2*xU^c5%*bUkQ1=si$R&?BH)&~Km=lpw_l<6DCuxFg|?g!>xY*Wgybt$_Og z+y~&!hdUqc_i(?58w)oU?xk=qg*zDTV7Sl2eI9Nh+(Ni_!MzLa>2ObndjReMxXs}< zhkGsDYvGQCI~MM{aNmX79d38H55s*JZVlWTxWB;t1#S>-5bi~AFM@jl+!NsLg1ZZD zTexlE-UjzJxHI9-g!>uX&)}xPO@n(S+$-Up2KO|$Z^3;FZfCfi;r<=&-{GDI_dK}& zfcp=)P2e_xy8`YCxF^9q3GT~qUxwQrZhN@*!o3%672GPg-@yF_ZZ_O(xHrJP0q#V& z6XCuO_kFm%;r5367~IF;UI6z3xWB{w9WG~peLy*&NuWf~$)HluS)dSTASfR+3zQD3 z1a$$O5AuWhgW7<2t0)z83aA6*ErG=Tbnc7j@iZU#*SeFWmwG*NnS0BHx1UI1wX zFfIi!_5?7#1TcmKFir$876fp<2XIaYaNY)RZU%7v1#pf9P?`YFm4N&;1&;@1f_$J9 zP%Nl9CUiZF)r$h+iFPJJ&gAcQSUX77Bg%yuYT^}%wbu6 z_snm^Z*#K_RgCdPFG?ii4*uae)vXrF8iLX*fPV-T_XuS5@LWS=cw=|L+hx z6yvL4*@-=T_|1zaF~<}bzf*JLiobLgUxx~t5EImHES?T+!F^wR#Bho;sbEyjx41)I zN0ppSO(C&%qgU@ScFjg$&J469cXHWYysl4&%L6+h-wZ7~2WOU&&wt{LSKK1DYVV@A zesmg*57N3ewoWspokKcDkFniI@nHi*`rQsVgqUluKjt-m0-34^$Ja=jdEqQ&^~rMUdcrQ8mej}NC;gmK56 z)m4~ciw`~~YfW%>#F8hP`O9IVPe1h*EB$6e3tAJ9+sS-fD(2>|fUbFBP7i&X*)1Gx zH20eAe149z7@0~u`G9QIUGU;I5FW41@QMuaH-bFi_naPWAC%I);Ac zha2b74^m6pN@d}r_d0W<`Y0?JUA2L;MafO>c)QlfU2n83{_#>jG^8yzpe-v3jSa0m z(XuK`DUONfbmc=1-v0}zAwGrqShRmw=sv9UZcn3){?C<%7G+Ik=z7CVXN`1~rIkzx z7ESz@RW=$`CeKDq6sfr4wCdUL4+W3?u6L;V;(t@cf3DR?8J17{e_iu;@==m}3D?tl zeV#>a>l!IK-ZOyU7Cr4XpE=Di-GV1g)f?!3P0yS-oBN_r2Y1QtMW=~qrGn}es2a0* zoHS@!pXtowXpiZ0YBbMoy(Nf^B#%)db1JNYEIE6*kA?VeLts|>T7$L#8F4E!51<=I z)np?Jth$JL@Dps>NN;LMPSx44ST>0amKOC&; z0ed`U!dGHFwTK4?feh{Ko>Y8TB(;a_Fp@$gS=BQqs9l3`Nl*p7znCt^z4RewaC zSgjLttWNdtNp6J~ykyJB#6=e}m~e!n<@zyxq3PUJccTgOut^|;3iyp@u07+SD@&rU zg3i8{cK&L(b`38DeCW*vcb{@o-s?Ue4y#ZSern*rQzy|nAGP6rqZr>Yp`WknCVFx% z;g>aFAL0C;kB>!aE1Y2Zsw`-bX2WpP57>@-`IF)^cJ zq%LDHlCJZUpvWpF&EME#DrfP&bhP`k%G{6qvctyV;WaYu7tPotoi#D5A`bgRUWulv zy%&*?9rpUgm#(6|o3wBG#B^L{|4_$ydVNGdt;Up-_qFvfoL(`^v?FGrT+niDG*_(P zk;#N~HN6hSb9PrmV98aq#2Qtgwh3a$1FDV4RWLsfI1i3H= zO0a*9SjmfjqzqxA=Qv$|;?=?%c8XK%UK?34xS)x3Jx#N9)XI9{5k4D~3tL-O_k*o} zw(FXxUGAtXa}N~wkFzpIW@QeaZOe$lo)`t^dBKfduz(YjEZr(|%!|^(AT%&iQ z6BUfX=UkqIfbDc@pQ5Y3T7>ahuc2rQ+y14Buehn5zY(Jh>b`w-4Z4}`=)SZH1l)!I z%#b71TcZKh|A>nCsusR1h1~M*fL=j2gM9gS686OpATh<4ragAM9yO064t@(1PIYs$ z{qy@GPVEyky+*jN3ZIE~_=AKH1KIYY+T!J_8bAeJ18unvugBcK(5~W!yja{OSvUoY z|1#OCflRd(R;fKep%;vniai$lb@&)J+^-93)Qq)rauVGOAZBkt)YW#SvWf2|`&%)I}Z5n-;B66a63+s{fTjs$>&kRs2Ql zs?Qj?@h`*iO@uG0@un#W=DMtXUln%!!@@&Jwg{fOAP2;fE20*n-2$p71_|A6RH``_ z&!@Rmm%~^YR!z{2ab)SMgrAM@<+F8)HRk}7^}>hUphQnDIw~tMfq&9;D$A4qsOwa= zFRy+X_WU7=%nFSU%{g|K=utKz?a(P}8_Xxx{`hq@sf1jy8J}2_DEPi8EOy+_y&dyG zIF>h8Dg@t%qahxfcmZK}L=xf{!Ma=wSJx%4D=|)>%nqRPctb;P;*5kCqT^P5fc7ZL zLZ{*YV#{`vw(Mf5zbmIVpY?eA+;7L_YAwBUD3X2{@mUISWu1D9NdBYj0$9I}Rk}yz z76C0+yKBt-0lAHl;GcgP^lM*5O1v)7m0#`b+PeX8l60Sru6;fRNGwZbxKD1fM74Rd z0u{k$T$A+ag*o_NM3tZGNb-Zz+_S}}7oz7>x5d}oebVIO^XJCbSxasMjG;HtS{AuEoYm7k)xKcs<_T}tW+O{@4ruvATCj+^8q zf0;9HAMs-CYMQlm|31P7MvyrL)(PU-0)7W^DiGsf@4ETh(W_$ZVEzWUj$B^jypxQO zsbfcF-_Q_@fXJKE2DNtVhX3?3zo6I;3|xeZz4LrY9|HHPM;Q< z9FM_{wU9MMrybsZ#pGIg6t>d=I;Rl!wRAP7Y0V_RtBMUwF|w9lZOR-lWp?f2yK`T% zy>#xm(cFELW85@N?v9%zu9P%FXYQLE>*|@jgHb)C&2hfQl}yZ-;$%$IBK)xNJPgF0`H5LmCOKKtv^)v^(-4Y^WnNroae#T{*tV_4 z#N;IQ@msM@aAKU3J_UQoPK?jN>0^bkd=&9^%YE~ih;vZl@Secsc&o{(WtWP?24k|~ z3R^g76VocrTb0oHq~7qnEyVyrIWu8e0^cqcslFx zV$g0Z9JpK8Ne=S-3VBBOj!{!Tb8sAA@QTSX{Qhh(;CaVg81dkVqi~UKQ~8C#-dB^ z`|HO}#oVSM!|>IX!xuI#4g6(THNz78lIWiz z?y`z}5FTFF=Y9uOxX^p!ihQNR}g@N}t0H1P6@ zRz+KK+?@iq9ojSyW7jY{DOyRXCmroy&e@x2c!Ea91_N{2`+~C(ndV_;rU&Ja+3aq1D#u5Qd-in zv~zi9`rtV#_}&Nc?k^_410TZqei7u6XIIZYb0%N;RULX+YA^17wLW#EO1#CAwN$64<0s_U!8WtLxo{3`1(1w0uQ7m_d5WWf_#415x_grAU@&7 z{Q{2n^1cY8;5-$51hairH-x_gqAu^7@O@>L2KlJg#$_1FE&g16_Js4WSr!%mE9(&SKrqi$@%xEm4~ z>z%}HiH_=!%vf8K>3>bi@)YQ#ElqROy~3XpzB_~Z(=w?!v^_OvlvCbUPXFnhD1YAd z&907mv>Sc)bfY~NkD%sBBioORQH>+%|MJL3M>?u(3jH_DVl3aBk7qmTx_ONIpzxQ3 ze<9poP5(^corF)V9$Af)McyF%G2wfwna&~MN2-}}+xe;U-&fty2OKqMetYCQNBA}K zsd>Nfr{=R}zMcQ>d`CHFQ>W$GsgOIJ&3YJoHq#k?Hmw~a@?4RV&!JE2a~QYJIjq%F z#pg`%dEgwDwEMY?J5~5%;SUObO1SSlhGw6~bP7eTI*%n?BK$`2xlj1BqVvA+FNJ?E z{D|wNG6mU{XE>R%vyxdx#)|yt>GWB-kg07KpRa@;7T&&wwb!eLI+KOZ6n35WXH9y+U*zt7UC`Sj)H>iywAos+KsrQ|un#jvBX^p|$XL)W*fE?d{+*)hiPE znfPa3z|c;@2MHf}0WGf*`CRZA_1XnbTo9vJK9{QcwRp;bZHQ z>SEMf$c|c3-y;~K){Fc@J##s^fqiCH18cZWF}55s`I0-A=kd@}_7BB-D2-;$`pHp2$Us@+7DCTI}W5i(w`pdqp|TcYYJ zXc(>qEc;-f0M`FqqI{_9N(|~;C3lT#z+7}HPylQDaE~5nzG#k@eSZ?wBD(-9n#N;g zR~^DG1`1$x*FBQv)e<%ZD=wM)?GiSF-vI;KB4P8@eu?*zge{f5BNNrTf>sg1mQR4V za_@-5J0$Ve0m&86$Na9ww@!RWGwh?C2eAT=Wk>~z$5m{j#op5#nqi>(1r-ZAY*24O zKN&Pkkg}kOG{*yBy%rF2m@YZ=x0c&X^E}ZUXsr;`AZREMt-f5)2!KK&+*^ z1XWt=B;JFfS!rD>n$JquSc5(UYNlpeTO{mTK?|%`(H=M_FsTTrE3FvVl&BJbnyG87 z7Cx4}C9dsZ^*5`Fgys9o{Q-4{LA?asWA*j1M8lvNz#777h?b}(BCMJE(3&o(oF%Co zu`UHlROg9i(7x2iGF&35MC{8Y-b#tr+Fl{?a8Cfa7uvT-?sto3DG+mbP&7N*w|O*& z**hi8mql|V5Nq&t|NH*1I>p9qWS}nvjTV%segX=p@jwBD1u;d5SGU<;`#4ug1q%Ru zC;2rGypIyyWB(wiouEy2lAk@f15iM1v&;PmRDBUItX{FZ`B}b^680_-HRlT2Yj+p4 zK+s{kx5Qf}@sw|{gk39PO^8t1yT#6Y-v~d;elxMGLD%_~Nmw7Cuv+iCR8koZ)J)w3#JZk@@ja|I`)-kVr%SvoK=nxF96`H$4~s1g z67N-mmOE>mfO^gMhJ>vLYNp=teU2QkqdgwW1=Kz)f=odUM;2m_KkG*z_PWzBj}9mo z-7e^7pX~`df_rV$w3krxcb_AvJkr2a{Qh`BuPpVVCKq~9pFf~^e?YhV0loPL)S}Uw z%9KB#?SDXD{Q+fTUVqfGB~j!!j|B_VsJdOjV(=G)zbX79;fKIooerU^pwmxyrSRFp z7YJV^{C45nguf>IL*YLQPYN@IR>FG;A1}N{_;teX7ygRyuY{+>FjlGXA;M>ZTk34w zx3tufm|wsziQ(9MrTE_v<3o48JH`QjRCr|^HJ1us7st?k@vmEMxgLoB)f!c|RrvG5 z_kg>hKg270RNc?Qj|jIClOD!cP-E5!_PO zB>aLkxDP}2sV5U0jP+XHi*$VIKteWjnl@<%-mHnwgjy;OvZW?8DTWU9Ew!mhsgZr^ z*(UhBrh21EU-<6<_o-h*{x$KJXgdy0x(>Dt7d}?_Y~hQ*JE@D3d{!rQhwwLq{{(KS z-pQ=b;mHr#Noq(+JMf!RJ_NrL+)|rU9|He-Ds`R`{tCEHO=&s;BmOMmXA7@y%C=Yw z*;4li-y-~prla8Vp738pCndssGb6BE?TL)=4X-;1@3mWMYFZ66b&jW})j^&o{^zH$ zKJQGs5IH`Ub}{(7X}nT=n8v)m6#hdRE&NS*Vmkd>r!&nmk>5>$MntM@y*CP z3!fsqz8TMyHNqbd{;cqQ!oLvyW3!JD%g!KA0Jqc`8Oa!Z=4V9wZr^Cgs6*(b;FemG zk&RGqSpv;j52?c2Hm7afL>?r3obc8y8LO-Cp)FY(Q-z<`auiCvtR;KSI^ov~zeV_6 zEqSJF7yi8PJ>Wj|TT9k+Tr2jm>{d*nM0gi)OAQu2r&XJPPc4Fur7mp6bXK=w%Wi1J zR^BB18R2_c(dLh#<5S;5_NkwtiCK7S#!41mAiSsWlUr~0>AqyCajic@kDc4P9R~gL zTC=4tY0X@&6nV4o$A!Pznz?)c?o;1MI(D1Q&}5(Ssf;!yu(nm3VuY3mAJB&BjBCSQ zdb;ohZ7Pt z0lCA#JLWO{q_(t;eaTW675s`)++ENW&s1J0=mmbTfagm_A$iZjzD|<*XED#FUyBQ( zXXvirae+~F%}dC$g|`)61n%~tUBP>tQFR?l$S?8VgLhEfk-P-4dX|tMamdH}$OmF0 z3UKlN7Cx^21Myvv!iW;`(}a%)x731)mx5^J3f9k^6)e|7!gp4%SML`7WyNO5zgDok z$sH(n?7+CkcVMiOI_yRYl^yni&*{LPbCz)SBHdDd?2QXMd;-m-9qvI2S4s+ZivA-a zza)IG_#71ZNC(!iuOsuy5Z*yJ+uc%wL_W16d(o7Ro1wW#WVWnNT_vHnc4RAT?Z{Sm zRpbvlvPXU0@k?0pyXZITM4xt@zJX6^r(f`vRCoB`>eJ~kd_M1#9sr|>1|8yMNE~hW~iNdG$Wr?)S3q`)G?^ryfdqzS(7w+pPv4r;& zK1ule{_IP2{aN$t`}3-OcYmg~MYulqclKX^)L!b(u|;16_CR)f(Wjzm9nV-{;c3Ek zt-gFbTc77F#{c7K!zaSOKA!n9N4GV9J)ZqDZh*7}`hcZ$f6(dcKCDwtAHckdh4&k9 zA#58lfT@iaK63!AT_~ZtpRb1e=U!wfZQ)G=*w1ylZy&(k?mOWUq!2t|1$f*EYr#)H z;aPBkeb*$6&O0g zm!}ekMj)q)+){WkxTE?Gy&%?6rwm<+&{?8WGxTEkEEk^}MRW5|rt`dnzApSd;hzfs zRd~#>8pLWoECQY*ye)X1DiOJ281w2Xa<5^RL#IEuJK_x;#u}&`#=fd+PuGL4TU|3V zhp~pw1b6FG*U~w|*cLSsdeN{|NOSEl*1*le9~Azy@I9jQk?=2t9~S=7@a4hu%G4s}1*{Z_X{rxCA7ZE%jaEBG2} z%!a=;f_SmwQ{}kA;7G>L`T%BC<1z`tib3g*P8X{Z=BEjJi11rz(VZ5uaYd2MQk{ ze4Ox^;F!0M8jX|}iqA#DR|~&M_+7&PF8p!fFOK3odEcl{f|!>|F24$QPGi0ar%ga= z&4srU-bMU5+W6FQr_u63!bhGq6`G?(o+*63@I}He6TVjX4Z?2|zWFrH-XDgHof-xd4!Yk%Q~gdY}uM7VEU3Th)PyvaD$Ow(~pr=`ekArG(P88^I+=NIdCD{4%i z9sNaf@Hp1MXyG&AgKNz=_JJoP^qFyw#+RwL#$g;bwnh434}N7mgZe4Fr{ z;1%kb@sZdH^{Vha!aorHx$tkmed@JeO33awzi~pp1WW1byB@ z6#lb>#!aM7y6{}#JZmh~c_Qaj{U&n!KWQSb3zfnrP2`w=&P4t?SUQnckaZK8<{hHB zY2pyr!_%*_pCsXq#k?$71S@<^LJB3dbofkxY zOZemwLlQ>T=@FabbA|d~5?kk6;l9a~6DLna?KK0hP;G>_7yoYHK6T1uj)dbUvscfU zd~br=4|fHhgFV+xCf_@b{1%bNjCjtY(+0m`@0d)!N%%J5j|+cB_{+lI6kgVgn(vAH zvG4=JzY}gxX%qbwT-NIo{Hh91Ax{Q(t=c*1Wmu9m<>iD5HDLLtQsQx6mUEzn>rlJD#lGsXcADfralLsD`V(Cf9lKNOQ*I81f=%{)TL8L z;E4r$Y(QNj@`kAo+0g94UnQL32h{CTeRwYSkno*Tvl03da>re%X-9uqR8LE2GOBKY z@H%iuT{4a5*ScvukFFQKahhW}>S6JJMtt7IeBM#7i2uH6ybti{w3C|n)K}9^0Y5x# zGgA0%8rnt0PNycV8dbLiGUhYFIjW%S!a1sps^fSvs*dBys5*`$qw3xk&2PcISFYi8 z&J32~)ft=+2ajr+%Kndvt-BtmlH6{MD(igWtE}x!D~)`rJ=Z@#lV*oMJVv z+1@n8+S9PRRf?6p6sydvF~YxDYPCtRiY|N)eEfwUg0H-=dv1#L#D#sp4_|mZc&L%Q zTjL<`VZ!SgKZU$j$OKC7@Ol&65Wd_ZO?Pis#wFX@f+Y9J=gVrLf zO#RKEdk|KpHVV?^D_0K*sz+(VR=L_CXpL$eH^J(l_8U|XHyzIu{8DXeRB2q5)m61H zs7u^ARyQ@!pneGJr6vf{IrLUD1nC@ltFw&e(6~D5IJMTG(zr{k{_1Xn`T-rUo)E-T zR$2qpfhfwuPCDO5QP>)+my+RWf0wvxt)Z$zYqlrtyww`6h8WZjXoQ+7s4+AnF3}pP zP8Y-+?gqLpio(`tb!!ymVdtGqg4U?@aa*jh>SKfM1Dc@Hr30-|j{{9sLkxN??g^}^ zm}}4{Kr_^326c&h)|#ar6Vw>`Cv2Ikb{Uiq-wLbxUKYeU%L97b#2Xm@HZ)^%S-!^5 zN%0?9Rk)+A(RjqGQaKt)yegF+MVSaIi=wZrvs8CMOQCt#s#eEG!}74V&Cn>y1R51Z zUs>m_NAV%6#H`ZTQto)?z)x7;HTBI39W#}3EF8hmE~%YpnA1C zA;VswnzW@R!&2;(DpQaiX;-OyK{}OH>Z+(_GWXreXFR6T+Fq@05u{UDqy8yKr?OW0 zxe!zBjP24S6W{&5U64-m3WcRb3=_+)PV~9IjUBh1AqJT&+%yq7?fYwM>vs^IEl1kWTYj)uBk|z%;K_ zsU<`@&Fj=OLG@~TlMeQE>M}t(hxKZ^3EQ2}!@fb~w`V+EFB?=pK{~%1)nGvlp%0o2 zuy0f&4LZZywIf6yjguONT+#=`X!1o)h#Me#@rb;%Kn?m z*C^y9w!)rUy$x!Sm^sz16-;xLT9P=~zEk;o z5NXTqQaOU^75mv;s=Gm}6KC3YtI>iQ)yBj#?Tu<$6rE?^t4`_3R2VPCzE7Pcs8M~L zSa092-j1T>_5*4|FKVtz|9y07{DbN_L3)&WP`xf_jmk~F(SA^6U)FE5v2Msho?jJ zf_xgO<;i(iJCF zQrr3VsFemSPOb30r#1;%qt>N%2C5uL%~k4_)V{tC)g+CihkT?~3eqk8k$PLB(EF(a zeIKj+27Q~_&H7k>&r#115|;oCi=cra}DYond$ppwH-{&#?XMsJl~J1r$M6x9WSUpG%=EB z{isedVdn{&WYF43CRRFbG@3U?T4C3{EgGqfkvyQLLv#*1k>)>Cp+T<*>aUUdJhILH zhk8N~XF;ocKdHB)Xua=Ol|GEA)T=J(&)C1Kfd=(Uztd-1n++O+Fu%3mpsIBIMzEHi zq~k41-(d%>aVKlE9-1-MWrB2T##?=cGpsRmfBHOMqII31rxn{a(K=-$!=6?=<5H}R z8c9p1SlbO^OQ%?m8N`-Ov7R&W*wQK1TPBPxonq}Xh;5rPb788M%7__s+G@xq)HH3EK2UZX3 zCKJZleGltygFbGN3Djenw&mLv1ARTM{svi@+w7j!EQ69V^Q>OhSq8Pwoa66hoo`UL z%(H;%3>uQzO7*gq8C02>33Qb~Rheh|ds`a}suy&-L02G^-qt3AZpvH)w8fw;nM;7m zr)xW3%DmX$$Le9wN0}>twixtNW;g3NYllIxSwznml#{j2f1H&wL#NU)D-mJ&2KCI! z11dFWsGwd3P0G3k@dg@Hm30Hq)dq3=>}$Ovs6NE;v!C^WpoY+5q|(niWHc|!`kTL> z^^-xjWZem5&D6GR&)VegZ-otdIqM;yWP?6LD#u%y2K}D(i2ryi*P!I=CxA)}%FWKR z23SK4>YZHxw8)^*+0Xb-u$CIMF#AQI%MH2~VFRrz47v|t1FiK2?aF@5f1-7(K_6zn z1GGud8ueTDe*Ylrph2-YpZbSb|1c;s=PUnE%bvyZtx-ieKlo3w;tlGNbHqQ~N;hao zPB1XiYHiR=q%z7X6|_p#}|3(Tu<>t2Ts|>2o8)es9ldw*kBlM+ttyF_mcdkaa2}nF0!txCt9Prx7`-F z*m^_IDs@WR-u_Fik4@N=woe2uv+9;;&ADy&+RLrm1+7xGZC?niuu>az*mZ4R3#_ze z32IRHw|zIT#@e)$VfE_CwjTzrunrq^u$kq>D7l0=mKKzf7YZ zKsQ@+FV^TZpxdk-mk>3mbMm*@cUiBm&|xd{zYE-Lby%y>E%~j~Jyzls8a|8kF7cr@%&Q$n`obpaUI_%VTzXvv3i8m27sCn%i=RxbBK}(^z%^G)? z)?9}i9=1Lf)Szx@7jYi8O7GTT54J0G9=GneN2BN4-5A(uePq!7b`{Q(R@_F0HDErt z&3?){f0IT(BF(3*MuYIiEYKE%G7GlZPg_0i*J)M&?XprI(C7r9XRJ04YBUMxS?jPt z=NHVhpR+0-VwnDY`+{}5pf$=V8E3y>#cpAko|U|49sc`K%@-}o?mcQ3@m}-Q&dVl@ z_nOyxP(kQc=T$33r>V{?x!>7sWk%6f=QV4%LFXdu4QpH!ZFSzXt}|$H$>Yx3*5N36 z!Fk6TvX#~};=afm&K_%&L0161YfXxV?Q`~8bED{UXPPB^kk=tmH>@*oR2-pH|B#`ri4)s)!;d zc*N=-MNNWuCm@P`bA0wJLG|iuSRJspo3LFat%HtzAgb9q7_xsg$k+aU?5E{Cs&n_X z--?Y^QVmK(SiF6$pnBE1eNiyMzF$y->e0S)Fv)%;8rD0QVsG5RRMx45!6CtPdrK4z z4>q&Ycj~aU!DWFK_BewYf}?|(_8~!fMxAX>dy1Nkq007oR<=FYpy}-kfX*?f8euth ztwGBXmSZ;>bSJ`E+RF`k9bql)D-GiOx|Mx{K}XuB0^M#-=I?%fYT~yji<=Gz@w6Zi4=%7KIN4B*O8^n2J zTl+VIIRDJI15fLk;QTY+PB4fw+;(=vAkJ{x*?9(WK3`y$7{vK}f!*04&gTp5-Ue|# zUuX{$)DYr5<05;M4pUc`CaWTQw$Z!|WiPhp8T16oUTj}%5a)a)_U#67&R1f;Wzc)2 zbA#>e_YFE+S`GBML7a(~+ADYI@^L0!YF}kgY#EV!856yLGsjZ9;u)>UnPaKl&mhhm z%k04hapqWNpJEVaj^*|^gE(_6x2FqQ7s@JI5UjB0ny~V+#Xx5pG_0%vsMer4Wvx^P z`$B_i%QAuPGKh2Uj`nMU^xV6X{jLe)Y`c^FkwKhocd`!}#MyRd+xM(45og<-?KTE+ zuHVHjGKh2iE_Q!|IQQ;q4>5>y@2>W#2CXbhw7S{j4Z5Q&6=;z`Pav$j-DuF~Wxasz zF(^>p&FW!4Xi%&2M4(3u>R+A;v`3Jh)AqCv3R)LBv;5*3ZyKpy71=-?UX@gU zGSx79hM-TauaooCN%r}Io&+kePO|aA6&wwrK@|giC)+0rst=78^rAttE4JAu+aDV= zv{NfJ-2PQiW2nBR^qw zJG{<#xEItZPmQt9GU#nV*9mG2{m>~VG{%12Ag6OqXsjLghK`rf8NX%hE(YZbnkJ}0 zb?KaKjk9ktsDI~z(0Kbttr?ouxtoP;$KTXeU)s4_XrevIpc{ZD*;fgwR}XdWADV1` zEC}=K&Q55$o&Of&HK^A+4-3t*7a6o8_q5RI_6|Yy>Wj{q>J0m!LB9i?X{W!f^ULls zGgM`tY*2fkv+QMp>Q&z^d1{{hq(LVMIwYt;P3V$s&9l3_qffacq` z3u;iSyEKH(wo~_rrnbt*MKgu zSMJy7n=X4om)f@*WOscnbeVno2RbYb=yE&tBaMoImfPb#)@UHm3j0Yx>##y&NN}b7 zN)+u6t+IQ3LQRH!8d_tkPl@W)*shuC3VWQOMpe}{Ppz{Le!;L+>g=vxh1S^}zSNq_ z5q710nL*bJ`dkp>Wg=|S0csL$v#+wZ8}ww?BcZG9{ZZtEueB!~q~uWw(eTJoU1RqG)vBHoHp{MZ$O3{i7%| ze7Aja6txN8Yfmt!Temjh2kg0m>eaArMd82O%M6;>tt`C7e)6BpeU)0!ty}mJ8=p=R zTfR;_F1*8T6GcP9kJ|$cTGg#Gywjc=MOOr#v{xE*8_MvseK3kf1a{eYAw$x$eQjT9(Cd9pj`_yE!Jv=(oCA$yZS!Q(Q4wi=Xi zTr2gh{kTE-2>aH4&Y(^R`_A5N&;W#eXTNLED1?1)e`L@Mgne%xH0WG}9kve}bQ!`9 z+rJrf6T*J513_IAk0a~{J3%99+aK*n6m7GAv~!{;Q~kpp5JhuhezGeC)#EwfyqKTu zM+NB_%Ww9({||3(0vJ_w{g2=G?i)zRN=R4})(`~&2_S-k5|WTa5)zWIiiSyM62^o~ zGBep&ln5%VShZLy6&H%TShZ^FUZ`lrrPZ(2rEXBIqN0M;7F>UybMAdJZ!*F9{q_I* z+w#dh=bpQtd+xdS-8WB3vLE@a`L3qOkNnm=q$%?JzccAQIvP##{J%55)f9Po-I;S#Qr^bYUO}t9l&>@O6hG6jz)gC3WyK zN|U#1ioDnX@?K4m7dt?Hq$%p_bosfasISxI*P5c8RECteV@%^fJE;trs405lFi@sz zYFy#@{RYZYHAOqALGnyZ(N1cREY=k5qz20hP0>zjuw14o+DQ$OZcWinYKYvVsZ$G^ z`VN&_G*wg>0Cl&fy74q(nB1eOC51#ir>XkF@t|JQ6zz{P<>#8B{ZXdOOj7NmolTZJ zSyQBuS@KLx(avVLEYcM1Y=+AUP0`L~gj}jA+S!bdZl=`EW~5xLe zc1@A5KT6)DDf0D4$vsSUi?+fM#%TFZrZ&c1Qdlg<$ggb*JK8Z);?_55Iqek3$iYmh zr=8jI9vyd0;cxq#AgxrA>=rkpUrv;7YU+`~95GH_(Vybf>=-A<(FZA@*K|i>yqusZ znjPci$(o|sFV%QRI{bPuQpHAN#fRlcq%8nLPJD^1ZnnksRC!6nelnJOzZ zMLX}QvQ<;0OH<``O%2Z_>Jd$mE=`s1Yl?OuQ)S-_%2PcPo+<}3b+!0w(VzRF1WoNP zdbQtldB3JUE_$cm4EY^X*fA90xgmZrR@E%N7|#u5il(xP-|u(29K=+2+~neqK%JoD z@^SfcmMqa!6;stpQZy8Q)^C=)S;dKt;xGEmmM<`+EYTSeu47xiUu-t6X+!>b8=P`c=p$ zHAS}#7Rnbib#Dn#gR(dm%!i=~3+0JnYE(j{+`v>fmsc&HRdI3epM`r5@+D1uan}3& zs^uF>GVZ&xJ_7Zgj*FY0YAlk6blmXy>7c&UanlgD7@rtdZ8&TGZga6LV5%E8O2#ED zlW%Hj@%%{%%Vp+BC3)U_Jgbujnd%m6nYwWl#dV9HGKIr1rnWM*S5w!`pPF#C{AN7G zT`6|WpPf)6C!D0H-_DK4DBUzSiWADyUj`6F^UPi9V5k}uC+l5n0}!Bn^S zJL3FuMy`@PJij)=+&VeQ#*#+K*cca~<+m#g3xOe#+`Hp{mZ#kPF2 z{8m#mkMKF&IV{Qd-8RdSisE^+SlR@_j7s0Tot#7snmQ$ zoy$}UQ|d;~&*g(UuAzKK!p~)Pfs*u>=NMb%98GnW-;%IZo~5ac)9ozB$AN=2Q;)NPtNo2k?)ic=bLoy@FeO3YvQc*6Cvn5nIza^c>D z8)S$nrCB@V$4U~K^{}}^eif#Ux_&KPi|jnl>vxk(4^yut+#+9QO7-sT5)b5Av&b&p zE+;V6E%GagYSPpKrVeUqxr$rDC9oyBU51!aR{wU{wv_W^{oExxHAVWlORm)v+4)`a zT1}Bg?vlUO6lvrxd8ejGBX`N)DvB-pUGgDKkw)GvcWa6~k9*|POwk>z{R#KU{>xN7 z8!JCc_?;ZWRCnB($}d5UR&nUT+JxWBnlSaS`H*Z5Q%7A7%dRkWUcX1><}meI!sBwq zaw?%)d|s6!_QZFkjbuvo{2%2_Om&O#)#Hsn%5QZXjl&ai z!U~lqjl&bNNmDcqPssO~x|notE$6Cq)2qiNJ|*|AR8&dzwti2`U2dY( z>bpgmEo{@)D9FNg6 z^52@GF?vpZrzskv=Ve^2s@XGxPfmP6b~2^(`X#x6sjcFt)iV=cl2@EZk}B?Hxr-_F z&dAGhWuwYv?~)wxvfQt!*O_W+qPUIX6Q;h=)b~po5?_{^S5w?p(Qj#U;w$n&rZ$R< zr45OHlSi9Xx)DoLjW^{6zoI5C?M!@Aexa#ZkbFn>Yo)kuF>mS9<^egGsg0sy=>>`J z$rYMfzO**seK{kba`7z95eMZiO*JpQIPsu7F{I);mu^Y?NKS53)XyM!Nbb_qcBYoL ztGJt)I;g3;mtK{4NOpIqxQCaHH$IcQHTCS$YZDL4KXZpA0LPcdR+mUcgF29JWxW&tIjIU&^rdpSc2i2%3 zJUO^2@oU);rhb$7t=t@@9!eC}_AvFQM9VsQu_}Q)t9WbEC5qazEY*m&4l>m(u2@EK zrJGgU_GPam##;|+>Xv2u6B8`!rz-B0N$)2nS`|MdN@-7$g<$ykyG_ya_iGbVbR0c@ z|0FRrOpT8_nmE9!x}0($pIs!STN{|VS{z-LkTk^F!jvjusCDiYBuTb>Owv&6yf8H( zDbs2XQ!|oASQmz=xk;m~TbOz(e(>`0q#Wx$P30_K1nOla$+s6zu-?-YJzYJ)s<@KN zi=!RNiPkxqqP_iz*7;056+dnHX~sC~3Qf&n>L#Z2-q1R%;?&;I%J@0u`4ry<9d8ZR z6j_Gx)@((wKQZ1qN5_$!7;kwrMRsDmb&saVPK>vHuha3~(E6LEcyDMO&=lE;$<{$l zk#~`6C2pmgbQ-P*6Ib%;CF%DzhV3!OpCuqJ4V z&LC!3#hRkqk~6IeP0?-1nbv2T`U3v-Y1Y3L#iMzeC4a$rf|`&t%Ss7TGm_4#2QXf%uP`3&xP9r#=VkOp#I*vxH#ClCrG-4&z%wKZpeDYOd%~2GdckDLL zvUX^SMy$-bO;a>t<<>o#q7kdGQm>(0$b-PUbJqRah*INMWqqS58oz3*;8!Y+#&40e zSyMEAi>>FFQnPA_^#xO8^)E_VVuh}ybQ`fFdcWUt>t#*NJ9|gMa%;|=DsI8q*r8ZU zHFe9fr_HmiO`57Y8+ZMzt2Fhqv>gfOS_OAeI#phcbyF1e7*lG^sj;3^l$g5WXGt}d z^&3^*yt99mE`RAq^S6RRPnBr86eqjw}N|o>n>(OxBsmZ^vPCH~vK5TBY=7p(+$-lBH z!_;~Gwp-_hspZMnTTNlglf1)vLs4w`ZnoZK3Vt0d-_6z`9rt)ms&R|;g{EGtNe9*c z6E2udVP0{?j)jCa6H2ZI}=4$G_n$tj)GSw~qU6Uhjv#d`k7v*)`W_dm%s#~P3 z%n^55BM&QT#LDr;oz`Zip5pnp%X&^z^sd4#EB6T31?Sg96)~k|_%5qL$K5vNVe>9) z@aHN|^6P$M-SbaH<*eM+?;dOK7mAv)vNic$YsQy~dS-BE@^7u%m{PX<0qagp(HY_an)Fu+qO))RpeN z$$zxmhKV?(XM3&9f+$tOUdtC1*BYj>#9nI+Q&)>|wR@AFv^HsKR_)8lf3lupYO9!6 z`>FY?^^&G4Yu`zJ&f3qED(`vgAXBP5+@!`=c9dW6e)98HOW#Oc{>MsdCoFYCsn zykYIq)Yo;b@(t?+rj$m$VXa7{bloD!lOx`??oUxv7Odji)WA{e0Uh z)D(^8+g7QjXf*d*E12pQBR!+V0qZ$U&Ge)i2dqQ=RW7tz9I$?x&J_C-?^(ap6s=D0 zSvP5lwC+9YUQLnKy=OhHDbl+4tS2=^TKAsy98Q2K$GbA+Ys<~l#e)3ZZ>$S7)rk_mwQkVVMsJSz z*7}2{uJFE+_^ow7Q?y!qZw($od2SRtASqm)p^CcOyW145Pnja!9g`$oUxld&NiJ8P zVcZjln~@afN()nSlM-AfGo`$s6xS?Gkr$NWI!8&e6;5?EX^O0Hs_Qi^Nq%d8*GHNn zFQ~uk8>W(X3t zSt?J`x-?gcqS)3Aa81z^&5nVtnVO>6G1xUnQ{)8=ae0_heov-rm!`M})%Q|hmEjdWe3sWa*?O&R5yFoMTH zEU4d_GR8HXsg2_7`fVv=T@^a6wf<@I1lK`Lt*cM6#=A;Ks&wn>Z%8@G^)gdeii_)S zPMPSMGm7Gfx+7(hE5uZ{_<23v(sCWt)GhUQr=09cA5D@twXOeMO0H`bQx}VU^|c98 zUH?=R&$v@u--N00#wo6TW4Lt0J)Sb%HBnJ~(mlg9JskJ2Im0zCOr6(nrfYGS+M9B^ zD-fohO_}ZbS(th$Wsd7krfBE(c1nTk?oZN!yF$gTZ!~poLk=h_n`;)= z)G!`YDpTrYw#0S5rf8%~T{kLoJ6zO2O>oJ{0r6*d!3H7uEN!4EY%FpWe`{CN@7aAdtBwp&~fBlRJkTIrB<0L*W8Pd zOs_yyu2Myb&UL35Rj$wZ4Ft71Rk^-Vlz4JofmP)?OWnQW@vCxG>YI39pFc6P%C(Yj zwHz?YI&zFfu5@*eC4S6>LqKKfTP^2Zn1k;?WowGwkzVBTXvtq)*gt)dtBENp9nU6Q zYnj6P9Z0v>MW5-ox}i5T#SISrZ3vs9U@1d?xZa0F>H7 zQa&brC5&1@^~85;fi7`g67^^5d4$SprE~bdX*JniQw-&NdJp5VGS^o1QlyQhn1EDL z%miBaWlMXkZNB3CP~Gs`i7}(&R;N#~WoekLHBiYw+r0inEwg3N*Pz zhFIbVyE&HLO;!4AigtwQ_dJ}Ug20(!#6mr@GTB2JwL)> zLQ^Qd@);CIg^6$b5)nzMy$dx5m827Cbuh*Eod5N#=T1~M!D)N@HrGZ<%-5WkSaZ3`$|$}%gMqv}w{oFR=g_Zykt!JIW5re0Nc0KfjnHT)^ZUKWnE zE%R39Zv#qkeK^(>cX9Y}j(w8DYNk+Fia!A@@xuQve5E0O<+46xRIO8CwNj8TVT#Yf zvG_ez?l&b#A3wz}MFTDTS~%H5)x#=hB{QgrdNLbmK@wYDNSgS4!-%9Q1|bJ~RZ_EF zVz+&$8^? zZgrHX!m;hTk7ZO#pFvoPe=z3|PJ7z*9Scj^Hb==6Ge5R& zjY$P?E&yO_F>A ze1m{-IM><9afY3x@8$f}dZ)t5_x}1E%1ueWz%p-fxoS_R!m2*B{+i-r#M&OIGxjZR z^-<2j>HjMqUhM_UW-2QZmfFL2a+DqG$+3TwvaGuJpN%iaM;iX-6? z;i)>p%Fa9MrZ}`C>uukZ?C+gVsno97)|}Y>S8Y+VZ!q$KpT#zOIOq92+ZMHk5}INp z^PP2z?JJdbJWEdIJWmJWdk{cNsC~rD1(aJJ^9z_?1T=)QQIrF|Ou?nA97>q8fF-L~ zatToF>F`B4=GOtSo95UM$ExtFXOrYQaIo(NS}fxdB#$qMIV4qh^N;2$$Oqj7Vm2DoAU_w;THAPJwRb5vJN~@h5%E8jw zuKK}=|6BVXtCPy!Dmz(&voZtULm_mQ5~+{97E@dPyZZmXtGOES$*h5wVJz_NKepav z?QPvw7EJLkhm0wH4wT{-KucT$bcr3nKH?@IzHP)B{$u6)@_A;QsP#m8@-EIt)lJn( z>6OwtB}t=Til-nc1=Y~vd|bRv_2KiwzU;rn@$8Nl&qJ~wzH}o*f;h%)q;(1(e&@DZ zK#OHux+X6`-V`r!{v>G$YP*Zu-iO=Xms=gjsp562*#4oOvGaTdVMDwL#0fJ{@@%s7 zZjLm^)*0tqaOyenZF{aXO>t<39$)igHCb6*rB|xlSbO^!*EZIcDs7L=Gj@F>yJw&6 zsJRoduK3y%+gs%iDEp~oj&lDfOZ7d6Q(LLkWNFpeJHG7*jv=xc`_@r^_6O4UUr1&w z&?Qa+8e$S;Ot!QV-=w2hRhH_#X`HjN8)SuC$6YI9TNm2{s%NMbCZCC+?X0DAKBjC1 zo~3e~$!^$TW$P9)pR6vvBg3s$9Hse69|%q1Wl0rQy%Y(fjU1~mk~Z3ItCdBqT%?V* z*8P8Lb^qU4EvL_>yp9gE+7w;fc4v4h`*k#S_7f;&z16rV%Qmu{dO+b?&gVkT=VA_D z#^D)fQU1yY`?Q|qujE)2cFtVqY*q3~(C34$Vm@~~8ZH;MNs8ws)OtY-5E3L#_4t|%YZ%f0kAW=WG_3aWfP$K2O6nIzL%V`BD zF-Md#7KlgM4k6WU$XA1tZd8j=?Z$v=F}6K^K!M0@-_~cQIlVn?z&26VK5RgLd@0~J zW+|sC5H*Nx6~Xo~16swU?Gp#gG=JHihFaa&e(He!=FGHL(Z)N#DP_rS^ZE8fa|M^1 zYrfjPe!vQpbqGDPpTnQEZv^LP`(*>Rai4owvPtB1Z0qA;$#}l$QerOdSYgJChK~19 ztFDfZ2i$I6*75m(BgXW+(W1Y&wIe?LUXye(-pK3dpPs8q6m+*Imv53ig#2^x%`du# zn=9z9P%ht0%M~=@xq|NfO1%(%``>D0P;>C~%@=(ibd^V4q^Nu3LU z13Ooww~Dcy=L08oZURp4%rTB2ZD(SusP6m;ICYE<_1%tqE^50KoGUvEtX6SdCvKOE zn;GwBe30=8#yGAU9t{j8-pFmqKYI`|- zh%D@SBYl*t>iPt=B|X0#zZ~;Vd?!G)o!{>ebTcZK?=s~ozPz~WSo%zaQ#0~pQYYSz zM|hd*UgU5r{UPqj68XojbfZMR!1zJexQr6{P1j^#+?rD}+(ni^rUWi5HdUD!nJ!ipDeLX_}5Mzc)M7;wySTe*tB+2dWm`YTAF1S zwXGUB&b(*sCg9_1H@jXJ&$l<2x#ml2F9qk_wLc%2%XVy>d2sFD!1ssK1T(_=c z&=%%zVScN4f8AAst`h%Rmt$N7{-Lz1gj~O^&vx!%>cc+_+Ri%PDw5Wp2HmLcd~(nc zbMX4Bt?hz-m2JEDYRX>*(Y*dQ&}v)O_jWOEeJVzC`ug9QH*wB4ah^AE{;j~r2fxUp zK)Bd^ox?NDn)ORzks8;>5B*Sftj{qH$gS&BhaQn%O&K`!n3U^Bi({C}SqR^P{0)or zCmxt3s3*Nc6Jh@YLw7OW&$IP*@yhzHzWv$8_J`zsLtn>l!;(DRy(9iH{8%X28Oq`9 zp)<|O+J68)TmR9}M|m8HA3v3476ZTvb zo&VUdW5Rd-ABW{yt>;(tn`v!1|D$0utzQElMcWTETA5^3HV*J`?>!34$b3}1eST)< zOf%zxQ!`&i>{-Gi#$QkZNwP(cijyyxJkV#&yx@k6R%>5z4_q*R_?6t}+cf5Fs2F}sEZ;C%?65|)FO6S;o>@HnP44+O zxo5Un4I9QA+pKkrTN&@(kR`TRPaxGc>s5qTaPMuiK0gw@tC{9fe$u$gNlb&nPg zNm_l5@fwtC_L)>qwM4S$d8 z_8x20Ar8kI^j6{#?tx>#bfdq~xv>==P^7Tox_aXsBW^cu-1z{TtMg~0E!Nva#!;>_H{CfV(V%t8 zGAcJ6N*f3Mcq7rE*=HHlUdw3Sw5`uL9sl>0%CWuqXtMC3LI?i0cM&{N%WZcEHK-A0eB+g1oN*5 zPd5JsoMyfw`-&On2f$h8N5DDeC*W6@Tq3@<9w#2fS1{wmZhW0RPVALb`qPrjmDIN{ zbL?vzep6DfzQ>${EPsgQ4@;`;7o6&-q%rzN(imA5|__k&S1_g#yQL{V16lcDwyNp@G1^p(}(ie-iLCyu@B|&O<&@OIO14w#EFZe5)H7k)? zH-~dB;GBy&=h8&#rHaJ=L2Py6tH7m+Zvs~&9ssUPd>`oHoL6zVO^JU--%i6fs^i6s zBb4HKVMe3GIPoA#g#M#M=zkLR$zGI;8OO0NFuu$( zuQ9&KlKWZmJ(fI}M7?(?iF)ra;}=QPheuI!Xk!xfp-3i-OQsSNlc~hiWGZnmb26E; zF8TZ9II$twN{JJjlH-9dbL?vz`zFh0rjP|2$(Wr&xt*9oxlKr++$N_`pHEAnKA(|7 zy*(@C4&*r}@Ljy76DPr9o)5fK%mr>0kETu%J4GA9C*f;?lkmmkNx;)Z zAuwO~foF?0U>z*jB+)1?L^vpJ2CfzN0yiRueB}0XpbFn7_NBgSTq?dumFA^lc>giL z;{N%-K>s@6_Wm1zPxasFx>S6hvC~EJJ6)7k_W8Q+bg{9Ij5~Yi#y-T~*ymD_i!jCJ z_5E5L?(YWvyMH(E`~EwCebV*-lhY0WGt!JW2`ic(Px`S}FCMX}|1k91?*1gdpK(JPm331F^D`2R)6?Sz?d*HX$Z^0= zNAAfa$pef=7KKMK<}tb%ZycUrT$N#sp&YtTAekE(cQEc|+{3t^@c^SZktFfcaFi$G z9L7Axm5gr2-HiJg@#ArjAIUg}aV6u9@xkQkFlPa1P^2#tn@78N~{gVVuJ#@SSh;0ORge6yDD$e9UKb zGp-ELsBH)l|3=1}+G*5Ab`rl}4TZ&}oQiS7WyIffHSzb~I3Fvc*g-glaV4Vx-%`Lr z;Y=ETJMkCB5nq?Z?OD)k@V5Ye*AjoQfR~4xGYGE7-*w=hkH4MxdjbB2@OK0L;spu3 z(FP$?hzsd2{=X5h0ly8hN&HXhtEq3M9!Ncy`bp}kX|vPv)5_C4Y3HYHOxu!nb=uCf z+tTh$n?2y_0gnuLVZiqTGSYL?m!x~rSEc*Yx2FFl{SWE;)4xxT&lsMOoiQiFlM%@1 z%(y6HOUCarp3QhMi5^nt|#%LdjCY#F$2;57s98hGEp#|FMQ@UH_8 z4E%WD;elTcbPXCZC}+_4LAirY9aK1I;h<%MJcBM8^s7O)4EpP!ZwJZ2se{K3o<8`j z!Igs>2d^1?<>2cE-!pjh(8i(bhW>Ksj-ihX-8=M|p??|r`OyBurVMKvcFC}thdn*) zAHz~It22L=c}M2snJ;C2kogThJvugPX4ZnN>Z~nU*Ja(Bb$`|~Subb3k@arY(X8*X zCJvuEe9rJK!^Md75#vY97_o4~$`Ox__+Z56Bg~QGMaszGBPWiWIBNQ+(?{ixDjroj zYVoMLQ8$dbb<`814vaEKr;Hvodd}#s(U*+=<>*^R|7P^Vqu&{QaP*g>zZz|g88Bwr zn1V6qjp-b-dCXN~?jG~IF?+|nI_AijlhjvRa9*d=3Y$2N{#Gj{XXUyi+F>^)`pVQ}r#1s0TFpY*u`R(6+4=%#cX^9_6%{CI8!`@UBWA3u6PHl@ZYglcwdx=kMSkzBhcf|#X|gSb+!0f zED|nbInFW86=_DJ$TU`qv4&sd7%li>UaQD8I>byg;i&}r;k1_$ih%nQ%77mvECe1& zSPc9&VL324k+36?Bu6I^PEDfNkNO-0p2y+)k|}Lj3h}RW;Fl>2F*nBaC;ln@N#>h0 zLTdnFB4fq?%0H8FLPnVs;Xa1Urjh4oCR_tFnJ=Cd&0z@AUvJJr4xUKu#a)= z#H|SbocY@(Qax{-NF_cvkxKc~MCySz8C7psvnaPD#<7g5XXei$`Lmf5oYfJJ7R{ox zsuik5s=dx0Q+n0SsZ`yrnYA8ioqclWEb5=wIzK#XBP5@hwHf$#E=%=*v+b&9RNIem z4g1WddY(9&+L*`Tn%S38iL-wWykPcr#+|@Tv+n?Io&8(jwT!p3{N1yummX$(YBsg; zZ=Bn~>Bk^>@|jehUk#uh{$zFy49J#zlG(}l2;<&->O)n}XE^*(z88}J;#gM!$)_+5 zV?2RzCZp;H)!VAQsy;ug&q`ADhDxi(NNH^B7`-!(MqwT6(#P|tw#U;PH44uD{MS6{ zA2s?vT&r{B@6qZb@-d*2SM~H3QRzyrK0W0L#5(hL)?aCh(&UF{QJ*V)R(X)562c#@)#D{(AD$~AJ$Z}q*-{GswUqLCgTtRN{%}4j)ep-&R%yU#@l{j) zKSn-OO?rF(GHTal%j=TtUQ(m^%jFb%1LF^ut7f9IPJiXLICJ~)`5ah5HBqG(tfW?` zQB!$Vt)%*>wLsM;c12K<)gH>H)>D!qgvaxrZTOjWRM!7pol_d9R>K=8hcz5l7IjMl z)!~Qx?fnaBB^|f1Y($(m%{1v86KIHGcwUZoA%Srs&$Pgw3pC&jxWLZ@rsA79eGpp= zG~gZJ!(#9g`hrto;#>gFTI0YO$$rHsV4PTF_5*)0&=6zbVVLkB2(#g7;2jMhZmPrE zFyLFHAbc7;4&2j#*J{FR$N(0LLBJAtAEsD|IvT>w*n)cDJw(*Pz%z8h^>}WL`>Twb zP?~|K>tn##f^rOT84z#0q8vPt2b$v7@MKJ!9-IWc3BHVpGue|7dmGL?O?;)E@ClqK zm^g<$1^A>m6}S)HjwznO8G|XFg~wxx=i%>|;?E)vXdCWR;mz73Da6d#Hz;30TLrualG0e&i$0T1I0!-VH_4pMy%#63e% z12hab&@}3R((nRZ_*5(2_cDBt>5K!7 zHgGZ+2f_0)#9+o@Mi=-)fzSkFEy9_M!;SR_k1%MjF%pP7mPR*lv_ZRzF+hy6aS_5} zff!}u65t8OPk<-le8mvsjmr=o$9R%)Il>c+D}fV@t-wjfFCcR=&=ix6Um~0fG{qES z8*r*|EpVD~9q<(62H0Dch=I%)hK;SwO;oHZUocs}D|;}LKcF)lS8 zLwJSp2jDrz9$=U81aOVW26LXo`czUlIP0@nhpva6SSW;uGU_gby)(YP4)!nXinoy?gC-^O@{c{(_^Gv0}>VH;u><8RC}!M}^~ZZi-3dw{06*TgrS#czS8 zxX&y^_g;tV8&1pef!ly$J6In&N=j zfbiderg+!%A^aZW`(`6J|6u&UT#fKS(~sB>fzW@m72%J8(0?bVfDZ&*cJybhQlZvYOIJAi}aPT*j9 zGjNE!6*yGh4jd-$MA}jKA}&^2#?kU_aK->(b>+RlvGP9PB>4dFWchpGWcd(qihKk( zRXzs!X+Y?(`~&bbxd(Wzt>lg|Si{s&D*@p&AV$qfLO30W zQL|EjLoHY)F^ntrDcY0SHgYnh*Sg zRR+#(#y?u+;Ot?1!di&%UaJcDl(h)>Cu<4tX=@qq8S8AMdd@lr;b$5DYSke8isc4= zYSjThv%J8=Rs$rD05K~qAMi`75%@1_HSnnA2OhIpA@dawW8?|~`?=c8Y_ZtDTd!iE z%Y}QEU&Tv!hl%}O0w(wS3oy0ci)M#N>qq?be(&Or`lInr#6J`NV*G3Ize#%|?Y*?G z(mDp*G2piYz8WxY;5mcV54v&CgM%gy{^`&whW>SE#jyHeb23*BPaZLO#ARcy9J77Q z&M`mDzCF8qZ0p#voR!r=yd$qU9kxrJh)vo7c_Mz*{O|ILTCCvm=q}hUx$-Wo;PSS= z;O$F!+Xq;|<%u5}_%-d@fFH^eKQhEe@z}8hkrsGPT3sfBVdHpe^>#q)9lH6 zgn6Uj!;i+lN$`qK)~9@VVh;TBd@&DRZ4v&R1&_82r+Jm|U90eKiC7FjbvZoKb8#!7 z5og!|oIy_%ZTQ!Y@#w(6PVl<$Zw>yf#lLmfV;0xjP>?Qc) zE$}vZ8{8qUC~xsLhl%_qe=rhNIo?e($?sjjiXklk4;I0eBMxYLbfq*~272sTn(^==`wu-qZ z*BuOY_ye9OCRHekksqjw&{g%FMc!s_z)k%XVI#Au5V|VD(bX#K^aVq{=7xE`CU0IH zB@(6n249`KDc|3GUR$$bmC#^`C98aOtEzpgy);ZM?tm}oZ${UnEPp^$VK7)YpN1wt z8CCh#cq0@gj8F^QPKvre5|mj}`5XkqmSiq0yP-y=m~b12Y-@>;sIrq4q!ugspjhG$G?s+Ct4XusRi->oCM|FB)rtad zeG@uXcbBHh+|BL=G~BK@4LykFdS8Q`K=(rt^^NM1l4j0{iwO!R#a&f`-U~Fln{-4( zA;Sz0^ji~l1)@ovPknX3>kYS7S2?P^EHJOBEx3verriwmf2p_K%jVlQwWvIr-$0rk zHot00pm!o>C^8SJj;bY*CQz^X>bTTAPZMbj602^}9ZQV4ZkqdQTJxW9Ir*4_b(|=Y zXCw>!f_(neDSD-W6&3i06{4;U1Bc0@a$Fs(^9N`^tGa@u4CS@w!OpQ&5oK*nsGd6* z3NJnpTkdEgC!ADLE_9Y91-@X5Kj^N-T&>pmPRjQ~#n^xbC$R;G!7U-%1^Ws?7zkAX zr=U|nlmwwNJpaR?C0Hx<#1;9gymgI`2nX!NMa=Vcf?wbZpm;w_Q;|0Wy3|)2a0j{; zdjqs^ib)hF+TBfU-kKV*z~2l-Xkm!MyzA*lo=6X$|=*uqUK;*ON&2%369}y z_cwY)NnWt4xvtV1MCS<(hgapf-UeT@7AtJ_=n%{lj93kHfwR$MUOkirVP#G=lXR`g zONEgobEdNCx!!tzz)O@$X!AL{SaxiNd4alBzIN~2E-X(ZFJSzf1!+>1!!}G6r1@M< zEIU$;Qx0KowRd%kF4Hc`ZbLKH&|ac-Q+_Cxic`yH#E9Fub9E!l)A~bAROM=hYLz3F zi#=YXlfT5@*5oN~_Xax1Q?OSnDj-rc^-##$?2L>mJrBO(amwZ>@~di8SBe@hR$Q#{ z)&7vXNz~N2o9kezYREbVL#i1yu&}hM)wtE@l6N9%YH5tI9yAB*y#aU&q9#OHaNkt> z?FiA}4ROuGMZn95W{^aF8?tED<&i`bgC$hOI8FsQ=dgRq*@h{K(|W!_5ue&wrI?a?&0LMMV0D7URFj^PDo=&i6E(+` z#<4qPk1@>{k8?y6LswW4wyf449#?k&y&$4gOlgL#xY|ut)v}pfv?ic-c4Z@+$h4+T z*0s>lc0JYhpwwT-E;|+$?%Rlv4uu73yq$G=uBwKHcMMbpEdZJkP11^!T&t*yJRY}95) zEGS=4DDoB*i1JFY6#q~(rq^mltau0)1-zJzf$CN6W@orOP}th$ZmRZ+Qf$<8d?Xl& zw#85*J4l^@#jDmI^a@gBJ6uR>7z)E;ulFhJ@rhYl;Ecwanz`5_q6g;ryiFcqCyeZL zu&oi*ek|sY5jEiqd3z)Zkasn;i9vUMH98Xe+y;0Sfx=GPMWW3m_9~(#0AmxNpq*!# zJA_q6?aHcJ;KEP~Vwf=u<(sf;M$HfJqja{ENl#u+n$#xD3yO$5!gfo`vG_wf!n?y# zZ+%GARQeiLg;*n1h)Po-g*D+0XQ7_^MK`xGmP-x62(`lx!Lp5AXV6>W_tA!n3g|s% zfj_XCbll!kx+8rqYIv&{sf)dZR9a9Hal^>t;yo>ONw631Ym(}2ayFaT-zaZx>gpxE zp3!1fua%9_x7aS|HJvhzeDr}9VW|u^seqg_$M{ruo5>ZT?K{@97Hn@s1$;fP$LpEf zRqpXDXj@(D4V2ecL8!^Qu+0xCF%RyjzvBla@|r!R*u=q2bL2*L|374RJP}8JMP4}6 z!McD?ZCF{KdDKJ=j(^}Hx|=HeLG0V%m)7{2v6Iw}HTz@iT(OE_F=7s>5W-bnZ==mu zLcEh8fpOn3_9dX6_8(@wZ`PP~Z=-6@j+;;QadPyXJLx zs+!!vRTXZuC_EL2n&%HJ3VKWEXoCu{b(*XbowE5^O?VUyTl@}6?b01zj|(4JzOI#=3r2_SNR&6-Jv$vHlk<}bVakU-GkLY+&r9Suy25^ zNV6kdp69%_V2JD}#Ml5}b6VHv^;G-AR@M$w`&AUC0WBraCOQ;c)a+|*V;`B@Yi}^o z!Q?j+kJn171nre7y>v8FQ(TFTitOKNVESsw6||jFMNuMBKj@*mNu4dR{wxW&TUx^B z8KisMHal^c!Rb{Kl~%$h$C;NWtOn5;MP{Qm*O_?!s2Fgc$aIT_`DABiej&RNSuq~3r4zUK2dg*yieQ3vdDi(A1 zakD9+Cc1?*a7qB{L3w@TFd0W`ZjU>p)}3%2D2Ff+E<~N^sSY3s6cHh)``R(P)xm-4 zFB%)@Aa_z1b)d7lYJ_^JCLNgeTE%dU!Ud~B=a!b|&#$Q}SzcIEvY=+}vg*Pr3_Xsk zR-<26(*a~nvme_XQBzM=laG+>SzqO?Yl92aHAywD0cyLdOB9#oe4Z&vR5Gkh*dAfM6*Zmwr;ZL%VH5OU93Nq;rL3!C`?S>FQR&5r z4WX)D4dyKwB0iDD1oPLn)r+P6KuL2&6Rlk=8ZH*Th)NdC)`w-$OjsAY4`_U1^N8Z= zENHknVP0Ek6+B<9@&c*ryy|ca%Mu@y!bNW+6XtH}A!}Q$O7CiaJDui~c|ATi9e+-r zh6S{|J|7w5j4^x$Q;GA+fWs0VUy`>4IIIdA+g|gFL?fpjrr74dlDh3>*O_4z7L}0R z#zp0W+V;o_=jEi;Hu z>}848BdP&vj(rp#>N;5Uh;7EXgmw$C4TQ?@7RBb&`B&3fx+bYTrS4z|{wWMK3^4gK zQ4Eq$D>#o5ceobj%?l;4Q!|6RsIHFoVxF)>o|8cmyaJ%F)H05hSk6GKV{Xc4CTZ1hL2e?#76o zup-bTYzli5RM{{=iJcE5DAGyyh+pCkp5>!wg}ivHbxS?#AwjJ-3%umJb0n638gj0b z9bVAZ)TED$DN&`jwGC&xbUHkJ8Yfa#3!We;rslyDP}^NfLQVxzu#Tz+PgLz#ZVy@Y z44{XoVmc+^8k zRYg6K=F)nwbi1IMaLK)S!3D?wW)H3@m4|WbC5FzZ1S*Pr?UH7_lxRntygHakI_z+8X!_V>_(_cN?Co^|577eT>4V0M zQI4UWH;yO_j?#ARIjS^R4FZjMJv6B#$on9wzYcOM)q${1UWJ{Rr=`@tiXM{CQWxz> zgQ<)!R&;h{i{WN?_1=bZqju3c8}{*uX(v&_qGpZ#Ai1WVwjr#DJ-BM6WN(biiIOBA zEzH%D;pf--L2~p$P*WD76Dur#{3l=iX%5u~*$Ug?2(RF(BYJADO;-op zP*+mjlaS3&kEYT7Vy z3S0bjt3*wQuX*Ye9bV%N_=_>{qJ}4K__=Zoon}O+=sQlfjnIGTBqO|Gq;%v?V-OB~u2AOmAxLx99eN$A|4u5)1!3UKdh74IOJ zRNff1U#m9-d)52MK7%$FB*xQI6uX;oXQE>Mfb9Pawb`-nuuaw-}-+*l$)0e^FYqfcT|h8LmOEYxg@NkKa-M5zIbiH$5iF;RLW zp%SuI_S|BtKEg3MtZy56dKd!L=iwt$(nCHUBt;@W%ImRNYPDE`i(k~=c@1t~Gn|U9 zTDWGxDF05WjCNYc$>GZAA)V)IfMHeZ1IDODnLur^=!O_lyJ?g#?>HTAskLq325=-4 zjg2f0oK%ifOJ#>?P<_EwQ9cly587eSsA?rd20Q?`Q-jN5RFkL#+_1cs7J9l7-WaIn zGS@NY<#e{p9x|Rb;C>$8jllUZ&Jm-R7#vK8a8^x=7-j0P9{N~{nvQwm#*>VeE_w#p z*02h5-5$0uPo3M=ArBmbI)y1>fnP1N>a>QtkRDoySv=g){(a1Ym|1pHl(Qcjk8X2x zNNhYhx!rdhe>_$?#%cZ$BJ5Yk$VGOiv8Nb(W)XD?;5Y$@+U!T|>!Y^tjxDyHXVCBH z4ZA~xW@$`3PfT73BbCL)Q|C6?xl4A0d#usgYlz+%V^rADi(Z$NPDi%AVdv5wMD6p% zY)b8TxB+TIiW!URR*{V;c{h$p;0TrkZ9lIUjl+t3oPA=nW{KXnd_SaKB1W5HIcig; zeG~hDPhEN=145=Hyic*cI&HWd%VXGwbKdoG^q5{V@fZk$i%Z2g9Tu<}IOFAs?YAwe zC@8O@yJK|zgRHPzY2%+O^i4$AGFTLK3opFo6IJkuvFOo*8+Bidtq(nAL^&Q09yF|` zzmyhYIDcgmLRWq@7p3tPSdwstHQO=DEM{k@3{m*(4w)&A%1nhL<#k~O==&>>jO6Jg z=63O71D1U&H!N2I3yJ2bGr@3Cv|nYL7GR%+wp>+pxIq!5ou*BYn^T1gcvK^_T6uTc zE|cK#;wYW7c1wIsP4Ma4dw&l9<0T#DhKk@DnhqXSsV9%*ur$$yFg%uqD;o^Ep{lLN ziQ}eYS?6o0+*X^Q818K1asZA1T}s9@CQag+xpAx1+f2`y+p&02@8RkQ7nt9B6s5vc z<)yU8;bkvul4iR`)`QbgOKjc)s##QgZ zBB?TWr(W*WU2NXhQP#aiP>S#)ewBdEYkM4YQF1)8$Bg$j>FJ9#+#6hl@#7}_Zz53- zr6Cn=9}dTR$-9SyUJbaQ9`{(4+rgu3TV~~Np$&LkZ||im>98L&jvwyQX(d1C)pICv zADl02>gXw3Dc+^PwGrwf@*UKS%L@{lnQS{Kmdm#-pFRaw(k!P_($v)Fl*(>8 z>V(Imc=XZ~K!0}e&K8GNSU7NT8KhB&)H%dixEn$4GYW3<*Qv*T z1y!QPKEmm_;W>T`on!dyjXmx$;v^~N_&AoO+=m)Z4}0Z&qSRxOWB1*I6R`=T9L`Bj zV@~x_D;3^q5|Kqhn@FAl+HavD#tc@=KBLW8Ocw@s$HiFs~YJ? z>*e(%u5^vN#rD@6Y&|i9TPbyf<8H$q2s}| zn+n$1ifs_X=wYwceBzrzt0!LMoOfWsG5pJ|JOz14bbY#b>RL#Ct&hx-_ zxgxdZ^A)iDVWW?nrca|gVb%VaDM#Hu4{KH^a>a?q)eB?qc-$Y8X$_rFGPh@z^ZdA; z7vLxqOr{CV=gp2ff+LRF5|bZ8>Z*6z)F<%&h+}scav^`%Hd`XU$?I-zYvEobxv!X-uLn*-_%mrA_yq+VgcdmTaV>RQ|q);)*yl#jEk+27}B?Zu?73bobZ zn2z69O$I zNzAgn_LwdGtmC-pv4ZG@`zZ@p0SHIhyP1@&%XBz8V|7ZXC zxa(w(h#rn_4`-K*T$B^a4k)q0P7S>u%Z9=JtDR2U;S8@TPG_>WMYop~2O~l+)xa!x z177&Y9&Ht9^X)j*vu#5VlFCZpRUOhIm@?Y?({@NK@WRi8S&2Lg&ui*%WVv0)6ARjN~0d0|<53hMO(F}!Z|dRq*GgHsw?FX)Ke5APV~zxLfX9Mizr zS{-!qsE71`Q~&57ap}BSF9Wnz;i&|l!IIQ*q9~O;-;`Gzwg)^y$BUzMC2-Pd5oEzI zK`{&4eAv@bu_{D7wE`|`ZsB{ylrE?rPvICE=gB1fpJXT>N@?#px%m#7;-QK7k%N#^ zqz8+nXi{L|$7>XnM}(p{`)VG{D#to$M+t1?D7DU>X^O{cTi6NLfDYKIeIeaJv0ReH zoZ{Q{^dkT~4FgpjKD?2Fc}rRUK=dp%?lFoytM`$Pl{?PR#tPa)8ymx;8_WI=!x)>u zF{ZJR(W4g|A0E8eD96afMmmNqHZo?kVnvQWHZiij4~cDY^^A>7JiEh%nmzxaJNdBI zR`=-6V%x9O+|d>EOpvAsD{M?d$-Ey=CHV}7T+}xEjrk&SsXEz$;d-Ud@pA;~Ui@*M z$zX%;d`T0B0`S~uk!co#xdkmREt@l~`rdrX~sg}hO(cEZNdqr_+)mUVitPDTm$&efX% zbWWl#+W7fiwB1`?I>-$_@8ORDYqvNflp z`z5*xa5U&Fg5K(7CVZTz7V-#I`+1$`POxu{;B~2xqqDGLD}OO&zRV(Hs6AVCZWJTp z91};L(G^)!kK-yoPMFsC)X^W>#VZz#3c^v+nx}7R_VE6czY@b#{S;8Yq)}4~jo?Ye zAdGcGM7>?6WI-Kc2>gxe~Rt#T&rU0oeg4Dx0sGoRH8|Zu;PrLnX{1%N; z(Vje(Q!~)MeL&MdYn;t;NO64~bfgUwgSyyhXymY*+az5Ap&HwY36k|f)71g|EC=+6 zUIWF=29LnVN7X)N+1|IzuiJC|v z6n_6)Pa^1wJ_%lprx)mUmZmPj9s?%22Q%`*wIe+@oztlhUAN~Djyd%G0o*L8fQ^gJ zFs6iFbFanWWFx6b?&QghqD~DjU+G6L>q`oFTP;LQU2GFe z$}8vB%*)HK##_xkm_jd|#HdNlZQ<#`3d(l?S(`aTyu5bYkRzMU$9go96d%haS?4op zbqYw`Bs%C^eljhNc)h#Yk368}Trw6}WvnoCJeUG6>Zl%3@uV8G*HhiaA!gA_gkC1w zgB|V`vD)jIDkx?lF{eV?)M*WR5tp9Y;1aH?#lFth&`cY0auAz6k+>*oGDOSVjW~bu z=<6vx#B-xlPl+a{Mw8Q`$y1`q>Cxn=f={~qxFOn%OB=XVjTa43Q%r3dkC+KPD`psC zL?Q#MF7U*pz*B52guG(Vd$jZ(nvXRQO6+aL3*`7T_3BXlya4_N`K$|Tm>nn!)yH;q zO&47Ocl0kE|MuVn>Q#PDsd{)LJ;ds;DT`s@eX*$Qr_{7yodPQq9?@xVr!b3h(Z3;> z#~LW13anbC10D~n3u#LY<|`Sc@&MgGv^5UyK}%PJs`WMSY+mJswsm-U`_tmafdQs< z$X%=SQ`E0UY>*K@3E+V;<3cjKS?pFt3?n;ZwLv-<618~rhL*DfXqz59yTQw8dX-_@ z66CiWc{uTdKxhTrC^}TG#Z4g(acC6j9m}wY&2S0@+t4n$+(3aH&6{1oB|>Jca7j1Pc%o$+%0q-;%3D`3t;5qz= zDBq+i@`l);*9KJxJ%PX?HoF`o)4r-!-G-+-lOAt1St9&2ptr7_85lOrf?0zJE=Gr9 z@7^O0wh1$-j82i&+)|m*n$#PAvU1Z^wXy29wUC{L0~5+qF$?@X7&bXq#oJ_lPjMX| zNuMtY%VFoM^D3)r_%%sUiJzdTsUSMf5uWP^=i{d;YMf$G@m^#@nXj3qX`K@2y<=!*)9MACaR>NK>nWaI#)9W#C?uMiX0T3F zR|`@DykUX|(ERHX>Md>VU|M|m7ph>;1u79{;_6;!6p`1|vdYbC6=EXRSyV1sfUa7! z04*=V1w3eE5x;CI7Sxnrt*oMq)ET)SPd67VDyu1940dsOIr^MmMqOA{j{e3d=+{(Z zJ(!Ya5t+s`vB<-QAw)1d0kN)NCqOT3;vqX-Ez`a`-!jwp%+>A$x15^LGame^22>DU zXE;Azdn05S9(~}2boG22Z_DC!OL}pWTs=EUjKz;c>4%Yg9|41$4~xN%x9MGdJRMj5 z2rs*A+Q`45^%~9y1u23yK(tp0hOZDJQk$hFI-PAIAG*hHw@?Leumra@(C)+iOa20z>3$9wYBMRW|Uyd)@) z-DfmF4w8SHK{+%$4HNlCPLW!ceMjIUyQ zOeG>kN~9$^mK}GdojE+NRsgKig!t zJD6evv7vFTe9UzxQ*V^Mvyg=V#7MyfSfa=KScZnY;0cGox3|O~++x+T+h1WSfmlR_cUH zSd$aeGvkwE@bHC6W0L8KaQe#BHSr6VXGorUF}ZndhHB4|JdRAeczI$x5o*dhIW{wW zd4gBJ$FE&Tu3notJ$YgD^0n~V%;?nE@#+PU?##NDw4CRa@$;k8V=o5a zk5{CfyLj=X(HAF1#{-8;&hQh6PM4x+xdm-V`5qi*t{O%9l~DwFD1}49 z8lJTo-d19E$f}CtRZ$ZXa1uEwfzm-IPcB4^w^td^)q6=^d*s(ME1Ga3QY`^)TOq0; zw;Pk(O30K@xNm96gYU7R36i7|lP62OK7l?+=#uR+21kYmOn6DpX(iZQ?UUW6^O zuNH3eNL}3K5oV*Ts00M<;Jbk(rmZ8CT6?WMY*YN~%F2S1r-ZF2AzVNyrAb(+i_ybB z2Lpl6{(0L*(hN&BRl!I~G_XYY8Oa8gpnGsAz0)%bEnq6tt|jB64xkPx%XsT5BIA7} z&r^3S$&oe@tGBbNo`FUa^dj*-~9h;BWNjBWE=ggeT{F~P?9(6_v zUN^Zxs9bMv1YAdL;S6whq?@Qwj)@q8Sc;(Yaow-NZzq(QtA1L=@&1K z2Xy#Z5IQzJWXI!nJZ480x|2Q-OwUe*u@@)CUK;Y#aX%gN6MIF^TzrYc6k|Gienunl z+RTLsi~=(!UYnV?eEGt~Ooq#s2~c4|j82d0ncc{IiPxvEoT**Qf}gy2A-U(hF%y@V zw06OE$Fg?(ZeuB4V7uaFK;JsCo7DWOjWs9T-CSm)`FXaCzs*MTqIDDsf?o72(nDBQ zD(h|x)F+`lXK%3)ZhfjXP8xeeV@!_1G64mpji^!y&ts^=q-QNKlX=|mVDjP&C^$pJ z&-T)Z798#t7O^HA5-}x3NIT{#F`=;4+MQWkw|6sbf(Jt)^#S7CQfl0@18L1Iu|nedq{b`l|>(h)7md(er2mO2K`Cw0EUj2r)& zc1~R{Nnd2Wi_dg1c0-bK8GbVmq$We77vN$)@!tF%&1jM4js<{Fw}f%g@n zzJum87?Pwtnel-U6cEVomOw2k@XDOvKR~AghymtSx%)!9mGO!mevriP#6ZYE@*ug zEwi6DvIv8O4JaWZOBnRiF+Uym(~zHr{q&5VPWb7h)etFJ*tB{^G(F6SP;U}fvMCS+ zkKC;bS1wPPC9k&~q;)}&PPQnE%{MjZ9_nDJPz;%vA9H$gdI}LblW4l+jMkdCJbG?Q zdhIOndw&{p$^W5<6}>!hY3BIMGlBDKTnrBQ)!^XF;PI1EbPNcgt!TCj$r^=qQ*P;9 ze6BqJ6O*3N_wjV=-b)!Zq;z4UODq^8jM4P$XxXWWa6w|%HbG}If!EGWo@OS(9Kvw+ zwaH6NCbF=cv7NnT7L*&Gei?BJ_B~-qW6OKz2v2xEF@_}C*!9cn2s3Bj@kvRWv$8t| z(bk#TO|oIc4RWPw)h#8l|I8iYvvJhTXnV(w^-W$!gyRh^uMmoTu+u-B&rpSMg$vW>lC^FwLBj5VEjpdro4(=2pnl$7*civ=()Yl^}| z3JGQo#v9B+X%ts9Dj_>D&7r&K+b_taBJS)b*301KFlrGY#sbN^ZZ`BnSe`5N((-Pf!=m}p5=g(ai0gLp_+)YYp91=qUE&$;&nEL(?xDD6a^w0jd0}gdcYVu-kV#l)`hj>6jVL@B z7VcbHS-J-aOLAs*%eIarlGWOoR}T`$hrNEG4ahMiAIqQZwBpK%yzrQE;^8L&W+)~t zY@LLrMMtb~ww2qyN-VwGnmc`lb81_Qh1wF175~ZslQ3)kR$?L-^bV(eK!+%;h6Xn} zv-6eek-$hdbV;`4Fe!pc*K$yT2)8TvI=0xupt75LVNO$Iabv)Z+Dvztvn~5$39UX~ zh&L0yI#3CIg~BJ8fts<(qCr(#UBhgq?;mHo#-;`k_T>uJA?$;-dfi@T4r~d|yYO;| zP0`feQx4bBkE_~SRozuGR6H#PUM#HfWuy`SwVnU8f*(J1Lpufes!3u!zT-8(hwDTSlD7e9flU1-lveoA zOA@n2P^P%7+#MuuyT6vWRV6EhOQJ7vfn<5?B*p`}WB|2(0a2T=pv#A+6qA zBeGy5fVzO#k{$k7c%$&$B8yO#?(xP3ECObHk6NGPS_rJdfJ7iD+;`tLZ@G@3Sx$g( zgmrBl7w?v=-5Av27$3h)XfSS#az~gh~@Z;tLXM#7wYJEU@;r(Es8hF;;d5A{-mhWrg9|TXtc*4@cZFMmEyX znjSc)zC_A#YrKe4!+kw7GJ+C8%MeavV+=>xTv?+EFLv^Jx||*RKfZi=C$n{iOo-a+ zy@@TuyYb`(^#pD7Jt5W+ChO+o3{s%A<&85gaFbc33CVKCbUrX!ySB#Wz!NSrBfa9T z@s{DnJt$o8Yc4pmgdWh7anPhyQZ!kYlsu^1WfnN%?3fp+^xxGGwU2UfMCUvsNx0f`s2{qY$-1Ko};@q6tkF&&?;stHv2o0r4@3 zqcH#0y;pe=qREb|8OlwNkC+XtYJ%Wo#p-UwViFhv>evN)tyNZh{apf>aZhc@P*|Rm zvzRP)uxC^YCKR3K6G=qPQMKXbVptsvdL6VI|;IFC4RYp3M-rGq$iI zxA_)tqh6h**qz0&$VUcmg(U%nM)T8La?2tPn_XF&w}~A|ffX3rriGFSI-*{5oW#LZ zd_I{KGDGTC<(3=J2o3t8DV8)=eIpG@%YRZ(nq3rQP@1G{Q2GurS-uJ%2xDz5CDFzW zZWoek$4rx09+saXoHtj)@=`z7*Qm9><8zFj8E$lH%W($ zL`D+w?%U4FaS-iVm2i*wZ{Q!UFYNY*89eUL00-}*rMY|F#M+=$y* zYX!i{9gGCUGM4VKmJ>^RVT^0+udP+us}Nh05&nFW?KT7k*0(+;Di%LakUkt+x%CR$ z{SfC*)6U*rB%BZ8^*O^Zc5aGHyhnq~OH-2$j4#e&rtvYx`E`O`Z1aCZ(*|iaPlG^2 z1U>=I@?;K`^bh7d5o4ovq3d@feP%NXawGP+N4m~M>;wlE4H?0#i+ zCi8uoi);3U8I)u;Rk!D0dwszslOrbSu@z$wbUnGuro5n#yHtB68xJH>01CvF2@_0? zGI^f7zRH=e#Kcc6PD%=0ypEHC*-kfV=H4V;x+Y~68FO!%i*@y!jd#|xNL#E=i5iNv zltlXm13OD-@3CLjBHzf=&fij#^KY_PD=`t$D&4-Sluj1G+U9h*3PvTtZ?aI9~1^w{yf@uAVN@smTtXC_8ZyceE)(x-9; z?mjcXzmdVdK`mva@q57Lru!v*Y~vsD!IzK_v?$OgXVd}RY1hvr<H7w1y>3y@88A z=BpQjmfa~3m2K6%^#n7p0ADaN_Am(bIU^Q6p^0MJ7}9a&R)!2*@sQil&jOj1joKJj zGT)swT3gY3?aK|R(62tQstl&Cbm9H9H2dJAeYQqmpSESOTqIPld!twzmK${T0;Ugp zZOz_eM*pTZykKygk73@aRkk~VpBOfb0XMt3jV}vHMi6(4n7nu!bI-;j#it0G5Qf#L z=4i;;KaZj4--EeUNtg%?gK+Yvi_4PdDqy>H(gCeZWZPRhYX)zFR_bS!7^~4`0c(04 z^9J5e)0!kT1!Rz2NKFprs_k8+G7(UWf)BC*r!se8nH)q1+imnKIoo@Q36?&P`4{uwiW+{RqV zc5!KTL95bgiOGGkcQfz3Cfjmi*}+vvWktm-wuj;1AC~ao-HXhxr$E#m5{rnRbbwN) z;7;NfOIttP%Rk%Afc&t$xULQglCNj@I6ucg9 zjjI!hmxg+sb7_*b*{7MeWG@GSY`a=9MAo@0(`Qcl#m2lCi|%Q*#}tST(<`t;cFEvW zosLL$d9A4|lOo9?;^%12~4(6ZORQ8`A#M zI@90ho}ZtY!Oy~7yk`c>Aiks4n?rl!T8f0eYS_l~HErAR{M^jUfY%~9v9RDgzP`1> zA(Dn>X4t5lhg&MsesvNd>#FcL>oQytC`mmMT|q{!(RAZi3Z*T1=uC+g3ylCMK~#5X z7VRMwz=vn0bZ`x7=Hx~ACQ*IYAt@lr9|Qg_{*y>W2AqVL*9~Tu-92uoZi(N+Kg}XPSCNw=ZMK)a@bj*B`yOhU7Fo2;W(8p|4D@nDWx=V>r!kT_ zg;oEmIyEZ`5=F1AgtIJnN3_YWG=V2+D_*>T1tuNGYo;t`LqQ~vK@ixX5YD)LA`Df5 zF4M#f7NDcqFQ9qwL=cHNZ+)l0-BTYyQ_(hzMj;Wo;r!zK+RFOM^^N{9sdBz2Y$v1D zXmZtDfdxKKc8f0-`?6&N4~q8?E~Jc2TFZ)mX1HGOH^WT+1s#frj86@grW;BKyS3;) za=7;GCO*PoYrRcmM~}m)M-Gf7CmV5^izT5Z`xwz>&m#2E>Q+OIX=)Ga0!>rHlZ`f} z)&jc*N6Z>wU>wO7gaCCi^HInHQ8kk_R!=#6QiI*v#F;FYsaDuALjx@0r zTXx()rIx0OBVujhxvqqv+Q9Q3v$MaiznfgYI=d#xYB{W?B-mwr)|N{aipT!IHN{?$ z6O7Gq$Ij24&F+5l{DS1=bI%`}iR)vUQG|`!;(Tor9Ynx$lQj<(NiMd!_k6zrni$7T z2rKTvL-Br4%YwA$o*$giGGW;01M+99ey;NT@XU-f!U<-&`EJ%Qm$$UXKB8pl-ZRbW z+G!V}ZT|t_#B3fEs1V?W&N6`t>B7m3TRpwv=7BkLXP8l8`L`{jvvFrg{LV&{RTzAx zl<_s2#f08EY|nDqZOs?H-&F6+4PCEbzPKuCVs-nMGX>-db1kXquQ)AY4o zO0b-XWu-z|fP^>d*5QO=>Pk&AV9-1OCC3JaPBs8FJRlEu%6uH{wZ*ERZ83VH5u?Kc zG6=UX@XXfMh96vDaA;@?fF~YU#pTb<&jbI%ztGqq^@6pASE0X>WwjgfCcr@rQl-%DeM`*KJ zX`8yaej$X1>T3xtPtxaQdM7C9Z(BJ$9da%D9R*5Yo|-ZYu%MOM%zNaSxMwz)+}CMwmUjEO?hWsTf$*O2ui!Op)|{1(D;+WXsC3WOR#z_uBi1et;br` zmeqQoH=MF3PaDm6Kb|HfXD}%j@ILMRDThPh`S2WlRb9_RZ_n{NL=9iCTEY{}Qe)Xu zRxY%(gO8MoP60_M%z|fFs&Lo&rp>r#mqsVyiCsPl#vi+GrRjS_RiZ9YPw0po8M?1i z(w{lKYTS}5t5>7G9>V@+6c9Qh&7~ZC)HwL)b{xDva(Xsj*e|a4GDj0haE~@)-mFx} zwYqSxx3up(SB!o2s8ra8Ti8D%?{Ez6DwgN6sj# z%1Bz>4car+sJmmy-A%hYp4@rPq2zAeo(oHAvF^j*##H?8Q~%4VDbk1}pVK*!(}D*vhJSG0klNag$P}qLg4gq06A$uLi~q9 z!30H`pW9?s+pXumv3bxjoUYut&H>}w(!e4udkkr()z9%scAs0 z#zATF#y{758U^PVk)Lbu&JdCkuTX>RO}ERW0i+|urKcJG#uCz~l4pLYS>1TAB5wYkfk_Iw_0oWGg4++JGI|Op;vFhgn#!&2#?}VWsMcNr>xV0yz}lprr)ga}UE?cw zw&GUy)L1m4>QUW)sQIo2Kh9KQb8KU-a5*38(xB4Sl-UwPp#Cj`72uu z-{_`(mMWw{Tp;=}s?T)*kYOl|B=(aDAeJnn&ZSB(@|?AgcAVl$z)F-JO`cDZck5HM z(6y*Eq6oNP<EQPlm8}XS$ zdUUcwk7^g+uxTc}lMAA2nfy2oEsWaPE6|aPX$2KooyXBtwt_9HU%hw7><-X6hP=0t zcc^DErKspo&0C9VvoZG+Ph2^O7TmcJ46#JSiHDi%VRGlvr9_s}JSDYXWoGLxjK&^n z6og+7$bN{v-TPVeO|Xgc>Y=LV)bNxW91-Sd*hF>Ik1PQ9PdDa@RN9d5RAas@{#=nu z;>eZCN~5HeC;G!BqYxQaqS=c!hHJR}@=`=);axW@vQ#EjBbw3prf_N8<0#idjZ^s0$ZcpwK6jLyq2snC6y%(9yO!zw$WxZw^Dv$@_h@e z5i^2QRL0JbK{`v^pzydjMAV$cgk;EujSk~;ZRd4HO;L}N6jRakPR3+pdRu74?XC?M zjLx#q1JfHZcoXx)z(_NixK2&dEAD=0^-CNrUTy#qH~Faj)OGOda#|WY(p1!bZY;TE zi8Sgai2{J3t&adxt}t#Po=}jfN@%{DEmkb0kI>9B3P9DRC~%W|>{56MS3d>@JV@jr zov_U_1$ml3O9DRKr@`b3qb=%XlU#yJ(-!Kg-5Z2MOp!<{zsXOzWidpVtWdeyG}3euP6XAu=%_7CRaU43EdL_=?W(fLR5Vsg4EOYK~9Cg3t17EUX^m@Xa6;7jO5$Q zG*QG%VT{H|YG&X!|M^D&S^6f1YlL+Lv6=x;->ImFn{~rO(Hb)kL5Iz1GhFSo;hh*| zDY3XPQo|BgF$x}@IB(=9+uRL?#@G{Vw@+pF&K1nUYpN7$_Lh3p z$aE>OMR;8rOE$~ui58~YI!*;*4BTDVRH_1T^D09A`m&Snj36BxE~JKj{%bxunpJ_8-V0XiZ5gz ze+?9Vci|oG zg?X8Csd?$0l{>AmQs-snpK17$OE6Z`8;USXa(Z|}h;tnpTXGlCiBqh6)gWNUFxpnc zJ!)K;!P0UHM#-A-z)-Bk%by{?Tyj?uPC?RP6}f6`!svZdoy|i(?#RY~QYyK#sDC;U zQ%_T8Zu6f`0!}pDq6y{_NBrqilFA}leK&DxKBu?&0qf(@yQP+Pa*v*n^!&lMhxtm=}}nUopo{gEDgg-!y`Q=@gT zI=3h&<3^HGRoIj5QE1b;ld$>AUZF_o7TxigXm-C~0HbZKu4N~ZvI;}j=jgV_3tuE> zN_wdQoHbIlpic|%JR;;VQn$Jw;`I-PrkOCA0&@2eK0=#!KDf>8gw#*f?(Gk5x3RCT z56**S2|LXo$mEJvykl9hjb=DbVjgeoq*W<-O-X*}+8^`UXP}Bj#FYeje_}j@qpGd( zuU=8RK+`f2Cc>KLcZ@_fsmpKEvyBd!lz~hR*L}*LjYK9>k0WxL1*ZYrOca`@bKwQMu zST>o)WjpFatr(_Ei~&2k=zO00w5{A{AKa1_ zR@`OEHeCp&{95*a*gx@#L8ztQTj$5*sd|ey3|1*JnY8roKqF_==CDS^1F;X$#&i{{ zJ~{`=PLn|{oADiB$u6l3Ct@DQYOF(fv%dM3a=TI$7S@Gd^(jp&qr3%~@azF7Ey?bbUR;N(huOwwHlS<_xF#t@`jqm7-lnNvePYZB(V zdx19%)1igVc7jDwMISOy;Xe=l>0TV7yW>1{Nh{8Jm+SOt9D`g(P0@Fsr?=vzh>y?_ zbw}8B8O+EyS|JK8%F&`;;VitgGbo<71s``dUbtmqHp|3+Zu5A%lIZ zlnoEbL~~db1`JO}x=Rh$I6vX-CI-qrAJeG}o@4DTdN~|UQQ=%3WlxkFZbE~?VL>Qu9cd}bfppHR30*w3U8y?y+vR*A zE(tGZG3{1kz5L1IZw#2+)R&&oq)Fp)HXwg=BWtQdBtWy73|CP;aa-UNEn3T9oTjQu}ajIXYh)3O@w$3zHE>Zy^wJ7-4lTyxs zsahc*!P^2d?(n~^#5S7M=~82Ysiz5Qjm#y5k}jJ~m6Zg$pobg=FF*>CF>z@{RI_40 z86hOZ2s?2$JS3P$ofn5uJey{sKi(la>HCVw=DinhCpWOMdGv2 z@Kl06*{I^JMvEs)E*fNCqm;^|)Q$#~k42u}%D-Xr7lmeLlo*lNYQngV&{UIXN61d& z84_8dy>yMMVxE_b9whZeeOU@qyi#-&X(qM`ptX0%YNo>hb-mfbx-fj6CxXM@RPZ`u zSTAc-r^by?;k2)q#aSSeHkA=A1cp8j0Z6oXoK?NzLw>X)mr(sk|1zOrnDCWB<*k=Mo-Sw44u^TBk zDF{)~NAV)`X?UY>@PT%agb+!0gh#>A7dF47$aIWxW%<{~VX6kwL{pHQ;N^JKTMh!% zjbhmuPL=M|ybTD7oTn3GFN9nhJ5PpianitBWQ_WgiJg9vt=X|#uRW7-&X=b-Ha>Ti z8w$zWR6Tz0`OhT1?dL3p42O=I#kFjq0#93Js6LgrAfF21@iNOlHE-kZg2;{50BHD3 z{_^(QQF;_^_*siheinb7v~rY?LM~}Xq~zjq3M=eYAjsk&<;&D*X-0J0t)iemk9&)5 zj%SZPo}n+kjj3r(|C9a`DQ`8&!>tJa&l*de!qK(QGhWhB5~!N6@OK5KI7`+j)oDvq z=`t@e$7n;jX|T+G_T=h?Dnbjtj!zM{eM8}$&0qXkHMDhMOBrqA13hYjOv5jeq6W;J zj}Mkf$U8gF=E#xt_zEqiFJu@>uGI?%F}P%%tZ9Y96=1#ru}Z{$i=VWYetf;!ieu~9n;%~b zTgTgdl3H)pKfbo2aQ?tH3u1EEkL?x+|8s;XpZHw(97gV|=-A8lYTh(4{fp3;R=-Vh zbpg{rc`lRdJom3~p5f^ko==cEW2Gl3p_fu8SU;!SFLO7^-E>mgc`)XkVG?PQn#ZZ{ zDmADjwM*%vTjB9ilklxy}O z>2CdNjM*+rFS($S_=)-^ob_5#=h>IzX+2zA4d-UI-U#+GxkNdfgo@wc;&IqGfHwkeT}t{!}n%O@aP$Pi2Fp4rgkm z$gb00*k7-s`BEf*VX!{+D&y?y*X{swKTIU*P!IYM@mAug`V!+jpH1vG?QD|d`urp% zWuRwmPOm+!Gg`r0)!Y=LdK>$qpV}Mk(C~7zy3<;<{M~Jo_@28Iqg1TevT2Q1Kd45x z$E6e$?(v`xn}&Z-y(1r`$7Zv?^ifJ`iX#So#8drXAN&7_2jj!?3_m!}HZ>pK30|!J z&+a7WHmwY5Y&AurKAq;LRRpp?*Xl+! zC?`M?zCMh+-K*yxHYWICqAZTMsKNWuU+TK2?tBT9+~z;}yVj|T@OZP>ML#2?sE03z zO1rAqnnpie*+sW%uU5$akhJg#p2n90{fSmQc&(J2^qOUo`*I{nomhi{OfE}%p&8XG zm*Aqcy=-2#?}2hy?{(Mq8K{Rr9=ak!if2e>C{!gWqyetI_Wy7iT{6x+%THLS;I?>vyFd&Jb|%dU_2 zx?^A{iv?LE?#p`|K~9)!@A@cU_(zJf$zgLzrO02bCr*6qL{vPOTDIdR`rL7u_GFJ} z!qH!I4EqJCmL6OHyK%L8c+`18%Qa*HJ&WX({S&T6DrgpjeutVgwJds1C+@`&(#$br ztI?C)<@0tU?B)Vw$t3jWt+n@v3Ft~KzF{=!Q&XpKXSH9^ao~BCXIkgxxKMA>7FBbW zx5IGuPL^M^Ki$2~j(@}uF!jZ2jZ!QTDOr&@$%)!D*omFDk`|z2)tDsyuH?szjCIh3t}tXt9I2!R)e;Y#ec`)X)Nm z0UR+|_7P9%%dQy1AzvqBfHohR&6OBKR_UT@j7KYR#m-xvcz zVwsh7Tk#nl)yr9;&13a+@wm^;2%B-SY<3jGQ7!fI7E?{)6woyPe71C)gozNQFvwbW zJ6q$e5%+x%JRUAe*4PRokp^Vt`Q&7HS1@Y?BxSM-G_v()F{RmuxPCBFtK_`+&=+Pn z1X)i*&-D(O+L4UcNU+P|M8s_hnRXF!nIaw$R4S7l`T9jx$dF1F(ycG1ing}GCV3R6 zG6kJzNG`f83YR1%9Vl{m$3mZGf$H3 zaXmkV^V^q`eBm>Iz$iOJGEE%%hViZJ3Evw@P()4+hq5qvKP7w8mukc96qc!kF5>I% zk>t=D54EhXtqzADC1xDkaoWGW*}`RI$UA~nWVx3h!lIr9$fEApGM z#Ml`twFHAL6U?qKzJ%4U@C~tZ_Ak_Os;i9Gnk|H}WmHG&!!?3iYnChab8VyCYE=>H zaQ+V0>Ww@J--AS2sSy*(lg1ZPtd&hi^@EpT$>x`|%Hx(vE7^$R)ScHfNDbmhr-bm> z6fmYTE!8u$b9~BZ+?RI>Hbp-ix6%NT>)LdpoT01m`HLCMW*4EQC8dW2b1!r*`5~zj z$L2IO3TNx!-zn&n>5>7-VLqAd8cG&yne&*3@kG-goorhSloi6jMtKqO}h%!noq_2C3X41facuZb!x==Ao z523aNhDSEiO)2Wzb((0jzh#B#Rrm0oLg>rLZ%G87Yn46`6*&DkEv8yxoxN*bAg{Zg zu4%O668q5`?8=$;ThiF2zWYtWb(A7RtM;EwbZ=eH4ozD7sjiFT7H7Z1e)VdF$lFQ& zhT%Z-LY@*{vsy2eO5$AKX)25~<`PWq8AzgK%LwLZa}YZ@t9< z4_S#Q%gXHwsO2-0^vU&VGx-shO-k;Bm!xB}FV;tjSHBbmb&i#MbSdVG)Z-F$*XW6r zw*_O(Amy?b?hZUU4F6B;%w}PEE-XWx2O#wK2$vu4~FZ(^i+f9 zRC8!{SbF5aFl?pGTDybI+kHTZQR(5h_0#tGvTH%J{0E=*JaD=8{wxR7tez{)Qn%Uw z+s9h88|*QAF*(}hK=P<`WYhz~gfDbyW*upg%&emm^>$F|S4twMyU$*x=5#3~Jl>}I zLz`OE+ez_to?4p^)u+YT5LvUmP`YSZy5B8DEQ2;Z3D;u#4t*BuuK(R)ZpXVg0=_p8-MZd?jBCWq0 zr9rwopSN9R;&J=7dcnD@7T?mwrAPE&4l`AF3hdW=VD1g4d1Q0Nwxfjps4dHr-o8ye zrL`;dl#(66?IimSMvtwmnt5UqQ1Kb?EqX|)GmF!#XURC&N=oU_M$b1L1<7l#PwP@b zP1~h88tQ!D9vOXT7A+%-w#m+6&21AQuE$pFd9=QPc(|UU<9O8bb3LC?YQ$-^o@>RE zf_NTEi$0yC)H)Pi^EOXptf%^`T0u z?$|RceSDIXtPS`Y5=`1RYhj)-sphNXz|iKe#Bi@duL`_Ifius&J4C9su@g#58}~qS zR_0#fc-vpTXU_HA4N=m~{!JbzlhRwhM*{O4j_$*G?-;8Eb ze@iXI2%lh#G9|0!BLTTbmD`Rko8|9=0$bN}TNKlq&=PW;Vp zhvM(O^ZF|XhW_L$h5e;NxzgshTg$n8S6exs@9N?**VR%E`sMQN#g_K&-K~LttvMa? zI<)AZM2h4NexjXYSLr}!xwUkdbE)rO8S*;b9&2 z>+pyUk8;Sj=Udz9aK61O-`;6}cbDmDQQa=Kl>^U!Q#c_tuT&19yR05r&Q7Iuw)BQ# zTd#6+m2d4O2NzxZI@?3O)Z10;2rZn*P;3i1t~!Ct?mIj6=t%9+k*>~iTdpf#ERtEd z2K1=2Q^f|lc9q-Xvo4hz(!(ybG1O&sT0&=MOM7X5C(lpnd1*f|a{$2oJ~;cqdag9s zJq(Vg`Mt{Tb$&ljO}VZfjZL0{^esY&1 zRk}h7XI0tLMjA&;E0zw>07oISvvi=ymt49>=($cBvtsuM2+wuxEgjg~1;vByHnOWh z)z;xiKA^tSUQb)Tz1>hyq><9**PQ}%E*$_>J#A#<0P%fYef%9jyvFYhezUvFtzwPM zuXplb7rn9@uIZV2m~TIrZ|`Wm^wPiphxT?I3LM&W)zZqLP~-rqen*79$sylf$ah`O zKXg66_c}c*ZGIE-0j_U~J|OKj2DGP*x?35+HsJ37wCZ;tV1x0S5sGgDMVAU{boQ4j z`L2WDIZv@*R06U(09csQedyl&jvk3laypXmJ(_DTl*9h+#a!M}zAF~%-u$j^s$aI7 z>X*s2M@4sA(cQY7wo8uG@_jG!ebP%VUk>W>in8cPmLGYRAGI;cT@0&e3i1)~U0p># zGtkM!Ua<>LN)MMlu?x225?Bu&w4vY47*)Tl(fWx->wE3(g1*yFh!DET!0qMtFh7@o z0v8rAy6>Lu5_NWQ))+!%Kv=4(;~XVwbDf>70a0t&?0LQj=ah3IOmZCn(sD~4dAe7y z+X#rJjRb8d8Ihml>7}{}lZYh>G^X-8iBQX}I<)D%EH zjHE$`?%s&h0-$MjRBq4q?|SEA1s)qysA9lK;uWp0?y6r12-Tj#%3K_U>|<@+%2G zfEgsB@?H7TEeH?FGphb2qs8hk8Daj=ZZ?0|8tAI1_LkxEmhRu;vUH$BV*_-4y2Z$I zcdK-z1GXvM7Eq!I;1VB6n%V=CnvBP-j&@^BW#G#4gSYB0iKp)hgFh^geh-DxVffOO zsEY!fooYx)emz61bGE{rQRco$j2u$kf%9Gg=lFUbHnU5qXCu=Du!LRb7 zo&w!^-(}PLVE0e=iWRw{^9FHm!E!)@ffDbFV*j+;@^D$pjq!3~&Zb9LTd| zHPT93drxWe2R4k|n?JU5Y4gt+yj1gK!4~KSelk}kj@&NNckzl;S zxvMLn&d{ivKP-BBt8R-Opt6{hF|z)#ll6~9(IVqq=`D!yE$iWr)w#D^;y@WvX?dVQ zq*_$Cbf`idx^(EkzRP!Z$ad?H04|!!+e^z;G^})>L?bQ1WQgo)QM$3%#vz}F z+^KwTk$<5z*P}DE(8fP8fQ*J3(_xd;RtNf?2pTija>X7QOJGE(?g0({ERO)D z_U`Hzk>cR(+b9ksaB@}LgFf@bBEqe!j6G&qin>(^vU3H77zR4b{TC&`4|9%w#&e~^ zvbTYQr=Ke#T&m}!p7EAHUt^bb>Khfbo=(5V2Lm(3fi%(s&?K(IV9iC!{Zkke*d9a?q3;cE?e zbFDbv9LS>%e?#akRmY0~lfPZm6U0tx{fjz$6~_r3_G{uk4MB@EH{1tL>mM#;haM^G zH(UR6Jj>SK(%~CAkoK?K81exni^h~5w+AWZ0|*ud)z0!BWI<|-aYrPDzAgC1b-3v? z@KuQoY5+j>Tqx6UagvJE8N;l_&Xynp%W}8r*r8(%yBrszgF_pHobTvCypi0)g&wP7 z5oo8gd}kitTeo2OJGzuZ!==Hq`ENJBp$*MiH$(VmAt3oVaDRDfbPxoC|6KUPo8S6x z{_4@m|M>U+&3BIH{_1~u?0XOW7hnA2U;Bg45B>J>U;X;mHvaOr|N5&Z9$o(Bfj|7? z-p@Vvr@uL{{I&1>^W1+w@sEFf;M0Hf2Y>XfzW>i&{%V(A7oM!l%^w?{zy3_$$l$SozM*3$kN3@uoH*7uP#GRRHn1?jzcWM} z1a9z-{YBAk=uT?^rKZCX9R~1yN<*a~T@UH{Wa;D%Tj1kwJIr}{$2muLoO5KyIZy65 zC;NrBgQn;C{$noWpFicd&-v|h$t@>6J;b?`W5@E!Qe~bGuTQVd&Q}cEr7A8o=&ZKc zaZg);aKO*E$ye^$U1-Dkd)-|?c!j`0_XucLBE*WlB+~8bt{xI&w6x-w=35HbCS_C| z7kTs74&u?abQN1v=V%v0heM%8Ud{J(eX7vi(}Nk-)y1j#9~8lZ7VML1AFkyWiEMG< z0SbHybQ`X#RGdzNXJ6QtlNGuz?B#+`5*4G4&2<@`qN#-yQOGx zq;R08tF+MlDviX(lD3Ln-6Ne{-9O(|TJ8S%(njfS=?kT$(#_HrdgvIgl38T*kFK~S zdaFhTTOEa# zPEMqC=0e+riRm#ok>Tr-q0`l3CP|ydj0j7)1sRE5-x~u;q43Z=6LY4BotKSE28o2K29|_paZ|*9zDlo-WPaB9Y zfOvHT{!!xv%y)rRu+*Nm9SXQ17~cav-~~46E_9$&u3$<~Cv=7<50j2OOfueZsrqlB z{`hBLy_TEx&m*mURs8rnL6yuF>4b+NDT zkawlM9rdYk>E68?JerGng)UKP2Z+Qsw}C6P?=Q?*4@C$WOs=iMyAq_NkkL-b^Nk+JcY3-`5RQ*8_YJ&Ko5Ws1(NLhDbx4}zM z=wBmA)wiJ?BRqo0gwgK_;na&5IaDb5V=@{+aj;9}vj6aEu|<6Wy|4(wq5lMO9xm*{ z7gKgR)6Nf+c66%iAQ&^k;ORs@f%48YU_|X2O_=blPZSh3!t|n1fNd{e4G|WldN5kO zTdH0vRR>DdCm$*7R{1JQ0;VLGRP5~R?2+t&fH2;uvQ)rgg_OUhF>$%E2Y$9BOWj?Q z5Qve@Kgfm6@1L&RSX^FST)t7hv$%1y{Ptk~NdI8}Gv$@*U9+2w_;saMu#Z&YY*eWNnFz|7cUF3eAF2WxqKad{qqk}md_uYA;o z+>9z!|3U$)QuW^>mrB+DOLiyxS70FZh+*NdLy0lWyCAvHI=N9{oh;Ob%tFdZCt0)# z4Yn`rk;tv-C{!YWI;rj#c*wxw;wi?#L#TEsRNn7l`1g_S z{W@$}(KYw`%n|pPC^2TDp7;Ae_5DGGsgg{uq*4b|f#4)gwYy*eTGzpZX{a3{{0S#d;=(dZ%y*i~Z|_1NW878p z4;K{RbLx;Hs#+M5hs9!lVRxPpOlI7^EnzIUiJZlJPK~ufh=oaGw?8*+UFqsX86%I; z4i!i{p~jcRHZ|aS^d9%Ubi?L4!$1CE-2l<#_9enpqBVPCX-9Al!1W}{Sp zgg2_-3onvMocuuS07~PbE=3SOkqe(}t|d}cV3_)nDSR2Sm>r)kJj_s`g}=g}xt@en zWFD06SFvr21;*Bgn_((laSi_vy4x%_St}6N?t+L$#tgI3U6`dtR9=kRL>wWQ2zo%? znkCx&Jv8m_{?wZGBP!aDtmQ&@J{Lxs<9SEgxJdu8WvYrX^c=)o2Vuod+2S3TdpHyA zOb3HZOsZm!+1s+dK3l-t*=ymmJV%1S3gF5m_<(=p!kVM1;8 zmFv0Nd)a!+h5cyny#mL|3xHa#HZ0NIg#t0?Xdo7LapQq9Y9alT__!AP%QTy*|776_ z)oxjcUQ<@}r+>_ZN#6uvAIt(%$@DqVp-BUEu&>*1k9+XG4U3|2# zM{QB6%>v?vA2P`+`jeJUCbB#69>Jdt1jYwZwof2v7X{1$@v z`A-Je%)N)x2vJmm8SiwCfr?VhO% z&k#cO*Aol-qg+JDe*&58U|g;LFH1vBmKU`7Dz9~5o>2*~IxuQktTund8_J=Tal zXApsjAiD5O;M_ba5dNG$wWGS&)y{$E=68R^V_#P&Ry1y z5^T&%@|rgAx6*;K;#i-%HAPb6&~^3|pL5sGVHjIky|=b_c7wVBnc@ zAE&`V3t1DQ-kl2tciM>EekvDwCRdgh=bv6L%e|K?3%BPh3#^~sl?&~cD;u+m z?6kA_E9l;@%tpVne0^oDd=u@pB%ksf%FnLN-&}mVvff|5xv{bO?9rol?%e6e=d7$Q zRqk?e>u9Y9IJ@Rt;{VR#>soWszx`}^aihF6JOAc-dFsro<@MXEt1D|8{pH>>OS5mU ztetXr08T?SGI;Xj;K{kcz7vB(gMC9IbHwZC7OwZ59Om!j?84y4+&t2Yurj^33#NAX z_ellqr}K|oU7KCKu(CXHcfPVJ-+B7x+RB}Eyi)u3@V`5CK^H1K#qSgUt|ffp2QAE6 zj8Fa5?AH!#oWJ}JfAP@dzq$A?fA_akX8zgNYh8R@C`~Z=`pVodyndN@_UwA)bwhbS zPy3Un{i_Re%!*KV{P!<)U5Awzp_@T^e-$iTKxOl zr$YI2cJ=p%j{^fa%?O51zzOxW`TP(232aGMz8Cqu8d}3wTXpCEzS>G$GrR&#&2ZFP z*;6dE)<$$QoG*kkT{P3mPZ>i`ri=i)xkkH zlKW37t2N5$7W=#nL~D9iP^;S2vhTJM*VAja5v_yPb6<8IciyPqzDT=xm3jY7dkn1d z_Pq9AyJLU-ycOVY<@)<(zLSz*I0{A@zXYpVe9K*bf5DG}Q0t<7D@cFyt^VCsy=@-f zeDe<(=&iT7`DXo_KEA>`yK4Uw-@jNH?aTy-~azG@c#nA C{sMIX diff --git a/AssemblyInfo.vb b/AssemblyInfo.vb deleted file mode 100644 index e704404..0000000 --- a/AssemblyInfo.vb +++ /dev/null @@ -1,52 +0,0 @@ -' -' DotNetNuke? - http://www.dnnsoftware.com -' Copyright (c) 2002-2014 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports System -Imports System.Reflection -Imports System.Runtime.InteropServices - -' General Information about an assembly is controlled through the following -' set of attributes. Change these attribute values to modify the information -' associated with an assembly. - -' Review the values of the assembly attributes - - - - - - - - - -'The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: - - - diff --git a/Components/DataProvider.cs b/Components/DataProvider.cs new file mode 100644 index 0000000..3eb6924 --- /dev/null +++ b/Components/DataProvider.cs @@ -0,0 +1,157 @@ +using System.Data; +using System; + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events + { + + public abstract class DataProvider + { + +#region Shared/Static Methods + // singleton reference to the instantiated object + private static DataProvider _objProvider = null; + + // constructor + static DataProvider() + { + CreateProvider(); + } + + // dynamically create provider + private static void CreateProvider() + { + _objProvider = (DataProvider) (Framework.Reflection.CreateObject("data", "DotNetNuke.Modules.Events", "")); + } + + // return the provider + public static new DataProvider Instance() + { + return _objProvider; + } + +#endregion + + public abstract string ObjectQualifier {get;} + public abstract string DatabaseOwner {get;} + +#region Event Functions + public abstract void EventsDelete(int eventId, int moduleId); + public abstract IDataReader EventsGet(int eventId, int moduleId); + public abstract IDataReader EventsGetByRange(string modules, DateTime beginDate, DateTime endDate, string categoryIDs, string locationIDs, int socialGroupId, int socialUserId); + public abstract IDataReader EventsSave(int portalId, int eventId, int recurMasterId, int moduleId, DateTime eventTimeBegin, int duration, string eventName, string eventDesc, int importance, string createdById, string notify, bool approved, bool signups, int maxEnrollment, int enrollRoleId, decimal enrollFee, string enrollType, string payPalAccount, bool cancelled, bool detailPage, bool detailNewWin, string detailUrl, string imageUrl, string imageType, int imageWidth, int imageHeight, bool imageDisplay, int location, int category, string reminder, bool sendReminder, int reminderTime, string reminderTimeMeasurement, string reminderFrom, bool searchSubmitted, string customField1, string customField2, bool enrollListView, bool displayEndDate, bool allDayEvent, int ownerId, int lastUpdatedId, DateTime originalDateBegin, bool newEventEmailSent, bool allowAnonEnroll, int contentItemId, bool journalItem, string summary, bool saveOnly); + public abstract IDataReader EventsModerateEvents(int moduleId, int socialGroupId); + public abstract int EventsTimeZoneCount(int moduleId); + public abstract void EventsUpgrade(string moduleVersion); + public abstract void EventsCleanupExpired(int portalId, int moduleId); + public abstract IDataReader EventsGetRecurrences(int recurMasterId, int moduleId); +#endregion + +#region Master Event Functions + public abstract void EventsMasterDelete(int masterId, int moduleId); + public abstract IDataReader EventsMasterGet(int moduleId, int subEventId); + public abstract IDataReader EventsMasterAssignedModules(int moduleId); + public abstract IDataReader EventsMasterAvailableModules(int portalId, int moduleId); + public abstract IDataReader EventsMasterSave(int masterId, int moduleId, int subEventId); +#endregion + +#region Event Categories and Locations Functions + public abstract void EventsCategoryDelete(int category, int portalId); + public abstract IDataReader EventsCategoryGetByName(string categoryName, int portalId); + public abstract IDataReader EventsCategoryGet(int category, int portalId); + public abstract IDataReader EventsCategoryList(int portalId); + public abstract IDataReader EventsCategorySave(int portalId, int category, string + categoryName, string color, string fontColor); + + public abstract void EventsLocationDelete(int location, int portalId); + public abstract IDataReader EventsLocationGetByName(string locationName, int portalId); + public abstract IDataReader EventsLocationGet(int location, int portalId); + public abstract IDataReader EventsLocationList(int portalId); + public abstract IDataReader EventsLocationSave(int portalId, int location, string + locationName, string mapUrl, string street, + string postalCode, string city, string region, + string country); +#endregion + +#region Event Enrollment and Moderation Functions + public abstract void EventsSignupsDelete(int signupId, int moduleId); + public abstract IDataReader EventsModerateSignups(int moduleId, int socialGroupId); + public abstract IDataReader EventsSignupsGet(int signupId, int moduleId, bool ppipn); + public abstract IDataReader EventsSignupsGetEvent(int eventId, int moduleId); + public abstract IDataReader EventsSignupsGetEventRecurMaster(int recurMasterId, int moduleId); + public abstract IDataReader EventsSignupsGetUser(int eventId, int userId, int moduleId); + public abstract IDataReader EventsSignupsGetAnonUser(int eventId, string anonEmail, int moduleId); + public abstract IDataReader EventsSignupsMyEnrollments(int moduleId, int userId, int socialGroupId, string categoryIDs, DateTime beginDate, DateTime endDate); + public abstract IDataReader EventsSignupsSave(int eventId, int signupId, int moduleId, + int userId, bool approved, string + payPalStatus, string payPalReason, string payPalTransId, string payPalPayerId, string payPalPayerStatus, + string payPalRecieverEmail, string payPalUserEmail, string payPalPayerEmail, + string payPalFirstName, string payPalLastName, string payPalAddress, string payPalCity, + string payPalState, string payPalZip, string payPalCountry, string payPalCurrency, + DateTime payPalPaymentDate, decimal payPalAmount, decimal payPalFee, + int noEnrolees, string anonEmail, string anonName, string anonTelephone, string anonCulture, + string anonTimeZoneId, string firstName, string lastName, string company, + string jobTitle, string referenceNumber, string street, + string postalCode, string city, string region, string country); +#endregion + +#region Event PayPal Functions + public abstract IDataReader EventsPpErrorLogAdd(int signupId, string + payPalStatus, string payPalReason, string payPalTransId, string payPalPayerId, string payPalPayerStatus, + string payPalRecieverEmail, string payPalUserEmail, string payPalPayerEmail, + string payPalFirstName, string payPalLastName, string payPalAddress, string payPalCity, + string payPalState, string payPalZip, string payPalCountry, string payPalCurrency, + DateTime payPalPaymentDate, double payPalAmount, double payPalFee); +#endregion + +#region Event Notification Functions + public abstract void EventsNotificationTimeChange(int eventId, DateTime eventTimeBegin, int moduleId); + public abstract void EventsNotificationDelete(DateTime deleteDate); + public abstract IDataReader EventsNotificationGet(int eventId, string userEmail, int moduleId); + public abstract IDataReader EventsNotificationsToSend(DateTime notifyTime); + public abstract IDataReader EventsNotificationSave(int notificationId, int eventId, int portalAliasId, string userEmail, bool notificationSent, DateTime notifyByDateTime, DateTime eventTimeBegin, string notifyLanguage, int + moduleId, int tabId); +#endregion + +#region Event Recur Master Functions + public abstract void EventsRecurMasterDelete(int recurMasterId, int moduleId); + public abstract IDataReader EventsRecurMasterGet(int recurMasterId, int moduleId); + public abstract IDataReader EventsRecurMasterSave(int recurMasterId, int moduleId, int portalId, string rrule, DateTime dtstart, string duration, DateTime Until, string eventName, string eventDesc, int importance, string notify, bool approved, bool signups, int maxEnrollment, int enrollRoleId, decimal enrollFee, string enrollType, string payPalAccount, bool detailPage, bool detailNewWin, string detailUrl, string imageUrl, string imageType, int imageWidth, int imageHeight, bool imageDisplay, int location, int category, string reminder, bool sendReminder, int reminderTime, string reminderTimeMeasurement, string reminderFrom, string customField1, string customField2, bool enrollListView, bool displayEndDate, bool allDayEvent, string cultureName, int ownerId, int createdById, int updatedById, string eventTimeZoneId, bool allowAnonEnroll, int contentItemId, int socialGroupId, int socialUserId, string summary); + public abstract IDataReader EventsRecurMasterModerate(int moduleId, int socialGroupId); +#endregion + +#region Event Subscription Functions + public abstract void EventsSubscriptionDeleteUser(int userId, int moduleId); + public abstract IDataReader EventsSubscriptionGetUser(int userId, int moduleId); + public abstract IDataReader EventsSubscriptionGetModule(int moduleId); + public abstract IDataReader EventsSubscriptionGetSubModule(int moduleId); + public abstract IDataReader EventsSubscriptionSave(int subscriptionId, int moduleId, int portalId, int userId); +#endregion + + } + + } + + diff --git a/Components/DataProvider.vb b/Components/DataProvider.vb deleted file mode 100644 index ccecc24..0000000 --- a/Components/DataProvider.vb +++ /dev/null @@ -1,170 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports System - -Namespace DotNetNuke.Modules.Events - - Public MustInherit Class DataProvider - -#Region "Shared/Static Methods" - ' singleton reference to the instantiated object - Private Shared _objProvider As DataProvider = Nothing - - ' constructor - Shared Sub New() - CreateProvider() - End Sub - - ' dynamically create provider - Private Shared Sub CreateProvider() - _objProvider = CType(Framework.Reflection.CreateObject("data", "DotNetNuke.Modules.Events", ""), DataProvider) - End Sub - - ' return the provider - Public Shared Shadows Function Instance() As DataProvider - Return _objProvider - End Function - -#End Region - - Public MustOverride ReadOnly Property ObjectQualifier() As String - Public MustOverride ReadOnly Property DatabaseOwner() As String - -#Region "Event Functions" - Public MustOverride Sub EventsDelete(ByVal eventId As Integer, ByVal moduleId As Integer) - Public MustOverride Function EventsGet(ByVal eventId As Integer, ByVal moduleId As Integer) As IDataReader - Public MustOverride Function EventsGetByRange(ByVal modules As String, ByVal beginDate As DateTime, ByVal endDate As DateTime, ByVal categoryIDs As String, ByVal locationIDs As String, ByVal socialGroupId As Integer, ByVal socialUserId As Integer) As IDataReader - Public MustOverride Function EventsSave(ByVal portalId As Integer, ByVal eventId As Integer, ByVal recurMasterId As Integer, ByVal moduleId As Integer, _ - ByVal eventTimeBegin As DateTime, ByVal duration As Integer, ByVal eventName As String, _ - ByVal eventDesc As String, ByVal importance As Integer, ByVal createdById As String, _ - ByVal notify As String, ByVal approved As Boolean, _ - ByVal signups As Boolean, ByVal maxEnrollment As Integer, ByVal enrollRoleId As Integer, _ - ByVal enrollFee As Decimal, ByVal enrollType As String, ByVal payPalAccount As String, _ - ByVal cancelled As Boolean, ByVal detailPage As Boolean, ByVal detailNewWin As Boolean, ByVal detailUrl As String, ByVal imageUrl As String, ByVal imageType As String, ByVal imageWidth As Integer, ByVal imageHeight As Integer, _ - ByVal imageDisplay As Boolean, ByVal location As Integer, _ - ByVal category As Integer, _ - ByVal reminder As String, ByVal sendReminder As Boolean, ByVal reminderTime As Integer, _ - ByVal reminderTimeMeasurement As String, ByVal reminderFrom As String, ByVal searchSubmitted As Boolean, _ - ByVal customField1 As String, ByVal customField2 As String, ByVal enrollListView As Boolean, ByVal displayEndDate As Boolean, _ - ByVal allDayEvent As Boolean, ByVal ownerId As Integer, ByVal lastUpdatedId As Integer, ByVal originalDateBegin As DateTime, _ - ByVal newEventEmailSent As Boolean, ByVal allowAnonEnroll As Boolean, ByVal contentItemId As Integer, ByVal journalItem As Boolean, _ - ByVal summary As String, ByVal saveOnly As Boolean) As IDataReader - Public MustOverride Function EventsModerateEvents(ByVal moduleId As Integer, ByVal socialGroupId As Integer) As IDataReader - Public MustOverride Function EventsTimeZoneCount(ByVal moduleId As Integer) As Integer - Public MustOverride Sub EventsUpgrade(ByVal moduleVersion As String) - Public MustOverride Sub EventsCleanupExpired(ByVal portalId As Integer, ByVal moduleId As Integer) - Public MustOverride Function EventsGetRecurrences(ByVal recurMasterId As Integer, ByVal moduleId As Integer) As IDataReader -#End Region - -#Region "Master Event Functions" - Public MustOverride Sub EventsMasterDelete(ByVal masterId As Integer, ByVal moduleId As Integer) - Public MustOverride Function EventsMasterGet(ByVal moduleId As Integer, ByVal subEventId As Integer) As IDataReader - Public MustOverride Function EventsMasterAssignedModules(ByVal moduleId As Integer) As IDataReader - Public MustOverride Function EventsMasterAvailableModules(ByVal portalId As Integer, ByVal moduleId As Integer) As IDataReader - Public MustOverride Function EventsMasterSave(ByVal masterId As Integer, ByVal moduleId As Integer, ByVal subEventId As Integer) As IDataReader -#End Region - -#Region "Event Categories and Locations Functions" - Public MustOverride Sub EventsCategoryDelete(ByVal category As Integer, ByVal portalId As Integer) - Public MustOverride Function EventsCategoryGetByName(ByVal categoryName As String, ByVal portalId As Integer) As IDataReader - Public MustOverride Function EventsCategoryGet(ByVal category As Integer, ByVal portalId As Integer) As IDataReader - Public MustOverride Function EventsCategoryList(ByVal portalId As Integer) As IDataReader - Public MustOverride Function EventsCategorySave(ByVal portalId As Integer, ByVal category As Integer, _ - ByVal categoryName As String, ByVal color As String, ByVal fontColor As String) As IDataReader - - Public MustOverride Sub EventsLocationDelete(ByVal location As Integer, ByVal portalId As Integer) - Public MustOverride Function EventsLocationGetByName(ByVal locationName As String, ByVal portalId As Integer) As IDataReader - Public MustOverride Function EventsLocationGet(ByVal location As Integer, ByVal portalId As Integer) As IDataReader - Public MustOverride Function EventsLocationList(ByVal portalId As Integer) As IDataReader - Public MustOverride Function EventsLocationSave(ByVal portalId As Integer, ByVal location As Integer, _ - ByVal locationName As String, ByVal mapUrl As String, _ - ByVal street As String, ByVal postalCode As String, ByVal city As String, _ - ByVal region As String, ByVal country As String) As IDataReader -#End Region - -#Region "Event Enrollment and Moderation Functions" - Public MustOverride Sub EventsSignupsDelete(ByVal signupId As Integer, ByVal moduleId As Integer) - Public MustOverride Function EventsModerateSignups(ByVal moduleId As Integer, ByVal socialGroupId As Integer) As IDataReader - Public MustOverride Function EventsSignupsGet(ByVal signupId As Integer, ByVal moduleId As Integer, ByVal ppipn As Boolean) As IDataReader - Public MustOverride Function EventsSignupsGetEvent(ByVal eventId As Integer, ByVal moduleId As Integer) As IDataReader - Public MustOverride Function EventsSignupsGetEventRecurMaster(ByVal recurMasterId As Integer, ByVal moduleId As Integer) As IDataReader - Public MustOverride Function EventsSignupsGetUser(ByVal eventId As Integer, ByVal userId As Integer, ByVal moduleId As Integer) As IDataReader - Public MustOverride Function EventsSignupsGetAnonUser(ByVal eventId As Integer, ByVal anonEmail As String, ByVal moduleId As Integer) As IDataReader - Public MustOverride Function EventsSignupsMyEnrollments(ByVal moduleId As Integer, ByVal userId As Integer, ByVal socialGroupId As Integer, ByVal categoryIDs As String, ByVal beginDate As DateTime, ByVal endDate As DateTime) As IDataReader - Public MustOverride Function EventsSignupsSave(ByVal eventId As Integer, ByVal signupId As Integer, _ - ByVal moduleId As Integer, ByVal userId As Integer, ByVal approved As Boolean, _ - ByVal payPalStatus As String, ByVal payPalReason As String, ByVal payPalTransId As String, ByVal payPalPayerId As String, _ - ByVal payPalPayerStatus As String, ByVal payPalRecieverEmail As String, ByVal payPalUserEmail As String, _ - ByVal payPalPayerEmail As String, ByVal payPalFirstName As String, ByVal payPalLastName As String, ByVal payPalAddress As String, _ - ByVal payPalCity As String, ByVal payPalState As String, ByVal payPalZip As String, ByVal payPalCountry As String, _ - ByVal payPalCurrency As String, ByVal payPalPaymentDate As DateTime, ByVal payPalAmount As Decimal, ByVal payPalFee As Decimal, _ - ByVal noEnrolees As Integer, ByVal anonEmail As String, ByVal anonName As String, ByVal anonTelephone As String, _ - ByVal anonCulture As String, ByVal anonTimeZoneId As String, ByVal firstName As String, ByVal lastName As String, _ - ByVal company As String, ByVal jobTitle As String, ByVal referenceNumber As String, _ - ByVal street As String, ByVal postalCode As String, ByVal city As String, ByVal region As String, ByVal country As String _ - ) As IDataReader -#End Region - -#Region "Event PayPal Functions" - Public MustOverride Function EventsPpErrorLogAdd(ByVal signupId As Integer, _ - ByVal payPalStatus As String, ByVal payPalReason As String, ByVal payPalTransId As String, ByVal payPalPayerId As String, _ - ByVal payPalPayerStatus As String, ByVal payPalRecieverEmail As String, ByVal payPalUserEmail As String, _ - ByVal payPalPayerEmail As String, ByVal payPalFirstName As String, ByVal payPalLastName As String, ByVal payPalAddress As String, _ - ByVal payPalCity As String, ByVal payPalState As String, ByVal payPalZip As String, ByVal payPalCountry As String, _ - ByVal payPalCurrency As String, ByVal payPalPaymentDate As DateTime, ByVal payPalAmount As Double, ByVal payPalFee As Double) As IDataReader -#End Region - -#Region "Event Notification Functions" - Public MustOverride Sub EventsNotificationTimeChange(ByVal eventId As Integer, ByVal eventTimeBegin As DateTime, ByVal moduleId As Integer) - Public MustOverride Sub EventsNotificationDelete(ByVal deleteDate As DateTime) - Public MustOverride Function EventsNotificationGet(ByVal eventId As Integer, ByVal userEmail As String, ByVal moduleId As Integer) As IDataReader - Public MustOverride Function EventsNotificationsToSend(ByVal notifyTime As DateTime) As IDataReader - Public MustOverride Function EventsNotificationSave(ByVal notificationId As Integer, ByVal eventId As Integer, ByVal portalAliasId As Integer, ByVal userEmail As String, _ - ByVal notificationSent As Boolean, ByVal notifyByDateTime As DateTime, ByVal eventTimeBegin As DateTime, ByVal notifyLanguage As String, ByVal moduleId As Integer, ByVal tabId As Integer) As IDataReader -#End Region - -#Region "Event Recur Master Functions" - Public MustOverride Sub EventsRecurMasterDelete(ByVal recurMasterId As Integer, ByVal moduleId As Integer) - Public MustOverride Function EventsRecurMasterGet(ByVal recurMasterId As Integer, ByVal moduleId As Integer) As IDataReader - Public MustOverride Function EventsRecurMasterSave(ByVal recurMasterId As Integer, ByVal moduleId As Integer, ByVal portalId As Integer, ByVal rrule As String, _ - ByVal dtstart As DateTime, ByVal duration As String, ByVal until As DateTime, _ - ByVal eventName As String, ByVal eventDesc As String, ByVal importance As Integer, ByVal notify As String, ByVal approved As Boolean, _ - ByVal signups As Boolean, ByVal maxEnrollment As Integer, ByVal enrollRoleId As Integer, _ - ByVal enrollFee As Decimal, ByVal enrollType As String, ByVal payPalAccount As String, _ - ByVal detailPage As Boolean, ByVal detailNewWin As Boolean, ByVal detailUrl As String, ByVal imageUrl As String, _ - ByVal imageType As String, ByVal imageWidth As Integer, ByVal imageHeight As Integer, ByVal imageDisplay As Boolean, ByVal location As Integer, _ - ByVal category As Integer, ByVal reminder As String, ByVal sendReminder As Boolean, ByVal reminderTime As Integer, _ - ByVal reminderTimeMeasurement As String, ByVal reminderFrom As String, ByVal customField1 As String, ByVal customField2 As String, _ - ByVal enrollListView As Boolean, ByVal displayEndDate As Boolean, ByVal allDayEvent As Boolean, ByVal cultureName As String, ByVal ownerId As Integer, ByVal createdById As Integer, _ - ByVal updatedById As Integer, ByVal eventTimeZoneId As String, ByVal allowAnonEnroll As Boolean, ByVal contentItemId As Integer, ByVal socialGroupId As Integer, ByVal socialUserId As Integer, ByVal summary As String) As IDataReader - Public MustOverride Function EventsRecurMasterModerate(ByVal moduleId As Integer, ByVal socialGroupId As Integer) As IDataReader -#End Region - -#Region "Event Subscription Functions" - Public MustOverride Sub EventsSubscriptionDeleteUser(ByVal userId As Integer, ByVal moduleId As Integer) - Public MustOverride Function EventsSubscriptionGetUser(ByVal userId As Integer, ByVal moduleId As Integer) As IDataReader - Public MustOverride Function EventsSubscriptionGetModule(ByVal moduleId As Integer) As IDataReader - Public MustOverride Function EventsSubscriptionGetSubModule(ByVal moduleId As Integer) As IDataReader - Public MustOverride Function EventsSubscriptionSave(ByVal subscriptionId As Integer, ByVal moduleId As Integer, ByVal portalId As Integer, ByVal userId As Integer) As IDataReader -#End Region - - End Class - -End Namespace diff --git a/Components/EventBase.cs b/Components/EventBase.cs new file mode 100644 index 0000000..47ec41a --- /dev/null +++ b/Components/EventBase.cs @@ -0,0 +1,1328 @@ +using DotNetNuke.Entities.Users; +using System.Drawing; +using DotNetNuke.Framework; +using Microsoft.VisualBasic; +using System.Collections; +using DotNetNuke.Common.Utilities; +using System.Web; +using System.Web.UI.HtmlControls; +using DotNetNuke.Services.Localization; +using System; +using DotNetNuke.Security; +using System.Globalization; +using DotNetNuke.Services.FileSystem; +using DotNetNuke.Security.Roles; +using DotNetNuke.Entities.Modules; + + + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events + { + using DotNetNuke.Modules.Events.Components.Integration; + using Constants = Microsoft.VisualBasic.Constants; + + public class EventBase : PortalModuleBase + { + +#region Properties + private DateTime _selectedDate; + private CultureInfo _currculture; + public DateTime SelectedDate + { + get + { + EventTimeZoneUtilities objEventTimeZoneUtilities = new EventTimeZoneUtilities(); + EventTimeZoneUtilities.DateInfo currDateInfo = objEventTimeZoneUtilities.ConvertFromUTCToDisplayTimeZone(DateTime.UtcNow, GetDisplayTimeZoneId()); + try + { + _currculture = System.Threading.Thread.CurrentThread.CurrentCulture; + if (_selectedDate.Year == 1) + { + if (!(Request.Params["selecteddate"] == null)) + { + string strDate = Request.Params["selecteddate"]; + if (Information.IsDate(strDate)) + { + _selectedDate = System.Convert.ToDateTime(strDate); + } + else + { + CultureInfo invCulture = CultureInfo.InvariantCulture; + try + { + _selectedDate = DateTime.ParseExact(strDate, "yyyyMMdd", invCulture); + } + catch (Exception) + { + _selectedDate = currDateInfo.EventDate; + } + } + } + else if (ReferenceEquals(Request.Cookies["DNNEvents"], null)) + { + _selectedDate = currDateInfo.EventDate; + } + else if (ReferenceEquals(Request.Cookies["DNNEvents"]["EventSelectedDate" + System.Convert.ToString(ModuleId)], null)) + { + _selectedDate = currDateInfo.EventDate; + } + else + { + string cookieDate = System.Convert.ToString(Request.Cookies["DNNEvents"]["EventSelectedDate" + System.Convert.ToString(ModuleId)]); + System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", false); + if (System.Convert.ToDateTime(cookieDate).Year == 1) + { + _selectedDate = currDateInfo.EventDate; + } + else + { + _selectedDate = System.Convert.ToDateTime(cookieDate); + } + System.Threading.Thread.CurrentThread.CurrentCulture = _currculture; + } + } + return _selectedDate; + } + catch (Exception) + { + System.Threading.Thread.CurrentThread.CurrentCulture = _currculture; + _selectedDate = currDateInfo.EventDate; + return _selectedDate; + } + } + set + { + if (Information.IsDate(value)) + { + _selectedDate = System.Convert.ToDateTime(value.ToShortDateString()); + } + else + { + EventTimeZoneUtilities objEventTimeZoneUtilities = new EventTimeZoneUtilities(); + _selectedDate = objEventTimeZoneUtilities.ConvertFromUTCToDisplayTimeZone(DateTime.UtcNow, GetDisplayTimeZoneId()).EventDate; + } + if (_selectedDate.Year == 1) + { + EventTimeZoneUtilities objEventTimeZoneUtilities = new EventTimeZoneUtilities(); + _selectedDate = objEventTimeZoneUtilities.ConvertFromUTCToDisplayTimeZone(DateTime.UtcNow, GetDisplayTimeZoneId()).EventDate; + } + _currculture = System.Threading.Thread.CurrentThread.CurrentCulture; + System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", false); + Response.Cookies["DNNEvents"]["EventSelectedDate" + System.Convert.ToString(ModuleId)] = _selectedDate.ToShortDateString(); + Response.Cookies["DNNEvents"].Expires = DateTime.Now.AddMinutes(2); + Response.Cookies["DNNEvents"].Path = "/"; + System.Threading.Thread.CurrentThread.CurrentCulture = _currculture; + } + } + + public CDefault BasePage + { + get + { + return ((CDefault) Page); + } + } + +#endregion + +#region Public Routines + public bool IsModerator() + { + if (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString())) + { + return true; + } + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + return objEventInfoHelper.IsModerator(Request.IsAuthenticated); + } + + public bool IsModuleEditor() + { + bool blHasBasePermissions = false; + try + { + ModuleController mc = new ModuleController(); + ModuleInfo objMod = default(ModuleInfo); + DotNetNuke.Security.Permissions.ModulePermissionCollection mp = default(DotNetNuke.Security.Permissions.ModulePermissionCollection); + + objMod = mc.GetModule(ModuleId, TabId, false); + + if (!ReferenceEquals(objMod, null)) + { + mp = objMod.ModulePermissions; + if (DotNetNuke.Security.Permissions.ModulePermissionController.HasModulePermission(mp, "EVENTSEDT")) + { + blHasBasePermissions = true; + } + else if (DotNetNuke.Security.Permissions.ModulePermissionController.HasModulePermission(mp, "EDIT")) + { + blHasBasePermissions = true; + } + } + + } + catch + { + } + if (blHasBasePermissions && Settings.SocialGroupModule == EventModuleSettings.SocialModule.SocialGroup & Settings.SocialGroupSecurity != EventModuleSettings.SocialGroupPrivacy.OpenToAll) + { + int socialGroupID = GetUrlGroupId(); + if (socialGroupID > -1) + { + RoleController objRoleCtl = new RoleController(); + RoleInfo objRoleInfo = objRoleCtl.GetRole(socialGroupID, PortalSettings.PortalId); + if (!ReferenceEquals(objRoleInfo, null)) + { + if (!PortalSettings.UserInfo.IsInRole(objRoleInfo.RoleName)) + { + return false; + } + } + } + } + return blHasBasePermissions; + } + + public bool IsEventEditor(EventInfo objEvent, bool blMasterOwner) + { + try + { + if ((PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString()) == true) || + (IsModuleEditor() && (objEvent.CreatedByID == UserId || (objEvent.OwnerID == UserId && !blMasterOwner) || objEvent.RmOwnerID == UserId)) || + (IsModerator() == true)) + { + return true; + } + else + { + return false; + } + } + catch + { + } + return false; + } + + public bool IsPrivateNotModerator + { + get + { + bool returnValue = false; + if (Settings.PrivateMessage != "" && !IsModerator()) + { + returnValue = true; + } + else + { + returnValue = false; + } + return returnValue; + } + } + + public bool IsCategoryEditor() + { + if (Request.IsAuthenticated) + { + if (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString())) + { + return true; + } + try + { + ModuleController mc = new ModuleController(); + ModuleInfo objMod = default(ModuleInfo); + DotNetNuke.Security.Permissions.ModulePermissionCollection mp = default(DotNetNuke.Security.Permissions.ModulePermissionCollection); + + objMod = mc.GetModule(ModuleId, TabId, false); + + if (!ReferenceEquals(objMod, null)) + { + mp = objMod.ModulePermissions; + return DotNetNuke.Security.Permissions.ModulePermissionController.HasModulePermission(mp, "EVENTSCAT"); + } + else + { + return false; + } + + } + catch + { + } + } + return false; + } + + public bool IsLocationEditor() + { + if (Request.IsAuthenticated) + { + if (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString())) + { + return true; + } + try + { + ModuleController mc = new ModuleController(); + ModuleInfo objMod = default(ModuleInfo); + DotNetNuke.Security.Permissions.ModulePermissionCollection mp = default(DotNetNuke.Security.Permissions.ModulePermissionCollection); + + objMod = mc.GetModule(ModuleId, TabId, false); + + if (!ReferenceEquals(objMod, null)) + { + mp = objMod.ModulePermissions; + return DotNetNuke.Security.Permissions.ModulePermissionController.HasModulePermission(mp, "EVENTSLOC"); + } + else + { + return false; + } + + } + catch + { + } + } + return false; + } + + public bool IsSettingsEditor() + { + if (Request.IsAuthenticated) + { + if (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString())) + { + return true; + } + try + { + ModuleController mc = new ModuleController(); + ModuleInfo objMod = default(ModuleInfo); + DotNetNuke.Security.Permissions.ModulePermissionCollection mp = default(DotNetNuke.Security.Permissions.ModulePermissionCollection); + + objMod = mc.GetModule(ModuleId, TabId, false); + + if (!ReferenceEquals(objMod, null)) + { + mp = objMod.ModulePermissions; + return DotNetNuke.Security.Permissions.ModulePermissionController.HasModulePermission(mp, "EVENTSSET"); + } + else + { + return false; + } + + } + catch + { + } + } + return false; + } + + public ArrayList GetModerators() + { + ArrayList moderators = new ArrayList(); + DotNetNuke.Security.Permissions.ModulePermissionCollection objCollModulePermission = default(DotNetNuke.Security.Permissions.ModulePermissionCollection); + objCollModulePermission = DotNetNuke.Security.Permissions.ModulePermissionController.GetModulePermissions(ModuleId, TabId); + DotNetNuke.Security.Permissions.ModulePermissionInfo objModulePermission = default(DotNetNuke.Security.Permissions.ModulePermissionInfo); + + // To cope with host users or someone who is no longer an editor!! + + foreach (DotNetNuke.Security.Permissions.ModulePermissionInfo tempLoopVar_objModulePermission in objCollModulePermission) + { + objModulePermission = tempLoopVar_objModulePermission; + if (objModulePermission.PermissionKey == "EVENTSMOD") + { + if (objModulePermission.UserID < 0) + { + RoleController objCtlRole = new RoleController(); + if (objModulePermission.RoleID != PortalSettings.AdministratorRoleId) + { + ArrayList lstUsers = objCtlRole.GetUsersByRoleName(PortalId, objModulePermission.RoleName); + UserInfo objUser = default(UserInfo); + foreach (UserInfo tempLoopVar_objUser in lstUsers) + { + objUser = tempLoopVar_objUser; + if (!moderators.Contains(objUser)) + { + moderators.Add(objUser); + } + } + } + } + else + { + UserController objUserCtl = new UserController(); + UserInfo objUser = objUserCtl.GetUser(PortalId, objModulePermission.UserID); + if (!ReferenceEquals(objUser, null)) + { + if (!moderators.Contains(objUser.Email)) + { + moderators.Add(objUser.Email); + } + } + } + } + } + return moderators; + } + + public Color ImportanceColor(int iImportance) + { + switch (iImportance) + { + case 1: + return Color.Red; + case 2: + return Color.Blue; + case 3: + return Color.Black; + default: + return Color.Red; + } + } + + public Color GetColor(string categoryColor) + { + ColorConverter cc = new ColorConverter(); + return ((Color) (cc.ConvertFromString(categoryColor))); + } + + ///

+ /// Attach a theme css to the supplied panel + /// + /// + /// + public void SetTheme(System.Web.UI.WebControls.Panel ctlPnlTheme) + { + ThemeSetting themeSettings = GetThemeSettings(); + + HtmlLink cssLink = new HtmlLink(); + cssLink.Href = themeSettings.ThemeFile; + cssLink.Attributes.Add("rel", "stylesheet"); + cssLink.Attributes.Add("type", "text/css"); + bool added = false; + foreach (object pagecontrol in Page.Header.Controls) + { + if ((pagecontrol) is System.Web.UI.WebControls.PlaceHolder) + { + System.Web.UI.WebControls.PlaceHolder placeholder = (System.Web.UI.WebControls.PlaceHolder) pagecontrol; + if (placeholder.ID == "CSS") + { + int insertat = 1; + foreach (object placeholdercontrol in placeholder.Controls) + { + if ((placeholdercontrol) is HtmlLink) + { + HtmlLink htmllink = (HtmlLink) placeholdercontrol; + if (htmllink.Href.ToLower().Contains("desktopmodules/events/module.css")) + { + placeholder.Controls.AddAt(insertat, cssLink); + added = true; + break; + } + } + insertat++; + } + if (added) + { + break; + } + } + } + } + if (!added) + { + Page.Header.Controls.Add(cssLink); + } + + ctlPnlTheme.CssClass = themeSettings.CssClass; + } + + public ThemeSetting GetThemeSettings() + { + ThemeSetting themeSettings = new ThemeSetting(); + if (themeSettings.ValidateSetting(Settings.EventTheme) == false) + { + themeSettings.ReadSetting(Settings.EventThemeDefault, PortalId); + } + else if (Settings.EventTheme != "") + { + themeSettings.ReadSetting(Settings.EventTheme, PortalId); + } + return themeSettings; + } + + public void AddFacebookMetaTags() + { + if (Settings.FBAdmins != "") + { + HtmlMeta fbMeta = new HtmlMeta(); + fbMeta.Name = "fb:admins"; + fbMeta.Content = Settings.FBAdmins; + Page.Header.Controls.Add(fbMeta); + } + + if (Settings.FBAppID != "") + { + HtmlMeta fbMeta = new HtmlMeta(); + fbMeta.Name = "fb:app_id"; + fbMeta.Content = Settings.FBAppID; + Page.Header.Controls.Add(fbMeta); + } + + } + + public string ImageInfo(string imageUrl, int imageHeight, int imageWidth) + { + string imagestring = ""; + string imageSrc = ""; + if (imageUrl.StartsWith("FileID=")) + { + IFileInfo objFile = default(IFileInfo); + int fileId = int.Parse(imageUrl.Substring(7)); + objFile = FileManager.Instance.GetFile(fileId); + if (!ReferenceEquals(objFile, null)) + { + imageSrc = objFile.Folder + objFile.FileName.Replace(" ", "%20"); + if (imageSrc.IndexOf("://") + 1 == 0) + { + imageSrc = PortalSettings.HomeDirectory + imageSrc; + } + imagestring = ConvertToThumb(imageSrc, imageWidth, imageHeight); + } + } + else if (imageUrl.StartsWith("http")) + { + imageSrc = imageUrl; + imagestring = ConvertToThumb(imageSrc, imageWidth, imageHeight); + } + return imagestring; + } + + private string ConvertToThumb(string imageSrc, int imageWidth, int imageHeight) + { + string imagestring = ""; + if (imageWidth > 0 & imageHeight > 0) + { + int thumbWidth = imageWidth; + int thumbHeight = imageHeight; + if (imageHeight > Settings.MaxThumbHeight) + { + thumbHeight = Settings.MaxThumbHeight; + thumbWidth = System.Convert.ToInt32((double) imageWidth * Settings.MaxThumbHeight / imageHeight); + } + if (thumbWidth > Settings.MaxThumbWidth) + { + thumbWidth = Settings.MaxThumbWidth; + thumbHeight = System.Convert.ToInt32((double) imageHeight * Settings.MaxThumbWidth / imageWidth); + } + imagestring = "\"\"
"; + } + else + { + imagestring = "\"\"
"; + } + return imagestring; + } + + public string DetailPageEdit(EventInfo objEvent) + { + string editString = ""; + if (IsEventEditor(objEvent, false)) + { + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + string imgurl = Entities.Icons.IconController.IconURL("View"); + editString = "
\"""; + } + return editString; + } + + //EVT-4499 Redirect to login page with url parameter returnurl + public void RedirectToLogin() + { + + string returnUrl = HttpContext.Current.Request.RawUrl; + if (returnUrl.IndexOf("?returnurl=", StringComparison.Ordinal) != -1) + { + returnUrl = returnUrl.Substring(0, returnUrl.IndexOf("?returnurl=", StringComparison.Ordinal)); + } + returnUrl = HttpUtility.UrlEncode(returnUrl); + + Response.Redirect(DotNetNuke.Common.Globals.LoginURL(returnUrl, System.Convert.ToBoolean(Request.QueryString["override"] != null)), true); + + } + + public void SetUpIconBar(EventIcons eventIcons, EventIcons eventIcons2) + { + eventIcons.Visible = false; + eventIcons2.Visible = false; + eventIcons.ModuleConfiguration = ModuleConfiguration.Clone(); + eventIcons2.ModuleConfiguration = ModuleConfiguration.Clone(); + switch (Settings.IconBar) + { + case "TOP": + eventIcons.Visible = true; + break; + case "BOTTOM": + eventIcons2.Visible = true; + break; + } + } + + public void SendNewEventEmails(EventInfo objEvent) + { + if (!objEvent.Approved) + { + return ; + } + EventEmailInfo objEventEmailInfo = new EventEmailInfo(); + EventEmails objEventEmail = new EventEmails(PortalId, ModuleId, LocalResourceFile, ((PageBase) Page).PageCulture.Name); + objEventEmailInfo.TxtEmailSubject = Settings.Templates.txtNewEventEmailSubject; + objEventEmailInfo.TxtEmailBody = Settings.Templates.txtNewEventEmailMessage; + objEventEmailInfo.TxtEmailFrom = Settings.StandardEmail; + switch (Settings.Neweventemails) + { + case "Subscribe": + // Email Subscribed Users + + EventSubscriptionController objEventSubscriptionController = new EventSubscriptionController(); + ArrayList lstSubscriptions = default(ArrayList); + EventSubscriptionInfo objEventSubscription = default(EventSubscriptionInfo); + lstSubscriptions = objEventSubscriptionController.EventsSubscriptionGetSubModule(ModuleId); + + if (lstSubscriptions.Count == 0) + { + return ; + } + + EventInfoHelper objEventInfo = new EventInfoHelper(ModuleId, TabId, PortalId, null); + ArrayList lstusers = objEventInfo.GetEventModuleViewers(); + + foreach (EventSubscriptionInfo tempLoopVar_objEventSubscription in lstSubscriptions) + { + objEventSubscription = tempLoopVar_objEventSubscription; + if (!lstusers.Contains(objEventSubscription.UserID)) + { + UserController objCtlUser = new UserController(); + UserInfo objUser = objCtlUser.GetUser(PortalId, objEventSubscription.UserID); + if (!ReferenceEquals(objUser, null) && objUser.IsSuperUser) + { + objEventEmailInfo.UserEmails.Add(objUser.Email); + objEventEmailInfo.UserLocales.Add(objUser.Profile.PreferredLocale); + objEventEmailInfo.UserTimeZoneIds.Add(objUser.Profile.PreferredTimeZone.Id); + } + else + { + continue; + } + } + else + { + objEventEmailInfo.UserIDs.Add(objEventSubscription.UserID); + } + + } + break; + case "Role": + // Email users in role + EventEmailAddRoleUsers(Settings.Neweventemailrole, objEventEmailInfo); + break; + default: + return ; + } + objEventEmail.SendEmails(objEventEmailInfo, objEvent); + + } + + public void EventEmailAddRoleUsers(int roleId, EventEmailInfo objEventEmailInfo) + { + RoleController objRoleController = new RoleController(); + RoleInfo objRole = objRoleController.GetRole(roleId, PortalId); + if (!ReferenceEquals(objRole, null)) + { + ArrayList lstUsers = objRoleController.GetUsersByRoleName(PortalId, objRole.RoleName); + foreach (UserInfo objUser in lstUsers) + { + objEventEmailInfo.UserEmails.Add(objUser.Email); + objEventEmailInfo.UserLocales.Add(objUser.Profile.PreferredLocale); + objEventEmailInfo.UserTimeZoneIds.Add(objUser.Profile.PreferredTimeZone.Id); + } + } + } + + public void CreateNewEventJournal(EventInfo objEvent) + { + if (!Settings.JournalIntegration) + { + return; + } + + if (objEvent.Approved) + { + Journal cntJournal = new Journal(); + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + string url = objEventInfoHelper.DetailPageURL(objEvent); + string imageSrc = null; + if (Settings.Eventimage && objEvent.ImageDisplay) + { + string portalurl = objEventInfoHelper.GetDomainURL(); + if (PortalSettings.PortalAlias.HTTPAlias.IndexOf("/", StringComparison.Ordinal) > 0) + { + portalurl = portalurl + Common.Globals.ApplicationPath; + } + imageSrc = objEvent.ImageURL; + if (objEvent.ImageURL.StartsWith("FileID=")) + { + int fileId = int.Parse(objEvent.ImageURL.Substring(7)); + IFileInfo objFileInfo = FileManager.Instance.GetFile(fileId); + if (!ReferenceEquals(objFileInfo, null)) + { + imageSrc = objFileInfo.Folder + objFileInfo.FileName; + if (imageSrc.IndexOf("://") + 1 == 0) + { + Entities.Portals.PortalController pi = new Entities.Portals.PortalController(); + imageSrc = DotNetNuke.Common.Globals.AddHTTP(string.Format("{0}/{1}/{2}", portalurl, pi.GetPortal(objEvent.PortalID).HomeDirectory, imageSrc)); + } + } + } + } + + cntJournal.NewEvent(objEvent, TabId, url, imageSrc); + + // Update event to show it has an associated JournalItem + EventController cntEvent = new EventController(); + objEvent.JournalItem = true; + cntEvent.EventsSave(objEvent, true, TabId, false); + } + } + + public void CreateEnrollmentJournal(EventSignupsInfo objEventSignup, EventInfo objEvent, EventModuleSettings enrollSettings) + { + if (!enrollSettings.JournalIntegration) + { + return; + } + + if (objEventSignup.Approved && objEventSignup.UserID > -1) + { + int modTab = TabId; + if (modTab == -1) + { + ModuleController cntModule = new ModuleController(); + modTab = cntModule.GetModule(objEvent.ModuleID).TabID; + } + + EventInfoHelper objEventInfoHelper = new EventInfoHelper(objEvent.ModuleID, modTab, objEvent.PortalID, enrollSettings); + string url = objEventInfoHelper.DetailPageURL(objEvent); + + int creatorUserid = UserId; + if (creatorUserid == -1) + { + creatorUserid = objEventSignup.UserID; + } + + Journal cntJournal = new Journal(); + cntJournal.NewEnrollment(objEventSignup, objEvent, modTab, url, creatorUserid); + } + } + + public EventSignupsInfo CreateEnrollment(EventSignupsInfo objEventSignup, EventInfo objEvent) + { + return CreateEnrollment(objEventSignup, objEvent, Settings); + } + + public EventSignupsInfo CreateEnrollment(EventSignupsInfo objEventSignup, EventInfo objEvent, EventModuleSettings enrollSettings) + { + EventSignupsController objCtlEventSignups = new EventSignupsController(); + if (objEventSignup.SignupID == 0) + { + objEventSignup = objCtlEventSignups.EventsSignupsSave(objEventSignup); + } + else + { + objCtlEventSignups.EventsSignupsSave(objEventSignup); + } + CreateEnrollmentJournal(objEventSignup, objEvent, enrollSettings); + return objEventSignup; + } + + public void DeleteEnrollment(int signupId, int inModuleId, int eventId) + { + EventSignupsController objCtlEventSignups = new EventSignupsController(); + objCtlEventSignups.EventsSignupsDelete(signupId, inModuleId); + Journal cntJournal = new Journal(); + cntJournal.DeleteEnrollment(inModuleId, eventId, signupId, PortalId); + } + + public string ToolTipCreate(EventInfo objEvent, string templateTitle, string templateBody, bool isEvtEditor) + { + string themeCss = GetThemeSettings().CssClass; + + TokenReplaceControllerClass tr = new TokenReplaceControllerClass(ModuleId, LocalResourceFile); + + // Add sub module name if a sub-calendar + bool blAddSubModuleName = false; + if (objEvent.ModuleID != ModuleId && objEvent.ModuleTitle != null && Settings.Addsubmodulename) + { + blAddSubModuleName = true; + } + + string tooltipTitle = tr.TokenReplaceEvent(objEvent, System.Convert.ToString(templateTitle.Replace(Constants.vbLf, "").Replace(Constants.vbCr, "")), blAddSubModuleName); + string tooltipBody = tr.TokenReplaceEvent(objEvent, System.Convert.ToString(templateBody.Replace(Constants.vbLf, "").Replace(Constants.vbCr, "")), null, false, isEvtEditor); + + // Shorten to maximum length + int intTooltipLength = Settings.Eventtooltiplength; + tooltipBody = System.Convert.ToString(HtmlUtils.Shorten(System.Convert.ToString(HttpUtility.HtmlDecode(tooltipBody).Replace(Environment.NewLine, " ")), intTooltipLength, "...").Replace("[", "[").Replace("]", "]")); + string tooltip = "
" + tooltipTitle + "
" + tooltipBody + "
"); + return tooltip; + + } + + public string EnrolmentColumns(EventInfo eventInfo, bool enrollListView) + { + string txtColumns = ""; + if (Settings.Eventsignup && enrollListView) + { + if (IsEventEditor(eventInfo, false)) + { + if (Settings.EnrollEditFields != "" || Settings.EnrollViewFields != "" || Settings.EnrollAnonFields != "") + { + txtColumns = Settings.EnrollEditFields + ";" + Settings.EnrollViewFields + ";" + Settings.EnrollAnonFields; + } + } + else if (Request.IsAuthenticated) + { + if (Settings.EnrollViewFields != "" || Settings.EnrollAnonFields != "") + { + txtColumns = Settings.EnrollViewFields + ";" + Settings.EnrollAnonFields; + } + } + else + { + if (Settings.EnrollAnonFields != "") + { + txtColumns = Settings.EnrollAnonFields; + } + } + } + txtColumns = txtColumns.Replace("01", "UserName"); + txtColumns = txtColumns.Replace("02", "DisplayName"); + txtColumns = txtColumns.Replace("03", "Email"); + txtColumns = txtColumns.Replace("04", "Phone"); + txtColumns = txtColumns.Replace("05", "Approved"); + txtColumns = txtColumns.Replace("06", "Qty"); + + return txtColumns; + + } + + public void CreateThemeDirectory() + { + //Create theme folder if needed + Entities.Portals.PortalController pc = new Entities.Portals.PortalController(); + var with_1 = pc.GetPortal(PortalId); + string eventSkinPath = string.Format("{0}\\DNNEvents\\Themes", with_1.HomeDirectoryMapPath); + if (!System.IO.Directory.Exists(eventSkinPath)) + { + System.IO.Directory.CreateDirectory(eventSkinPath); + } + } + + public bool HideFullEvent(EventInfo objevent) + { + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + return objEventInfoHelper.HideFullEvent(objevent, Settings.Eventhidefullenroll, UserId, Request.IsAuthenticated); + } + + public string CreateIconString(EventInfo objEvent, bool iconPrio, bool iconRec, bool iconReminder, bool iconEnroll) + { + EventRecurMasterController objCtlEventRecurMaster = new EventRecurMasterController(); + string iconString = ""; + if (iconPrio) + { + switch (objEvent.Importance.ToString()) + { + case "High": + iconString = "\"" "; + break; + case "Low": + iconString = "\"" "; + break; + } + } + if (objEvent.RRULE != "" && iconRec) + { + iconString = iconString + "\"" "; + } + + string notificationInfo = ""; + if (objEvent.SendReminder && iconReminder && Request.IsAuthenticated) + { + EventNotificationController objEventNotificationController = new EventNotificationController(); + notificationInfo = objEventNotificationController.NotifyInfo(objEvent.EventID, UserInfo.Email, objEvent.ModuleID, LocalResourceFile, GetDisplayTimeZoneId()); + } + if (objEvent.SendReminder && iconReminder && Request.IsAuthenticated && !string.IsNullOrEmpty(notificationInfo)) + { + iconString = iconString + "\"" "; + } + else if (objEvent.SendReminder && iconReminder && (Settings.Notifyanon || Request.IsAuthenticated)) + { + iconString = iconString + "\"" "; + } + + EventSignupsController objEventSignupsController = new EventSignupsController(); + if (iconEnroll && objEventSignupsController.DisplayEnrollIcon(objEvent) && Settings.Eventsignup) + { + if (objEvent.MaxEnrollment == 0 | objEvent.Enrolled < objEvent.MaxEnrollment) + { + iconString = iconString + "\"" "; + } + else + { + iconString = iconString + "\"" "; + } + } + if (objEvent.DetailPage == true) + { + iconString = iconString + DetailPageEdit(objEvent); + } + return iconString; + } + + public void SetupViewControls(EventIcons eventIcons, EventIcons eventIcons2, SelectCategory selectCategory, SelectLocation selectLocation, System.Web.UI.WebControls.Panel pnlDateControls = null) + { + // Disable Top Navigation + if (!ReferenceEquals(pnlDateControls, null) && Settings.DisableEventnav) + { + pnlDateControls.Visible = false; + } + + // Setup Icon Bar for use + SetUpIconBar(eventIcons, eventIcons2); + + // Category Configuration and Settings. + selectCategory.ModuleConfiguration = ModuleConfiguration.Clone(); + + // Disable Category Select + if (Settings.Enablecategories == EventModuleSettings.DisplayCategories.DoNotDisplay | + (IsPrivateNotModerator && + !IsCategoryEditor())) + { + selectCategory.Visible = false; + } + + // Location Configuration and Settings. + selectLocation.ModuleConfiguration = ModuleConfiguration.Clone(); + + // Disable Location Select + if (Settings.Enablelocations == EventModuleSettings.DisplayLocations.DoNotDisplay | + (IsPrivateNotModerator && + !IsLocationEditor())) + { + selectLocation.Visible = false; + } + } + + public string CreateEventName(EventInfo objEvent, string template = null) + { + bool isEvtEditor = IsEventEditor(objEvent, false); + + bool blAddSubModuleName = false; + if (objEvent.ModuleID != ModuleId && objEvent.ModuleTitle != null && Settings.Addsubmodulename) + { + blAddSubModuleName = true; + } + TokenReplaceControllerClass tcc = new TokenReplaceControllerClass(ModuleId, LocalResourceFile); + return tcc.TokenReplaceEvent(objEvent, template, null, blAddSubModuleName, isEvtEditor); + } + + public ArrayList Get_ListView_Events(ArrayList categoryIDs, ArrayList locationIDs) + { + DateTime moduleStartDate = default(DateTime); // Start View Date Events Range + DateTime moduleEndDate = default(DateTime); // End View Date Events Range + DateTime displayStartDate = default(DateTime); // Start View Date Events Range + DateTime displayEndDate = default(DateTime); // End View Date Events Range + int noEvents = 0; + + // Set Date Range + DateTime moduleDate = default(DateTime); + DateTime displayDate = default(DateTime); + if (Settings.ListViewUseTime) + { + moduleDate = ModuleNow(); + displayDate = DisplayNow(); + } + else + { + moduleDate = ModuleNow().Date; + displayDate = DisplayNow().Date; + } + int numDays = Settings.EventsListEventDays; + if (Settings.EventsListSelectType == "DAYS") + { + //****DO NOT CHANGE THE NEXT SECTION FOR ML CODING **** + // Used Only to select view dates on Event Month View.. + moduleStartDate = moduleDate.AddDays((Settings.EventsListBeforeDays + 1) * -1); + moduleEndDate = moduleDate.AddDays((Settings.EventsListAfterDays + 1) * 1); + displayStartDate = displayDate.AddDays(Settings.EventsListBeforeDays * -1); + displayEndDate = displayDate.AddDays(Settings.EventsListAfterDays * 1); + } + else + { + noEvents = Settings.EventsListNumEvents; + moduleStartDate = moduleDate.AddDays(-1); + moduleEndDate = moduleDate.AddDays(numDays + 1); + displayStartDate = displayDate; + displayEndDate = displayDate.AddDays(numDays); + } + + bool getSubEvents = Settings.MasterEvent; + + EventInfo objEvent = default(EventInfo); + EventInfo lstEvent = default(EventInfo); + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + ArrayList lstEvents = default(ArrayList); + ArrayList selectedEvents = new ArrayList(); + lstEvents = objEventInfoHelper.GetEvents(moduleStartDate, moduleEndDate, getSubEvents, categoryIDs, locationIDs, GetUrlGroupId(), GetUrlUserId()); + + lstEvents = objEventInfoHelper.ConvertEventListToDisplayTimeZone(lstEvents, GetDisplayTimeZoneId()); + + foreach (EventInfo tempLoopVar_objEvent in lstEvents) + { + objEvent = tempLoopVar_objEvent; + // If full enrollments should be hidden, ignore + if (HideFullEvent(objEvent)) + { + continue; + } + if (objEvent.EventTimeEnd < displayStartDate || + objEvent.EventTimeBegin > displayEndDate) + { + continue; + } + + bool blAddEvent = true; + if (Settings.Collapserecurring) + { + foreach (EventInfo tempLoopVar_lstEvent in selectedEvents) + { + lstEvent = tempLoopVar_lstEvent; + if (lstEvent.RecurMasterID == objEvent.RecurMasterID) + { + blAddEvent = false; + } + } + } + if (blAddEvent) + { + selectedEvents.Add(objEvent); + } + + if (Settings.EventsListSelectType == "EVENTS" && + selectedEvents.Count >= noEvents) + { + break; + } + } + return selectedEvents; + } + + public DateTime ModuleNow() + { + EventTimeZoneUtilities objEventTimeZoneUtilities = new EventTimeZoneUtilities(); + return objEventTimeZoneUtilities.ConvertFromUTCToModuleTimeZone(DateTime.UtcNow, Settings.TimeZoneId); + } + + public DateTime DisplayNow() + { + EventTimeZoneUtilities objEventTimeZoneUtilities = new EventTimeZoneUtilities(); + return objEventTimeZoneUtilities.ConvertFromUTCToDisplayTimeZone(DateTime.UtcNow, GetDisplayTimeZoneId()).EventDate; + } + + public string GetDisplayTimeZoneId() + { + return GetDisplayTimeZoneId(Settings, PortalId); + } + + public string GetDisplayTimeZoneId(EventModuleSettings modSettings, int modPortalid) + { + return GetDisplayTimeZoneId(modSettings, modPortalid, null); + } + + public string GetDisplayTimeZoneId(EventModuleSettings modSettings, int modPortalid, string userTimeZoneId) + { + string displayTimeToneId = ""; + + //Try Primary + if (modSettings.PrimaryTimeZone == EventModuleSettings.TimeZones.UserTZ) + { + if (!ReferenceEquals(userTimeZoneId, null)) + { + displayTimeToneId = userTimeZoneId; + } + else + { + displayTimeToneId = GetUserTimeZoneId(); + } + } + else if (modSettings.PrimaryTimeZone == EventModuleSettings.TimeZones.ModuleTZ) + { + displayTimeToneId = GetModuleTimeZoneId(modSettings); + } + else if (modSettings.PrimaryTimeZone == EventModuleSettings.TimeZones.PortalTZ) + { + displayTimeToneId = GetPortalTimeZoneId(); + } + + // Try Secondary + if (string.IsNullOrEmpty(displayTimeToneId)) + { + if (modSettings.SecondaryTimeZone == EventModuleSettings.TimeZones.UserTZ) + { + if (!ReferenceEquals(userTimeZoneId, null)) + { + displayTimeToneId = userTimeZoneId; + } + else + { + displayTimeToneId = GetUserTimeZoneId(); + } + } + else if (modSettings.SecondaryTimeZone == EventModuleSettings.TimeZones.ModuleTZ) + { + displayTimeToneId = GetModuleTimeZoneId(modSettings); + } + else if (modSettings.SecondaryTimeZone == EventModuleSettings.TimeZones.PortalTZ) + { + displayTimeToneId = GetPortalTimeZoneId(); + } + } + + // If all else fails use Portal + if (string.IsNullOrEmpty(displayTimeToneId)) + { + displayTimeToneId = GetPortalTimeZoneId(); + } + + return displayTimeToneId; + } + + public EventListObject.SortFilter GetListSortExpression(string columnName) + { + EventListObject.SortFilter sortExpression = EventListObject.SortFilter.EventDateBegin; + switch (columnName) + { + case "CategoryName": + sortExpression = EventListObject.SortFilter.CategoryName; + break; + case "CustomField1": + sortExpression = EventListObject.SortFilter.CustomField1; + break; + case "CustomField2": + sortExpression = EventListObject.SortFilter.CustomField2; + break; + case "Description": + sortExpression = EventListObject.SortFilter.Description; + break; + case "Duration": + sortExpression = EventListObject.SortFilter.Duration; + break; + case "EventDateBegin": + sortExpression = EventListObject.SortFilter.EventDateBegin; + break; + case "EventDateEnd": + sortExpression = EventListObject.SortFilter.EventDateEnd; + break; + case "EventName": + sortExpression = EventListObject.SortFilter.EventName; + break; + case "LocationName": + sortExpression = EventListObject.SortFilter.LocationName; + break; + case "EventID": + sortExpression = EventListObject.SortFilter.EventID; + break; + } + return sortExpression; + } + + public EventSignupsInfo.SortFilter GetSignupsSortExpression(string columnName) + { + EventSignupsInfo.SortFilter sortExpression = EventSignupsInfo.SortFilter.EventTimeBegin; + switch (columnName) + { + case "EventID": + sortExpression = EventSignupsInfo.SortFilter.EventID; + break; + case "Duration": + sortExpression = EventSignupsInfo.SortFilter.Duration; + break; + case "EventTimeBegin": + sortExpression = EventSignupsInfo.SortFilter.EventTimeBegin; + break; + case "EventTimeEnd": + sortExpression = EventSignupsInfo.SortFilter.EventTimeEnd; + break; + case "EventName": + sortExpression = EventSignupsInfo.SortFilter.EventName; + break; + case "Approved": + sortExpression = EventSignupsInfo.SortFilter.Approved; + break; + } + return sortExpression; + } + + public int GetUrlGroupId() + { + int socialGroupId = -1; + if (!(HttpContext.Current.Request.QueryString["groupid"] == "") && Settings.SocialGroupModule == EventModuleSettings.SocialModule.SocialGroup) + { + socialGroupId = System.Convert.ToInt32(HttpContext.Current.Request.QueryString["groupid"]); + } + return socialGroupId; + } + + public int GetUrlUserId() + { + int socialUserId = -1; + if (!(HttpContext.Current.Request.QueryString["userid"] == "") && Settings.SocialGroupModule == EventModuleSettings.SocialModule.UserProfile) + { + socialUserId = System.Convert.ToInt32(HttpContext.Current.Request.QueryString["Userid"]); + } + return socialUserId; + } + + public void StorePrevPageInViewState() + { + if (!ReferenceEquals(Request.UrlReferrer, null)) + { + ViewState["prevPage"] = Request.UrlReferrer.ToString(); + } + else + { + ViewState["prevPage"] = GetSocialNavigateUrl(); + } + } + + public string GetStoredPrevPage() + { + return ViewState["prevPage"].ToString(); + } + + public string GetSocialNavigateUrl() + { + int socialGroupId = GetUrlGroupId(); + int socialUserId = GetUrlUserId(); + if (socialGroupId > 0) + { + return DotNetNuke.Common.Globals.NavigateURL(TabId, "", "groupid=" + socialGroupId.ToString()); + } + else if (socialUserId > 0) + { + return DotNetNuke.Common.Globals.NavigateURL(TabId, "", "userid=" + socialUserId.ToString()); + } + else + { + return DotNetNuke.Common.Globals.NavigateURL(); + } + } +#endregion + +#region Private Routines + private string GetUserTimeZoneId() + { + if (HttpContext.Current.Request.IsAuthenticated) + { + UserInfo objUser = UserController.GetCurrentUserInfo(); + TimeZoneInfo authUserTimeZone = objUser.Profile.PreferredTimeZone; + return authUserTimeZone.Id; + } + return ""; + } + + private string GetModuleTimeZoneId(EventModuleSettings modSettings) + { + if (!ReferenceEquals(modSettings.TimeZoneId, null)) + { + return modSettings.TimeZoneId; + } + return ""; + } + + private string GetPortalTimeZoneId() + { + string portalTimeZoneId = ""; + if (ReferenceEquals(HttpContext.Current, null)) + { + portalTimeZoneId = Entities.Portals.PortalController.GetPortalSetting("TimeZone", PortalId, string.Empty); + } + else + { + portalTimeZoneId = Entities.Portals.PortalController.GetCurrentPortalSettings().TimeZone.Id; + } + return portalTimeZoneId; + } + +#endregion + +#region Shadow PMB Settings + +#region Variables + + private EventModuleSettings _settings; + +#endregion + +#region Properties + public new EventModuleSettings Settings + { + get + { + if (ReferenceEquals(_settings, null)) + { + EventModuleSettings ems = new EventModuleSettings(); + _settings = ems.GetEventModuleSettings(ModuleId, LocalResourceFile); + } + return _settings; + } + set + { + _settings = value; + } + } + +#endregion + +#endregion + } + } + diff --git a/Components/EventBase.vb b/Components/EventBase.vb deleted file mode 100644 index 1b45a49..0000000 --- a/Components/EventBase.vb +++ /dev/null @@ -1,1014 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports DotNetNuke.Security -Imports System.Globalization -Imports DotNetNuke.Services.FileSystem -Imports DotNetNuke.Security.Roles -Imports DotNetNuke.Entities.Modules -Imports DotNetNuke.Modules.Events.Components.Integration - -Namespace DotNetNuke.Modules.Events - Public Class EventBase - Inherits PortalModuleBase - -#Region "Properties" - Private _selectedDate As Date - Private _currculture As CultureInfo - Public Property SelectedDate() As Date - Get - Dim objEventTimeZoneUtilities As New EventTimeZoneUtilities - Dim currDateInfo As EventTimeZoneUtilities.DateInfo = objEventTimeZoneUtilities.ConvertFromUTCToDisplayTimeZone(Date.UtcNow, GetDisplayTimeZoneId()) - Try - _currculture = Threading.Thread.CurrentThread.CurrentCulture - If _selectedDate.Year = 1 Then - If Not Request.Params("selecteddate") = Nothing Then - Dim strDate As String = Request.Params("selecteddate") - If IsDate(strDate) Then - _selectedDate = CType(strDate, Date) - Else - Dim invCulture As CultureInfo = CultureInfo.InvariantCulture - Try - _selectedDate = Date.ParseExact(strDate, "yyyyMMdd", invCulture) - Catch ex As Exception - _selectedDate = currDateInfo.EventDate - End Try - End If - ElseIf Request.Cookies("DNNEvents") Is Nothing Then - _selectedDate = currDateInfo.EventDate - ElseIf Request.Cookies("DNNEvents")("EventSelectedDate" & ModuleId) Is Nothing Then - _selectedDate = currDateInfo.EventDate - Else - Dim cookieDate As String = Request.Cookies("DNNEvents")("EventSelectedDate" & ModuleId) - Threading.Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US", False) - If CType(cookieDate, Date).Year = 1 Then - _selectedDate = currDateInfo.EventDate - Else - _selectedDate = CType(cookieDate, Date) - End If - Threading.Thread.CurrentThread.CurrentCulture = _currculture - End If - End If - Return _selectedDate - Catch exc As Exception - Threading.Thread.CurrentThread.CurrentCulture = _currculture - _selectedDate = currDateInfo.EventDate - Return _selectedDate - End Try - End Get - Set(ByVal value As Date) - If IsDate(value) Then - _selectedDate = CType(value.ToShortDateString, Date) - Else - Dim objEventTimeZoneUtilities As New EventTimeZoneUtilities - _selectedDate = objEventTimeZoneUtilities.ConvertFromUTCToDisplayTimeZone(Date.UtcNow, GetDisplayTimeZoneId()).EventDate - End If - If _selectedDate.Year = 1 Then - Dim objEventTimeZoneUtilities As New EventTimeZoneUtilities - _selectedDate = objEventTimeZoneUtilities.ConvertFromUTCToDisplayTimeZone(Date.UtcNow, GetDisplayTimeZoneId()).EventDate - End If - _currculture = Threading.Thread.CurrentThread.CurrentCulture - Threading.Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US", False) - Response.Cookies("DNNEvents")("EventSelectedDate" & ModuleId) = _selectedDate.ToShortDateString - Response.Cookies("DNNEvents").Expires = DateTime.Now.AddMinutes(2) - Response.Cookies("DNNEvents").Path = "/" - Threading.Thread.CurrentThread.CurrentCulture = _currculture - End Set - End Property - - Public ReadOnly Property BasePage() As CDefault - Get - Return CType(Page, CDefault) - End Get - End Property - -#End Region - -#Region "Public Routines" - Public Function IsModerator() As Boolean - If PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) Then - Return True - End If - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - Return objEventInfoHelper.IsModerator(Request.IsAuthenticated) - End Function - - Public Function IsModuleEditor() As Boolean - Dim blHasBasePermissions As Boolean = False - Try - Dim mc As New ModuleController - Dim objMod As ModuleInfo - Dim mp As Permissions.ModulePermissionCollection - - objMod = mc.GetModule(ModuleId, TabId, False) - - If Not objMod Is Nothing Then - mp = objMod.ModulePermissions - If Permissions.ModulePermissionController.HasModulePermission(mp, "EVENTSEDT") Then - blHasBasePermissions = True - ElseIf Permissions.ModulePermissionController.HasModulePermission(mp, "EDIT") Then - blHasBasePermissions = True - End If - End If - - Catch - End Try - If blHasBasePermissions And Settings.SocialGroupModule = EventModuleSettings.SocialModule.SocialGroup And Settings.SocialGroupSecurity <> EventModuleSettings.SocialGroupPrivacy.OpenToAll Then - Dim socialGroupID As Integer = GetUrlGroupId() - If socialGroupID > -1 Then - Dim objRoleCtl As New RoleController - Dim objRoleInfo As RoleInfo = objRoleCtl.GetRole(socialGroupID, PortalSettings.PortalId) - If Not objRoleInfo Is Nothing Then - If Not PortalSettings.UserInfo.IsInRole(objRoleInfo.RoleName) Then - Return False - End If - End If - End If - End If - Return blHasBasePermissions - End Function - - Public Function IsEventEditor(ByVal objEvent As EventInfo, ByVal blMasterOwner As Boolean) As Boolean - Try - If (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) = True) Or _ - (IsModuleEditor() And (objEvent.CreatedByID = UserId Or (objEvent.OwnerID = UserId And Not blMasterOwner) Or objEvent.RMOwnerID = UserId)) Or _ - (IsModerator() = True) Then - Return True - Else - Return False - End If - Catch - End Try - Return False - End Function - - Public ReadOnly Property IsPrivateNotModerator() As Boolean - Get - If Settings.PrivateMessage <> "" And Not IsModerator() Then - IsPrivateNotModerator = True - Else - IsPrivateNotModerator = False - End If - End Get - End Property - - Public Function IsCategoryEditor() As Boolean - If Request.IsAuthenticated Then - If PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) Then - Return True - End If - Try - Dim mc As New ModuleController - Dim objMod As ModuleInfo - Dim mp As Permissions.ModulePermissionCollection - - objMod = mc.GetModule(ModuleId, TabId, False) - - If Not objMod Is Nothing Then - mp = objMod.ModulePermissions - Return Permissions.ModulePermissionController.HasModulePermission(mp, "EVENTSCAT") - Else - Return False - End If - - Catch - End Try - End If - Return False - End Function - - Public Function IsLocationEditor() As Boolean - If Request.IsAuthenticated Then - If PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) Then - Return True - End If - Try - Dim mc As New ModuleController - Dim objMod As ModuleInfo - Dim mp As Permissions.ModulePermissionCollection - - objMod = mc.GetModule(ModuleId, TabId, False) - - If Not objMod Is Nothing Then - mp = objMod.ModulePermissions - Return Permissions.ModulePermissionController.HasModulePermission(mp, "EVENTSLOC") - Else - Return False - End If - - Catch - End Try - End If - Return False - End Function - - Public Function IsSettingsEditor() As Boolean - If Request.IsAuthenticated Then - If PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) Then - Return True - End If - Try - Dim mc As New ModuleController - Dim objMod As ModuleInfo - Dim mp As Permissions.ModulePermissionCollection - - objMod = mc.GetModule(ModuleId, TabId, False) - - If Not objMod Is Nothing Then - mp = objMod.ModulePermissions - Return Permissions.ModulePermissionController.HasModulePermission(mp, "EVENTSSET") - Else - Return False - End If - - Catch - End Try - End If - Return False - End Function - - Public Function GetModerators() As ArrayList - Dim moderators As New ArrayList - Dim objCollModulePermission As Permissions.ModulePermissionCollection - objCollModulePermission = Permissions.ModulePermissionController.GetModulePermissions(ModuleId, TabId) - Dim objModulePermission As Permissions.ModulePermissionInfo - - ' To cope with host users or someone who is no longer an editor!! - - For Each objModulePermission In objCollModulePermission - If objModulePermission.PermissionKey = "EVENTSMOD" Then - If objModulePermission.UserID < 0 Then - Dim objCtlRole As New RoleController - If objModulePermission.RoleID <> PortalSettings.AdministratorRoleId Then - Dim lstUsers As ArrayList = objCtlRole.GetUsersByRoleName(PortalId, objModulePermission.RoleName) - Dim objUser As UserInfo - For Each objUser In lstUsers - If Not moderators.Contains(objUser) Then - moderators.Add(objUser) - End If - Next - End If - Else - Dim objUserCtl As New UserController - Dim objUser As UserInfo = objUserCtl.GetUser(PortalId, objModulePermission.UserID) - If Not objUser Is Nothing Then - If Not moderators.Contains(objUser.Email) Then - moderators.Add(objUser.Email) - End If - End If - End If - End If - Next - Return moderators - End Function - - Public Function ImportanceColor(ByVal iImportance As Integer) As Color - Select Case iImportance - Case 1 - Return Color.Red - Case 2 - Return Color.Blue - Case 3 - Return Color.Black - End Select - End Function - - Public Function GetColor(ByVal categoryColor As String) As Color - Dim cc As ColorConverter = New ColorConverter - Return CType(cc.ConvertFromString(categoryColor), Color) - End Function - - ''' - ''' Attach a theme css to the supplied panel - ''' - ''' - ''' - Public Sub SetTheme(ByVal ctlPnlTheme As System.Web.UI.WebControls.Panel) - Dim themeSettings As ThemeSetting = GetThemeSettings() - - Dim cssLink As New HtmlLink() - With cssLink - .Href = themeSettings.ThemeFile - .Attributes.Add("rel", "stylesheet") - .Attributes.Add("type", "text/css") - End With - Dim added As Boolean = False - For Each pagecontrol As Object In Page.Header.Controls - If TypeOf (pagecontrol) Is System.Web.UI.WebControls.PlaceHolder Then - Dim placeholder As System.Web.UI.WebControls.PlaceHolder = CType(pagecontrol, System.Web.UI.WebControls.PlaceHolder) - If placeholder.ID = "CSS" Then - Dim insertat As Integer = 1 - For Each placeholdercontrol As Object In placeholder.Controls - If TypeOf (placeholdercontrol) Is HtmlLink Then - Dim htmllink As HtmlLink = CType(placeholdercontrol, HtmlLink) - If htmllink.Href.ToLower.Contains("desktopmodules/events/module.css") Then - placeholder.Controls.AddAt(insertat, cssLink) - added = True - Exit For - End If - End If - insertat += 1 - Next - If added Then - Exit For - End If - End If - End If - Next - If Not added Then - Page.Header.Controls.Add(cssLink) - End If - - ctlPnlTheme.CssClass = themeSettings.CssClass - End Sub - - Public Function GetThemeSettings() As ThemeSetting - Dim themeSettings As New ThemeSetting - If themeSettings.ValidateSetting(Settings.EventTheme) = False Then - themeSettings.ReadSetting(Settings.EventThemeDefault, PortalId) - ElseIf Settings.EventTheme <> "" Then - themeSettings.ReadSetting(Settings.EventTheme, PortalId) - End If - Return themeSettings - End Function - - Public Sub AddFacebookMetaTags() - If Settings.FBAdmins <> "" Then - Dim fbMeta As New HtmlMeta - fbMeta.Name = "fb:admins" - fbMeta.Content = Settings.FBAdmins - Page.Header.Controls.Add(fbMeta) - End If - - If Settings.FBAppID <> "" Then - Dim fbMeta As New HtmlMeta - fbMeta.Name = "fb:app_id" - fbMeta.Content = Settings.FBAppID - Page.Header.Controls.Add(fbMeta) - End If - - End Sub - - Public Function ImageInfo(ByVal imageUrl As String, ByVal imageHeight As Integer, ByVal imageWidth As Integer) As String - Dim imagestring As String = "" - Dim imageSrc As String - If imageUrl.StartsWith("FileID=") Then - Dim objFile As IFileInfo - Dim fileId As Integer = Integer.Parse(imageUrl.Substring(7)) - objFile = FileManager.Instance.GetFile(fileId) - If Not objFile Is Nothing Then - imageSrc = objFile.Folder + objFile.FileName.Replace(" ", "%20") - If InStr(1, imageSrc, "://") = 0 Then - imageSrc = PortalSettings.HomeDirectory & imageSrc - End If - imagestring = ConvertToThumb(imageSrc, imageWidth, imageHeight) - End If - ElseIf imageUrl.StartsWith("http") Then - imageSrc = imageUrl - imagestring = ConvertToThumb(imageSrc, imageWidth, imageHeight) - End If - Return imagestring - End Function - - Private Function ConvertToThumb(ByVal imageSrc As String, ByVal imageWidth As Integer, ByVal imageHeight As Integer) As String - Dim imagestring As String - If imageWidth > 0 And imageHeight > 0 Then - Dim thumbWidth As Integer = imageWidth - Dim thumbHeight As Integer = imageHeight - If imageHeight > Settings.MaxThumbHeight Then - thumbHeight = Settings.MaxThumbHeight - thumbWidth = CInt(imageWidth * Settings.MaxThumbHeight / imageHeight) - End If - If thumbWidth > Settings.MaxThumbWidth Then - thumbWidth = Settings.MaxThumbWidth - thumbHeight = CInt(imageHeight * Settings.MaxThumbWidth / imageWidth) - End If - imagestring = "
" - Else - imagestring = "
" - End If - Return imagestring - End Function - - Public Function DetailPageEdit(ByVal objEvent As EventInfo) As String - Dim editString As String = "" - If IsEventEditor(objEvent, False) Then - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - Dim imgurl As String = Entities.Icons.IconController.IconURL("View") - editString = "" - End If - Return editString - End Function - - 'EVT-4499 Redirect to login page with url parameter returnurl - Public Sub RedirectToLogin() - - Dim returnUrl As String = HttpContext.Current.Request.RawUrl - If returnUrl.IndexOf("?returnurl=", StringComparison.Ordinal) <> -1 Then - returnUrl = returnUrl.Substring(0, returnUrl.IndexOf("?returnurl=", StringComparison.Ordinal)) - End If - returnUrl = HttpUtility.UrlEncode(returnUrl) - - Response.Redirect(LoginURL(returnUrl, (Request.QueryString("override") IsNot Nothing)), True) - - End Sub - - Public Sub SetUpIconBar(ByVal eventIcons As EventIcons, ByVal eventIcons2 As EventIcons) - eventIcons.Visible = False - eventIcons2.Visible = False - eventIcons.ModuleConfiguration = ModuleConfiguration.Clone - eventIcons2.ModuleConfiguration = ModuleConfiguration.Clone - Select Case Settings.IconBar - Case "TOP" - eventIcons.Visible = True - Case "BOTTOM" - eventIcons2.Visible = True - End Select - End Sub - - Public Sub SendNewEventEmails(ByVal objEvent As EventInfo) - If Not objEvent.Approved Then - Return - End If - Dim objEventEmailInfo As New EventEmailInfo - Dim objEventEmail As New EventEmails(PortalId, ModuleId, LocalResourceFile, CType(Page, PageBase).PageCulture.Name) - objEventEmailInfo.txtEmailSubject = Settings.Templates.txtNewEventEmailSubject - objEventEmailInfo.txtEmailBody = Settings.Templates.txtNewEventEmailMessage - objEventEmailInfo.txtEmailFrom() = Settings.StandardEmail - Select Case Settings.neweventemails - Case "Subscribe" - ' Email Subscribed Users - - Dim objEventSubscriptionController As New EventSubscriptionController - Dim lstSubscriptions As ArrayList - Dim objEventSubscription As EventSubscriptionInfo - lstSubscriptions = objEventSubscriptionController.EventsSubscriptionGetSubModule(ModuleId) - - If lstSubscriptions.Count = 0 Then - Return - End If - - Dim objEventInfo As New EventInfoHelper(ModuleId, TabId, PortalId, Nothing) - Dim lstusers As ArrayList = objEventInfo.GetEventModuleViewers - - For Each objEventSubscription In lstSubscriptions - If Not lstusers.Contains(objEventSubscription.UserID) Then - Dim objCtlUser As New UserController - Dim objUser As UserInfo = objCtlUser.GetUser(PortalId, objEventSubscription.UserID) - If Not objUser Is Nothing And objUser.IsSuperUser Then - objEventEmailInfo.UserEmails.Add(objUser.Email) - objEventEmailInfo.UserLocales.Add(objUser.Profile.PreferredLocale) - objEventEmailInfo.UserTimeZoneIds.Add(objUser.Profile.PreferredTimeZone.Id) - Else - Continue For - End If - Else - objEventEmailInfo.UserIDs.Add(objEventSubscription.UserID) - End If - - Next - Case "Role" - ' Email users in role - EventEmailAddRoleUsers(Settings.neweventemailrole, objEventEmailInfo) - Case Else - Return - End Select - objEventEmail.SendEmails(objEventEmailInfo, objEvent) - - End Sub - - Public Sub EventEmailAddRoleUsers(ByVal roleId As Integer, ByVal objEventEmailInfo As EventEmailInfo) - Dim objRoleController As New RoleController - Dim objRole As RoleInfo = objRoleController.GetRole(roleId, PortalId) - If Not objRole Is Nothing Then - Dim lstUsers As ArrayList = objRoleController.GetUsersByRoleName(PortalId, objRole.RoleName) - For Each objUser As UserInfo In lstUsers - objEventEmailInfo.UserEmails.Add(objUser.Email) - objEventEmailInfo.UserLocales.Add(objUser.Profile.PreferredLocale) - objEventEmailInfo.UserTimeZoneIds.Add(objUser.Profile.PreferredTimeZone.Id) - Next - End If - End Sub - - Public Sub CreateNewEventJournal(ByVal objEvent As EventInfo) - If Not Settings.JournalIntegration Then - Exit Sub - End If - - If objEvent.Approved Then - Dim cntJournal As New Journal - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - Dim url As String = objEventInfoHelper.DetailPageURL(objEvent) - Dim imageSrc As String = Nothing - If Settings.eventimage And objEvent.ImageDisplay Then - Dim portalurl As String = objEventInfoHelper.GetDomainURL() - If PortalSettings.PortalAlias.HTTPAlias.IndexOf("/", StringComparison.Ordinal) > 0 Then - portalurl = portalurl & Common.Globals.ApplicationPath - End If - imageSrc = objEvent.ImageURL - If objEvent.ImageURL.StartsWith("FileID=") Then - Dim fileId As Integer = Integer.Parse(objEvent.ImageURL.Substring(7)) - Dim objFileInfo As IFileInfo = FileManager.Instance.GetFile(fileId) - If Not objFileInfo Is Nothing Then - imageSrc = objFileInfo.Folder + objFileInfo.FileName - If InStr(1, imageSrc, "://") = 0 Then - Dim pi As New Entities.Portals.PortalController - imageSrc = AddHTTP(String.Format("{0}/{1}/{2}", portalurl, pi.GetPortal(objEvent.PortalID).HomeDirectory, imageSrc)) - End If - End If - End If - End If - - cntJournal.NewEvent(objEvent, TabId, url, imageSrc) - - ' Update event to show it has an associated JournalItem - Dim cntEvent As New EventController - objEvent.JournalItem = True - cntEvent.EventsSave(objEvent, True, TabId, False) - End If - End Sub - - Public Sub CreateEnrollmentJournal(ByVal objEventSignup As EventSignupsInfo, ByVal objEvent As EventInfo, ByVal enrollSettings As EventModuleSettings) - If Not enrollSettings.JournalIntegration Then - Exit Sub - End If - - If objEventSignup.Approved And objEventSignup.UserID > -1 Then - Dim modTab As Integer = TabId - If modTab = -1 Then - Dim cntModule As New ModuleController - modTab = cntModule.GetModule(objEvent.ModuleID).TabID - End If - - Dim objEventInfoHelper As New EventInfoHelper(objEvent.ModuleID, modTab, objEvent.PortalID, enrollSettings) - Dim url As String = objEventInfoHelper.DetailPageURL(objEvent) - - Dim creatorUserid As Integer = UserId - If creatorUserid = -1 Then - creatorUserid = objEventSignup.UserID - End If - - Dim cntJournal As New Journal - cntJournal.NewEnrollment(objEventSignup, objEvent, modTab, url, creatorUserid) - End If - End Sub - - Public Function CreateEnrollment(ByVal objEventSignup As EventSignupsInfo, ByVal objEvent As EventInfo) As EventSignupsInfo - Return CreateEnrollment(objEventSignup, objEvent, Settings) - End Function - - Public Function CreateEnrollment(ByVal objEventSignup As EventSignupsInfo, ByVal objEvent As EventInfo, ByVal enrollSettings As EventModuleSettings) As EventSignupsInfo - Dim objCtlEventSignups As New EventSignupsController - If objEventSignup.SignupID = 0 Then - objEventSignup = objCtlEventSignups.EventsSignupsSave(objEventSignup) - Else - objCtlEventSignups.EventsSignupsSave(objEventSignup) - End If - CreateEnrollmentJournal(objEventSignup, objEvent, enrollSettings) - Return objEventSignup - End Function - - Public Sub DeleteEnrollment(ByVal signupId As Integer, ByVal inModuleId As Integer, ByVal eventId As Integer) - Dim objCtlEventSignups As New EventSignupsController - objCtlEventSignups.EventsSignupsDelete(signupId, inModuleId) - Dim cntJournal As New Journal - cntJournal.DeleteEnrollment(inModuleId, eventId, signupId, PortalId) - End Sub - - Public Function ToolTipCreate(ByVal objEvent As EventInfo, ByVal templateTitle As String, ByVal templateBody As String, ByVal isEvtEditor As Boolean) As String - Dim themeCss As String = GetThemeSettings().CssClass - - Dim tr As New TokenReplaceControllerClass(ModuleId, LocalResourceFile) - - ' Add sub module name if a sub-calendar - Dim blAddSubModuleName As Boolean = False - If objEvent.ModuleID <> ModuleId And objEvent.ModuleTitle <> Nothing And Settings.addsubmodulename Then - blAddSubModuleName = True - End If - - Dim tooltipTitle As String = tr.TokenReplaceEvent(objEvent, templateTitle.Replace(vbLf, "").Replace(vbCr, ""), blAddSubModuleName) - Dim tooltipBody As String = tr.TokenReplaceEvent(objEvent, templateBody.Replace(vbLf, "").Replace(vbCr, ""), Nothing, False, isEvtEditor) - - ' Shorten to maximum length - Dim intTooltipLength As Integer = Settings.eventtooltiplength - tooltipBody = HtmlUtils.Shorten(HttpUtility.HtmlDecode(tooltipBody).Replace(Environment.NewLine, " "), intTooltipLength, "...").Replace("[", "[").Replace("]", "]") - Dim tooltip As String = "
" + tooltipTitle + "
" + tooltipBody + "
" - Return tooltip - - End Function - - Public Function EnrolmentColumns(ByVal eventInfo As EventInfo, ByVal enrollListView As Boolean) As String - Dim txtColumns As String = "" - If Settings.eventsignup And enrollListView Then - If IsEventEditor(eventInfo, False) Then - If Settings.EnrollEditFields <> "" Or Settings.EnrollViewFields <> "" Or Settings.EnrollAnonFields <> "" Then - txtColumns = Settings.EnrollEditFields + ";" + Settings.EnrollViewFields + ";" + Settings.EnrollAnonFields - End If - ElseIf Request.IsAuthenticated Then - If Settings.EnrollViewFields <> "" Or Settings.EnrollAnonFields <> "" Then - txtColumns = Settings.EnrollViewFields + ";" + Settings.EnrollAnonFields - End If - Else - If Settings.EnrollAnonFields <> "" Then - txtColumns = Settings.EnrollAnonFields - End If - End If - End If - txtColumns = txtColumns.Replace("01", "UserName") - txtColumns = txtColumns.Replace("02", "DisplayName") - txtColumns = txtColumns.Replace("03", "Email") - txtColumns = txtColumns.Replace("04", "Phone") - txtColumns = txtColumns.Replace("05", "Approved") - txtColumns = txtColumns.Replace("06", "Qty") - - Return txtColumns - - End Function - - Public Sub CreateThemeDirectory() - 'Create theme folder if needed - Dim pc As New Entities.Portals.PortalController - With pc.GetPortal(PortalId) - Dim eventSkinPath As String = String.Format("{0}\DNNEvents\Themes", .HomeDirectoryMapPath) - If Not IO.Directory.Exists(eventSkinPath) Then - IO.Directory.CreateDirectory(eventSkinPath) - End If - End With - End Sub - - Public Function HideFullEvent(ByVal objevent As EventInfo) As Boolean - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - Return objEventInfoHelper.HideFullEvent(objevent, Settings.eventhidefullenroll(), UserId, Request.IsAuthenticated) - End Function - - Public Function CreateIconString(ByVal objEvent As EventInfo, ByVal iconPrio As Boolean, ByVal iconRec As Boolean, ByVal iconReminder As Boolean, ByVal iconEnroll As Boolean) As String - Dim objCtlEventRecurMaster As New EventRecurMasterController - Dim iconString As String = "" - If iconPrio Then - Select Case objEvent.Importance.ToString - Case "High" - iconString = " " - Case "Low" - iconString = " " - End Select - End If - If objEvent.RRULE <> "" And iconRec Then - iconString = iconString + " " - End If - - Dim notificationInfo As String = "" - If objEvent.SendReminder And iconReminder And Request.IsAuthenticated() Then - Dim objEventNotificationController As EventNotificationController = New EventNotificationController - notificationInfo = objEventNotificationController.NotifyInfo(objEvent.EventID, UserInfo.Email, objEvent.ModuleID, LocalResourceFile, GetDisplayTimeZoneId()) - End If - If objEvent.SendReminder And iconReminder And Request.IsAuthenticated And notificationInfo <> "" Then - iconString = iconString + " " - ElseIf objEvent.SendReminder And iconReminder And (Settings.notifyanon Or Request.IsAuthenticated) Then - iconString = iconString + " " - End If - - Dim objEventSignupsController As New EventSignupsController - If iconEnroll And objEventSignupsController.DisplayEnrollIcon(objEvent) And Settings.eventsignup Then - If objEvent.MaxEnrollment = 0 Or objEvent.Enrolled < objEvent.MaxEnrollment Then - iconString = iconString + " " - Else - iconString = iconString + " " - End If - End If - If objEvent.DetailPage = True Then - iconString = iconString + DetailPageEdit(objEvent) - End If - Return iconString - End Function - - Public Sub SetupViewControls(ByVal eventIcons As EventIcons, ByVal eventIcons2 As EventIcons, ByVal selectCategory As SelectCategory, ByVal selectLocation As SelectLocation, Optional ByVal pnlDateControls As System.Web.UI.WebControls.Panel = Nothing) - ' Disable Top Navigation - If Not pnlDateControls Is Nothing And Settings.DisableEventnav Then - pnlDateControls.Visible = False - End If - - ' Setup Icon Bar for use - SetUpIconBar(eventIcons, eventIcons2) - - ' Category Configuration and Settings. - selectCategory.ModuleConfiguration = ModuleConfiguration.Clone - - ' Disable Category Select - If Settings.Enablecategories = EventModuleSettings.DisplayCategories.DoNotDisplay Or _ - (IsPrivateNotModerator And _ - Not IsCategoryEditor()) Then - selectCategory.Visible = False - End If - - ' Location Configuration and Settings. - selectLocation.ModuleConfiguration = ModuleConfiguration.Clone - - ' Disable Location Select - If Settings.Enablelocations = EventModuleSettings.DisplayLocations.DoNotDisplay Or _ - (IsPrivateNotModerator And _ - Not IsLocationEditor()) Then - SelectLocation.Visible = False - End If - End Sub - - Public Function CreateEventName(ByVal objEvent As EventInfo, Optional ByVal template As String = Nothing) As String - Dim isEvtEditor As Boolean = IsEventEditor(objEvent, False) - - Dim blAddSubModuleName As Boolean = False - If objEvent.ModuleID <> ModuleId And objEvent.ModuleTitle <> Nothing And Settings.addsubmodulename Then - blAddSubModuleName = True - End If - Dim tcc As New TokenReplaceControllerClass(ModuleId, LocalResourceFile) - Return tcc.TokenReplaceEvent(objEvent, template, Nothing, blAddSubModuleName, isEvtEditor) - End Function - - Public Function Get_ListView_Events(ByVal categoryIDs As ArrayList, ByVal locationIDs As ArrayList) As ArrayList - Dim moduleStartDate As DateTime ' Start View Date Events Range - Dim moduleEndDate As DateTime ' End View Date Events Range - Dim displayStartDate As DateTime ' Start View Date Events Range - Dim displayEndDate As DateTime ' End View Date Events Range - Dim noEvents As Integer - - ' Set Date Range - Dim moduleDate, displayDate As DateTime - If Settings.ListViewUseTime Then - moduleDate = ModuleNow() - displayDate = DisplayNow() - Else - moduleDate = ModuleNow.Date - displayDate = DisplayNow.Date - End If - Dim numDays As Integer = Settings.EventsListEventDays - If Settings.EventsListSelectType = "DAYS" Then - '****DO NOT CHANGE THE NEXT SECTION FOR ML CODING **** - ' Used Only to select view dates on Event Month View.. - moduleStartDate = moduleDate.AddDays((Settings.EventsListBeforeDays + 1) * -1) - moduleEndDate = moduleDate.AddDays((Settings.EventsListAfterDays + 1) * 1) - displayStartDate = displayDate.AddDays(Settings.EventsListBeforeDays * -1) - displayEndDate = displayDate.AddDays(Settings.EventsListAfterDays * 1) - Else - noEvents = Settings.EventsListNumEvents - moduleStartDate = moduleDate.AddDays(-1) - moduleEndDate = moduleDate.AddDays(numDays + 1) - displayStartDate = displayDate - displayEndDate = displayDate.AddDays(numDays) - End If - - Dim getSubEvents As Boolean = Settings.MasterEvent - - Dim objEvent, lstEvent As EventInfo - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - Dim lstEvents As ArrayList - Dim selectedEvents As New ArrayList - lstEvents = objEventInfoHelper.GetEvents(moduleStartDate, moduleEndDate, getSubEvents, categoryIDs, locationIDs, GetUrlGroupId, GetUrlUserId) - - lstEvents = objEventInfoHelper.ConvertEventListToDisplayTimeZone(lstEvents, GetDisplayTimeZoneId()) - - For Each objEvent In lstEvents - ' If full enrollments should be hidden, ignore - If HideFullEvent(objEvent) Then - Continue For - End If - If objEvent.EventTimeEnd < displayStartDate Or _ - objEvent.EventTimeBegin > displayEndDate Then - Continue For - End If - - Dim blAddEvent As Boolean = True - If Settings.Collapserecurring Then - For Each lstEvent In selectedEvents - If lstEvent.RecurMasterID = objEvent.RecurMasterID Then - blAddEvent = False - End If - Next - End If - If blAddEvent Then - selectedEvents.Add(objEvent) - End If - - If Settings.EventsListSelectType = "EVENTS" And _ - selectedEvents.Count >= noEvents Then - Exit For - End If - Next - Return selectedEvents - End Function - - Public Function ModuleNow() As DateTime - Dim objEventTimeZoneUtilities As New EventTimeZoneUtilities - Return objEventTimeZoneUtilities.ConvertFromUTCToModuleTimeZone(Date.UtcNow, Settings.TimeZoneId) - End Function - - Public Function DisplayNow() As DateTime - Dim objEventTimeZoneUtilities As New EventTimeZoneUtilities - Return objEventTimeZoneUtilities.ConvertFromUTCToDisplayTimeZone(Date.UtcNow, GetDisplayTimeZoneId()).EventDate - End Function - - Public Function GetDisplayTimeZoneId() As String - Return GetDisplayTimeZoneId(Settings, PortalId) - End Function - - Public Function GetDisplayTimeZoneId(ByVal modSettings As EventModuleSettings, ByVal modPortalid As Integer) As String - Return GetDisplayTimeZoneId(modSettings, modPortalid, Nothing) - End Function - - Public Function GetDisplayTimeZoneId(ByVal modSettings As EventModuleSettings, ByVal modPortalid As Integer, ByVal userTimeZoneId As String) As String - Dim displayTimeToneId As String = "" - - 'Try Primary - Select Case modSettings.PrimaryTimeZone - Case EventModuleSettings.TimeZones.UserTZ - If Not userTimeZoneId Is Nothing Then - displayTimeToneId = userTimeZoneId - Else - displayTimeToneId = GetUserTimeZoneId() - End If - Case EventModuleSettings.TimeZones.ModuleTZ - displayTimeToneId = GetModuleTimeZoneId(modSettings) - Case EventModuleSettings.TimeZones.PortalTZ - displayTimeToneId = GetPortalTimeZoneId() - End Select - - ' Try Secondary - If displayTimeToneId = "" Then - Select Case modSettings.SecondaryTimeZone - Case EventModuleSettings.TimeZones.UserTZ - If Not userTimeZoneId Is Nothing Then - displayTimeToneId = userTimeZoneId - Else - displayTimeToneId = GetUserTimeZoneId() - End If - Case EventModuleSettings.TimeZones.ModuleTZ - displayTimeToneId = GetModuleTimeZoneId(modSettings) - Case EventModuleSettings.TimeZones.PortalTZ - displayTimeToneId = GetPortalTimeZoneId() - End Select - End If - - ' If all else fails use Portal - If displayTimeToneId = "" Then - displayTimeToneId = GetPortalTimeZoneId() - End If - - Return displayTimeToneId - End Function - - Public Function GetListSortExpression(ByVal columnName As String) As EventListObject.SortFilter - Dim sortExpression As EventListObject.SortFilter = EventListObject.SortFilter.EventDateBegin - Select Case columnName - Case "CategoryName" - sortExpression = EventListObject.SortFilter.CategoryName - Case "CustomField1" - sortExpression = EventListObject.SortFilter.CustomField1 - Case "CustomField2" - sortExpression = EventListObject.SortFilter.CustomField2 - Case "Description" - sortExpression = EventListObject.SortFilter.Description - Case "Duration" - sortExpression = EventListObject.SortFilter.Duration - Case "EventDateBegin" - sortExpression = EventListObject.SortFilter.EventDateBegin - Case "EventDateEnd" - sortExpression = EventListObject.SortFilter.EventDateEnd - Case "EventName" - sortExpression = EventListObject.SortFilter.EventName - Case "LocationName" - sortExpression = EventListObject.SortFilter.LocationName - Case "EventID" - sortExpression = EventListObject.SortFilter.EventID - End Select - Return sortExpression - End Function - - Public Function GetSignupsSortExpression(ByVal columnName As String) As EventSignupsInfo.SortFilter - Dim sortExpression As EventSignupsInfo.SortFilter = EventSignupsInfo.SortFilter.EventTimeBegin - Select Case columnName - Case "EventID" - sortExpression = EventSignupsInfo.SortFilter.EventID - Case "Duration" - sortExpression = EventSignupsInfo.SortFilter.Duration - Case "EventTimeBegin" - sortExpression = EventSignupsInfo.SortFilter.EventTimeBegin - Case "EventTimeEnd" - sortExpression = EventSignupsInfo.SortFilter.EventTimeEnd - Case "EventName" - sortExpression = EventSignupsInfo.SortFilter.EventName - Case "Approved" - sortExpression = EventSignupsInfo.SortFilter.Approved - End Select - Return sortExpression - End Function - - Public Function GetUrlGroupId() As Integer - Dim socialGroupId As Integer = -1 - If Not HttpContext.Current.Request.QueryString("groupid") = "" And Settings.SocialGroupModule = EventModuleSettings.SocialModule.SocialGroup Then - socialGroupId = CType(HttpContext.Current.Request.QueryString("groupid"), Integer) - End If - Return socialGroupId - End Function - - Public Function GetUrlUserId() As Integer - Dim socialUserId As Integer = -1 - If Not HttpContext.Current.Request.QueryString("userid") = "" And Settings.SocialGroupModule = EventModuleSettings.SocialModule.UserProfile Then - socialUserId = CType(HttpContext.Current.Request.QueryString("Userid"), Integer) - End If - Return socialUserId - End Function - - Public Sub StorePrevPageInViewState() - If Not Request.UrlReferrer Is Nothing Then - ViewState("prevPage") = Request.UrlReferrer.ToString - Else - ViewState("prevPage") = GetSocialNavigateUrl() - End If - End Sub - - Public Function GetStoredPrevPage() As String - Return ViewState("prevPage").ToString - End Function - - Public Function GetSocialNavigateUrl() As String - Dim socialGroupId As Integer = GetUrlGroupId() - Dim socialUserId As Integer = GetUrlUserId() - If socialGroupId > 0 Then - Return NavigateURL(TabId, "", "groupid=" & socialGroupId.ToString) - ElseIf socialUserId > 0 Then - Return NavigateURL(TabId, "", "userid=" & socialUserId.ToString) - Else - Return NavigateURL() - End If - End Function -#End Region - -#Region "Private Routines" - Private Function GetUserTimeZoneId() As String - If HttpContext.Current.Request.IsAuthenticated Then - Dim objUser As UserInfo = UserController.GetCurrentUserInfo - Dim authUserTimeZone As TimeZoneInfo = objUser.Profile.PreferredTimeZone - Return authUserTimeZone.Id - End If - Return "" - End Function - - Private Function GetModuleTimeZoneId(ByVal modSettings As EventModuleSettings) As String - If Not modSettings.TimeZoneId Is Nothing Then - Return modSettings.TimeZoneId - End If - Return "" - End Function - - Private Function GetPortalTimeZoneId() As String - Dim portalTimeZoneId As String - If HttpContext.Current Is Nothing Then - portalTimeZoneId = Entities.Portals.PortalController.GetPortalSetting("TimeZone", PortalId, String.Empty) - Else - portalTimeZoneId = Entities.Portals.PortalController.GetCurrentPortalSettings.TimeZone.Id - End If - Return portalTimeZoneId - End Function - -#End Region - -#Region " Shadow PMB Settings " - -#Region " Variables " - - Private _settings As EventModuleSettings - -#End Region - -#Region " Properties " - Public Shadows Property Settings() As EventModuleSettings - Get - If _settings Is Nothing Then - Dim ems As New EventModuleSettings - _settings = ems.GetEventModuleSettings(ModuleId, LocalResourceFile) - End If - Return _settings - End Get - Set(ByVal value As EventModuleSettings) - _settings = value - End Set - End Property - -#End Region - -#End Region - End Class -End Namespace \ No newline at end of file diff --git a/Components/EventController.cs b/Components/EventController.cs new file mode 100644 index 0000000..612ff11 --- /dev/null +++ b/Components/EventController.cs @@ -0,0 +1,3254 @@ +using DotNetNuke.Services.Exceptions; +using DotNetNuke.Entities.Users; +using Microsoft.VisualBasic; +using System.Collections; +using DotNetNuke.Common.Utilities; +using System.Web; +using DotNetNuke.Services.Localization; +using System; +using DotNetNuke.Entities.Modules; +using DotNetNuke.Entities.Modules.Definitions; +using DotNetNuke.Entities.Tabs; +using DotNetNuke.Security; +using DotNetNuke.Security.Permissions; +using DotNetNuke.Services.Mail; +using DotNetNuke.Security.Roles; +using System.Globalization; + + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + + +namespace DotNetNuke.Modules.Events +{ + using System.Linq; + using DotNetNuke.Modules.Events.Components.Integration; + + #region EventInfoHelper Class + public class EventInfoHelper : PortalModuleBase + { + #region Public Functions and Methods + + private ArrayList _lstEvents = new ArrayList(); + + // public properties + public ArrayList LstEvents + { + get + { + return _lstEvents; + } + set + { + _lstEvents = value; + } + } + + // Module ID of Base Calendar (used for converting Sub-Calendar Event Time Zones) + private int _baseModuleId = 0; + private int _baseTabId = 0; + private int _basePortalId = 0; + private EventModuleSettings _baseSettings; + public int BaseModuleID + { + get + { + return _baseModuleId; + } + set + { + _baseModuleId = value; + } + } + + public int BaseTabID + { + get + { + return _baseTabId; + } + set + { + _baseTabId = value; + } + } + + public int BasePortalID + { + get + { + return _basePortalId; + } + set + { + _basePortalId = value; + } + } + + public EventModuleSettings BaseSettings + { + get + { + return _baseSettings; + } + set + { + _baseSettings = value; + } + } + + public EventInfoHelper() + { + } + + public EventInfoHelper(int moduleID, EventModuleSettings settings) + { + BaseModuleID = moduleID; + BaseSettings = settings; + } + + public EventInfoHelper(int moduleID, int tabID, int portalID, EventModuleSettings settings) + { + BaseModuleID = moduleID; + BaseTabID = tabID; + BasePortalID = portalID; + BaseSettings = settings; + } + + public string GetDetailPageRealURL(int eventID, int socialGroupId, int socialUserId) + { + return GetDetailPageRealURL(eventID, true, socialGroupId, socialUserId); + } + + public string GetDetailPageRealURL(int eventID, bool blSkinContainer, int socialGroupId, int socialUserId) + { + string url = ""; + if (BaseSettings.Eventdetailnewpage) + { + if (socialGroupId > 0) + { + url = DotNetNuke.Common.Globals.NavigateURL(BaseTabID, "Details", "Mid=" + BaseModuleID.ToString(), "ItemID=" + eventID.ToString(), "groupid=" + socialGroupId.ToString()); + } + else if (socialUserId > 0) + { + url = DotNetNuke.Common.Globals.NavigateURL(BaseTabID, "Details", "Mid=" + BaseModuleID.ToString(), "ItemID=" + eventID.ToString(), "userid=" + socialUserId.ToString()); + } + else + { + url = DotNetNuke.Common.Globals.NavigateURL(BaseTabID, "Details", "Mid=" + BaseModuleID.ToString(), "ItemID=" + eventID.ToString()); + } + if (blSkinContainer) + { + url = AddSkinContainerControls(url, "?"); + } + } + else + { + if (socialGroupId > 0) + { + url = DotNetNuke.Common.Globals.NavigateURL(BaseTabID, "", "ModuleID=" + BaseModuleID.ToString(), "ItemID=" + eventID.ToString(), "mctl=EventDetails", "groupid=" + socialGroupId.ToString()); + } + else if (socialUserId > 0) + { + url = DotNetNuke.Common.Globals.NavigateURL(BaseTabID, "", "ModuleID=" + BaseModuleID.ToString(), "ItemID=" + eventID.ToString(), "mctl=EventDetails", "userid=" + socialUserId.ToString()); + } + else + { + url = DotNetNuke.Common.Globals.NavigateURL(BaseTabID, "", "ModuleID=" + BaseModuleID.ToString(), "ItemID=" + eventID.ToString(), "mctl=EventDetails"); + } + } + if (url.IndexOf("://") + 1 == 0) + { + string domainurl = GetDomainURL(); + url = DotNetNuke.Common.Globals.AddHTTP(domainurl) + url; + } + return url; + } + + public string GetDomainURL() + { + // Dim domainurl As String = ps.PortalAlias.HTTPAlias + string domainurl = HttpContext.Current.Request.ServerVariables["HTTP_HOST"]; + if (ReferenceEquals(domainurl, null)) + { + Entities.Portals.PortalSettings ps = (Entities.Portals.PortalSettings)(HttpContext.Current.Items["PortalSettings"]); + domainurl = ps.PortalAlias.HTTPAlias; + } + if (domainurl.IndexOf("/", StringComparison.Ordinal) > 0) + { + domainurl = domainurl.Substring(0, domainurl.IndexOf("/", StringComparison.Ordinal)); + } + return domainurl; + } + + public string AddSkinContainerControls(string url, string addchar) + { + if (url.Substring(0, 10).ToLower() == "javascript") + { + return url; + } + + if (BaseSettings.Enablecontainerskin) + { + string strFriendlyUrls = Entities.Controllers.HostController.Instance.GetString("UseFriendlyUrls"); + if (strFriendlyUrls == "N") + { + addchar = "&"; + } + TabController objCtlTab = new TabController(); + DotNetNuke.Entities.Tabs.TabInfo objTabInfo = objCtlTab.GetTab(BaseTabID, BasePortalID, false); + string skinSrc = null; + if (!ReferenceEquals(objTabInfo, null)) + { + if (!(objTabInfo.SkinSrc == "")) + { + skinSrc = objTabInfo.SkinSrc; + if (skinSrc.Substring(skinSrc.Length - 5, 5) == ".ascx") + { + skinSrc = skinSrc.Substring(0, skinSrc.Length - 5); + } + } + } + ModuleController objCtlModule = new ModuleController(); + ModuleInfo objModuleInfo = objCtlModule.GetModule(BaseModuleID, BaseTabID, false); + string containerSrc = null; + if (!ReferenceEquals(objModuleInfo, null)) + { + if (objModuleInfo.DisplayTitle) + { + if (!(objModuleInfo.ContainerSrc == "")) + { + containerSrc = objModuleInfo.ContainerSrc; + } + else if (!(objTabInfo.ContainerSrc == "")) + { + containerSrc = objTabInfo.ContainerSrc; + } + if (!ReferenceEquals(containerSrc, null)) + { + if (containerSrc.Substring(containerSrc.Length - 5, 5) == ".ascx") + { + containerSrc = containerSrc.Substring(0, containerSrc.Length - 5); + } + } + } + else + { + containerSrc = "[G]Containers/_default/No+Container"; + } + } + if (!ReferenceEquals(containerSrc, null)) + { + url += addchar + "ContainerSrc=" + HttpUtility.HtmlEncode(containerSrc); + addchar = "&"; + } + if (!ReferenceEquals(skinSrc, null)) + { + url += addchar + "SkinSrc=" + HttpUtility.HtmlEncode(skinSrc); + } + } + return url; + } + + public bool HideFullEvent(EventInfo objevent, bool blEventHideFullEnroll, int intuserid, bool blAuthenticated) + { + if (objevent.Signups && blEventHideFullEnroll && objevent.MaxEnrollment > 0 & + objevent.Enrolled >= objevent.MaxEnrollment & UserId != objevent.OwnerID & + intuserid != objevent.CreatedByID & intuserid != objevent.RmOwnerID && !IsModerator(blAuthenticated)) + { + return true; + } + return false; + } + + public string DetailPageURL(EventInfo objEvent) + { + return DetailPageURL(objEvent, true); + } + + public string DetailPageURL(EventInfo objEvent, bool blSkinContainer) + { + string returnURL = ""; + if (objEvent.DetailPage) + { + + if (objEvent.DetailURL.StartsWith("http")) + { + returnURL = objEvent.DetailURL; + } + else + { + returnURL = Common.Globals.LinkClick(objEvent.DetailURL, BaseTabID, BaseModuleID, false); + } + } + else + { + returnURL = GetDetailPageRealURL(objEvent.EventID, blSkinContainer, objEvent.SocialGroupId, objEvent.SocialUserId); + } + return returnURL; + + } + + public string GetModerateUrl() + { + return DotNetNuke.Common.Globals.NavigateURL(BaseTabID, "", "Mid=" + BaseModuleID.ToString(), "mctl=EventModerate"); + } + + public string GetEditURL(int itemid, int socialGroupId, int socialUserId) + { + return GetEditURL(itemid, socialGroupId, socialUserId, "Single"); + } + + public string GetEditURL(int itemid, int socialGroupId, int socialUserId, string editRecur) + { + if (socialGroupId > 0) + { + return AddSkinContainerControls(EditUrl("ItemID", itemid.ToString(), "Edit", "Mid=" + BaseModuleID.ToString(), "EditRecur=" + editRecur, "groupid=" + socialGroupId.ToString()), "?"); + } + else if (socialUserId > 0) + { + return AddSkinContainerControls(EditUrl("ItemID", itemid.ToString(), "Edit", "Mid=" + BaseModuleID.ToString(), "EditRecur=" + editRecur, "userid=" + socialUserId.ToString()), "?"); + } + else + { + return AddSkinContainerControls(EditUrl("ItemID", itemid.ToString(), "Edit", "Mid=" + BaseModuleID.ToString(), "EditRecur=" + editRecur), "?"); + } + } + + // Detemines if a EventInfo ArrayList already contains the EventInfo Object + public DateTime IsConflict(EventInfo objEvent, ArrayList objEvents, DateTime conflictDateChk) + { + EventInfo objEvent1 = default(EventInfo); + EventInfo objEvent2 = default(EventInfo); + DateTime eventTimeBegin1 = default(DateTime); + DateTime eventTimeBegin2 = default(DateTime); + DateTime eventTimeEnd1 = default(DateTime); + DateTime eventTimeEnd2 = default(DateTime); + bool locationConflict = BaseSettings.Locationconflict; + + // Handle Recurring Event Conflict Detection + LstEvents = new ArrayList(); + AddEvent(objEvent); + + //Convert both lists to common timezone + objEvents = ConvertEventListToDisplayTimeZone(objEvents, BaseSettings.TimeZoneId); + LstEvents = ConvertEventListToDisplayTimeZone(LstEvents, BaseSettings.TimeZoneId); + + foreach (EventInfo tempLoopVar_objEvent1 in LstEvents) + { + objEvent1 = tempLoopVar_objEvent1; + // Take into account timezone offsets and length of event when deciding on conflicts + eventTimeBegin1 = objEvent1.EventTimeBegin; + eventTimeEnd1 = objEvent1.EventTimeEnd; + foreach (EventInfo tempLoopVar_objEvent2 in objEvents) + { + objEvent2 = tempLoopVar_objEvent2; + eventTimeBegin2 = objEvent2.EventTimeBegin; + eventTimeEnd2 = objEvent2.EventTimeEnd; + if (((eventTimeBegin1 >= eventTimeBegin2 && eventTimeBegin1 < eventTimeEnd2) || + (eventTimeBegin1 <= eventTimeBegin2 && eventTimeEnd1 > eventTimeBegin2)) + && (objEvent1.EventID != objEvent2.EventID)) + { + if (locationConflict) + { + if (objEvent1.Location > 0 & objEvent1.Location == objEvent2.Location) + { + return objEvent.EventTimeBegin; + } + } + else + { + return objEvent.EventTimeBegin; + } + } + } + } + return conflictDateChk; + } + + // Get Events (including SubModule Events, including categories, including locations) + public ArrayList GetEvents(DateTime startDate, DateTime endDate, bool getSubEvents, ArrayList categoryIDs, ArrayList locationIDs, int socialGroupId, int socialUserId) + { + return GetEvents(startDate, endDate, getSubEvents, categoryIDs, locationIDs, false, socialGroupId, socialUserId); + } + + public ArrayList GetEvents(DateTime startDate, DateTime endDate, bool getSubEvents, ArrayList inCategoryIDs, ArrayList inLocationIDs, bool isSearch, int socialGroupId, int socialUserId) + { + //Dim objEventInfoHelper As New EventInfoHelper(ModID) + EventMasterController objCtlMasterEvent = new EventMasterController(); + string moduleIDs = BaseModuleID.ToString(); + try + { + //*** See what Sub-Events/Calendars are included + if (getSubEvents) + { + // Get Assigned Sub Events and Bind to Grid + ArrayList subEvents = default(ArrayList); + subEvents = objCtlMasterEvent.EventsMasterAssignedModules(BaseModuleID); + if (!(ReferenceEquals(subEvents, null))) + { + IEnumerator myEnumerator = subEvents.GetEnumerator(); + EventMasterInfo objSubEvent = default(EventMasterInfo); + while (myEnumerator.MoveNext()) + { + objSubEvent = (EventMasterInfo)myEnumerator.Current; + if (IsModuleViewer(objSubEvent.SubEventID) || !BaseSettings.Enforcesubcalperms) + { + moduleIDs = moduleIDs + "," + objSubEvent.SubEventID.ToString(); + } + } + } + } + + // Adds Recurring Dates to EventInfo ArrayList for given Date Range + EventInfo objEvents = default(EventInfo); + EventController ctrlEvent = new EventController(); + _lstEvents = new ArrayList(); + _lstEvents.Clear(); + + string categoryIDs = CreateCategoryFilter(inCategoryIDs); + string locationIDs = CreateLocationFilter(inLocationIDs); + + ArrayList newlstEvents = new ArrayList(); + if (BaseSettings.SocialGroupModule == EventModuleSettings.SocialModule.No | IsSocialUserPublic(socialUserId) || IsSocialGroupPublic(socialGroupId)) + { + newlstEvents = ctrlEvent.EventsGetByRange(moduleIDs, startDate, endDate, categoryIDs, locationIDs, socialGroupId, socialUserId); + } + + foreach (EventInfo tempLoopVar_objEvents in newlstEvents) + { + objEvents = tempLoopVar_objEvents; + // If the module is set for private events, then obfuscate the appropriate information + objEvents.IsPrivate = false; + if (BaseSettings.PrivateMessage != "") + { + if (isSearch) + { + objEvents.EventName = BaseSettings.PrivateMessage; + objEvents.EventDesc = ""; + objEvents.Summary = ""; + objEvents.IsPrivate = true; + } + else if (!(UserId == objEvents.OwnerID) && !IsModerator(true)) + { + objEvents.EventName = BaseSettings.PrivateMessage; + objEvents.EventDesc = ""; + objEvents.Summary = ""; + objEvents.IsPrivate = true; + } + } + objEvents.ModuleTitle = objCtlMasterEvent.GetModuleTitle(objEvents.ModuleID); + AddEvent(objEvents); + } + LstEvents.Sort(new EventDateSort()); + + return LstEvents; + } + catch (Exception) + { + return new ArrayList(); + } + } + + // Get Events for a Specifc Date and returns a EventInfo ArrayList + public ArrayList GetDateEvents(ArrayList selectedEvents, DateTime selectDate) + { + ArrayList newEventEvents = new ArrayList(); + int itemid = 0; + // Modified to account for multi-day events + if (!(ReferenceEquals(selectedEvents, null))) + { + foreach (EventInfo objEvent in selectedEvents) + { + if (objEvent.EventTimeBegin == selectDate || + (objEvent.EventTimeBegin.Date <= selectDate.Date && + objEvent.EventTimeEnd.Date >= selectDate.Date)) + { + if (itemid != objEvent.EventID) + { + newEventEvents.Add(objEvent); + } + itemid = objEvent.EventID; + } + } + } + return newEventEvents; + } + + public string CreateCategoryFilter(ArrayList inCategoryIDs) + { + ArrayList restrictedCategories = new ArrayList(); + if (BaseSettings.Restrictcategories) + { + if (inCategoryIDs[0].ToString() == "-1") + { + restrictedCategories = BaseSettings.ModuleCategoryIDs; + } + else + { + foreach (int inCategory in inCategoryIDs) + { + foreach (int category in BaseSettings.ModuleCategoryIDs) + { + if (category == inCategory) + { + restrictedCategories.Add(category); + } + } + } + } + } + else + { + restrictedCategories = inCategoryIDs; + } + + string categoryIDs = ""; + // ReSharper disable LoopCanBeConvertedToQuery + foreach (string category in restrictedCategories) + { + // ReSharper restore LoopCanBeConvertedToQuery + categoryIDs = categoryIDs + "," + category; + } + categoryIDs = categoryIDs.Substring(1); + + return categoryIDs; + } + + public string CreateLocationFilter(ArrayList inLocationIDs) + { + // Because of method overloads without locations. + if (ReferenceEquals(inLocationIDs, null)) + { + inLocationIDs = new ArrayList(System.Convert.ToInt32(new[] { "-1" })); + } + + ArrayList restrictedLocations = new ArrayList(); + if (BaseSettings.Restrictlocations) + { + if (inLocationIDs[0].ToString() == "-1") + { + restrictedLocations = BaseSettings.ModuleLocationIDs; + } + else + { + foreach (int inLocation in inLocationIDs) + { + foreach (int location in BaseSettings.ModuleLocationIDs) + { + if (location == inLocation) + { + restrictedLocations.Add(location); + } + } + } + } + } + else + { + restrictedLocations = inLocationIDs; + } + + string locationIDs = ""; + // ReSharper disable LoopCanBeConvertedToQuery + foreach (string location in restrictedLocations) + { + // ReSharper restore LoopCanBeConvertedToQuery + locationIDs = locationIDs + "," + location; + } + locationIDs = locationIDs.Substring(1); + + return locationIDs; + } + + public bool IsModuleViewer(int subModuleID) + { + try + { + if (!PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString())) + { + ModuleController objCtlModule = new ModuleController(); + + ArrayList objModules = (ArrayList)(objCtlModule.GetModuleTabs(subModuleID)); + ModuleInfo objModule = default(ModuleInfo); + foreach (ModuleInfo tempLoopVar_objModule in objModules) + { + objModule = tempLoopVar_objModule; + if (!objModule.InheritViewPermissions) + { + ModulePermissionCollection objCollModulePermission = default(ModulePermissionCollection); + objCollModulePermission = ModulePermissionController.GetModulePermissions(subModuleID, objModule.TabID); + return ModulePermissionController.HasModulePermission(objCollModulePermission, "VIEW"); + } + else + { + TabPermissionCollection objCollTabPermission = default(TabPermissionCollection); + objCollTabPermission = TabPermissionController.GetTabPermissions(objModule.TabID, PortalId); + return TabPermissionController.HasTabPermission(objCollTabPermission, "VIEW"); + } + } + return false; + } + else + { + return true; + } + + } + catch + { + } + return false; + } + + public bool IsSocialUserPublic(int socialUserId) + { + if (BaseSettings.SocialGroupModule == EventModuleSettings.SocialModule.UserProfile & !BaseSettings.SocialUserPrivate) + { + return true; + } + else if (socialUserId == -1) + { + return false; + } + else if (BaseSettings.SocialGroupModule == EventModuleSettings.SocialModule.UserProfile & BaseSettings.SocialUserPrivate && socialUserId == PortalSettings.UserInfo.UserID) + { + return true; + } + return false; + } + + public bool IsSocialGroupPublic(int socialGroupId) + { + if (BaseSettings.SocialGroupModule == EventModuleSettings.SocialModule.SocialGroup & !(BaseSettings.SocialGroupSecurity == EventModuleSettings.SocialGroupPrivacy.PrivateToGroup)) + { + return true; + } + else if (socialGroupId == -1) + { + return false; + } + else + { + RoleController objRoleCtl = new RoleController(); + RoleInfo objRoleInfo = objRoleCtl.GetRole(socialGroupId, PortalSettings.PortalId); + if (ReferenceEquals(objRoleInfo, null)) + { + return false; + } + if (BaseSettings.SocialGroupModule == EventModuleSettings.SocialModule.SocialGroup & BaseSettings.SocialGroupSecurity == EventModuleSettings.SocialGroupPrivacy.PrivateToGroup & PortalSettings.UserInfo.IsInRole(objRoleInfo.RoleName)) + { + return true; + } + else + { + return false; + } + } + } + + public bool IsModerator(bool blAuthenticated) + { + if (blAuthenticated) + { + try + { + ModuleController mc = new ModuleController(); + ModuleInfo objMod = default(ModuleInfo); + ModulePermissionCollection mp = default(ModulePermissionCollection); + + objMod = mc.GetModule(BaseModuleID, BaseTabID, false); + + if (!ReferenceEquals(objMod, null)) + { + mp = objMod.ModulePermissions; + return ModulePermissionController.HasModulePermission(mp, "EVENTSMOD"); + } + else + { + return false; + } + + } + catch + { + } + } + return false; + } + + public ArrayList GetEventModuleViewers() + { + ModuleController objCtlModule = new ModuleController(); + ModuleInfo objModule = objCtlModule.GetModule(BaseModuleID, BaseTabID, false); + + ArrayList lstUsers = new ArrayList(); + ArrayList lstDeniedUsers = new ArrayList(); + + if (!objModule.InheritViewPermissions) + { + ModulePermissionInfo objModulePermission = default(ModulePermissionInfo); + foreach (ModulePermissionInfo tempLoopVar_objModulePermission in objModule.ModulePermissions) + { + objModulePermission = tempLoopVar_objModulePermission; + if (objModulePermission.PermissionKey == "VIEW") + { + if (objModulePermission.UserID < 0) + { + string roleName = ""; + RoleController objCtlRole = new RoleController(); + if (objModulePermission.RoleID < 0) + { + roleName = PortalSettings.RegisteredRoleName; + } + else + { + roleName = objModulePermission.RoleName; + } + ArrayList lstRoleUsers = objCtlRole.GetUsersByRoleName(BasePortalID, roleName); + foreach (UserInfo objUser in lstRoleUsers) + { + AddViewUserid(objUser.UserID, objModulePermission.AllowAccess, lstUsers, lstDeniedUsers); + } + } + else + { + AddViewUserid(objModulePermission.UserID, objModulePermission.AllowAccess, lstUsers, lstDeniedUsers); + } + } + } + } + else + { + TabPermissionCollection objCollTabPermission = default(TabPermissionCollection); + objCollTabPermission = TabPermissionController.GetTabPermissions(BaseTabID, BasePortalID); + TabPermissionInfo objTabPermission = default(TabPermissionInfo); + foreach (TabPermissionInfo tempLoopVar_objTabPermission in objCollTabPermission) + { + objTabPermission = tempLoopVar_objTabPermission; + if (objTabPermission.PermissionKey == "VIEW") + { + if (objTabPermission.UserID < 0) + { + string roleName = ""; + RoleController objCtlRole = new RoleController(); + if (objTabPermission.RoleID < 0) + { + roleName = PortalSettings.RegisteredRoleName; + } + else + { + roleName = objTabPermission.RoleName; + } + ArrayList lstRoleUsers = objCtlRole.GetUsersByRoleName(BasePortalID, roleName); + foreach (UserInfo objUser in lstRoleUsers) + { + AddViewUserid(objUser.UserID, objTabPermission.AllowAccess, lstUsers, lstDeniedUsers); + } + } + else + { + AddViewUserid(objTabPermission.UserID, objTabPermission.AllowAccess, lstUsers, lstDeniedUsers); + } + } + } + } + return lstUsers; + } + + private void AddViewUserid(int viewUserid, bool viewAllowAccess, ArrayList lstUsers, ArrayList lstDeniedUsers) + { + if (lstUsers.Contains(viewUserid) && !viewAllowAccess) + { + lstUsers.Remove(viewUserid); + } + if (lstDeniedUsers.Contains(viewUserid)) + { + return; + } + if (!viewAllowAccess) + { + lstDeniedUsers.Add(viewUserid); + return; + } + if (lstUsers.Contains(viewUserid)) + { + return; + } + lstUsers.Add(viewUserid); + } + + public DateTime ConvertDateTimeToTZ(DateTime fromDateTime, int fromTZ, int toTZ) + { + return fromDateTime.AddMinutes(Convert.ToDouble(toTZ) - Convert.ToDouble(fromTZ)); + } + + public EventUser UserDisplayNameProfile(int prfUserID, string prfDisplayName, string inLocalResourceFile) + { + EventUser returnValue = default(EventUser); + string domainurl = GetDomainURL(); + returnValue = new EventUser(); + var with_1 = returnValue; + with_1.UserID = prfUserID; + with_1.DisplayName = prfDisplayName; + if (with_1.DisplayName != "") + { + with_1.ProfileURL = HttpUtility.HtmlEncode(Common.Globals.UserProfileURL(System.Convert.ToInt32(with_1.UserID))); + if (!with_1.ProfileURL.ToLower().StartsWith("http://") && !with_1.ProfileURL.ToLower().StartsWith("https://")) + { + with_1.ProfileURL = DotNetNuke.Common.Globals.AddHTTP(domainurl) + with_1.ProfileURL; + } + with_1.DisplayNameURL = string.Format("{1}", with_1.ProfileURL, with_1.DisplayName, " target=\"_blank\""); + } + else + { + with_1.ProfileURL = DotNetNuke.Common.Globals.NavigateURL(); + with_1.DisplayName = Localization.GetString("UserDeleted", inLocalResourceFile); + with_1.DisplayNameURL = with_1.DisplayName; + } + return returnValue; + } + + public EventInfo ConvertEventToDisplayTimeZone(EventInfo moduleEvent, string displayTimeZoneId) + { + var with_1 = moduleEvent; + EventTimeZoneUtilities objEventTimeZoneUtilities = new EventTimeZoneUtilities(); + EventTimeZoneUtilities.DateInfo eventDateInfo = default(EventTimeZoneUtilities.DateInfo); + // Convert to display timezone based on timezone event was stored in + eventDateInfo = objEventTimeZoneUtilities.ConvertToDisplayTimeZone(with_1.EventTimeBegin, with_1.EventTimeZoneId, with_1.PortalID, displayTimeZoneId); + // If it is an all day event then no need to adjust + if (!moduleEvent.AllDayEvent) + { + with_1.EventTimeBegin = eventDateInfo.EventDate; + } + eventDateInfo = objEventTimeZoneUtilities.ConvertToDisplayTimeZone(with_1.LastRecurrence, with_1.EventTimeZoneId, with_1.PortalID, displayTimeZoneId); + // If it is an all day event then no need to adjust + if (!moduleEvent.AllDayEvent) + { + with_1.LastRecurrence = eventDateInfo.EventDate; + } + // Store the new timezone so it can be used again if needed + with_1.EventTimeZoneId = eventDateInfo.EventTimeZoneId; + // Convert to display timezone. If times have not been converted before, then OtherTimeZoneId will conatin "UTC" since these date are stored to DB in UTC + eventDateInfo = objEventTimeZoneUtilities.ConvertToDisplayTimeZone(with_1.CreatedDate, with_1.OtherTimeZoneId, with_1.PortalID, displayTimeZoneId); + with_1.CreatedDate = eventDateInfo.EventDate; + eventDateInfo = objEventTimeZoneUtilities.ConvertToDisplayTimeZone(with_1.LastUpdatedAt, with_1.OtherTimeZoneId, with_1.PortalID, displayTimeZoneId); + with_1.LastUpdatedAt = eventDateInfo.EventDate; + // Store the new timezone so it can be used again if needed + with_1.OtherTimeZoneId = eventDateInfo.EventTimeZoneId; + return moduleEvent; + } + + public ArrayList ConvertEventListToDisplayTimeZone(ArrayList moduleEvents, string displayTimeZoneId) + { + ArrayList outEvents = new ArrayList(); + foreach (EventInfo objEvent in moduleEvents) + { + outEvents.Add(ConvertEventToDisplayTimeZone(objEvent, displayTimeZoneId)); + } + return outEvents; + } + + // DateTime Sort Class + public class EventDateSort : IComparer + { + + public int Compare(object x, object y) + { + EventInfo xEventInfo = (EventInfo)x; + EventInfo yEventInfo = (EventInfo)y; + + EventTimeZoneUtilities objEventTimeZoneUtilities = new EventTimeZoneUtilities(); + + int result = 0; + result = DateTime.Compare(objEventTimeZoneUtilities.ConvertToUTCTimeZone(xEventInfo.EventTimeBegin, xEventInfo.EventTimeZoneId), objEventTimeZoneUtilities.ConvertToUTCTimeZone(yEventInfo.EventTimeBegin, yEventInfo.EventTimeZoneId)); + if (result == 0) + { + result = xEventInfo.EventID.CompareTo(yEventInfo.EventID); + } + + return result; + } + } + + + #endregion + + #region Private Functions and Methods + // Adds a new Recurring Event (not the real event) to the EventInfo ArrayList + // Sets Instance Date/Time and Converts to User Time Zone + private void AddEvent(EventInfo objEvent) + { + EventInfo objEvent2 = objEvent.Clone(); + + LstEvents.Add(objEvent2); + } + + #endregion + + } + #endregion + + #region EventController Class + + [DNNtc.UpgradeEventMessage("01.01.01,04.00.02,04.01.00,05.02.00")] + [DNNtc.BusinessControllerClass] + public class EventController : ISearchable, IUpgradeable + { + + public void EventsDelete(int eventID, int moduleID, int contentItemID) + { + // Dim cntTaxonomy As New Content + // cntTaxonomy.DeleteContentItem(ContentItemID) + DataProvider.Instance().EventsDelete(eventID, moduleID); + } + + public EventInfo EventsGet(int eventID, int moduleID) + { + EventInfo eventInfo = (EventInfo)(CBO.FillObject(DataProvider.Instance().EventsGet(eventID, moduleID), typeof(EventInfo))); + if (!ReferenceEquals(eventInfo, null)) + { + EventMasterController objCtlMasterEvent = new EventMasterController(); + eventInfo.ModuleTitle = objCtlMasterEvent.GetModuleTitle(eventInfo.ModuleID); + } + return eventInfo; + } + + public ArrayList EventsGetByRange(string moduleIDs, DateTime beginDate, DateTime endDate, string categoryIDs, string locationIDs, int socialGroupId, int socialUserId) + { + return CBO.FillCollection(DataProvider.Instance().EventsGetByRange(moduleIDs, beginDate, endDate, categoryIDs, locationIDs, socialGroupId, socialUserId), typeof(EventInfo)); + } + + + public EventInfo EventsSave(EventInfo objEvent, bool saveOnly, int tabID, bool updateContent) + { + // Dim cntTaxonomy As New Content + // If UpdateContent Then + // If Not objEvent.ContentItemID = Nothing And objEvent.ContentItemID <> 0 Then + // If Not objEvent.Cancelled Then + // cntTaxonomy.UpdateContentEvent(objEvent) + // Else + // cntTaxonomy.DeleteContentItem(objEvent.ContentItemID) + // objEvent.ContentItemID = Nothing + // End If + // End If + // End If + + if (objEvent.Cancelled && objEvent.JournalItem) + { + Journal cntJournal = new Journal(); + cntJournal.DeleteEvent(objEvent); + objEvent.JournalItem = false; + } + + EventInfo objEventOut = EventsSave(objEvent, saveOnly); + + // If UpdateContent And objEvent.EventID = -1 Then + // If objEventOut.ContentItemID = 0 And Not SaveOnly And Not TabID = Nothing Then + // objEventOut.ContentItemID = cntTaxonomy.CreateContentEvent(objEventOut, TabID).ContentItemId + // EventsSave(objEventOut, SaveOnly) + // End If + // End If + + return objEventOut; + } + + public EventInfo EventsSave(EventInfo objEvent, bool saveOnly) + { + return ((EventInfo)(CBO.FillObject(DataProvider.Instance().EventsSave(objEvent.PortalID, objEvent.EventID, objEvent.RecurMasterID, objEvent.ModuleID, objEvent.EventTimeBegin, objEvent.Duration, objEvent.EventName, objEvent.EventDesc, (System.Int32)objEvent.Importance, objEvent.CreatedByID.ToString(), objEvent.Notify, objEvent.Approved, objEvent.Signups, objEvent.MaxEnrollment, objEvent.EnrollRoleID, objEvent.EnrollFee, objEvent.EnrollType, objEvent.PayPalAccount, objEvent.Cancelled, objEvent.DetailPage, objEvent.DetailNewWin, objEvent.DetailURL, objEvent.ImageURL, objEvent.ImageType, objEvent.ImageWidth, objEvent.ImageHeight, objEvent.ImageDisplay, objEvent.Location, objEvent.Category, objEvent.Reminder, objEvent.SendReminder, objEvent.ReminderTime, objEvent.ReminderTimeMeasurement, objEvent.ReminderFrom, objEvent.SearchSubmitted, objEvent.CustomField1, objEvent.CustomField2, objEvent.EnrollListView, objEvent.DisplayEndDate, objEvent.AllDayEvent, objEvent.OwnerID, objEvent.LastUpdatedID, objEvent.OriginalDateBegin, objEvent.NewEventEmailSent, objEvent.AllowAnonEnroll, objEvent.ContentItemID, objEvent.JournalItem, objEvent.Summary, saveOnly), typeof(EventInfo)))); + } + + public ArrayList EventsModerateEvents(int moduleID, int socialGroupId) + { + return CBO.FillCollection(DataProvider.Instance().EventsModerateEvents(moduleID, socialGroupId), typeof(EventInfo)); + } + + public int EventsTimeZoneCount(int moduleID) + { + // ReSharper disable RedundantCast + return System.Convert.ToInt32(DataProvider.Instance().EventsTimeZoneCount(moduleID)); + // ReSharper restore RedundantCast + } + + public void EventsUpgrade(string moduleVersion) + { + DataProvider.Instance().EventsUpgrade(moduleVersion); + } + + public void EventsCleanupExpired(int portalId, int moduleId) + { + DataProvider.Instance().EventsCleanupExpired(portalId, moduleId); + } + + public ArrayList EventsGetRecurrences(int recurMasterID, int moduleID) + { + return CBO.FillCollection(DataProvider.Instance().EventsGetRecurrences(recurMasterID, moduleID), typeof(EventInfo)); + } + + + #region Optional Interfaces + //*** Implement ISearchable + public Services.Search.SearchItemInfoCollection GetSearchItems(ModuleInfo modInfo) + { + EventModuleSettings ems = new EventModuleSettings(); + EventModuleSettings settings = ems.GetEventModuleSettings(modInfo.ModuleID, null); + + Entities.Portals.PortalController objPortals = new Entities.Portals.PortalController(); + Entities.Portals.PortalInfo objPortal = default(Entities.Portals.PortalInfo); + objPortal = objPortals.GetPortal(modInfo.PortalID); + // Set Thread Culture for Portal Default Culture (for Dates/Times Formatting) + string lang = objPortal.DefaultLanguage; + System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo(lang, false); + Services.Search.SearchItemInfoCollection searchItemCollection = new Services.Search.SearchItemInfoCollection(); + + try + { + if (settings.Eventsearch) + { + // Get Date Recurrences from 6 months prior to Current Date and 1 year out + EventInfoHelper objEventInfoHelper = new EventInfoHelper(modInfo.ModuleID, settings); + ArrayList categoryIDs = new ArrayList(); + categoryIDs.Add("-1"); + ArrayList locationIDs = new ArrayList(); + locationIDs.Add("-1"); + ArrayList lstEvents = objEventInfoHelper.GetEvents(DateTime.UtcNow.AddMonths(-6), DateTime.UtcNow.AddYears(1), false, categoryIDs, locationIDs, true, -1, -1); + + string portalTimeZoneId = Entities.Portals.PortalController.GetPortalSetting("TimeZone", modInfo.PortalID, string.Empty); + lstEvents = objEventInfoHelper.ConvertEventListToDisplayTimeZone(lstEvents, portalTimeZoneId); + + foreach (EventInfo objEvent in lstEvents) + { + Services.Search.SearchItemInfo searchItem = default(Services.Search.SearchItemInfo); + // Item Title + string strTitle = HttpUtility.HtmlDecode(objEvent.ModuleTitle + ": " + objEvent.EventName + ", " + objEvent.EventTimeBegin.ToString()); + // Displayed Description + string strDescription = HtmlUtils.Shorten(HtmlUtils.StripTags(HttpUtility.HtmlDecode(objEvent.EventDesc), false), 255, "..."); + // Search Items + string strContent = HttpUtility.HtmlDecode(objEvent.ModuleTitle + " " + objEvent.EventName + " " + objEvent.EventTimeBegin.ToString() + " " + objEvent.EventDesc); + // Added to Link + string strGUID = HttpUtility.HtmlDecode("ModuleID=" + objEvent.ModuleID.ToString() + "&ItemID=" + objEvent.EventID.ToString() + "&mctl=EventDetails"); + // Unique Item Key + string strUnique = "Event: " + objEvent.EventID.ToString() + ", Date:" + objEvent.EventTimeBegin.ToString(); + + searchItem = new Services.Search.SearchItemInfo(); + searchItem.Title = strTitle; + searchItem.PubDate = objEvent.LastUpdatedAt; + searchItem.Description = strDescription; + searchItem.Author = objEvent.LastUpdatedID; + searchItem.ModuleId = modInfo.ModuleID; + searchItem.SearchKey = strUnique; + searchItem.Content = strContent; + searchItem.GUID = strGUID; + + searchItemCollection.Add(searchItem); + } + } + return searchItemCollection; + } + catch (Exception) + { + return null; + } + } + + //Public Function ExportModule(ByVal ModuleID As Integer) As String Implements Entities.Modules.IPortable.ExportModule + // Dim strXML As String = "" + // Dim objEventCtl As New EventController + + // Dim arrEvents As ArrayList = objEventCtl.EventsGetByRange(ModuleID.ToString(), DateTime.Now, DateTime.Now.AddYears(1), "") + // If arrEvents.Count <> 0 Then + // strXML += "" + // Dim objEvent As EventInfo + // For Each objEvent In arrEvents + // strXML += "" + // strXML += "" & XMLEncode(objEvent.EventDesc) & "" + // strXML += "" & XMLEncode(objEvent.EventTimeBegin.ToString) & "" + // strXML += "" & XMLEncode(objEvent.EventName) & "" + // strXML += "" & XMLEncode(objEvent.IconFile) & "" + // strXML += "" & XMLEncode(objEvent.Every.ToString) & "" + // strXML += "" & XMLEncode(objEvent.AltText) & "" + // strXML += "" & XMLEncode(objEvent.ExpireDate.ToString) & "" + // strXML += "" & XMLEncode(objEvent.MaxWidth.ToString) & "" + // strXML += "" & XMLEncode(objEvent.Period) & "" + // strXML += "" + // Next + // strXML += "" + // End If + + // Return strXML + //End Function + + //Public Sub ImportModule(ByVal ModuleID As Integer, ByVal Content As String, ByVal Version As String, ByVal UserId As Integer) Implements Entities.Modules.IPortable.ImportModule + // Dim xmlEvent As XmlNode + // Dim xmlEvents As XmlNode = GetContent(Content, "events") + // For Each xmlEvent In xmlEvents.SelectNodes("event") + // Dim objEvent As New EventInfo + // objEvent.ModuleID = ModuleID + // objEvent.Description = xmlEvent.Item("description").InnerText + // objEvent.DateTime = Date.Parse(xmlEvent.Item("datetime").InnerText) + // objEvent.Title = xmlEvent.Item("title").InnerText + // objEvent.IconFile = ImportUrl(ModuleID, xmlEvent.Item("icon").InnerText) + // objEvent.Every = Integer.Parse(xmlEvent.Item("occursevery").InnerText) + // objEvent.AltText = xmlEvent.Item("alttext").InnerText + // objEvent.ExpireDate = Date.Parse(xmlEvent.Item("expires").InnerText) + // objEvent.MaxWidth = Integer.Parse(xmlEvent.Item("maxWidth").InnerText) + // objEvent.Period = xmlEvent.Item("period").InnerText + // objEvent.CreatedByUser = UserId.ToString + // AddEvent(objEvent) + // Next + //End Sub + + public string UpgradeModule(string version) + { + string rtnMessage = "Events Module Updated: " + version; + try + { + + // Create Lists and Schedule - they should always exist + CreateListsAndSchedule(); + + //Lookup DesktopModuleID + DesktopModuleInfo objDesktopModule = default(DesktopModuleInfo); + objDesktopModule = DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", 0); + + if (!ReferenceEquals(objDesktopModule, null)) + { + ModuleDefinitionInfo objModuleDefinition = default(ModuleDefinitionInfo); + //Lookup ModuleDefID + objModuleDefinition = ModuleDefinitionController.GetModuleDefinitionByFriendlyName("Events", objDesktopModule.DesktopModuleID); + + if (!ReferenceEquals(objModuleDefinition, null)) + { + ModuleControlInfo objModuleControlInfo = default(ModuleControlInfo); + //Lookup ModuleControlID + objModuleControlInfo = ModuleControlController.GetModuleControlByControlKey("Import", objModuleDefinition.ModuleDefID); + if (!ReferenceEquals(objModuleControlInfo, null)) + { + //Remove Import control key + ModuleControlController.DeleteModuleControl(objModuleControlInfo.ModuleControlID); + } + // ReSharper disable RedundantAssignment + objModuleControlInfo = null; + // ReSharper restore RedundantAssignment + objModuleControlInfo = ModuleControlController.GetModuleControlByControlKey("TZUpdate", objModuleDefinition.ModuleDefID); + if (!ReferenceEquals(objModuleControlInfo, null)) + { + //Remove TZUpdate control key + ModuleControlController.DeleteModuleControl(objModuleControlInfo.ModuleControlID); + } + } + } + + if (version == "04.00.02") + { + // Copy moderators from ModuleSettings to ModulePermissions + EventController objEventCtl = new EventController(); + objEventCtl.EventsUpgrade(version); + } + + if (version == "04.01.00") + { + // Upgrade recurring events + bool blAllOk = false; + blAllOk = UpgradeRecurringEvents(); + EventsUpgrade(version); + if (blAllOk) + { + rtnMessage = "Events Module Updated: " + (version + " --> All Events Upgraded"); + } + else + { + rtnMessage = "Events Module Updated: " + (version + " --> Not All Events Upgraded - Check database for errors"); + } + } + + if (version == "05.02.00") + { + // ReSharper disable UnusedVariable + bool result = ConvertEditPermissions(); + // ReSharper restore UnusedVariable + } + + } + catch (Exception ex) + { + Exceptions.LogException(ex); + + return "Events Module Updated - Exception: " + version + " - Message: " + ex.Message.ToString(); + } + return rtnMessage; + } + + public void CreateListsAndSchedule() + { + // Create schedule + EventNotificationController objEventNotificationController = new EventNotificationController(); + objEventNotificationController.InstallEventSchedule(); + + // Add TimeInterval List entries + DotNetNuke.Common.Lists.ListController ctlLists = new DotNetNuke.Common.Lists.ListController(); + System.Collections.Generic.IEnumerable colThreadStatus = ctlLists.GetListEntryInfoItems("TimeInterval"); + if (!colThreadStatus.Any()) + { + AddLists(); + } + + } + + private bool UpgradeRecurringEvents() + { + bool returnStr = true; + + Entities.Portals.PortalController objPortals = new Entities.Portals.PortalController(); + Entities.Portals.PortalInfo objPortal = default(Entities.Portals.PortalInfo); + ModuleController objModules = new ModuleController(); + ModuleInfo objModule = default(ModuleInfo); + + ArrayList lstportals = objPortals.GetPortals(); + foreach (Entities.Portals.PortalInfo tempLoopVar_objPortal in lstportals) + { + objPortal = tempLoopVar_objPortal; + DesktopModuleInfo objDesktopModule = default(DesktopModuleInfo); + objDesktopModule = DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", objPortal.PortalID); + string folderName = objDesktopModule.FolderName; + string templateSourceDirectory = Common.Globals.ApplicationPath; + string localResourceFile = templateSourceDirectory + "/DesktopModules/" + folderName + "/" + Localization.LocalResourceDirectory + "/EventSettings.ascx.resx"; + + ArrayList lstModules = objModules.GetModulesByDefinition(objPortal.PortalID, objDesktopModule.FriendlyName); + foreach (ModuleInfo tempLoopVar_objModule in lstModules) + { + objModule = tempLoopVar_objModule; + // This check for objModule = Nothing because of error in DNN 5.0.0 in GetModulesByDefinition + if (ReferenceEquals(objModule, null)) + { + continue; + } + EventModuleSettings ems = new EventModuleSettings(); + EventModuleSettings settings = ems.GetEventModuleSettings(objModule.ModuleID, null); + + string maxRecurrences = settings.Maxrecurrences.ToString(); + + if (!UpgradeRecurringEventModule(objModule.ModuleID, System.Convert.ToInt32(settings.RecurDummy), maxRecurrences, localResourceFile)) + { + returnStr = false; + } + } + } + + return returnStr; + } + + public bool UpgradeRecurringEventModule(int moduleID, int recurMasterID, string maxRecurrences, string localResourceFile) + { + if (recurMasterID == 99999) + { + return true; + } + EventRecurMasterController objCtlEventRecurMaster = new EventRecurMasterController(); + EventController objCtlEvent = new EventController(); + EventInfo objEvent = default(EventInfo); + EventInfo objEventNew = default(EventInfo); + + ArrayList lstEvents = default(ArrayList); + lstEvents = objCtlEvent.EventsGetRecurrences(recurMasterID, moduleID); + + foreach (EventInfo tempLoopVar_objEvent in lstEvents) + { + objEvent = tempLoopVar_objEvent; + EventRecurMasterInfo objEventRecurMaster = new EventRecurMasterInfo(); + objEventRecurMaster.RecurMasterID = -1; + objEventRecurMaster.ModuleID = objEvent.ModuleID; + objEventRecurMaster.PortalID = objEvent.PortalID; + objEventRecurMaster.Dtstart = objEvent.EventTimeBegin; + objEventRecurMaster.Duration = System.Convert.ToString(System.Convert.ToString(objEvent.Duration) + "M"); + // ReSharper disable VBWarnings::BC40008 + objEventRecurMaster.Until = objEvent.EventDateEnd; + // ReSharper restore VBWarnings::BC40008 + objEventRecurMaster.EventName = objEvent.EventName; + objEventRecurMaster.EventDesc = objEvent.EventDesc; + objEventRecurMaster.Importance = (EventRecurMasterInfo.Priority)objEvent.Importance; + objEventRecurMaster.Notify = objEvent.Notify; + objEventRecurMaster.Approved = objEvent.Approved; + objEventRecurMaster.Signups = objEvent.Signups; + objEventRecurMaster.MaxEnrollment = objEvent.MaxEnrollment; + objEventRecurMaster.EnrollRoleID = objEvent.EnrollRoleID; + objEventRecurMaster.EnrollFee = objEvent.EnrollFee; + objEventRecurMaster.EnrollType = objEvent.EnrollType; + objEventRecurMaster.Enrolled = objEvent.Enrolled; + objEventRecurMaster.PayPalAccount = objEvent.PayPalAccount; + objEventRecurMaster.DetailPage = objEvent.DetailPage; + objEventRecurMaster.DetailNewWin = objEvent.DetailNewWin; + objEventRecurMaster.DetailURL = objEvent.DetailURL; + objEventRecurMaster.ImageURL = objEvent.ImageURL; + objEventRecurMaster.ImageType = objEvent.ImageType; + objEventRecurMaster.ImageWidth = objEvent.ImageWidth; + objEventRecurMaster.ImageHeight = objEvent.ImageHeight; + objEventRecurMaster.ImageDisplay = objEvent.ImageDisplay; + objEventRecurMaster.Location = objEvent.Location; + objEventRecurMaster.Category = objEvent.Category; + objEventRecurMaster.Reminder = objEvent.Reminder; + objEventRecurMaster.SendReminder = objEvent.SendReminder; + objEventRecurMaster.ReminderTime = objEvent.ReminderTime; + objEventRecurMaster.ReminderTimeMeasurement = objEvent.ReminderTimeMeasurement; + objEventRecurMaster.ReminderFrom = objEvent.ReminderFrom; + objEventRecurMaster.CustomField1 = objEvent.CustomField1; + objEventRecurMaster.CustomField2 = objEvent.CustomField2; + objEventRecurMaster.EnrollListView = objEvent.EnrollListView; + objEventRecurMaster.DisplayEndDate = objEvent.DisplayEndDate; + objEventRecurMaster.AllDayEvent = objEvent.AllDayEvent; + objEventRecurMaster.OwnerID = objEvent.OwnerID; + objEventRecurMaster.CreatedByID = objEvent.CreatedByID; + objEventRecurMaster.UpdatedByID = objEvent.CreatedByID; + objEventRecurMaster.AllowAnonEnroll = false; + objEventRecurMaster.ContentItemID = 0; + objEventRecurMaster.SocialGroupID = 0; + objEventRecurMaster.SocialUserID = 0; + objEventRecurMaster.Summary = null; + UserController objCtlUsers = new UserController(); + UserInfo objUserInfo = objCtlUsers.GetUser(objEvent.PortalID, objEvent.CreatedByID); + if (!ReferenceEquals(objUserInfo, null)) + { + objEventRecurMaster.CultureName = objUserInfo.Profile.PreferredLocale; + } + if (ReferenceEquals(objUserInfo, null) || objEventRecurMaster.CultureName == "") + { + Entities.Portals.PortalController objCtlPortal = new Entities.Portals.PortalController(); + Entities.Portals.PortalInfo objPortalinfo = objCtlPortal.GetPortal(objEvent.PortalID); + objEventRecurMaster.CultureName = objPortalinfo.DefaultLanguage; + } + + objEventRecurMaster.RRULE = CreateRRULE(objEvent, objEventRecurMaster.CultureName); + ArrayList lstEventsNew = default(ArrayList); + + lstEventsNew = objCtlEventRecurMaster.CreateEventRecurrences(objEventRecurMaster, objEvent.Duration, maxRecurrences); + objEventRecurMaster = objCtlEventRecurMaster.EventsRecurMasterSave(objEventRecurMaster); + + // If no events generated, mark original as cancelled and link to new recurmaster - Non Destructive + if (lstEventsNew.Count == 0) + { + objEvent.Cancelled = true; + objEvent.RecurMasterID = objEventRecurMaster.RecurMasterID; + objCtlEvent.EventsSave(objEvent, true); + } + + int i = 0; + foreach (EventInfo tempLoopVar_objEventNew in lstEventsNew) + { + objEventNew = tempLoopVar_objEventNew; + i++; + if (i == 1) + { + objEventNew.EventID = objEvent.EventID; + } + objEventNew.RecurMasterID = objEventRecurMaster.RecurMasterID; + objEventNew.Cancelled = objEvent.Cancelled; + objEventNew.SearchSubmitted = objEvent.SearchSubmitted; + // ReSharper disable RedundantAssignment + objEventNew = objCtlEvent.EventsSave(objEventNew, true); + // ReSharper restore RedundantAssignment + } + } + lstEvents.Clear(); + lstEvents = objCtlEvent.EventsGetRecurrences(recurMasterID, moduleID); + if (lstEvents.Count == 0) + { + objCtlEventRecurMaster.EventsRecurMasterDelete(recurMasterID, moduleID); + EventModuleSettings ems = new EventModuleSettings(); + EventModuleSettings settings = ems.GetEventModuleSettings(moduleID, localResourceFile); + settings.RecurDummy = "99999"; + settings.SaveSettings(moduleID); + return true; + } + else + { + return false; + } + } + + private string CreateRRULE(EventInfo objEvent, string cultureName) + { + string rrule = ""; + string strWkst = ""; + CultureInfo culture = new CultureInfo(cultureName, false); + strWkst = "SU"; + if (culture.DateTimeFormat.FirstDayOfWeek != DayOfWeek.Sunday) + { + strWkst = "MO"; + } + // ReSharper disable VBWarnings::BC40008 + switch (objEvent.RepeatType.Trim()) + { + case "N": + rrule = ""; + break; + case "P1": + switch (objEvent.Period.Trim()) + { + case "D": + rrule = "FREQ=DAILY"; + break; + case "W": + rrule = "FREQ=WEEKLY;WKST=" + strWkst; + break; + case "M": + rrule = "FREQ=MONTHLY"; + break; + case "Y": + rrule = "FREQ=YEARLY"; + break; + } + rrule = rrule + ";INTERVAL=" + objEvent.Every.ToString(); + break; + case "W1": + rrule = "FREQ=WEEKLY;WKST=" + strWkst + ";INTERVAL=" + objEvent.Every.ToString() + ";BYDAY="; + if (System.Convert.ToBoolean(objEvent.Period.Substring(0, 1))) + { + rrule = rrule + "SU,"; + } + if (System.Convert.ToBoolean(objEvent.Period.Substring(1, 1))) + { + rrule = rrule + "MO,"; + } + if (System.Convert.ToBoolean(objEvent.Period.Substring(2, 1))) + { + rrule = rrule + "TU,"; + } + if (System.Convert.ToBoolean(objEvent.Period.Substring(3, 1))) + { + rrule = rrule + "WE,"; + } + if (System.Convert.ToBoolean(objEvent.Period.Substring(4, 1))) + { + rrule = rrule + "TH,"; + } + if (System.Convert.ToBoolean(objEvent.Period.Substring(5, 1))) + { + rrule = rrule + "FR,"; + } + if (System.Convert.ToBoolean(objEvent.Period.Substring(6, 1))) + { + rrule = rrule + "SA,"; + } + rrule = rrule.Substring(0, rrule.Length - 1); + break; + case "M1": + rrule = "FREQ=MONTHLY;INTERVAL=1;BYDAY="; + string strWeek = ""; + if (objEvent.Every < 5) + { + strWeek = "+" + Convert.ToString(objEvent.Every); + } + else + { + strWeek = "-1"; + } + rrule = rrule + strWeek; + + string strDay = ""; + switch (objEvent.Period.Trim()) + { + case "0": + strDay = "SU"; + break; + case "1": + strDay = "MO"; + break; + case "2": + strDay = "TU"; + break; + case "3": + strDay = "WE"; + break; + case "4": + strDay = "TH"; + break; + case "5": + strDay = "FR"; + break; + case "6": + strDay = "SA"; + break; + } + rrule = rrule + strDay; + break; + case "M2": + rrule = "FREQ=MONTHLY;INTERVAL=" + objEvent.Every.ToString() + ";BYMONTHDAY=+" + objEvent.Period.Trim(); + break; + case "Y1": + CultureInfo uiculture = System.Threading.Thread.CurrentThread.CurrentCulture; + CultureInfo usculture = new CultureInfo("en-US", false); + System.Threading.Thread.CurrentThread.CurrentCulture = usculture; + DateTime yearDate = Convert.ToDateTime(objEvent.Period); + // ReSharper restore VBWarnings::BC40008 + System.Threading.Thread.CurrentThread.CurrentCulture = uiculture; + rrule = "FREQ=YEARLY;INTERVAL=1;BYMONTH=" + Convert.ToString(yearDate.Month) + ";BYMONTHDAY=+" + Convert.ToString(yearDate.Day); + break; + } + return rrule; + } + + private bool ConvertEditPermissions() + { + bool returnStr = true; + + Entities.Portals.PortalController objPortals = new Entities.Portals.PortalController(); + Entities.Portals.PortalInfo objPortal = default(Entities.Portals.PortalInfo); + ModuleController objModules = new ModuleController(); + ModuleInfo objModule = default(ModuleInfo); + + ArrayList lstportals = objPortals.GetPortals(); + foreach (Entities.Portals.PortalInfo tempLoopVar_objPortal in lstportals) + { + objPortal = tempLoopVar_objPortal; + DesktopModuleInfo objDesktopModule = default(DesktopModuleInfo); + objDesktopModule = DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", objPortal.PortalID); + + ArrayList lstModules = objModules.GetModulesByDefinition(objPortal.PortalID, objDesktopModule.FriendlyName); + foreach (ModuleInfo tempLoopVar_objModule in lstModules) + { + objModule = tempLoopVar_objModule; + // This check for objModule = Nothing because of error in DNN 5.0.0 in GetModulesByDefinition + if (ReferenceEquals(objModule, null)) + { + continue; + } + + if (!ConvertEditPermissionsModule(objModule.ModuleID, objModule.TabID)) + { + returnStr = false; + } + } + } + return returnStr; + } + + private static bool ConvertEditPermissionsModule(int moduleID, int tabID) + { + bool returnStr = false; + ArrayList arrRoles = new ArrayList(); + ArrayList arrUsers = new ArrayList(); + + ModulePermissionInfo objPermission = default(ModulePermissionInfo); + PermissionController objPermissionController = new PermissionController(); + + ModuleController objModules = new ModuleController(); + // Get existing module permissions + ModuleInfo objModule = objModules.GetModule(moduleID, tabID); + ModulePermissionCollection objModulePermissions2 = new ModulePermissionCollection(); + + foreach (ModulePermissionInfo perm in objModule.ModulePermissions) + { + if (perm.PermissionKey == "EDIT" && perm.AllowAccess) + { + objModulePermissions2.Add(perm); + if (perm.UserID >= 0) + { + arrUsers.Add(perm.UserID); + } + else + { + arrRoles.Add(perm.RoleID); + } + } + } + foreach (ModulePermissionInfo perm in objModulePermissions2) + { + if (perm.RoleName != "Administrators") + { + objModule.ModulePermissions.Remove(perm); + } + } + + ArrayList objEditPermissions = objPermissionController.GetPermissionByCodeAndKey("EVENTS_MODULE", "EVENTSEDT"); + PermissionInfo objEditPermission = (PermissionInfo)(objEditPermissions[0]); + + foreach (int iRoleID in arrRoles) + { + objPermission = new ModulePermissionInfo(); + objPermission.RoleID = iRoleID; + objPermission.ModuleID = moduleID; + objPermission.PermissionKey = objEditPermission.PermissionKey; + objPermission.PermissionName = objEditPermission.PermissionName; + objPermission.PermissionCode = objEditPermission.PermissionCode; + objPermission.PermissionID = objEditPermission.PermissionID; + objPermission.AllowAccess = true; + objModule.ModulePermissions.Add(objPermission); + } + foreach (int iUserID in arrUsers) + { + objPermission = new ModulePermissionInfo(); + objPermission.UserID = iUserID; + objPermission.ModuleID = moduleID; + objPermission.PermissionKey = objEditPermission.PermissionKey; + objPermission.PermissionName = objEditPermission.PermissionName; + objPermission.PermissionCode = objEditPermission.PermissionCode; + objPermission.PermissionID = objEditPermission.PermissionID; + objPermission.AllowAccess = true; + objModule.ModulePermissions.Add(objPermission); + } + + ModulePermissionController.SaveModulePermissions(objModule); + returnStr = true; + return returnStr; + } + private void AddLists() + { + DesktopModuleInfo objDesktopModule = default(DesktopModuleInfo); + objDesktopModule = DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", 0); + if (ReferenceEquals(objDesktopModule, null)) + { + return; + } + ModuleDefinitionInfo objModuleDefinition = default(ModuleDefinitionInfo); + objModuleDefinition = ModuleDefinitionController.GetModuleDefinitionByFriendlyName("Events", objDesktopModule.DesktopModuleID); + if (ReferenceEquals(objModuleDefinition, null)) + { + return; + } + + int moduleDefId = objModuleDefinition.ModuleDefID; + + DotNetNuke.Common.Lists.ListController ctlLists = new DotNetNuke.Common.Lists.ListController(); + //description is missing, not needed + + //ThreadStatus + DotNetNuke.Common.Lists.ListEntryInfo objList = new DotNetNuke.Common.Lists.ListEntryInfo(); + objList.ListName = "TimeInterval"; + objList.Value = "5"; + objList.Text = "5"; + objList.SortOrder = 1; + objList.ParentID = 0; + objList.Level = 0; + objList.DefinitionID = moduleDefId; + ctlLists.AddListEntry(objList); + + objList.ListName = "TimeInterval"; + objList.Value = "10"; + objList.Text = "10"; + objList.SortOrder = 2; + objList.ParentID = 0; + objList.Level = 0; + objList.DefinitionID = moduleDefId; + ctlLists.AddListEntry(objList); + + objList.ListName = "TimeInterval"; + objList.Value = "15"; + objList.Text = "15"; + objList.SortOrder = 3; + objList.ParentID = 0; + objList.Level = 0; + objList.DefinitionID = moduleDefId; + ctlLists.AddListEntry(objList); + + objList.ListName = "TimeInterval"; + objList.Value = "20"; + objList.Text = "20"; + objList.SortOrder = 4; + objList.ParentID = 0; + objList.Level = 0; + objList.DefinitionID = moduleDefId; + ctlLists.AddListEntry(objList); + + objList.ListName = "TimeInterval"; + objList.Value = "30"; + objList.Text = "30"; + objList.SortOrder = 5; + objList.ParentID = 0; + objList.Level = 0; + objList.DefinitionID = moduleDefId; + ctlLists.AddListEntry(objList); + + objList.ListName = "TimeInterval"; + objList.Value = "60"; + objList.Text = "60"; + objList.SortOrder = 6; + objList.ParentID = 0; + objList.Level = 0; + objList.DefinitionID = moduleDefId; + ctlLists.AddListEntry(objList); + + + objList.ListName = "TimeInterval"; + objList.Value = "120"; + objList.Text = "120"; + objList.SortOrder = 7; + objList.ParentID = 0; + objList.Level = 0; + objList.DefinitionID = moduleDefId; + ctlLists.AddListEntry(objList); + + + objList.ListName = "TimeInterval"; + objList.Value = "240"; + objList.Text = "240"; + objList.SortOrder = 8; + objList.ParentID = 0; + objList.Level = 0; + objList.DefinitionID = moduleDefId; + ctlLists.AddListEntry(objList); + + + objList.ListName = "TimeInterval"; + objList.Value = "360"; + objList.Text = "360"; + objList.SortOrder = 9; + objList.ParentID = 0; + objList.Level = 0; + objList.DefinitionID = moduleDefId; + ctlLists.AddListEntry(objList); + + objList.ListName = "TimeInterval"; + objList.Value = "720"; + objList.Text = "720"; + objList.SortOrder = 10; + objList.ParentID = 0; + objList.Level = 0; + objList.DefinitionID = moduleDefId; + ctlLists.AddListEntry(objList); + + objList.ListName = "TimeInterval"; + objList.Value = "1440"; + objList.Text = "1440"; + objList.SortOrder = 11; + objList.ParentID = 0; + objList.Level = 0; + objList.DefinitionID = moduleDefId; + ctlLists.AddListEntry(objList); + + + } + #endregion + + } + #endregion + + #region EventMasterController Class + public class EventMasterController + { + + public void EventsMasterDelete(int masterID, int moduleID) + { + DataProvider.Instance().EventsMasterDelete(masterID, moduleID); + } + + public EventMasterInfo EventsMasterGet(int moduleID, int subEventID) + { + EventMasterInfo eventMasterInfo = (EventMasterInfo)(CBO.FillObject(DataProvider.Instance().EventsMasterGet(moduleID, subEventID), typeof(EventMasterInfo))); + if (!ReferenceEquals(eventMasterInfo, null)) + { + eventMasterInfo.SubEventTitle = GetModuleTitle(eventMasterInfo.SubEventID); + } + return eventMasterInfo; + } + + public ArrayList EventsMasterAssignedModules(int moduleID) + { + ArrayList assignedModules = CBO.FillCollection(DataProvider.Instance().EventsMasterAssignedModules(moduleID), typeof(EventMasterInfo)); + EventMasterInfo objEventMasterInfo = default(EventMasterInfo); + foreach (EventMasterInfo tempLoopVar_objEventMasterInfo in assignedModules) + { + objEventMasterInfo = tempLoopVar_objEventMasterInfo; + objEventMasterInfo.SubEventTitle = GetModuleTitle(objEventMasterInfo.SubEventID); + } + assignedModules.Sort(new ModuleListSort()); + return assignedModules; + } + + public ArrayList EventsMasterAvailableModules(int portalID, int moduleID) + { + ArrayList availableModules = CBO.FillCollection(DataProvider.Instance().EventsMasterAvailableModules(portalID, moduleID), typeof(EventMasterInfo)); + EventMasterInfo objEventMasterInfo = default(EventMasterInfo); + foreach (EventMasterInfo tempLoopVar_objEventMasterInfo in availableModules) + { + objEventMasterInfo = tempLoopVar_objEventMasterInfo; + objEventMasterInfo.SubEventTitle = GetModuleTitle(objEventMasterInfo.SubEventID); + } + availableModules.Sort(new ModuleListSort()); + return availableModules; + } + + public EventMasterInfo EventsMasterSave(EventMasterInfo objEventMaster) + { + return ((EventMasterInfo)(CBO.FillObject(DataProvider.Instance().EventsMasterSave(objEventMaster.MasterID, objEventMaster.ModuleID, objEventMaster.SubEventID), typeof(EventMasterInfo)))); + } + + public string GetModuleTitle(int intModuleID) + { + string cacheKey = "EventsModuleTitle" + intModuleID.ToString(); + string moduleTitle = System.Convert.ToString(Common.Utilities.DataCache.GetCache(cacheKey)); + if (ReferenceEquals(moduleTitle, null)) + { + ModuleController objModuleController = new ModuleController(); + ArrayList objModuleTabs = (ArrayList)(objModuleController.GetModuleTabs(intModuleID)); + ModuleInfo objModuleInfo = default(ModuleInfo); + int intTabID = 0; + foreach (ModuleInfo tempLoopVar_objModuleInfo in objModuleTabs) + { + objModuleInfo = tempLoopVar_objModuleInfo; + if (objModuleInfo.TabID < intTabID | intTabID == 0) + { + moduleTitle = Common.Utilities.HtmlUtils.StripTags(objModuleInfo.ModuleTitle, false); + intTabID = objModuleInfo.TabID; + } + } + Common.Utilities.DataCache.SetCache(cacheKey, moduleTitle); + } + return moduleTitle; + } + + } + #endregion + + #region Comparer Class + public class ModuleListSort : IComparer + { + + public int Compare(object x, object y) + { + string xdisplayname = ""; + string ydisplayname = ""; + + xdisplayname = ((EventMasterInfo)x).SubEventTitle; + ydisplayname = ((EventMasterInfo)y).SubEventTitle; + CaseInsensitiveComparer c = new CaseInsensitiveComparer(); + return c.Compare(xdisplayname, ydisplayname); + } + } + + #endregion + + + #region EventSignupsController Class + + // EventSignupsController class made public in order to accommodate an external enrollment page. + public class EventSignupsController + { + + public void EventsSignupsDelete(int signupID, int moduleID) + { + DataProvider.Instance().EventsSignupsDelete(signupID, moduleID); + } + + public EventSignupsInfo EventsSignupsGet(int signupID, int moduleID, bool ppipn) + { + return ((EventSignupsInfo)(CBO.FillObject(DataProvider.Instance().EventsSignupsGet(signupID, moduleID, ppipn), typeof(EventSignupsInfo)))); + } + + public ArrayList EventsSignupsGetEvent(int eventID, int moduleID) + { + return CBO.FillCollection(DataProvider.Instance().EventsSignupsGetEvent(eventID, moduleID), typeof(EventSignupsInfo)); + } + + public ArrayList EventsSignupsGetEventRecurMaster(int recurMasterID, int moduleID) + { + return CBO.FillCollection(DataProvider.Instance().EventsSignupsGetEventRecurMaster(recurMasterID, moduleID), typeof(EventSignupsInfo)); + } + + public ArrayList EventsSignupsMyEnrollments(int moduleID, int userID, int socialGroupId, string categoryIDs, DateTime beginDate, DateTime endDate) + { + return CBO.FillCollection(DataProvider.Instance().EventsSignupsMyEnrollments(moduleID, userID, socialGroupId, categoryIDs, beginDate, endDate), typeof(EventSignupsInfo)); + } + + public EventSignupsInfo EventsSignupsGetUser(int eventID, int userID, int moduleID) + { + return ((EventSignupsInfo)(CBO.FillObject(DataProvider.Instance().EventsSignupsGetUser(eventID, userID, moduleID), typeof(EventSignupsInfo)))); + } + + public EventSignupsInfo EventsSignupsGetAnonUser(int eventID, string anonEmail, int moduleID) + { + return ((EventSignupsInfo)(CBO.FillObject(DataProvider.Instance().EventsSignupsGetAnonUser(eventID, anonEmail, moduleID), typeof(EventSignupsInfo)))); + } + + public EventSignupsInfo EventsSignupsSave(EventSignupsInfo objEventSignup) + { + return ((EventSignupsInfo)(CBO.FillObject(DataProvider.Instance().EventsSignupsSave(objEventSignup.EventID, objEventSignup.SignupID, objEventSignup.ModuleID, objEventSignup.UserID, objEventSignup.Approved, objEventSignup.PayPalStatus, objEventSignup.PayPalReason, objEventSignup.PayPalTransID, objEventSignup.PayPalPayerID, objEventSignup.PayPalPayerStatus, objEventSignup.PayPalRecieverEmail, objEventSignup.PayPalUserEmail, objEventSignup.PayPalPayerEmail, objEventSignup.PayPalFirstName, objEventSignup.PayPalLastName, objEventSignup.PayPalAddress, objEventSignup.PayPalCity, objEventSignup.PayPalState, objEventSignup.PayPalZip, objEventSignup.PayPalCountry, objEventSignup.PayPalCurrency, objEventSignup.PayPalPaymentDate, objEventSignup.PayPalAmount, objEventSignup.PayPalFee, objEventSignup.NoEnrolees, objEventSignup.AnonEmail, objEventSignup.AnonName, objEventSignup.AnonTelephone, objEventSignup.AnonCulture, objEventSignup.AnonTimeZoneId, objEventSignup.FirstName, objEventSignup.LastName, objEventSignup.Company, objEventSignup.JobTitle, objEventSignup.ReferenceNumber, objEventSignup.Street, objEventSignup.PostalCode, objEventSignup.City, objEventSignup.Region, objEventSignup.Country), typeof(EventSignupsInfo)))); + } + + public ArrayList EventsModerateSignups(int moduleID, int socialGroupId) + { + return CBO.FillCollection(DataProvider.Instance().EventsModerateSignups(moduleID, socialGroupId), typeof(EventSignupsInfo)); + } + + public bool DisplayEnrollIcon(EventInfo eventInfo) + { + EventTimeZoneUtilities objEventTimeZoneUtilities = new EventTimeZoneUtilities(); + if (eventInfo.EventTimeBegin < objEventTimeZoneUtilities.ConvertFromUTCToModuleTimeZone(DateTime.UtcNow, eventInfo.EventTimeZoneId)) + { + return false; + } + + if (!eventInfo.Signups) + { + return false; + } + + if (eventInfo.EnrollRoleID == null || eventInfo.EnrollRoleID == -1) + { + return true; + } + else + { + if (IsEnrollRole(eventInfo.EnrollRoleID, eventInfo.PortalID)) + { + return true; + } + } + + return false; + } + + public bool IsEnrollRole(int roleID, int portalId) + { + try + { + // ReSharper disable RedundantAssignment + string roleName = ""; + // ReSharper restore RedundantAssignment + if (roleID != -1) + { + RoleInfo enrollRoleInfo = default(RoleInfo); + RoleController enrollRoleCntrl = new RoleController(); + enrollRoleInfo = enrollRoleCntrl.GetRole(roleID, portalId); + roleName = enrollRoleInfo.RoleName; + return PortalSecurity.IsInRole(roleName); + } + } + catch + { + } + return false; + } + + + } + + #endregion + + #region EventPPErrorLogController Class + + public class EventPpErrorLogController + { + public EventPpErrorLogInfo EventsPpErrorLogAdd(EventPpErrorLogInfo objEventPpErrorLog) + { + return ((EventPpErrorLogInfo)(CBO.FillObject(DataProvider.Instance().EventsPpErrorLogAdd(objEventPpErrorLog.SignupID, objEventPpErrorLog.PayPalStatus, objEventPpErrorLog.PayPalReason, objEventPpErrorLog.PayPalTransID, objEventPpErrorLog.PayPalPayerID, objEventPpErrorLog.PayPalPayerStatus, objEventPpErrorLog.PayPalRecieverEmail, objEventPpErrorLog.PayPalUserEmail, objEventPpErrorLog.PayPalPayerEmail, objEventPpErrorLog.PayPalFirstName, objEventPpErrorLog.PayPalLastName, objEventPpErrorLog.PayPalAddress, objEventPpErrorLog.PayPalCity, objEventPpErrorLog.PayPalState, objEventPpErrorLog.PayPalZip, objEventPpErrorLog.PayPalCountry, objEventPpErrorLog.PayPalCurrency, objEventPpErrorLog.PayPalPaymentDate, objEventPpErrorLog.PayPalAmount, objEventPpErrorLog.PayPalFee), typeof(EventPpErrorLogInfo)))); + } + + } + #endregion + + #region EventCategoryController Class + public class EventCategoryController + { + public void EventsCategoryDelete(int category, int portalID) + { + DataProvider.Instance().EventsCategoryDelete(category, portalID); + } + + public EventCategoryInfo EventCategoryGet(int category, int portalID) + { + return ((EventCategoryInfo)(CBO.FillObject(DataProvider.Instance().EventsCategoryGet(category, portalID), typeof(EventCategoryInfo)))); + } + + public EventCategoryInfo EventCategoryGetByName(string categoryName, int portalID) + { + return ((EventCategoryInfo)(CBO.FillObject(DataProvider.Instance().EventsCategoryGetByName(categoryName, portalID), typeof(EventCategoryInfo)))); + } + + public ArrayList EventsCategoryList(int portalID) + { + return CBO.FillCollection(DataProvider.Instance().EventsCategoryList(portalID), typeof(EventCategoryInfo)); + } + + public EventCategoryInfo EventsCategorySave(EventCategoryInfo objEventCategory) + { + return ((EventCategoryInfo)(CBO.FillObject(DataProvider.Instance().EventsCategorySave(objEventCategory.PortalID, objEventCategory.Category, objEventCategory.CategoryName, objEventCategory.Color, objEventCategory.FontColor), typeof(EventCategoryInfo)))); + } + } + #endregion + + #region EventLocationController Class + public class EventLocationController + { + public void EventsLocationDelete(int location, int portalID) + { + DataProvider.Instance().EventsLocationDelete(location, portalID); + } + + public EventLocationInfo EventsLocationGet(int location, int portalID) + { + return ((EventLocationInfo)(CBO.FillObject(DataProvider.Instance().EventsLocationGet(location, portalID), typeof(EventLocationInfo)))); + } + + public EventLocationInfo EventsLocationGetByName(string locationName, int portalID) + { + return ((EventLocationInfo)(CBO.FillObject(DataProvider.Instance().EventsLocationGetByName(locationName, portalID), typeof(EventLocationInfo)))); + } + + public ArrayList EventsLocationList(int portalID) + { + return CBO.FillCollection(DataProvider.Instance().EventsLocationList(portalID), typeof(EventLocationInfo)); + } + + public EventLocationInfo EventsLocationSave(EventLocationInfo objEventLocation) + { + return ((EventLocationInfo)(CBO.FillObject(DataProvider.Instance().EventsLocationSave(objEventLocation.PortalID, objEventLocation.Location, objEventLocation.LocationName, objEventLocation.MapURL, objEventLocation.Street, objEventLocation.PostalCode, objEventLocation.City, objEventLocation.Region, objEventLocation.Country), typeof(EventLocationInfo)))); + } + } + #endregion + + #region EventNotificationController Class + public class EventNotificationController + { + public void EventsNotificationTimeChange(int eventID, DateTime eventTimeBegin, int moduleID) + { + DataProvider.Instance().EventsNotificationTimeChange(eventID, eventTimeBegin, moduleID); + } + + public void EventsNotificationDelete(DateTime deleteDate) + { + DataProvider.Instance().EventsNotificationDelete(deleteDate); + } + + public EventNotificationInfo EventsNotificationGet(int eventID, string userEmail, int moduleID) + { + return ((EventNotificationInfo)(CBO.FillObject(DataProvider.Instance().EventsNotificationGet(eventID, userEmail, moduleID), typeof(EventNotificationInfo)))); + } + + public ArrayList EventsNotificationsToSend(DateTime notifyTime) + { + return CBO.FillCollection(DataProvider.Instance().EventsNotificationsToSend(notifyTime), typeof(EventNotificationInfo)); + } + + public EventNotificationInfo EventsNotificationSave(EventNotificationInfo objEventNotification) + { + return ((EventNotificationInfo)(CBO.FillObject(DataProvider.Instance().EventsNotificationSave(objEventNotification.NotificationID, objEventNotification.EventID, objEventNotification.PortalAliasID, objEventNotification.UserEmail, objEventNotification.NotificationSent, objEventNotification.NotifyByDateTime, objEventNotification.EventTimeBegin, objEventNotification.NotifyLanguage, objEventNotification.ModuleID, objEventNotification.TabID), typeof(EventNotificationInfo)))); + } + + public string NotifyInfo(int itemID, string email, int moduleID, string localResourceFile, string displayTimeZoneId) + { + string notiinfo = ""; + EventNotificationInfo objEventNotification = default(EventNotificationInfo); + objEventNotification = EventsNotificationGet(itemID, email, moduleID); + if (!ReferenceEquals(objEventNotification, null)) + { + EventTimeZoneUtilities objEventTimeZoneUtilities = new EventTimeZoneUtilities(); + DateTime notifyDisplay = objEventTimeZoneUtilities.ConvertFromUTCToDisplayTimeZone(objEventNotification.NotifyByDateTime, displayTimeZoneId).EventDate; + notiinfo = string.Format(Localization.GetString("lblReminderConfirmation", localResourceFile), notifyDisplay.ToString()); + } + return notiinfo; + } + + // Creates Event Schedule (if Not already installed) + public void InstallEventSchedule() + { + Services.Scheduling.ScheduleItem objScheduleItem = default(Services.Scheduling.ScheduleItem); + objScheduleItem = Services.Scheduling.SchedulingProvider.Instance().GetSchedule("DotNetNuke.Modules.Events.EventNotification, DotNetNuke.Modules.Events", null); + if (ReferenceEquals(objScheduleItem, null)) + { + objScheduleItem = new Services.Scheduling.ScheduleItem(); + objScheduleItem.TypeFullName = "DotNetNuke.Modules.Events.EventNotification, DotNetNuke.Modules.Events"; + objScheduleItem.TimeLapse = 1; + objScheduleItem.TimeLapseMeasurement = "h"; + objScheduleItem.RetryTimeLapse = 30; + objScheduleItem.RetryTimeLapseMeasurement = "m"; + objScheduleItem.RetainHistoryNum = 10; + objScheduleItem.Enabled = true; + objScheduleItem.ObjectDependencies = ""; + objScheduleItem.FriendlyName = "DNN Events"; + Services.Scheduling.SchedulingProvider.Instance().AddSchedule(objScheduleItem); + } + else + { + objScheduleItem.FriendlyName = "DNN Events"; + Services.Scheduling.SchedulingProvider.Instance().UpdateSchedule(objScheduleItem); + } + } + + } + #endregion + + + + #region EventRecurMasterController Class + + public class EventRecurMasterController + { + public void EventsRecurMasterDelete(int recurMasterID, int moduleID) + { + + // Delete ContentItems for the Events + EventController objCtlEvent = new EventController(); + ArrayList lstEvents = objCtlEvent.EventsGetRecurrences(recurMasterID, moduleID); + // Dim cntTaxonomy As New Content + Journal cntJournal = new Journal(); + foreach (EventInfo objEvent in lstEvents) + { + // cntTaxonomy.DeleteContentItem(objEvent.ContentItemID) + if (objEvent.JournalItem) + { + cntJournal.DeleteEvent(objEvent); + } + } + + // Delete ContentItem for recurmaster + // Dim objCtlEventRecurMaster As New EventRecurMasterController + // Dim objEventRecurMaster As EventRecurMasterInfo = objCtlEventRecurMaster.EventsRecurMasterGet(RecurMasterID, ModuleID) + // If Not objEventRecurMaster Is Nothing Then + // cntTaxonomy.DeleteContentItem(objEventRecurMaster.ContentItemID) + // End If + + // Delete recurmaster + DataProvider.Instance().EventsRecurMasterDelete(recurMasterID, moduleID); + } + + public EventRecurMasterInfo EventsRecurMasterGet(int recurMasterID, int moduleID) + { + return ((EventRecurMasterInfo)(CBO.FillObject( + DataProvider + .Instance().EventsRecurMasterGet(recurMasterID, moduleID), + typeof(EventRecurMasterInfo)))); + } + + public EventRecurMasterInfo EventsRecurMasterSave(EventRecurMasterInfo objEventRecurMaster, int tabId, + bool updateContent) + { + // Dim cntTaxonomy As New Content + // If UpdateContent Then + // If Not objEventRecurMaster.ContentItemID = Nothing And objEventRecurMaster.ContentItemID <> 0 Then + // cntTaxonomy.UpdateContentEventRecurMaster(objEventRecurMaster) + // End If + // End If + + EventRecurMasterInfo objEventRecurMasterOut = EventsRecurMasterSave(objEventRecurMaster); + + // If UpdateContent And objEventRecurMaster.RecurMasterID = -1 Then + // If objEventRecurMasterOut.ContentItemID = 0 And Not TabId = Nothing Then + // objEventRecurMasterOut.ContentItemID = cntTaxonomy.CreateContentEventRecurMaster(objEventRecurMasterOut, TabId).ContentItemId + // EventsRecurMasterSave(objEventRecurMasterOut) + // End If + // End If + + return objEventRecurMasterOut; + + } + + + public EventRecurMasterInfo EventsRecurMasterSave(EventRecurMasterInfo objEventRecurMaster) + { + return ((EventRecurMasterInfo)(CBO.FillObject( + DataProvider + .Instance().EventsRecurMasterSave( + objEventRecurMaster.RecurMasterID, + objEventRecurMaster.ModuleID, objEventRecurMaster.PortalID, + objEventRecurMaster.RRULE, objEventRecurMaster.Dtstart, + objEventRecurMaster.Duration, objEventRecurMaster.Until, + objEventRecurMaster.EventName, + objEventRecurMaster.EventDesc, + (System.Int32)objEventRecurMaster.Importance, + objEventRecurMaster.Notify, objEventRecurMaster.Approved, + objEventRecurMaster.Signups, + objEventRecurMaster.MaxEnrollment, + objEventRecurMaster.EnrollRoleID, + objEventRecurMaster.EnrollFee, + objEventRecurMaster.EnrollType, + objEventRecurMaster.PayPalAccount, + objEventRecurMaster.DetailPage, + objEventRecurMaster.DetailNewWin, + objEventRecurMaster.DetailURL, + objEventRecurMaster.ImageURL, + objEventRecurMaster.ImageType, + objEventRecurMaster.ImageWidth, + objEventRecurMaster.ImageHeight, + objEventRecurMaster.ImageDisplay, + objEventRecurMaster.Location, objEventRecurMaster.Category, + objEventRecurMaster.Reminder, + objEventRecurMaster.SendReminder, + objEventRecurMaster.ReminderTime, + objEventRecurMaster.ReminderTimeMeasurement, + objEventRecurMaster.ReminderFrom, + objEventRecurMaster.CustomField1, + objEventRecurMaster.CustomField2, + objEventRecurMaster.EnrollListView, + objEventRecurMaster.DisplayEndDate, + objEventRecurMaster.AllDayEvent, + objEventRecurMaster.CultureName, + objEventRecurMaster.OwnerID, + objEventRecurMaster.CreatedByID, + objEventRecurMaster.UpdatedByID, + objEventRecurMaster.EventTimeZoneId, + objEventRecurMaster.AllowAnonEnroll, + objEventRecurMaster.ContentItemID, + objEventRecurMaster.SocialGroupID, + objEventRecurMaster.SocialUserID, + objEventRecurMaster.Summary), + typeof(EventRecurMasterInfo)))); + } + + public ArrayList EventsRecurMasterModerate(int moduleID, int socialGroupId) + { + return CBO.FillCollection(DataProvider.Instance().EventsRecurMasterModerate(moduleID, socialGroupId), + typeof(EventRecurMasterInfo)); + } + + public EventRRULEInfo DecomposeRRULE(string strRRULE, DateTime dtStart) + { + EventRRULEInfo objEventRRULE = new EventRRULEInfo(); + int intEqual = 0; + int intKeyEnd = 0; + string strKey = ""; + string strValue = ""; + strRRULE = strRRULE + ";"; + objEventRRULE.FreqBasic = false; + while (strRRULE.Length > 1) + { + intEqual = strRRULE.IndexOf("=") + 1; + intKeyEnd = strRRULE.IndexOf(";") + 1; + strKey = strRRULE.Substring(0, intEqual - 1); + strValue = strRRULE.Substring(intEqual + 1 - 1, intKeyEnd - intEqual - 1); + switch (strKey) + { + case "FREQ": + objEventRRULE.Freq = strValue; + break; + case "WKST": + objEventRRULE.Wkst = strValue; + break; + case "INTERVAL": + objEventRRULE.Interval = int.Parse(strValue); + break; + case "BYDAY": + objEventRRULE.ByDay = strValue; + if (Information.IsNumeric(strValue.Substring(0, 2))) + { + if (strValue.IndexOf("SU") + 1 > 0) + { + objEventRRULE.Su = true; + objEventRRULE.SuNo = int.Parse(strValue.Substring(0, 2)); + } + if (strValue.IndexOf("MO") + 1 > 0) + { + objEventRRULE.Mo = true; + objEventRRULE.MoNo = int.Parse(strValue.Substring(0, 2)); + } + if (strValue.IndexOf("TU") + 1 > 0) + { + objEventRRULE.Tu = true; + objEventRRULE.TuNo = int.Parse(strValue.Substring(0, 2)); + } + if (strValue.IndexOf("WE") + 1 > 0) + { + objEventRRULE.We = true; + objEventRRULE.WeNo = int.Parse(strValue.Substring(0, 2)); + } + if (strValue.IndexOf("TH") + 1 > 0) + { + objEventRRULE.Th = true; + objEventRRULE.ThNo = int.Parse(strValue.Substring(0, 2)); + } + if (strValue.IndexOf("FR") + 1 > 0) + { + objEventRRULE.Fr = true; + objEventRRULE.FrNo = int.Parse(strValue.Substring(0, 2)); + } + if (strValue.IndexOf("SA") + 1 > 0) + { + objEventRRULE.Sa = true; + objEventRRULE.SaNo = int.Parse(strValue.Substring(0, 2)); + } + } + else + { + if (strValue.IndexOf("SU") + 1 > 0) + { + objEventRRULE.Su = true; + objEventRRULE.SuNo = 0; + } + if (strValue.IndexOf("MO") + 1 > 0) + { + objEventRRULE.Mo = true; + objEventRRULE.MoNo = 0; + } + if (strValue.IndexOf("TU") + 1 > 0) + { + objEventRRULE.Tu = true; + objEventRRULE.TuNo = 0; + } + if (strValue.IndexOf("WE") + 1 > 0) + { + objEventRRULE.We = true; + objEventRRULE.WeNo = 0; + } + if (strValue.IndexOf("TH") + 1 > 0) + { + objEventRRULE.Th = true; + objEventRRULE.ThNo = 0; + } + if (strValue.IndexOf("FR") + 1 > 0) + { + objEventRRULE.Fr = true; + objEventRRULE.FrNo = 0; + } + if (strValue.IndexOf("SA") + 1 > 0) + { + objEventRRULE.Sa = true; + objEventRRULE.SaNo = 0; + } + } + break; + case "BYMONTH": + objEventRRULE.ByMonth = int.Parse(strValue); + break; + case "BYMONTHDAY": + objEventRRULE.ByMonthDay = int.Parse(strValue); + break; + } + strRRULE = strRRULE.Substring(intKeyEnd + 1 - 1); + } + switch (objEventRRULE.Freq) + { + case "YEARLY": + if (objEventRRULE.ByMonth == 0 & objEventRRULE.ByMonthDay == 0) + { + objEventRRULE.FreqBasic = true; + } + if (objEventRRULE.ByMonth == 0) + { + objEventRRULE.ByMonth = dtStart.Month; + } + if (objEventRRULE.ByMonthDay == 0) + { + objEventRRULE.ByMonthDay = dtStart.Day; + } + break; + case "MONTHLY": + if (objEventRRULE.ByMonthDay == 0 && ReferenceEquals(objEventRRULE.ByDay, null)) + { + objEventRRULE.ByMonthDay = dtStart.Day; + objEventRRULE.FreqBasic = true; + } + break; + case "WEEKLY": + if (ReferenceEquals(objEventRRULE.ByDay, null)) + { + objEventRRULE.FreqBasic = true; + DayOfWeek dtdow = dtStart.DayOfWeek; + switch (dtdow) + { + case DayOfWeek.Sunday: + objEventRRULE.Su = true; + objEventRRULE.SuNo = 0; + objEventRRULE.ByDay = "SU"; + break; + case DayOfWeek.Monday: + objEventRRULE.Mo = true; + objEventRRULE.MoNo = 0; + objEventRRULE.ByDay = "MO"; + break; + case DayOfWeek.Tuesday: + objEventRRULE.Tu = true; + objEventRRULE.TuNo = 0; + objEventRRULE.ByDay = "TU"; + break; + case DayOfWeek.Wednesday: + objEventRRULE.We = true; + objEventRRULE.WeNo = 0; + objEventRRULE.ByDay = "WE"; + break; + case DayOfWeek.Thursday: + objEventRRULE.Th = true; + objEventRRULE.ThNo = 0; + objEventRRULE.ByDay = "TH"; + break; + case DayOfWeek.Friday: + objEventRRULE.Fr = true; + objEventRRULE.FrNo = 0; + objEventRRULE.ByDay = "FR"; + break; + case DayOfWeek.Saturday: + objEventRRULE.Sa = true; + objEventRRULE.SaNo = 0; + objEventRRULE.ByDay = "SA"; + break; + } + } + break; + } + return objEventRRULE; + } + + public ArrayList CreateEventRecurrences(EventRecurMasterInfo objEventRecurMaster, int intDuration, + string maxRecurrences) + { + DateTime dtStart = objEventRecurMaster.Dtstart; + EventRecurMasterController objCtlEventRecurMaster = new EventRecurMasterController(); + EventRRULEInfo objEventRRULE = + objCtlEventRecurMaster.DecomposeRRULE(objEventRecurMaster.RRULE, objEventRecurMaster.Dtstart); + ArrayList lstEvents = new ArrayList(); + DateTime nextDate = dtStart.Date; + bool blAddDate = true; + while (nextDate <= objEventRecurMaster.Until) + { + if (objEventRRULE.ByMonth != 0 & nextDate.Month != objEventRRULE.ByMonth) + { + blAddDate = false; + } + if (objEventRRULE.ByMonthDay != 0 & nextDate.Day != objEventRRULE.ByMonthDay) + { + blAddDate = false; + } + if (!ReferenceEquals(objEventRRULE.ByDay, null)) + { + DayOfWeek dtdow = nextDate.DayOfWeek; + switch (dtdow) + { + case DayOfWeek.Sunday: + blAddDate = CheckWeekday(nextDate, objEventRRULE.Su, objEventRRULE.SuNo, blAddDate); + break; + case DayOfWeek.Monday: + blAddDate = CheckWeekday(nextDate, objEventRRULE.Mo, objEventRRULE.MoNo, blAddDate); + break; + case DayOfWeek.Tuesday: + blAddDate = CheckWeekday(nextDate, objEventRRULE.Tu, objEventRRULE.TuNo, blAddDate); + break; + case DayOfWeek.Wednesday: + blAddDate = CheckWeekday(nextDate, objEventRRULE.We, objEventRRULE.WeNo, blAddDate); + break; + case DayOfWeek.Thursday: + blAddDate = CheckWeekday(nextDate, objEventRRULE.Th, objEventRRULE.ThNo, blAddDate); + break; + case DayOfWeek.Friday: + blAddDate = CheckWeekday(nextDate, objEventRRULE.Fr, objEventRRULE.FrNo, blAddDate); + break; + case DayOfWeek.Saturday: + blAddDate = CheckWeekday(nextDate, objEventRRULE.Sa, objEventRRULE.SaNo, blAddDate); + break; + } + } + + if (blAddDate == true) + { + switch (objEventRRULE.Freq) + { + case "YEARLY": + int intYear = (int)(DateAndTime.DateDiff(DateInterval.Year, dtStart.Date, nextDate)); + // ReSharper disable CompareOfFloatsByEqualityOperator + if ((double)intYear / objEventRRULE.Interval != + System.Convert.ToInt32((double)intYear / objEventRRULE.Interval)) + { + // ReSharper restore CompareOfFloatsByEqualityOperator + blAddDate = false; + } + break; + case "MONTHLY": + int intMonth = (int)(DateAndTime.DateDiff(DateInterval.Month, dtStart.Date, nextDate)); + // ReSharper disable CompareOfFloatsByEqualityOperator + if ((double)intMonth / objEventRRULE.Interval != + System.Convert.ToInt32((double)intMonth / objEventRRULE.Interval)) + { + // ReSharper restore CompareOfFloatsByEqualityOperator + blAddDate = false; + } + break; + case "WEEKLY": + Microsoft.VisualBasic.FirstDayOfWeek fdow = default(Microsoft.VisualBasic.FirstDayOfWeek); + if (objEventRRULE.Wkst == "SU") + { + fdow = Microsoft.VisualBasic.FirstDayOfWeek.Sunday; + } + else + { + fdow = Microsoft.VisualBasic.FirstDayOfWeek.Monday; + } + int intWeek = + (int)(DateAndTime.DateDiff(DateInterval.WeekOfYear, dtStart.Date, nextDate, fdow)); + // ReSharper disable CompareOfFloatsByEqualityOperator + if ((double)intWeek / objEventRRULE.Interval != + System.Convert.ToInt32((double)intWeek / objEventRRULE.Interval)) + { + // ReSharper restore CompareOfFloatsByEqualityOperator + blAddDate = false; + } + break; + case "DAILY": + int intDay = (int)(DateAndTime.DateDiff(DateInterval.Day, dtStart.Date, nextDate)); + // ReSharper disable CompareOfFloatsByEqualityOperator + if ((double)intDay / objEventRRULE.Interval != + System.Convert.ToInt32((double)intDay / objEventRRULE.Interval)) + { + // ReSharper restore CompareOfFloatsByEqualityOperator + blAddDate = false; + } + break; + } + } + if (blAddDate == true) + { + EventInfo objEvent = new EventInfo(); + objEvent.EventTimeBegin = nextDate.Date + dtStart.TimeOfDay; + objEvent.Duration = intDuration; + objEvent.OriginalDateBegin = nextDate.Date; + var with_1 = objEventRecurMaster; + objEvent.EventID = -1; + objEvent.RecurMasterID = with_1.RecurMasterID; + objEvent.ModuleID = with_1.ModuleID; + objEvent.PortalID = with_1.PortalID; + objEvent.EventName = with_1.EventName; + objEvent.EventDesc = with_1.EventDesc; + objEvent.Importance = (EventInfo.Priority)with_1.Importance; + objEvent.Notify = with_1.Notify; + objEvent.Approved = with_1.Approved; + objEvent.Signups = with_1.Signups; + objEvent.AllowAnonEnroll = with_1.AllowAnonEnroll; + objEvent.JournalItem = with_1.JournalItem; + objEvent.MaxEnrollment = with_1.MaxEnrollment; + objEvent.EnrollRoleID = with_1.EnrollRoleID; + objEvent.EnrollFee = with_1.EnrollFee; + objEvent.EnrollType = with_1.EnrollType; + objEvent.PayPalAccount = with_1.PayPalAccount; + objEvent.DetailPage = with_1.DetailPage; + objEvent.DetailNewWin = with_1.DetailNewWin; + objEvent.DetailURL = with_1.DetailURL; + objEvent.ImageURL = with_1.ImageURL; + objEvent.ImageType = with_1.ImageType; + objEvent.ImageWidth = with_1.ImageWidth; + objEvent.ImageHeight = with_1.ImageHeight; + objEvent.ImageDisplay = with_1.ImageDisplay; + objEvent.Location = with_1.Location; + objEvent.Category = with_1.Category; + objEvent.Reminder = with_1.Reminder; + objEvent.SendReminder = with_1.SendReminder; + objEvent.ReminderTime = with_1.ReminderTime; + objEvent.ReminderTimeMeasurement = with_1.ReminderTimeMeasurement; + objEvent.ReminderFrom = with_1.ReminderFrom; + objEvent.CustomField1 = with_1.CustomField1; + objEvent.CustomField2 = with_1.CustomField2; + objEvent.EnrollListView = with_1.EnrollListView; + objEvent.DisplayEndDate = with_1.DisplayEndDate; + objEvent.AllDayEvent = with_1.AllDayEvent; + objEvent.OwnerID = with_1.OwnerID; + objEvent.CreatedByID = with_1.CreatedByID; + objEvent.LastUpdatedID = with_1.UpdatedByID; + objEvent.Cancelled = false; + objEvent.SearchSubmitted = false; + objEvent.NewEventEmailSent = objEvent.Approved; + objEvent.SocialGroupId = with_1.SocialGroupID; + objEvent.SocialUserId = with_1.SocialUserID; + objEvent.Summary = with_1.Summary; + objEvent.UpdateStatus = "Add"; + lstEvents.Add(objEvent); + if (maxRecurrences != "") + { + if (lstEvents.Count == int.Parse(maxRecurrences)) + { + objEventRecurMaster.Until = objEvent.EventTimeBegin.Date; + break; + } + } + } + nextDate = DateAndTime.DateAdd(DateInterval.Day, 1, nextDate); + blAddDate = true; + } + return lstEvents; + } + + private bool CheckWeekday(DateTime dtDate, bool blDay, int intDayNo, bool blAddDate) + { + if (blAddDate == false) + { + return false; + } + + if (!blDay) + { + return false; + } + + if (ReferenceEquals(intDayNo, null) || intDayNo == 0) + { + return true; + } + + if (intDayNo > 0) + { + // ReSharper disable CompareOfFloatsByEqualityOperator + if (Conversion.Int((double)(dtDate.Day - 1) / 7) == intDayNo - 1) + { + // ReSharper restore CompareOfFloatsByEqualityOperator + return true; + } + } + else + { + int intDaysInMonth = 0; + intDaysInMonth = DateTime.DaysInMonth(dtDate.Year, dtDate.Month); + // ReSharper disable CompareOfFloatsByEqualityOperator + if (Conversion.Int((double)(intDaysInMonth - dtDate.Day) / 7) == (intDayNo * -1) - 1) + { + // ReSharper restore CompareOfFloatsByEqualityOperator + return true; + } + } + + return false; + + } + + public string RepeatType(EventRRULEInfo objEventRRULE) + { + string strRepeatType = "N"; + switch (objEventRRULE.Freq) + { + case "DAILY": + strRepeatType = "P1"; + break; + case "WEEKLY": + if (objEventRRULE.FreqBasic) + { + strRepeatType = "P1"; + } + else + { + strRepeatType = "W1"; + } + break; + case "MONTHLY": + if (objEventRRULE.FreqBasic) + { + strRepeatType = "P1"; + } + else if (!ReferenceEquals(objEventRRULE.ByDay, null)) + { + strRepeatType = "M1"; + } + else + { + strRepeatType = "M2"; + } + break; + case "YEARLY": + if (objEventRRULE.FreqBasic) + { + strRepeatType = "P1"; + } + else + { + strRepeatType = "Y1"; + } + break; + } + return strRepeatType; + } + + public string RecurrenceText(EventRRULEInfo objEventRRULE, string localResourceFile, CultureInfo culture, + DateTime eventDateBegin) + { + string lblEventText = ""; + string strRepeatType = RepeatType(objEventRRULE); + switch (strRepeatType) + { + case "N": + lblEventText = Localization.GetString("OneTimeEvent", localResourceFile); + break; + case "P1": + string txtEvent = ""; + switch (objEventRRULE.Freq.Substring(0, 1).Trim()) + { + case "D": + txtEvent = Localization.GetString("EveryXDays", localResourceFile); + break; + case "W": + txtEvent = Localization.GetString("EveryXWeeks", localResourceFile); + break; + case "M": + txtEvent = Localization.GetString("EveryXMonths", localResourceFile); + break; + case "Y": + txtEvent = Localization.GetString("EveryXYears", localResourceFile); + break; + } + lblEventText = string.Format(txtEvent, objEventRRULE.Interval.ToString()); + break; + case "W1": + string txtdays = ""; + if (objEventRRULE.Su) + { + txtdays += culture.DateTimeFormat.DayNames[(int)DayOfWeek.Sunday]; + } + if (objEventRRULE.Mo) + { + if (txtdays.Trim().Length > 0) + { + txtdays += ", "; + } + txtdays += culture.DateTimeFormat.DayNames[(int)DayOfWeek.Monday]; + } + if (objEventRRULE.Tu) + { + if (txtdays.Trim().Length > 0) + { + txtdays += ", "; + } + txtdays += culture.DateTimeFormat.DayNames[(int)DayOfWeek.Tuesday]; + } + if (objEventRRULE.We) + { + if (txtdays.Trim().Length > 0) + { + txtdays += ", "; + } + txtdays += culture.DateTimeFormat.DayNames[(int)DayOfWeek.Wednesday]; + } + if (objEventRRULE.Th) + { + if (txtdays.Trim().Length > 0) + { + txtdays += ", "; + } + txtdays += culture.DateTimeFormat.DayNames[(int)DayOfWeek.Thursday]; + } + if (objEventRRULE.Fr) + { + if (txtdays.Trim().Length > 0) + { + txtdays += ", "; + } + txtdays += culture.DateTimeFormat.DayNames[(int)DayOfWeek.Friday]; + } + if (objEventRRULE.Sa) + { + if (txtdays.Trim().Length > 0) + { + txtdays += ", "; + } + txtdays += culture.DateTimeFormat.DayNames[(int)DayOfWeek.Saturday]; + } + lblEventText = string.Format(Localization.GetString("RecurringWeeksOn", localResourceFile), + objEventRRULE.Interval.ToString(), txtdays); + break; + case "M1": + string txtDay = ""; + string txtWeek = ""; + int intEvery = 0; + if (objEventRRULE.Su) + { + txtDay = culture.DateTimeFormat.DayNames[(int)DayOfWeek.Sunday]; + intEvery = objEventRRULE.SuNo; + } + if (objEventRRULE.Mo) + { + txtDay = culture.DateTimeFormat.DayNames[(int)DayOfWeek.Monday]; + intEvery = objEventRRULE.MoNo; + } + if (objEventRRULE.Tu) + { + txtDay = culture.DateTimeFormat.DayNames[(int)DayOfWeek.Tuesday]; + intEvery = objEventRRULE.TuNo; + } + if (objEventRRULE.We) + { + txtDay = culture.DateTimeFormat.DayNames[(int)DayOfWeek.Wednesday]; + intEvery = objEventRRULE.WeNo; + } + if (objEventRRULE.Th) + { + txtDay = culture.DateTimeFormat.DayNames[(int)DayOfWeek.Thursday]; + intEvery = objEventRRULE.ThNo; + } + if (objEventRRULE.Fr) + { + txtDay = culture.DateTimeFormat.DayNames[(int)DayOfWeek.Friday]; + intEvery = objEventRRULE.FrNo; + } + if (objEventRRULE.Sa) + { + txtDay = culture.DateTimeFormat.DayNames[(int)DayOfWeek.Saturday]; + intEvery = objEventRRULE.SaNo; + } + switch (Strings.Trim(System.Convert.ToString(intEvery))) + { + case "1": + txtWeek = Localization.GetString("First", localResourceFile); + break; + case "2": + txtWeek = Localization.GetString("Second", localResourceFile); + break; + case "3": + txtWeek = Localization.GetString("Third", localResourceFile); + break; + case "4": + txtWeek = Localization.GetString("Fourth", localResourceFile); + break; + case "-1": + txtWeek = Localization.GetString("Last", localResourceFile); + break; + } + if (objEventRRULE.Interval == 1) + { + lblEventText = string.Format(Localization.GetString("RecurringInMonth", localResourceFile), + txtWeek, txtDay); + } + else + { + lblEventText = string.Format(Localization.GetString("RecurringEveryMonth2", localResourceFile), + objEventRRULE.Interval.ToString().Trim(), txtWeek, txtDay); + } + break; + case "M2": + lblEventText = string.Format(Localization.GetString("RecurringEveryMonth", localResourceFile), + objEventRRULE.Interval.ToString().Trim(), + Localization.GetString( + System.Convert.ToString(objEventRRULE.ByMonthDay), + localResourceFile)); + break; + case "Y1": + lblEventText = string.Format(Localization.GetString("RecurringYearsOn", localResourceFile), + eventDateBegin); + break; + + } + return lblEventText; + } + + public string RecurrenceInfo(EventInfo objEvent, string localResourceFile) + { + string recinfo = ""; + recinfo = string.Format(Localization.GetString("RecurringUntil", localResourceFile), + objEvent.LastRecurrence.ToString("d"), objEvent.NoOfRecurrences.ToString()); + return recinfo; + } + + } + + #endregion + + #region EventSubscriptionController Class + public class EventSubscriptionController + { + public void EventsSubscriptionDeleteUser(int userID, int moduleID) + { + DataProvider.Instance().EventsSubscriptionDeleteUser(userID, moduleID); + } + + public EventSubscriptionInfo EventsSubscriptionGetUser(int userID, int moduleID) + { + return ((EventSubscriptionInfo)(CBO.FillObject(DataProvider.Instance().EventsSubscriptionGetUser(userID, moduleID), typeof(EventSubscriptionInfo)))); + } + + public ArrayList EventsSubscriptionGetModule(int moduleID) + { + return CBO.FillCollection(DataProvider.Instance().EventsSubscriptionGetModule(moduleID), typeof(EventSubscriptionInfo)); + } + + public ArrayList EventsSubscriptionGetSubModule(int moduleID) + { + return CBO.FillCollection(DataProvider.Instance().EventsSubscriptionGetSubModule(moduleID), typeof(EventSubscriptionInfo)); + } + + public EventSubscriptionInfo EventsSubscriptionSave(EventSubscriptionInfo objEventSubscription) + { + return ((EventSubscriptionInfo)(CBO.FillObject(DataProvider.Instance().EventsSubscriptionSave(objEventSubscription.SubscriptionID, objEventSubscription.ModuleID, objEventSubscription.PortalID, objEventSubscription.UserID), typeof(EventSubscriptionInfo)))); + } + } + #endregion + + #region EventEmails Class + public class EventEmails + { + #region Member Variables + private string _localResourceFile; + private string _cultureName; + private int _moduleId; + private int _portalId; + private CultureInfo _currculture; + #endregion + + #region Constructor + public EventEmails(int portalID, int moduleID, string localResourceFile) + { + this.PortalID = portalID; + this.ModuleID = moduleID; + this.LocalResourceFile = localResourceFile; + } + public EventEmails(int portalID, int moduleID, string localResourceFile, string cultureName) + { + this.PortalID = portalID; + this.ModuleID = moduleID; + this.LocalResourceFile = localResourceFile; + this.CultureName = cultureName; + } + #endregion + + #region Properties + private int PortalID + { + get + { + return _portalId; + } + set + { + _portalId = value; + } + } + + private int ModuleID + { + get + { + return _moduleId; + } + set + { + _moduleId = value; + } + } + + private string LocalResourceFile + { + get + { + return _localResourceFile; + } + set + { + _localResourceFile = value; + } + } + + private string CultureName + { + get + { + return _cultureName; + } + set + { + _cultureName = value; + } + } + + #endregion + + + #region Methods + public void SendEmails(EventEmailInfo objEventEmailInfo, EventInfo objEvent) + { + SendEmails(objEventEmailInfo, objEvent, null, null, null, true); + } + + public void SendEmails(EventEmailInfo objEventEmailInfo, EventInfo objEvent, EventSignupsInfo objEventSignups) + { + SendEmails(objEventEmailInfo, objEvent, objEventSignups, null, null, true); + } + + public void SendEmails(EventEmailInfo objEventEmailInfo, EventInfo objEvent, EventSignupsInfo objEventSignups, bool blTokenReplace) + { + SendEmails(objEventEmailInfo, objEvent, objEventSignups, null, null, blTokenReplace); + } + + public void SendEmails(EventEmailInfo objEventEmailInfo, EventInfo objEvent, System.Collections.Generic.List attachments) + { + SendEmails(objEventEmailInfo, objEvent, null, attachments, null, true); + } + + public void SendEmails(EventEmailInfo objEventEmailInfo, EventInfo objEvent, string domainurl) + { + SendEmails(objEventEmailInfo, objEvent, null, null, domainurl, true); + } + + public void SendEmails(EventEmailInfo objEventEmailInfo, EventInfo objEvent, EventSignupsInfo objEventSignups, System.Collections.Generic.List attachments, string domainurl, bool blTokenReplace) + { + _currculture = System.Threading.Thread.CurrentThread.CurrentCulture; + + var with_1 = objEventEmailInfo; + string userEmail = ""; + int itemNo = 0; + + EventModuleSettings ems = new EventModuleSettings(); + EventModuleSettings settings = ems.GetEventModuleSettings(ModuleID, LocalResourceFile); + EventBase objEventBase = new EventBase(); + string displayTimeZoneId = objEventBase.GetDisplayTimeZoneId(settings, objEvent.PortalID, "User"); + + foreach (string tempLoopVar_userEmail in with_1.UserEmails) + { + userEmail = tempLoopVar_userEmail; + string usedTimeZoneId = displayTimeZoneId; + if (displayTimeZoneId == "User") + { + usedTimeZoneId = with_1.UserTimeZoneIds[itemNo].ToString(); + } + SendSingleEmail(userEmail, with_1.UserLocales[itemNo], objEvent, with_1.TxtEmailSubject, with_1.TxtEmailBody, with_1.TxtEmailFrom, objEventSignups, attachments, domainurl, usedTimeZoneId, blTokenReplace); + itemNo++; + } + + int userID = 0; + foreach (int tempLoopVar_userID in with_1.UserIDs) + { + userID = tempLoopVar_userID; + UserController objCtlUser = new UserController(); + UserInfo objUser = objCtlUser.GetUser(PortalID, userID); + + if (!ReferenceEquals(objUser, null)) + { + string usedTimeZoneId = displayTimeZoneId; + if (displayTimeZoneId == "User") + { + usedTimeZoneId = objUser.Profile.PreferredTimeZone.Id; + } + SendSingleEmail(objUser.Email, objUser.Profile.PreferredLocale, objEvent, with_1.TxtEmailSubject, with_1.TxtEmailBody, with_1.TxtEmailFrom, objEventSignups, attachments, domainurl, usedTimeZoneId, blTokenReplace); + } + } + + System.Threading.Thread.CurrentThread.CurrentCulture = _currculture; + + } + + private void SendSingleEmail(string userEmail, object userLocale, EventInfo objEvent, string txtEmailSubject, string txtEmailBody, string txtEmailFrom, EventSignupsInfo objEventSignups, System.Collections.Generic.List attachments, string domainurl, string displayTimeZoneId, bool blTokenReplace) + { + TokenReplaceControllerClass tcc = default(TokenReplaceControllerClass); + string subject = ""; + string body = ""; + // ReSharper disable RedundantAssignment + string bodyformat = "html"; + // ReSharper restore RedundantAssignment + ChangeLocale(userLocale); + + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleID, null); + objEvent = objEventInfoHelper.ConvertEventToDisplayTimeZone(objEvent.Clone(), displayTimeZoneId); + EventSignupsInfo objUsedSignup = new EventSignupsInfo(); + if (!ReferenceEquals(objEventSignups, null)) + { + objUsedSignup = objEventSignups.Clone(); + EventTimeZoneUtilities objEventTimeZoneUtilities = new EventTimeZoneUtilities(); + objUsedSignup.PayPalPaymentDate = objEventTimeZoneUtilities.ConvertFromUTCToDisplayTimeZone(objUsedSignup.PayPalPaymentDate, displayTimeZoneId).EventDate; + } + + if (blTokenReplace) + { + tcc = new TokenReplaceControllerClass(ModuleID, LocalResourceFile); + subject = tcc.TokenReplaceEvent(objEvent, txtEmailSubject, objUsedSignup); + body = tcc.TokenReplaceEvent(objEvent, txtEmailBody, objUsedSignup); + } + else + { + subject = txtEmailSubject; + body = txtEmailBody; + } + body = AddHost(body, domainurl); + bodyformat = GetBodyFormat(body); + if (bodyformat == "text") + { + body = HtmlUtils.StripTags(body, true); + } + if (!ReferenceEquals(attachments, null)) + { + bool smtpEnableSsl = false; + if (Entities.Controllers.HostController.Instance.GetString("SMTPEnableSSL") == "Y") + { + smtpEnableSsl = true; + } + Mail.SendMail(txtEmailFrom, userEmail, "", "", "", MailPriority.Normal, subject, MailFormat.Html, System.Text.Encoding.UTF8, body, attachments, "", "", "", "", smtpEnableSsl); + } + else + { + Mail.SendMail(txtEmailFrom, userEmail, "", subject, body, "", bodyformat, "", "", "", ""); + } + } + + private string GetBodyFormat(string body) + { + string bodyformat = ""; + EventModuleSettings ems = new EventModuleSettings(); + EventModuleSettings settings = ems.GetEventModuleSettings(ModuleID, LocalResourceFile); + + bodyformat = settings.HTMLEmail; + if (bodyformat == "auto") + { + if (Common.Utilities.HtmlUtils.IsHtml(body)) + { + bodyformat = "html"; + } + else + { + bodyformat = "text"; + } + } + return bodyformat; + } + + private void ChangeLocale(object userLocale) + { + string strLocale = ""; + System.Threading.Thread.CurrentThread.CurrentCulture = _currculture; + if (!ReferenceEquals(userLocale, null)) + { + strLocale = userLocale.ToString(); + } + if (!ReferenceEquals(userLocale, null) && !string.IsNullOrEmpty(strLocale)) + { + CultureInfo userculture = new CultureInfo(strLocale, false); + System.Threading.Thread.CurrentThread.CurrentCulture = userculture; + } + else if (!(CultureName == null)) + { + CultureInfo userculture = new CultureInfo(CultureName, false); + System.Threading.Thread.CurrentThread.CurrentCulture = userculture; + } + + } + + private string AddHost(string content, string domainurl) + { + + if (ReferenceEquals(domainurl, null)) + { + EventInfoHelper objEventInfoHelper = new EventInfoHelper(); + domainurl = objEventInfoHelper.GetDomainURL(); + } + domainurl = DotNetNuke.Common.Globals.AddHTTP(domainurl); + + string txtContent = content; + if (domainurl != "") + { + txtContent = Strings.Replace(Expression: txtContent, Find: "src=\"/", Replacement: "src=\"" + domainurl + "/", Compare: CompareMethod.Text); + txtContent = Strings.Replace(Expression: txtContent, Find: "href=\"/", Replacement: "href=\"" + domainurl + "/", Compare: CompareMethod.Text); + } + return txtContent; + } + + #endregion + } + #endregion + + #region TimeZone Utilities Class + public class EventTimeZoneUtilities + { + public DateInfo ConvertFromUTCToDisplayTimeZone(DateTime utcDate, string displayTimeZoneId) + { + DateInfo displayInfo = new DateInfo(); + displayInfo.EventDate = utcDate; + displayInfo.EventTimeZoneId = "UTC"; + try + { + TimeZoneInfo displayTimeZone = TimeZoneInfo.FindSystemTimeZoneById(displayTimeZoneId); + displayInfo.EventTimeZoneId = displayTimeZone.Id; + displayInfo.EventDate = TimeZoneInfo.ConvertTimeFromUtc(utcDate, displayTimeZone); + } + catch (Exception) + { + return displayInfo; + } + return displayInfo; + } + + public DateInfo ConvertToDisplayTimeZone(DateTime inDate, string inTimeZoneId, int portalId, string displayTimeZoneId) + { + DateInfo displayDateInfo = new DateInfo(); + if (inTimeZoneId == displayTimeZoneId) + { + displayDateInfo.EventDate = inDate; + displayDateInfo.EventTimeZoneId = inTimeZoneId; + return displayDateInfo; + } + DateTime utcDate = inDate; + if (inTimeZoneId != "UTC") + { + utcDate = ConvertToUTCTimeZone(inDate, inTimeZoneId); + } + + displayDateInfo.EventDate = utcDate; + displayDateInfo.EventTimeZoneId = displayTimeZoneId; + if (displayTimeZoneId != "UTC") + { + displayDateInfo = ConvertFromUTCToDisplayTimeZone(utcDate, displayTimeZoneId); + } + return displayDateInfo; + } + + public DateTime ConvertToUTCTimeZone(DateTime inDate, string inTimeZoneId) + { + DateTime utcDate = default(DateTime); + try + { + TimeZoneInfo inTimeZone = TimeZoneInfo.FindSystemTimeZoneById(inTimeZoneId); + utcDate = TimeZoneInfo.ConvertTimeToUtc(inDate, inTimeZone); + } + catch (Exception) + { + return inDate; + } + return utcDate; + } + + public DateTime ConvertFromUTCToModuleTimeZone(DateTime utcDate, string moduleTimeZoneId) + { + DateTime moduleDate = default(DateTime); + try + { + TimeZoneInfo moduleTimeZone = TimeZoneInfo.FindSystemTimeZoneById(moduleTimeZoneId); + moduleDate = TimeZoneInfo.ConvertTimeFromUtc(utcDate, moduleTimeZone); + } + catch (Exception) + { + return utcDate; + } + return moduleDate; + } + + public class DateInfo + { + private DateTime _eventDate; + private string _eventTimeZoneId; + + public DateTime EventDate + { + get + { + return _eventDate; + } + set + { + _eventDate = value; + } + } + + public string EventTimeZoneId + { + get + { + return _eventTimeZoneId; + } + set + { + _eventTimeZoneId = value; + } + } + + } + } + + #endregion + +} + diff --git a/Components/EventController.vb b/Components/EventController.vb deleted file mode 100644 index 6a908dd..0000000 --- a/Components/EventController.vb +++ /dev/null @@ -1,2619 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports System -Imports DotNetNuke.Entities.Modules -Imports DotNetNuke.Entities.Modules.Definitions -Imports DotNetNuke.Entities.Tabs -Imports DotNetNuke.Security -Imports DotNetNuke.Security.Permissions -Imports DotNetNuke.Services.Mail -Imports DotNetNuke.Security.Roles -Imports DotNetNuke.Modules.Events.Components.Integration -Imports System.Globalization -Imports System.Collections - - -Namespace DotNetNuke.Modules.Events - -#Region "EventInfoHelper Class" - Public Class EventInfoHelper - Inherits PortalModuleBase -#Region "Public Functions and Methods" - - Private _lstEvents As New ArrayList - - ' public properties - Public Property LstEvents() As ArrayList - Get - Return _lstEvents - End Get - Set(ByVal value As ArrayList) - _lstEvents = value - End Set - End Property - - ' Module ID of Base Calendar (used for converting Sub-Calendar Event Time Zones) - Private _baseModuleId As Integer = 0 - Private _baseTabId As Integer = 0 - Private _basePortalId As Integer = 0 - Private _baseSettings As EventModuleSettings - Public Property BaseModuleID() As Integer - Get - Return _baseModuleId - End Get - Set(ByVal value As Integer) - _baseModuleId = value - End Set - End Property - - Public Property BaseTabID() As Integer - Get - Return _baseTabId - End Get - Set(ByVal value As Integer) - _baseTabId = value - End Set - End Property - - Public Property BasePortalID() As Integer - Get - Return _basePortalId - End Get - Set(ByVal value As Integer) - _basePortalId = value - End Set - End Property - - Public Property BaseSettings() As EventModuleSettings - Get - Return _baseSettings - End Get - Set(ByVal value As EventModuleSettings) - _baseSettings = value - End Set - End Property - - Public Sub New() - End Sub - - Public Sub New(ByVal moduleID As Integer, ByVal settings As EventModuleSettings) - BaseModuleID = moduleID - BaseSettings = settings - End Sub - - Public Sub New(ByVal moduleID As Integer, ByVal tabID As Integer, ByVal portalID As Integer, ByVal settings As EventModuleSettings) - BaseModuleID = moduleID - BaseTabID = tabID - BasePortalID = portalID - BaseSettings = settings - End Sub - - Public Function GetDetailPageRealURL(ByVal eventID As Integer, ByVal socialGroupId As Integer, ByVal socialUserId As Integer) As String - Return GetDetailPageRealURL(eventID, True, socialGroupId, socialUserId) - End Function - - Public Function GetDetailPageRealURL(ByVal eventID As Integer, ByVal blSkinContainer As Boolean, ByVal socialGroupId As Integer, ByVal socialUserId As Integer) As String - Dim url As String - If BaseSettings.eventdetailnewpage Then - If socialGroupId > 0 Then - url = NavigateURL(BaseTabID, "Details", "Mid=" & BaseModuleID.ToString, "ItemID=" & eventID.ToString(), "groupid=" & socialGroupId.ToString) - ElseIf socialUserId > 0 Then - url = NavigateURL(BaseTabID, "Details", "Mid=" & BaseModuleID.ToString, "ItemID=" & eventID.ToString(), "userid=" & socialUserId.ToString) - Else - url = NavigateURL(BaseTabID, "Details", "Mid=" & BaseModuleID.ToString, "ItemID=" & eventID.ToString()) - End If - If blSkinContainer Then - url = AddSkinContainerControls(url, "?") - End If - Else - If socialGroupId > 0 Then - url = NavigateURL(BaseTabID, "", "ModuleID=" & BaseModuleID.ToString, "ItemID=" & eventID.ToString(), "mctl=EventDetails", "groupid=" & socialGroupId.ToString) - ElseIf socialUserId > 0 Then - url = NavigateURL(BaseTabID, "", "ModuleID=" & BaseModuleID.ToString, "ItemID=" & eventID.ToString(), "mctl=EventDetails", "userid=" & socialUserId.ToString) - Else - url = NavigateURL(BaseTabID, "", "ModuleID=" & BaseModuleID.ToString, "ItemID=" & eventID.ToString(), "mctl=EventDetails") - End If - End If - If InStr(1, url, "://") = 0 Then - Dim domainurl As String = GetDomainURL() - url = AddHTTP(domainurl) & url - End If - Return url - End Function - - Public Function GetDomainURL() As String - ' Dim domainurl As String = ps.PortalAlias.HTTPAlias - Dim domainurl As String = HttpContext.Current.Request.ServerVariables("HTTP_HOST") - If domainurl Is Nothing Then - Dim ps As Entities.Portals.PortalSettings = CType(HttpContext.Current.Items("PortalSettings"), Entities.Portals.PortalSettings) - domainurl = ps.PortalAlias.HTTPAlias() - End If - If domainurl.IndexOf("/", StringComparison.Ordinal) > 0 Then - domainurl = domainurl.Substring(0, domainurl.IndexOf("/", StringComparison.Ordinal)) - End If - Return domainurl - End Function - - Public Function AddSkinContainerControls(ByVal url As String, ByVal addchar As String) As String - If Left(url, 10).ToLower = "javascript" Then - Return url - End If - - If BaseSettings.enablecontainerskin Then - Dim strFriendlyUrls As String = Entities.Controllers.HostController.Instance.GetString("UseFriendlyUrls") - If strFriendlyUrls = "N" Then - addchar = "&" - End If - Dim objCtlTab As New TabController - Dim objTabInfo As TabInfo = objCtlTab.GetTab(BaseTabID, BasePortalID, False) - Dim skinSrc As String = Nothing - If Not objTabInfo Is Nothing Then - If Not objTabInfo.SkinSrc = "" Then - skinSrc = objTabInfo.SkinSrc - If Right(skinSrc, 5) = ".ascx" Then - skinSrc = Left(skinSrc, Len(skinSrc) - 5) - End If - End If - End If - Dim objCtlModule As New ModuleController - Dim objModuleInfo As ModuleInfo = objCtlModule.GetModule(BaseModuleID, BaseTabID, False) - Dim containerSrc As String = Nothing - If Not objModuleInfo Is Nothing Then - If objModuleInfo.DisplayTitle Then - If Not objModuleInfo.ContainerSrc = "" Then - containerSrc = objModuleInfo.ContainerSrc - ElseIf Not objTabInfo.ContainerSrc = "" Then - containerSrc = objTabInfo.ContainerSrc - End If - If Not containerSrc Is Nothing Then - If Right(containerSrc, 5) = ".ascx" Then - containerSrc = Left(containerSrc, Len(containerSrc) - 5) - End If - End If - Else - containerSrc = "[G]Containers/_default/No+Container" - End If - End If - If Not containerSrc Is Nothing Then - url += addchar + "ContainerSrc=" & HttpUtility.HtmlEncode(containerSrc) - addchar = "&" - End If - If Not skinSrc Is Nothing Then - url += addchar + "SkinSrc=" & HttpUtility.HtmlEncode(skinSrc) - End If - End If - Return url - End Function - - Public Function HideFullEvent(ByVal objevent As EventInfo, ByVal blEventHideFullEnroll As Boolean, ByVal intuserid As Integer, ByVal blAuthenticated As Boolean) As Boolean - If objevent.Signups And blEventHideFullEnroll And objevent.MaxEnrollment > 0 And _ - objevent.Enrolled >= objevent.MaxEnrollment And UserId <> objevent.OwnerID And _ - intuserid <> objevent.CreatedByID And intuserid <> objevent.RMOwnerID And Not IsModerator(blAuthenticated) Then - Return True - End If - Return False - End Function - - Public Function DetailPageURL(ByVal objEvent As EventInfo) As String - Return DetailPageURL(objEvent, True) - End Function - - Public Function DetailPageURL(ByVal objEvent As EventInfo, ByVal blSkinContainer As Boolean) As String - Dim returnURL As String - If objEvent.DetailPage Then - - If objEvent.DetailURL.StartsWith("http") Then - returnURL = objEvent.DetailURL - Else - returnURL = Common.Globals.LinkClick(objEvent.DetailURL, BaseTabID, BaseModuleID, False) - End If - Else - returnURL = GetDetailPageRealURL(objEvent.EventID, blSkinContainer, objEvent.SocialGroupId, objEvent.SocialUserId) - End If - Return returnURL - - End Function - - Public Function GetModerateUrl() As String - Return NavigateURL(BaseTabID, "", "Mid=" & BaseModuleID.ToString, "mctl=EventModerate") - End Function - - Public Function GetEditURL(ByVal itemid As Integer, ByVal socialGroupId As Integer, ByVal socialUserId As Integer) As String - Return GetEditURL(itemid, socialGroupId, socialUserId, "Single") - End Function - - Public Function GetEditURL(ByVal itemid As Integer, ByVal socialGroupId As Integer, ByVal socialUserId As Integer, ByVal editRecur As String) As String - If socialGroupId > 0 Then - Return AddSkinContainerControls(EditUrl("ItemID", itemid.ToString, "Edit", "Mid=" & BaseModuleID.ToString, "EditRecur=" & editRecur, "groupid=" & socialGroupId.ToString), "?") - ElseIf socialUserId > 0 Then - Return AddSkinContainerControls(EditUrl("ItemID", itemid.ToString, "Edit", "Mid=" & BaseModuleID.ToString, "EditRecur=" & editRecur, "userid=" & socialUserId.ToString), "?") - Else - Return AddSkinContainerControls(EditUrl("ItemID", itemid.ToString, "Edit", "Mid=" & BaseModuleID.ToString, "EditRecur=" & editRecur), "?") - End If - End Function - - ' Detemines if a EventInfo ArrayList already contains the EventInfo Object - Public Function IsConflict(ByVal objEvent As EventInfo, ByVal objEvents As ArrayList, ByVal conflictDateChk As DateTime) As DateTime - Dim objEvent1 As EventInfo - Dim objEvent2 As EventInfo - Dim eventTimeBegin1, eventTimeBegin2, eventTimeEnd1, eventTimeEnd2 As Date - Dim locationConflict As Boolean = BaseSettings.locationconflict - - ' Handle Recurring Event Conflict Detection - LstEvents = New ArrayList - AddEvent(objEvent) - - 'Convert both lists to common timezone - objEvents = ConvertEventListToDisplayTimeZone(objEvents, BaseSettings.TimeZoneId) - LstEvents = ConvertEventListToDisplayTimeZone(LstEvents, BaseSettings.TimeZoneId) - - For Each objEvent1 In LstEvents - ' Take into account timezone offsets and length of event when deciding on conflicts - eventTimeBegin1 = objEvent1.EventTimeBegin - eventTimeEnd1 = objEvent1.EventTimeEnd - For Each objEvent2 In objEvents - eventTimeBegin2 = objEvent2.EventTimeBegin - eventTimeEnd2 = objEvent2.EventTimeEnd - If ((eventTimeBegin1 >= eventTimeBegin2 And eventTimeBegin1 < eventTimeEnd2) Or _ - (eventTimeBegin1 <= eventTimeBegin2 And eventTimeEnd1 > eventTimeBegin2)) _ - And (objEvent1.EventID <> objEvent2.EventID) Then - If locationConflict Then - If objEvent1.Location > 0 And objEvent1.Location = objEvent2.Location Then - Return objEvent.EventTimeBegin - End If - Else - Return objEvent.EventTimeBegin - End If - End If - Next - Next - Return conflictDateChk - End Function - - ' Get Events (including SubModule Events, including categories, including locations) - Public Function GetEvents(ByVal startDate As DateTime, ByVal endDate As DateTime, ByVal getSubEvents As Boolean, ByVal categoryIDs As ArrayList, ByVal locationIDs As ArrayList, ByVal socialGroupId As Integer, ByVal socialUserId As Integer) As ArrayList - Return GetEvents(startDate, endDate, getSubEvents, categoryIDs, locationIDs, False, socialGroupId, socialUserId) - End Function - - Public Function GetEvents(ByVal startDate As DateTime, ByVal endDate As DateTime, ByVal getSubEvents As Boolean, ByVal inCategoryIDs As ArrayList, ByVal inLocationIDs As ArrayList, ByVal isSearch As Boolean, ByVal socialGroupId As Integer, ByVal socialUserId As Integer) As ArrayList - 'Dim objEventInfoHelper As New EventInfoHelper(ModID) - Dim objCtlMasterEvent As New EventMasterController - Dim moduleIDs As String = BaseModuleID.ToString - Try - '*** See what Sub-Events/Calendars are included - If getSubEvents Then - ' Get Assigned Sub Events and Bind to Grid - Dim subEvents As ArrayList - subEvents = objCtlMasterEvent.EventsMasterAssignedModules(BaseModuleID) - If Not (subEvents Is Nothing) Then - Dim myEnumerator As IEnumerator = subEvents.GetEnumerator() - Dim objSubEvent As EventMasterInfo - While myEnumerator.MoveNext() - objSubEvent = CType(myEnumerator.Current, EventMasterInfo) - If IsModuleViewer(objSubEvent.SubEventID) Or Not BaseSettings.Enforcesubcalperms Then - moduleIDs = moduleIDs + "," + objSubEvent.SubEventID.ToString - End If - End While - End If - End If - - ' Adds Recurring Dates to EventInfo ArrayList for given Date Range - Dim objEvents As EventInfo - Dim ctrlEvent As New EventController - _lstEvents = New ArrayList - _lstEvents.Clear() - - Dim categoryIDs As String = CreateCategoryFilter(inCategoryIDs) - Dim locationIDs As String = CreateLocationFilter(inLocationIDs) - - Dim newlstEvents As New ArrayList - If BaseSettings.SocialGroupModule = EventModuleSettings.SocialModule.No Or IsSocialUserPublic(socialUserId) Or IsSocialGroupPublic(socialGroupId) Then - newlstEvents = ctrlEvent.EventsGetByRange(moduleIDs, startDate, endDate, categoryIDs, locationIDs, socialGroupId, socialUserId) - End If - - For Each objEvents In newlstEvents - ' If the module is set for private events, then obfuscate the appropriate information - objEvents.IsPrivate = False - If BaseSettings.PrivateMessage <> "" Then - If isSearch Then - objEvents.EventName = BaseSettings.PrivateMessage - objEvents.EventDesc = "" - objEvents.Summary = "" - objEvents.IsPrivate = True - ElseIf Not UserId = objEvents.OwnerID And Not IsModerator(True) Then - objEvents.EventName = BaseSettings.PrivateMessage - objEvents.EventDesc = "" - objEvents.Summary = "" - objEvents.IsPrivate = True - End If - End If - objEvents.ModuleTitle = objCtlMasterEvent.GetModuleTitle(objEvents.ModuleID) - AddEvent(objEvents) - Next - LstEvents.Sort(New EventDateSort) - - Return LstEvents - Catch ex As Exception - Return New ArrayList - End Try - End Function - - ' Get Events for a Specifc Date and returns a EventInfo ArrayList - Public Function GetDateEvents(ByVal selectedEvents As ArrayList, ByVal selectDate As Date) As ArrayList - Dim newEventEvents As New ArrayList - Dim itemid As Integer = 0 - ' Modified to account for multi-day events - If Not (selectedEvents Is Nothing) Then - For Each objEvent As EventInfo In selectedEvents - If objEvent.EventTimeBegin = selectDate Or _ - (objEvent.EventTimeBegin.Date <= selectDate.Date And _ - objEvent.EventTimeEnd.Date >= selectDate.Date) Then - If itemid <> objEvent.EventID Then - newEventEvents.Add(objEvent) - End If - itemid = objEvent.EventID - End If - Next - End If - Return newEventEvents - End Function - - Public Function CreateCategoryFilter(inCategoryIDs As ArrayList) As String - Dim restrictedCategories As New ArrayList - If BaseSettings.restrictcategories Then - If inCategoryIDs.Item(0).ToString = "-1" Then - restrictedCategories = BaseSettings.ModuleCategoryIDs - Else - For Each inCategory As Integer In inCategoryIDs - For Each category As Integer In BaseSettings.ModuleCategoryIDs - If category = inCategory Then - restrictedCategories.Add(category) - End If - Next - Next - End If - Else - restrictedCategories = inCategoryIDs - End If - - Dim categoryIDs As String = "" - ' ReSharper disable LoopCanBeConvertedToQuery - For Each category As String In restrictedCategories - ' ReSharper restore LoopCanBeConvertedToQuery - categoryIDs = categoryIDs + "," + category - Next - categoryIDs = Mid(categoryIDs, 2) - - Return categoryIDs - End Function - - Public Function CreateLocationFilter(inLocationIDs As ArrayList) As String - ' Because of method overloads without locations. - If inLocationIDs Is Nothing Then inLocationIDs = New ArrayList({"-1"}) - - Dim restrictedLocations As New ArrayList - If BaseSettings.Restrictlocations Then - If inLocationIDs.Item(0).ToString = "-1" Then - restrictedLocations = BaseSettings.ModuleLocationIDs - Else - For Each inLocation As Integer In inLocationIDs - For Each location As Integer In BaseSettings.ModuleLocationIDs - If location = inLocation Then - restrictedLocations.Add(location) - End If - Next - Next - End If - Else - restrictedLocations = inLocationIDs - End If - - Dim locationIDs As String = "" - ' ReSharper disable LoopCanBeConvertedToQuery - For Each location As String In restrictedLocations - ' ReSharper restore LoopCanBeConvertedToQuery - locationIDs = locationIDs + "," + location - Next - locationIDs = Mid(locationIDs, 2) - - Return locationIDs - End Function - - Public Function IsModuleViewer(ByVal subModuleID As Integer) As Boolean - Try - If Not PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) Then - Dim objCtlModule As New ModuleController - - Dim objModules As ArrayList = objCtlModule.GetModuleTabs(subModuleID) - Dim objModule As ModuleInfo - For Each objModule In objModules - If Not objModule.InheritViewPermissions Then - Dim objCollModulePermission As ModulePermissionCollection - objCollModulePermission = ModulePermissionController.GetModulePermissions(subModuleID, objModule.TabID) - Return ModulePermissionController.HasModulePermission(objCollModulePermission, "VIEW") - Else - Dim objCollTabPermission As TabPermissionCollection - objCollTabPermission = TabPermissionController.GetTabPermissions(objModule.TabID, PortalId) - Return TabPermissionController.HasTabPermission(objCollTabPermission, "VIEW") - End If - Next - Return False - Else - Return True - End If - - Catch - End Try - Return False - End Function - - Public Function IsSocialUserPublic(ByVal socialUserId As Integer) As Boolean - If (BaseSettings.SocialGroupModule = EventModuleSettings.SocialModule.UserProfile And Not BaseSettings.SocialUserPrivate) Then - Return True - ElseIf (socialUserId = -1) Then - Return False - ElseIf (BaseSettings.SocialGroupModule = EventModuleSettings.SocialModule.UserProfile And BaseSettings.SocialUserPrivate And socialUserId = PortalSettings.UserInfo.UserID) Then - Return True - End If - Return False - End Function - - Public Function IsSocialGroupPublic(ByVal socialGroupId As Integer) As Boolean - If (BaseSettings.SocialGroupModule = EventModuleSettings.SocialModule.SocialGroup And Not BaseSettings.SocialGroupSecurity = EventModuleSettings.SocialGroupPrivacy.PrivateToGroup) Then - Return True - ElseIf (socialGroupId = -1) Then - Return False - Else - Dim objRoleCtl As New RoleController - Dim objRoleInfo As RoleInfo = objRoleCtl.GetRole(socialGroupId, PortalSettings.PortalId) - If objRoleInfo Is Nothing Then - Return False - End If - If (BaseSettings.SocialGroupModule = EventModuleSettings.SocialModule.SocialGroup And BaseSettings.SocialGroupSecurity = EventModuleSettings.SocialGroupPrivacy.PrivateToGroup _ - And PortalSettings.UserInfo.IsInRole(objRoleInfo.RoleName)) Then - Return True - Else - Return False - End If - End If - End Function - - Public Function IsModerator(ByVal blAuthenticated As Boolean) As Boolean - If blAuthenticated Then - Try - Dim mc As New ModuleController - Dim objMod As ModuleInfo - Dim mp As ModulePermissionCollection - - objMod = mc.GetModule(BaseModuleID, BaseTabID, False) - - If Not objMod Is Nothing Then - mp = objMod.ModulePermissions - Return ModulePermissionController.HasModulePermission(mp, "EVENTSMOD") - Else - Return False - End If - - Catch - End Try - End If - Return False - End Function - - Public Function GetEventModuleViewers() As ArrayList - Dim objCtlModule As New ModuleController - Dim objModule As ModuleInfo = objCtlModule.GetModule(BaseModuleID, BaseTabID, False) - - Dim lstUsers As New ArrayList - Dim lstDeniedUsers As New ArrayList - - If Not objModule.InheritViewPermissions Then - Dim objModulePermission As ModulePermissionInfo - For Each objModulePermission In objModule.ModulePermissions - If objModulePermission.PermissionKey = "VIEW" Then - If objModulePermission.UserID < 0 Then - Dim roleName As String - Dim objCtlRole As New RoleController - If objModulePermission.RoleID < 0 Then - roleName = PortalSettings.RegisteredRoleName - Else - roleName = objModulePermission.RoleName - End If - Dim lstRoleUsers As ArrayList = objCtlRole.GetUsersByRoleName(BasePortalID, roleName) - For Each objUser As UserInfo In lstRoleUsers - AddViewUserid(objUser.UserID, objModulePermission.AllowAccess, lstUsers, lstDeniedUsers) - Next - Else - AddViewUserid(objModulePermission.UserID, objModulePermission.AllowAccess, lstUsers, lstDeniedUsers) - End If - End If - Next - Else - Dim objCollTabPermission As TabPermissionCollection - objCollTabPermission = TabPermissionController.GetTabPermissions(BaseTabID, BasePortalID) - Dim objTabPermission As TabPermissionInfo - For Each objTabPermission In objCollTabPermission - If objTabPermission.PermissionKey = "VIEW" Then - If objTabPermission.UserID < 0 Then - Dim roleName As String - Dim objCtlRole As New RoleController - If objTabPermission.RoleID < 0 Then - roleName = PortalSettings.RegisteredRoleName - Else - roleName = objTabPermission.RoleName - End If - Dim lstRoleUsers As ArrayList = objCtlRole.GetUsersByRoleName(BasePortalID, roleName) - For Each objUser As UserInfo In lstRoleUsers - AddViewUserid(objUser.UserID, objTabPermission.AllowAccess, lstUsers, lstDeniedUsers) - Next - Else - AddViewUserid(objTabPermission.UserID, objTabPermission.AllowAccess, lstUsers, lstDeniedUsers) - End If - End If - Next - End If - Return lstUsers - End Function - - Private Sub AddViewUserid(ByVal viewUserid As Integer, ByVal viewAllowAccess As Boolean, ByVal lstUsers As ArrayList, ByVal lstDeniedUsers As ArrayList) - If lstUsers.Contains(viewUserid) And Not viewAllowAccess Then - lstUsers.Remove(viewUserid) - End If - If lstDeniedUsers.Contains(viewUserid) Then - Exit Sub - End If - If Not viewAllowAccess Then - lstDeniedUsers.Add(viewUserid) - Exit Sub - End If - If lstUsers.Contains(viewUserid) Then - Exit Sub - End If - lstUsers.Add(viewUserid) - End Sub - - Public Function ConvertDateTimeToTZ(ByVal fromDateTime As DateTime, ByVal fromTZ As Integer, ByVal toTZ As Integer) As DateTime - Return fromDateTime.AddMinutes(Convert.ToDouble(toTZ) - Convert.ToDouble(fromTZ)) - End Function - - Public Function UserDisplayNameProfile(ByVal prfUserID As Integer, ByVal prfDisplayName As String, ByVal inLocalResourceFile As String) As EventUser - Dim domainurl As String = GetDomainURL() - UserDisplayNameProfile = New EventUser - With UserDisplayNameProfile - .UserID = prfUserID - .DisplayName = prfDisplayName - If .DisplayName <> "" Then - .ProfileURL = HttpUtility.HtmlEncode(Common.Globals.UserProfileURL(.UserID)) - If Not .ProfileURL.ToLower.StartsWith("http://") And Not .ProfileURL.ToLower.StartsWith("https://") Then - .ProfileURL = AddHTTP(domainurl) & .ProfileURL - End If - .DisplayNameURL = String.Format("{1}", .ProfileURL, .DisplayName, " target=""_blank""") - Else - .ProfileURL = NavigateURL() - .DisplayName = Localization.GetString("UserDeleted", inLocalResourceFile) - .DisplayNameURL = .DisplayName - End If - End With - Return UserDisplayNameProfile - End Function - - Public Function ConvertEventToDisplayTimeZone(ByVal moduleEvent As EventInfo, ByVal displayTimeZoneId As String) As EventInfo - With moduleEvent - Dim objEventTimeZoneUtilities As New EventTimeZoneUtilities - Dim eventDateInfo As EventTimeZoneUtilities.DateInfo - ' Convert to display timezone based on timezone event was stored in - eventDateInfo = objEventTimeZoneUtilities.ConvertToDisplayTimeZone(.EventTimeBegin, .EventTimeZoneId, .PortalID, displayTimeZoneId) - ' If it is an all day event then no need to adjust - If Not moduleEvent.AllDayEvent Then - .EventTimeBegin = eventDateInfo.EventDate - End If - eventDateInfo = objEventTimeZoneUtilities.ConvertToDisplayTimeZone(.LastRecurrence, .EventTimeZoneId, .PortalID, displayTimeZoneId) - ' If it is an all day event then no need to adjust - If Not moduleEvent.AllDayEvent Then - .LastRecurrence = eventDateInfo.EventDate - End If - ' Store the new timezone so it can be used again if needed - .EventTimeZoneId = eventDateInfo.EventTimeZoneId - ' Convert to display timezone. If times have not been converted before, then OtherTimeZoneId will conatin "UTC" since these date are stored to DB in UTC - eventDateInfo = objEventTimeZoneUtilities.ConvertToDisplayTimeZone(.CreatedDate, .OtherTimeZoneId, .PortalID, displayTimeZoneId) - .CreatedDate = eventDateInfo.EventDate - eventDateInfo = objEventTimeZoneUtilities.ConvertToDisplayTimeZone(.LastUpdatedAt, .OtherTimeZoneId, .PortalID, displayTimeZoneId) - .LastUpdatedAt = eventDateInfo.EventDate - ' Store the new timezone so it can be used again if needed - .OtherTimeZoneId = eventDateInfo.EventTimeZoneId - End With - Return moduleEvent - End Function - - Public Function ConvertEventListToDisplayTimeZone(ByVal moduleEvents As ArrayList, ByVal displayTimeZoneId As String) As ArrayList - Dim outEvents As New ArrayList - For Each objEvent As EventInfo In moduleEvents - outEvents.Add(ConvertEventToDisplayTimeZone(objEvent, displayTimeZoneId)) - Next - Return outEvents - End Function - - ' DateTime Sort Class - Public Class EventDateSort - Implements IComparer - - Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer Implements IComparer.Compare - Dim xEventInfo As EventInfo = CType(x, EventInfo) - Dim yEventInfo As EventInfo = CType(y, EventInfo) - - Dim objEventTimeZoneUtilities As New EventTimeZoneUtilities - - Dim result As Integer - result = Date.Compare(objEventTimeZoneUtilities.ConvertToUTCTimeZone(xEventInfo.EventTimeBegin, xEventInfo.EventTimeZoneId), objEventTimeZoneUtilities.ConvertToUTCTimeZone(yEventInfo.EventTimeBegin, yEventInfo.EventTimeZoneId)) - If result = 0 Then - result = xEventInfo.EventID.CompareTo(yEventInfo.EventID) - End If - - Return result - End Function - End Class - - -#End Region - -#Region "Private Functions and Methods" - ' Adds a new Recurring Event (not the real event) to the EventInfo ArrayList - ' Sets Instance Date/Time and Converts to User Time Zone - Private Sub AddEvent(ByVal objEvent As EventInfo) - Dim objEvent2 As EventInfo = objEvent.Clone - - LstEvents.Add(objEvent2) - End Sub - -#End Region - - End Class -#End Region - -#Region "EventController Class " - - _ - _ - Public Class EventController - Implements ISearchable, IUpgradeable - - Public Sub EventsDelete(ByVal eventID As Integer, ByVal moduleID As Integer, ByVal contentItemID As Integer) - ' Dim cntTaxonomy As New Content - ' cntTaxonomy.DeleteContentItem(ContentItemID) - DataProvider.Instance().EventsDelete(eventID, moduleID) - End Sub - - Public Function EventsGet(ByVal eventID As Integer, ByVal moduleID As Integer) As EventInfo - Dim eventInfo As EventInfo = CType(CBO.FillObject(DataProvider.Instance().EventsGet(eventID, moduleID), GetType(EventInfo)), EventInfo) - If Not eventInfo Is Nothing Then - Dim objCtlMasterEvent As New EventMasterController - eventInfo.ModuleTitle = objCtlMasterEvent.GetModuleTitle(eventInfo.ModuleID) - End If - Return eventInfo - End Function - - Public Function EventsGetByRange(ByVal moduleIDs As String, ByVal beginDate As DateTime, ByVal endDate As DateTime, ByVal categoryIDs As String, ByVal locationIDs As String, ByVal socialGroupId As Integer, ByVal socialUserId As Integer) As ArrayList - Return CBO.FillCollection(DataProvider.Instance().EventsGetByRange(moduleIDs, beginDate, endDate, categoryIDs, locationIDs, socialGroupId, socialUserId), GetType(EventInfo)) - End Function - - - Public Function EventsSave(ByVal objEvent As EventInfo, ByVal saveOnly As Boolean, ByVal tabID As Integer, ByVal updateContent As Boolean) As EventInfo - ' Dim cntTaxonomy As New Content - ' If UpdateContent Then - ' If Not objEvent.ContentItemID = Nothing And objEvent.ContentItemID <> 0 Then - ' If Not objEvent.Cancelled Then - ' cntTaxonomy.UpdateContentEvent(objEvent) - ' Else - ' cntTaxonomy.DeleteContentItem(objEvent.ContentItemID) - ' objEvent.ContentItemID = Nothing - ' End If - ' End If - ' End If - - If objEvent.Cancelled And objEvent.JournalItem Then - Dim cntJournal As New Journal - cntJournal.DeleteEvent(objEvent) - objEvent.JournalItem = False - End If - - Dim objEventOut As EventInfo = EventsSave(objEvent, saveOnly) - - ' If UpdateContent And objEvent.EventID = -1 Then - ' If objEventOut.ContentItemID = 0 And Not SaveOnly And Not TabID = Nothing Then - ' objEventOut.ContentItemID = cntTaxonomy.CreateContentEvent(objEventOut, TabID).ContentItemId - ' EventsSave(objEventOut, SaveOnly) - ' End If - ' End If - - Return objEventOut - End Function - - Public Function EventsSave(ByVal objEvent As EventInfo, ByVal saveOnly As Boolean) As EventInfo - Return CType(CBO.FillObject(DataProvider.Instance().EventsSave(objEvent.PortalID, objEvent.EventID, objEvent.RecurMasterID, _ - objEvent.ModuleID, _ - objEvent.EventTimeBegin, objEvent.Duration, objEvent.EventName, _ - objEvent.EventDesc, objEvent.Importance, _ - objEvent.CreatedByID.ToString, objEvent.Notify, objEvent.Approved, objEvent.Signups, _ - objEvent.MaxEnrollment, objEvent.EnrollRoleID, objEvent.EnrollFee, objEvent.EnrollType, _ - objEvent.PayPalAccount, objEvent.Cancelled, _ - objEvent.DetailPage, objEvent.DetailNewWin, objEvent.DetailURL, objEvent.ImageURL, objEvent.ImageType, objEvent.ImageWidth, objEvent.ImageHeight, _ - objEvent.ImageDisplay, objEvent.Location, _ - objEvent.Category, _ - objEvent.Reminder, objEvent.SendReminder, objEvent.ReminderTime, _ - objEvent.ReminderTimeMeasurement, objEvent.ReminderFrom, objEvent.SearchSubmitted, objEvent.CustomField1, objEvent.CustomField2, _ - objEvent.EnrollListView, objEvent.DisplayEndDate, objEvent.AllDayEvent, objEvent.OwnerID, objEvent.LastUpdatedID, objEvent.OriginalDateBegin, _ - objEvent.NewEventEmailSent, objEvent.AllowAnonEnroll, objEvent.ContentItemID, objEvent.JournalItem, objEvent.Summary, saveOnly), _ - GetType(EventInfo)), EventInfo) - End Function - - Public Function EventsModerateEvents(ByVal moduleID As Integer, ByVal socialGroupId As Integer) As ArrayList - Return CBO.FillCollection(DataProvider.Instance().EventsModerateEvents(moduleID, socialGroupId), GetType(EventInfo)) - End Function - - Public Function EventsTimeZoneCount(ByVal moduleID As Integer) As Integer - ' ReSharper disable RedundantCast - Return CType(DataProvider.Instance().EventsTimeZoneCount(CInt(moduleID)), Integer) - ' ReSharper restore RedundantCast - End Function - - Public Sub EventsUpgrade(ByVal moduleVersion As String) - DataProvider.Instance().EventsUpgrade(moduleVersion) - End Sub - - Public Sub EventsCleanupExpired(ByVal portalId As Integer, ByVal moduleId As Integer) - DataProvider.Instance().EventsCleanupExpired(portalId, moduleId) - End Sub - - Public Function EventsGetRecurrences(ByVal recurMasterID As Integer, ByVal moduleID As Integer) As ArrayList - Return CBO.FillCollection(DataProvider.Instance().EventsGetRecurrences(recurMasterID, moduleID), GetType(EventInfo)) - End Function - - -#Region "Optional Interfaces" - '*** Implement ISearchable - Public Function GetSearchItems(ByVal modInfo As ModuleInfo) As Services.Search.SearchItemInfoCollection Implements ISearchable.GetSearchItems - Dim ems As New EventModuleSettings - Dim settings As EventModuleSettings = ems.GetEventModuleSettings(modInfo.ModuleID, Nothing) - - Dim objPortals As New Entities.Portals.PortalController - Dim objPortal As Entities.Portals.PortalInfo - objPortal = objPortals.GetPortal(modInfo.PortalID) - ' Set Thread Culture for Portal Default Culture (for Dates/Times Formatting) - Dim lang As String = objPortal.DefaultLanguage - Threading.Thread.CurrentThread.CurrentCulture = New CultureInfo(lang, False) - Dim searchItemCollection As New Services.Search.SearchItemInfoCollection - - Try - If settings.Eventsearch Then - ' Get Date Recurrences from 6 months prior to Current Date and 1 year out - Dim objEventInfoHelper As New EventInfoHelper(modInfo.ModuleID, settings) - Dim categoryIDs As New ArrayList - categoryIDs.Add("-1") - Dim locationIDs As New ArrayList - locationIDs.Add("-1") - Dim lstEvents As ArrayList = objEventInfoHelper.GetEvents(Date.UtcNow.AddMonths(-6), Date.UtcNow.AddYears(1), False, categoryIDs, locationIDs, True, -1, -1) - - Dim portalTimeZoneId As String = Entities.Portals.PortalController.GetPortalSetting("TimeZone", modInfo.PortalID, String.Empty) - lstEvents = objEventInfoHelper.ConvertEventListToDisplayTimeZone(lstEvents, portalTimeZoneId) - - For Each objEvent As EventInfo In lstEvents - Dim searchItem As Services.Search.SearchItemInfo - With objEvent - ' Item Title - Dim strTitle As String = HttpUtility.HtmlDecode(.ModuleTitle & ": " & .EventName & ", " & .EventTimeBegin.ToString) - ' Displayed Description - Dim strDescription As String = HtmlUtils.Shorten(HtmlUtils.StripTags(HttpUtility.HtmlDecode(.EventDesc), False), 255, "...") - ' Search Items - Dim strContent As String = HttpUtility.HtmlDecode(.ModuleTitle & " " & .EventName & " " & .EventTimeBegin.ToString & " " & .EventDesc) - ' Added to Link - Dim strGUID As String = HttpUtility.HtmlDecode("ModuleID=" & .ModuleID.ToString() & "&ItemID=" & .EventID.ToString() & "&mctl=EventDetails") - ' Unique Item Key - Dim strUnique As String = "Event: " & .EventID.ToString & ", Date:" & .EventTimeBegin.ToString - - searchItem = New Services.Search.SearchItemInfo - searchItem.Title = strTitle - searchItem.PubDate = .LastUpdatedAt - searchItem.Description = strDescription - searchItem.Author = .LastUpdatedID - searchItem.ModuleId = modInfo.ModuleID - searchItem.SearchKey = strUnique - searchItem.Content = strContent - searchItem.GUID = strGUID - - searchItemCollection.Add(searchItem) - End With - Next - End If - Return searchItemCollection - Catch ex As Exception - Return Nothing - End Try - End Function - - 'Public Function ExportModule(ByVal ModuleID As Integer) As String Implements Entities.Modules.IPortable.ExportModule - ' Dim strXML As String = "" - ' Dim objEventCtl As New EventController - - ' Dim arrEvents As ArrayList = objEventCtl.EventsGetByRange(ModuleID.ToString(), DateTime.Now, DateTime.Now.AddYears(1), "") - ' If arrEvents.Count <> 0 Then - ' strXML += "" - ' Dim objEvent As EventInfo - ' For Each objEvent In arrEvents - ' strXML += "" - ' strXML += "" & XMLEncode(objEvent.EventDesc) & "" - ' strXML += "" & XMLEncode(objEvent.EventTimeBegin.ToString) & "" - ' strXML += "" & XMLEncode(objEvent.EventName) & "" - ' strXML += "" & XMLEncode(objEvent.IconFile) & "" - ' strXML += "" & XMLEncode(objEvent.Every.ToString) & "" - ' strXML += "" & XMLEncode(objEvent.AltText) & "" - ' strXML += "" & XMLEncode(objEvent.ExpireDate.ToString) & "" - ' strXML += "" & XMLEncode(objEvent.MaxWidth.ToString) & "" - ' strXML += "" & XMLEncode(objEvent.Period) & "" - ' strXML += "" - ' Next - ' strXML += "" - ' End If - - ' Return strXML - 'End Function - - 'Public Sub ImportModule(ByVal ModuleID As Integer, ByVal Content As String, ByVal Version As String, ByVal UserId As Integer) Implements Entities.Modules.IPortable.ImportModule - ' Dim xmlEvent As XmlNode - ' Dim xmlEvents As XmlNode = GetContent(Content, "events") - ' For Each xmlEvent In xmlEvents.SelectNodes("event") - ' Dim objEvent As New EventInfo - ' objEvent.ModuleID = ModuleID - ' objEvent.Description = xmlEvent.Item("description").InnerText - ' objEvent.DateTime = Date.Parse(xmlEvent.Item("datetime").InnerText) - ' objEvent.Title = xmlEvent.Item("title").InnerText - ' objEvent.IconFile = ImportUrl(ModuleID, xmlEvent.Item("icon").InnerText) - ' objEvent.Every = Integer.Parse(xmlEvent.Item("occursevery").InnerText) - ' objEvent.AltText = xmlEvent.Item("alttext").InnerText - ' objEvent.ExpireDate = Date.Parse(xmlEvent.Item("expires").InnerText) - ' objEvent.MaxWidth = Integer.Parse(xmlEvent.Item("maxWidth").InnerText) - ' objEvent.Period = xmlEvent.Item("period").InnerText - ' objEvent.CreatedByUser = UserId.ToString - ' AddEvent(objEvent) - ' Next - 'End Sub - - Public Function UpgradeModule(ByVal version As String) As String Implements IUpgradeable.UpgradeModule - Dim rtnMessage As String = "Events Module Updated: " & version - Try - - ' Create Lists and Schedule - they should always exist - CreateListsAndSchedule() - - 'Lookup DesktopModuleID - Dim objDesktopModule As DesktopModuleInfo - objDesktopModule = DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", 0) - - If Not objDesktopModule Is Nothing Then - Dim objModuleDefinition As ModuleDefinitionInfo - 'Lookup ModuleDefID - objModuleDefinition = ModuleDefinitionController.GetModuleDefinitionByFriendlyName("Events", objDesktopModule.DesktopModuleID) - - If Not objModuleDefinition Is Nothing Then - Dim objModuleControlInfo As ModuleControlInfo - 'Lookup ModuleControlID - objModuleControlInfo = ModuleControlController.GetModuleControlByControlKey("Import", objModuleDefinition.ModuleDefID) - If Not objModuleControlInfo Is Nothing Then - 'Remove Import control key - ModuleControlController.DeleteModuleControl(objModuleControlInfo.ModuleControlID) - End If - ' ReSharper disable RedundantAssignment - objModuleControlInfo = Nothing - ' ReSharper restore RedundantAssignment - objModuleControlInfo = ModuleControlController.GetModuleControlByControlKey("TZUpdate", objModuleDefinition.ModuleDefID) - If Not objModuleControlInfo Is Nothing Then - 'Remove TZUpdate control key - ModuleControlController.DeleteModuleControl(objModuleControlInfo.ModuleControlID) - End If - End If - End If - - If version = "04.00.02" Then - ' Copy moderators from ModuleSettings to ModulePermissions - Dim objEventCtl As New EventController - objEventCtl.EventsUpgrade(version) - End If - - If version = "04.01.00" Then - ' Upgrade recurring events - Dim blAllOk As Boolean - blAllOk = UpgradeRecurringEvents() - EventsUpgrade(version) - If blAllOk Then - rtnMessage = "Events Module Updated: " & version + " --> All Events Upgraded" - Else - rtnMessage = "Events Module Updated: " & version + " --> Not All Events Upgraded - Check database for errors" - End If - End If - - If version = "05.02.00" Then - ' ReSharper disable UnusedVariable - Dim result As Boolean = ConvertEditPermissions() - ' ReSharper restore UnusedVariable - End If - - Catch ex As Exception - LogException(ex) - - Return "Events Module Updated - Exception: " & version & " - Message: " & ex.Message.ToString - End Try - Return rtnMessage - End Function - - Public Sub CreateListsAndSchedule() - ' Create schedule - Dim objEventNotificationController As New EventNotificationController - objEventNotificationController.InstallEventSchedule() - - ' Add TimeInterval List entries - Dim ctlLists As New Lists.ListController - Dim colThreadStatus As Generic.IEnumerable(Of Lists.ListEntryInfo) = ctlLists.GetListEntryInfoItems("TimeInterval") - If colThreadStatus.Count = 0 Then - AddLists() - End If - - End Sub - - Private Function UpgradeRecurringEvents() As Boolean - Dim returnStr As Boolean = True - - Dim objPortals As New Entities.Portals.PortalController - Dim objPortal As Entities.Portals.PortalInfo - Dim objModules As New ModuleController - Dim objModule As ModuleInfo - - Dim lstportals As ArrayList = objPortals.GetPortals() - For Each objPortal In lstportals - Dim objDesktopModule As DesktopModuleInfo - objDesktopModule = DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", objPortal.PortalID) - Dim folderName As String = objDesktopModule.FolderName - Dim templateSourceDirectory As String = Common.Globals.ApplicationPath - Dim localResourceFile As String = templateSourceDirectory & "/DesktopModules/" & folderName & "/" & Localization.LocalResourceDirectory & "/EventSettings.ascx.resx" - - Dim lstModules As ArrayList = objModules.GetModulesByDefinition(objPortal.PortalID, objDesktopModule.FriendlyName) - For Each objModule In lstModules - ' This check for objModule = Nothing because of error in DNN 5.0.0 in GetModulesByDefinition - If objModule Is Nothing Then - Continue For - End If - Dim ems As New EventModuleSettings - Dim settings As EventModuleSettings = ems.GetEventModuleSettings(objModule.ModuleID, Nothing) - - Dim maxRecurrences As String = settings.maxrecurrences.ToString - - If Not UpgradeRecurringEventModule(objModule.ModuleID, CType(settings.RecurDummy, Integer), maxRecurrences, localResourceFile) Then - returnStr = False - End If - Next - Next - - Return returnStr - End Function - - Public Function UpgradeRecurringEventModule(ByVal moduleID As Integer, ByVal recurMasterID As Integer, ByVal maxRecurrences As String, ByVal localResourceFile As String) As Boolean - If recurMasterID = 99999 Then - Return True - End If - Dim objCtlEventRecurMaster As New EventRecurMasterController - Dim objCtlEvent As New EventController - Dim objEvent, objEventNew As EventInfo - - Dim lstEvents As ArrayList - lstEvents = objCtlEvent.EventsGetRecurrences(recurMasterID, moduleID) - - For Each objEvent In lstEvents - Dim objEventRecurMaster As New EventRecurMasterInfo - With objEventRecurMaster - .RecurMasterID = -1 - .ModuleID = objEvent.ModuleID - .PortalID = objEvent.PortalID - .DTSTART = objEvent.EventTimeBegin - .Duration = CType(objEvent.Duration, String) + "M" - ' ReSharper disable VBWarnings::BC40008 - .Until = objEvent.EventDateEnd - ' ReSharper restore VBWarnings::BC40008 - .EventName = objEvent.EventName - .EventDesc = objEvent.EventDesc - .Importance = CType(objEvent.Importance, EventRecurMasterInfo.Priority) - .Notify = objEvent.Notify - .Approved = objEvent.Approved - .Signups = objEvent.Signups - .MaxEnrollment = objEvent.MaxEnrollment - .EnrollRoleID = objEvent.EnrollRoleID - .EnrollFee = objEvent.EnrollFee - .EnrollType = objEvent.EnrollType - .Enrolled = objEvent.Enrolled - .PayPalAccount = objEvent.PayPalAccount - .DetailPage = objEvent.DetailPage - .DetailNewWin = objEvent.DetailNewWin - .DetailURL = objEvent.DetailURL - .ImageURL = objEvent.ImageURL - .ImageType = objEvent.ImageType - .ImageWidth = objEvent.ImageWidth - .ImageHeight = objEvent.ImageHeight - .ImageDisplay = objEvent.ImageDisplay - .Location = objEvent.Location - .Category = objEvent.Category - .Reminder = objEvent.Reminder - .SendReminder = objEvent.SendReminder - .ReminderTime = objEvent.ReminderTime - .ReminderTimeMeasurement = objEvent.ReminderTimeMeasurement - .ReminderFrom = objEvent.ReminderFrom - .CustomField1 = objEvent.CustomField1 - .CustomField2 = objEvent.CustomField2 - .EnrollListView = objEvent.EnrollListView - .DisplayEndDate = objEvent.DisplayEndDate - .AllDayEvent = objEvent.AllDayEvent - .OwnerID = objEvent.OwnerID - .CreatedByID = objEvent.CreatedByID - .UpdatedByID = objEvent.CreatedByID - .AllowAnonEnroll = False - .ContentItemID = 0 - .SocialGroupID = 0 - .SocialUserID = 0 - .Summary = Nothing - Dim objCtlUsers As New UserController - Dim objUserInfo As UserInfo = objCtlUsers.GetUser(objEvent.PortalID, objEvent.CreatedByID) - If Not objUserInfo Is Nothing Then - .CultureName = objUserInfo.Profile.PreferredLocale - End If - If objUserInfo Is Nothing Or .CultureName = "" Then - Dim objCtlPortal As New Entities.Portals.PortalController - Dim objPortalinfo As Entities.Portals.PortalInfo = objCtlPortal.GetPortal(objEvent.PortalID) - .CultureName = objPortalinfo.DefaultLanguage - End If - - .RRULE = CreateRRULE(objEvent, .CultureName) - End With - Dim lstEventsNew As ArrayList - - lstEventsNew = objCtlEventRecurMaster.CreateEventRecurrences(objEventRecurMaster, objEvent.Duration, maxRecurrences) - objEventRecurMaster = objCtlEventRecurMaster.EventsRecurMasterSave(objEventRecurMaster) - - ' If no events generated, mark original as cancelled and link to new recurmaster - Non Destructive - If lstEventsNew.Count = 0 Then - objEvent.Cancelled = True - objEvent.RecurMasterID = objEventRecurMaster.RecurMasterID - objCtlEvent.EventsSave(objEvent, True) - End If - - Dim i As Integer = 0 - For Each objEventNew In lstEventsNew - i = i + 1 - If i = 1 Then - objEventNew.EventID = objEvent.EventID - End If - objEventNew.RecurMasterID = objEventRecurMaster.RecurMasterID - objEventNew.Cancelled = objEvent.Cancelled - objEventNew.SearchSubmitted = objEvent.SearchSubmitted - ' ReSharper disable RedundantAssignment - objEventNew = objCtlEvent.EventsSave(objEventNew, True) - ' ReSharper restore RedundantAssignment - Next - Next - lstEvents.Clear() - lstEvents = objCtlEvent.EventsGetRecurrences(recurMasterID, moduleID) - If lstEvents.Count = 0 Then - objCtlEventRecurMaster.EventsRecurMasterDelete(recurMasterID, moduleID) - Dim ems As New EventModuleSettings - Dim settings As EventModuleSettings = ems.GetEventModuleSettings(moduleID, localResourceFile) - settings.RecurDummy = "99999" - settings.SaveSettings(moduleID) - Return True - Else - Return False - End If - End Function - - Private Function CreateRRULE(ByVal objEvent As EventInfo, ByVal cultureName As String) As String - Dim rrule As String = "" - Dim strWkst As String - Dim culture As New CultureInfo(cultureName, False) - strWkst = "SU" - If (culture.DateTimeFormat.FirstDayOfWeek <> DayOfWeek.Sunday) Then - strWkst = "MO" - End If - ' ReSharper disable VBWarnings::BC40008 - Select Case Trim(objEvent.RepeatType) - Case "N" - rrule = "" - Case "P1" - Select Case Trim(objEvent.Period) - Case "D" - rrule = "FREQ=DAILY" - Case "W" - rrule = "FREQ=WEEKLY;WKST=" + strWkst - Case "M" - rrule = "FREQ=MONTHLY" - Case "Y" - rrule = "FREQ=YEARLY" - End Select - rrule = rrule + ";INTERVAL=" + objEvent.Every.ToString - Case "W1" - rrule = "FREQ=WEEKLY;WKST=" + strWkst + ";INTERVAL=" + objEvent.Every.ToString + ";BYDAY=" - If CType(Mid(objEvent.Period, 1, 1), Boolean) Then - rrule = rrule + "SU," - End If - If CType(Mid(objEvent.Period, 2, 1), Boolean) Then - rrule = rrule + "MO," - End If - If CType(Mid(objEvent.Period, 3, 1), Boolean) Then - rrule = rrule + "TU," - End If - If CType(Mid(objEvent.Period, 4, 1), Boolean) Then - rrule = rrule + "WE," - End If - If CType(Mid(objEvent.Period, 5, 1), Boolean) Then - rrule = rrule + "TH," - End If - If CType(Mid(objEvent.Period, 6, 1), Boolean) Then - rrule = rrule + "FR," - End If - If CType(Mid(objEvent.Period, 7, 1), Boolean) Then - rrule = rrule + "SA," - End If - rrule = Left(rrule, Len(rrule) - 1) - Case "M1" - rrule = "FREQ=MONTHLY;INTERVAL=1;BYDAY=" - Dim strWeek As String - If objEvent.Every < 5 Then - strWeek = "+" + Convert.ToString(objEvent.Every) - Else - strWeek = "-1" - End If - rrule = rrule + strWeek - - Dim strDay As String = "" - Select Case Trim(objEvent.Period) - Case "0" - strDay = "SU" - Case "1" - strDay = "MO" - Case "2" - strDay = "TU" - Case "3" - strDay = "WE" - Case "4" - strDay = "TH" - Case "5" - strDay = "FR" - Case "6" - strDay = "SA" - End Select - rrule = rrule + strDay - Case "M2" - rrule = "FREQ=MONTHLY;INTERVAL=" + objEvent.Every.ToString + ";BYMONTHDAY=+" + Trim(objEvent.Period) - Case "Y1" - Dim uiculture As CultureInfo = Threading.Thread.CurrentThread.CurrentCulture - Dim usculture As New CultureInfo("en-US", False) - Threading.Thread.CurrentThread.CurrentCulture = usculture - Dim yearDate As DateTime = Convert.ToDateTime(objEvent.Period) - ' ReSharper restore VBWarnings::BC40008 - Threading.Thread.CurrentThread.CurrentCulture = uiculture - rrule = "FREQ=YEARLY;INTERVAL=1;BYMONTH=" + Convert.ToString(yearDate.Month) + ";BYMONTHDAY=+" + Convert.ToString(yearDate.Day) - End Select - Return rrule - End Function - - Private Function ConvertEditPermissions() As Boolean - Dim returnStr As Boolean = True - - Dim objPortals As New Entities.Portals.PortalController - Dim objPortal As Entities.Portals.PortalInfo - Dim objModules As New ModuleController - Dim objModule As ModuleInfo - - Dim lstportals As ArrayList = objPortals.GetPortals() - For Each objPortal In lstportals - Dim objDesktopModule As DesktopModuleInfo - objDesktopModule = DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", objPortal.PortalID) - - Dim lstModules As ArrayList = objModules.GetModulesByDefinition(objPortal.PortalID, objDesktopModule.FriendlyName) - For Each objModule In lstModules - ' This check for objModule = Nothing because of error in DNN 5.0.0 in GetModulesByDefinition - If objModule Is Nothing Then - Continue For - End If - - If Not ConvertEditPermissionsModule(objModule.ModuleID, objModule.TabID) Then - returnStr = False - End If - Next - Next - Return returnStr - End Function - - Private Shared Function ConvertEditPermissionsModule(ByVal moduleID As Integer, ByVal tabID As Integer) As Boolean - Dim returnStr As Boolean - Dim arrRoles As New ArrayList - Dim arrUsers As New ArrayList - - Dim objPermission As ModulePermissionInfo - Dim objPermissionController As New PermissionController - - Dim objModules As New ModuleController - ' Get existing module permissions - Dim objModule As ModuleInfo = objModules.GetModule(moduleID, tabID) - Dim objModulePermissions2 As New ModulePermissionCollection - - For Each perm As ModulePermissionInfo In objModule.ModulePermissions - If (perm.PermissionKey = "EDIT" And perm.AllowAccess) Then - objModulePermissions2.Add(perm) - If perm.UserID >= 0 Then - arrUsers.Add(perm.UserID) - Else - arrRoles.Add(perm.RoleID) - End If - End If - Next - For Each perm As ModulePermissionInfo In objModulePermissions2 - If perm.RoleName <> "Administrators" Then - objModule.ModulePermissions.Remove(perm) - End If - Next - - Dim objEditPermissions As ArrayList = objPermissionController.GetPermissionByCodeAndKey("EVENTS_MODULE", "EVENTSEDT") - Dim objEditPermission As PermissionInfo = CType(objEditPermissions.Item(0), PermissionInfo) - - For Each iRoleID As Integer In arrRoles - objPermission = New ModulePermissionInfo - objPermission.RoleID = iRoleID - objPermission.ModuleID = moduleID - objPermission.PermissionKey = objEditPermission.PermissionKey - objPermission.PermissionName = objEditPermission.PermissionName - objPermission.PermissionCode = objEditPermission.PermissionCode - objPermission.PermissionID = objEditPermission.PermissionID - objPermission.AllowAccess = True - objModule.ModulePermissions.Add(objPermission) - Next - For Each iUserID As Integer In arrUsers - objPermission = New ModulePermissionInfo - objPermission.UserID = iUserID - objPermission.ModuleID = moduleID - objPermission.PermissionKey = objEditPermission.PermissionKey - objPermission.PermissionName = objEditPermission.PermissionName - objPermission.PermissionCode = objEditPermission.PermissionCode - objPermission.PermissionID = objEditPermission.PermissionID - objPermission.AllowAccess = True - objModule.ModulePermissions.Add(objPermission) - Next - - ModulePermissionController.SaveModulePermissions(objModule) - returnStr = True - Return returnStr - End Function - Private Sub AddLists() - Dim objDesktopModule As DesktopModuleInfo - objDesktopModule = DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", 0) - If objDesktopModule Is Nothing Then - Exit Sub - End If - Dim objModuleDefinition As ModuleDefinitionInfo - objModuleDefinition = ModuleDefinitionController.GetModuleDefinitionByFriendlyName("Events", objDesktopModule.DesktopModuleID) - If objModuleDefinition Is Nothing Then - Exit Sub - End If - - Dim moduleDefId As Integer = objModuleDefinition.ModuleDefID - - Dim ctlLists As New Lists.ListController - 'description is missing, not needed - - 'ThreadStatus - Dim objList As New Lists.ListEntryInfo - objList.ListName = "TimeInterval" - objList.Value = "5" - objList.Text = "5" - objList.SortOrder = 1 - objList.ParentID = 0 - objList.Level = 0 - objList.DefinitionID = moduleDefId - ctlLists.AddListEntry(objList) - - objList.ListName = "TimeInterval" - objList.Value = "10" - objList.Text = "10" - objList.SortOrder = 2 - objList.ParentID = 0 - objList.Level = 0 - objList.DefinitionID = moduleDefId - ctlLists.AddListEntry(objList) - - objList.ListName = "TimeInterval" - objList.Value = "15" - objList.Text = "15" - objList.SortOrder = 3 - objList.ParentID = 0 - objList.Level = 0 - objList.DefinitionID = moduleDefId - ctlLists.AddListEntry(objList) - - objList.ListName = "TimeInterval" - objList.Value = "20" - objList.Text = "20" - objList.SortOrder = 4 - objList.ParentID = 0 - objList.Level = 0 - objList.DefinitionID = moduleDefId - ctlLists.AddListEntry(objList) - - objList.ListName = "TimeInterval" - objList.Value = "30" - objList.Text = "30" - objList.SortOrder = 5 - objList.ParentID = 0 - objList.Level = 0 - objList.DefinitionID = moduleDefId - ctlLists.AddListEntry(objList) - - objList.ListName = "TimeInterval" - objList.Value = "60" - objList.Text = "60" - objList.SortOrder = 6 - objList.ParentID = 0 - objList.Level = 0 - objList.DefinitionID = moduleDefId - ctlLists.AddListEntry(objList) - - - objList.ListName = "TimeInterval" - objList.Value = "120" - objList.Text = "120" - objList.SortOrder = 7 - objList.ParentID = 0 - objList.Level = 0 - objList.DefinitionID = moduleDefId - ctlLists.AddListEntry(objList) - - - objList.ListName = "TimeInterval" - objList.Value = "240" - objList.Text = "240" - objList.SortOrder = 8 - objList.ParentID = 0 - objList.Level = 0 - objList.DefinitionID = moduleDefId - ctlLists.AddListEntry(objList) - - - objList.ListName = "TimeInterval" - objList.Value = "360" - objList.Text = "360" - objList.SortOrder = 9 - objList.ParentID = 0 - objList.Level = 0 - objList.DefinitionID = moduleDefId - ctlLists.AddListEntry(objList) - - objList.ListName = "TimeInterval" - objList.Value = "720" - objList.Text = "720" - objList.SortOrder = 10 - objList.ParentID = 0 - objList.Level = 0 - objList.DefinitionID = moduleDefId - ctlLists.AddListEntry(objList) - - objList.ListName = "TimeInterval" - objList.Value = "1440" - objList.Text = "1440" - objList.SortOrder = 11 - objList.ParentID = 0 - objList.Level = 0 - objList.DefinitionID = moduleDefId - ctlLists.AddListEntry(objList) - - - End Sub -#End Region - - End Class -#End Region - -#Region "EventMasterController Class " - Public Class EventMasterController - - Public Sub EventsMasterDelete(ByVal masterID As Integer, ByVal moduleID As Integer) - DataProvider.Instance().EventsMasterDelete(masterID, moduleID) - End Sub - - Public Function EventsMasterGet(ByVal moduleID As Integer, ByVal subEventID As Integer) As EventMasterInfo - Dim eventMasterInfo As EventMasterInfo = CType(CBO.FillObject(DataProvider.Instance().EventsMasterGet(moduleID, subEventID), GetType(EventMasterInfo)), EventMasterInfo) - If Not eventMasterInfo Is Nothing Then - eventMasterInfo.SubEventTitle = GetModuleTitle(eventMasterInfo.SubEventID) - End If - Return eventMasterInfo - End Function - - Public Function EventsMasterAssignedModules(ByVal moduleID As Integer) As ArrayList - Dim assignedModules As ArrayList = CBO.FillCollection(DataProvider.Instance().EventsMasterAssignedModules(moduleID), GetType(EventMasterInfo)) - Dim objEventMasterInfo As EventMasterInfo - For Each objEventMasterInfo In assignedModules - objEventMasterInfo.SubEventTitle = GetModuleTitle(objEventMasterInfo.SubEventID) - Next - assignedModules.Sort(New ModuleListSort) - Return assignedModules - End Function - - Public Function EventsMasterAvailableModules(ByVal portalID As Integer, ByVal moduleID As Integer) As ArrayList - Dim availableModules As ArrayList = CBO.FillCollection(DataProvider.Instance().EventsMasterAvailableModules(portalID, moduleID), GetType(EventMasterInfo)) - Dim objEventMasterInfo As EventMasterInfo - For Each objEventMasterInfo In availableModules - objEventMasterInfo.SubEventTitle = GetModuleTitle(objEventMasterInfo.SubEventID) - Next - availableModules.Sort(New ModuleListSort) - Return availableModules - End Function - - Public Function EventsMasterSave(ByVal objEventMaster As EventMasterInfo) As EventMasterInfo - Return CType(CBO.FillObject(DataProvider.Instance().EventsMasterSave(objEventMaster.MasterID, objEventMaster.ModuleID, objEventMaster.SubEventID), GetType(EventMasterInfo)), EventMasterInfo) - End Function - - Public Function GetModuleTitle(ByVal intModuleID As Integer) As String - Dim cacheKey As String = "EventsModuleTitle" & intModuleID.ToString - Dim moduleTitle As String = CType(Common.Utilities.DataCache.GetCache(cacheKey), String) - If moduleTitle Is Nothing Then - Dim objModuleController As New ModuleController - Dim objModuleTabs As ArrayList = objModuleController.GetModuleTabs(intModuleID) - Dim objModuleInfo As ModuleInfo - Dim intTabID As Integer = 0 - For Each objModuleInfo In objModuleTabs - If objModuleInfo.TabID < intTabID Or intTabID = 0 Then - moduleTitle = Common.Utilities.HtmlUtils.StripTags(objModuleInfo.ModuleTitle, False) - intTabID = objModuleInfo.TabID - End If - Next - Common.Utilities.DataCache.SetCache(cacheKey, moduleTitle) - End If - Return moduleTitle - End Function - - End Class -#End Region - -#Region "Comparer Class" - Public Class ModuleListSort - Implements IComparer - - Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer Implements IComparer.Compare - Dim xdisplayname As String - Dim ydisplayname As String - - xdisplayname = CType(x, EventMasterInfo).SubEventTitle - ydisplayname = CType(y, EventMasterInfo).SubEventTitle - Dim c As New CaseInsensitiveComparer - Return c.Compare(xdisplayname, ydisplayname) - End Function - End Class - -#End Region - - -#Region "EventSignupsController Class" - - ' EventSignupsController class made public in order to accommodate an external enrollment page. - Public Class EventSignupsController - - Public Sub EventsSignupsDelete(ByVal signupID As Integer, ByVal moduleID As Integer) - DataProvider.Instance().EventsSignupsDelete(signupID, moduleID) - End Sub - - Public Function EventsSignupsGet(ByVal signupID As Integer, ByVal moduleID As Integer, ByVal ppipn As Boolean) As EventSignupsInfo - Return CType(CBO.FillObject(DataProvider.Instance().EventsSignupsGet(signupID, moduleID, ppipn), GetType(EventSignupsInfo)), EventSignupsInfo) - End Function - - Public Function EventsSignupsGetEvent(ByVal eventID As Integer, ByVal moduleID As Integer) As ArrayList - Return CBO.FillCollection(DataProvider.Instance().EventsSignupsGetEvent(eventID, moduleID), GetType(EventSignupsInfo)) - End Function - - Public Function EventsSignupsGetEventRecurMaster(ByVal recurMasterID As Integer, ByVal moduleID As Integer) As ArrayList - Return CBO.FillCollection(DataProvider.Instance().EventsSignupsGetEventRecurMaster(recurMasterID, moduleID), GetType(EventSignupsInfo)) - End Function - - Public Function EventsSignupsMyEnrollments(ByVal moduleID As Integer, ByVal userID As Integer, ByVal socialGroupId As Integer, ByVal categoryIDs As String, ByVal beginDate As DateTime, _ - ByVal endDate As DateTime) As ArrayList - Return CBO.FillCollection(DataProvider.Instance().EventsSignupsMyEnrollments(moduleID, userID, socialGroupId, categoryIDs, beginDate, endDate), GetType(EventSignupsInfo)) - End Function - - Public Function EventsSignupsGetUser(ByVal eventID As Integer, ByVal userID As Integer, ByVal moduleID As Integer) As EventSignupsInfo - Return CType(CBO.FillObject(DataProvider.Instance().EventsSignupsGetUser(eventID, userID, moduleID), GetType(EventSignupsInfo)), EventSignupsInfo) - End Function - - Public Function EventsSignupsGetAnonUser(ByVal eventID As Integer, ByVal anonEmail As String, ByVal moduleID As Integer) As EventSignupsInfo - Return CType(CBO.FillObject(DataProvider.Instance().EventsSignupsGetAnonUser(eventID, anonEmail, moduleID), GetType(EventSignupsInfo)), EventSignupsInfo) - End Function - - Public Function EventsSignupsSave(ByVal objEventSignup As EventSignupsInfo) As EventSignupsInfo - Return CType(CBO.FillObject(DataProvider.Instance().EventsSignupsSave(objEventSignup.EventID, objEventSignup.SignupID, objEventSignup.ModuleID, objEventSignup.UserID, objEventSignup.Approved, _ - objEventSignup.PayPalStatus, objEventSignup.PayPalReason, objEventSignup.PayPalTransID, objEventSignup.PayPalPayerID, _ - objEventSignup.PayPalPayerStatus, objEventSignup.PayPalRecieverEmail, objEventSignup.PayPalUserEmail, _ - objEventSignup.PayPalPayerEmail, objEventSignup.PayPalFirstName, objEventSignup.PayPalLastName, objEventSignup.PayPalAddress, _ - objEventSignup.PayPalCity, objEventSignup.PayPalState, objEventSignup.PayPalZip, objEventSignup.PayPalCountry, _ - objEventSignup.PayPalCurrency, objEventSignup.PayPalPaymentDate, objEventSignup.PayPalAmount, objEventSignup.PayPalFee, _ - objEventSignup.NoEnrolees, objEventSignup.AnonEmail, objEventSignup.AnonName, objEventSignup.AnonTelephone, _ - objEventSignup.AnonCulture, objEventSignup.AnonTimeZoneId, objEventSignup.FirstName, objEventSignup.LastName, _ - objEventSignup.Company, objEventSignup.JobTitle, objEventSignup.ReferenceNumber, _ - objEventSignup.Street, objEventSignup.PostalCode, objEventSignup.City, objEventSignup.Region, objEventSignup.Country), _ - GetType(EventSignupsInfo)), EventSignupsInfo) - End Function - - Public Function EventsModerateSignups(ByVal moduleID As Integer, ByVal socialGroupId As Integer) As ArrayList - Return CBO.FillCollection(DataProvider.Instance().EventsModerateSignups(moduleID, socialGroupId), GetType(EventSignupsInfo)) - End Function - - Public Function DisplayEnrollIcon(ByVal eventInfo As EventInfo) As Boolean - Dim objEventTimeZoneUtilities As New EventTimeZoneUtilities - If eventInfo.EventTimeBegin < objEventTimeZoneUtilities.ConvertFromUTCToModuleTimeZone(Date.UtcNow, eventInfo.EventTimeZoneId) Then - Return False - End If - - If Not eventInfo.Signups Then - Return False - End If - - If eventInfo.EnrollRoleID = Nothing Or eventInfo.EnrollRoleID = -1 Then - Return True - Else - If IsEnrollRole(eventInfo.EnrollRoleID, eventInfo.PortalID) Then - Return True - End If - End If - - Return False - End Function - - Public Function IsEnrollRole(ByVal roleID As Integer, ByVal portalId As Integer) As Boolean - Try - ' ReSharper disable RedundantAssignment - Dim roleName As String = "" - ' ReSharper restore RedundantAssignment - If roleID <> -1 Then - Dim enrollRoleInfo As RoleInfo - Dim enrollRoleCntrl As New RoleController - enrollRoleInfo = enrollRoleCntrl.GetRole(roleID, portalId) - roleName = enrollRoleInfo.RoleName - Return PortalSecurity.IsInRole(roleName) - End If - Catch - End Try - Return False - End Function - - - End Class - -#End Region - -#Region "EventPPErrorLogController Class" - - Public Class EventPpErrorLogController - Public Function EventsPpErrorLogAdd(ByVal objEventPpErrorLog As EventPPErrorLogInfo) As EventPPErrorLogInfo - Return CType(CBO.FillObject(DataProvider.Instance().EventsPpErrorLogAdd(objEventPpErrorLog.SignupID, _ - objEventPpErrorLog.PayPalStatus, objEventPpErrorLog.PayPalReason, objEventPpErrorLog.PayPalTransID, objEventPpErrorLog.PayPalPayerID, _ - objEventPpErrorLog.PayPalPayerStatus, objEventPpErrorLog.PayPalRecieverEmail, objEventPpErrorLog.PayPalUserEmail, _ - objEventPpErrorLog.PayPalPayerEmail, objEventPpErrorLog.PayPalFirstName, objEventPpErrorLog.PayPalLastName, objEventPpErrorLog.PayPalAddress, _ - objEventPpErrorLog.PayPalCity, objEventPpErrorLog.PayPalState, objEventPpErrorLog.PayPalZip, objEventPpErrorLog.PayPalCountry, _ - objEventPpErrorLog.PayPalCurrency, objEventPpErrorLog.PayPalPaymentDate, objEventPpErrorLog.PayPalAmount, objEventPpErrorLog.PayPalFee _ - ), GetType(EventPPErrorLogInfo)), EventPPErrorLogInfo) - End Function - - End Class -#End Region - -#Region "EventCategoryController Class" - Public Class EventCategoryController - Public Sub EventsCategoryDelete(ByVal category As Integer, ByVal portalID As Integer) - DataProvider.Instance().EventsCategoryDelete(category, portalID) - End Sub - - Public Function EventCategoryGet(ByVal category As Integer, ByVal portalID As Integer) As EventCategoryInfo - Return CType(CBO.FillObject(DataProvider.Instance().EventsCategoryGet(category, portalID), GetType(EventCategoryInfo)), EventCategoryInfo) - End Function - - Public Function EventCategoryGetByName(ByVal categoryName As String, ByVal portalID As Integer) As EventCategoryInfo - Return CType(CBO.FillObject(DataProvider.Instance().EventsCategoryGetByName(categoryName, portalID), GetType(EventCategoryInfo)), EventCategoryInfo) - End Function - - Public Function EventsCategoryList(ByVal portalID As Integer) As ArrayList - Return CBO.FillCollection(DataProvider.Instance().EventsCategoryList(portalID), GetType(EventCategoryInfo)) - End Function - - Public Function EventsCategorySave(ByVal objEventCategory As EventCategoryInfo) As EventCategoryInfo - Return CType(CBO.FillObject(DataProvider.Instance().EventsCategorySave(objEventCategory.PortalID, _ - objEventCategory.Category, objEventCategory.CategoryName, objEventCategory.Color, objEventCategory.FontColor), _ - GetType(EventCategoryInfo)), EventCategoryInfo) - End Function - End Class -#End Region - -#Region "EventLocationController Class" - Public Class EventLocationController - Public Sub EventsLocationDelete(ByVal location As Integer, ByVal portalID As Integer) - DataProvider.Instance().EventsLocationDelete(location, portalID) - End Sub - - Public Function EventsLocationGet(ByVal location As Integer, ByVal portalID As Integer) As EventLocationInfo - Return CType(CBO.FillObject(DataProvider.Instance().EventsLocationGet(location, portalID), GetType(EventLocationInfo)), EventLocationInfo) - End Function - - Public Function EventsLocationGetByName(ByVal locationName As String, ByVal portalID As Integer) As EventLocationInfo - Return CType(CBO.FillObject(DataProvider.Instance().EventsLocationGetByName(locationName, portalID), GetType(EventLocationInfo)), EventLocationInfo) - End Function - - Public Function EventsLocationList(ByVal portalID As Integer) As ArrayList - Return CBO.FillCollection(DataProvider.Instance().EventsLocationList(portalID), GetType(EventLocationInfo)) - End Function - - Public Function EventsLocationSave(ByVal objEventLocation As EventLocationInfo) As EventLocationInfo - Return CType(CBO.FillObject(DataProvider.Instance().EventsLocationSave(objEventLocation.PortalID, _ - objEventLocation.Location, objEventLocation.LocationName, objEventLocation.MapURL, _ - objEventLocation.Street, objEventLocation.PostalCode, objEventLocation.City, _ - objEventLocation.Region, objEventLocation.Country), _ - GetType(EventLocationInfo)), EventLocationInfo) - End Function - End Class -#End Region - -#Region "EventNotificationController Class" - Public Class EventNotificationController - Public Sub EventsNotificationTimeChange(ByVal eventID As Integer, ByVal eventTimeBegin As DateTime, ByVal moduleID As Integer) - DataProvider.Instance().EventsNotificationTimeChange(eventID, eventTimeBegin, moduleID) - End Sub - - Public Sub EventsNotificationDelete(ByVal deleteDate As DateTime) - DataProvider.Instance().EventsNotificationDelete(deleteDate) - End Sub - - Public Function EventsNotificationGet(ByVal eventID As Integer, ByVal userEmail As String, ByVal moduleID As Integer) As EventNotificationInfo - Return CType(CBO.FillObject(DataProvider.Instance().EventsNotificationGet(eventID, userEmail, moduleID), GetType(EventNotificationInfo)), EventNotificationInfo) - End Function - - Public Function EventsNotificationsToSend(ByVal notifyTime As DateTime) As ArrayList - Return CBO.FillCollection(DataProvider.Instance().EventsNotificationsToSend(notifyTime), GetType(EventNotificationInfo)) - End Function - - Public Function EventsNotificationSave(ByVal objEventNotification As EventNotificationInfo) As EventNotificationInfo - Return CType(CBO.FillObject(DataProvider.Instance().EventsNotificationSave(objEventNotification.NotificationID, objEventNotification.EventID, objEventNotification.PortalAliasID, objEventNotification.UserEmail, objEventNotification.NotificationSent, objEventNotification.NotifyByDateTime, objEventNotification.EventTimeBegin, objEventNotification.NotifyLanguage, objEventNotification.ModuleID, objEventNotification.TabID), _ - GetType(EventNotificationInfo)), EventNotificationInfo) - End Function - - Public Function NotifyInfo(ByVal itemID As Integer, ByVal email As String, ByVal moduleID As Integer, ByVal localResourceFile As String, ByVal displayTimeZoneId As String) As String - Dim notiinfo As String = "" - Dim objEventNotification As EventNotificationInfo - objEventNotification = EventsNotificationGet(itemID, email, moduleID) - If Not objEventNotification Is Nothing Then - Dim objEventTimeZoneUtilities As New EventTimeZoneUtilities - Dim notifyDisplay As DateTime = objEventTimeZoneUtilities.ConvertFromUTCToDisplayTimeZone(objEventNotification.NotifyByDateTime, displayTimeZoneId).EventDate - notiinfo = String.Format(Localization.GetString("lblReminderConfirmation", localResourceFile), notifyDisplay.ToString) - End If - Return notiinfo - End Function - - ' Creates Event Schedule (if Not already installed) - Public Sub InstallEventSchedule() - Dim objScheduleItem As Services.Scheduling.ScheduleItem - objScheduleItem = Services.Scheduling.SchedulingProvider.Instance().GetSchedule("DotNetNuke.Modules.Events.EventNotification, DotNetNuke.Modules.Events", Nothing) - If objScheduleItem Is Nothing Then - objScheduleItem = New Services.Scheduling.ScheduleItem - objScheduleItem.TypeFullName = "DotNetNuke.Modules.Events.EventNotification, DotNetNuke.Modules.Events" - objScheduleItem.TimeLapse = 1 - objScheduleItem.TimeLapseMeasurement = "h" - objScheduleItem.RetryTimeLapse = 30 - objScheduleItem.RetryTimeLapseMeasurement = "m" - objScheduleItem.RetainHistoryNum = 10 - objScheduleItem.Enabled = True - objScheduleItem.ObjectDependencies = "" - objScheduleItem.FriendlyName = "DNN Events" - Services.Scheduling.SchedulingProvider.Instance().AddSchedule(objScheduleItem) - Else - objScheduleItem.FriendlyName = "DNN Events" - Services.Scheduling.SchedulingProvider.Instance().UpdateSchedule(objScheduleItem) - End If - End Sub - - End Class -#End Region - - - -#Region "EventRecurMasterController Class " - Public Class EventRecurMasterController - Public Sub EventsRecurMasterDelete(ByVal recurMasterID As Integer, ByVal moduleID As Integer) - - ' Delete ContentItems for the Events - Dim objCtlEvent As New EventController - Dim lstEvents As ArrayList = objCtlEvent.EventsGetRecurrences(recurMasterID, moduleID) - ' Dim cntTaxonomy As New Content - Dim cntJournal As New Journal - For Each objEvent As EventInfo In lstEvents - ' cntTaxonomy.DeleteContentItem(objEvent.ContentItemID) - If objEvent.JournalItem Then - cntJournal.DeleteEvent(objEvent) - End If - Next - - ' Delete ContentItem for recurmaster - ' Dim objCtlEventRecurMaster As New EventRecurMasterController - ' Dim objEventRecurMaster As EventRecurMasterInfo = objCtlEventRecurMaster.EventsRecurMasterGet(RecurMasterID, ModuleID) - ' If Not objEventRecurMaster Is Nothing Then - ' cntTaxonomy.DeleteContentItem(objEventRecurMaster.ContentItemID) - ' End If - - ' Delete recurmaster - DataProvider.Instance().EventsRecurMasterDelete(recurMasterID, moduleID) - End Sub - - Public Function EventsRecurMasterGet(ByVal recurMasterID As Integer, ByVal moduleID As Integer) As EventRecurMasterInfo - Return CType(CBO.FillObject(DataProvider.Instance().EventsRecurMasterGet(recurMasterID, moduleID), GetType(EventRecurMasterInfo)), EventRecurMasterInfo) - End Function - - Public Function EventsRecurMasterSave(ByVal objEventRecurMaster As EventRecurMasterInfo, ByVal tabId As Integer, ByVal updateContent As Boolean) As EventRecurMasterInfo - ' Dim cntTaxonomy As New Content - ' If UpdateContent Then - ' If Not objEventRecurMaster.ContentItemID = Nothing And objEventRecurMaster.ContentItemID <> 0 Then - ' cntTaxonomy.UpdateContentEventRecurMaster(objEventRecurMaster) - ' End If - ' End If - - Dim objEventRecurMasterOut As EventRecurMasterInfo = EventsRecurMasterSave(objEventRecurMaster) - - ' If UpdateContent And objEventRecurMaster.RecurMasterID = -1 Then - ' If objEventRecurMasterOut.ContentItemID = 0 And Not TabId = Nothing Then - ' objEventRecurMasterOut.ContentItemID = cntTaxonomy.CreateContentEventRecurMaster(objEventRecurMasterOut, TabId).ContentItemId - ' EventsRecurMasterSave(objEventRecurMasterOut) - ' End If - ' End If - - Return objEventRecurMasterOut - - End Function - - - Public Function EventsRecurMasterSave(ByVal objEventRecurMaster As EventRecurMasterInfo) As EventRecurMasterInfo - Return CType(CBO.FillObject(DataProvider.Instance().EventsRecurMasterSave(objEventRecurMaster.RecurMasterID, _ - objEventRecurMaster.ModuleID, objEventRecurMaster.PortalID, objEventRecurMaster.RRULE, objEventRecurMaster.DTSTART, objEventRecurMaster.Duration, _ - objEventRecurMaster.Until, objEventRecurMaster.EventName, objEventRecurMaster.EventDesc, objEventRecurMaster.Importance, _ - objEventRecurMaster.Notify, objEventRecurMaster.Approved, objEventRecurMaster.Signups, objEventRecurMaster.MaxEnrollment, _ - objEventRecurMaster.EnrollRoleID, objEventRecurMaster.EnrollFee, objEventRecurMaster.EnrollType, objEventRecurMaster.PayPalAccount, _ - objEventRecurMaster.DetailPage, objEventRecurMaster.DetailNewWin, objEventRecurMaster.DetailURL, objEventRecurMaster.ImageURL, objEventRecurMaster.ImageType, objEventRecurMaster.ImageWidth, _ - objEventRecurMaster.ImageHeight, objEventRecurMaster.ImageDisplay, objEventRecurMaster.Location, objEventRecurMaster.Category, _ - objEventRecurMaster.Reminder, objEventRecurMaster.SendReminder, objEventRecurMaster.ReminderTime, _ - objEventRecurMaster.ReminderTimeMeasurement, objEventRecurMaster.ReminderFrom, objEventRecurMaster.CustomField1, _ - objEventRecurMaster.CustomField2, objEventRecurMaster.EnrollListView, objEventRecurMaster.DisplayEndDate, _ - objEventRecurMaster.AllDayEvent, objEventRecurMaster.CultureName, objEventRecurMaster.OwnerID, objEventRecurMaster.CreatedByID, _ - objEventRecurMaster.UpdatedByID, objEventRecurMaster.EventTimeZoneId, objEventRecurMaster.AllowAnonEnroll, objEventRecurMaster.ContentItemID, _ - objEventRecurMaster.SocialGroupID, objEventRecurMaster.SocialUserID, objEventRecurMaster.Summary), GetType(EventRecurMasterInfo)), EventRecurMasterInfo) - End Function - - Public Function EventsRecurMasterModerate(ByVal moduleID As Integer, ByVal socialGroupId As Integer) As ArrayList - Return CBO.FillCollection(DataProvider.Instance().EventsRecurMasterModerate(moduleID, socialGroupId), GetType(EventRecurMasterInfo)) - End Function - - Public Function DecomposeRRULE(ByVal strRRULE As String, ByVal dtStart As DateTime) As EventRRULEInfo - Dim objEventRRULE As New EventRRULEInfo - With objEventRRULE - Dim intEqual, intKeyEnd As Integer - Dim strKey, strValue As String - strRRULE = strRRULE + ";" - .FreqBasic = False - While Len(strRRULE) > 1 - intEqual = InStr(strRRULE, "=") - intKeyEnd = InStr(strRRULE, ";") - strKey = Left(strRRULE, intEqual - 1) - strValue = Mid(strRRULE, intEqual + 1, intKeyEnd - intEqual - 1) - Select Case strKey - Case "FREQ" - .Freq = strValue - Case "WKST" - .WKST = strValue - Case "INTERVAL" - .Interval = CInt(strValue) - Case "BYDAY" - .ByDay = strValue - If IsNumeric(Left(strValue, 2)) Then - If InStr(strValue, "SU") > 0 Then - .Su = True - .SuNo = CInt(Left(strValue, 2)) - End If - If InStr(strValue, "MO") > 0 Then - .Mo = True - .MoNo = CInt(Left(strValue, 2)) - End If - If InStr(strValue, "TU") > 0 Then - .Tu = True - .TuNo = CInt(Left(strValue, 2)) - End If - If InStr(strValue, "WE") > 0 Then - .We = True - .WeNo = CInt(Left(strValue, 2)) - End If - If InStr(strValue, "TH") > 0 Then - .Th = True - .ThNo = CInt(Left(strValue, 2)) - End If - If InStr(strValue, "FR") > 0 Then - .Fr = True - .FrNo = CInt(Left(strValue, 2)) - End If - If InStr(strValue, "SA") > 0 Then - .Sa = True - .SaNo = CInt(Left(strValue, 2)) - End If - Else - If InStr(strValue, "SU") > 0 Then - .Su = True - .SuNo = Nothing - End If - If InStr(strValue, "MO") > 0 Then - .Mo = True - .MoNo = Nothing - End If - If InStr(strValue, "TU") > 0 Then - .Tu = True - .TuNo = Nothing - End If - If InStr(strValue, "WE") > 0 Then - .We = True - .WeNo = Nothing - End If - If InStr(strValue, "TH") > 0 Then - .Th = True - .ThNo = Nothing - End If - If InStr(strValue, "FR") > 0 Then - .Fr = True - .FrNo = Nothing - End If - If InStr(strValue, "SA") > 0 Then - .Sa = True - .SaNo = Nothing - End If - End If - Case "BYMONTH" - .ByMonth = CInt(strValue) - Case "BYMONTHDAY" - .ByMonthDay = CInt(strValue) - End Select - strRRULE = Mid(strRRULE, intKeyEnd + 1) - End While - Select Case .Freq - Case "YEARLY" - If .ByMonth = 0 And .ByMonthDay = 0 Then - .FreqBasic = True - End If - If .ByMonth = 0 Then - .ByMonth = dtStart.Month - End If - If .ByMonthDay = 0 Then - .ByMonthDay = dtStart.Day - End If - Case "MONTHLY" - If .ByMonthDay = 0 And IsNothing(.ByDay) Then - .ByMonthDay = dtStart.Day - .FreqBasic = True - End If - Case "WEEKLY" - If IsNothing(.ByDay) Then - .FreqBasic = True - Dim dtdow As DayOfWeek = dtStart.DayOfWeek - Select Case dtdow - Case DayOfWeek.Sunday - .Su = True - .SuNo = Nothing - .ByDay = "SU" - Case DayOfWeek.Monday - .Mo = True - .MoNo = Nothing - .ByDay = "MO" - Case DayOfWeek.Tuesday - .Tu = True - .TuNo = Nothing - .ByDay = "TU" - Case DayOfWeek.Wednesday - .We = True - .WeNo = Nothing - .ByDay = "WE" - Case DayOfWeek.Thursday - .Th = True - .ThNo = Nothing - .ByDay = "TH" - Case DayOfWeek.Friday - .Fr = True - .FrNo = Nothing - .ByDay = "FR" - Case DayOfWeek.Saturday - .Sa = True - .SaNo = Nothing - .ByDay = "SA" - End Select - End If - End Select - End With - Return objEventRRULE - End Function - - Public Function CreateEventRecurrences(ByVal objEventRecurMaster As EventRecurMasterInfo, ByVal intDuration As Integer, ByVal maxRecurrences As String) As ArrayList - Dim dtStart As DateTime = objEventRecurMaster.DTSTART - Dim objCtlEventRecurMaster As New EventRecurMasterController - Dim objEventRRULE As EventRRULEInfo = objCtlEventRecurMaster.DecomposeRRULE(objEventRecurMaster.RRULE, objEventRecurMaster.DTSTART) - Dim lstEvents As New ArrayList - Dim nextDate As DateTime = dtStart.Date - Dim blAddDate As Boolean = True - While nextDate <= objEventRecurMaster.Until - If objEventRRULE.ByMonth <> 0 And nextDate.Month <> objEventRRULE.ByMonth Then - blAddDate = False - End If - If objEventRRULE.ByMonthDay <> 0 And nextDate.Day <> objEventRRULE.ByMonthDay Then - blAddDate = False - End If - If Not IsNothing(objEventRRULE.ByDay) Then - Dim dtdow As DayOfWeek = nextDate.DayOfWeek - Select Case dtdow - Case DayOfWeek.Sunday - blAddDate = CheckWeekday(nextDate, objEventRRULE.Su, objEventRRULE.SuNo, blAddDate) - Case DayOfWeek.Monday - blAddDate = CheckWeekday(nextDate, objEventRRULE.Mo, objEventRRULE.MoNo, blAddDate) - Case DayOfWeek.Tuesday - blAddDate = CheckWeekday(nextDate, objEventRRULE.Tu, objEventRRULE.TuNo, blAddDate) - Case DayOfWeek.Wednesday - blAddDate = CheckWeekday(nextDate, objEventRRULE.We, objEventRRULE.WeNo, blAddDate) - Case DayOfWeek.Thursday - blAddDate = CheckWeekday(nextDate, objEventRRULE.Th, objEventRRULE.ThNo, blAddDate) - Case DayOfWeek.Friday - blAddDate = CheckWeekday(nextDate, objEventRRULE.Fr, objEventRRULE.FrNo, blAddDate) - Case DayOfWeek.Saturday - blAddDate = CheckWeekday(nextDate, objEventRRULE.Sa, objEventRRULE.SaNo, blAddDate) - End Select - End If - - If blAddDate = True Then - Select Case objEventRRULE.Freq - Case "YEARLY" - Dim intYear As Integer = CInt(DateDiff(DateInterval.Year, dtStart.Date, nextDate)) - ' ReSharper disable CompareOfFloatsByEqualityOperator - If intYear / objEventRRULE.Interval <> CInt(intYear / objEventRRULE.Interval) Then - ' ReSharper restore CompareOfFloatsByEqualityOperator - blAddDate = False - End If - Case "MONTHLY" - Dim intMonth As Integer = CInt(DateDiff(DateInterval.Month, dtStart.Date, nextDate)) - ' ReSharper disable CompareOfFloatsByEqualityOperator - If intMonth / objEventRRULE.Interval <> CInt(intMonth / objEventRRULE.Interval) Then - ' ReSharper restore CompareOfFloatsByEqualityOperator - blAddDate = False - End If - Case "WEEKLY" - Dim fdow As Microsoft.VisualBasic.FirstDayOfWeek - If objEventRRULE.WKST = "SU" Then - fdow = Microsoft.VisualBasic.FirstDayOfWeek.Sunday - Else - fdow = Microsoft.VisualBasic.FirstDayOfWeek.Monday - End If - Dim intWeek As Integer = CInt(DateDiff(DateInterval.WeekOfYear, dtStart.Date, nextDate, fdow)) - ' ReSharper disable CompareOfFloatsByEqualityOperator - If intWeek / objEventRRULE.Interval <> CInt(intWeek / objEventRRULE.Interval) Then - ' ReSharper restore CompareOfFloatsByEqualityOperator - blAddDate = False - End If - Case "DAILY" - Dim intDay As Integer = CInt(DateDiff(DateInterval.Day, dtStart.Date, nextDate)) - ' ReSharper disable CompareOfFloatsByEqualityOperator - If intDay / objEventRRULE.Interval <> CInt(intDay / objEventRRULE.Interval) Then - ' ReSharper restore CompareOfFloatsByEqualityOperator - blAddDate = False - End If - End Select - End If - If blAddDate = True Then - Dim objEvent As New EventInfo - objEvent.EventTimeBegin = nextDate.Date + dtStart.TimeOfDay - objEvent.Duration = intDuration - objEvent.OriginalDateBegin = nextDate.Date - With objEventRecurMaster - objEvent.EventID = -1 - objEvent.RecurMasterID = .RecurMasterID - objEvent.ModuleID = .ModuleID - objEvent.PortalID = .PortalID - objEvent.EventName = .EventName - objEvent.EventDesc = .EventDesc - objEvent.Importance = CType(.Importance, EventInfo.Priority) - objEvent.Notify = .Notify - objEvent.Approved = .Approved - objEvent.Signups = .Signups - objEvent.AllowAnonEnroll = .AllowAnonEnroll - objEvent.JournalItem = .JournalItem - objEvent.MaxEnrollment = .MaxEnrollment - objEvent.EnrollRoleID = .EnrollRoleID - objEvent.EnrollFee = .EnrollFee - objEvent.EnrollType = .EnrollType - objEvent.PayPalAccount = .PayPalAccount - objEvent.DetailPage = .DetailPage - objEvent.DetailNewWin = .DetailNewWin - objEvent.DetailURL = .DetailURL - objEvent.ImageURL = .ImageURL - objEvent.ImageType = .ImageType - objEvent.ImageWidth = .ImageWidth - objEvent.ImageHeight = .ImageHeight - objEvent.ImageDisplay = .ImageDisplay - objEvent.Location = .Location - objEvent.Category = .Category - objEvent.Reminder = .Reminder - objEvent.SendReminder = .SendReminder - objEvent.ReminderTime = .ReminderTime - objEvent.ReminderTimeMeasurement = .ReminderTimeMeasurement - objEvent.ReminderFrom = .ReminderFrom - objEvent.CustomField1 = .CustomField1 - objEvent.CustomField2 = .CustomField2 - objEvent.EnrollListView = .EnrollListView - objEvent.DisplayEndDate = .DisplayEndDate - objEvent.AllDayEvent = .AllDayEvent - objEvent.OwnerID = .OwnerID - objEvent.CreatedByID = .CreatedByID - objEvent.LastUpdatedID = .UpdatedByID - objEvent.Cancelled = False - objEvent.SearchSubmitted = False - objEvent.NewEventEmailSent = objEvent.Approved - objEvent.SocialGroupId = .SocialGroupID - objEvent.SocialUserId = .SocialUserID - objEvent.Summary = .Summary - objEvent.UpdateStatus = "Add" - End With - lstEvents.Add(objEvent) - If maxRecurrences <> "" Then - If lstEvents.Count = CInt(maxRecurrences) Then - objEventRecurMaster.Until = objEvent.EventTimeBegin.Date - Exit While - End If - End If - End If - nextDate = DateAdd(DateInterval.Day, 1, nextDate) - blAddDate = True - End While - Return lstEvents - End Function - - Private Function CheckWeekday(ByVal dtDate As DateTime, ByVal blDay As Boolean, ByVal intDayNo As Integer, ByVal blAddDate As Boolean) As Boolean - If blAddDate = False Then - Return False - End If - - If Not blDay Then - Return False - End If - - If IsNothing(intDayNo) Or intDayNo = 0 Then - Return True - End If - - If intDayNo > 0 Then - ' ReSharper disable CompareOfFloatsByEqualityOperator - If Int((dtDate.Day - 1) / 7) = intDayNo - 1 Then - ' ReSharper restore CompareOfFloatsByEqualityOperator - Return True - End If - Else - Dim intDaysInMonth As Integer - intDaysInMonth = DateTime.DaysInMonth(dtDate.Year, dtDate.Month) - ' ReSharper disable CompareOfFloatsByEqualityOperator - If Int((intDaysInMonth - dtDate.Day) / 7) = (intDayNo * -1) - 1 Then - ' ReSharper restore CompareOfFloatsByEqualityOperator - Return True - End If - End If - - Return False - - End Function - - Public Function RepeatType(ByVal objEventRRULE As EventRRULEInfo) As String - Dim strRepeatType As String = "N" - Select Case objEventRRULE.Freq - Case "DAILY" - strRepeatType = "P1" - Case "WEEKLY" - If objEventRRULE.FreqBasic Then - strRepeatType = "P1" - Else - strRepeatType = "W1" - End If - Case "MONTHLY" - If objEventRRULE.FreqBasic Then - strRepeatType = "P1" - ElseIf Not IsNothing(objEventRRULE.ByDay) Then - strRepeatType = "M1" - Else - strRepeatType = "M2" - End If - Case "YEARLY" - If objEventRRULE.FreqBasic Then - strRepeatType = "P1" - Else - strRepeatType = "Y1" - End If - End Select - Return strRepeatType - End Function - - Public Function RecurrenceText(ByVal objEventRRULE As EventRRULEInfo, ByVal localResourceFile As String, ByVal culture As CultureInfo, ByVal eventDateBegin As DateTime) As String - Dim lblEventText As String = "" - Dim strRepeatType As String = RepeatType(objEventRRULE) - Select Case strRepeatType - Case "N" - lblEventText = Localization.GetString("OneTimeEvent", localResourceFile) - Case "P1" - Dim txtEvent As String = "" - Select Case Trim(Left(objEventRRULE.Freq, 1)) - Case "D" - txtEvent = Localization.GetString("EveryXDays", localResourceFile) - Case "W" - txtEvent = Localization.GetString("EveryXWeeks", localResourceFile) - Case "M" - txtEvent = Localization.GetString("EveryXMonths", localResourceFile) - Case "Y" - txtEvent = Localization.GetString("EveryXYears", localResourceFile) - End Select - lblEventText = String.Format(txtEvent, objEventRRULE.Interval.ToString) - Case "W1" - Dim txtdays As String = "" - If objEventRRULE.Su Then - txtdays += culture.DateTimeFormat.DayNames(DayOfWeek.Sunday) - End If - If objEventRRULE.Mo Then - If Trim(txtdays).Length > 0 Then - txtdays += ", " - End If - txtdays += culture.DateTimeFormat.DayNames(DayOfWeek.Monday) - End If - If objEventRRULE.Tu Then - If Trim(txtdays).Length > 0 Then - txtdays += ", " - End If - txtdays += culture.DateTimeFormat.DayNames(DayOfWeek.Tuesday) - End If - If objEventRRULE.We Then - If Trim(txtdays).Length > 0 Then - txtdays += ", " - End If - txtdays += culture.DateTimeFormat.DayNames(DayOfWeek.Wednesday) - End If - If objEventRRULE.Th Then - If Trim(txtdays).Length > 0 Then - txtdays += ", " - End If - txtdays += culture.DateTimeFormat.DayNames(DayOfWeek.Thursday) - End If - If objEventRRULE.Fr Then - If Trim(txtdays).Length > 0 Then - txtdays += ", " - End If - txtdays += culture.DateTimeFormat.DayNames(DayOfWeek.Friday) - End If - If objEventRRULE.Sa Then - If Trim(txtdays).Length > 0 Then - txtdays += ", " - End If - txtdays += culture.DateTimeFormat.DayNames(DayOfWeek.Saturday) - End If - lblEventText = String.Format(Localization.GetString("RecurringWeeksOn", localResourceFile), objEventRRULE.Interval.ToString, txtdays) - Case "M1" - Dim txtDay As String = "" - Dim txtWeek As String = "" - Dim intEvery As Integer - If objEventRRULE.Su Then - txtDay = culture.DateTimeFormat.DayNames(DayOfWeek.Sunday) - intEvery = objEventRRULE.SuNo - End If - If objEventRRULE.Mo Then - txtDay = culture.DateTimeFormat.DayNames(DayOfWeek.Monday) - intEvery = objEventRRULE.MoNo() - End If - If objEventRRULE.Tu Then - txtDay = culture.DateTimeFormat.DayNames(DayOfWeek.Tuesday) - intEvery = objEventRRULE.TuNo - End If - If objEventRRULE.We Then - txtDay = culture.DateTimeFormat.DayNames(DayOfWeek.Wednesday) - intEvery = objEventRRULE.WeNo - End If - If objEventRRULE.Th Then - txtDay = culture.DateTimeFormat.DayNames(DayOfWeek.Thursday) - intEvery = objEventRRULE.ThNo - End If - If objEventRRULE.Fr Then - txtDay = culture.DateTimeFormat.DayNames(DayOfWeek.Friday) - intEvery = objEventRRULE.FrNo - End If - If objEventRRULE.Sa Then - txtDay = culture.DateTimeFormat.DayNames(DayOfWeek.Saturday) - intEvery = objEventRRULE.SaNo - End If - Select Case Trim(CType(intEvery, String)) - Case "1" - txtWeek = Localization.GetString("First", localResourceFile) - Case "2" - txtWeek = Localization.GetString("Second", localResourceFile) - Case "3" - txtWeek = Localization.GetString("Third", localResourceFile) - Case "4" - txtWeek = Localization.GetString("Fourth", localResourceFile) - Case "-1" - txtWeek = Localization.GetString("Last", localResourceFile) - End Select - If objEventRRULE.Interval = 1 Then - lblEventText = String.Format(Localization.GetString("RecurringInMonth", localResourceFile), txtWeek, txtDay) - Else - lblEventText = String.Format(Localization.GetString("RecurringEveryMonth2", localResourceFile), Trim(objEventRRULE.Interval.ToString), txtWeek, txtDay) - End If - Case "M2" - lblEventText = String.Format(Localization.GetString("RecurringEveryMonth", localResourceFile), Trim(objEventRRULE.Interval.ToString), Localization.GetString(CType(objEventRRULE.ByMonthDay, String), localResourceFile)) - Case "Y1" - lblEventText = String.Format(Localization.GetString("RecurringYearsOn", localResourceFile), eventDateBegin) - - End Select - Return lblEventText - End Function - - Public Function RecurrenceInfo(ByVal objEvent As EventInfo, ByVal localResourceFile As String) As String - Dim recinfo As String - recinfo = String.Format(Localization.GetString("RecurringUntil", localResourceFile), objEvent.LastRecurrence.ToString("d"), objEvent.NoOfRecurrences.ToString) - Return recinfo - End Function - - End Class -#End Region - -#Region "EventSubscriptionController Class" - Public Class EventSubscriptionController - Public Sub EventsSubscriptionDeleteUser(ByVal userID As Integer, ByVal moduleID As Integer) - DataProvider.Instance().EventsSubscriptionDeleteUser(userID, moduleID) - End Sub - - Public Function EventsSubscriptionGetUser(ByVal userID As Integer, ByVal moduleID As Integer) As EventSubscriptionInfo - Return CType(CBO.FillObject(DataProvider.Instance().EventsSubscriptionGetUser(userID, moduleID), GetType(EventSubscriptionInfo)), EventSubscriptionInfo) - End Function - - Public Function EventsSubscriptionGetModule(ByVal moduleID As Integer) As ArrayList - Return CBO.FillCollection(DataProvider.Instance().EventsSubscriptionGetModule(moduleID), GetType(EventSubscriptionInfo)) - End Function - - Public Function EventsSubscriptionGetSubModule(ByVal moduleID As Integer) As ArrayList - Return CBO.FillCollection(DataProvider.Instance().EventsSubscriptionGetSubModule(moduleID), GetType(EventSubscriptionInfo)) - End Function - - Public Function EventsSubscriptionSave(ByVal objEventSubscription As EventSubscriptionInfo) As EventSubscriptionInfo - Return CType(CBO.FillObject(DataProvider.Instance().EventsSubscriptionSave(objEventSubscription.SubscriptionID, _ - objEventSubscription.ModuleID, objEventSubscription.PortalID, objEventSubscription.UserID), _ - GetType(EventSubscriptionInfo)), EventSubscriptionInfo) - End Function - End Class -#End Region - -#Region "EventEmails Class" - Public Class EventEmails -#Region "Member Variables" - Private _localResourceFile As String - Private _cultureName As String - Private _moduleId As Int32 - Private _portalId As Int32 - Private _currculture As CultureInfo -#End Region - -#Region "Constructor" - Sub New(ByVal portalID As Integer, ByVal moduleID As Integer, ByVal localResourceFile As String) - Me.PortalID = portalID - Me.ModuleID = moduleID - Me.LocalResourceFile = localResourceFile - End Sub - Sub New(ByVal portalID As Integer, ByVal moduleID As Integer, ByVal localResourceFile As String, ByVal cultureName As String) - Me.PortalID = portalID - Me.ModuleID = moduleID - Me.LocalResourceFile = localResourceFile - Me.CultureName = cultureName - End Sub -#End Region - -#Region "Properties" - Private Property PortalID() As Integer - Get - Return _portalId - End Get - Set(ByVal value As Integer) - _portalId = value - End Set - End Property - - Private Property ModuleID() As Integer - Get - Return _moduleId - End Get - Set(ByVal value As Integer) - _moduleId = value - End Set - End Property - - Private Overloads Property LocalResourceFile() As String - Get - Return _localResourceFile - End Get - Set(ByVal value As String) - _localResourceFile = value - End Set - End Property - - Private Property CultureName() As String - Get - Return _cultureName - End Get - Set(ByVal value As String) - _cultureName = value - End Set - End Property - -#End Region - - -#Region "Methods" - Public Sub SendEmails(ByVal objEventEmailInfo As EventEmailInfo, ByVal objEvent As EventInfo) - SendEmails(objEventEmailInfo, objEvent, Nothing, Nothing, Nothing, True) - End Sub - - Public Sub SendEmails(ByVal objEventEmailInfo As EventEmailInfo, ByVal objEvent As EventInfo, ByVal objEventSignups As EventSignupsInfo) - SendEmails(objEventEmailInfo, objEvent, objEventSignups, Nothing, Nothing, True) - End Sub - - Public Sub SendEmails(ByVal objEventEmailInfo As EventEmailInfo, ByVal objEvent As EventInfo, ByVal objEventSignups As EventSignupsInfo, ByVal blTokenReplace As Boolean) - SendEmails(objEventEmailInfo, objEvent, objEventSignups, Nothing, Nothing, blTokenReplace) - End Sub - - Public Sub SendEmails(ByVal objEventEmailInfo As EventEmailInfo, ByVal objEvent As EventInfo, ByVal attachments As Generic.List(Of Net.Mail.Attachment)) - SendEmails(objEventEmailInfo, objEvent, Nothing, attachments, Nothing, True) - End Sub - - Public Sub SendEmails(ByVal objEventEmailInfo As EventEmailInfo, ByVal objEvent As EventInfo, ByVal domainurl As String) - SendEmails(objEventEmailInfo, objEvent, Nothing, Nothing, domainurl, True) - End Sub - - Public Sub SendEmails(ByVal objEventEmailInfo As EventEmailInfo, ByVal objEvent As EventInfo, ByVal objEventSignups As EventSignupsInfo, ByVal attachments As Generic.List(Of Net.Mail.Attachment), ByVal domainurl As String, ByVal blTokenReplace As Boolean) - _currculture = Threading.Thread.CurrentThread.CurrentCulture - - With objEventEmailInfo - Dim userEmail As String - Dim itemNo As Integer = 0 - - Dim ems As New EventModuleSettings - Dim settings As EventModuleSettings = ems.GetEventModuleSettings(ModuleID, LocalResourceFile) - Dim objEventBase As New EventBase - Dim displayTimeZoneId As String = objEventBase.GetDisplayTimeZoneId(settings, objEvent.PortalID, "User") - - For Each userEmail In .UserEmails - Dim usedTimeZoneId As String = displayTimeZoneId - If displayTimeZoneId = "User" Then - usedTimeZoneId = .UserTimeZoneIds.Item(itemNo).ToString - End If - SendSingleEmail(userEmail, .UserLocales.Item(itemNo), objEvent, .txtEmailSubject, .txtEmailBody, .txtEmailFrom(), objEventSignups, attachments, domainurl, usedTimeZoneId, blTokenReplace) - itemNo += 1 - Next - - Dim userID As Integer - For Each userID In .UserIDs - Dim objCtlUser As New UserController - Dim objUser As UserInfo = objCtlUser.GetUser(PortalID, userID) - - If Not objUser Is Nothing Then - Dim usedTimeZoneId As String = displayTimeZoneId - If displayTimeZoneId = "User" Then - usedTimeZoneId = objUser.Profile.PreferredTimeZone.Id - End If - SendSingleEmail(objUser.Email, objUser.Profile.PreferredLocale, objEvent, .txtEmailSubject, .txtEmailBody, .txtEmailFrom(), objEventSignups, attachments, domainurl, usedTimeZoneId, blTokenReplace) - End If - Next - End With - - Threading.Thread.CurrentThread.CurrentCulture = _currculture - - End Sub - - Private Sub SendSingleEmail(ByVal userEmail As String, ByVal userLocale As Object, ByVal objEvent As EventInfo, ByVal txtEmailSubject As String, ByVal txtEmailBody As String, _ - ByVal txtEmailFrom As String, ByVal objEventSignups As EventSignupsInfo, ByVal attachments As Generic.List(Of Net.Mail.Attachment), ByVal domainurl As String, _ - ByVal displayTimeZoneId As String, ByVal blTokenReplace As Boolean) - Dim tcc As TokenReplaceControllerClass - Dim subject As String - Dim body As String - ' ReSharper disable RedundantAssignment - Dim bodyformat As String = "html" - ' ReSharper restore RedundantAssignment - ChangeLocale(userLocale) - - Dim objEventInfoHelper As New EventInfoHelper(ModuleID, Nothing) - objEvent = objEventInfoHelper.ConvertEventToDisplayTimeZone(objEvent.Clone, displayTimeZoneId) - Dim objUsedSignup As New EventSignupsInfo - If Not objEventSignups Is Nothing Then - objUsedSignup = objEventSignups.Clone - Dim objEventTimeZoneUtilities As New EventTimeZoneUtilities - objUsedSignup.PayPalPaymentDate = objEventTimeZoneUtilities.ConvertFromUTCToDisplayTimeZone( _ - objUsedSignup.PayPalPaymentDate, displayTimeZoneId).EventDate - End If - - If blTokenReplace Then - tcc = New TokenReplaceControllerClass(ModuleID, LocalResourceFile) - subject = tcc.TokenReplaceEvent(objEvent, txtEmailSubject, objUsedSignup) - body = tcc.TokenReplaceEvent(objEvent, txtEmailBody, objUsedSignup) - Else - subject = txtEmailSubject - body = txtEmailBody - End If - body = AddHost(body, domainurl) - bodyformat = GetBodyFormat(body) - If bodyformat = "text" Then - body = HtmlUtils.StripTags(body, True) - End If - If Not attachments Is Nothing Then - Dim smtpEnableSsl As Boolean = False - If Entities.Controllers.HostController.Instance.GetString("SMTPEnableSSL") = "Y" Then - smtpEnableSsl = True - End If - Mail.SendMail(txtEmailFrom, userEmail, "", "", "", MailPriority.Normal, subject, MailFormat.Html, Text.Encoding.UTF8, body, attachments, "", "", "", "", smtpEnableSsl) - Else - Mail.SendMail(txtEmailFrom, userEmail, "", subject, body, "", bodyformat, "", "", "", "") - End If - End Sub - - Private Function GetBodyFormat(ByVal body As String) As String - Dim bodyformat As String - Dim ems As New EventModuleSettings - Dim settings As EventModuleSettings = ems.GetEventModuleSettings(ModuleID, LocalResourceFile) - - bodyformat = settings.HTMLEmail - If bodyformat = "auto" Then - If Common.Utilities.HtmlUtils.IsHtml(body) Then - bodyformat = "html" - Else - bodyformat = "text" - End If - End If - Return bodyformat - End Function - - Private Sub ChangeLocale(ByVal userLocale As Object) - Dim strLocale As String = "" - Threading.Thread.CurrentThread.CurrentCulture = _currculture - If Not userLocale Is Nothing Then - strLocale = userLocale.ToString - End If - If Not userLocale Is Nothing And strLocale <> "" Then - Dim userculture As New CultureInfo(strLocale, False) - Threading.Thread.CurrentThread.CurrentCulture = userculture - ElseIf Not CultureName = Nothing Then - Dim userculture As New CultureInfo(CultureName, False) - Threading.Thread.CurrentThread.CurrentCulture = userculture - End If - - End Sub - - Private Function AddHost(ByVal content As String, ByVal domainurl As String) As String - - If domainurl Is Nothing Then - Dim objEventInfoHelper As New EventInfoHelper() - domainurl = objEventInfoHelper.GetDomainURL() - End If - domainurl = AddHTTP(domainurl) - - Dim txtContent As String = content - If domainurl <> "" Then - txtContent = Replace(txtContent, "src=""/", "src=""" & domainurl & "/", , , CompareMethod.Text) - txtContent = Replace(txtContent, "href=""/", "href=""" & domainurl & "/", , , CompareMethod.Text) - End If - Return txtContent - End Function - -#End Region - End Class -#End Region - -#Region "TimeZone Utilities Class" - Public Class EventTimeZoneUtilities - Public Function ConvertFromUTCToDisplayTimeZone(ByVal utcDate As DateTime, ByVal displayTimeZoneId As String) As DateInfo - Dim displayInfo As New DateInfo - displayInfo.EventDate = utcDate - displayInfo.EventTimeZoneId = "UTC" - Try - Dim displayTimeZone As TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(displayTimeZoneId) - displayInfo.EventTimeZoneId = displayTimeZone.Id - displayInfo.EventDate = TimeZoneInfo.ConvertTimeFromUtc(utcDate, displayTimeZone) - Catch ex As Exception - Return displayInfo - End Try - Return displayInfo - End Function - - Public Function ConvertToDisplayTimeZone(ByVal inDate As DateTime, ByVal inTimeZoneId As String, ByVal portalId As Integer, ByVal displayTimeZoneId As String) As DateInfo - Dim displayDateInfo As New DateInfo - If inTimeZoneId = displayTimeZoneId Then - displayDateInfo.EventDate = inDate - displayDateInfo.EventTimeZoneId = inTimeZoneId - Return displayDateInfo - End If - Dim utcDate As DateTime = inDate - If inTimeZoneId <> "UTC" Then - utcDate = ConvertToUTCTimeZone(inDate, inTimeZoneId) - End If - - displayDateInfo.EventDate = utcDate - displayDateInfo.EventTimeZoneId = displayTimeZoneId - If displayTimeZoneId <> "UTC" Then - displayDateInfo = ConvertFromUTCToDisplayTimeZone(utcDate, displayTimeZoneId) - End If - Return displayDateInfo - End Function - - Public Function ConvertToUTCTimeZone(ByVal inDate As DateTime, ByVal inTimeZoneId As String) As DateTime - Dim utcDate As DateTime - Try - Dim inTimeZone As TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(inTimeZoneId) - utcDate = TimeZoneInfo.ConvertTimeToUtc(inDate, inTimeZone) - Catch ex As Exception - Return inDate - End Try - Return utcDate - End Function - - Public Function ConvertFromUTCToModuleTimeZone(ByVal utcDate As DateTime, ByVal moduleTimeZoneId As String) As DateTime - Dim moduleDate As DateTime - Try - Dim moduleTimeZone As TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(moduleTimeZoneId) - moduleDate = TimeZoneInfo.ConvertTimeFromUtc(utcDate, moduleTimeZone) - Catch ex As Exception - Return utcDate - End Try - Return moduleDate - End Function - - Public Class DateInfo - Private _eventDate As DateTime - Private _eventTimeZoneId As String - - Property EventDate() As DateTime - Get - Return _EventDate - End Get - Set(ByVal value As DateTime) - _eventDate = Value - End Set - End Property - - Property EventTimeZoneId() As String - Get - Return _EventTimeZoneId - End Get - Set(ByVal value As String) - _eventTimeZoneId = Value - End Set - End Property - - End Class - End Class - -#End Region - -End Namespace diff --git a/Components/EventInfo.cs b/Components/EventInfo.cs new file mode 100644 index 0000000..438891b --- /dev/null +++ b/Components/EventInfo.cs @@ -0,0 +1,6087 @@ +using System.Drawing; +using Microsoft.VisualBasic; +using System.Web.UI.WebControls; +using System.Collections; +using System; + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events + { + +#region EventInfo Class + + public class EventInfo : IComparable + { + /// + /// Priority setting for events, can be used to display appropriate icons in an event + /// + public enum Priority + { + /// + /// High priority + /// + High = 1, + /// + /// Medium priority + /// + Medium = 2, + /// + /// Low priority + /// + Low = 3 + } + +#region Private Members + private int _portalID; + private int _eventID; + private int _recurMasterID; + private int _moduleID; + private DateTime _eventDateEnd; + private DateTime _eventTimeBegin; + private int _duration; + private string _eventName = string.Empty; + private string _eventDesc = string.Empty; + private int _importance; + private DateTime _createdDate; + private string _createdBy = string.Empty; + private int _createdByID; + // ReSharper disable UnassignedField.Local + private int _every; + private string _period = string.Empty; + private string _repeatType = string.Empty; + // ReSharper restore UnassignedField.Local + private string _notify = string.Empty; + private bool _approved; + private int _maxEnrollment; + private bool _signups; + private int _enrolled; + private int _noOfRecurrences; + private DateTime _lastRecurrence; + private int _enrollRoleID = 0; + private string _enrollType = string.Empty; + private decimal _enrollFee; + private string _payPalAccount = string.Empty; + private bool _cancelled; + private bool _detailPage; + private bool _detailNewWin; + private string _detailURL = string.Empty; + private string _imageURL = string.Empty; + private string _imageType = string.Empty; + private int _imageWidth; + private int _imageHeight; + private int _location; + private string _locationName = string.Empty; + private string _mapURL = string.Empty; + private int _category; + private string _categoryName = string.Empty; + private string _color = string.Empty; + private string _fontColor = string.Empty; + private bool _imageDisplay; + private bool _sendReminder; + private int _reminderTime; + private string _reminderTimeMeasurement = string.Empty; + private string _reminder = string.Empty; + private string _reminderFrom = string.Empty; + private bool _searchSubmitted; + private string _moduleTitle = string.Empty; + private string _customField1 = string.Empty; + private string _customField2 = string.Empty; + private bool _enrollListView; + private bool _displayEndDate; + private bool _allDayEvent; + private int _ownerID; + private string _ownerName = string.Empty; + private DateTime _lastUpdatedAt; + private string _lastUpdatedBy = string.Empty; + private int _lastUpdatedID; + private DateTime _originalDateBegin; + private string _updateStatus = string.Empty; + private string _rrule = string.Empty; + private int _rmOwnerID; + private bool _newEventEmailSent; + private bool _isPrivate; + private string _eventTimeZoneId = string.Empty; + private string _otherTimeZoneId = string.Empty; + private bool _allowAnonEnroll; + private int _contentItemId; + private bool _journalItem; + private int _socialGroupId; + private int _socialUserId; + private string _summary = string.Empty; + private int _sequence; + private int _rmSequence; + private string _socialUserUserName = string.Empty; + private string _socialUserDisplayName = string.Empty; + + +#endregion + +#region Constructors + + // initialization + /// + /// Initializes a new instance of the class. + /// + public EventInfo() + { + } +#endregion + +#region Public Properties + + // public properties + /// + /// Gets or sets the portal ID. + /// + /// The portal ID. + public int PortalID + { + get + { + return _portalID; + } + set + { + _portalID = value; + } + } + + /// + /// Gets or sets the event ID. + /// + /// The event ID. + public int EventID + { + get + { + return _eventID; + } + set + { + _eventID = value; + } + } + + /// + /// Gets or sets the recurring master ID. + /// + /// The recur master ID. + public int RecurMasterID + { + get + { + return _recurMasterID; + } + set + { + _recurMasterID = value; + } + } + + /// + /// Gets or sets the module ID. + /// + /// The module ID. + public int ModuleID + { + get + { + return _moduleID; + } + set + { + _moduleID = value; + } + } + + /// + /// Gets or sets the event date end. + /// + /// The event date end. + [Obsolete("EventDateEnd is only retained for upgrade from versions prior to 4.1.0")] + public DateTime EventDateEnd + { + get + { + return _eventDateEnd; + } + set + { + _eventDateEnd = value; + } + } + + /// + /// Gets or sets the event time begin. + /// + /// The event time begin. + public DateTime EventTimeBegin + { + get + { + return _eventTimeBegin; + } + set + { + _eventTimeBegin = value; + } + } + + /// + /// Gets the event time end. + /// + /// The event time end. + public DateTime EventTimeEnd + { + get + { + return EventTimeBegin.AddMinutes(Duration); + } + } + + /// + /// Gets or sets the duration of an event. + /// + /// The duration. + public int Duration + { + get + { + return _duration; + } + set + { + _duration = value; + } + } + + /// + /// Gets or sets the name of the event. + /// + /// The name of the event. + public string EventName + { + get + { + return _eventName; + } + set + { + _eventName = value; + } + } + + /// + /// Gets or sets the event description + /// + /// The event description. + public string EventDesc + { + get + { + return _eventDesc; + } + set + { + _eventDesc = value; + } + } + + /// + /// Gets or sets the importance of an event + /// + /// The importance of an event. + public Priority Importance + { + get + { + return ((Priority) _importance); + } + set + { + _importance = (int) value; + } + } + + /// + /// Gets or sets the created date of an event + /// + /// The created date of an event. + public DateTime CreatedDate + { + get + { + return _createdDate; + } + set + { + _createdDate = value; + } + } + + /// + /// Gets or sets the created by of an event. + /// + /// The created by of an event. + public string CreatedBy + { + get + { + return _createdBy; + } + set + { + _createdBy = value; + } + } + + /// + /// Gets or sets the created by UserID. + /// + /// The created by UserID. + public int CreatedByID + { + get + { + return _createdByID; + } + set + { + _createdByID = value; + } + } + + /// + /// Gets or sets the recurrence unit of an event + /// + /// The recurrence unit of an event. + [Obsolete("Every is only retained for upgrade from versions prior to 4.1.0")] + public int Every + { + get + { + return _every; + } + } + + /// + /// Gets or sets the period of a recurrence. + /// + /// The period of a recurrnence. + [Obsolete("Period is only retained for upgrade from versions prior to 4.1.0")] + public string Period + { + get + { + return _period; + } + } + + /// + /// Gets or sets the type of the repeat of a recurrence + /// + /// The type of the repeat of a recurrence. + [Obsolete("RepeatType is only retained for upgrade from versions prior to 4.1.0")] + public string RepeatType + { + get + { + return _repeatType; + } + } + + /// + /// Gets or sets the notification text + /// + /// The notification text. + public string Notify + { + get + { + return _notify; + } + set + { + _notify = value; + } + } + + /// + /// Gets or sets a value indicating whether this is approved. + /// + /// true if approved; otherwise, false. + public bool Approved + { + get + { + return _approved; + } + set + { + _approved = value; + } + } + + /// + /// Gets or sets a value indicating whether this can have signups. + /// + /// true can have signups; otherwise, false. + public bool Signups + { + get + { + return _signups; + } + set + { + _signups = value; + } + } + + /// + /// Gets or sets the max # of enrollments + /// + /// The max # of enrollments + public int MaxEnrollment + { + get + { + return _maxEnrollment; + } + set + { + _maxEnrollment = value; + } + } + + /// + /// Gets or sets the # of enrolled people + /// + /// The # enrolled of enrolled people. + public int Enrolled + { + get + { + if (_enrolled < 0) + { + return 0; + } + return _enrolled; + } + set + { + _enrolled = value; + } + } + + /// + /// Gets or sets the # f recurrences. + /// + /// The # of recurrences. + public int NoOfRecurrences + { + get + { + return _noOfRecurrences; + } + set + { + _noOfRecurrences = value; + } + } + + /// + /// Gets or sets the last recurrence date + /// + /// The last recurrence date. + public DateTime LastRecurrence + { + get + { + return _lastRecurrence; + } + set + { + _lastRecurrence = value; + } + } + + /// + /// Gets or sets the enroll role ID. + /// + /// The enroll role ID. + public int EnrollRoleID + { + get + { + return _enrollRoleID; + } + set + { + _enrollRoleID = value; + } + } + + /// + /// Gets or sets the type of the enrollment + /// + /// The type of the enrollment + public string EnrollType + { + get + { + return _enrollType; + } + set + { + _enrollType = value; + } + } + + /// + /// Gets or sets the enroll fee. + /// + /// The enroll fee. + public decimal EnrollFee + { + get + { + return _enrollFee; + } + set + { + _enrollFee = value; + } + } + + /// + /// Gets or sets the PayPal account. + /// + /// The PayPal account. + public string PayPalAccount + { + get + { + return _payPalAccount; + } + set + { + _payPalAccount = value; + } + } + + /// + /// Gets or sets a value indicating whether this is cancelled. + /// + /// true if cancelled; otherwise, false. + public bool Cancelled + { + get + { + return _cancelled; + } + set + { + _cancelled = value; + } + } + + /// + /// Gets or sets a value indicating whether a detail page must be openend. + /// + /// true if detail page must be opened; otherwise, false. + public bool DetailPage + { + get + { + return _detailPage; + } + set + { + _detailPage = value; + } + } + + /// + /// Gets or sets a value indicating whether detail page must appear in a new page. + /// + /// true if new page; otherwise, false. + public bool DetailNewWin + { + get + { + return _detailNewWin; + } + set + { + _detailNewWin = value; + } + } + + /// + /// Gets or sets the detail URL. + /// + /// The detail URL. + public string DetailURL + { + get + { + return _detailURL; + } + set + { + _detailURL = value; + } + } + /// + /// Gets or sets the image URL. + /// + /// The image URL. + public string ImageURL + { + get + { + return _imageURL; + } + set + { + _imageURL = value; + } + } + + /// + /// Gets or sets the type of the image. + /// + /// The type of the image. + public string ImageType + { + get + { + return _imageType; + } + set + { + _imageType = value; + } + } + + /// + /// Gets or sets the width of the image. + /// + /// The width of the image. + public int ImageWidth + { + get + { + return _imageWidth; + } + set + { + _imageWidth = value; + } + } + + /// + /// Gets or sets the height of the image. + /// + /// The height of the image. + public int ImageHeight + { + get + { + return _imageHeight; + } + set + { + _imageHeight = value; + } + } + + /// + /// Gets or sets the location of an event + /// + /// The location of an event. + public int Location + { + get + { + return _location; + } + set + { + _location = value; + } + } + + /// + /// Gets or sets the name of the location of an event. + /// + /// The name of the location of an event. + public string LocationName + { + get + { + return _locationName; + } + set + { + _locationName = value; + } + } + + /// + /// Gets or sets the map URL. + /// + /// The map URL. + public string MapURL + { + get + { + return _mapURL; + } + set + { + _mapURL = value; + } + } + + /// + /// Gets or sets the category of an event + /// + /// The category of an event. + public int Category + { + get + { + return _category; + } + set + { + _category = value; + } + } + + /// + /// Gets or sets the name of the category. + /// + /// The name of the category. + public string CategoryName + { + get + { + return _categoryName; + } + set + { + _categoryName = value; + } + } + + /// + /// Gets or sets the category color to be used for display. + /// + /// The color of the category. + public string Color + { + get + { + return _color; + } + set + { + _color = value; + } + } + + /// + /// Gets or sets the category color of the font (foreground color). + /// + /// The color of the font. + public string FontColor + { + get + { + return _fontColor; + } + set + { + _fontColor = value; + } + } + + /// + /// Gets or sets a value indicating whether an image must be displayed. + /// + /// true if image must be displayed; otherwise, false. + public bool ImageDisplay + { + get + { + return _imageDisplay; + } + set + { + _imageDisplay = value; + } + } + + /// + /// Gets or sets a value indicating whether to send a reminder. + /// + /// true if send reminder; otherwise, false. + public bool SendReminder + { + get + { + return _sendReminder; + } + set + { + _sendReminder = value; + } + } + + /// + /// Gets or sets the reminder time. + /// + /// The reminder time. + public int ReminderTime + { + get + { + return _reminderTime; + } + set + { + _reminderTime = value; + } + } + + /// + /// Gets or sets the reminder time measurement. + /// + /// The reminder time measurement. + public string ReminderTimeMeasurement + { + get + { + return _reminderTimeMeasurement; + } + set + { + _reminderTimeMeasurement = value; + } + } + + /// + /// Gets or sets the reminder. + /// + /// The reminder. + public string Reminder + { + get + { + return _reminder; + } + set + { + _reminder = value; + } + } + + /// + /// Gets or sets the reminder from e-mail address + /// + /// The reminder from e-mail address. + public string ReminderFrom + { + get + { + return _reminderFrom; + } + set + { + _reminderFrom = value; + } + } + + /// + /// Gets or sets a value indicating whether the event is submitted to the search + /// + /// true if search submitted; otherwise, false. + public bool SearchSubmitted + { + get + { + return _searchSubmitted; + } + set + { + _searchSubmitted = value; + } + } + + /// + /// Gets or sets the module title. + /// + /// The module title. + public string ModuleTitle + { + get + { + return _moduleTitle; + } + set + { + _moduleTitle = value; + } + } + + /// + /// Gets or sets the custom field1. + /// + /// The custom field1. + public string CustomField1 + { + get + { + return _customField1; + } + set + { + _customField1 = value; + } + } + + /// + /// Gets or sets the custom field2. + /// + /// The custom field2. + public string CustomField2 + { + get + { + return _customField2; + } + set + { + _customField2 = value; + } + } + + /// + /// Gets or sets a value indicating whether enroll list view is to be displayed. + /// + /// true if [enroll list view]; otherwise, false. + public bool EnrollListView + { + get + { + return _enrollListView; + } + set + { + _enrollListView = value; + } + } + + /// + /// Gets or sets a value indicating whether end date is to be displayed + /// + /// true if [display end date]; otherwise, false. + public bool DisplayEndDate + { + get + { + return _displayEndDate; + } + set + { + _displayEndDate = value; + } + } + + /// + /// Gets or sets a value indicating whether the event is an all day event. + /// + /// true if [all day event]; otherwise, false. + public bool AllDayEvent + { + get + { + return _allDayEvent; + } + set + { + _allDayEvent = value; + } + } + + /// + /// Gets or sets the owner ID (userID). + /// + /// The owner ID. + public int OwnerID + { + get + { + return _ownerID; + } + set + { + _ownerID = value; + } + } + + /// + /// Gets or sets the name of the owner of the event + /// + /// The name of the owner. + public string OwnerName + { + get + { + return _ownerName; + } + set + { + _ownerName = value; + } + } + + /// + /// Gets or sets the last updated at. + /// + /// The last updated at. + public DateTime LastUpdatedAt + { + get + { + return _lastUpdatedAt; + } + set + { + _lastUpdatedAt = value; + } + } + + /// + /// Gets or sets the last updated by. + /// + /// The last updated by. + public string LastUpdatedBy + { + get + { + return _lastUpdatedBy; + } + set + { + _lastUpdatedBy = value; + } + } + + /// + /// Gets or sets the last updated userID + /// + /// The last updated userID. + public int LastUpdatedID + { + get + { + return _lastUpdatedID; + } + set + { + _lastUpdatedID = value; + } + } + + /// + /// Gets or sets the original date begin. + /// + /// The original date begin. + public DateTime OriginalDateBegin + { + get + { + return _originalDateBegin; + } + set + { + _originalDateBegin = value; + } + } + + /// + /// Gets or sets the update status. + /// + /// The update status. + public string UpdateStatus + { + get + { + return _updateStatus; + } + set + { + _updateStatus = value; + } + } + + /// + /// Gets or sets the Recurrence Rule. + /// + /// The Recurrence Rule. + public string RRULE + { + get + { + return _rrule; + } + set + { + _rrule = value; + } + } + + /// + /// Gets or sets the RM owner ID. + /// + /// The RM owner ID. + public int RmOwnerID + { + get + { + return _rmOwnerID; + } + set + { + _rmOwnerID = value; + } + } + + /// + /// Gets or sets a value indicating whether [new event email sent]. + /// + /// true if [new event email sent]; otherwise, false. + public bool NewEventEmailSent + { + get + { + return _newEventEmailSent; + } + set + { + _newEventEmailSent = value; + } + } + + /// + /// Gets or sets a value indicating whether [is private]. + /// + /// true if [is private]; otherwise, false. + public bool IsPrivate + { + get + { + return _isPrivate; + } + set + { + _isPrivate = value; + } + } + + /// + /// Gets or sets a value indicating what the [event timezoneid] is + /// + /// The event timezoneid. + public string EventTimeZoneId + { + get + { + if (string.IsNullOrEmpty(_eventTimeZoneId)) + { + EventModuleSettings ems = new EventModuleSettings(); + EventModuleSettings modSettings = ems.GetEventModuleSettings(_moduleID, null); + _eventTimeZoneId = modSettings.TimeZoneId; + } + return _eventTimeZoneId; + } + set + { + _eventTimeZoneId = value; + } + } + + /// + /// Gets or sets a value indicating what the [other timezoneid] is + /// + /// The other timezoneid. + public string OtherTimeZoneId + { + get + { + if (ReferenceEquals(_otherTimeZoneId, null)) + { + _otherTimeZoneId = "UTC"; + } + return _otherTimeZoneId; + } + set + { + _otherTimeZoneId = value; + } + } + + /// + /// Gets or sets a value indicating whether [allow anonymous enrollment]. + /// + /// true if [allow anonymous enrollment]; otherwise, false. + public bool AllowAnonEnroll + { + get + { + return _allowAnonEnroll; + } + set + { + _allowAnonEnroll = value; + } + } + + /// + /// Gets or sets a value indicating the [content item id]. + /// + /// The contentitemid. + public int ContentItemID + { + get + { + return _contentItemId; + } + set + { + _contentItemId = value; + } + } + + /// + /// Gets or sets a value indicating whether [event has journal item]. + /// + /// true if [event has journal item]; otherwise, false. + public bool JournalItem + { + get + { + return _journalItem; + } + set + { + _journalItem = value; + } + } + + /// + /// Gets or sets a value indicating the [soccialgroup id]. + /// + /// The SocialGroupId. + public int SocialGroupId + { + get + { + return _socialGroupId; + } + set + { + _socialGroupId = value; + } + } + + /// + /// Gets or sets a value indicating the [user id]. + /// + /// The SocialUserId. + public int SocialUserId + { + get + { + return _socialUserId; + } + set + { + _socialUserId = value; + } + } + + /// + /// Gets or sets the summary. + /// + /// The summary. + public string Summary + { + get + { + return _summary; + } + set + { + _summary = value; + } + } + + /// + /// Gets or sets a value indicating the [sequence]. + /// + /// The Sequence. + public int Sequence + { + get + { + return _sequence; + } + set + { + _sequence = value; + } + } + + /// + /// Gets or sets a value indicating the [recur master sequence]. + /// + /// The Recur MasterSequence. + public int RmSequence + { + get + { + return _rmSequence; + } + set + { + _rmSequence = value; + } + } + + /// + /// Gets or sets the SocialUserUserName. + /// + /// The SocialUserUserName. + public string SocialUserUserName + { + get + { + return _socialUserUserName; + } + set + { + _socialUserUserName = value; + } + } + + /// + /// Gets or sets the SocialUserDisplayName. + /// + /// The SocialUserDisplayName. + public string SocialUserDisplayName + { + get + { + return _socialUserDisplayName; + } + set + { + _socialUserDisplayName = value; + } + } + + private static SortFilter _sortExpression; + /// + /// Gets or sets the sort expression. + /// + /// The sort expression. + public static SortFilter SortExpression + { + get + { + return _sortExpression; + } + set + { + _sortExpression = value; + } + } + + private static SortDirection _sortDirection; + /// + /// Gets or sets the sort direction. + /// + /// The sort direction. + public static SortDirection SortDirection + { + get + { + return _sortDirection; + } + set + { + _sortDirection = value; + } + } + + + /// + /// Sorting enumeration + /// + public enum SortFilter + { + /// + /// By EventID + /// + EventID, + /// + /// By Date beging + /// + EventDateBegin, + /// + /// By Date end + /// + EventDateEnd, + /// + /// Bu Name + /// + EventName, + /// + /// By duration + /// + Duration, + /// + /// Bu category name + /// + CategoryName, + /// + /// By customfield1 + /// + CustomField1, + /// + /// By customfield2 + /// + CustomField2, + /// + /// By description + /// + Description, + /// + /// By Location name + /// + LocationName + } + + /// + /// Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. + /// + /// An object to compare with this instance. + /// + /// A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: + /// Value + /// Meaning + /// Less than zero + /// This instance is less than . + /// Zero + /// This instance is equal to . + /// Greater than zero + /// This instance is greater than . + /// + /// + /// is not the same type as this instance. + /// + public int CompareTo(object obj) + { + EventInfo o = (EventInfo) obj; + string xCompare = EventName + Strings.Format(EventID, "00000000"); + string yCompare = o.EventName + Strings.Format(o.EventID, "00000000"); + if (SortExpression == SortFilter.CategoryName) + { + xCompare = CategoryName + Strings.Format(EventID, "00000000"); + yCompare = o.CategoryName + Strings.Format(o.EventID, "00000000"); + } + else if (SortExpression == SortFilter.CustomField1) + { + xCompare = CustomField1 + Strings.Format(EventID, "00000000"); + yCompare = o.CustomField1 + Strings.Format(o.EventID, "00000000"); + } + else if (SortExpression == SortFilter.CustomField2) + { + xCompare = CustomField2 + Strings.Format(EventID, "00000000"); + yCompare = o.CustomField2 + Strings.Format(o.EventID, "00000000"); + } + else if (SortExpression == SortFilter.Description) + { + xCompare = EventDesc + Strings.Format(EventID, "00000000"); + yCompare = o.EventDesc + Strings.Format(o.EventID, "00000000"); + } + else if (SortExpression == SortFilter.Duration) + { + xCompare = System.Convert.ToString(Strings.Format(Duration, "000000") + Strings.Format(EventID, "00000000")); + yCompare = System.Convert.ToString(Strings.Format(o.Duration, "000000") + Strings.Format(o.EventID, "00000000")); + } + else if (SortExpression == SortFilter.EventDateBegin) + { + xCompare = System.Convert.ToString(Strings.Format(EventTimeBegin, "yyyyMMddHHmm") + Strings.Format(EventID, "00000000")); + yCompare = System.Convert.ToString(Strings.Format(o.EventTimeBegin, "yyyyMMddHHmm") + Strings.Format(o.EventID, "00000000")); + } + else if (SortExpression == SortFilter.EventDateEnd) + { + xCompare = System.Convert.ToString(Strings.Format(EventTimeEnd, "yyyyMMddHHmm") + Strings.Format(EventID, "00000000")); + yCompare = System.Convert.ToString(Strings.Format(o.EventTimeEnd, "yyyyMMddHHmm") + Strings.Format(o.EventID, "00000000")); + } + else if (SortExpression == SortFilter.LocationName) + { + xCompare = LocationName + Strings.Format(EventID, "00000000"); + yCompare = o.LocationName + Strings.Format(o.EventID, "00000000"); + } + if (SortDirection == System.Web.UI.WebControls.SortDirection.Ascending) + { + return System.String.Compare(xCompare, yCompare, StringComparison.CurrentCulture); + } + else + { + return System.String.Compare(yCompare, xCompare, StringComparison.CurrentCulture); + } + } + + +#endregion + +#region Public Methods + + /// + /// Clones an instance of the events object + /// + /// Cloned Eventsinfo object + public EventInfo Clone() + { + return ((EventInfo) (MemberwiseClone())); + + } +#endregion + } + +#endregion + +#region EventMasterInfo Class + public class EventMasterInfo + { + + private int _portalID; + private int _masterID; + private int _moduleID; + private int _subEventID; + private string _subEventTitle; + + /// + /// Gets or sets the portal ID. + /// + /// The portal ID. + public int PortalID + { + get + { + return _portalID; + } + set + { + _portalID = value; + } + } + + /// + /// Gets or sets the master ID. + /// + /// The master ID. + public int MasterID + { + get + { + return _masterID; + } + set + { + _masterID = value; + } + } + + /// + /// Gets or sets the module ID. + /// + /// The module ID. + public int ModuleID + { + get + { + return _moduleID; + } + set + { + _moduleID = value; + } + } + + /// + /// Gets or sets the sub event ID. + /// + /// The sub event ID. + public int SubEventID + { + get + { + return _subEventID; + } + set + { + _subEventID = value; + } + } + + /// + /// Gets or sets the sub event title. + /// + /// The sub event title. + public string SubEventTitle + { + get + { + return _subEventTitle; + } + set + { + _subEventTitle = value; + } + } + } +#endregion + +#region EventSignupsInfo Class + /// + /// Information about the users that have signed up for a particular event + /// + public class EventSignupsInfo : IComparable + { + + /// + /// Priority of the event + /// + public enum Priority + { + /// + /// Hign priority + /// + High = 1, + /// + /// Medium priority + /// + Medium = 2, + /// + /// Low priority + /// + Low = 3 + } + + private int _eventID; + private int _moduleID; + private int _signupID; + private int _userID; + private bool _approved = false; + private string _userName; + private string _email; + private bool _emailVisible; + private string _telephone; + private DateTime _eventTimeBegin = DateTime.Now; + private DateTime _eventTimeEnd; + private int _duration; + private string _eventName; + private int _importance; + private bool _eventApproved = false; + private int _maxEnrollment = 0; + private int _enrolled; + private string _payPalStatus; + private string _payPalReason; + private string _payPalTransID; + private string _payPalPayerID; + private string _payPalPayerStatus; + private string _payPalRecieverEmail; + private string _payPalUserEmail; + private string _payPalPayerEmail; + private string _payPalFirstName; + private string _payPalLastName; + private string _payPalAddress; + private string _payPalCity; + private string _payPalState; + private string _payPalZip; + private string _payPalCountry; + private string _payPalCurrency; + private DateTime _payPalPaymentDate = DateTime.Now; + private decimal _payPalAmount = 0; + private decimal _payPalFee = 0; + private int _noEnrolees = 1; + private string _eventTimeZoneId; + private string _anonEmail; + private string _anonName; + private string _anonTelephone; + private string _anonCulture; + private string _anonTimeZoneId; + private string _firstName; + private string _lastName; + private string _company; + private string _jobTitle; + private string _referenceNumber; + private string _remarks; + private string _street; + private string _postalCode; + private string _city; + private string _region; + private string _country; + + // initialization + /// + /// Initializes a new instance of the class. + /// + public EventSignupsInfo() + { + } + + // public properties + /// + /// Gets or sets the event ID. + /// + /// The event ID. + public int EventID + { + get + { + return _eventID; + } + set + { + _eventID = value; + } + } + + /// + /// Gets or sets the module ID. + /// + /// The module ID. + public int ModuleID + { + get + { + return _moduleID; + } + set + { + _moduleID = value; + } + } + + /// + /// Gets or sets the signup ID. + /// + /// The signup ID. + public int SignupID + { + get + { + return _signupID; + } + set + { + _signupID = value; + } + } + + /// + /// Gets or sets the user ID. + /// + /// The user ID. + public int UserID + { + get + { + return _userID; + } + set + { + _userID = value; + } + } + + /// + /// Gets or sets a value indicating whether this is approved. + /// + /// true if approved; otherwise, false. + public bool Approved + { + get + { + return _approved; + } + set + { + _approved = value; + } + } + + /// + /// Gets or sets the name of the user for the signup + /// + /// The name of the user. + public string UserName + { + get + { + return _userName; + } + set + { + _userName = value; + } + } + + /// + /// Gets or sets the email of the signup + /// + /// The email. + public string Email + { + get + { + return _email; + } + set + { + _email = value; + } + } + + /// + /// Gets or sets a value indicating whether email of the signup is visible. + /// + /// true if [email visible]; otherwise, false. + public bool EmailVisible + { + get + { + return _emailVisible; + } + set + { + _emailVisible = value; + } + } + + /// + /// Gets or sets the telephone of the signup + /// + /// The telephone. + public string Telephone + { + get + { + return _telephone; + } + set + { + _telephone = value; + } + } + + /// + /// Gets the event date begin. + /// + /// The event date begin. + public DateTime EventDateBegin + { + get + { + return _eventTimeBegin.Date; + } + } + + /// + /// Gets or sets the event time begin. + /// + /// The event time begin. + public DateTime EventTimeBegin + { + get + { + return _eventTimeBegin; + } + set + { + _eventTimeBegin = value; + } + } + + /// + /// Gets or sets the event time end. + /// + /// The event time end. + public DateTime EventTimeEnd + { + get + { + return _eventTimeEnd; + } + set + { + _eventTimeEnd = value; + } + } + + /// + /// Gets or sets the duration. + /// + /// The duration. + public int Duration + { + get + { + return _duration; + } + set + { + _duration = value; + } + } + + /// + /// Gets or sets the name of the event. + /// + /// The name of the event. + public string EventName + { + get + { + return _eventName; + } + set + { + _eventName = value; + } + } + + /// + /// Gets or sets the importance of the event + /// + /// The importance. + public Priority Importance + { + get + { + return ((Priority) _importance); + } + set + { + _importance = (int) value; + } + } + + /// + /// Gets or sets a value indicating whether the event is approved. + /// + /// true if [event approved]; otherwise, false. + public bool EventApproved + { + get + { + return _eventApproved; + } + set + { + _eventApproved = value; + } + } + + /// + /// Gets or sets the max # of enrollments + /// + /// The max # of enrollments. + public int MaxEnrollment + { + get + { + return _maxEnrollment; + } + set + { + _maxEnrollment = value; + } + } + + /// + /// Gets or sets the # of enrolled. + /// + /// The # of enrolled. + public int Enrolled + { + get + { + return _enrolled; + } + set + { + _enrolled = value; + } + } + + /// + /// Gets or sets the PayPal status. + /// + /// The PayPal status. + public string PayPalStatus + { + get + { + return _payPalStatus; + } + set + { + _payPalStatus = value; + } + } + + /// + /// Gets or sets the PayPal result reason + /// + /// The PayPal reason. + public string PayPalReason + { + get + { + return _payPalReason; + } + set + { + _payPalReason = value; + } + } + + /// + /// Gets or sets the PayPal transaction ID. + /// + /// The PayPal transaction ID. + public string PayPalTransID + { + get + { + return _payPalTransID; + } + set + { + _payPalTransID = value; + } + } + + /// + /// Gets or sets the PayPal payer ID. + /// + /// The PayPal payer ID. + public string PayPalPayerID + { + get + { + return _payPalPayerID; + } + set + { + _payPalPayerID = value; + } + } + + /// + /// Gets or sets the PayPal payer status. + /// + /// The pay PayPal status. + public string PayPalPayerStatus + { + get + { + return _payPalPayerStatus; + } + set + { + _payPalPayerStatus = value; + } + } + + /// + /// Gets or sets the PayPal reciever email. + /// + /// The PayPal reciever email. + public string PayPalRecieverEmail + { + get + { + return _payPalRecieverEmail; + } + set + { + _payPalRecieverEmail = value; + } + } + + /// + /// Gets or sets the PayPal user email. + /// + /// The PayPal user email. + public string PayPalUserEmail + { + get + { + return _payPalUserEmail; + } + set + { + _payPalUserEmail = value; + } + } + + /// + /// Gets or sets the PayPal payer email. + /// + /// The PayPal payer email. + public string PayPalPayerEmail + { + get + { + return _payPalPayerEmail; + } + set + { + _payPalPayerEmail = value; + } + } + + /// + /// Gets or sets the first name of the PayPal. + /// + /// The first name of the PayPal. + public string PayPalFirstName + { + get + { + return _payPalFirstName; + } + set + { + _payPalFirstName = value; + } + } + + /// + /// Gets or sets the last name of the PayPal. + /// + /// The last name of the PayPal. + public string PayPalLastName + { + get + { + return _payPalLastName; + } + set + { + _payPalLastName = value; + } + } + + /// + /// Gets or sets the PayPal address. + /// + /// The PayPal address. + public string PayPalAddress + { + get + { + return _payPalAddress; + } + set + { + _payPalAddress = value; + } + } + + /// + /// Gets or sets the PayPal city. + /// + /// The PayPal city. + public string PayPalCity + { + get + { + return _payPalCity; + } + set + { + _payPalCity = value; + } + } + + /// + /// Gets or sets the state of the PayPal. + /// + /// The state of the PayPal. + public string PayPalState + { + get + { + return _payPalState; + } + set + { + _payPalState = value; + } + } + + /// + /// Gets or sets the PayPal zip. + /// + /// The PayPal zip. + public string PayPalZip + { + get + { + return _payPalZip; + } + set + { + _payPalZip = value; + } + } + + /// + /// Gets or sets the PayPal country. + /// + /// The PayPal country. + public string PayPalCountry + { + get + { + return _payPalCountry; + } + set + { + _payPalCountry = value; + } + } + + /// + /// Gets or sets the PayPal currency. + /// + /// The PayPal currency. + public string PayPalCurrency + { + get + { + return _payPalCurrency; + } + set + { + _payPalCurrency = value; + } + } + + /// + /// Gets or sets the PayPal payment date. + /// + /// The PayPal payment date. + public DateTime PayPalPaymentDate + { + get + { + return _payPalPaymentDate; + } + set + { + _payPalPaymentDate = value; + } + } + + /// + /// Gets or sets the PayPal amount. + /// + /// The PayPal amount. + public decimal PayPalAmount + { + get + { + return _payPalAmount; + } + set + { + _payPalAmount = value; + } + } + + /// + /// Gets or sets the PayPal fee. + /// + /// The PayPal fee. + public decimal PayPalFee + { + get + { + return _payPalFee; + } + set + { + _payPalFee = value; + } + } + + /// + /// Gets or sets the # of enrolees. + /// + /// The # of enrolees. + public int NoEnrolees + { + get + { + return _noEnrolees; + } + set + { + _noEnrolees = value; + } + } + + /// + /// Gets or sets a value indicating what the [event timezoneid] is + /// + /// The event timezoneid. + public string EventTimeZoneId + { + get + { + return _eventTimeZoneId; + } + set + { + _eventTimeZoneId = value; + } + } + + /// + /// Gets or sets a value indicating what the [anonymous email] is + /// + /// The event timezoneid. + public string AnonEmail + { + get + { + return _anonEmail; + } + set + { + _anonEmail = value; + } + } + + /// + /// Gets or sets a value indicating what the [anonymous name] is + /// + /// The event timezoneid. + public string AnonName + { + get + { + return _anonName; + } + set + { + _anonName = value; + } + } + + /// + /// Gets or sets a value indicating what the [anonymous telephone] is + /// + /// The event timezoneid. + public string AnonTelephone + { + get + { + return _anonTelephone; + } + set + { + _anonTelephone = value; + } + } + + /// + /// Gets or sets a value indicating what the [anonymous Culture] is + /// + /// The event timezoneid. + public string AnonCulture + { + get + { + return _anonCulture; + } + set + { + _anonCulture = value; + } + } + + /// + /// Gets or sets a value indicating what the [anonymous TimeZoneId] is + /// + /// The event timezoneid. + public string AnonTimeZoneId + { + get + { + return _anonTimeZoneId; + } + set + { + _anonTimeZoneId = value; + } + } + + /// + /// Gets or sets the enrollee's dirst name. + /// + /// The enrollee's first name. + public string FirstName + { + get + { + return _firstName; + } + set + { + _firstName = value; + } + } + + /// + /// Gets or sets the enrollee's last name. + /// + /// The enrollee's last name. + public string LastName + { + get + { + return _lastName; + } + set + { + _lastName = value; + } + } + + /// + /// Gets or sets the enrollee's company. + /// + /// The enrollee's company. + public string Company + { + get + { + return _company; + } + set + { + _company = value; + } + } + + /// + /// Gets or sets the enrollee's job title. + /// + /// The enrollee's job title. + public string JobTitle + { + get + { + return _jobTitle; + } + set + { + _jobTitle = value; + } + } + + /// + /// Gets or sets the enrollee's reference number. + /// + /// The enrollee's reference number. + public string ReferenceNumber + { + get + { + return _referenceNumber; + } + set + { + _referenceNumber = value; + } + } + + /// + /// Gets or sets the enrollee's remarks. + /// + /// The enrollee's remarks. + public string Remarks + { + get + { + return _remarks; + } + set + { + _remarks = value; + } + } + + /// + /// Gets or sets the street of the enrollee's address. + /// + /// The street of the enrollee's address. + public string Street + { + get + { + return _street; + } + set + { + _street = value; + } + } + + /// + /// Gets or sets the postal code of the enrollee's address. + /// + /// The postal code of the enrollee's address. + public string PostalCode + { + get + { + return _postalCode; + } + set + { + _postalCode = value; + } + } + + /// + /// Gets or sets the city of the enrollee's address. + /// + /// The city of the enrollee's address. + public string City + { + get + { + return _city; + } + set + { + _city = value; + } + } + + /// + /// Gets or sets the region of the enrollee's address. + /// + /// The region of the enrollee's address. + public string Region + { + get + { + return _region; + } + set + { + _region = value; + } + } + + /// + /// Gets or sets the country of the enrollee's address. + /// + /// The country of the enrollee's address. + public string Country + { + get + { + return _country; + } + set + { + _country = value; + } + } +#region Sorting + private static SortFilter _sortExpression; + /// + /// Gets or sets the sort expression. + /// + /// The sort expression. + public static SortFilter SortExpression + { + get + { + return _sortExpression; + } + set + { + _sortExpression = value; + } + } + + private static SortDirection _sortDirection; + /// + /// Gets or sets the sort direction. + /// + /// The sort direction. + public static SortDirection SortDirection + { + get + { + return _sortDirection; + } + set + { + _sortDirection = value; + } + } + + + /// + /// Sorting enumeration + /// + public enum SortFilter + { + /// + /// By EventID + /// + EventID, + /// + /// By Date beging + /// + EventTimeBegin, + /// + /// By Date end + /// + EventTimeEnd, + /// + /// Bu Name + /// + EventName, + /// + /// By duration + /// + Duration, + /// + /// By approved + /// + Approved + } + + /// + /// Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. + /// + /// An object to compare with this instance. + /// + /// A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: + /// Value + /// Meaning + /// Less than zero + /// This instance is less than . + /// Zero + /// This instance is equal to . + /// Greater than zero + /// This instance is greater than . + /// + /// + /// is not the same type as this instance. + /// + public int CompareTo(object obj) + { + EventSignupsInfo o = (EventSignupsInfo) obj; + string xCompare = EventName + Strings.Format(EventID, "00000000"); + string yCompare = o.EventName + Strings.Format(o.EventID, "00000000"); + if (SortExpression == SortFilter.Duration) + { + xCompare = System.Convert.ToString(Strings.Format(Duration, "000000") + Strings.Format(EventID, "00000000")); + yCompare = System.Convert.ToString(Strings.Format(o.Duration, "000000") + Strings.Format(o.EventID, "00000000")); + } + else if (SortExpression == SortFilter.EventTimeBegin) + { + xCompare = System.Convert.ToString(Strings.Format(EventTimeBegin, "yyyyMMddHHmm") + Strings.Format(EventID, "00000000")); + yCompare = System.Convert.ToString(Strings.Format(o.EventTimeBegin, "yyyyMMddHHmm") + Strings.Format(o.EventID, "00000000")); + } + else if (SortExpression == SortFilter.EventTimeEnd) + { + xCompare = System.Convert.ToString(Strings.Format(EventTimeEnd, "yyyyMMddHHmm") + Strings.Format(EventID, "00000000")); + yCompare = System.Convert.ToString(Strings.Format(o.EventTimeEnd, "yyyyMMddHHmm") + Strings.Format(o.EventID, "00000000")); + } + else if (SortExpression == SortFilter.Approved) + { + xCompare = Approved.ToString() + Strings.Format(EventID, "00000000"); + yCompare = o.Approved.ToString() + Strings.Format(o.EventID, "00000000"); + } + if (SortDirection == System.Web.UI.WebControls.SortDirection.Ascending) + { + return System.String.Compare(xCompare, yCompare, StringComparison.CurrentCulture); + } + else + { + return System.String.Compare(yCompare, xCompare, StringComparison.CurrentCulture); + } + } + +#endregion + +#region Public Methods + + /// + /// Clones an instance of the eventssignups object + /// + /// Cloned EventsSignupsinfo object + public EventSignupsInfo Clone() + { + // create the object + return ((EventSignupsInfo) (MemberwiseClone())); + } +#endregion + + } +#endregion + +#region EventPPErrorLogInfo Class + /// + /// Information about any infomartion during PayPal payments + /// + public class EventPpErrorLogInfo + { + // ReSharper disable ConvertToConstant.Local + private int _payPalID = 0; + // ReSharper restore ConvertToConstant.Local + private int _signupID = 0; + private DateTime _createDate = DateTime.Now; + private string _payPalStatus; + private string _payPalReason; + private string _payPalTransID; + private string _payPalPayerID; + private string _payPalPayerStatus; + private string _payPalRecieverEmail; + private string _payPalUserEmail; + private string _payPalPayerEmail; + private string _payPalFirstName; + private string _payPalLastName; + private string _payPalAddress; + private string _payPalCity; + private string _payPalState; + private string _payPalZip; + private string _payPalCountry; + private string _payPalCurrency; + private DateTime _payPalPaymentDate = DateTime.Now; + private double _payPalAmount = 0.0; + private double _payPalFee = 0.0; + + // public properties + /// + /// Gets the PayPal ID. + /// + /// The PayPal ID. + public int PayPalID + { + get + { + return _payPalID; + } + } + + /// + /// Gets or sets the signup ID. + /// + /// The signup ID. + public int SignupID + { + get + { + return _signupID; + } + set + { + _signupID = value; + } + } + + /// + /// Gets the create date. + /// + /// The create date. + public DateTime CreateDate + { + get + { + return _createDate; + } + } + + /// + /// Gets or sets the PayPal status. + /// + /// The PayPal status. + public string PayPalStatus + { + get + { + return _payPalStatus; + } + set + { + _payPalStatus = value; + } + } + + /// + /// Gets or sets the PayPal reason. + /// + /// The PayPal reason. + public string PayPalReason + { + get + { + return _payPalReason; + } + set + { + _payPalReason = value; + } + } + + /// + /// Gets or sets the PayPal trans ID. + /// + /// The PayPal trans ID. + public string PayPalTransID + { + get + { + return _payPalTransID; + } + set + { + _payPalTransID = value; + } + } + + /// + /// Gets or sets the PayPal payer ID. + /// + /// The PayPal payer ID. + public string PayPalPayerID + { + get + { + return _payPalPayerID; + } + set + { + _payPalPayerID = value; + } + } + + /// + /// Gets or sets the PayPal payer status. + /// + /// The PayPal payer status. + public string PayPalPayerStatus + { + get + { + return _payPalPayerStatus; + } + set + { + _payPalPayerStatus = value; + } + } + + /// + /// Gets or sets the PayPal reciever email. + /// + /// The PayPal reciever email. + public string PayPalRecieverEmail + { + get + { + return _payPalRecieverEmail; + } + set + { + _payPalRecieverEmail = value; + } + } + + /// + /// Gets or sets the PayPal user email. + /// + /// The PayPal user email. + public string PayPalUserEmail + { + get + { + return _payPalUserEmail; + } + set + { + _payPalUserEmail = value; + } + } + + /// + /// Gets or sets the PayPal payer email. + /// + /// The PayPal payer email. + public string PayPalPayerEmail + { + get + { + return _payPalPayerEmail; + } + set + { + _payPalPayerEmail = value; + } + } + + /// + /// Gets or sets the first name of the PayPal. + /// + /// The first name of the PayPal. + public string PayPalFirstName + { + get + { + return _payPalFirstName; + } + set + { + _payPalFirstName = value; + } + } + + /// + /// Gets or sets the last name of the PayPal. + /// + /// The last name of the PayPal. + public string PayPalLastName + { + get + { + return _payPalLastName; + } + set + { + _payPalLastName = value; + } + } + + /// + /// Gets or sets the PayPal address. + /// + /// The PayPal address. + public string PayPalAddress + { + get + { + return _payPalAddress; + } + set + { + _payPalAddress = value; + } + } + + /// + /// Gets or sets the PayPal city. + /// + /// The PayPal city. + public string PayPalCity + { + get + { + return _payPalCity; + } + set + { + _payPalCity = value; + } + } + + /// + /// Gets or sets the state of the PayPal. + /// + /// The state of the PayPal. + public string PayPalState + { + get + { + return _payPalState; + } + set + { + _payPalState = value; + } + } + + /// + /// Gets or sets the PayPal zip. + /// + /// The PayPal zip. + public string PayPalZip + { + get + { + return _payPalZip; + } + set + { + _payPalZip = value; + } + } + + /// + /// Gets or sets the PayPal country. + /// + /// The PayPal country. + public string PayPalCountry + { + get + { + return _payPalCountry; + } + set + { + _payPalCountry = value; + } + } + + /// + /// Gets or sets the PayPal currency. + /// + /// The PayPal currency. + public string PayPalCurrency + { + get + { + return _payPalCurrency; + } + set + { + _payPalCurrency = value; + } + } + + /// + /// Gets or sets the PayPal payment date. + /// + /// The PayPal payment date. + public DateTime PayPalPaymentDate + { + get + { + return _payPalPaymentDate; + } + set + { + _payPalPaymentDate = value; + } + } + + /// + /// Gets or sets the PayPal amount. + /// + /// The PayPal amount. + public double PayPalAmount + { + get + { + return _payPalAmount; + } + set + { + _payPalAmount = value; + } + } + + /// + /// Gets or sets the PayPal fee. + /// + /// The PayPal fee. + public double PayPalFee + { + get + { + return _payPalFee; + } + set + { + _payPalFee = value; + } + } + + } +#endregion + +#region EventCategoryInfo Class + /// + /// Information about the (optional) category of the envent + /// + public class EventCategoryInfo + { + + private int _portalID; + private int _category; + private string _categoryName; + private string _color; + private string _fontColor; + + // initialization + /// + /// Initializes a new instance of the class. + /// + public EventCategoryInfo() + { + } + + // public properties + /// + /// Gets or sets the portal ID. + /// + /// The portal ID. + public int PortalID + { + get + { + return _portalID; + } + set + { + _portalID = value; + } + } + + /// + /// Gets or sets the category ID. + /// + /// The category ID. + public int Category + { + get + { + return _category; + } + set + { + _category = value; + } + } + + /// + /// Gets or sets the name of the category. + /// + /// The name of the category. + public string CategoryName + { + get + { + return _categoryName; + } + set + { + _categoryName = value; + } + } + + /// + /// Gets or sets the color. + /// + /// The color. + public string Color + { + get + { + return _color; + } + set + { + _color = value; + } + } + /// + /// Gets or sets the color of the font. + /// + /// The color of the font. + public string FontColor + { + get + { + return _fontColor; + } + set + { + _fontColor = value; + } + } + } +#endregion + +#region EventLocationInfo Class + /// + /// Information about the (optional) location of the event + /// + public class EventLocationInfo + { + + private int _portalID; + private int _location; + private string _locationName; + private string _mapURL; + private string _street; + private string _postalCode; + private string _city; + private string _region; + private string _country; + + // initialization + /// + /// Initializes a new instance of the class. + /// + public EventLocationInfo() + { + } + + // public properties + /// + /// Gets or sets the portal ID. + /// + /// The portal ID. + public int PortalID + { + get + { + return _portalID; + } + set + { + _portalID = value; + } + } + + /// + /// Gets or sets the location. + /// + /// The location. + public int Location + { + get + { + return _location; + } + set + { + _location = value; + } + } + + /// + /// Gets or sets the name of the location. + /// + /// The name of the location. + public string LocationName + { + get + { + return _locationName; + } + set + { + _locationName = value; + } + } + + /// + /// Gets or sets the map URL. + /// + /// The map URL. + public string MapURL + { + get + { + return _mapURL; + } + set + { + _mapURL = value; + } + } + + /// + /// Gets or sets the street of the location's address. + /// + /// The street of the location's address. + public string Street + { + get + { + return _street; + } + set + { + _street = value; + } + } + + /// + /// Gets or sets the postal code of the location's address. + /// + /// The postal code of the location's address. + public string PostalCode + { + get + { + return _postalCode; + } + set + { + _postalCode = value; + } + } + + /// + /// Gets or sets the city of the location's address. + /// + /// The city of the location's address. + public string City + { + get + { + return _city; + } + set + { + _city = value; + } + } + + /// + /// Gets or sets the region of the location's address. + /// + /// The region of the location's address. + public string Region + { + get + { + return _region; + } + set + { + _region = value; + } + } + + /// + /// Gets or sets the country of the location's address. + /// + /// The country of the location's address. + public string Country + { + get + { + return _country; + } + set + { + _country = value; + } + } + } +#endregion + +#region EventNotificationInfo Class + /// + /// Information for emial notification of events + /// + public class EventNotificationInfo + { + + private int _eventID; + private int _portalAliasID; + private int _notificationID; + private string _userEmail; + private bool _notificationSent = false; + private DateTime _notifyByDateTime; + private DateTime _eventTimeBegin; + private string _notifyLanguage; + private int _moduleID; + private int _tabID; + + // initialization + /// + /// Initializes a new instance of the class. + /// + public EventNotificationInfo() + { + } + + // public properties + /// + /// Gets or sets the event ID. + /// + /// The event ID. + public int EventID + { + get + { + return _eventID; + } + set + { + _eventID = value; + } + } + + /// + /// Gets or sets the portal alias ID. + /// + /// The portal alias ID. + public int PortalAliasID + { + get + { + return _portalAliasID; + } + set + { + _portalAliasID = value; + } + } + + /// + /// Gets or sets the notification ID. + /// + /// The notification ID. + public int NotificationID + { + get + { + return _notificationID; + } + set + { + _notificationID = value; + } + } + + /// + /// Gets or sets the user email. + /// + /// The user email. + public string UserEmail + { + get + { + return _userEmail; + } + set + { + _userEmail = value; + } + } + + /// + /// Gets or sets a value indicating whether [notification sent]. + /// + /// true if [notification sent]; otherwise, false. + public bool NotificationSent + { + get + { + return _notificationSent; + } + set + { + _notificationSent = value; + } + } + + /// + /// Gets or sets the notify by date time. + /// + /// The notify by date time. + public DateTime NotifyByDateTime + { + get + { + return _notifyByDateTime; + } + set + { + _notifyByDateTime = value; + } + } + + /// + /// Gets or sets the event time begin. + /// + /// The event time begin. + public DateTime EventTimeBegin + { + get + { + return _eventTimeBegin; + } + set + { + _eventTimeBegin = value; + } + } + + /// + /// Gets or sets the notify language. + /// + /// The notify language. + public string NotifyLanguage + { + get + { + return _notifyLanguage; + } + set + { + _notifyLanguage = value; + } + } + + /// + /// Gets or sets the module ID. + /// + /// The module ID. + public int ModuleID + { + get + { + return _moduleID; + } + set + { + _moduleID = value; + } + } + + /// + /// Gets or sets the tab ID. + /// + /// The tab ID. + public int TabID + { + get + { + return _tabID; + } + set + { + _tabID = value; + } + } + + } +#endregion + +#region EventRecurMasterInfo Class + /// + /// Master record for recurring events, holds a set of events together + /// + public class EventRecurMasterInfo + { + + /// + /// Priority of the (master) events + /// + public enum Priority + { + /// + /// High priority + /// + High = 1, + /// + /// Medium priority + /// + Medium = 2, + /// + /// Low priority + /// + Low = 3 + } + + private int _recurMasterID; + private int _moduleID; + private int _portalID; + private string _rrule = string.Empty; + private DateTime _dtstart; + private string _duration = string.Empty; + private DateTime _until; + private string _eventName = string.Empty; + private string _eventDesc = string.Empty; + private int _importance; + private string _notify = string.Empty; + private bool _approved; + private int _maxEnrollment; + private bool _signups; + private int _enrolled; + private int _enrollRoleID = 0; + private string _enrollType = string.Empty; + private decimal _enrollFee; + private string _payPalAccount = string.Empty; + private bool _detailPage; + private bool _detailNewWin; + private string _detailURL = string.Empty; + private string _imageURL = string.Empty; + private string _imageType = string.Empty; + private int _imageWidth; + private int _imageHeight; + private int _location; + private int _category; + private bool _imageDisplay; + private bool _sendReminder; + private int _reminderTime; + private string _reminderTimeMeasurement = string.Empty; + private string _reminder = string.Empty; + private string _reminderFrom = string.Empty; + private string _customField1 = string.Empty; + private string _customField2 = string.Empty; + private bool _enrollListView; + private bool _displayEndDate; + private bool _allDayEvent; + private string _cultureName = string.Empty; + private int _ownerID; + private int _createdByID; + private DateTime _createdDate; + private int _updatedByID; + private DateTime _updatedDate; + private int _firstEventID; + private string _eventTimeZoneId = string.Empty; + private bool _allowAnonEnroll; + private int _contentItemId; + private bool _journalItem; + private int _socialGroupId; + private int _socialUserId; + private string _summary = string.Empty; + private int _sequence; + + /// + /// Gets or sets the recur master ID. + /// + /// The recur master ID. + public int RecurMasterID + { + get + { + return _recurMasterID; + } + set + { + _recurMasterID = value; + } + } + + /// + /// Gets or sets the module ID. + /// + /// The module ID. + public int ModuleID + { + get + { + return _moduleID; + } + set + { + _moduleID = value; + } + } + + /// + /// Gets or sets the portal ID. + /// + /// The portal ID. + public int PortalID + { + get + { + return _portalID; + } + set + { + _portalID = value; + } + } + + /// + /// Gets or sets the Recurrence rule. + /// + /// The recurrence rule. + public string RRULE + { + get + { + return _rrule; + } + set + { + _rrule = value; + } + } + + /// + /// Gets or sets the Date start. + /// + /// The start date. + public DateTime Dtstart + { + get + { + return _dtstart; + } + set + { + _dtstart = value; + } + } + + /// + /// Gets or sets the duration. + /// + /// The duration. + public string Duration + { + get + { + return _duration; + } + set + { + _duration = value; + } + } + + /// + /// Gets or sets the until. + /// + /// The until. + public DateTime Until + { + get + { + return _until; + } + set + { + _until = value; + } + } + + /// + /// Gets or sets the name of the event. + /// + /// The name of the event. + public string EventName + { + get + { + return _eventName; + } + set + { + _eventName = value; + } + } + + /// + /// Gets or sets the event description + /// + /// The event description. + public string EventDesc + { + get + { + return _eventDesc; + } + set + { + _eventDesc = value; + } + } + + /// + /// Gets or sets the importance. + /// + /// The importance. + public Priority Importance + { + get + { + return ((Priority) _importance); + } + set + { + _importance = (int) value; + } + } + + /// + /// Gets or sets the notify. + /// + /// The notify. + public string Notify + { + get + { + return _notify; + } + set + { + _notify = value; + } + } + + /// + /// Gets or sets a value indicating whether this is approved. + /// + /// true if approved; otherwise, false. + public bool Approved + { + get + { + return _approved; + } + set + { + _approved = value; + } + } + + /// + /// Gets or sets a value indicating whether this is signups. + /// + /// true if signups; otherwise, false. + public bool Signups + { + get + { + return _signups; + } + set + { + _signups = value; + } + } + + /// + /// Gets or sets the max # of enrollment. + /// + /// The max # of enrollment. + public int MaxEnrollment + { + get + { + return _maxEnrollment; + } + set + { + _maxEnrollment = value; + } + } + + /// + /// Gets or sets the # enrolled. + /// + /// The #enrolled. + public int Enrolled + { + get + { + if (_enrolled < 0) + { + return 0; + } + return _enrolled; + } + set + { + _enrolled = value; + } + } + + /// + /// Gets or sets the enroll role ID. + /// + /// The enroll role ID. + public int EnrollRoleID + { + get + { + return _enrollRoleID; + } + set + { + _enrollRoleID = value; + } + } + + /// + /// Gets or sets the type of the enroll. + /// + /// The type of the enroll. + public string EnrollType + { + get + { + return _enrollType; + } + set + { + _enrollType = value; + } + } + + /// + /// Gets or sets the enroll fee. + /// + /// The enroll fee. + public decimal EnrollFee + { + get + { + return _enrollFee; + } + set + { + _enrollFee = value; + } + } + + /// + /// Gets or sets the pay pal account. + /// + /// The pay pal account. + public string PayPalAccount + { + get + { + return _payPalAccount; + } + set + { + _payPalAccount = value; + } + } + + /// + /// Gets or sets a value indicating whether to display on a detail page. + /// + /// true if [detail page]; otherwise, false. + public bool DetailPage + { + get + { + return _detailPage; + } + set + { + _detailPage = value; + } + } + /// + /// Gets or sets a value indicating whether to dispay the event in a new page. + /// + /// true if [detail new page]; otherwise, false. + public bool DetailNewWin + { + get + { + return _detailNewWin; + } + set + { + _detailNewWin = value; + } + } + + /// + /// Gets or sets the detail URL. + /// + /// The detail URL. + public string DetailURL + { + get + { + return _detailURL; + } + set + { + _detailURL = value; + } + } + + /// + /// Gets or sets the image URL. + /// + /// The image URL. + public string ImageURL + { + get + { + return _imageURL; + } + set + { + _imageURL = value; + } + } + + /// + /// Gets or sets the type of the image. + /// + /// The type of the image. + public string ImageType + { + get + { + return _imageType; + } + set + { + _imageType = value; + } + } + + /// + /// Gets or sets the width of the image. + /// + /// The width of the image. + public int ImageWidth + { + get + { + return _imageWidth; + } + set + { + _imageWidth = value; + } + } + + /// + /// Gets or sets the height of the image. + /// + /// The height of the image. + public int ImageHeight + { + get + { + return _imageHeight; + } + set + { + _imageHeight = value; + } + } + + /// + /// Gets or sets the location. + /// + /// The location. + public int Location + { + get + { + return _location; + } + set + { + _location = value; + } + } + + /// + /// Gets or sets the category. + /// + /// The category. + public int Category + { + get + { + return _category; + } + set + { + _category = value; + } + } + + /// + /// Gets or sets a value indicating whether [image display]. + /// + /// true if [image display]; otherwise, false. + public bool ImageDisplay + { + get + { + return _imageDisplay; + } + set + { + _imageDisplay = value; + } + } + + /// + /// Gets or sets a value indicating whether [send reminder]. + /// + /// true if [send reminder]; otherwise, false. + public bool SendReminder + { + get + { + return _sendReminder; + } + set + { + _sendReminder = value; + } + } + + /// + /// Gets or sets the reminder time. + /// + /// The reminder time. + public int ReminderTime + { + get + { + return _reminderTime; + } + set + { + _reminderTime = value; + } + } + + /// + /// Gets or sets the reminder time measurement. + /// + /// The reminder time measurement. + public string ReminderTimeMeasurement + { + get + { + return _reminderTimeMeasurement; + } + set + { + _reminderTimeMeasurement = value; + } + } + + /// + /// Gets or sets the reminder. + /// + /// The reminder. + public string Reminder + { + get + { + return _reminder; + } + set + { + _reminder = value; + } + } + + /// + /// Gets or sets the reminder from. + /// + /// The reminder from. + public string ReminderFrom + { + get + { + return _reminderFrom; + } + set + { + _reminderFrom = value; + } + } + + /// + /// Gets or sets the custom field1. + /// + /// The custom field1. + public string CustomField1 + { + get + { + return _customField1; + } + set + { + _customField1 = value; + } + } + + /// + /// Gets or sets the custom field2. + /// + /// The custom field2. + public string CustomField2 + { + get + { + return _customField2; + } + set + { + _customField2 = value; + } + } + + /// + /// Gets or sets a value indicating whether [enroll list view]. + /// + /// true if [enroll list view]; otherwise, false. + public bool EnrollListView + { + get + { + return _enrollListView; + } + set + { + _enrollListView = value; + } + } + + /// + /// Gets or sets a value indicating whether [display end date]. + /// + /// true if [display end date]; otherwise, false. + public bool DisplayEndDate + { + get + { + return _displayEndDate; + } + set + { + _displayEndDate = value; + } + } + + /// + /// Gets or sets a value indicating whether [all day event]. + /// + /// true if [all day event]; otherwise, false. + public bool AllDayEvent + { + get + { + return _allDayEvent; + } + set + { + _allDayEvent = value; + } + } + + /// + /// Gets or sets the name of the culture. + /// + /// The name of the culture. + public string CultureName + { + get + { + return _cultureName; + } + set + { + _cultureName = value; + } + } + + /// + /// Gets or sets the owner ID. + /// + /// The owner ID. + public int OwnerID + { + get + { + return _ownerID; + } + set + { + _ownerID = value; + } + } + + /// + /// Gets or sets the created by ID. + /// + /// The created by ID. + public int CreatedByID + { + get + { + return _createdByID; + } + set + { + _createdByID = value; + } + } + + /// + /// Gets or sets the created date. + /// + /// The created date. + public DateTime CreatedDate + { + get + { + return _createdDate; + } + set + { + _createdDate = value; + } + } + + /// + /// Gets or sets the updated by ID. + /// + /// The updated by ID. + public int UpdatedByID + { + get + { + return _updatedByID; + } + set + { + _updatedByID = value; + } + } + + /// + /// Gets or sets the updated date. + /// + /// The updated date. + public DateTime UpdatedDate + { + get + { + return _updatedDate; + } + set + { + _updatedDate = value; + } + } + + /// + /// Gets or sets the first event ID. + /// + /// The first event ID. + public int FirstEventID + { + get + { + return _firstEventID; + } + set + { + _firstEventID = value; + } + } + + /// + /// Gets or sets a value indicating what the [event timezoneid] is + /// + /// The event timezoneid. + public string EventTimeZoneId + { + get + { + if (string.IsNullOrEmpty(_eventTimeZoneId)) + { + EventModuleSettings ems = new EventModuleSettings(); + EventModuleSettings modSettings = ems.GetEventModuleSettings(_moduleID, null); + _eventTimeZoneId = modSettings.TimeZoneId; + } + return _eventTimeZoneId; + } + set + { + _eventTimeZoneId = value; + } + } + + /// + /// Gets or sets a value indicating whether [allow anonymous enrollment]. + /// + /// true if [allow anonymous enrollment]; otherwise, false. + public bool AllowAnonEnroll + { + get + { + return _allowAnonEnroll; + } + set + { + _allowAnonEnroll = value; + } + } + + /// + /// Gets or sets a value indicating the [content item id]. + /// + /// The contentitemid. + public int ContentItemID + { + get + { + return _contentItemId; + } + set + { + _contentItemId = value; + } + } + + /// + /// Gets or sets a value indicating whether [event has journal item]. + /// + /// true if [event has journal item]; otherwise, false. + public bool JournalItem + { + get + { + return _journalItem; + } + set + { + _journalItem = value; + } + } + + /// + /// Gets or sets a value indicating the [socialgroup id]. + /// + /// The SocialGroupid. + public int SocialGroupID + { + get + { + return _socialGroupId; + } + set + { + _socialGroupId = value; + } + } + + /// + /// Gets or sets a value indicating the [social user id]. + /// + /// The SocialUserid. + public int SocialUserID + { + get + { + return _socialUserId; + } + set + { + _socialUserId = value; + } + } + + /// + /// Gets or sets the summary. + /// + /// The summary. + public string Summary + { + get + { + return _summary; + } + set + { + _summary = value; + } + } + + /// + /// Gets or sets a value indicating the [sequence]. + /// + /// The Sequence. + public int Sequence + { + get + { + return _sequence; + } + set + { + _sequence = value; + } + } + + } +#endregion + +#region EventRRULEInfo Class + /// + /// Information about the recurrrence rules + /// + public class EventRRULEInfo + { + + private string _freq; + private int _interval; + private string _byDay; + private int _byMonthDay; + private int _byMonth; + private bool _su; + private bool _mo; + private bool _tu; + private bool _we; + private bool _th; + private bool _fr; + private bool _sa; + private int _suNo; + private int _moNo; + private int _tuNo; + private int _weNo; + private int _thNo; + private int _frNo; + private int _saNo; + private bool _freqBasic; + private string _wkst; + + /// + /// Gets or sets the frequency + /// + /// The frequency. + public string Freq + { + get + { + return _freq; + } + set + { + _freq = value; + } + } + + /// + /// Gets or sets the interval. + /// + /// The interval. + public int Interval + { + get + { + return _interval; + } + set + { + _interval = value; + } + } + + /// + /// Gets or sets the by day. + /// + /// The by day. + public string ByDay + { + get + { + return _byDay; + } + set + { + _byDay = value; + } + } + + /// + /// Gets or sets the by day of the month. + /// + /// The by day of the month. + public int ByMonthDay + { + get + { + return _byMonthDay; + } + set + { + _byMonthDay = value; + } + } + + /// + /// Gets or sets the by month. + /// + /// The by month. + public int ByMonth + { + get + { + return _byMonth; + } + set + { + _byMonth = value; + } + } + + /// + /// Gets or sets a value indicating whether this is sunday + /// + /// true if sunday; otherwise, false. + public bool Su + { + get + { + return _su; + } + set + { + _su = value; + } + } + + /// + /// Gets or sets the no sunday + /// + /// The no sunday + public int SuNo + { + get + { + return _suNo; + } + set + { + _suNo = value; + } + } + + /// + /// Gets or sets a value indicating whether this is monday + /// + /// true if monday; otherwise, false. + public bool Mo + { + get + { + return _mo; + } + set + { + _mo = value; + } + } + + /// + /// Gets or sets the no monday + /// + /// The no monday + public int MoNo + { + get + { + return _moNo; + } + set + { + _moNo = value; + } + } + + /// + /// Gets or sets a value indicating whether this is tuesday + /// + /// true if tuesday; otherwise, false. + public bool Tu + { + get + { + return _tu; + } + set + { + _tu = value; + } + } + + /// + /// Gets or sets the no tuesday + /// + /// The no tuesday. + public int TuNo + { + get + { + return _tuNo; + } + set + { + _tuNo = value; + } + } + + /// + /// Gets or sets a value indicating whether this is wednessday + /// + /// true if wednessday; otherwise, false. + public bool We + { + get + { + return _we; + } + set + { + _we = value; + } + } + + /// + /// Gets or sets the no wednessday. + /// + /// The no wednessday. + public int WeNo + { + get + { + return _weNo; + } + set + { + _weNo = value; + } + } + + /// + /// Gets or sets a value indicating whether this is thursday. + /// + /// true if thursday; otherwise, false. + public bool Th + { + get + { + return _th; + } + set + { + _th = value; + } + } + + /// + /// Gets or sets the no thursday + /// + /// The no thursday. + public int ThNo + { + get + { + return _thNo; + } + set + { + _thNo = value; + } + } + + /// + /// Gets or sets a value indicating whether this is friday. + /// + /// true if friday; otherwise, false. + public bool Fr + { + get + { + return _fr; + } + set + { + _fr = value; + } + } + + /// + /// Gets or sets the no friday. + /// + /// The no friday. + public int FrNo + { + get + { + return _frNo; + } + set + { + _frNo = value; + } + } + + /// + /// Gets or sets a value indicating whether this is saturday. + /// + /// true if saturday; otherwise, false. + public bool Sa + { + get + { + return _sa; + } + set + { + _sa = value; + } + } + + /// + /// Gets or sets the no saturday. + /// + /// The no saturday. + public int SaNo + { + get + { + return _saNo; + } + set + { + _saNo = value; + } + } + + public bool FreqBasic + { + get + { + return _freqBasic; + } + set + { + _freqBasic = value; + } + } + + public string Wkst + { + get + { + return _wkst; + } + set + { + _wkst = value; + } + } + + } +#endregion + +#region EventEmailInfo Class + /// + /// Information abotu e-mails related to events + /// + public class EventEmailInfo + { + private string _txtEmailSubject; + private string _txtEmailBody; + private string _txtEmailFrom; + private ArrayList _userIDs; + private ArrayList _userEmails; + private ArrayList _userLocales; + private ArrayList _userTimeZoneIds; + + /// + /// Gets or sets the email subject. + /// + /// The email subject. + public string TxtEmailSubject + { + get + { + return _txtEmailSubject; + } + set + { + _txtEmailSubject = value; + } + } + + /// + /// Gets or sets the email body. + /// + /// The email body. + public string TxtEmailBody + { + get + { + return _txtEmailBody; + } + set + { + _txtEmailBody = value; + } + } + + /// + /// Gets or sets the email from. + /// + /// The email from. + public string TxtEmailFrom + { + get + { + return _txtEmailFrom; + } + set + { + _txtEmailFrom = value; + } + } + + /// + /// Gets or sets the user I ds. + /// + /// The user I ds. + public ArrayList UserIDs + { + get + { + return _userIDs; + } + set + { + _userIDs = value; + } + } + + /// + /// Gets or sets the user emails. + /// + /// The user emails. + public ArrayList UserEmails + { + get + { + return _userEmails; + } + set + { + _userEmails = value; + } + } + + /// + /// Gets or sets the user locales. + /// + /// The user locales. + public ArrayList UserLocales + { + get + { + return _userLocales; + } + set + { + _userLocales = value; + } + } + + /// + /// Gets or sets the user timezoneids. + /// + /// The user timezoneids. + public ArrayList UserTimeZoneIds + { + get + { + return _userTimeZoneIds; + } + set + { + _userTimeZoneIds = value; + } + } + + /// + /// Initializes a new instance of the class. + /// + public EventEmailInfo() + { + ArrayList newUserEmails = new ArrayList(); + UserEmails = newUserEmails; + + ArrayList newUserIDs = new ArrayList(); + UserIDs = newUserIDs; + + ArrayList newUserLocales = new ArrayList(); + UserLocales = newUserLocales; + + ArrayList newUserTimeZoneIds = new ArrayList(); + UserTimeZoneIds = newUserTimeZoneIds; + + } + } +#endregion + +#region EventSubscriptionInfo Class + /// + /// Information about subscription o events + /// + public class EventSubscriptionInfo + { + + private int _portalID; + private int _moduleID; + private int _userID; + private int _subscriptionID; + + // initialization + /// + /// Initializes a new instance of the class. + /// + public EventSubscriptionInfo() + { + } + + // public properties + /// + /// Gets or sets the portal ID. + /// + /// The portal ID. + public int PortalID + { + get + { + return _portalID; + } + set + { + _portalID = value; + } + } + + /// + /// Gets or sets the subscription ID. + /// + /// The subscription ID. + public int SubscriptionID + { + get + { + return _subscriptionID; + } + set + { + _subscriptionID = value; + } + } + + /// + /// Gets or sets the module ID. + /// + /// The module ID. + public int ModuleID + { + get + { + return _moduleID; + } + set + { + _moduleID = value; + } + } + + /// + /// Gets or sets the user ID. + /// + /// The user ID. + public int UserID + { + get + { + return _userID; + } + set + { + _userID = value; + } + } + + } +#endregion + +#region EventListObject Class + /// + /// Object for listing the events + /// + public class EventListObject : IComparable + { + + // public properties + private int _indexId; + /// + /// Gets or sets the index id. + /// + /// The index id. + public int IndexId + { + get + { + return _indexId; + } + set + { + _indexId = value; + } + } + private int _eventID; + /// + /// Gets or sets the event ID. + /// + /// The event ID. + public int EventID + { + get + { + return _eventID; + } + set + { + _eventID = value; + } + } + + private int _createdByID; + /// + /// Gets or sets the created by ID. + /// + /// The created by ID. + public int CreatedByID + { + get + { + return _createdByID; + } + set + { + _createdByID = value; + } + } + + private int _ownerID; + /// + /// Gets or sets the owner ID. + /// + /// The owner ID. + public int OwnerID + { + get + { + return _ownerID; + } + set + { + _ownerID = value; + } + } + + private int _moduleID; + /// + /// Gets or sets the module ID. + /// + /// The module ID. + public int ModuleID + { + get + { + return _moduleID; + } + set + { + _moduleID = value; + } + } + + private DateTime _eventDateBegin; + /// + /// Gets or sets the event date begin. + /// + /// The event date begin. + public DateTime EventDateBegin + { + get + { + return _eventDateBegin; + } + set + { + _eventDateBegin = value; + } + } + + private DateTime _eventDateEnd; + /// + /// Gets or sets the event date end. + /// + /// The event date end. + public DateTime EventDateEnd + { + get + { + return _eventDateEnd; + } + set + { + _eventDateEnd = value; + } + } + + private string _txtEventDateEnd; + /// + /// Gets or sets the event date end. + /// + /// The event date end. + public string TxtEventDateEnd + { + get + { + return _txtEventDateEnd; + } + set + { + _txtEventDateEnd = value; + } + } + + private DateTime _eventTimeBegin; + /// + /// Gets or sets the event time begin. + /// + /// The event time begin. + public DateTime EventTimeBegin + { + get + { + return _eventTimeBegin; + } + set + { + _eventTimeBegin = value; + } + } + + private string _txtEventTimeBegin; + /// + /// Gets or sets the event time begin. + /// + /// The event time begin. + public string TxtEventTimeBegin + { + get + { + return _txtEventTimeBegin; + } + set + { + _txtEventTimeBegin = value; + } + } + + private string _recurUntil; + /// + /// Gets or sets the recurrence until. + /// + /// The recurrence until. + public string RecurUntil + { + get + { + return _recurUntil; + } + set + { + _recurUntil = value; + } + } + + private int _duration; + /// + /// Gets or sets the duration. + /// + /// The duration. + public int Duration + { + get + { + return _duration; + } + set + { + _duration = value; + } + } + + private string _eventName; + /// + /// Gets or sets the name of the event. + /// + /// The name of the event. + public string EventName + { + get + { + return _eventName; + } + set + { + _eventName = value; + } + } + + private string _eventDesc; + /// + /// Gets or sets the event description + /// + /// The event description. + public string EventDesc + { + get + { + return _eventDesc; + } + set + { + _eventDesc = value; + } + } + + private string _decodedDesc; + /// + /// Gets or sets the decoded description. + /// + /// The decoded description. + public string DecodedDesc + { + get + { + return _decodedDesc; + } + set + { + _decodedDesc = value; + } + } + + private string _recurText; + /// + /// Gets or sets the recurrence text. + /// + /// The recurrence text. + public string RecurText + { + get + { + return _recurText; + } + set + { + _recurText = value; + } + } + + private string _url; + /// + /// Gets or sets the URL. + /// + /// The URL. + public string URL + { + get + { + return _url; + } + set + { + _url = value; + } + } + + private string _target; + /// + /// Gets or sets the target. + /// + /// The target. + public string Target + { + get + { + return _target; + } + set + { + _target = value; + } + } + + private string _imageURL; + /// + /// Gets or sets the image URL. + /// + /// The image URL. + public string ImageURL + { + get + { + return _imageURL; + } + set + { + _imageURL = value; + } + } + + + private string _categoryName; + /// + /// Gets or sets the name of the category. + /// + /// The name of the category. + public string CategoryName + { + get + { + return _categoryName; + } + set + { + _categoryName = value; + } + } + + private string _locationName; + /// + /// Gets or sets the name of the location. + /// + /// The name of the location. + public string LocationName + { + get + { + return _locationName; + } + set + { + _locationName = value; + } + } + + private string _customField1; + /// + /// Gets or sets the custom field1. + /// + /// The custom field1. + public string CustomField1 + { + get + { + return _customField1; + } + set + { + _customField1 = value; + } + } + + private string _customField2; + /// + /// Gets or sets the custom field2. + /// + /// The custom field2. + public string CustomField2 + { + get + { + return _customField2; + } + set + { + _customField2 = value; + } + } + + private bool _editVisibility; + /// + /// Gets or sets a value indicating whether visibility is editable. + /// + /// true if [edit visibility]; otherwise, false. + public bool EditVisibility + { + get + { + return _editVisibility; + } + set + { + _editVisibility = value; + } + } + + private Color _categoryColor; + /// + /// Gets or sets the color of the category. + /// + /// The color of the category. + public Color CategoryColor + { + get + { + return _categoryColor; + } + set + { + _categoryColor = value; + } + } + + private Color _categoryFontColor; + /// + /// Gets or sets the color of the category font. + /// + /// The color of the category font. + public Color CategoryFontColor + { + get + { + return _categoryFontColor; + } + set + { + _categoryFontColor = value; + } + } + + private int _displayDuration; + /// + /// Gets or sets the display duration. + /// + /// The display duration. + public int DisplayDuration + { + get + { + return _displayDuration; + } + set + { + _displayDuration = value; + } + } + + private int _recurMasterID; + /// + /// Gets or sets the recur master ID. + /// + /// The recur master ID. + public int RecurMasterID + { + get + { + return _recurMasterID; + } + set + { + _recurMasterID = value; + } + } + + private string _icons; + /// + /// Gets or sets the icons. + /// + /// The icons. + public string Icons + { + get + { + return _icons; + } + set + { + _icons = value; + } + } + + private string _tooltip; + /// + /// Gets or sets the tooltip. + /// + /// The tooltip. + public string Tooltip + { + get + { + return _tooltip; + } + set + { + _tooltip = value; + } + } + + private static SortFilter _sortExpression; + /// + /// Gets or sets the sort expression. + /// + /// The sort expression. + public static SortFilter SortExpression + { + get + { + return _sortExpression; + } + set + { + _sortExpression = value; + } + } + + private static SortDirection _sortDirection; + /// + /// Gets or sets the sort direction. + /// + /// The sort direction. + public static SortDirection SortDirection + { + get + { + return _sortDirection; + } + set + { + _sortDirection = value; + } + } + + + /// + /// Sorting enumeration + /// + public enum SortFilter + { + /// + /// By EventID + /// + EventID, + /// + /// By Date beging + /// + EventDateBegin, + /// + /// By Date end + /// + EventDateEnd, + /// + /// Bu Name + /// + EventName, + /// + /// By duration + /// + Duration, + /// + /// Bu category name + /// + CategoryName, + /// + /// By customfield1 + /// + CustomField1, + /// + /// By customfield2 + /// + CustomField2, + /// + /// By description + /// + Description, + /// + /// By Location name + /// + LocationName + } + + /// + /// Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. + /// + /// An object to compare with this instance. + /// + /// A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: + /// Value + /// Meaning + /// Less than zero + /// This instance is less than . + /// Zero + /// This instance is equal to . + /// Greater than zero + /// This instance is greater than . + /// + /// + /// is not the same type as this instance. + /// + public int CompareTo(object obj) + { + EventListObject o = (EventListObject) obj; + string xCompare = EventName + Strings.Format(EventID, "00000000"); + string yCompare = o.EventName + Strings.Format(o.EventID, "00000000"); + if (SortExpression == SortFilter.CategoryName) + { + xCompare = CategoryName + Strings.Format(EventID, "00000000"); + yCompare = o.CategoryName + Strings.Format(o.EventID, "00000000"); + } + else if (SortExpression == SortFilter.CustomField1) + { + xCompare = CustomField1 + Strings.Format(EventID, "00000000"); + yCompare = o.CustomField1 + Strings.Format(o.EventID, "00000000"); + } + else if (SortExpression == SortFilter.CustomField2) + { + xCompare = CustomField2 + Strings.Format(EventID, "00000000"); + yCompare = o.CustomField2 + Strings.Format(o.EventID, "00000000"); + } + else if (SortExpression == SortFilter.Description) + { + xCompare = EventDesc + Strings.Format(EventID, "00000000"); + yCompare = o.EventDesc + Strings.Format(o.EventID, "00000000"); + } + else if (SortExpression == SortFilter.Duration) + { + xCompare = System.Convert.ToString(Strings.Format(Duration, "000000") + Strings.Format(EventID, "00000000")); + yCompare = System.Convert.ToString(Strings.Format(o.Duration, "000000") + Strings.Format(o.EventID, "00000000")); + } + else if (SortExpression == SortFilter.EventDateBegin) + { + xCompare = System.Convert.ToString(Strings.Format(EventDateBegin, "yyyyMMddHHmm") + Strings.Format(EventID, "00000000")); + yCompare = System.Convert.ToString(Strings.Format(o.EventDateBegin, "yyyyMMddHHmm") + Strings.Format(o.EventID, "00000000")); + } + else if (SortExpression == SortFilter.EventDateEnd) + { + xCompare = System.Convert.ToString(Strings.Format(EventDateEnd, "yyyyMMddHHmm") + Strings.Format(EventID, "00000000")); + yCompare = System.Convert.ToString(Strings.Format(o.EventDateEnd, "yyyyMMddHHmm") + Strings.Format(o.EventID, "00000000")); + } + else if (SortExpression == SortFilter.LocationName) + { + xCompare = LocationName + Strings.Format(EventID, "00000000"); + yCompare = o.LocationName + Strings.Format(o.EventID, "00000000"); + } + else if (SortExpression == SortFilter.EventID) + { + xCompare = Strings.Format(EventID, "00000000"); + yCompare = Strings.Format(o.EventID, "00000000"); + } + if (SortDirection == System.Web.UI.WebControls.SortDirection.Ascending) + { + return System.String.Compare(xCompare, yCompare, StringComparison.CurrentCulture); + } + else + { + return System.String.Compare(yCompare, xCompare, StringComparison.CurrentCulture); + } + } + } +#endregion +#region EventUser Class + /// + /// user related to an event + /// + public class EventUser + { + private int _userID; + private string _displayName; + private string _profileURL; + private string _displayNameURL; + + /// + /// Gets or sets the user ID. + /// + /// The user ID. + public int UserID + { + get + { + return _userID; + } + set + { + _userID = value; + } + } + + /// + /// Gets or sets the display name. + /// + /// The display name. + public string DisplayName + { + get + { + return _displayName; + } + set + { + _displayName = value; + } + } + + /// + /// Gets or sets the profile URL. + /// + /// The profile URL. + public string ProfileURL + { + get + { + return _profileURL; + } + set + { + _profileURL = value; + } + } + + /// + /// Gets or sets the display name URL. + /// + /// The display name URL. + public string DisplayNameURL + { + get + { + return _displayNameURL; + } + set + { + _displayNameURL = value; + } + } + + } +#endregion + +#region EventEnrollList Class + /// + /// List of users enrolled into an event + /// + public class EventEnrollList + { + private int _signupID; + private string _enrollUserName; + private string _enrollDisplayName; + private string _enrollEmail; + private string _enrollPhone; + private bool _enrollApproved; + private int _enrollNo; + private DateTime _enrollTimeBegin; + + /// + /// Gets or sets the signup ID. + /// + /// The signup ID. + public int SignupID + { + get + { + return _signupID; + } + set + { + _signupID = value; + } + } + + /// + /// Gets or sets the name of the enroll user. + /// + /// The name of the enroll user. + public string EnrollUserName + { + get + { + return _enrollUserName; + } + set + { + _enrollUserName = value; + } + } + + /// + /// Gets or sets the display name of the enroll. + /// + /// The display name of the enroll. + public string EnrollDisplayName + { + get + { + return _enrollDisplayName; + } + set + { + _enrollDisplayName = value; + } + } + + /// + /// Gets or sets the enroll email. + /// + /// The enroll email. + public string EnrollEmail + { + get + { + return _enrollEmail; + } + set + { + _enrollEmail = value; + } + } + + /// + /// Gets or sets the enroll phone. + /// + /// The enroll phone. + public string EnrollPhone + { + get + { + return _enrollPhone; + } + set + { + _enrollPhone = value; + } + } + + /// + /// Gets or sets a value indicating whether [enroll approved]. + /// + /// true if [enroll approved]; otherwise, false. + public bool EnrollApproved + { + get + { + return _enrollApproved; + } + set + { + _enrollApproved = value; + } + } + + /// + /// Gets or sets the enroll no. + /// + /// The enroll no. + public int EnrollNo + { + get + { + return _enrollNo; + } + set + { + _enrollNo = value; + } + } + + /// + /// Gets or sets the enroll time begin. + /// + /// The enroll time begin. + public DateTime EnrollTimeBegin + { + get + { + return _enrollTimeBegin; + } + set + { + _enrollTimeBegin = value; + } + } + } +#endregion + + } diff --git a/Components/EventInfo.vb b/Components/EventInfo.vb deleted file mode 100644 index 05b65f2..0000000 --- a/Components/EventInfo.vb +++ /dev/null @@ -1,5039 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports System -Imports System.DateTime - - -Namespace DotNetNuke.Modules.Events - -#Region "EventInfo Class " - - Public Class EventInfo - Implements IComparable - ''' - ''' Priority setting for events, can be used to display appropriate icons in an event - ''' - Public Enum Priority - ''' - ''' High priority - ''' - High = 1 - ''' - ''' Medium priority - ''' - Medium = 2 - ''' - ''' Low priority - ''' - Low = 3 - End Enum - -#Region "Private Members" - Private _portalID As Integer - Private _eventID As Integer - Private _recurMasterID As Integer - Private _moduleID As Integer - Private _eventDateEnd As DateTime - Private _eventTimeBegin As DateTime - Private _duration As Integer - Private _eventName As String - Private _eventDesc As String - Private _importance As Integer - Private _createdDate As DateTime - Private _createdBy As String - Private _createdByID As Integer - ' ReSharper disable UnassignedField.Local - Private _every As Integer - Private _period As String - Private _repeatType As String - ' ReSharper restore UnassignedField.Local - Private _notify As String - Private _approved As Boolean - Private _maxEnrollment As Integer - Private _signups As Boolean - Private _enrolled As Integer - Private _noOfRecurrences As Integer - Private _lastRecurrence As DateTime - Private _enrollRoleID As Integer = Nothing - Private _enrollType As String - Private _enrollFee As Decimal - Private _payPalAccount As String - Private _cancelled As Boolean - Private _detailPage As Boolean - Private _detailNewWin As Boolean - Private _detailURL As String - Private _imageURL As String - Private _imageType As String - Private _imageWidth As Integer - Private _imageHeight As Integer - Private _location As Integer - Private _locationName As String - Private _mapURL As String - Private _category As Integer - Private _categoryName As String - Private _color As String - Private _fontColor As String - Private _imageDisplay As Boolean - Private _sendReminder As Boolean - Private _reminderTime As Integer - Private _reminderTimeMeasurement As String - Private _reminder As String - Private _reminderFrom As String - Private _searchSubmitted As Boolean - Private _moduleTitle As String - Private _customField1 As String - Private _customField2 As String - Private _enrollListView As Boolean - Private _displayEndDate As Boolean - Private _allDayEvent As Boolean - Private _ownerID As Integer - Private _ownerName As String - Private _lastUpdatedAt As DateTime - Private _lastUpdatedBy As String - Private _lastUpdatedID As Integer - Private _originalDateBegin As DateTime - Private _updateStatus As String - Private _rrule As String - Private _rmOwnerID As Integer - Private _newEventEmailSent As Boolean - Private _isPrivate As Boolean - Private _eventTimeZoneId As String - Private _otherTimeZoneId As String - Private _allowAnonEnroll As Boolean - Private _contentItemId As Integer - Private _journalItem As Boolean - Private _socialGroupId As Integer - Private _socialUserId As Integer - Private _summary As String - Private _sequence As Integer - Private _rmSequence As Integer - Private _socialUserUserName As String - Private _socialUserDisplayName As String - - -#End Region - -#Region "Constructors" - - ' initialization - ''' - ''' Initializes a new instance of the class. - ''' - Public Sub New() - End Sub -#End Region - -#Region "Public Properties" - - ' public properties - ''' - ''' Gets or sets the portal ID. - ''' - ''' The portal ID. - Property PortalID() As Integer - Get - Return _PortalID - End Get - Set(ByVal value As Integer) - _portalID = Value - End Set - End Property - - ''' - ''' Gets or sets the event ID. - ''' - ''' The event ID. - Property EventID() As Integer - Get - Return _eventID - End Get - Set(ByVal value As Integer) - _eventID = Value - End Set - End Property - - ''' - ''' Gets or sets the recurring master ID. - ''' - ''' The recur master ID. - Property RecurMasterID() As Integer - Get - Return _recurMasterID - End Get - Set(ByVal value As Integer) - _recurMasterID = Value - End Set - End Property - - ''' - ''' Gets or sets the module ID. - ''' - ''' The module ID. - Property ModuleID() As Integer - Get - Return _moduleID - End Get - Set(ByVal value As Integer) - _moduleID = Value - End Set - End Property - - ''' - ''' Gets or sets the event date end. - ''' - ''' The event date end. - - Property EventDateEnd() As Date - Get - Return _eventDateEnd - End Get - Set(ByVal value As Date) - _eventDateEnd = Value - End Set - End Property - - ''' - ''' Gets or sets the event time begin. - ''' - ''' The event time begin. - Property EventTimeBegin() As DateTime - Get - Return _eventTimeBegin - End Get - Set(ByVal value As DateTime) - _eventTimeBegin = Value - End Set - End Property - - ''' - ''' Gets the event time end. - ''' - ''' The event time end. - ReadOnly Property EventTimeEnd() As DateTime - Get - Return EventTimeBegin.AddMinutes(Duration) - End Get - End Property - - ''' - ''' Gets or sets the duration of an event. - ''' - ''' The duration. - Property Duration() As Integer - Get - Return _duration - End Get - Set(ByVal value As Integer) - _duration = value - End Set - End Property - - ''' - ''' Gets or sets the name of the event. - ''' - ''' The name of the event. - Property EventName() As String - Get - Return _eventName - End Get - Set(ByVal value As String) - _eventName = value - End Set - End Property - - ''' - ''' Gets or sets the event description - ''' - ''' The event description. - Property EventDesc() As String - Get - Return _eventDesc - End Get - Set(ByVal value As String) - _eventDesc = value - End Set - End Property - - ''' - ''' Gets or sets the importance of an event - ''' - ''' The importance of an event. - Property Importance() As Priority - Get - Return CType(_importance, Priority) - End Get - Set(ByVal value As Priority) - _importance = Value - End Set - End Property - - ''' - ''' Gets or sets the created date of an event - ''' - ''' The created date of an event. - Property CreatedDate() As DateTime - Get - Return _createdDate - End Get - Set(ByVal value As Date) - _createdDate = value - End Set - End Property - - ''' - ''' Gets or sets the created by of an event. - ''' - ''' The created by of an event. - Property CreatedBy() As String - Get - Return _createdBy - End Get - Set(ByVal value As String) - _createdBy = value - End Set - End Property - - ''' - ''' Gets or sets the created by UserID. - ''' - ''' The created by UserID. - Property CreatedByID() As Integer - Get - Return _createdByID - End Get - Set(ByVal value As Integer) - _createdByID = value - End Set - End Property - - ''' - ''' Gets or sets the recurrence unit of an event - ''' - ''' The recurrence unit of an event. - - ReadOnly Property Every() As Integer - Get - Return _every - End Get - End Property - - ''' - ''' Gets or sets the period of a recurrence. - ''' - ''' The period of a recurrnence. - - ReadOnly Property Period() As String - Get - Return _period - End Get - End Property - - ''' - ''' Gets or sets the type of the repeat of a recurrence - ''' - ''' The type of the repeat of a recurrence. - - ReadOnly Property RepeatType() As String - Get - Return _repeatType - End Get - End Property - - ''' - ''' Gets or sets the notification text - ''' - ''' The notification text. - Property Notify() As String - Get - Return _notify - End Get - Set(ByVal value As String) - _notify = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether this is approved. - ''' - ''' true if approved; otherwise, false. - Property Approved() As Boolean - Get - Return _approved - End Get - Set(ByVal value As Boolean) - _approved = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether this can have signups. - ''' - ''' true can have signups; otherwise, false. - Property Signups() As Boolean - Get - Return _signups - End Get - Set(ByVal value As Boolean) - _signups = value - End Set - End Property - - ''' - ''' Gets or sets the max # of enrollments - ''' - ''' The max # of enrollments - Property MaxEnrollment() As Integer - Get - Return _maxEnrollment - End Get - Set(ByVal value As Integer) - _maxEnrollment = value - End Set - End Property - - ''' - ''' Gets or sets the # of enrolled people - ''' - ''' The # enrolled of enrolled people. - Property Enrolled() As Integer - Get - If _enrolled < 0 Then - Return 0 - End If - Return _enrolled - End Get - Set(ByVal value As Integer) - _enrolled = value - End Set - End Property - - ''' - ''' Gets or sets the # f recurrences. - ''' - ''' The # of recurrences. - Property NoOfRecurrences() As Integer - Get - Return _noOfRecurrences - End Get - Set(ByVal value As Integer) - _noOfRecurrences = value - End Set - End Property - - ''' - ''' Gets or sets the last recurrence date - ''' - ''' The last recurrence date. - Property LastRecurrence() As Date - Get - Return _lastRecurrence - End Get - Set(ByVal value As Date) - _lastRecurrence = value - End Set - End Property - - ''' - ''' Gets or sets the enroll role ID. - ''' - ''' The enroll role ID. - Property EnrollRoleID() As Integer - Get - Return _enrollRoleID - End Get - Set(ByVal value As Integer) - _enrollRoleID = value - End Set - End Property - - ''' - ''' Gets or sets the type of the enrollment - ''' - ''' The type of the enrollment - Property EnrollType() As String - Get - Return _enrollType - End Get - Set(ByVal value As String) - _enrollType = value - End Set - End Property - - ''' - ''' Gets or sets the enroll fee. - ''' - ''' The enroll fee. - Property EnrollFee() As Decimal - Get - Return _enrollFee - End Get - Set(ByVal value As Decimal) - _enrollFee = Value - End Set - End Property - - ''' - ''' Gets or sets the PayPal account. - ''' - ''' The PayPal account. - Property PayPalAccount() As String - Get - Return _payPalAccount - End Get - Set(ByVal value As String) - _payPalAccount = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether this is cancelled. - ''' - ''' true if cancelled; otherwise, false. - Property Cancelled() As Boolean - Get - Return _cancelled - End Get - Set(ByVal value As Boolean) - _cancelled = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether a detail page must be openend. - ''' - ''' true if detail page must be opened; otherwise, false. - Property DetailPage() As Boolean - Get - Return _detailPage - End Get - Set(ByVal value As Boolean) - _detailPage = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether detail page must appear in a new page. - ''' - ''' true if new page; otherwise, false. - Property DetailNewWin() As Boolean - Get - Return _detailNewWin - End Get - Set(ByVal value As Boolean) - _detailNewWin = value - End Set - End Property - - ''' - ''' Gets or sets the detail URL. - ''' - ''' The detail URL. - Property DetailURL() As String - Get - Return _detailURL - End Get - Set(ByVal value As String) - _detailURL = value - End Set - End Property - ''' - ''' Gets or sets the image URL. - ''' - ''' The image URL. - Property ImageURL() As String - Get - Return _imageURL - End Get - Set(ByVal value As String) - _imageURL = value - End Set - End Property - - ''' - ''' Gets or sets the type of the image. - ''' - ''' The type of the image. - Property ImageType() As String - Get - Return _imageType - End Get - Set(ByVal value As String) - _imageType = value - End Set - End Property - - ''' - ''' Gets or sets the width of the image. - ''' - ''' The width of the image. - Property ImageWidth() As Integer - Get - Return _imageWidth - End Get - Set(ByVal value As Integer) - _imageWidth = value - End Set - End Property - - ''' - ''' Gets or sets the height of the image. - ''' - ''' The height of the image. - Property ImageHeight() As Integer - Get - Return _imageHeight - End Get - Set(ByVal value As Integer) - _imageHeight = value - End Set - End Property - - ''' - ''' Gets or sets the location of an event - ''' - ''' The location of an event. - Property Location() As Integer - Get - Return _location - End Get - Set(ByVal value As Integer) - _location = value - End Set - End Property - - ''' - ''' Gets or sets the name of the location of an event. - ''' - ''' The name of the location of an event. - Property LocationName() As String - Get - Return _locationName - End Get - Set(ByVal value As String) - _locationName = value - End Set - End Property - - ''' - ''' Gets or sets the map URL. - ''' - ''' The map URL. - Property MapURL() As String - Get - Return _mapURL - End Get - Set(ByVal value As String) - _mapURL = value - End Set - End Property - - ''' - ''' Gets or sets the category of an event - ''' - ''' The category of an event. - Property Category() As Integer - Get - Return _category - End Get - Set(ByVal value As Integer) - _category = value - End Set - End Property - - ''' - ''' Gets or sets the name of the category. - ''' - ''' The name of the category. - Property CategoryName() As String - Get - Return _categoryName - End Get - Set(ByVal value As String) - _categoryName = value - End Set - End Property - - ''' - ''' Gets or sets the category color to be used for display. - ''' - ''' The color of the category. - Property Color() As String - Get - Return _color - End Get - Set(ByVal value As String) - _color = value - End Set - End Property - - ''' - ''' Gets or sets the category color of the font (foreground color). - ''' - ''' The color of the font. - Property FontColor() As String - Get - Return _fontColor - End Get - Set(ByVal value As String) - _fontColor = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether an image must be displayed. - ''' - ''' true if image must be displayed; otherwise, false. - Property ImageDisplay() As Boolean - Get - Return _imageDisplay - End Get - Set(ByVal value As Boolean) - _imageDisplay = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether to send a reminder. - ''' - ''' true if send reminder; otherwise, false. - Property SendReminder() As Boolean - Get - Return _sendReminder - End Get - Set(ByVal value As Boolean) - _sendReminder = value - End Set - End Property - - ''' - ''' Gets or sets the reminder time. - ''' - ''' The reminder time. - Property ReminderTime() As Integer - Get - Return _reminderTime - End Get - Set(ByVal value As Integer) - _reminderTime = value - End Set - End Property - - ''' - ''' Gets or sets the reminder time measurement. - ''' - ''' The reminder time measurement. - Property ReminderTimeMeasurement() As String - Get - Return _reminderTimeMeasurement - End Get - Set(ByVal value As String) - _reminderTimeMeasurement = value - End Set - End Property - - ''' - ''' Gets or sets the reminder. - ''' - ''' The reminder. - Property Reminder() As String - Get - Return _reminder - End Get - Set(ByVal value As String) - _reminder = value - End Set - End Property - - ''' - ''' Gets or sets the reminder from e-mail address - ''' - ''' The reminder from e-mail address. - Property ReminderFrom() As String - Get - Return _reminderFrom - End Get - Set(ByVal value As String) - _reminderFrom = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether the event is submitted to the search - ''' - ''' true if search submitted; otherwise, false. - Property SearchSubmitted() As Boolean - Get - Return _searchSubmitted - End Get - Set(ByVal value As Boolean) - _searchSubmitted = value - End Set - End Property - - ''' - ''' Gets or sets the module title. - ''' - ''' The module title. - Property ModuleTitle() As String - Get - Return _moduleTitle - End Get - Set(ByVal value As String) - _moduleTitle = value - End Set - End Property - - ''' - ''' Gets or sets the custom field1. - ''' - ''' The custom field1. - Property CustomField1() As String - Get - Return _customField1 - End Get - Set(ByVal value As String) - _customField1 = value - End Set - End Property - - ''' - ''' Gets or sets the custom field2. - ''' - ''' The custom field2. - Property CustomField2() As String - Get - Return _customField2 - End Get - Set(ByVal value As String) - _customField2 = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether enroll list view is to be displayed. - ''' - ''' true if [enroll list view]; otherwise, false. - Property EnrollListView() As Boolean - Get - Return _enrollListView - End Get - Set(ByVal value As Boolean) - _enrollListView = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether end date is to be displayed - ''' - ''' true if [display end date]; otherwise, false. - Property DisplayEndDate() As Boolean - Get - Return _displayEndDate - End Get - Set(ByVal value As Boolean) - _displayEndDate = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether the event is an all day event. - ''' - ''' true if [all day event]; otherwise, false. - Property AllDayEvent() As Boolean - Get - Return _allDayEvent - End Get - Set(ByVal value As Boolean) - _allDayEvent = value - End Set - End Property - - ''' - ''' Gets or sets the owner ID (userID). - ''' - ''' The owner ID. - Property OwnerID() As Integer - Get - Return _ownerID - End Get - Set(ByVal value As Integer) - _ownerID = value - End Set - End Property - - ''' - ''' Gets or sets the name of the owner of the event - ''' - ''' The name of the owner. - Property OwnerName() As String - Get - Return _ownerName - End Get - Set(ByVal value As String) - _ownerName = value - End Set - End Property - - ''' - ''' Gets or sets the last updated at. - ''' - ''' The last updated at. - Property LastUpdatedAt() As DateTime - Get - Return _lastUpdatedAt - End Get - Set(ByVal value As DateTime) - _lastUpdatedAt = value - End Set - End Property - - ''' - ''' Gets or sets the last updated by. - ''' - ''' The last updated by. - Property LastUpdatedBy() As String - Get - Return _lastUpdatedBy - End Get - Set(ByVal value As String) - _lastUpdatedBy = value - End Set - End Property - - ''' - ''' Gets or sets the last updated userID - ''' - ''' The last updated userID. - Property LastUpdatedID() As Integer - Get - Return _lastUpdatedID - End Get - Set(ByVal value As Integer) - _lastUpdatedID = value - End Set - End Property - - ''' - ''' Gets or sets the original date begin. - ''' - ''' The original date begin. - Property OriginalDateBegin() As Date - Get - Return _originalDateBegin - End Get - Set(ByVal value As Date) - _originalDateBegin = value - End Set - End Property - - ''' - ''' Gets or sets the update status. - ''' - ''' The update status. - Property UpdateStatus() As String - Get - Return _updateStatus - End Get - Set(ByVal value As String) - _updateStatus = value - End Set - End Property - - ''' - ''' Gets or sets the Recurrence Rule. - ''' - ''' The Recurrence Rule. - Property RRULE() As String - Get - Return _rrule - End Get - Set(ByVal value As String) - _rrule = value - End Set - End Property - - ''' - ''' Gets or sets the RM owner ID. - ''' - ''' The RM owner ID. - Property RmOwnerID() As Integer - Get - Return _rmOwnerID - End Get - Set(ByVal value As Integer) - _rmOwnerID = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether [new event email sent]. - ''' - ''' true if [new event email sent]; otherwise, false. - Property NewEventEmailSent() As Boolean - Get - Return _newEventEmailSent - End Get - Set(ByVal value As Boolean) - _newEventEmailSent = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether [is private]. - ''' - ''' true if [is private]; otherwise, false. - Property IsPrivate() As Boolean - Get - Return _isPrivate - End Get - Set(ByVal value As Boolean) - _isPrivate = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating what the [event timezoneid] is - ''' - ''' The event timezoneid. - Property EventTimeZoneId() As String - Get - If String.IsNullOrEmpty(_eventTimeZoneId) Then - Dim ems As New EventModuleSettings - Dim modSettings As EventModuleSettings = ems.GetEventModuleSettings(_moduleID, Nothing) - _eventTimeZoneId = modSettings.TimeZoneId - End If - Return _eventTimeZoneId - End Get - Set(ByVal value As String) - _eventTimeZoneId = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating what the [other timezoneid] is - ''' - ''' The other timezoneid. - Property OtherTimeZoneId() As String - Get - If _otherTimeZoneId Is Nothing Then - _otherTimeZoneId = "UTC" - End If - Return _otherTimeZoneId - End Get - Set(ByVal value As String) - _otherTimeZoneId = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether [allow anonymous enrollment]. - ''' - ''' true if [allow anonymous enrollment]; otherwise, false. - Property AllowAnonEnroll() As Boolean - Get - Return _allowAnonEnroll - End Get - Set(ByVal value As Boolean) - _allowAnonEnroll = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating the [content item id]. - ''' - ''' The contentitemid. - Property ContentItemID() As Integer - Get - Return _contentItemId - End Get - Set(ByVal value As Integer) - _contentItemId = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether [event has journal item]. - ''' - ''' true if [event has journal item]; otherwise, false. - Property JournalItem() As Boolean - Get - Return _journalItem - End Get - Set(ByVal value As Boolean) - _journalItem = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating the [soccialgroup id]. - ''' - ''' The SocialGroupId. - Property SocialGroupId() As Integer - Get - Return _socialGroupId - End Get - Set(ByVal value As Integer) - _socialGroupId = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating the [user id]. - ''' - ''' The SocialUserId. - Property SocialUserId() As Integer - Get - Return _socialUserId - End Get - Set(ByVal value As Integer) - _socialUserId = value - End Set - End Property - - ''' - ''' Gets or sets the summary. - ''' - ''' The summary. - Property Summary() As String - Get - Return _summary - End Get - Set(ByVal value As String) - _summary = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating the [sequence]. - ''' - ''' The Sequence. - Property Sequence() As Integer - Get - Return _sequence - End Get - Set(ByVal value As Integer) - _sequence = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating the [recur master sequence]. - ''' - ''' The Recur MasterSequence. - Property RmSequence() As Integer - Get - Return _rmSequence - End Get - Set(ByVal value As Integer) - _rmSequence = value - End Set - End Property - - ''' - ''' Gets or sets the SocialUserUserName. - ''' - ''' The SocialUserUserName. - Property SocialUserUserName() As String - Get - Return _socialUserUserName - End Get - Set(ByVal value As String) - _socialUserUserName = value - End Set - End Property - - ''' - ''' Gets or sets the SocialUserDisplayName. - ''' - ''' The SocialUserDisplayName. - Property SocialUserDisplayName() As String - Get - Return _socialUserDisplayName - End Get - Set(ByVal value As String) - _socialUserDisplayName = value - End Set - End Property - - Private Shared _sortExpression As SortFilter - ''' - ''' Gets or sets the sort expression. - ''' - ''' The sort expression. - Shared Property SortExpression() As SortFilter - Get - Return _sortExpression - End Get - Set(ByVal value As SortFilter) - _sortExpression = value - End Set - End Property - - Private Shared _sortDirection As SortDirection - ''' - ''' Gets or sets the sort direction. - ''' - ''' The sort direction. - Shared Property SortDirection() As SortDirection - Get - Return _SortDirection - End Get - Set(ByVal value As SortDirection) - _SortDirection = value - End Set - End Property - - - ''' - ''' Sorting enumeration - ''' - Public Enum SortFilter - ''' - ''' By EventID - ''' - EventID - ''' - ''' By Date beging - ''' - EventDateBegin - ''' - ''' By Date end - ''' - EventDateEnd - ''' - ''' Bu Name - ''' - EventName - ''' - ''' By duration - ''' - Duration - ''' - ''' Bu category name - ''' - CategoryName - ''' - ''' By customfield1 - ''' - CustomField1 - ''' - ''' By customfield2 - ''' - CustomField2 - ''' - ''' By description - ''' - Description - ''' - ''' By Location name - ''' - LocationName - End Enum - - ''' - ''' Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. - ''' - ''' An object to compare with this instance. - ''' - ''' A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: - ''' Value - ''' Meaning - ''' Less than zero - ''' This instance is less than . - ''' Zero - ''' This instance is equal to . - ''' Greater than zero - ''' This instance is greater than . - ''' - ''' - ''' is not the same type as this instance. - ''' - Public Function CompareTo(ByVal obj As Object) As Integer Implements IComparable.CompareTo - Dim o As EventInfo = CType(obj, EventInfo) - Dim xCompare As String = EventName + Format(EventID, "00000000") - Dim yCompare As String = o.EventName + Format(o.EventID, "00000000") - Select Case SortExpression - Case SortFilter.CategoryName - xCompare = CategoryName + Format(EventID, "00000000") - yCompare = o.CategoryName + Format(o.EventID, "00000000") - Case SortFilter.CustomField1 - xCompare = CustomField1 + Format(EventID, "00000000") - yCompare = o.CustomField1 + Format(o.EventID, "00000000") - Case SortFilter.CustomField2 - xCompare = CustomField2 + Format(EventID, "00000000") - yCompare = o.CustomField2 + Format(o.EventID, "00000000") - Case SortFilter.Description - xCompare = EventDesc + Format(EventID, "00000000") - yCompare = o.EventDesc + Format(o.EventID, "00000000") - Case SortFilter.Duration - xCompare = Format(Duration, "000000") + Format(EventID, "00000000") - yCompare = Format(o.Duration, "000000") + Format(o.EventID, "00000000") - Case SortFilter.EventDateBegin - xCompare = Format(EventTimeBegin, "yyyyMMddHHmm") + Format(EventID, "00000000") - yCompare = Format(o.EventTimeBegin, "yyyyMMddHHmm") + Format(o.EventID, "00000000") - Case SortFilter.EventDateEnd - xCompare = Format(EventTimeEnd, "yyyyMMddHHmm") + Format(EventID, "00000000") - yCompare = Format(o.EventTimeEnd, "yyyyMMddHHmm") + Format(o.EventID, "00000000") - Case SortFilter.LocationName - xCompare = LocationName + Format(EventID, "00000000") - yCompare = o.LocationName + Format(o.EventID, "00000000") - End Select - If SortDirection = System.Web.UI.WebControls.SortDirection.Ascending Then - Return System.String.Compare(xCompare, yCompare, StringComparison.CurrentCulture) - Else - Return System.String.Compare(yCompare, xCompare, StringComparison.CurrentCulture) - End If - End Function - - -#End Region - -#Region "Public Methods" - - ''' - ''' Clones an instance of the events object - ''' - ''' Cloned Eventsinfo object - Public Function Clone() As EventInfo - Return DirectCast(MemberwiseClone(), EventInfo) - - End Function -#End Region - End Class - -#End Region - -#Region "EventMasterInfo Class " - Public Class EventMasterInfo - - Private _portalID As Integer - Private _masterID As Integer - Private _moduleID As Integer - Private _subEventID As Integer - Private _subEventTitle As String - - ''' - ''' Gets or sets the portal ID. - ''' - ''' The portal ID. - Property PortalID() As Integer - Get - Return _PortalID - End Get - Set(ByVal value As Integer) - _PortalID = value - End Set - End Property - - ''' - ''' Gets or sets the master ID. - ''' - ''' The master ID. - Property MasterID() As Integer - Get - Return _MasterID - End Get - Set(ByVal value As Integer) - _MasterID = value - End Set - End Property - - ''' - ''' Gets or sets the module ID. - ''' - ''' The module ID. - Property ModuleID() As Integer - Get - Return _ModuleID - End Get - Set(ByVal value As Integer) - _ModuleID = value - End Set - End Property - - ''' - ''' Gets or sets the sub event ID. - ''' - ''' The sub event ID. - Property SubEventID() As Integer - Get - Return _SubEventID - End Get - Set(ByVal value As Integer) - _SubEventID = value - End Set - End Property - - ''' - ''' Gets or sets the sub event title. - ''' - ''' The sub event title. - Property SubEventTitle() As String - Get - Return _SubEventTitle - End Get - Set(ByVal value As String) - _SubEventTitle = value - End Set - End Property - End Class -#End Region - -#Region "EventSignupsInfo Class" - ''' - ''' Information about the users that have signed up for a particular event - ''' - Public Class EventSignupsInfo - Implements IComparable - - ''' - ''' Priority of the event - ''' - Public Enum Priority - ''' - ''' Hign priority - ''' - High = 1 - ''' - ''' Medium priority - ''' - Medium = 2 - ''' - ''' Low priority - ''' - Low = 3 - End Enum - - Private _eventID As Integer - Private _moduleID As Integer - Private _signupID As Integer - Private _userID As Integer - Private _approved As Boolean = False - Private _userName As String - Private _email As String - Private _emailVisible As Boolean - Private _telephone As String - Private _eventTimeBegin As DateTime = Now - Private _eventTimeEnd As DateTime - Private _duration As Integer - Private _eventName As String - Private _importance As Integer - Private _eventApproved As Boolean = False - Private _maxEnrollment As Integer = 0 - Private _enrolled As Integer - Private _payPalStatus As String - Private _payPalReason As String - Private _payPalTransID As String - Private _payPalPayerID As String - Private _payPalPayerStatus As String - Private _payPalRecieverEmail As String - Private _payPalUserEmail As String - Private _payPalPayerEmail As String - Private _payPalFirstName As String - Private _payPalLastName As String - Private _payPalAddress As String - Private _payPalCity As String - Private _payPalState As String - Private _payPalZip As String - Private _payPalCountry As String - Private _payPalCurrency As String - Private _payPalPaymentDate As DateTime = Now - Private _payPalAmount As Decimal = 0 - Private _payPalFee As Decimal = 0 - Private _noEnrolees As Integer = 1 - Private _eventTimeZoneId As String - Private _anonEmail As String - Private _anonName As String - Private _anonTelephone As String - Private _anonCulture As String - Private _anonTimeZoneId As String - Private _firstName As String - Private _lastName As String - Private _company As String - Private _jobTitle As String - Private _referenceNumber As String - Private _remarks As String - Private _street As String - Private _postalCode As String - Private _city As String - Private _region As String - Private _country As String - - ' initialization - ''' - ''' Initializes a new instance of the class. - ''' - Public Sub New() - End Sub - - ' public properties - ''' - ''' Gets or sets the event ID. - ''' - ''' The event ID. - Property EventID() As Integer - Get - Return _EventID - End Get - Set(ByVal value As Integer) - _EventID = value - End Set - End Property - - ''' - ''' Gets or sets the module ID. - ''' - ''' The module ID. - Property ModuleID() As Integer - Get - Return _ModuleID - End Get - Set(ByVal value As Integer) - _ModuleID = value - End Set - End Property - - ''' - ''' Gets or sets the signup ID. - ''' - ''' The signup ID. - Property SignupID() As Integer - Get - Return _SignupID - End Get - Set(ByVal value As Integer) - _SignupID = value - End Set - End Property - - ''' - ''' Gets or sets the user ID. - ''' - ''' The user ID. - Property UserID() As Integer - Get - Return _UserID - End Get - Set(ByVal value As Integer) - _UserID = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether this is approved. - ''' - ''' true if approved; otherwise, false. - Property Approved() As Boolean - Get - Return _Approved - End Get - Set(ByVal value As Boolean) - _Approved = value - End Set - End Property - - ''' - ''' Gets or sets the name of the user for the signup - ''' - ''' The name of the user. - Property UserName() As String - Get - Return _UserName - End Get - Set(ByVal value As String) - _UserName = value - End Set - End Property - - ''' - ''' Gets or sets the email of the signup - ''' - ''' The email. - Property Email() As String - Get - Return _Email - End Get - Set(ByVal value As String) - _Email = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether email of the signup is visible. - ''' - ''' true if [email visible]; otherwise, false. - Property EmailVisible() As Boolean - Get - Return _EmailVisible - End Get - Set(ByVal value As Boolean) - _EmailVisible = value - End Set - End Property - - ''' - ''' Gets or sets the telephone of the signup - ''' - ''' The telephone. - Property Telephone() As String - Get - Return _Telephone - End Get - Set(ByVal value As String) - _Telephone = value - End Set - End Property - - ''' - ''' Gets the event date begin. - ''' - ''' The event date begin. - ReadOnly Property EventDateBegin() As Date - Get - Return _EventTimeBegin.Date - End Get - End Property - - ''' - ''' Gets or sets the event time begin. - ''' - ''' The event time begin. - Property EventTimeBegin() As DateTime - Get - Return _EventTimeBegin - End Get - Set(ByVal value As DateTime) - _EventTimeBegin = value - End Set - End Property - - ''' - ''' Gets or sets the event time end. - ''' - ''' The event time end. - Property EventTimeEnd() As DateTime - Get - Return _EventTimeEnd - End Get - Set(ByVal value As DateTime) - _EventTimeEnd = value - End Set - End Property - - ''' - ''' Gets or sets the duration. - ''' - ''' The duration. - Property Duration() As Integer - Get - Return _Duration - End Get - Set(ByVal value As Integer) - _Duration = value - End Set - End Property - - ''' - ''' Gets or sets the name of the event. - ''' - ''' The name of the event. - Property EventName() As String - Get - Return _EventName - End Get - Set(ByVal value As String) - _EventName = value - End Set - End Property - - ''' - ''' Gets or sets the importance of the event - ''' - ''' The importance. - Property Importance() As Priority - Get - Return CType(_Importance, Priority) - End Get - Set(ByVal value As Priority) - _Importance = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether the event is approved. - ''' - ''' true if [event approved]; otherwise, false. - Property EventApproved() As Boolean - Get - Return _EventApproved - End Get - Set(ByVal value As Boolean) - _EventApproved = value - End Set - End Property - - ''' - ''' Gets or sets the max # of enrollments - ''' - ''' The max # of enrollments. - Property MaxEnrollment() As Integer - Get - Return _MaxEnrollment - End Get - Set(ByVal value As Integer) - _MaxEnrollment = value - End Set - End Property - - ''' - ''' Gets or sets the # of enrolled. - ''' - ''' The # of enrolled. - Property Enrolled() As Integer - Get - Return _Enrolled - End Get - Set(ByVal value As Integer) - _Enrolled = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal status. - ''' - ''' The PayPal status. - Property PayPalStatus() As String - Get - Return _PayPalStatus - End Get - Set(ByVal value As String) - _PayPalStatus = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal result reason - ''' - ''' The PayPal reason. - Property PayPalReason() As String - Get - Return _PayPalReason - End Get - Set(ByVal value As String) - _PayPalReason = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal transaction ID. - ''' - ''' The PayPal transaction ID. - Property PayPalTransID() As String - Get - Return _PayPalTransID - End Get - Set(ByVal value As String) - _PayPalTransID = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal payer ID. - ''' - ''' The PayPal payer ID. - Property PayPalPayerID() As String - Get - Return _PayPalPayerID - End Get - Set(ByVal value As String) - _PayPalPayerID = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal payer status. - ''' - ''' The pay PayPal status. - Property PayPalPayerStatus() As String - Get - Return _PayPalPayerStatus - End Get - Set(ByVal value As String) - _PayPalPayerStatus = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal reciever email. - ''' - ''' The PayPal reciever email. - Property PayPalRecieverEmail() As String - Get - Return _PayPalRecieverEmail - End Get - Set(ByVal value As String) - _PayPalRecieverEmail = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal user email. - ''' - ''' The PayPal user email. - Property PayPalUserEmail() As String - Get - Return _PayPalUserEmail - End Get - Set(ByVal value As String) - _PayPalUserEmail = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal payer email. - ''' - ''' The PayPal payer email. - Property PayPalPayerEmail() As String - Get - Return _PayPalPayerEmail - End Get - Set(ByVal value As String) - _PayPalPayerEmail = value - End Set - End Property - - ''' - ''' Gets or sets the first name of the PayPal. - ''' - ''' The first name of the PayPal. - Property PayPalFirstName() As String - Get - Return _PayPalFirstName - End Get - Set(ByVal value As String) - _PayPalFirstName = value - End Set - End Property - - ''' - ''' Gets or sets the last name of the PayPal. - ''' - ''' The last name of the PayPal. - Property PayPalLastName() As String - Get - Return _PayPalLastName - End Get - Set(ByVal value As String) - _PayPalLastName = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal address. - ''' - ''' The PayPal address. - Property PayPalAddress() As String - Get - Return _PayPalAddress - End Get - Set(ByVal value As String) - _PayPalAddress = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal city. - ''' - ''' The PayPal city. - Property PayPalCity() As String - Get - Return _PayPalCity - End Get - Set(ByVal value As String) - _PayPalCity = value - End Set - End Property - - ''' - ''' Gets or sets the state of the PayPal. - ''' - ''' The state of the PayPal. - Property PayPalState() As String - Get - Return _PayPalState - End Get - Set(ByVal value As String) - _PayPalState = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal zip. - ''' - ''' The PayPal zip. - Property PayPalZip() As String - Get - Return _PayPalZip - End Get - Set(ByVal value As String) - _PayPalZip = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal country. - ''' - ''' The PayPal country. - Property PayPalCountry() As String - Get - Return _PayPalCountry - End Get - Set(ByVal value As String) - _PayPalCountry = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal currency. - ''' - ''' The PayPal currency. - Property PayPalCurrency() As String - Get - Return _PayPalCurrency - End Get - Set(ByVal value As String) - _PayPalCurrency = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal payment date. - ''' - ''' The PayPal payment date. - Property PayPalPaymentDate() As DateTime - Get - Return _PayPalPaymentDate - End Get - Set(ByVal value As DateTime) - _PayPalPaymentDate = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal amount. - ''' - ''' The PayPal amount. - Property PayPalAmount() As Decimal - Get - Return _PayPalAmount - End Get - Set(ByVal value As Decimal) - _PayPalAmount = Value - End Set - End Property - - ''' - ''' Gets or sets the PayPal fee. - ''' - ''' The PayPal fee. - Property PayPalFee() As Decimal - Get - Return _PayPalFee - End Get - Set(ByVal value As Decimal) - _PayPalFee = Value - End Set - End Property - - ''' - ''' Gets or sets the # of enrolees. - ''' - ''' The # of enrolees. - Property NoEnrolees() As Integer - Get - Return _NoEnrolees - End Get - Set(ByVal value As Integer) - _NoEnrolees = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating what the [event timezoneid] is - ''' - ''' The event timezoneid. - Property EventTimeZoneId() As String - Get - Return _EventTimeZoneId - End Get - Set(ByVal value As String) - _EventTimeZoneId = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating what the [anonymous email] is - ''' - ''' The event timezoneid. - Property AnonEmail() As String - Get - Return _AnonEmail - End Get - Set(ByVal value As String) - _AnonEmail = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating what the [anonymous name] is - ''' - ''' The event timezoneid. - Property AnonName() As String - Get - Return _AnonName - End Get - Set(ByVal value As String) - _AnonName = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating what the [anonymous telephone] is - ''' - ''' The event timezoneid. - Property AnonTelephone() As String - Get - Return _AnonTelephone - End Get - Set(ByVal value As String) - _AnonTelephone = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating what the [anonymous Culture] is - ''' - ''' The event timezoneid. - Property AnonCulture() As String - Get - Return _AnonCulture - End Get - Set(ByVal value As String) - _AnonCulture = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating what the [anonymous TimeZoneId] is - ''' - ''' The event timezoneid. - Property AnonTimeZoneId() As String - Get - Return _AnonTimeZoneId - End Get - Set(ByVal value As String) - _AnonTimeZoneId = value - End Set - End Property - - ''' - ''' Gets or sets the enrollee's dirst name. - ''' - ''' The enrollee's first name. - Property FirstName() As String - Get - Return _firstName - End Get - Set(ByVal value As String) - _firstName = value - End Set - End Property - - ''' - ''' Gets or sets the enrollee's last name. - ''' - ''' The enrollee's last name. - Property LastName() As String - Get - Return _lastName - End Get - Set(ByVal value As String) - _lastName = value - End Set - End Property - - ''' - ''' Gets or sets the enrollee's company. - ''' - ''' The enrollee's company. - Property Company() As String - Get - Return _company - End Get - Set(ByVal value As String) - _company = value - End Set - End Property - - ''' - ''' Gets or sets the enrollee's job title. - ''' - ''' The enrollee's job title. - Property JobTitle() As String - Get - Return _jobTitle - End Get - Set(ByVal value As String) - _jobTitle = value - End Set - End Property - - ''' - ''' Gets or sets the enrollee's reference number. - ''' - ''' The enrollee's reference number. - Property ReferenceNumber() As String - Get - Return _referenceNumber - End Get - Set(ByVal value As String) - _referenceNumber = value - End Set - End Property - - ''' - ''' Gets or sets the enrollee's remarks. - ''' - ''' The enrollee's remarks. - Property Remarks() As String - Get - Return _remarks - End Get - Set(ByVal value As String) - _remarks = value - End Set - End Property - - ''' - ''' Gets or sets the street of the enrollee's address. - ''' - ''' The street of the enrollee's address. - Property Street() As String - Get - Return _street - End Get - Set(ByVal value As String) - _street = value - End Set - End Property - - ''' - ''' Gets or sets the postal code of the enrollee's address. - ''' - ''' The postal code of the enrollee's address. - Property PostalCode() As String - Get - Return _postalCode - End Get - Set(ByVal value As String) - _postalCode = value - End Set - End Property - - ''' - ''' Gets or sets the city of the enrollee's address. - ''' - ''' The city of the enrollee's address. - Property City() As String - Get - Return _city - End Get - Set(ByVal value As String) - _city = value - End Set - End Property - - ''' - ''' Gets or sets the region of the enrollee's address. - ''' - ''' The region of the enrollee's address. - Property Region() As String - Get - Return _region - End Get - Set(ByVal value As String) - _region = value - End Set - End Property - - ''' - ''' Gets or sets the country of the enrollee's address. - ''' - ''' The country of the enrollee's address. - Property Country() As String - Get - Return _country - End Get - Set(ByVal value As String) - _country = value - End Set - End Property -#Region "Sorting" - Private Shared _sortExpression As SortFilter - ''' - ''' Gets or sets the sort expression. - ''' - ''' The sort expression. - Shared Property SortExpression() As SortFilter - Get - Return _SortExpression - End Get - Set(ByVal value As SortFilter) - _SortExpression = value - End Set - End Property - - Private Shared _sortDirection As SortDirection - ''' - ''' Gets or sets the sort direction. - ''' - ''' The sort direction. - Shared Property SortDirection() As SortDirection - Get - Return _SortDirection - End Get - Set(ByVal value As SortDirection) - _SortDirection = value - End Set - End Property - - - ''' - ''' Sorting enumeration - ''' - Public Enum SortFilter - ''' - ''' By EventID - ''' - EventID - ''' - ''' By Date beging - ''' - EventTimeBegin - ''' - ''' By Date end - ''' - EventTimeEnd - ''' - ''' Bu Name - ''' - EventName - ''' - ''' By duration - ''' - Duration - ''' - ''' By approved - ''' - Approved - End Enum - - ''' - ''' Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. - ''' - ''' An object to compare with this instance. - ''' - ''' A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: - ''' Value - ''' Meaning - ''' Less than zero - ''' This instance is less than . - ''' Zero - ''' This instance is equal to . - ''' Greater than zero - ''' This instance is greater than . - ''' - ''' - ''' is not the same type as this instance. - ''' - Public Function CompareTo(ByVal obj As Object) As Integer Implements IComparable.CompareTo - Dim o As EventSignupsInfo = CType(obj, EventSignupsInfo) - Dim xCompare As String = EventName + Format(EventID, "00000000") - Dim yCompare As String = o.EventName + Format(o.EventID, "00000000") - Select Case SortExpression - Case SortFilter.Duration - xCompare = Format(Duration, "000000") + Format(EventID, "00000000") - yCompare = Format(o.Duration, "000000") + Format(o.EventID, "00000000") - Case SortFilter.EventTimeBegin - xCompare = Format(EventTimeBegin, "yyyyMMddHHmm") + Format(EventID, "00000000") - yCompare = Format(o.EventTimeBegin, "yyyyMMddHHmm") + Format(o.EventID, "00000000") - Case SortFilter.EventTimeEnd - xCompare = Format(EventTimeEnd, "yyyyMMddHHmm") + Format(EventID, "00000000") - yCompare = Format(o.EventTimeEnd, "yyyyMMddHHmm") + Format(o.EventID, "00000000") - Case SortFilter.Approved - xCompare = Approved.ToString + Format(EventID, "00000000") - yCompare = o.Approved.ToString + Format(o.EventID, "00000000") - End Select - If SortDirection = System.Web.UI.WebControls.SortDirection.Ascending Then - Return System.String.Compare(xCompare, yCompare, StringComparison.CurrentCulture) - Else - Return System.String.Compare(yCompare, xCompare, StringComparison.CurrentCulture) - End If - End Function - -#End Region - -#Region "Public Methods" - - ''' - ''' Clones an instance of the eventssignups object - ''' - ''' Cloned EventsSignupsinfo object - Public Function Clone() As EventSignupsInfo - ' create the object - Return DirectCast(MemberwiseClone(), EventSignupsInfo) - End Function -#End Region - - End Class -#End Region - -#Region "EventPPErrorLogInfo Class" - ''' - ''' Information about any infomartion during PayPal payments - ''' - Public Class EventPpErrorLogInfo - ' ReSharper disable ConvertToConstant.Local - Private ReadOnly _payPalID As Integer = 0 - ' ReSharper restore ConvertToConstant.Local - Private _signupID As Integer = 0 - Private ReadOnly _createDate As DateTime = Now - Private _payPalStatus As String - Private _payPalReason As String - Private _payPalTransID As String - Private _payPalPayerID As String - Private _payPalPayerStatus As String - Private _payPalRecieverEmail As String - Private _payPalUserEmail As String - Private _payPalPayerEmail As String - Private _payPalFirstName As String - Private _payPalLastName As String - Private _payPalAddress As String - Private _payPalCity As String - Private _payPalState As String - Private _payPalZip As String - Private _payPalCountry As String - Private _payPalCurrency As String - Private _payPalPaymentDate As DateTime = Now - Private _payPalAmount As Double = 0.0 - Private _payPalFee As Double = 0.0 - - ' public properties - ''' - ''' Gets the PayPal ID. - ''' - ''' The PayPal ID. - Public ReadOnly Property PayPalID() As Integer - Get - Return _PayPalID - End Get - End Property - - ''' - ''' Gets or sets the signup ID. - ''' - ''' The signup ID. - Property SignupID() As Integer - Get - Return _SignupID - End Get - Set(ByVal value As Integer) - _SignupID = value - End Set - End Property - - ''' - ''' Gets the create date. - ''' - ''' The create date. - Public ReadOnly Property CreateDate() As DateTime - Get - Return _CreateDate - End Get - End Property - - ''' - ''' Gets or sets the PayPal status. - ''' - ''' The PayPal status. - Property PayPalStatus() As String - Get - Return _PayPalStatus - End Get - Set(ByVal value As String) - _PayPalStatus = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal reason. - ''' - ''' The PayPal reason. - Property PayPalReason() As String - Get - Return _PayPalReason - End Get - Set(ByVal value As String) - _PayPalReason = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal trans ID. - ''' - ''' The PayPal trans ID. - Property PayPalTransID() As String - Get - Return _PayPalTransID - End Get - Set(ByVal value As String) - _PayPalTransID = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal payer ID. - ''' - ''' The PayPal payer ID. - Property PayPalPayerID() As String - Get - Return _PayPalPayerID - End Get - Set(ByVal value As String) - _PayPalPayerID = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal payer status. - ''' - ''' The PayPal payer status. - Property PayPalPayerStatus() As String - Get - Return _PayPalPayerStatus - End Get - Set(ByVal value As String) - _PayPalPayerStatus = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal reciever email. - ''' - ''' The PayPal reciever email. - Property PayPalRecieverEmail() As String - Get - Return _PayPalRecieverEmail - End Get - Set(ByVal value As String) - _PayPalRecieverEmail = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal user email. - ''' - ''' The PayPal user email. - Property PayPalUserEmail() As String - Get - Return _PayPalUserEmail - End Get - Set(ByVal value As String) - _PayPalUserEmail = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal payer email. - ''' - ''' The PayPal payer email. - Property PayPalPayerEmail() As String - Get - Return _PayPalPayerEmail - End Get - Set(ByVal value As String) - _PayPalPayerEmail = value - End Set - End Property - - ''' - ''' Gets or sets the first name of the PayPal. - ''' - ''' The first name of the PayPal. - Property PayPalFirstName() As String - Get - Return _PayPalFirstName - End Get - Set(ByVal value As String) - _PayPalFirstName = value - End Set - End Property - - ''' - ''' Gets or sets the last name of the PayPal. - ''' - ''' The last name of the PayPal. - Property PayPalLastName() As String - Get - Return _PayPalLastName - End Get - Set(ByVal value As String) - _PayPalLastName = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal address. - ''' - ''' The PayPal address. - Property PayPalAddress() As String - Get - Return _PayPalAddress - End Get - Set(ByVal value As String) - _PayPalAddress = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal city. - ''' - ''' The PayPal city. - Property PayPalCity() As String - Get - Return _PayPalCity - End Get - Set(ByVal value As String) - _PayPalCity = value - End Set - End Property - - ''' - ''' Gets or sets the state of the PayPal. - ''' - ''' The state of the PayPal. - Property PayPalState() As String - Get - Return _PayPalState - End Get - Set(ByVal value As String) - _PayPalState = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal zip. - ''' - ''' The PayPal zip. - Property PayPalZip() As String - Get - Return _PayPalZip - End Get - Set(ByVal value As String) - _PayPalZip = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal country. - ''' - ''' The PayPal country. - Property PayPalCountry() As String - Get - Return _PayPalCountry - End Get - Set(ByVal value As String) - _PayPalCountry = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal currency. - ''' - ''' The PayPal currency. - Property PayPalCurrency() As String - Get - Return _PayPalCurrency - End Get - Set(ByVal value As String) - _PayPalCurrency = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal payment date. - ''' - ''' The PayPal payment date. - Property PayPalPaymentDate() As DateTime - Get - Return _PayPalPaymentDate - End Get - Set(ByVal value As DateTime) - _PayPalPaymentDate = value - End Set - End Property - - ''' - ''' Gets or sets the PayPal amount. - ''' - ''' The PayPal amount. - Property PayPalAmount() As Double - Get - Return _PayPalAmount - End Get - Set(ByVal value As Double) - _payPalAmount = Value - End Set - End Property - - ''' - ''' Gets or sets the PayPal fee. - ''' - ''' The PayPal fee. - Property PayPalFee() As Double - Get - Return _payPalFee - End Get - Set(ByVal value As Double) - _payPalFee = Value - End Set - End Property - - End Class -#End Region - -#Region "EventCategoryInfo Class" - ''' - ''' Information about the (optional) category of the envent - ''' - Public Class EventCategoryInfo - - Private _portalID As Integer - Private _category As Integer - Private _categoryName As String - Private _color As String - Private _fontColor As String - - ' initialization - ''' - ''' Initializes a new instance of the class. - ''' - Public Sub New() - End Sub - - ' public properties - ''' - ''' Gets or sets the portal ID. - ''' - ''' The portal ID. - Property PortalID() As Integer - Get - Return _PortalID - End Get - Set(ByVal value As Integer) - _PortalID = value - End Set - End Property - - ''' - ''' Gets or sets the category ID. - ''' - ''' The category ID. - Property Category() As Integer - Get - Return _Category - End Get - Set(ByVal value As Integer) - _Category = value - End Set - End Property - - ''' - ''' Gets or sets the name of the category. - ''' - ''' The name of the category. - Property CategoryName() As String - Get - Return _CategoryName - End Get - Set(ByVal value As String) - _CategoryName = value - End Set - End Property - - ''' - ''' Gets or sets the color. - ''' - ''' The color. - Property Color() As String - Get - Return _Color - End Get - Set(ByVal value As String) - _Color = value - End Set - End Property - ''' - ''' Gets or sets the color of the font. - ''' - ''' The color of the font. - Property FontColor() As String - Get - Return _FontColor - End Get - Set(ByVal value As String) - _FontColor = value - End Set - End Property - End Class -#End Region - -#Region "EventLocationInfo Class" - ''' - ''' Information about the (optional) location of the event - ''' - Public Class EventLocationInfo - - Private _portalID As Integer - Private _location As Integer - Private _locationName As String - Private _mapURL As String - Private _street As String - Private _postalCode As String - Private _city As String - Private _region As String - Private _country As String - - ' initialization - ''' - ''' Initializes a new instance of the class. - ''' - Public Sub New() - End Sub - - ' public properties - ''' - ''' Gets or sets the portal ID. - ''' - ''' The portal ID. - Property PortalID() As Integer - Get - Return _PortalID - End Get - Set(ByVal value As Integer) - _PortalID = value - End Set - End Property - - ''' - ''' Gets or sets the location. - ''' - ''' The location. - Property Location() As Integer - Get - Return _Location - End Get - Set(ByVal value As Integer) - _Location = value - End Set - End Property - - ''' - ''' Gets or sets the name of the location. - ''' - ''' The name of the location. - Property LocationName() As String - Get - Return _LocationName - End Get - Set(ByVal value As String) - _LocationName = value - End Set - End Property - - ''' - ''' Gets or sets the map URL. - ''' - ''' The map URL. - Property MapURL() As String - Get - Return _MapURL - End Get - Set(ByVal value As String) - _MapURL = value - End Set - End Property - - ''' - ''' Gets or sets the street of the location's address. - ''' - ''' The street of the location's address. - Property Street() As String - Get - Return _street - End Get - Set(ByVal value As String) - _street = value - End Set - End Property - - ''' - ''' Gets or sets the postal code of the location's address. - ''' - ''' The postal code of the location's address. - Property PostalCode() As String - Get - Return _postalCode - End Get - Set(ByVal value As String) - _postalCode = value - End Set - End Property - - ''' - ''' Gets or sets the city of the location's address. - ''' - ''' The city of the location's address. - Property City() As String - Get - Return _city - End Get - Set(ByVal value As String) - _city = value - End Set - End Property - - ''' - ''' Gets or sets the region of the location's address. - ''' - ''' The region of the location's address. - Property Region() As String - Get - Return _region - End Get - Set(ByVal value As String) - _region = value - End Set - End Property - - ''' - ''' Gets or sets the country of the location's address. - ''' - ''' The country of the location's address. - Property Country() As String - Get - Return _country - End Get - Set(ByVal value As String) - _country = value - End Set - End Property - End Class -#End Region - -#Region "EventNotificationInfo Class" - ''' - ''' Information for emial notification of events - ''' - Public Class EventNotificationInfo - - Private _eventID As Integer - Private _portalAliasID As Integer - Private _notificationID As Integer - Private _userEmail As String - Private _notificationSent As Boolean = False - Private _notifyByDateTime As DateTime - Private _eventTimeBegin As DateTime - Private _notifyLanguage As String - Private _moduleID As Integer - Private _tabID As Integer - - ' initialization - ''' - ''' Initializes a new instance of the class. - ''' - Public Sub New() - End Sub - - ' public properties - ''' - ''' Gets or sets the event ID. - ''' - ''' The event ID. - Property EventID() As Integer - Get - Return _EventID - End Get - Set(ByVal value As Integer) - _EventID = value - End Set - End Property - - ''' - ''' Gets or sets the portal alias ID. - ''' - ''' The portal alias ID. - Property PortalAliasID() As Integer - Get - Return _PortalAliasID - End Get - Set(ByVal value As Integer) - _PortalAliasID = value - End Set - End Property - - ''' - ''' Gets or sets the notification ID. - ''' - ''' The notification ID. - Property NotificationID() As Integer - Get - Return _NotificationID - End Get - Set(ByVal value As Integer) - _NotificationID = value - End Set - End Property - - ''' - ''' Gets or sets the user email. - ''' - ''' The user email. - Property UserEmail() As String - Get - Return _UserEmail - End Get - Set(ByVal value As String) - _UserEmail = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether [notification sent]. - ''' - ''' true if [notification sent]; otherwise, false. - Property NotificationSent() As Boolean - Get - Return _NotificationSent - End Get - Set(ByVal value As Boolean) - _NotificationSent = value - End Set - End Property - - ''' - ''' Gets or sets the notify by date time. - ''' - ''' The notify by date time. - Property NotifyByDateTime() As DateTime - Get - Return _NotifyByDateTime - End Get - Set(ByVal value As DateTime) - _NotifyByDateTime = value - End Set - End Property - - ''' - ''' Gets or sets the event time begin. - ''' - ''' The event time begin. - Property EventTimeBegin() As DateTime - Get - Return _EventTimeBegin - End Get - Set(ByVal value As DateTime) - _EventTimeBegin = value - End Set - End Property - - ''' - ''' Gets or sets the notify language. - ''' - ''' The notify language. - Property NotifyLanguage() As String - Get - Return _NotifyLanguage - End Get - Set(ByVal value As String) - _NotifyLanguage = value - End Set - End Property - - ''' - ''' Gets or sets the module ID. - ''' - ''' The module ID. - Property ModuleID() As Integer - Get - Return _ModuleID - End Get - Set(ByVal value As Integer) - _ModuleID = value - End Set - End Property - - ''' - ''' Gets or sets the tab ID. - ''' - ''' The tab ID. - Property TabID() As Integer - Get - Return _TabID - End Get - Set(ByVal value As Integer) - _TabID = value - End Set - End Property - - End Class -#End Region - -#Region "EventRecurMasterInfo Class " - ''' - ''' Master record for recurring events, holds a set of events together - ''' - Public Class EventRecurMasterInfo - - ''' - ''' Priority of the (master) events - ''' - Public Enum Priority - ''' - ''' High priority - ''' - High = 1 - ''' - ''' Medium priority - ''' - Medium = 2 - ''' - ''' Low priority - ''' - Low = 3 - End Enum - - Private _recurMasterID As Integer - Private _moduleID As Integer - Private _portalID As Integer - Private _rrule As String - Private _dtstart As DateTime - Private _duration As String - Private _until As DateTime - Private _eventName As String - Private _eventDesc As String - Private _importance As Integer - Private _notify As String - Private _approved As Boolean - Private _maxEnrollment As Integer - Private _signups As Boolean - Private _enrolled As Integer - Private _enrollRoleID As Integer = Nothing - Private _enrollType As String - Private _enrollFee As Decimal - Private _payPalAccount As String - Private _detailPage As Boolean - Private _detailNewWin As Boolean - Private _detailURL As String - Private _imageURL As String - Private _imageType As String - Private _imageWidth As Integer - Private _imageHeight As Integer - Private _location As Integer - Private _category As Integer - Private _imageDisplay As Boolean - Private _sendReminder As Boolean - Private _reminderTime As Integer - Private _reminderTimeMeasurement As String - Private _reminder As String - Private _reminderFrom As String - Private _customField1 As String - Private _customField2 As String - Private _enrollListView As Boolean - Private _displayEndDate As Boolean - Private _allDayEvent As Boolean - Private _cultureName As String - Private _ownerID As Integer - Private _createdByID As Integer - Private _createdDate As DateTime - Private _updatedByID As Integer - Private _updatedDate As DateTime - Private _firstEventID As Integer - Private _eventTimeZoneId As String - Private _allowAnonEnroll As Boolean - Private _contentItemId As Integer - Private _journalItem As Boolean - Private _socialGroupId As Integer - Private _socialUserId As Integer - Private _summary As String - Private _sequence As Integer - - ''' - ''' Gets or sets the recur master ID. - ''' - ''' The recur master ID. - Property RecurMasterID() As Integer - Get - Return _RecurMasterID - End Get - Set(ByVal value As Integer) - _RecurMasterID = value - End Set - End Property - - ''' - ''' Gets or sets the module ID. - ''' - ''' The module ID. - Property ModuleID() As Integer - Get - Return _ModuleID - End Get - Set(ByVal value As Integer) - _ModuleID = value - End Set - End Property - - ''' - ''' Gets or sets the portal ID. - ''' - ''' The portal ID. - Property PortalID() As Integer - Get - Return _PortalID - End Get - Set(ByVal value As Integer) - _PortalID = value - End Set - End Property - - ''' - ''' Gets or sets the Recurrence rule. - ''' - ''' The recurrence rule. - Property RRULE() As String - Get - Return _RRULE - End Get - Set(ByVal value As String) - _RRULE = value - End Set - End Property - - ''' - ''' Gets or sets the Date start. - ''' - ''' The start date. - Property Dtstart() As DateTime - Get - Return _dtstart - End Get - Set(ByVal value As DateTime) - _dtstart = value - End Set - End Property - - ''' - ''' Gets or sets the duration. - ''' - ''' The duration. - Property Duration() As String - Get - Return _Duration - End Get - Set(ByVal value As String) - _Duration = value - End Set - End Property - - ''' - ''' Gets or sets the until. - ''' - ''' The until. - Property Until() As DateTime - Get - Return _Until - End Get - Set(ByVal value As DateTime) - _Until = value - End Set - End Property - - ''' - ''' Gets or sets the name of the event. - ''' - ''' The name of the event. - Property EventName() As String - Get - Return _EventName - End Get - Set(ByVal value As String) - _EventName = value - End Set - End Property - - ''' - ''' Gets or sets the event description - ''' - ''' The event description. - Property EventDesc() As String - Get - Return _EventDesc - End Get - Set(ByVal value As String) - _EventDesc = value - End Set - End Property - - ''' - ''' Gets or sets the importance. - ''' - ''' The importance. - Property Importance() As Priority - Get - Return CType(_Importance, Priority) - End Get - Set(ByVal value As Priority) - _Importance = value - End Set - End Property - - ''' - ''' Gets or sets the notify. - ''' - ''' The notify. - Property Notify() As String - Get - Return _Notify - End Get - Set(ByVal value As String) - _Notify = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether this is approved. - ''' - ''' true if approved; otherwise, false. - Property Approved() As Boolean - Get - Return _Approved - End Get - Set(ByVal value As Boolean) - _Approved = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether this is signups. - ''' - ''' true if signups; otherwise, false. - Property Signups() As Boolean - Get - Return _Signups - End Get - Set(ByVal value As Boolean) - _Signups = value - End Set - End Property - - ''' - ''' Gets or sets the max # of enrollment. - ''' - ''' The max # of enrollment. - Property MaxEnrollment() As Integer - Get - Return _MaxEnrollment - End Get - Set(ByVal value As Integer) - _MaxEnrollment = value - End Set - End Property - - ''' - ''' Gets or sets the # enrolled. - ''' - ''' The #enrolled. - Property Enrolled() As Integer - Get - If _Enrolled < 0 Then - Return 0 - End If - Return _Enrolled - End Get - Set(ByVal value As Integer) - _Enrolled = value - End Set - End Property - - ''' - ''' Gets or sets the enroll role ID. - ''' - ''' The enroll role ID. - Property EnrollRoleID() As Integer - Get - Return _EnrollRoleID - End Get - Set(ByVal value As Integer) - _EnrollRoleID = value - End Set - End Property - - ''' - ''' Gets or sets the type of the enroll. - ''' - ''' The type of the enroll. - Property EnrollType() As String - Get - Return _EnrollType - End Get - Set(ByVal value As String) - _EnrollType = value - End Set - End Property - - ''' - ''' Gets or sets the enroll fee. - ''' - ''' The enroll fee. - Property EnrollFee() As Decimal - Get - Return _EnrollFee - End Get - Set(ByVal value As Decimal) - _EnrollFee = Value - End Set - End Property - - ''' - ''' Gets or sets the pay pal account. - ''' - ''' The pay pal account. - Property PayPalAccount() As String - Get - Return _PayPalAccount - End Get - Set(ByVal value As String) - _PayPalAccount = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether to display on a detail page. - ''' - ''' true if [detail page]; otherwise, false. - Property DetailPage() As Boolean - Get - Return _DetailPage - End Get - Set(ByVal value As Boolean) - _DetailPage = value - End Set - End Property - ''' - ''' Gets or sets a value indicating whether to dispay the event in a new page. - ''' - ''' true if [detail new page]; otherwise, false. - Property DetailNewWin() As Boolean - Get - Return _DetailNewWin - End Get - Set(ByVal value As Boolean) - _DetailNewWin = value - End Set - End Property - - ''' - ''' Gets or sets the detail URL. - ''' - ''' The detail URL. - Property DetailURL() As String - Get - Return _DetailURL - End Get - Set(ByVal value As String) - _DetailURL = value - End Set - End Property - - ''' - ''' Gets or sets the image URL. - ''' - ''' The image URL. - Property ImageURL() As String - Get - Return _ImageURL - End Get - Set(ByVal value As String) - _ImageURL = value - End Set - End Property - - ''' - ''' Gets or sets the type of the image. - ''' - ''' The type of the image. - Property ImageType() As String - Get - Return _ImageType - End Get - Set(ByVal value As String) - _ImageType = value - End Set - End Property - - ''' - ''' Gets or sets the width of the image. - ''' - ''' The width of the image. - Property ImageWidth() As Integer - Get - Return _ImageWidth - End Get - Set(ByVal value As Integer) - _ImageWidth = value - End Set - End Property - - ''' - ''' Gets or sets the height of the image. - ''' - ''' The height of the image. - Property ImageHeight() As Integer - Get - Return _ImageHeight - End Get - Set(ByVal value As Integer) - _ImageHeight = value - End Set - End Property - - ''' - ''' Gets or sets the location. - ''' - ''' The location. - Property Location() As Integer - Get - Return _Location - End Get - Set(ByVal value As Integer) - _Location = value - End Set - End Property - - ''' - ''' Gets or sets the category. - ''' - ''' The category. - Property Category() As Integer - Get - Return _Category - End Get - Set(ByVal value As Integer) - _Category = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether [image display]. - ''' - ''' true if [image display]; otherwise, false. - Property ImageDisplay() As Boolean - Get - Return _ImageDisplay - End Get - Set(ByVal value As Boolean) - _ImageDisplay = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether [send reminder]. - ''' - ''' true if [send reminder]; otherwise, false. - Property SendReminder() As Boolean - Get - Return _SendReminder - End Get - Set(ByVal value As Boolean) - _SendReminder = value - End Set - End Property - - ''' - ''' Gets or sets the reminder time. - ''' - ''' The reminder time. - Property ReminderTime() As Integer - Get - Return _ReminderTime - End Get - Set(ByVal value As Integer) - _ReminderTime = value - End Set - End Property - - ''' - ''' Gets or sets the reminder time measurement. - ''' - ''' The reminder time measurement. - Property ReminderTimeMeasurement() As String - Get - Return _ReminderTimeMeasurement - End Get - Set(ByVal value As String) - _ReminderTimeMeasurement = value - End Set - End Property - - ''' - ''' Gets or sets the reminder. - ''' - ''' The reminder. - Property Reminder() As String - Get - Return _Reminder - End Get - Set(ByVal value As String) - _Reminder = value - End Set - End Property - - ''' - ''' Gets or sets the reminder from. - ''' - ''' The reminder from. - Property ReminderFrom() As String - Get - Return _ReminderFrom - End Get - Set(ByVal value As String) - _ReminderFrom = value - End Set - End Property - - ''' - ''' Gets or sets the custom field1. - ''' - ''' The custom field1. - Property CustomField1() As String - Get - Return _CustomField1 - End Get - Set(ByVal value As String) - _CustomField1 = value - End Set - End Property - - ''' - ''' Gets or sets the custom field2. - ''' - ''' The custom field2. - Property CustomField2() As String - Get - Return _CustomField2 - End Get - Set(ByVal value As String) - _CustomField2 = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether [enroll list view]. - ''' - ''' true if [enroll list view]; otherwise, false. - Property EnrollListView() As Boolean - Get - Return _EnrollListView - End Get - Set(ByVal value As Boolean) - _EnrollListView = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether [display end date]. - ''' - ''' true if [display end date]; otherwise, false. - Property DisplayEndDate() As Boolean - Get - Return _DisplayEndDate - End Get - Set(ByVal value As Boolean) - _DisplayEndDate = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether [all day event]. - ''' - ''' true if [all day event]; otherwise, false. - Property AllDayEvent() As Boolean - Get - Return _AllDayEvent - End Get - Set(ByVal value As Boolean) - _AllDayEvent = value - End Set - End Property - - ''' - ''' Gets or sets the name of the culture. - ''' - ''' The name of the culture. - Property CultureName() As String - Get - Return _CultureName - End Get - Set(ByVal value As String) - _CultureName = value - End Set - End Property - - ''' - ''' Gets or sets the owner ID. - ''' - ''' The owner ID. - Property OwnerID() As Integer - Get - Return _OwnerID - End Get - Set(ByVal value As Integer) - _OwnerID = value - End Set - End Property - - ''' - ''' Gets or sets the created by ID. - ''' - ''' The created by ID. - Property CreatedByID() As Integer - Get - Return _CreatedByID - End Get - Set(ByVal value As Integer) - _CreatedByID = value - End Set - End Property - - ''' - ''' Gets or sets the created date. - ''' - ''' The created date. - Property CreatedDate() As DateTime - Get - Return _CreatedDate - End Get - Set(ByVal value As Date) - _CreatedDate = value - End Set - End Property - - ''' - ''' Gets or sets the updated by ID. - ''' - ''' The updated by ID. - Property UpdatedByID() As Integer - Get - Return _UpdatedByID - End Get - Set(ByVal value As Integer) - _UpdatedByID = value - End Set - End Property - - ''' - ''' Gets or sets the updated date. - ''' - ''' The updated date. - Property UpdatedDate() As DateTime - Get - Return _UpdatedDate - End Get - Set(ByVal value As DateTime) - _UpdatedDate = value - End Set - End Property - - ''' - ''' Gets or sets the first event ID. - ''' - ''' The first event ID. - Property FirstEventID() As Integer - Get - Return _FirstEventID - End Get - Set(ByVal value As Integer) - _FirstEventID = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating what the [event timezoneid] is - ''' - ''' The event timezoneid. - Property EventTimeZoneId() As String - Get - If String.IsNullOrEmpty(_EventTimeZoneId) Then - Dim ems As New EventModuleSettings - Dim modSettings As EventModuleSettings = ems.GetEventModuleSettings(_moduleID, Nothing) - _eventTimeZoneId = modSettings.TimeZoneId - End If - Return _EventTimeZoneId - End Get - Set(ByVal value As String) - _EventTimeZoneId = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether [allow anonymous enrollment]. - ''' - ''' true if [allow anonymous enrollment]; otherwise, false. - Property AllowAnonEnroll() As Boolean - Get - Return _AllowAnonEnroll - End Get - Set(ByVal value As Boolean) - _AllowAnonEnroll = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating the [content item id]. - ''' - ''' The contentitemid. - Property ContentItemID() As Integer - Get - Return _ContentItemId - End Get - Set(ByVal value As Integer) - _ContentItemId = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether [event has journal item]. - ''' - ''' true if [event has journal item]; otherwise, false. - Property JournalItem() As Boolean - Get - Return _JournalItem - End Get - Set(ByVal value As Boolean) - _JournalItem = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating the [socialgroup id]. - ''' - ''' The SocialGroupid. - Property SocialGroupID() As Integer - Get - Return _SocialGroupId - End Get - Set(ByVal value As Integer) - _SocialGroupId = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating the [social user id]. - ''' - ''' The SocialUserid. - Property SocialUserID() As Integer - Get - Return _SocialUserId - End Get - Set(ByVal value As Integer) - _SocialUserId = value - End Set - End Property - - ''' - ''' Gets or sets the summary. - ''' - ''' The summary. - Property Summary() As String - Get - Return _Summary - End Get - Set(ByVal value As String) - _Summary = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating the [sequence]. - ''' - ''' The Sequence. - Property Sequence() As Integer - Get - Return _Sequence - End Get - Set(ByVal value As Integer) - _Sequence = value - End Set - End Property - - End Class -#End Region - -#Region "EventRRULEInfo Class " - ''' - ''' Information about the recurrrence rules - ''' - Public Class EventRRULEInfo - - Private _freq As String - Private _interval As Integer - Private _byDay As String - Private _byMonthDay As Integer - Private _byMonth As Integer - Private _su, _mo, _tu, _we, _th, _fr, _sa As Boolean - Private _suNo, _moNo, _tuNo, _weNo, _thNo, _frNo, _saNo As Integer - Private _freqBasic As Boolean - Private _wkst As String - - ''' - ''' Gets or sets the frequency - ''' - ''' The frequency. - Property Freq() As String - Get - Return _Freq - End Get - Set(ByVal value As String) - _Freq = value - End Set - End Property - - ''' - ''' Gets or sets the interval. - ''' - ''' The interval. - Property Interval() As Integer - Get - Return _Interval - End Get - Set(ByVal value As Integer) - _Interval = value - End Set - End Property - - ''' - ''' Gets or sets the by day. - ''' - ''' The by day. - Property ByDay() As String - Get - Return _ByDay - End Get - Set(ByVal value As String) - _ByDay = value - End Set - End Property - - ''' - ''' Gets or sets the by day of the month. - ''' - ''' The by day of the month. - Property ByMonthDay() As Integer - Get - Return _ByMonthDay - End Get - Set(ByVal value As Integer) - _ByMonthDay = value - End Set - End Property - - ''' - ''' Gets or sets the by month. - ''' - ''' The by month. - Property ByMonth() As Integer - Get - Return _ByMonth - End Get - Set(ByVal value As Integer) - _ByMonth = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether this is sunday - ''' - ''' true if sunday; otherwise, false. - Property Su() As Boolean - Get - Return _Su - End Get - Set(ByVal value As Boolean) - _Su = value - End Set - End Property - - ''' - ''' Gets or sets the no sunday - ''' - ''' The no sunday - Property SuNo() As Integer - Get - Return _SuNo - End Get - Set(ByVal value As Integer) - _SuNo = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether this is monday - ''' - ''' true if monday; otherwise, false. - Property Mo() As Boolean - Get - Return _Mo - End Get - Set(ByVal value As Boolean) - _Mo = value - End Set - End Property - - ''' - ''' Gets or sets the no monday - ''' - ''' The no monday - Property MoNo() As Integer - Get - Return _MoNo - End Get - Set(ByVal value As Integer) - _MoNo = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether this is tuesday - ''' - ''' true if tuesday; otherwise, false. - Property Tu() As Boolean - Get - Return _Tu - End Get - Set(ByVal value As Boolean) - _Tu = value - End Set - End Property - - ''' - ''' Gets or sets the no tuesday - ''' - ''' The no tuesday. - Property TuNo() As Integer - Get - Return _TuNo - End Get - Set(ByVal value As Integer) - _TuNo = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether this is wednessday - ''' - ''' true if wednessday; otherwise, false. - Property We() As Boolean - Get - Return _We - End Get - Set(ByVal value As Boolean) - _We = value - End Set - End Property - - ''' - ''' Gets or sets the no wednessday. - ''' - ''' The no wednessday. - Property WeNo() As Integer - Get - Return _WeNo - End Get - Set(ByVal value As Integer) - _WeNo = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether this is thursday. - ''' - ''' true if thursday; otherwise, false. - Property Th() As Boolean - Get - Return _Th - End Get - Set(ByVal value As Boolean) - _Th = value - End Set - End Property - - ''' - ''' Gets or sets the no thursday - ''' - ''' The no thursday. - Property ThNo() As Integer - Get - Return _ThNo - End Get - Set(ByVal value As Integer) - _ThNo = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether this is friday. - ''' - ''' true if friday; otherwise, false. - Property Fr() As Boolean - Get - Return _Fr - End Get - Set(ByVal value As Boolean) - _Fr = value - End Set - End Property - - ''' - ''' Gets or sets the no friday. - ''' - ''' The no friday. - Property FrNo() As Integer - Get - Return _FrNo - End Get - Set(ByVal value As Integer) - _FrNo = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether this is saturday. - ''' - ''' true if saturday; otherwise, false. - Property Sa() As Boolean - Get - Return _Sa - End Get - Set(ByVal value As Boolean) - _Sa = value - End Set - End Property - - ''' - ''' Gets or sets the no saturday. - ''' - ''' The no saturday. - Property SaNo() As Integer - Get - Return _SaNo - End Get - Set(ByVal value As Integer) - _SaNo = value - End Set - End Property - - Property FreqBasic() As Boolean - Get - Return _FreqBasic - End Get - Set(ByVal value As Boolean) - _FreqBasic = value - End Set - End Property - - Property Wkst() As String - Get - Return _wkst - End Get - Set(ByVal value As String) - _wkst = value - End Set - End Property - - End Class -#End Region - -#Region "EventEmailInfo Class " - ''' - ''' Information abotu e-mails related to events - ''' - Public Class EventEmailInfo - Private _txtEmailSubject As String - Private _txtEmailBody As String - Private _txtEmailFrom As String - Private _userIDs As ArrayList - Private _userEmails As ArrayList - Private _userLocales As ArrayList - Private _userTimeZoneIds As ArrayList - - ''' - ''' Gets or sets the email subject. - ''' - ''' The email subject. - Property TxtEmailSubject() As String - Get - Return _txtEmailSubject - End Get - Set(ByVal value As String) - _txtEmailSubject = value - End Set - End Property - - ''' - ''' Gets or sets the email body. - ''' - ''' The email body. - Property TxtEmailBody() As String - Get - Return _txtEmailBody - End Get - Set(ByVal value As String) - _txtEmailBody = value - End Set - End Property - - ''' - ''' Gets or sets the email from. - ''' - ''' The email from. - Property TxtEmailFrom() As String - Get - Return _txtEmailFrom - End Get - Set(ByVal value As String) - _txtEmailFrom = value - End Set - End Property - - ''' - ''' Gets or sets the user I ds. - ''' - ''' The user I ds. - Property UserIDs() As ArrayList - Get - Return _UserIDs - End Get - Set(ByVal value As ArrayList) - _userIDs = Value - End Set - End Property - - ''' - ''' Gets or sets the user emails. - ''' - ''' The user emails. - Property UserEmails() As ArrayList - Get - Return _userEmails - End Get - Set(ByVal value As ArrayList) - _userEmails = Value - End Set - End Property - - ''' - ''' Gets or sets the user locales. - ''' - ''' The user locales. - Property UserLocales() As ArrayList - Get - Return _userLocales - End Get - Set(ByVal value As ArrayList) - _userLocales = Value - End Set - End Property - - ''' - ''' Gets or sets the user timezoneids. - ''' - ''' The user timezoneids. - Property UserTimeZoneIds() As ArrayList - Get - Return _userTimeZoneIds - End Get - Set(ByVal value As ArrayList) - _userTimeZoneIds = Value - End Set - End Property - - ''' - ''' Initializes a new instance of the class. - ''' - Public Sub New() - Dim newUserEmails As New ArrayList() - UserEmails = newUserEmails - - Dim newUserIDs As New ArrayList() - UserIDs = newUserIDs - - Dim newUserLocales As New ArrayList() - UserLocales = newUserLocales - - Dim newUserTimeZoneIds As New ArrayList() - UserTimeZoneIds = newUserTimeZoneIds - - End Sub - End Class -#End Region - -#Region "EventSubscriptionInfo Class" - ''' - ''' Information about subscription o events - ''' - Public Class EventSubscriptionInfo - - Private _portalID As Integer - Private _moduleID As Integer - Private _userID As Integer - Private _subscriptionID As Integer - - ' initialization - ''' - ''' Initializes a new instance of the class. - ''' - Public Sub New() - End Sub - - ' public properties - ''' - ''' Gets or sets the portal ID. - ''' - ''' The portal ID. - Property PortalID() As Integer - Get - Return _PortalID - End Get - Set(ByVal value As Integer) - _PortalID = value - End Set - End Property - - ''' - ''' Gets or sets the subscription ID. - ''' - ''' The subscription ID. - Property SubscriptionID() As Integer - Get - Return _SubscriptionID - End Get - Set(ByVal value As Integer) - _SubscriptionID = value - End Set - End Property - - ''' - ''' Gets or sets the module ID. - ''' - ''' The module ID. - Property ModuleID() As Integer - Get - Return _ModuleID - End Get - Set(ByVal value As Integer) - _ModuleID = value - End Set - End Property - - ''' - ''' Gets or sets the user ID. - ''' - ''' The user ID. - Property UserID() As Integer - Get - Return _UserID - End Get - Set(ByVal value As Integer) - _UserID = value - End Set - End Property - - End Class -#End Region - -#Region "EventListObject Class" - ''' - ''' Object for listing the events - ''' - Public Class EventListObject - Implements IComparable - - ' public properties - Private _indexId As Integer - ''' - ''' Gets or sets the index id. - ''' - ''' The index id. - Property IndexId() As Integer - Get - Return _IndexId - End Get - Set(ByVal value As Integer) - _IndexId = value - End Set - End Property - Private _eventID As Integer - ''' - ''' Gets or sets the event ID. - ''' - ''' The event ID. - Property EventID() As Integer - Get - Return _EventID - End Get - Set(ByVal value As Integer) - _EventID = value - End Set - End Property - - Private _createdByID As Integer - ''' - ''' Gets or sets the created by ID. - ''' - ''' The created by ID. - Property CreatedByID() As Integer - Get - Return _CreatedByID - End Get - Set(ByVal value As Integer) - _CreatedByID = value - End Set - End Property - - Private _ownerID As Integer - ''' - ''' Gets or sets the owner ID. - ''' - ''' The owner ID. - Property OwnerID() As Integer - Get - Return _OwnerID - End Get - Set(ByVal value As Integer) - _OwnerID = value - End Set - End Property - - Private _moduleID As Integer - ''' - ''' Gets or sets the module ID. - ''' - ''' The module ID. - Property ModuleID() As Integer - Get - Return _ModuleID - End Get - Set(ByVal value As Integer) - _ModuleID = value - End Set - End Property - - Private _eventDateBegin As Date - ''' - ''' Gets or sets the event date begin. - ''' - ''' The event date begin. - Property EventDateBegin() As Date - Get - Return _EventDateBegin - End Get - Set(ByVal value As Date) - _EventDateBegin = Value - End Set - End Property - - Private _eventDateEnd As Date - ''' - ''' Gets or sets the event date end. - ''' - ''' The event date end. - Property EventDateEnd() As Date - Get - Return _EventDateEnd - End Get - Set(ByVal value As Date) - _EventDateEnd = Value - End Set - End Property - - Private _txtEventDateEnd As String - ''' - ''' Gets or sets the event date end. - ''' - ''' The event date end. - Property TxtEventDateEnd() As String - Get - Return _txtEventDateEnd - End Get - Set(ByVal value As String) - _txtEventDateEnd = value - End Set - End Property - - Private _eventTimeBegin As DateTime - ''' - ''' Gets or sets the event time begin. - ''' - ''' The event time begin. - Property EventTimeBegin() As DateTime - Get - Return _EventTimeBegin - End Get - Set(ByVal value As DateTime) - _EventTimeBegin = Value - End Set - End Property - - Private _txtEventTimeBegin As String - ''' - ''' Gets or sets the event time begin. - ''' - ''' The event time begin. - Property TxtEventTimeBegin() As String - Get - Return _txtEventTimeBegin - End Get - Set(ByVal value As String) - _txtEventTimeBegin = value - End Set - End Property - - Private _recurUntil As String - ''' - ''' Gets or sets the recurrence until. - ''' - ''' The recurrence until. - Property RecurUntil() As String - Get - Return _RecurUntil - End Get - Set(ByVal value As String) - _RecurUntil = value - End Set - End Property - - Private _duration As Integer - ''' - ''' Gets or sets the duration. - ''' - ''' The duration. - Property Duration() As Integer - Get - Return _Duration - End Get - Set(ByVal value As Integer) - _Duration = value - End Set - End Property - - Private _eventName As String - ''' - ''' Gets or sets the name of the event. - ''' - ''' The name of the event. - Property EventName() As String - Get - Return _EventName - End Get - Set(ByVal value As String) - _EventName = value - End Set - End Property - - Private _eventDesc As String - ''' - ''' Gets or sets the event description - ''' - ''' The event description. - Property EventDesc() As String - Get - Return _EventDesc - End Get - Set(ByVal value As String) - _EventDesc = value - End Set - End Property - - Private _decodedDesc As String - ''' - ''' Gets or sets the decoded description. - ''' - ''' The decoded description. - Property DecodedDesc() As String - Get - Return _DecodedDesc - End Get - Set(ByVal value As String) - _DecodedDesc = value - End Set - End Property - - Private _recurText As String - ''' - ''' Gets or sets the recurrence text. - ''' - ''' The recurrence text. - Property RecurText() As String - Get - Return _RecurText - End Get - Set(ByVal value As String) - _RecurText = value - End Set - End Property - - Private _url As String - ''' - ''' Gets or sets the URL. - ''' - ''' The URL. - Property URL() As String - Get - Return _URL - End Get - Set(ByVal value As String) - _URL = value - End Set - End Property - - Private _target As String - ''' - ''' Gets or sets the target. - ''' - ''' The target. - Property Target() As String - Get - Return _Target - End Get - Set(ByVal value As String) - _Target = value - End Set - End Property - - Private _imageURL As String - ''' - ''' Gets or sets the image URL. - ''' - ''' The image URL. - Property ImageURL() As String - Get - Return _ImageURL - End Get - Set(ByVal value As String) - _ImageURL = value - End Set - End Property - - - Private _categoryName As String - ''' - ''' Gets or sets the name of the category. - ''' - ''' The name of the category. - Property CategoryName() As String - Get - Return _CategoryName - End Get - Set(ByVal value As String) - _CategoryName = value - End Set - End Property - - Private _locationName As String - ''' - ''' Gets or sets the name of the location. - ''' - ''' The name of the location. - Property LocationName() As String - Get - Return _LocationName - End Get - Set(ByVal value As String) - _LocationName = value - End Set - End Property - - Private _customField1 As String - ''' - ''' Gets or sets the custom field1. - ''' - ''' The custom field1. - Property CustomField1() As String - Get - Return _CustomField1 - End Get - Set(ByVal value As String) - _CustomField1 = value - End Set - End Property - - Private _customField2 As String - ''' - ''' Gets or sets the custom field2. - ''' - ''' The custom field2. - Property CustomField2() As String - Get - Return _CustomField2 - End Get - Set(ByVal value As String) - _CustomField2 = value - End Set - End Property - - Private _editVisibility As Boolean - ''' - ''' Gets or sets a value indicating whether visibility is editable. - ''' - ''' true if [edit visibility]; otherwise, false. - Property EditVisibility() As Boolean - Get - Return _EditVisibility - End Get - Set(ByVal value As Boolean) - _EditVisibility = value - End Set - End Property - - Private _categoryColor As Color - ''' - ''' Gets or sets the color of the category. - ''' - ''' The color of the category. - Property CategoryColor() As Color - Get - Return _categoryColor - End Get - Set(ByVal value As Color) - _categoryColor = value - End Set - End Property - - Private _categoryFontColor As Color - ''' - ''' Gets or sets the color of the category font. - ''' - ''' The color of the category font. - Property CategoryFontColor() As Color - Get - Return _categoryFontColor - End Get - Set(ByVal value As Color) - _categoryFontColor = value - End Set - End Property - - Private _displayDuration As Integer - ''' - ''' Gets or sets the display duration. - ''' - ''' The display duration. - Property DisplayDuration() As Integer - Get - Return _DisplayDuration - End Get - Set(ByVal value As Integer) - _DisplayDuration = value - End Set - End Property - - Private _recurMasterID As Integer - ''' - ''' Gets or sets the recur master ID. - ''' - ''' The recur master ID. - Property RecurMasterID() As Integer - Get - Return _RecurMasterID - End Get - Set(ByVal value As Integer) - _RecurMasterID = value - End Set - End Property - - Private _icons As String - ''' - ''' Gets or sets the icons. - ''' - ''' The icons. - Property Icons() As String - Get - Return _Icons - End Get - Set(ByVal value As String) - _Icons = value - End Set - End Property - - Private _tooltip As String - ''' - ''' Gets or sets the tooltip. - ''' - ''' The tooltip. - Property Tooltip() As String - Get - Return _Tooltip - End Get - Set(ByVal value As String) - _Tooltip = value - End Set - End Property - - Private Shared _sortExpression As SortFilter - ''' - ''' Gets or sets the sort expression. - ''' - ''' The sort expression. - Shared Property SortExpression() As SortFilter - Get - Return _SortExpression - End Get - Set(ByVal value As SortFilter) - _SortExpression = value - End Set - End Property - - Private Shared _sortDirection As SortDirection - ''' - ''' Gets or sets the sort direction. - ''' - ''' The sort direction. - Shared Property SortDirection() As SortDirection - Get - Return _SortDirection - End Get - Set(ByVal value As SortDirection) - _SortDirection = value - End Set - End Property - - - ''' - ''' Sorting enumeration - ''' - Public Enum SortFilter - ''' - ''' By EventID - ''' - EventID - ''' - ''' By Date beging - ''' - EventDateBegin - ''' - ''' By Date end - ''' - EventDateEnd - ''' - ''' Bu Name - ''' - EventName - ''' - ''' By duration - ''' - Duration - ''' - ''' Bu category name - ''' - CategoryName - ''' - ''' By customfield1 - ''' - CustomField1 - ''' - ''' By customfield2 - ''' - CustomField2 - ''' - ''' By description - ''' - Description - ''' - ''' By Location name - ''' - LocationName - End Enum - - ''' - ''' Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. - ''' - ''' An object to compare with this instance. - ''' - ''' A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: - ''' Value - ''' Meaning - ''' Less than zero - ''' This instance is less than . - ''' Zero - ''' This instance is equal to . - ''' Greater than zero - ''' This instance is greater than . - ''' - ''' - ''' is not the same type as this instance. - ''' - Public Function CompareTo(ByVal obj As Object) As Integer Implements IComparable.CompareTo - Dim o As EventListObject = CType(obj, EventListObject) - Dim xCompare As String = EventName + Format(EventID, "00000000") - Dim yCompare As String = o.EventName + Format(o.EventID, "00000000") - Select Case SortExpression - Case SortFilter.CategoryName - xCompare = CategoryName + Format(EventID, "00000000") - yCompare = o.CategoryName + Format(o.EventID, "00000000") - Case SortFilter.CustomField1 - xCompare = CustomField1 + Format(EventID, "00000000") - yCompare = o.CustomField1 + Format(o.EventID, "00000000") - Case SortFilter.CustomField2 - xCompare = CustomField2 + Format(EventID, "00000000") - yCompare = o.CustomField2 + Format(o.EventID, "00000000") - Case SortFilter.Description - xCompare = EventDesc + Format(EventID, "00000000") - yCompare = o.EventDesc + Format(o.EventID, "00000000") - Case SortFilter.Duration - xCompare = Format(Duration, "000000") + Format(EventID, "00000000") - yCompare = Format(o.Duration, "000000") + Format(o.EventID, "00000000") - Case SortFilter.EventDateBegin - xCompare = Format(EventDateBegin, "yyyyMMddHHmm") + Format(EventID, "00000000") - yCompare = Format(o.EventDateBegin, "yyyyMMddHHmm") + Format(o.EventID, "00000000") - Case SortFilter.EventDateEnd - xCompare = Format(EventDateEnd, "yyyyMMddHHmm") + Format(EventID, "00000000") - yCompare = Format(o.EventDateEnd, "yyyyMMddHHmm") + Format(o.EventID, "00000000") - Case SortFilter.LocationName - xCompare = LocationName + Format(EventID, "00000000") - yCompare = o.LocationName + Format(o.EventID, "00000000") - Case SortFilter.EventID - xCompare = Format(EventID, "00000000") - yCompare = Format(o.EventID, "00000000") - End Select - If SortDirection = System.Web.UI.WebControls.SortDirection.Ascending Then - Return System.String.Compare(xCompare, yCompare, StringComparison.CurrentCulture) - Else - Return System.String.Compare(yCompare, xCompare, StringComparison.CurrentCulture) - End If - End Function - End Class -#End Region -#Region "EventUser Class" - ''' - ''' user related to an event - ''' - Public Class EventUser - Private _userID As Integer - Private _displayName As String - Private _profileURL As String - Private _displayNameURL As String - - ''' - ''' Gets or sets the user ID. - ''' - ''' The user ID. - Property UserID() As Integer - Get - Return _UserID - End Get - Set(ByVal value As Integer) - _UserID = value - End Set - End Property - - ''' - ''' Gets or sets the display name. - ''' - ''' The display name. - Property DisplayName() As String - Get - Return _DisplayName - End Get - Set(ByVal value As String) - _DisplayName = value - End Set - End Property - - ''' - ''' Gets or sets the profile URL. - ''' - ''' The profile URL. - Property ProfileURL() As String - Get - Return _ProfileURL - End Get - Set(ByVal value As String) - _ProfileURL = value - End Set - End Property - - ''' - ''' Gets or sets the display name URL. - ''' - ''' The display name URL. - Property DisplayNameURL() As String - Get - Return _DisplayNameURL - End Get - Set(ByVal value As String) - _DisplayNameURL = value - End Set - End Property - - End Class -#End Region - -#Region "EventEnrollList Class " - ''' - ''' List of users enrolled into an event - ''' - Public Class EventEnrollList - Private _signupID As Int32 - Private _enrollUserName As String - Private _enrollDisplayName As String - Private _enrollEmail As String - Private _enrollPhone As String - Private _enrollApproved As Boolean - Private _enrollNo As Integer - Private _enrollTimeBegin As DateTime - - ''' - ''' Gets or sets the signup ID. - ''' - ''' The signup ID. - Property SignupID() As Int32 - Get - Return _signupID - End Get - Set(ByVal value As Int32) - _signupID = Value - End Set - End Property - - ''' - ''' Gets or sets the name of the enroll user. - ''' - ''' The name of the enroll user. - Property EnrollUserName() As String - Get - Return _enrollUserName - End Get - Set(ByVal value As String) - _enrollUserName = value - End Set - End Property - - ''' - ''' Gets or sets the display name of the enroll. - ''' - ''' The display name of the enroll. - Property EnrollDisplayName() As String - Get - Return _enrollDisplayName - End Get - Set(ByVal value As String) - _enrollDisplayName = value - End Set - End Property - - ''' - ''' Gets or sets the enroll email. - ''' - ''' The enroll email. - Property EnrollEmail() As String - Get - Return _enrollEmail - End Get - Set(ByVal value As String) - _enrollEmail = value - End Set - End Property - - ''' - ''' Gets or sets the enroll phone. - ''' - ''' The enroll phone. - Property EnrollPhone() As String - Get - Return _enrollPhone - End Get - Set(ByVal value As String) - _enrollPhone = value - End Set - End Property - - ''' - ''' Gets or sets a value indicating whether [enroll approved]. - ''' - ''' true if [enroll approved]; otherwise, false. - Property EnrollApproved() As Boolean - Get - Return _enrollApproved - End Get - Set(ByVal value As Boolean) - _enrollApproved = value - End Set - End Property - - ''' - ''' Gets or sets the enroll no. - ''' - ''' The enroll no. - Property EnrollNo() As Integer - Get - Return _enrollNo - End Get - Set(ByVal value As Integer) - _enrollNo = value - End Set - End Property - - ''' - ''' Gets or sets the enroll time begin. - ''' - ''' The enroll time begin. - Property EnrollTimeBegin() As DateTime - Get - Return _enrollTimeBegin - End Get - Set(ByVal value As DateTime) - _enrollTimeBegin = Value - End Set - End Property - End Class -#End Region - -End Namespace \ No newline at end of file diff --git a/Components/EventModuleSettings.cs b/Components/EventModuleSettings.cs new file mode 100644 index 0000000..3e78c34 --- /dev/null +++ b/Components/EventModuleSettings.cs @@ -0,0 +1,3951 @@ +using Microsoft.VisualBasic; +using System.Web.UI.WebControls; +using System.Collections; +using DotNetNuke.Common.Utilities; +using DotNetNuke.Services.Localization; +using System; +using DotNetNuke.Entities.Modules; + + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events + { + +#region EventModuleSettings + [Serializable()] + public class EventModuleSettings + { + public enum TimeZones : int + { + UserTZ = 1, + ModuleTZ, + PortalTZ + } + + public enum CategoriesSelected : int + { + All = 1, + Some, + None + } + + public enum DisplayCategories : int + { + DoNotDisplay = 1, + SingleSelect, + MultiSelect + } + + public enum LocationsSelected : int + { + All = 1, + Some, + None + } + + public enum DisplayLocations : int + { + DoNotDisplay = 1, + SingleSelect, + MultiSelect + } + + public enum SocialModule : int + { + No = 1, + SocialGroup, + UserProfile + } + + public enum SocialGroupPrivacy : int + { + OpenToAll = 1, + EditByGroup, + PrivateToGroup + } + +#region Private Members + private Hashtable _allsettings; + private int _moduleID = -1; + private string _localresourcefile = null; + + private string _version = ""; + private bool _ownerchangeallowed = false; + private bool _eventsignup = false; + private bool _eventsignupallowpaid = true; + private string _timeinterval = "30"; + private string _timeZone = null; + private string _timeZoneId = null; + private bool _enableEventTimeZones = false; + private TimeZones _primaryTimeZone = TimeZones.UserTZ; + private TimeZones _secondaryTimeZone = TimeZones.PortalTZ; + private bool _eventtooltipmonth = true; + private bool _eventtooltipweek = true; + private bool _eventtooltipday = true; + private bool _eventtooltiplist = true; + private int _eventtooltiplength = 10000; + private bool _monthcellnoevents = false; + // ReSharper disable FieldCanBeMadeReadOnly.Local + private bool _disablecategories = false; + // ReSharper restore FieldCanBeMadeReadOnly.Local + private DisplayCategories _enablecategories = (DisplayCategories) 0; + private bool _restrictcategories = false; + private bool _restrictcategoriestotimeframe = false; + // ReSharper disable FieldCanBeMadeReadOnly.Local + private bool _disablelocations = false; + // ReSharper restore FieldCanBeMadeReadOnly.Local + private DisplayLocations _enablelocations = (DisplayLocations) 0; + private bool _restrictlocations = false; + private bool _restrictlocationstotimeframe = false; + private bool _enablecontainerskin = true; + private bool _eventdetailnewpage = false; + private string _maxrecurrences = "1000"; + private bool _enableenrollpopup = true; + private bool _eventdaynewpage = false; + private string _defaultView = "EventMonth.ascx"; + private bool _eventnotify = true; + private bool _notifyanon = false; + private bool _sendreminderdefault = false; + private string _neweventemails = "Never"; + private int _neweventemailrole = -1; + private bool _newpereventemail = false; + private bool _tzdisplay = false; + private string _paypalurl = "https://www.paypal.com"; + private bool _disableEventnav = false; + private bool _collapserecurring = false; + private bool _fulltimescale = false; + private bool _includeendvalue = true; + private bool _showvaluemarks = false; + private bool _eventimage = true; + private bool _allowreoccurring = true; + private bool _eventsearch = true; + private bool _preventconflicts = false; + private bool _locationconflict = false; + private bool _showEventsAlways = false; + private bool _timeintitle = false; + private bool _monthdayselect = false; + private bool _masterEvent = false; + private bool _addsubmodulename = true; + private bool _enforcesubcalperms = true; + private bool _fridayweekend = false; + private bool _eventdefaultenrollview = false; + private string _paypalaccount = null; + private bool _moderateall = false; + private string _reminderfrom = null; + private string _eventsListSelectType = "EVENTS"; + private int _eventsListNumEvents = 10; + private int _eventsListEventDays = 365; + private int _eventsListPageSize = 10; + private string _eventsListSortDirection = "ASC"; + private bool _rssEnable = false; + private string _rssDateField = "UPDATEDDATE"; + private int _rssDays = 365; + private string _rssTitle = null; + private string _rssDesc = null; + private string _expireevents = ""; + private bool _exportowneremail = false; + private bool _exportanonowneremail = false; + private bool _monthAllowed = true; + private bool _weekAllowed = true; + private bool _listAllowed = true; + private bool _eventImageMonth = true; + private bool _eventImageWeek = false; + private string _iconBar = "TOP"; + private string _enrollEditFields = "03;05;"; + private string _enrollViewFields = ""; + private string _enrollAnonFields = "02;06;"; + private bool _eventhidefullenroll = false; + private int _maxnoenrolees = 1; + private int _enrolcanceldays = 0; + private bool _detailPageAllowed = false; + private bool _enrollmentPageAllowed = false; + private string _enrollmentPageDefaultUrl = ""; + private bool _eventsCustomField1 = false; + private bool _eventsCustomField2 = false; + private bool _iconMonthPrio = true; + private bool _iconMonthRec = true; + private bool _iconMonthReminder = true; + private bool _iconMonthEnroll = true; + private bool _iconWeekPrio = true; + private bool _iconWeekRec = true; + private bool _iconWeekReminder = true; + private bool _iconWeekEnroll = true; + private bool _iconListPrio = true; + private bool _iconListRec = true; + private bool _iconListReminder = true; + private bool _iconListEnroll = true; + private string _privateMessage = ""; + private string _eventTheme = ""; + private string _eventThemeDefault = "0,MinimalExtropy,"; + private string _eventsListFields = "BD;ED;EN"; + private string _eventsListShowHeader = "Yes"; + private int _eventsListBeforeDays = 1; + private int _eventsListAfterDays = 7; + private string _recurDummy = null; + private EventTemplates _templates; + private const int ModuleCategoryID = -1; + private ArrayList _moduleCategoryIDs = null; + private CategoriesSelected _moduleCategoriesSelected = CategoriesSelected.All; + private const int ModuleLocationID = -1; + private ArrayList _moduleLocationIDs = null; + private LocationsSelected _moduleLocationsSelected = LocationsSelected.All; + private string _eventsListSortColumn = "EventDateBegin"; + private string _htmlEmail = "html"; + private int _iCalDaysBefore = 365; + private int _iCalDaysAfter = 365; + private string _icalURLAppend = ""; + private string _icalDefaultImage = ""; + private bool _icalOnIconBar = false; + private bool _icalEmailEnable = false; + private bool _iIcalURLInLocation = true; + private bool _iIcalIncludeCalname = false; + private bool _enableSEO = true; + private int _seoDescriptionLength = 256; + private bool _enableSitemap = false; + private float _siteMapPriority = (float) (0.5F); + private int _siteMapDaysBefore = 365; + private int _siteMapDaysAfter = 365; + private bool _listViewGrid = true; + private bool _listViewTable = true; + private int _rptColumns = 1; + private int _rptRows = 5; + private System.Web.UI.WebControls.FirstDayOfWeek _weekStart = System.Web.UI.WebControls.FirstDayOfWeek.Default; + private bool _listViewUseTime = false; + private string _standardEmail = null; + private string _fbAdmins = ""; + private string _fbAppID = ""; + private int _maxThumbWidth = 125; + private int _maxThumbHeight = 125; + private bool _sendEnrollMessageApproved = true; + private bool _sendEnrollMessageWaiting = true; + private bool _sendEnrollMessageDenied = true; + private bool _sendEnrollMessageAdded = true; + private bool _sendEnrollMessageDeleted = true; + private bool _sendEnrollMessagePaying = true; + private bool _sendEnrollMessagePending = true; + private bool _sendEnrollMessagePaid = true; + private bool _sendEnrollMessageIncorrect = true; + private bool _sendEnrollMessageCancelled = true; + private bool _allowanonenroll = false; + private SocialModule _socialGroupModule = SocialModule.No; + private SortDirection _enrolListSortDirection = SortDirection.Descending; + private int _enrolListDaysBefore = (365 * 4) + 1; + private int _enrolListDaysAfter = (365 * 4) + 1; + private bool _journalIntegration = true; + private bool _socialUserPrivate = true; + private SocialGroupPrivacy _socialGroupSecurity = SocialGroupPrivacy.EditByGroup; + +#endregion + +#region Constructors + + public EventModuleSettings() + { + } + + public EventModuleSettings(int moduleId, string localResourceFile) + { + _moduleID = moduleId; + ModuleController mc = new ModuleController(); + _allsettings = (Hashtable) (mc.GetModuleSettings(_moduleID)); + _localresourcefile = localResourceFile; + + // Set default correct for those where the basic default is affected by upgrade + UpdateDefaults(); + + string temp_variable = Version; + ReadValue(_allsettings, "version", ref temp_variable); + Version = temp_variable; + string temp_variable2 = Timeinterval; + ReadValue(_allsettings, "timeinterval", ref temp_variable2); + Timeinterval = temp_variable2; + string temp_variable3 = TimeZone; + ReadValue(_allsettings, "TimeZone", ref temp_variable3); + TimeZone = temp_variable3; + string temp_variable4 = TimeZoneId; + ReadValue(_allsettings, "TimeZoneId", ref temp_variable4); + TimeZoneId = temp_variable4; + bool temp_variable5 = EnableEventTimeZones; + ReadValue(_allsettings, "EnableEventTimeZones", ref temp_variable5); + EnableEventTimeZones = temp_variable5; + TimeZones temp_variable6 = PrimaryTimeZone; + ReadValue(_allsettings, "PrimaryTimeZone", ref temp_variable6); + PrimaryTimeZone = temp_variable6; + TimeZones temp_variable7 = SecondaryTimeZone; + ReadValue(_allsettings, "SecondaryTimeZone", ref temp_variable7); + SecondaryTimeZone = temp_variable7; + bool temp_variable8 = Eventtooltipmonth; + ReadValue(_allsettings, "eventtooltipmonth", ref temp_variable8); + Eventtooltipmonth = temp_variable8; + bool temp_variable9 = Eventtooltipweek; + ReadValue(_allsettings, "eventtooltipweek", ref temp_variable9); + Eventtooltipweek = temp_variable9; + bool temp_variable10 = Eventtooltipday; + ReadValue(_allsettings, "eventtooltipday", ref temp_variable10); + Eventtooltipday = temp_variable10; + bool temp_variable11 = Eventtooltiplist; + ReadValue(_allsettings, "eventtooltiplist", ref temp_variable11); + Eventtooltiplist = temp_variable11; + int temp_variable12 = Eventtooltiplength; + ReadValue(_allsettings, "eventtooltiplength", ref temp_variable12); + Eventtooltiplength = temp_variable12; + bool temp_variable13 = Monthcellnoevents; + ReadValue(_allsettings, "monthcellnoevents", ref temp_variable13); + Monthcellnoevents = temp_variable13; + ReadValue(_allsettings, "disablecategories", ref _disablecategories); + DisplayCategories temp_variable14 = Enablecategories; + ReadValue(_allsettings, "enablecategories", ref temp_variable14); + Enablecategories = temp_variable14; + bool temp_variable15 = Restrictcategories; + ReadValue(_allsettings, "restrictcategories", ref temp_variable15); + Restrictcategories = temp_variable15; + bool temp_variable16 = RestrictCategoriesToTimeFrame; + ReadValue(_allsettings, "restrictcategoriestotimeframe", ref temp_variable16); + RestrictCategoriesToTimeFrame = temp_variable16; + ReadValue(_allsettings, "disablelocations", ref _disablelocations); + DisplayLocations temp_variable17 = Enablelocations; + ReadValue(_allsettings, "enablelocations", ref temp_variable17); + Enablelocations = temp_variable17; + bool temp_variable18 = Restrictlocations; + ReadValue(_allsettings, "restrictlocations", ref temp_variable18); + Restrictlocations = temp_variable18; + bool temp_variable19 = RestrictLocationsToTimeFrame; + ReadValue(_allsettings, "restrictlocationstotimeframe", ref temp_variable19); + RestrictLocationsToTimeFrame = temp_variable19; + bool temp_variable20 = Enablecontainerskin; + ReadValue(_allsettings, "enablecontainerskin", ref temp_variable20); + Enablecontainerskin = temp_variable20; + bool temp_variable21 = Eventdetailnewpage; + ReadValue(_allsettings, "eventdetailnewpage", ref temp_variable21); + Eventdetailnewpage = temp_variable21; + string temp_variable22 = Maxrecurrences; + ReadValue(_allsettings, "maxrecurrences", ref temp_variable22); + Maxrecurrences = temp_variable22; + bool temp_variable23 = Enableenrollpopup; + ReadValue(_allsettings, "enableenrollpopup", ref temp_variable23); + Enableenrollpopup = temp_variable23; + bool temp_variable24 = Eventdaynewpage; + ReadValue(_allsettings, "eventdaynewpage", ref temp_variable24); + Eventdaynewpage = temp_variable24; + string temp_variable25 = DefaultView; + ReadValue(_allsettings, "DefaultView", ref temp_variable25); + DefaultView = temp_variable25; + bool temp_variable26 = Eventnotify; + ReadValue(_allsettings, "Eventnotify", ref temp_variable26); + Eventnotify = temp_variable26; + bool temp_variable27 = Notifyanon; + ReadValue(_allsettings, "notifyanon", ref temp_variable27); + Notifyanon = temp_variable27; + bool temp_variable28 = Sendreminderdefault; + ReadValue(_allsettings, "sendreminderdefault", ref temp_variable28); + Sendreminderdefault = temp_variable28; + string temp_variable29 = Neweventemails; + ReadValue(_allsettings, "neweventemails", ref temp_variable29); + Neweventemails = temp_variable29; + int temp_variable30 = Neweventemailrole; + ReadValue(_allsettings, "neweventemailrole", ref temp_variable30); + Neweventemailrole = temp_variable30; + bool temp_variable31 = Newpereventemail; + ReadValue(_allsettings, "newpereventemail", ref temp_variable31); + Newpereventemail = temp_variable31; + bool temp_variable32 = Tzdisplay; + ReadValue(_allsettings, "tzdisplay", ref temp_variable32); + Tzdisplay = temp_variable32; + string temp_variable33 = Paypalurl; + ReadValue(_allsettings, "paypalurl", ref temp_variable33); + Paypalurl = temp_variable33; + bool temp_variable34 = DisableEventnav; + ReadValue(_allsettings, "disableEventnav", ref temp_variable34); + DisableEventnav = temp_variable34; + bool temp_variable35 = Collapserecurring; + ReadValue(_allsettings, "collapserecurring", ref temp_variable35); + Collapserecurring = temp_variable35; + bool temp_variable36 = Fulltimescale; + ReadValue(_allsettings, "fulltimescale", ref temp_variable36); + Fulltimescale = temp_variable36; + bool temp_variable37 = Includeendvalue; + ReadValue(_allsettings, "includeendvalue", ref temp_variable37); + Includeendvalue = temp_variable37; + bool temp_variable38 = Showvaluemarks; + ReadValue(_allsettings, "showvaluemarks", ref temp_variable38); + Showvaluemarks = temp_variable38; + bool temp_variable39 = Eventimage; + ReadValue(_allsettings, "eventimage", ref temp_variable39); + Eventimage = temp_variable39; + bool temp_variable40 = Allowreoccurring; + ReadValue(_allsettings, "allowreoccurring", ref temp_variable40); + Allowreoccurring = temp_variable40; + bool temp_variable41 = Eventsearch; + ReadValue(_allsettings, "Eventsearch", ref temp_variable41); + Eventsearch = temp_variable41; + bool temp_variable42 = Preventconflicts; + ReadValue(_allsettings, "preventconflicts", ref temp_variable42); + Preventconflicts = temp_variable42; + bool temp_variable43 = Locationconflict; + ReadValue(_allsettings, "locationconflict", ref temp_variable43); + Locationconflict = temp_variable43; + bool temp_variable44 = ShowEventsAlways; + ReadValue(_allsettings, "showEventsAlways", ref temp_variable44); + ShowEventsAlways = temp_variable44; + bool temp_variable45 = Timeintitle; + ReadValue(_allsettings, "timeintitle", ref temp_variable45); + Timeintitle = temp_variable45; + bool temp_variable46 = Monthdayselect; + ReadValue(_allsettings, "monthdayselect", ref temp_variable46); + Monthdayselect = temp_variable46; + bool temp_variable47 = MasterEvent; + ReadValue(_allsettings, "masterEvent", ref temp_variable47); + MasterEvent = temp_variable47; + bool temp_variable48 = Addsubmodulename; + ReadValue(_allsettings, "addsubmodulename", ref temp_variable48); + Addsubmodulename = temp_variable48; + bool temp_variable49 = Enforcesubcalperms; + ReadValue(_allsettings, "enforcesubcalperms", ref temp_variable49); + Enforcesubcalperms = temp_variable49; + bool temp_variable50 = Eventsignup; + ReadValue(_allsettings, "eventsignup", ref temp_variable50); + Eventsignup = temp_variable50; + bool temp_variable51 = Eventsignupallowpaid; + ReadValue(_allsettings, "eventsignupallowpaid", ref temp_variable51); + Eventsignupallowpaid = temp_variable51; + bool temp_variable52 = Fridayweekend; + ReadValue(_allsettings, "fridayweekend", ref temp_variable52); + Fridayweekend = temp_variable52; + bool temp_variable53 = Eventdefaultenrollview; + ReadValue(_allsettings, "eventdefaultenrollview", ref temp_variable53); + Eventdefaultenrollview = temp_variable53; + string temp_variable54 = Paypalaccount; + ReadValue(_allsettings, "paypalaccount", ref temp_variable54); + Paypalaccount = temp_variable54; + bool temp_variable55 = Moderateall; + ReadValue(_allsettings, "moderateall", ref temp_variable55); + Moderateall = temp_variable55; + string temp_variable56 = Reminderfrom; + ReadValue(_allsettings, "reminderfrom", ref temp_variable56); + Reminderfrom = temp_variable56; + string temp_variable57 = EventsListSelectType; + ReadValue(_allsettings, "EventsListSelectType", ref temp_variable57); + EventsListSelectType = temp_variable57; + int temp_variable58 = EventsListNumEvents; + ReadValue(_allsettings, "EventsListNumEvents", ref temp_variable58); + EventsListNumEvents = temp_variable58; + int temp_variable59 = EventsListEventDays; + ReadValue(_allsettings, "EventsListEventDays", ref temp_variable59); + EventsListEventDays = temp_variable59; + int temp_variable60 = EventsListPageSize; + ReadValue(_allsettings, "EventsListPageSize", ref temp_variable60); + EventsListPageSize = temp_variable60; + string temp_variable61 = EventsListSortDirection; + ReadValue(_allsettings, "EventsListSortDirection", ref temp_variable61); + EventsListSortDirection = temp_variable61; + bool temp_variable62 = RSSEnable; + ReadValue(_allsettings, "RSSEnable", ref temp_variable62); + RSSEnable = temp_variable62; + string temp_variable63 = RSSDateField; + ReadValue(_allsettings, "RSSDateField", ref temp_variable63); + RSSDateField = temp_variable63; + int temp_variable64 = RSSDays; + ReadValue(_allsettings, "RSSDays", ref temp_variable64); + RSSDays = temp_variable64; + string temp_variable65 = RSSTitle; + ReadValue(_allsettings, "RSSTitle", ref temp_variable65); + RSSTitle = temp_variable65; + string temp_variable66 = RSSDesc; + ReadValue(_allsettings, "RSSDesc", ref temp_variable66); + RSSDesc = temp_variable66; + string temp_variable67 = Expireevents; + ReadValue(_allsettings, "expireevents", ref temp_variable67); + Expireevents = temp_variable67; + bool temp_variable68 = Exportowneremail; + ReadValue(_allsettings, "exportowneremail", ref temp_variable68); + Exportowneremail = temp_variable68; + bool temp_variable69 = Exportanonowneremail; + ReadValue(_allsettings, "exportanonowneremail", ref temp_variable69); + Exportanonowneremail = temp_variable69; + bool temp_variable70 = Ownerchangeallowed; + ReadValue(_allsettings, "ownerchangeallowed", ref temp_variable70); + Ownerchangeallowed = temp_variable70; + bool temp_variable71 = MonthAllowed; + ReadValue(_allsettings, "MonthAllowed", ref temp_variable71); + MonthAllowed = temp_variable71; + bool temp_variable72 = WeekAllowed; + ReadValue(_allsettings, "WeekAllowed", ref temp_variable72); + WeekAllowed = temp_variable72; + bool temp_variable73 = ListAllowed; + ReadValue(_allsettings, "ListAllowed", ref temp_variable73); + ListAllowed = temp_variable73; + bool temp_variable74 = EventImageMonth; + ReadValue(_allsettings, "EventImageMonth", ref temp_variable74); + EventImageMonth = temp_variable74; + bool temp_variable75 = EventImageWeek; + ReadValue(_allsettings, "EventImageWeek", ref temp_variable75); + EventImageWeek = temp_variable75; + string temp_variable76 = IconBar; + ReadValue(_allsettings, "IconBar", ref temp_variable76); + IconBar = temp_variable76; + string temp_variable77 = EnrollEditFields; + ReadValue(_allsettings, "EnrollEditFields", ref temp_variable77); + EnrollEditFields = temp_variable77; + string temp_variable78 = EnrollViewFields; + ReadValue(_allsettings, "EnrollViewFields", ref temp_variable78); + EnrollViewFields = temp_variable78; + string temp_variable79 = EnrollAnonFields; + ReadValue(_allsettings, "EnrollAnonFields", ref temp_variable79); + EnrollAnonFields = temp_variable79; + bool temp_variable80 = Eventhidefullenroll; + ReadValue(_allsettings, "eventhidefullenroll", ref temp_variable80); + Eventhidefullenroll = temp_variable80; + int temp_variable81 = Maxnoenrolees; + ReadValue(_allsettings, "maxnoenrolees", ref temp_variable81); + Maxnoenrolees = temp_variable81; + int temp_variable82 = Enrolcanceldays; + ReadValue(_allsettings, "enrolcanceldays", ref temp_variable82); + Enrolcanceldays = temp_variable82; + bool temp_variable83 = DetailPageAllowed; + ReadValue(_allsettings, "DetailPageAllowed", ref temp_variable83); + DetailPageAllowed = temp_variable83; + bool temp_variable84 = EnrollmentPageAllowed; + ReadValue(_allsettings, "EnrollmentPageAllowed", ref temp_variable84); + EnrollmentPageAllowed = temp_variable84; + string temp_variable85 = EnrollmentPageDefaultUrl; + ReadValue(_allsettings, "EnrollmentPageDefaultUrl", ref temp_variable85); + EnrollmentPageDefaultUrl = temp_variable85; + bool temp_variable86 = EventsCustomField1; + ReadValue(_allsettings, "EventsCustomField1", ref temp_variable86); + EventsCustomField1 = temp_variable86; + bool temp_variable87 = EventsCustomField2; + ReadValue(_allsettings, "EventsCustomField2", ref temp_variable87); + EventsCustomField2 = temp_variable87; + bool temp_variable88 = IconMonthPrio; + ReadValue(_allsettings, "IconMonthPrio", ref temp_variable88); + IconMonthPrio = temp_variable88; + bool temp_variable89 = IconMonthRec; + ReadValue(_allsettings, "IconMonthRec", ref temp_variable89); + IconMonthRec = temp_variable89; + bool temp_variable90 = IconMonthReminder; + ReadValue(_allsettings, "IconMonthReminder", ref temp_variable90); + IconMonthReminder = temp_variable90; + bool temp_variable91 = IconMonthEnroll; + ReadValue(_allsettings, "IconMonthEnroll", ref temp_variable91); + IconMonthEnroll = temp_variable91; + bool temp_variable92 = IconWeekPrio; + ReadValue(_allsettings, "IconWeekPrio", ref temp_variable92); + IconWeekPrio = temp_variable92; + bool temp_variable93 = IconWeekRec; + ReadValue(_allsettings, "IconWeekRec", ref temp_variable93); + IconWeekRec = temp_variable93; + bool temp_variable94 = IconWeekReminder; + ReadValue(_allsettings, "IconWeekReminder", ref temp_variable94); + IconWeekReminder = temp_variable94; + bool temp_variable95 = IconWeekEnroll; + ReadValue(_allsettings, "IconWeekEnroll", ref temp_variable95); + IconWeekEnroll = temp_variable95; + bool temp_variable96 = IconListPrio; + ReadValue(_allsettings, "IconListPrio", ref temp_variable96); + IconListPrio = temp_variable96; + bool temp_variable97 = IconListRec; + ReadValue(_allsettings, "IconListRec", ref temp_variable97); + IconListRec = temp_variable97; + bool temp_variable98 = IconListReminder; + ReadValue(_allsettings, "IconListReminder", ref temp_variable98); + IconListReminder = temp_variable98; + bool temp_variable99 = IconListEnroll; + ReadValue(_allsettings, "IconListEnroll", ref temp_variable99); + IconListEnroll = temp_variable99; + string temp_variable100 = PrivateMessage; + ReadValue(_allsettings, "PrivateMessage", ref temp_variable100); + PrivateMessage = temp_variable100; + string temp_variable101 = EventTheme; + ReadValue(_allsettings, "EventTheme", ref temp_variable101); + EventTheme = temp_variable101; + string temp_variable102 = EventThemeDefault; + ReadValue(_allsettings, "EventThemeDefault", ref temp_variable102); + EventThemeDefault = temp_variable102; + string temp_variable103 = EventsListFields; + ReadValue(_allsettings, "EventsListFields", ref temp_variable103); + EventsListFields = temp_variable103; + string temp_variable104 = EventsListShowHeader; + ReadValue(_allsettings, "EventsListShowHeader", ref temp_variable104); + EventsListShowHeader = temp_variable104; + int temp_variable105 = EventsListBeforeDays; + ReadValue(_allsettings, "EventsListBeforeDays", ref temp_variable105); + EventsListBeforeDays = temp_variable105; + int temp_variable106 = EventsListAfterDays; + ReadValue(_allsettings, "EventsListAfterDays", ref temp_variable106); + EventsListAfterDays = temp_variable106; + string temp_variable107 = RecurDummy; + ReadValue(_allsettings, "RecurDummy", ref temp_variable107); + RecurDummy = temp_variable107; + //ReadValue(_allsettings, "modulecategoryid", ref ModuleCategoryID); + ReadValue(_allsettings, "modulecategoryids", ModuleCategoryIDs); + //ReadValue(_allsettings, "modulelocationid", ref ModuleLocationID); + ReadValue(_allsettings, "modulelocationids", ModuleLocationIDs); + string temp_variable108 = EventsListSortColumn; + ReadValue(_allsettings, "eventslistsortcolumn", ref temp_variable108); + EventsListSortColumn = temp_variable108; + string temp_variable109 = HTMLEmail; + ReadValue(_allsettings, "HTMLEmail", ref temp_variable109); + HTMLEmail = temp_variable109; + int temp_variable110 = IcalDaysBefore; + ReadValue(_allsettings, "iCalDaysBefore", ref temp_variable110); + IcalDaysBefore = temp_variable110; + int temp_variable111 = IcalDaysAfter; + ReadValue(_allsettings, "iCalDaysAfter", ref temp_variable111); + IcalDaysAfter = temp_variable111; + string temp_variable112 = IcalURLAppend; + ReadValue(_allsettings, "iCalURLAppend", ref temp_variable112); + IcalURLAppend = temp_variable112; + string temp_variable113 = IcalDefaultImage; + ReadValue(_allsettings, "iCalDefaultImage", ref temp_variable113); + IcalDefaultImage = temp_variable113; + bool temp_variable114 = IcalURLInLocation; + ReadValue(_allsettings, "iCalURLinLocation", ref temp_variable114); + IcalURLInLocation = temp_variable114; + bool temp_variable115 = IcalIncludeCalname; + ReadValue(_allsettings, "iCalIncludeCalname", ref temp_variable115); + IcalIncludeCalname = temp_variable115; + bool temp_variable116 = EnableSEO; + ReadValue(_allsettings, "enableSEO", ref temp_variable116); + EnableSEO = temp_variable116; + int temp_variable117 = SEODescriptionLength; + ReadValue(_allsettings, "SEODescriptionLength", ref temp_variable117); + SEODescriptionLength = temp_variable117; + bool temp_variable118 = EnableSitemap; + ReadValue(_allsettings, "enableSitemap", ref temp_variable118); + EnableSitemap = temp_variable118; + float temp_variable119 = SiteMapPriority; + ReadValue(_allsettings, "siteMapPriority", ref temp_variable119); + SiteMapPriority = temp_variable119; + int temp_variable120 = SiteMapDaysBefore; + ReadValue(_allsettings, "siteMapDaysBefore", ref temp_variable120); + SiteMapDaysBefore = temp_variable120; + int temp_variable121 = SiteMapDaysAfter; + ReadValue(_allsettings, "siteMapDaysAfter", ref temp_variable121); + SiteMapDaysAfter = temp_variable121; + bool temp_variable122 = ListViewGrid; + ReadValue(_allsettings, "ListViewGrid", ref temp_variable122); + ListViewGrid = temp_variable122; + bool temp_variable123 = ListViewTable; + ReadValue(_allsettings, "ListViewTable", ref temp_variable123); + ListViewTable = temp_variable123; + int temp_variable124 = RptColumns; + ReadValue(_allsettings, "rptColumns", ref temp_variable124); + RptColumns = temp_variable124; + int temp_variable125 = RptRows; + ReadValue(_allsettings, "rptRows", ref temp_variable125); + RptRows = temp_variable125; + System.Web.UI.WebControls.FirstDayOfWeek temp_variable126 = WeekStart; + ReadValue(_allsettings, "WeekStart", ref temp_variable126); + WeekStart = temp_variable126; + bool temp_variable127 = ListViewUseTime; + ReadValue(_allsettings, "ListViewUseTime", ref temp_variable127); + ListViewUseTime = temp_variable127; + bool temp_variable128 = IcalOnIconBar; + ReadValue(_allsettings, "iCalOnIconBar", ref temp_variable128); + IcalOnIconBar = temp_variable128; + bool temp_variable129 = IcalEmailEnable; + ReadValue(_allsettings, "iCalEmailEnable", ref temp_variable129); + IcalEmailEnable = temp_variable129; + string temp_variable130 = StandardEmail; + ReadValue(_allsettings, "StandardEmail", ref temp_variable130); + StandardEmail = temp_variable130; + string temp_variable131 = FBAdmins; + ReadValue(_allsettings, "FBAdmins", ref temp_variable131); + FBAdmins = temp_variable131; + string temp_variable132 = FBAppID; + ReadValue(_allsettings, "FBAppID", ref temp_variable132); + FBAppID = temp_variable132; + int temp_variable133 = MaxThumbWidth; + ReadValue(_allsettings, "MaxThumbWidth", ref temp_variable133); + MaxThumbWidth = temp_variable133; + int temp_variable134 = MaxThumbHeight; + ReadValue(_allsettings, "MaxThumbHeight", ref temp_variable134); + MaxThumbHeight = temp_variable134; + bool temp_variable135 = SendEnrollMessageApproved; + ReadValue(_allsettings, "SendEnrollMessageApproved", ref temp_variable135); + SendEnrollMessageApproved = temp_variable135; + bool temp_variable136 = SendEnrollMessageWaiting; + ReadValue(_allsettings, "SendEnrollMessageWaiting", ref temp_variable136); + SendEnrollMessageWaiting = temp_variable136; + bool temp_variable137 = SendEnrollMessageDenied; + ReadValue(_allsettings, "SendEnrollMessageDenied", ref temp_variable137); + SendEnrollMessageDenied = temp_variable137; + bool temp_variable138 = SendEnrollMessageAdded; + ReadValue(_allsettings, "SendEnrollMessageAdded", ref temp_variable138); + SendEnrollMessageAdded = temp_variable138; + bool temp_variable139 = SendEnrollMessageDeleted; + ReadValue(_allsettings, "SendEnrollMessageDeleted", ref temp_variable139); + SendEnrollMessageDeleted = temp_variable139; + bool temp_variable140 = SendEnrollMessagePaying; + ReadValue(_allsettings, "SendEnrollMessagePaying", ref temp_variable140); + SendEnrollMessagePaying = temp_variable140; + bool temp_variable141 = SendEnrollMessagePending; + ReadValue(_allsettings, "SendEnrollMessagePending", ref temp_variable141); + SendEnrollMessagePending = temp_variable141; + bool temp_variable142 = SendEnrollMessagePaid; + ReadValue(_allsettings, "SendEnrollMessagePaid", ref temp_variable142); + SendEnrollMessagePaid = temp_variable142; + bool temp_variable143 = SendEnrollMessageIncorrect; + ReadValue(_allsettings, "SendEnrollMessageIncorrect", ref temp_variable143); + SendEnrollMessageIncorrect = temp_variable143; + bool temp_variable144 = SendEnrollMessageCancelled; + ReadValue(_allsettings, "SendEnrollMessageCancelled", ref temp_variable144); + SendEnrollMessageCancelled = temp_variable144; + bool temp_variable145 = AllowAnonEnroll; + ReadValue(_allsettings, "allowanonenroll", ref temp_variable145); + AllowAnonEnroll = temp_variable145; + SocialModule temp_variable146 = SocialGroupModule; + ReadValue(_allsettings, "SocialGroupModule", ref temp_variable146); + SocialGroupModule = temp_variable146; + bool temp_variable147 = SocialUserPrivate; + ReadValue(_allsettings, "SocialUserPrivate", ref temp_variable147); + SocialUserPrivate = temp_variable147; + SocialGroupPrivacy temp_variable148 = SocialGroupSecurity; + ReadValue(_allsettings, "SSocialGroupSecurity", ref temp_variable148); + SocialGroupSecurity = temp_variable148; + SortDirection temp_variable149 = EnrolListSortDirection; + ReadValue(_allsettings, "EnrolListSortDirection", ref temp_variable149); + EnrolListSortDirection = temp_variable149; + int temp_variable150 = EnrolListDaysBefore; + ReadValue(_allsettings, "EnrolListDaysBefore", ref temp_variable150); + EnrolListDaysBefore = temp_variable150; + int temp_variable151 = EnrolListDaysAfter; + ReadValue(_allsettings, "EnrolListDaysAfter", ref temp_variable151); + EnrolListDaysAfter = temp_variable151; + bool temp_variable152 = JournalIntegration; + ReadValue(_allsettings, "JournalIntegration", ref temp_variable152); + JournalIntegration = temp_variable152; + Templates = new EventTemplates(_moduleID, _allsettings, _localresourcefile); + } + +#endregion + +#region Public Methods + + public EventModuleSettings GetEventModuleSettings(int moduleID, string localResourceFile) + { + _moduleID = moduleID; + if (_moduleID > 0) + { + string cacheKey = "EventsSettings" + moduleID.ToString(); + EventModuleSettings bs = default(EventModuleSettings); + bs = (EventModuleSettings) (DataCache.GetCache(cacheKey)); + if (ReferenceEquals(bs, null)) + { + bs = new EventModuleSettings(_moduleID, localResourceFile); + if (!ReferenceEquals(localResourceFile, null)) + { + DataCache.SetCache(cacheKey, bs); + } + } + return bs; + } + return null; + } + + + public void SaveSettings(int moduleId) + { + + ModuleController objModules = new ModuleController(); + DesktopModuleInfo objDesktopModule = default(DesktopModuleInfo); + objDesktopModule = DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", 0); + objModules.UpdateModuleSetting(moduleId, "version", objDesktopModule.Version); + + objModules.UpdateModuleSetting(moduleId, "timeinterval", Timeinterval.ToString()); + objModules.UpdateModuleSetting(moduleId, "TimeZoneId", TimeZoneId); + objModules.UpdateModuleSetting(moduleId, "EnableEventTimeZones", EnableEventTimeZones.ToString()); + objModules.UpdateModuleSetting(moduleId, "PrimaryTimeZone", (System.Convert.ToInt32(PrimaryTimeZone)).ToString()); + objModules.UpdateModuleSetting(moduleId, "SecondaryTimeZone", (System.Convert.ToInt32(SecondaryTimeZone)).ToString()); + objModules.UpdateModuleSetting(moduleId, "eventtooltipmonth", Eventtooltipmonth.ToString()); + objModules.UpdateModuleSetting(moduleId, "eventtooltipweek", Eventtooltipweek.ToString()); + objModules.UpdateModuleSetting(moduleId, "eventtooltipday", Eventtooltipday.ToString()); + objModules.UpdateModuleSetting(moduleId, "eventtooltiplist", Eventtooltiplist.ToString()); + objModules.UpdateModuleSetting(moduleId, "eventtooltiplength", Eventtooltiplength.ToString()); + objModules.UpdateModuleSetting(moduleId, "monthcellnoevents", Monthcellnoevents.ToString()); + objModules.UpdateModuleSetting(moduleId, "enablecategories", (System.Convert.ToInt32(Enablecategories)).ToString()); + objModules.UpdateModuleSetting(moduleId, "restrictcategories", Restrictcategories.ToString()); + objModules.UpdateModuleSetting(moduleId, "restrictcategoriestotimeframe", RestrictCategoriesToTimeFrame.ToString()); + objModules.UpdateModuleSetting(moduleId, "enablelocations", (System.Convert.ToInt32(Enablelocations)).ToString()); + objModules.UpdateModuleSetting(moduleId, "restrictlocations", Restrictlocations.ToString()); + objModules.UpdateModuleSetting(moduleId, "restrictlocationstotimeframe", RestrictLocationsToTimeFrame.ToString()); + objModules.UpdateModuleSetting(moduleId, "enablecontainerskin", Enablecontainerskin.ToString()); + objModules.UpdateModuleSetting(moduleId, "eventdetailnewpage", Eventdetailnewpage.ToString()); + objModules.UpdateModuleSetting(moduleId, "maxrecurrences", Maxrecurrences.ToString()); + objModules.UpdateModuleSetting(moduleId, "enableenrollpopup", Enableenrollpopup.ToString()); + objModules.UpdateModuleSetting(moduleId, "eventdaynewpage", Eventdaynewpage.ToString()); + objModules.UpdateModuleSetting(moduleId, "DefaultView", DefaultView.ToString()); + objModules.UpdateModuleSetting(moduleId, "Eventnotify", Eventnotify.ToString()); + objModules.UpdateModuleSetting(moduleId, "notifyanon", Notifyanon.ToString()); + objModules.UpdateModuleSetting(moduleId, "sendreminderdefault", Sendreminderdefault.ToString()); + objModules.UpdateModuleSetting(moduleId, "neweventemails", Neweventemails.ToString()); + objModules.UpdateModuleSetting(moduleId, "neweventemailrole", Neweventemailrole.ToString()); + objModules.UpdateModuleSetting(moduleId, "newpereventemail", Newpereventemail.ToString()); + objModules.UpdateModuleSetting(moduleId, "tzdisplay", Tzdisplay.ToString()); + objModules.UpdateModuleSetting(moduleId, "paypalurl", Paypalurl.ToString()); + objModules.UpdateModuleSetting(moduleId, "disableEventnav", DisableEventnav.ToString()); + objModules.UpdateModuleSetting(moduleId, "collapserecurring", Collapserecurring.ToString()); + objModules.UpdateModuleSetting(moduleId, "fulltimescale", Fulltimescale.ToString()); + objModules.UpdateModuleSetting(moduleId, "includeendvalue", Includeendvalue.ToString()); + objModules.UpdateModuleSetting(moduleId, "showvaluemarks", Showvaluemarks.ToString()); + objModules.UpdateModuleSetting(moduleId, "eventimage", Eventimage.ToString()); + objModules.UpdateModuleSetting(moduleId, "allowreoccurring", Allowreoccurring.ToString()); + objModules.UpdateModuleSetting(moduleId, "Eventsearch", Eventsearch.ToString()); + objModules.UpdateModuleSetting(moduleId, "preventconflicts", Preventconflicts.ToString()); + objModules.UpdateModuleSetting(moduleId, "locationconflict", Locationconflict.ToString()); + objModules.UpdateModuleSetting(moduleId, "showEventsAlways", ShowEventsAlways.ToString()); + objModules.UpdateModuleSetting(moduleId, "timeintitle", Timeintitle.ToString()); + objModules.UpdateModuleSetting(moduleId, "monthdayselect", Monthdayselect.ToString()); + objModules.UpdateModuleSetting(moduleId, "masterEvent", MasterEvent.ToString()); + objModules.UpdateModuleSetting(moduleId, "addsubmodulename", Addsubmodulename.ToString()); + objModules.UpdateModuleSetting(moduleId, "enforcesubcalperms", Enforcesubcalperms.ToString()); + objModules.UpdateModuleSetting(moduleId, "eventsignup", Eventsignup.ToString()); + objModules.UpdateModuleSetting(moduleId, "eventsignupallowpaid", Eventsignupallowpaid.ToString()); + objModules.UpdateModuleSetting(moduleId, "fridayweekend", Fridayweekend.ToString()); + objModules.UpdateModuleSetting(moduleId, "eventdefaultenrollview", Eventdefaultenrollview.ToString()); + objModules.UpdateModuleSetting(moduleId, "paypalaccount", Paypalaccount.ToString()); + objModules.UpdateModuleSetting(moduleId, "moderateall", Moderateall.ToString()); + objModules.UpdateModuleSetting(moduleId, "reminderfrom", Reminderfrom.ToString()); + objModules.UpdateModuleSetting(moduleId, "EventsListSelectType", EventsListSelectType.ToString()); + objModules.UpdateModuleSetting(moduleId, "EventsListNumEvents", EventsListNumEvents.ToString()); + objModules.UpdateModuleSetting(moduleId, "EventsListEventDays", EventsListEventDays.ToString()); + objModules.UpdateModuleSetting(moduleId, "EventsListPageSize", EventsListPageSize.ToString()); + objModules.UpdateModuleSetting(moduleId, "EventsListSortDirection", EventsListSortDirection.ToString()); + objModules.UpdateModuleSetting(moduleId, "RSSEnable", RSSEnable.ToString()); + objModules.UpdateModuleSetting(moduleId, "RSSDateField", RSSDateField.ToString()); + objModules.UpdateModuleSetting(moduleId, "RSSDays", RSSDays.ToString()); + objModules.UpdateModuleSetting(moduleId, "RSSTitle", RSSTitle.ToString()); + objModules.UpdateModuleSetting(moduleId, "RSSDesc", RSSDesc.ToString()); + objModules.UpdateModuleSetting(moduleId, "expireevents", Expireevents.ToString()); + objModules.UpdateModuleSetting(moduleId, "exportowneremail", Exportowneremail.ToString()); + objModules.UpdateModuleSetting(moduleId, "exportanonowneremail", Exportanonowneremail.ToString()); + objModules.UpdateModuleSetting(moduleId, "ownerchangeallowed", Ownerchangeallowed.ToString()); + objModules.UpdateModuleSetting(moduleId, "MonthAllowed", MonthAllowed.ToString()); + objModules.UpdateModuleSetting(moduleId, "WeekAllowed", WeekAllowed.ToString()); + objModules.UpdateModuleSetting(moduleId, "ListAllowed", ListAllowed.ToString()); + objModules.UpdateModuleSetting(moduleId, "EventImageMonth", EventImageMonth.ToString()); + objModules.UpdateModuleSetting(moduleId, "EventImageWeek", EventImageWeek.ToString()); + objModules.UpdateModuleSetting(moduleId, "IconBar", IconBar.ToString()); + objModules.UpdateModuleSetting(moduleId, "EnrollEditFields", EnrollEditFields.ToString()); + objModules.UpdateModuleSetting(moduleId, "EnrollViewFields", EnrollViewFields.ToString()); + objModules.UpdateModuleSetting(moduleId, "EnrollAnonFields", EnrollAnonFields.ToString()); + objModules.UpdateModuleSetting(moduleId, "eventhidefullenroll", Eventhidefullenroll.ToString()); + objModules.UpdateModuleSetting(moduleId, "maxnoenrolees", Maxnoenrolees.ToString()); + objModules.UpdateModuleSetting(moduleId, "enrolcanceldays", Enrolcanceldays.ToString()); + objModules.UpdateModuleSetting(moduleId, "DetailPageAllowed", DetailPageAllowed.ToString()); + objModules.UpdateModuleSetting(moduleId, "EnrollmentPageAllowed", EnrollmentPageAllowed.ToString()); + objModules.UpdateModuleSetting(moduleId, "EnrollmentPageDefaultUrl", EnrollmentPageDefaultUrl.ToString()); + objModules.UpdateModuleSetting(moduleId, "EventsCustomField1", EventsCustomField1.ToString()); + objModules.UpdateModuleSetting(moduleId, "EventsCustomField2", EventsCustomField2.ToString()); + objModules.UpdateModuleSetting(moduleId, "IconMonthPrio", IconMonthPrio.ToString()); + objModules.UpdateModuleSetting(moduleId, "IconMonthRec", IconMonthRec.ToString()); + objModules.UpdateModuleSetting(moduleId, "IconMonthReminder", IconMonthReminder.ToString()); + objModules.UpdateModuleSetting(moduleId, "IconMonthEnroll", IconMonthEnroll.ToString()); + objModules.UpdateModuleSetting(moduleId, "IconWeekPrio", IconWeekPrio.ToString()); + objModules.UpdateModuleSetting(moduleId, "IconWeekRec", IconWeekRec.ToString()); + objModules.UpdateModuleSetting(moduleId, "IconWeekReminder", IconWeekReminder.ToString()); + objModules.UpdateModuleSetting(moduleId, "IconWeekEnroll", IconWeekEnroll.ToString()); + objModules.UpdateModuleSetting(moduleId, "IconListPrio", IconListPrio.ToString()); + objModules.UpdateModuleSetting(moduleId, "IconListRec", IconListRec.ToString()); + objModules.UpdateModuleSetting(moduleId, "IconListReminder", IconListReminder.ToString()); + objModules.UpdateModuleSetting(moduleId, "IconListEnroll", IconListEnroll.ToString()); + objModules.UpdateModuleSetting(moduleId, "PrivateMessage", PrivateMessage.ToString()); + objModules.UpdateModuleSetting(moduleId, "EventTheme", EventTheme.ToString()); + // Hard coded value, not set anywhere + // .UpdateModuleSetting(ModuleId, "EventThemeDefault", EventThemeDefault.ToString) + objModules.UpdateModuleSetting(moduleId, "EventsListFields", EventsListFields.ToString()); + objModules.UpdateModuleSetting(moduleId, "EventsListShowHeader", EventsListShowHeader.ToString()); + objModules.UpdateModuleSetting(moduleId, "EventsListBeforeDays", EventsListBeforeDays.ToString()); + objModules.UpdateModuleSetting(moduleId, "EventsListAfterDays", EventsListAfterDays.ToString()); + if (!ReferenceEquals(RecurDummy, null)) + { + objModules.UpdateModuleSetting(moduleId, "RecurDummy", RecurDummy.ToString()); + } + objModules.UpdateModuleSetting(moduleId, "modulecategoryids", string.Join(",", (string[]) (ModuleCategoryIDs.ToArray(typeof(string))))); + objModules.UpdateModuleSetting(moduleId, "modulelocationids", string.Join(",", (string[]) (ModuleLocationIDs.ToArray(typeof(string))))); + objModules.UpdateModuleSetting(moduleId, "eventslistsortcolumn", EventsListSortColumn.ToString()); + objModules.UpdateModuleSetting(moduleId, "HTMLEmail", HTMLEmail.ToString()); + objModules.UpdateModuleSetting(moduleId, "iCalDaysBefore", IcalDaysBefore.ToString()); + objModules.UpdateModuleSetting(moduleId, "iCalDaysAfter", IcalDaysAfter.ToString()); + objModules.UpdateModuleSetting(moduleId, "iCalURLAppend", IcalURLAppend.ToString()); + objModules.UpdateModuleSetting(moduleId, "iCalDefaultImage", IcalDefaultImage.ToString()); + objModules.UpdateModuleSetting(moduleId, "iCalURLinLocation", IcalURLInLocation.ToString()); + objModules.UpdateModuleSetting(moduleId, "iCalIncludeCalname", IcalIncludeCalname.ToString()); + objModules.UpdateModuleSetting(moduleId, "enableSEO", EnableSEO.ToString()); + objModules.UpdateModuleSetting(moduleId, "SEODescriptionLength", SEODescriptionLength.ToString()); + objModules.UpdateModuleSetting(moduleId, "enableSitemap", EnableSitemap.ToString()); + objModules.UpdateModuleSetting(moduleId, "siteMapPriority", SiteMapPriority.ToString()); + objModules.UpdateModuleSetting(moduleId, "siteMapDaysBefore", SiteMapDaysBefore.ToString()); + objModules.UpdateModuleSetting(moduleId, "siteMapDaysAfter", SiteMapDaysAfter.ToString()); + objModules.UpdateModuleSetting(moduleId, "ListViewGrid", ListViewGrid.ToString()); + objModules.UpdateModuleSetting(moduleId, "ListViewTable", ListViewTable.ToString()); + objModules.UpdateModuleSetting(moduleId, "rptColumns", RptColumns.ToString()); + objModules.UpdateModuleSetting(moduleId, "rptRows", RptRows.ToString()); + objModules.UpdateModuleSetting(moduleId, "WeekStart", (System.Convert.ToInt32(WeekStart)).ToString()); + objModules.UpdateModuleSetting(moduleId, "ListViewUseTime", ListViewUseTime.ToString()); + objModules.UpdateModuleSetting(moduleId, "iCalOnIconBar", IcalOnIconBar.ToString()); + objModules.UpdateModuleSetting(moduleId, "iCalEmailEnable", IcalEmailEnable.ToString()); + objModules.UpdateModuleSetting(moduleId, "StandardEmail", StandardEmail.ToString()); + objModules.UpdateModuleSetting(moduleId, "FBAdmins", FBAdmins.ToString()); + objModules.UpdateModuleSetting(moduleId, "FBAppID", FBAppID.ToString()); + objModules.UpdateModuleSetting(moduleId, "MaxThumbHeight", MaxThumbHeight.ToString()); + objModules.UpdateModuleSetting(moduleId, "MaxThumbWidth", MaxThumbWidth.ToString()); + objModules.UpdateModuleSetting(moduleId, "SendEnrollMessageApproved", SendEnrollMessageApproved.ToString()); + objModules.UpdateModuleSetting(moduleId, "SendEnrollMessageWaiting", SendEnrollMessageWaiting.ToString()); + objModules.UpdateModuleSetting(moduleId, "SendEnrollMessageDenied", SendEnrollMessageDenied.ToString()); + objModules.UpdateModuleSetting(moduleId, "SendEnrollMessageAdded", SendEnrollMessageAdded.ToString()); + objModules.UpdateModuleSetting(moduleId, "SendEnrollMessageDeleted", SendEnrollMessageDeleted.ToString()); + objModules.UpdateModuleSetting(moduleId, "SendEnrollMessagePaying", SendEnrollMessagePaying.ToString()); + objModules.UpdateModuleSetting(moduleId, "SendEnrollMessagePending", SendEnrollMessagePending.ToString()); + objModules.UpdateModuleSetting(moduleId, "SendEnrollMessagePaid", SendEnrollMessagePaid.ToString()); + objModules.UpdateModuleSetting(moduleId, "SendEnrollMessageIncorrect", SendEnrollMessageIncorrect.ToString()); + objModules.UpdateModuleSetting(moduleId, "SendEnrollMessageCancelled", SendEnrollMessageCancelled.ToString()); + objModules.UpdateModuleSetting(moduleId, "allowanonenroll", AllowAnonEnroll.ToString()); + objModules.UpdateModuleSetting(moduleId, "SocialGroupModule", (System.Convert.ToInt32(SocialGroupModule)).ToString()); + objModules.UpdateModuleSetting(moduleId, "SocialUserPrivate", SocialUserPrivate.ToString()); + objModules.UpdateModuleSetting(moduleId, "SocialGroupSecurity", (System.Convert.ToInt32(SocialGroupSecurity)).ToString()); + objModules.UpdateModuleSetting(moduleId, "EnrolListSortDirection", (System.Convert.ToInt32(EnrolListSortDirection)).ToString()); + objModules.UpdateModuleSetting(moduleId, "EnrolListDaysBefore", (EnrolListDaysBefore).ToString()); + objModules.UpdateModuleSetting(moduleId, "EnrolListDaysAfter", (EnrolListDaysAfter).ToString()); + objModules.UpdateModuleSetting(moduleId, "JournalIntegration", JournalIntegration.ToString()); + string cacheKey = "EventsSettings" + moduleId.ToString(); + DataCache.SetCache(cacheKey, this); + + } + +#endregion + +#region Private Methods + + private static void ReadValue(Hashtable valueTable, string valueName, ref string variable) + { + if (!ReferenceEquals(valueTable[valueName], null)) + { + try + { + variable = System.Convert.ToString(valueTable[valueName]); + } + catch (Exception) + { + } + } + } + + private static void ReadValue(Hashtable valueTable, string valueName, ref int variable) + { + if (!ReferenceEquals(valueTable[valueName], null)) + { + try + { + variable = System.Convert.ToInt32(valueTable[valueName]); + } + catch (Exception) + { + } + } + } + + private static void ReadValue(Hashtable valueTable, string valueName, ref bool variable) + { + if (!ReferenceEquals(valueTable[valueName], null)) + { + try + { + variable = System.Convert.ToBoolean(valueTable[valueName]); + } + catch (Exception) + { + } + } + } + + private static void ReadValue(Hashtable valueTable, string valueName, ref System.Web.UI.WebControls.FirstDayOfWeek variable) + { + if (!ReferenceEquals(valueTable[valueName], null)) + { + try + { + variable = (System.Web.UI.WebControls.FirstDayOfWeek) (System.Convert.ToInt32(valueTable[valueName])); + } + catch (Exception) + { + } + } + } + + private static void ReadValue(Hashtable valueTable, string valueName, ref float variable) + { + if (!ReferenceEquals(valueTable[valueName], null)) + { + try + { + variable = System.Convert.ToSingle(System.Convert.ToSingle(valueTable[valueName])); + } + catch (Exception) + { + } + } + } + + private static void ReadValue(Hashtable valueTable, string valueName, ref TimeZones variable) + { + if (!ReferenceEquals(valueTable[valueName], null)) + { + try + { + variable = (TimeZones) (valueTable[valueName]); + } + catch (Exception) + { + } + } + } + + private static void ReadValue(Hashtable valueTable, string valueName, ref DisplayCategories variable) + { + if (!ReferenceEquals(valueTable[valueName], null)) + { + try + { + variable = (DisplayCategories) (valueTable[valueName]); + } + catch (Exception) + { + } + } + } + + private static void ReadValue(Hashtable valueTable, string valueName, ref DisplayLocations variable) + { + if (!ReferenceEquals(valueTable[valueName], null)) + { + try + { + variable = (DisplayLocations) (valueTable[valueName]); + } + catch (Exception) + { + } + } + } + + private static void ReadValue(Hashtable valueTable, string valueName, ref SocialModule variable) + { + if (!ReferenceEquals(valueTable[valueName], null)) + { + try + { + variable = (SocialModule) (valueTable[valueName]); + } + catch (Exception) + { + } + } + } + + private static void ReadValue(Hashtable valueTable, string valueName, ref SocialGroupPrivacy variable) + { + if (!ReferenceEquals(valueTable[valueName], null)) + { + try + { + variable = (SocialGroupPrivacy) (valueTable[valueName]); + } + catch (Exception) + { + } + } + } + + private static void ReadValue(Hashtable valueTable, string valueName, ref SortDirection variable) + { + if (!ReferenceEquals(valueTable[valueName], null)) + { + try + { + variable = (SortDirection) (valueTable[valueName]); + } + catch (Exception) + { + } + } + } + + private static void ReadValue(Hashtable valueTable, string valueName, ArrayList variable) + { + if (!ReferenceEquals(valueTable[valueName], null)) + { + try + { + string[] tmpArray = Strings.Split(System.Convert.ToString(valueTable[valueName]), ","); + variable.Clear(); + for (int i = 0; i <= tmpArray.Length - 1; i++) + { + if (tmpArray[i] != "") + { + variable.Add(int.Parse(tmpArray[i])); + } + } + } + catch (Exception) + { + } + } + } + + private void UpdateDefaults() + { + string vers = System.Convert.ToString(_allsettings["version"]); + if (!ReferenceEquals(_allsettings["onlyview"], null) && System.Convert.ToBoolean(_allsettings["onlyview"])) + { + if (System.Convert.ToString(_allsettings["DefaultView"]) == "EventList.ascx") + { + _listAllowed = true; + } + else + { + _listAllowed = false; + } + if (System.Convert.ToString(_allsettings["DefaultView"]) == "EventWeek.ascx") + { + _weekAllowed = true; + } + else + { + _weekAllowed = false; + } + if (System.Convert.ToString(_allsettings["DefaultView"]) == "EventMonth.ascx") + { + _monthAllowed = true; + } + else + { + _monthAllowed = false; + } + } + if (string.IsNullOrEmpty(vers)) + { + _enforcesubcalperms = true; + } + else + { + _enforcesubcalperms = false; + } + if (!ReferenceEquals(_allsettings["allowsubscriptions"], null) && System.Convert.ToBoolean(_allsettings["allowsubscriptions"])) + { + _neweventemails = "Subscribe"; + } + if (string.IsNullOrEmpty(vers)) + { + _enablecontainerskin = true; + } + else if (int.Parse(vers.Substring(0, vers.IndexOf(".") + 0)) < 5) + { + _enablecontainerskin = false; + } + else + { + _enablecontainerskin = true; + } + if (!ReferenceEquals(_allsettings["eventtooltip"], null)) + { + _eventtooltipmonth = System.Convert.ToBoolean(_allsettings["eventtooltip"]); + _eventtooltipweek = System.Convert.ToBoolean(_allsettings["eventtooltip"]); + _eventtooltipday = System.Convert.ToBoolean(_allsettings["eventtooltip"]); + _eventtooltiplist = System.Convert.ToBoolean(_allsettings["eventtooltip"]); + } + if (!ReferenceEquals(_allsettings["SocialGroupModule"], null)) + { + if ((SocialModule)this._allsettings["SocialGroupModule"] == SocialModule.UserProfile) + { + _socialUserPrivate = false; + } + if ((SocialModule)this._allsettings["SocialGroupModule"] == SocialModule.SocialGroup) + { + _socialGroupSecurity = SocialGroupPrivacy.OpenToAll; + } + } + } + +#endregion + +#region Properties + public int MaxThumbWidth + { + get + { + return _maxThumbWidth; + } + set + { + _maxThumbWidth = value; + } + } + + public int MaxThumbHeight + { + get + { + return _maxThumbHeight; + } + set + { + _maxThumbHeight = value; + } + } + + public string FBAppID + { + get + { + return _fbAppID; + } + set + { + _fbAppID = value; + } + } + + public string FBAdmins + { + get + { + return _fbAdmins; + } + set + { + _fbAdmins = value; + } + } + + public string StandardEmail + { + get + { + if (ReferenceEquals(_standardEmail, null)) + { + Entities.Portals.PortalSettings portalsettings = Entities.Portals.PortalController.GetCurrentPortalSettings(); + if (!ReferenceEquals(portalsettings, null)) + { + _standardEmail = portalsettings.Email; + } + } + return _standardEmail; + } + set + { + _standardEmail = value; + } + } + + public bool IcalIncludeCalname + { + get + { + return _iIcalIncludeCalname; + } + set + { + _iIcalIncludeCalname = value; + } + } + + public bool IcalEmailEnable + { + get + { + return _icalEmailEnable; + } + set + { + _icalEmailEnable = value; + } + } + + public bool IcalURLInLocation + { + get + { + return _iIcalURLInLocation; + } + set + { + _iIcalURLInLocation = value; + } + } + + public bool IcalOnIconBar + { + get + { + return _icalOnIconBar; + } + set + { + _icalOnIconBar = value; + } + } + + public bool ListViewUseTime + { + get + { + return _listViewUseTime; + } + set + { + _listViewUseTime = value; + } + } + + public System.Web.UI.WebControls.FirstDayOfWeek WeekStart + { + get + { + return _weekStart; + } + set + { + _weekStart = value; + } + } + + public int RptRows + { + get + { + return _rptRows; + } + set + { + _rptRows = value; + } + } + + public int RptColumns + { + get + { + return _rptColumns; + } + set + { + _rptColumns = value; + } + } + + public bool ListViewTable + { + get + { + return _listViewTable; + } + set + { + _listViewTable = value; + } + } + + public bool ListViewGrid + { + get + { + return _listViewGrid; + } + set + { + _listViewGrid = value; + } + } + + public int SiteMapDaysAfter + { + get + { + return _siteMapDaysAfter; + } + set + { + _siteMapDaysAfter = value; + } + } + + public int SiteMapDaysBefore + { + get + { + return _siteMapDaysBefore; + } + set + { + _siteMapDaysBefore = value; + } + } + + public float SiteMapPriority + { + get + { + return _siteMapPriority; + } + set + { + _siteMapPriority = value; + } + } + + public bool EnableSitemap + { + get + { + return _enableSitemap; + } + set + { + _enableSitemap = value; + } + } + + public int SEODescriptionLength + { + get + { + return _seoDescriptionLength; + } + set + { + _seoDescriptionLength = value; + } + } + + public bool EnableSEO + { + get + { + return _enableSEO; + } + set + { + _enableSEO = value; + } + } + + public string IcalDefaultImage + { + get + { + return _icalDefaultImage; + } + set + { + _icalDefaultImage = value; + } + } + + public string IcalURLAppend + { + get + { + return _icalURLAppend; + } + set + { + _icalURLAppend = value; + } + } + + public int IcalDaysAfter + { + get + { + return _iCalDaysAfter; + } + set + { + _iCalDaysAfter = value; + } + } + + public int IcalDaysBefore + { + get + { + return _iCalDaysBefore; + } + set + { + _iCalDaysBefore = value; + } + } + + public string HTMLEmail + { + get + { + return _htmlEmail; + } + set + { + _htmlEmail = value; + } + } + + public string EventsListSortColumn + { + get + { + return _eventsListSortColumn; + } + set + { + _eventsListSortColumn = value; + } + } + + public ArrayList ModuleCategoryIDs + { + get + { + if (ReferenceEquals(_moduleCategoryIDs, null)) + { + ArrayList arCat = new ArrayList(); + arCat.Add(ModuleCategoryID); + _moduleCategoryIDs = arCat; + } + return _moduleCategoryIDs; + } + set + { + _moduleCategoryIDs = value; + } + } + + public CategoriesSelected ModuleCategoriesSelected + { + get + { + if (ModuleCategoryIDs.Count == 0) + { + _moduleCategoriesSelected = CategoriesSelected.None; + } + else if (System.Convert.ToInt32(ModuleCategoryIDs[0]) == -1) + { + _moduleCategoriesSelected = CategoriesSelected.All; + } + else + { + _moduleCategoriesSelected = CategoriesSelected.Some; + } + return _moduleCategoriesSelected; + } + set + { + _moduleCategoriesSelected = value; + } + } + + public ArrayList ModuleLocationIDs + { + get + { + if (ReferenceEquals(_moduleLocationIDs, null)) + { + ArrayList arLoc = new ArrayList(); + arLoc.Add(ModuleLocationID); + _moduleLocationIDs = arLoc; + } + return _moduleLocationIDs; + } + set + { + _moduleLocationIDs = value; + } + } + + public LocationsSelected ModuleLocationsSelected + { + get + { + if (ModuleLocationIDs.Count == 0) + { + _moduleLocationsSelected = LocationsSelected.None; + } + else if (System.Convert.ToInt32(ModuleLocationIDs[0]) == -1) + { + _moduleLocationsSelected = LocationsSelected.All; + } + else + { + _moduleLocationsSelected = LocationsSelected.Some; + } + return _moduleLocationsSelected; + } + set + { + _moduleLocationsSelected = value; + } + } + + public string RecurDummy + { + get + { + return _recurDummy; + } + set + { + _recurDummy = value; + } + } + + public int EventsListAfterDays + { + get + { + return _eventsListAfterDays; + } + set + { + _eventsListAfterDays = value; + } + } + + public int EventsListBeforeDays + { + get + { + return _eventsListBeforeDays; + } + set + { + _eventsListBeforeDays = value; + } + } + + public string EventsListShowHeader + { + get + { + return _eventsListShowHeader; + } + set + { + _eventsListShowHeader = value; + } + } + + public string EventsListFields + { + get + { + return _eventsListFields; + } + set + { + _eventsListFields = value; + } + } + + public string EventThemeDefault + { + get + { + return _eventThemeDefault; + } + set + { + _eventThemeDefault = value; + } + } + + public string EventTheme + { + get + { + if (string.IsNullOrEmpty(_eventTheme)) + { + _eventTheme = _eventThemeDefault; + } + return _eventTheme; + } + set + { + _eventTheme = value; + } + } + + public string PrivateMessage + { + get + { + return _privateMessage; + } + set + { + _privateMessage = value; + } + } + + public bool IconListEnroll + { + get + { + return _iconListEnroll; + } + set + { + _iconListEnroll = value; + } + } + + public bool IconListReminder + { + get + { + return _iconListReminder; + } + set + { + _iconListReminder = value; + } + } + + public bool IconListRec + { + get + { + return _iconListRec; + } + set + { + _iconListRec = value; + } + } + + public bool IconListPrio + { + get + { + return _iconListPrio; + } + set + { + _iconListPrio = value; + } + } + + public bool IconWeekEnroll + { + get + { + return _iconWeekEnroll; + } + set + { + _iconWeekEnroll = value; + } + } + + public bool IconWeekReminder + { + get + { + return _iconWeekReminder; + } + set + { + _iconWeekReminder = value; + } + } + + public bool IconWeekRec + { + get + { + return _iconWeekRec; + } + set + { + _iconWeekRec = value; + } + } + + public bool IconWeekPrio + { + get + { + return _iconWeekPrio; + } + set + { + _iconWeekPrio = value; + } + } + + public bool IconMonthEnroll + { + get + { + return _iconMonthEnroll; + } + set + { + _iconMonthEnroll = value; + } + } + + public bool IconMonthReminder + { + get + { + return _iconMonthReminder; + } + set + { + _iconMonthReminder = value; + } + } + + public bool IconMonthRec + { + get + { + return _iconMonthRec; + } + set + { + _iconMonthRec = value; + } + } + + public bool IconMonthPrio + { + get + { + return _iconMonthPrio; + } + set + { + _iconMonthPrio = value; + } + } + + public bool EventsCustomField2 + { + get + { + return _eventsCustomField2; + } + set + { + _eventsCustomField2 = value; + } + } + + public bool EventsCustomField1 + { + get + { + return _eventsCustomField1; + } + set + { + _eventsCustomField1 = value; + } + } + + public bool DetailPageAllowed + { + get + { + return _detailPageAllowed; + } + set + { + _detailPageAllowed = value; + } + } + + public bool EnrollmentPageAllowed + { + get + { + return _enrollmentPageAllowed; + } + set + { + _enrollmentPageAllowed = value; + } + } + + public string EnrollmentPageDefaultUrl + { + get + { + return _enrollmentPageDefaultUrl; + } + set + { + _enrollmentPageDefaultUrl = value; + } + } + + public int Enrolcanceldays + { + get + { + return _enrolcanceldays; + } + set + { + _enrolcanceldays = value; + } + } + + public int Maxnoenrolees + { + get + { + return _maxnoenrolees; + } + set + { + _maxnoenrolees = value; + } + } + + public bool Eventhidefullenroll + { + get + { + return _eventhidefullenroll; + } + set + { + _eventhidefullenroll = value; + } + } + + public string EnrollAnonFields + { + get + { + return _enrollAnonFields; + } + set + { + _enrollAnonFields = value; + } + } + + public string EnrollViewFields + { + get + { + return _enrollViewFields; + } + set + { + _enrollViewFields = value; + } + } + + public string EnrollEditFields + { + get + { + return _enrollEditFields; + } + set + { + _enrollEditFields = value; + } + } + + public string IconBar + { + get + { + return _iconBar; + } + set + { + _iconBar = value; + } + } + + public bool EventImageWeek + { + get + { + return _eventImageWeek; + } + set + { + _eventImageWeek = value; + } + } + + public bool EventImageMonth + { + get + { + return _eventImageMonth; + } + set + { + _eventImageMonth = value; + } + } + + public bool ListAllowed + { + get + { + return _listAllowed; + } + set + { + _listAllowed = value; + } + } + + public bool WeekAllowed + { + get + { + return _weekAllowed; + } + set + { + _weekAllowed = value; + } + } + + public bool MonthAllowed + { + get + { + return _monthAllowed; + } + set + { + _monthAllowed = value; + } + } + + public bool Exportanonowneremail + { + get + { + return _exportanonowneremail; + } + set + { + _exportanonowneremail = value; + } + } + + public bool Exportowneremail + { + get + { + return _exportowneremail; + } + set + { + _exportowneremail = value; + } + } + + public string Expireevents + { + get + { + return _expireevents; + } + set + { + _expireevents = value; + } + } + + public string RSSDesc + { + get + { + if (string.IsNullOrEmpty(_rssDesc)&& !ReferenceEquals(_localresourcefile, null)) + { + _rssDesc = Localization.GetString("RSSFeedDescDefault", _localresourcefile); + } + return _rssDesc; + } + set + { + _rssDesc = value; + } + } + + public string RSSTitle + { + get + { + if (string.IsNullOrEmpty(_rssTitle)&& !ReferenceEquals(_localresourcefile, null)) + { + _rssTitle = Localization.GetString("RSSFeedTitleDefault", _localresourcefile); + } + return _rssTitle; + } + set + { + _rssTitle = value; + } + } + + public int RSSDays + { + get + { + return _rssDays; + } + set + { + _rssDays = value; + } + } + + public string RSSDateField + { + get + { + return _rssDateField; + } + set + { + _rssDateField = value; + } + } + + public bool RSSEnable + { + get + { + return _rssEnable; + } + set + { + _rssEnable = value; + } + } + + public string EventsListSortDirection + { + get + { + return _eventsListSortDirection; + } + set + { + _eventsListSortDirection = value; + } + } + + public int EventsListPageSize + { + get + { + return _eventsListPageSize; + } + set + { + _eventsListPageSize = value; + } + } + + public int EventsListEventDays + { + get + { + return _eventsListEventDays; + } + set + { + _eventsListEventDays = value; + } + } + + public int EventsListNumEvents + { + get + { + return _eventsListNumEvents; + } + set + { + _eventsListNumEvents = value; + } + } + + public string EventsListSelectType + { + get + { + return _eventsListSelectType; + } + set + { + _eventsListSelectType = value; + } + } + + public string Reminderfrom + { + get + { + if (ReferenceEquals(_reminderfrom, null)) + { + Entities.Portals.PortalSettings portalsettings = Entities.Portals.PortalController.GetCurrentPortalSettings(); + if (!ReferenceEquals(portalsettings, null)) + { + _reminderfrom = portalsettings.Email; + } + } + return _reminderfrom; + } + set + { + _reminderfrom = value; + } + } + + public bool Moderateall + { + get + { + return _moderateall; + } + set + { + _moderateall = value; + } + } + + public string Paypalaccount + { + get + { + if (ReferenceEquals(_paypalaccount, null)) + { + Entities.Portals.PortalSettings portalsettings = Entities.Portals.PortalController.GetCurrentPortalSettings(); + if (!ReferenceEquals(portalsettings, null)) + { + _paypalaccount = portalsettings.Email; + } + } + return _paypalaccount; + } + set + { + _paypalaccount = value; + } + } + + public bool Eventdefaultenrollview + { + get + { + return _eventdefaultenrollview; + } + set + { + _eventdefaultenrollview = value; + } + } + + public bool Fridayweekend + { + get + { + return _fridayweekend; + } + set + { + _fridayweekend = value; + } + } + + public bool Enforcesubcalperms + { + get + { + return _enforcesubcalperms; + } + set + { + _enforcesubcalperms = value; + } + } + + public bool Addsubmodulename + { + get + { + return _addsubmodulename; + } + set + { + _addsubmodulename = value; + } + } + + public bool MasterEvent + { + get + { + return _masterEvent; + } + set + { + _masterEvent = value; + } + } + + public bool Monthdayselect + { + get + { + return _monthdayselect; + } + set + { + _monthdayselect = value; + } + } + + public bool Timeintitle + { + get + { + return _timeintitle; + } + set + { + _timeintitle = value; + } + } + + public bool ShowEventsAlways + { + get + { + return _showEventsAlways; + } + set + { + _showEventsAlways = value; + } + } + + public bool Locationconflict + { + get + { + return _locationconflict; + } + set + { + _locationconflict = value; + } + } + + public bool Preventconflicts + { + get + { + return _preventconflicts; + } + set + { + _preventconflicts = value; + } + } + + public bool Eventsearch + { + get + { + return _eventsearch; + } + set + { + _eventsearch = value; + } + } + + public bool Allowreoccurring + { + get + { + return _allowreoccurring; + } + set + { + _allowreoccurring = value; + } + } + + public bool Eventimage + { + get + { + return _eventimage; + } + set + { + _eventimage = value; + } + } + + public bool Showvaluemarks + { + get + { + return _showvaluemarks; + } + set + { + _showvaluemarks = value; + } + } + + public bool Includeendvalue + { + get + { + return _includeendvalue; + } + set + { + _includeendvalue = value; + } + } + + public bool Fulltimescale + { + get + { + return _fulltimescale; + } + set + { + _fulltimescale = value; + } + } + + public bool Collapserecurring + { + get + { + return _collapserecurring; + } + set + { + _collapserecurring = value; + } + } + + public bool DisableEventnav + { + get + { + return _disableEventnav; + } + set + { + _disableEventnav = value; + } + } + + public string Paypalurl + { + get + { + return _paypalurl; + } + set + { + _paypalurl = value; + } + } + + public bool Tzdisplay + { + get + { + return _tzdisplay; + } + set + { + _tzdisplay = value; + } + } + + public bool Newpereventemail + { + get + { + return _newpereventemail; + } + set + { + _newpereventemail = value; + } + } + + public int Neweventemailrole + { + get + { + if (_neweventemailrole < 0) + { + Entities.Portals.PortalSettings portalsettings = Entities.Portals.PortalController.GetCurrentPortalSettings(); + if (!ReferenceEquals(portalsettings, null)) + { + _neweventemailrole = portalsettings.RegisteredRoleId; + } + } + return _neweventemailrole; + } + set + { + _neweventemailrole = value; + } + } + + public string Neweventemails + { + get + { + return _neweventemails; + } + set + { + _neweventemails = value; + } + } + + public bool Sendreminderdefault + { + get + { + return _sendreminderdefault; + } + set + { + _sendreminderdefault = value; + } + } + + public bool Notifyanon + { + get + { + return _notifyanon; + } + set + { + _notifyanon = value; + } + } + + public bool Eventnotify + { + get + { + return _eventnotify; + } + set + { + _eventnotify = value; + } + } + + public string DefaultView + { + get + { + return _defaultView; + } + set + { + _defaultView = value; + } + } + + public bool Eventdaynewpage + { + get + { + return _eventdaynewpage; + } + set + { + _eventdaynewpage = value; + } + } + + public bool Enableenrollpopup + { + get + { + return _enableenrollpopup; + } + set + { + _enableenrollpopup = value; + } + } + + public string Maxrecurrences + { + get + { + return _maxrecurrences; + } + set + { + _maxrecurrences = value; + } + } + + public string Version + { + get + { + return _version; + } + set + { + _version = value; + } + } + + public string Timeinterval + { + get + { + return _timeinterval; + } + set + { + _timeinterval = value; + } + } + + private string TimeZone + { + get + { + return _timeZone; + } + set + { + _timeZone = value; + } + } + + public string TimeZoneId + { + get + { + if (ReferenceEquals(_timeZoneId, null)) + { + if (ReferenceEquals(_timeZone, null)) + { + Entities.Portals.PortalSettings portalsettings = Entities.Portals.PortalController.GetCurrentPortalSettings(); + if (!ReferenceEquals(portalsettings, null)) + { + _timeZoneId = portalsettings.TimeZone.Id; + } + } + else + { + _timeZoneId = Localization.ConvertLegacyTimeZoneOffsetToTimeZoneInfo(int.Parse(_timeZone)).Id; + } + } + return _timeZoneId; + } + set + { + _timeZoneId = value; + } + } + + public bool EnableEventTimeZones + { + get + { + return _enableEventTimeZones; + } + set + { + _enableEventTimeZones = value; + } + } + + public TimeZones PrimaryTimeZone + { + get + { + return _primaryTimeZone; + } + set + { + _primaryTimeZone = value; + } + } + + public TimeZones SecondaryTimeZone + { + get + { + return _secondaryTimeZone; + } + set + { + _secondaryTimeZone = value; + } + } + + public bool Eventtooltiplist + { + get + { + return _eventtooltiplist; + } + set + { + _eventtooltiplist = value; + } + } + + public bool Eventtooltipday + { + get + { + return _eventtooltipday; + } + set + { + _eventtooltipday = value; + } + } + + public bool Eventtooltipweek + { + get + { + return _eventtooltipweek; + } + set + { + _eventtooltipweek = value; + } + } + + public bool Eventtooltipmonth + { + get + { + return _eventtooltipmonth; + } + set + { + _eventtooltipmonth = value; + } + } + + public int Eventtooltiplength + { + get + { + return _eventtooltiplength; + } + set + { + _eventtooltiplength = value; + } + } + + public bool Monthcellnoevents + { + get + { + return _monthcellnoevents; + } + set + { + _monthcellnoevents = value; + } + } + + public bool Restrictcategories + { + get + { + return _restrictcategories; + } + set + { + _restrictcategories = value; + } + } + + public bool RestrictCategoriesToTimeFrame + { + get + { + return _restrictcategoriestotimeframe; + } + set + { + _restrictcategoriestotimeframe = value; + } + } + + public DisplayCategories Enablecategories + { + get + { + if ((int) _enablecategories == 0) + { + if (_disablecategories) + { + return DisplayCategories.DoNotDisplay; + } + else + { + return DisplayCategories.MultiSelect; + } + } + else + { + return _enablecategories; + } + } + set + { + _enablecategories = value; + } + } + + public bool Restrictlocations + { + get + { + return _restrictlocations; + } + set + { + _restrictlocations = value; + } + } + + public bool RestrictLocationsToTimeFrame + { + get + { + return _restrictlocationstotimeframe; + } + set + { + _restrictlocationstotimeframe = value; + } + } + + public DisplayLocations Enablelocations + { + get + { + if ((int) _enablelocations == 0) + { + if (_disablelocations) + { + return DisplayLocations.DoNotDisplay; + } + else + { + return DisplayLocations.MultiSelect; + } + } + else + { + return _enablelocations; + } + } + set + { + _enablelocations = value; + } + } + + public bool Enablecontainerskin + { + get + { + return _enablecontainerskin; + } + set + { + _enablecontainerskin = value; + } + } + + public bool Eventdetailnewpage + { + get + { + return _eventdetailnewpage; + } + set + { + _eventdetailnewpage = value; + } + } + + public bool Ownerchangeallowed + { + get + { + return _ownerchangeallowed; + } + set + { + _ownerchangeallowed = value; + } + } + + public bool Eventsignupallowpaid + { + get + { + return _eventsignupallowpaid; + } + set + { + _eventsignupallowpaid = value; + } + } + + public bool Eventsignup + { + get + { + return _eventsignup; + } + set + { + _eventsignup = value; + } + } + + public bool SendEnrollMessageApproved + { + get + { + return _sendEnrollMessageApproved; + } + set + { + _sendEnrollMessageApproved = value; + } + } + + public bool SendEnrollMessageWaiting + { + get + { + return _sendEnrollMessageWaiting; + } + set + { + _sendEnrollMessageWaiting = value; + } + } + + public bool SendEnrollMessageDenied + { + get + { + return _sendEnrollMessageDenied; + } + set + { + _sendEnrollMessageDenied = value; + } + } + + public bool SendEnrollMessageAdded + { + get + { + return _sendEnrollMessageAdded; + } + set + { + _sendEnrollMessageAdded = value; + } + } + + public bool SendEnrollMessageDeleted + { + get + { + return _sendEnrollMessageDeleted; + } + set + { + _sendEnrollMessageDeleted = value; + } + } + + public bool SendEnrollMessagePaying + { + get + { + return _sendEnrollMessagePaying; + } + set + { + _sendEnrollMessagePaying = value; + } + } + + public bool SendEnrollMessagePending + { + get + { + return _sendEnrollMessagePending; + } + set + { + _sendEnrollMessagePending = value; + } + } + + public bool SendEnrollMessagePaid + { + get + { + return _sendEnrollMessagePaid; + } + set + { + _sendEnrollMessagePaid = value; + } + } + + public bool SendEnrollMessageIncorrect + { + get + { + return _sendEnrollMessageIncorrect; + } + set + { + _sendEnrollMessageIncorrect = value; + } + } + + public bool SendEnrollMessageCancelled + { + get + { + return _sendEnrollMessageCancelled; + } + set + { + _sendEnrollMessageCancelled = value; + } + } + + public bool AllowAnonEnroll + { + get + { + return _allowanonenroll; + } + set + { + _allowanonenroll = value; + } + } + + public SocialModule SocialGroupModule + { + get + { + return _socialGroupModule; + } + set + { + _socialGroupModule = value; + } + } + + public bool SocialUserPrivate + { + get + { + return _socialUserPrivate; + } + set + { + _socialUserPrivate = value; + } + } + + public SocialGroupPrivacy SocialGroupSecurity + { + get + { + return _socialGroupSecurity; + } + set + { + _socialGroupSecurity = value; + } + } + + public SortDirection EnrolListSortDirection + { + get + { + return _enrolListSortDirection; + } + set + { + _enrolListSortDirection = value; + } + } + + public int EnrolListDaysBefore + { + get + { + return _enrolListDaysBefore; + } + set + { + _enrolListDaysBefore = value; + } + } + + public int EnrolListDaysAfter + { + get + { + return _enrolListDaysAfter; + } + set + { + _enrolListDaysAfter = value; + } + } + + public bool JournalIntegration + { + get + { + return _journalIntegration; + } + set + { + _journalIntegration = value; + } + } + + public EventTemplates Templates + { + get + { + return _templates; + } + set + { + _templates = value; + } + } + +#endregion + + } + +#endregion + +#region EventTemplates + + [Serializable()] + public class EventTemplates + { + +#region Private Members + // ReSharper disable InconsistentNaming + private string _EventDetailsTemplate = null; + private string _NewEventTemplate = null; + private string _txtToolTipTemplateTitleNT = null; + private string _txtToolTipTemplateBodyNT = null; + private string _txtToolTipTemplateTitle = null; + private string _txtToolTipTemplateBody = null; + private string _moderateemailsubject = null; + private string _moderateemailmessage = null; + private string _txtEmailSubject = null; + private string _txtEmailMessage = null; + private string _txtEnrollMessageSubject = null; + private string _txtEnrollMessageApproved = null; + private string _txtEnrollMessageWaiting = null; + private string _txtEnrollMessageDenied = null; + private string _txtEnrollMessageAdded = null; + private string _txtEnrollMessageDeleted = null; + private string _txtEnrollMessagePaying = null; + private string _txtEnrollMessagePending = null; + private string _txtEnrollMessagePaid = null; + private string _txtEnrollMessageIncorrect = null; + private string _txtEnrollMessageCancelled = null; + private string _txtEditViewEmailSubject = null; + private string _txtEditViewEmailBody = null; + private string _txtSubject = null; + private string _txtMessage = null; + private string _txtNewEventEmailSubject = null; + private string _txtNewEventEmailMessage = null; + private string _txtListEventTimeBegin = null; + private string _txtListEventTimeEnd = null; + private string _txtListLocation = null; + private string _txtListEventDescription = null; + private string _txtListRptHeader = null; + private string _txtListRptBody = null; + private string _txtListRptFooter = null; + private string _txtDayEventTimeBegin = null; + private string _txtDayEventTimeEnd = null; + private string _txtDayLocation = null; + private string _txtDayEventDescription = null; + private string _txtWeekEventText = null; + private string _txtWeekTitleDate = null; + private string _txtMonthEventText = null; + private string _txtMonthDayEventCount = null; + private string _txtRSSTitle = null; + private string _txtRSSDescription = null; + private string _txtSEOPageTitle = null; + private string _txtSEOPageDescription = null; + private string _EventiCalSubject = null; + private string _EventiCalBody = null; + // ReSharper restore InconsistentNaming + +#endregion + +#region Constructors + + public EventTemplates(int moduleID, Hashtable allsettings, string localResourceFile) + { + + Type t = this.GetType(); + System.Reflection.PropertyInfo p = default(System.Reflection.PropertyInfo); + foreach (System.Reflection.PropertyInfo tempLoopVar_p in t.GetProperties()) + { + p = tempLoopVar_p; + string pn = p.Name; + string pv = null; + if (!ReferenceEquals(allsettings[pn], null)) + { + pv = System.Convert.ToString(allsettings[pn]); + if (pv.Length > 1900) + { + if (!ReferenceEquals(allsettings[pn + "2"], null)) + { + pv = System.Convert.ToString(pv + System.Convert.ToString(allsettings[pn + "2"])); + } + } + } + else + { + if (!ReferenceEquals(localResourceFile, null)) + { + pv = Localization.GetString(pn, localResourceFile); + if (moduleID > 0) + { + SaveTemplate(moduleID, pn, pv); + } + } + } + p.SetValue(this, pv, null); + } + + } + +#endregion + +#region Public Methods + public string GetTemplate(string templateName) + { + Type t = this.GetType(); + System.Reflection.PropertyInfo p = default(System.Reflection.PropertyInfo); + foreach (System.Reflection.PropertyInfo tempLoopVar_p in t.GetProperties()) + { + p = tempLoopVar_p; + if (p.Name == templateName) + { + return p.GetValue(this, null).ToString(); + } + } + return ""; + } + + public void SaveTemplate(int moduleID, string templateName, string templateValue) + { + Type t = this.GetType(); + System.Reflection.PropertyInfo p = default(System.Reflection.PropertyInfo); + foreach (System.Reflection.PropertyInfo tempLoopVar_p in t.GetProperties()) + { + p = tempLoopVar_p; + if (p.Name == templateName) + { + p.SetValue(this, templateValue, null); + ModuleController objModules = new ModuleController(); + + if (templateValue.Length > 2000) + { + objModules.UpdateModuleSetting(moduleID, templateName, templateValue.Substring(0, 2000)); + objModules.UpdateModuleSetting(moduleID, templateName + "2", templateValue.Substring(2000)); + } + else + { + objModules.UpdateModuleSetting(moduleID, templateName, templateValue.Trim()); + objModules.DeleteModuleSetting(moduleID, templateName + "2"); + } + } + } + string cacheKey = "EventsSettings" + moduleID.ToString(); + DataCache.ClearCache(cacheKey); + } + + public void ResetTemplate(int moduleID, string templateName, string localResourceFile) + { + string templateValue = Localization.GetString(templateName, localResourceFile); + SaveTemplate(moduleID, templateName, templateValue); + + } + +#endregion + +#region Private Methods + +#endregion + +#region Properties + // ReSharper disable InconsistentNaming + public string EventDetailsTemplate + { + get + { + return _EventDetailsTemplate; + } + set + { + _EventDetailsTemplate = value; + } + } + + public string NewEventTemplate + { + get + { + return _NewEventTemplate; + } + set + { + _NewEventTemplate = value; + } + } + + public string txtTooltipTemplateTitleNT + { + get + { + return _txtToolTipTemplateTitleNT; + } + set + { + _txtToolTipTemplateTitleNT = value; + } + } + + public string txtTooltipTemplateBodyNT + { + get + { + return _txtToolTipTemplateBodyNT; + } + set + { + _txtToolTipTemplateBodyNT = value; + } + } + + public string txtTooltipTemplateTitle + { + get + { + return _txtToolTipTemplateTitle; + } + set + { + _txtToolTipTemplateTitle = value; + } + } + + public string txtTooltipTemplateBody + { + get + { + return _txtToolTipTemplateBody; + } + set + { + _txtToolTipTemplateBody = value; + } + } + + public string moderateemailsubject + { + get + { + return _moderateemailsubject; + } + set + { + _moderateemailsubject = value; + } + } + + public string moderateemailmessage + { + get + { + return _moderateemailmessage; + } + set + { + _moderateemailmessage = value; + } + } + + public string txtEmailSubject + { + get + { + return _txtEmailSubject; + } + set + { + _txtEmailSubject = value; + } + } + + public string txtEmailMessage + { + get + { + return _txtEmailMessage; + } + set + { + _txtEmailMessage = value; + } + } + + public string txtEnrollMessageSubject + { + get + { + return _txtEnrollMessageSubject; + } + set + { + _txtEnrollMessageSubject = value; + } + } + + public string txtEnrollMessageApproved + { + get + { + return _txtEnrollMessageApproved; + } + set + { + _txtEnrollMessageApproved = value; + } + } + + public string txtEnrollMessageWaiting + { + get + { + return _txtEnrollMessageWaiting; + } + set + { + _txtEnrollMessageWaiting = value; + } + } + + public string txtEnrollMessageDenied + { + get + { + return _txtEnrollMessageDenied; + } + set + { + _txtEnrollMessageDenied = value; + } + } + + public string txtEnrollMessageAdded + { + get + { + return _txtEnrollMessageAdded; + } + set + { + _txtEnrollMessageAdded = value; + } + } + + public string txtEnrollMessageDeleted + { + get + { + return _txtEnrollMessageDeleted; + } + set + { + _txtEnrollMessageDeleted = value; + } + } + + public string txtEnrollMessagePaying + { + get + { + return _txtEnrollMessagePaying; + } + set + { + _txtEnrollMessagePaying = value; + } + } + + public string txtEnrollMessagePending + { + get + { + return _txtEnrollMessagePending; + } + set + { + _txtEnrollMessagePending = value; + } + } + + public string txtEnrollMessagePaid + { + get + { + return _txtEnrollMessagePaid; + } + set + { + _txtEnrollMessagePaid = value; + } + } + + public string txtEnrollMessageIncorrect + { + get + { + return _txtEnrollMessageIncorrect; + } + set + { + _txtEnrollMessageIncorrect = value; + } + } + + public string txtEnrollMessageCancelled + { + get + { + return _txtEnrollMessageCancelled; + } + set + { + _txtEnrollMessageCancelled = value; + } + } + + public string txtEditViewEmailSubject + { + get + { + return _txtEditViewEmailSubject; + } + set + { + _txtEditViewEmailSubject = value; + } + } + + public string txtEditViewEmailBody + { + get + { + return _txtEditViewEmailBody; + } + set + { + _txtEditViewEmailBody = value; + } + } + + public string txtSubject + { + get + { + return _txtSubject; + } + set + { + _txtSubject = value; + } + } + + public string txtMessage + { + get + { + return _txtMessage; + } + set + { + _txtMessage = value; + } + } + + public string txtNewEventEmailSubject + { + get + { + return _txtNewEventEmailSubject; + } + set + { + _txtNewEventEmailSubject = value; + } + } + + public string txtNewEventEmailMessage + { + get + { + return _txtNewEventEmailMessage; + } + set + { + _txtNewEventEmailMessage = value; + } + } + + public string txtListEventTimeBegin + { + get + { + return _txtListEventTimeBegin; + } + set + { + _txtListEventTimeBegin = value; + } + } + + public string txtListEventTimeEnd + { + get + { + return _txtListEventTimeEnd; + } + set + { + _txtListEventTimeEnd = value; + } + } + + public string txtListLocation + { + get + { + return _txtListLocation; + } + set + { + _txtListLocation = value; + } + } + + public string txtListEventDescription + { + get + { + return _txtListEventDescription; + } + set + { + _txtListEventDescription = value; + } + } + + public string txtListRptHeader + { + get + { + return _txtListRptHeader; + } + set + { + _txtListRptHeader = value; + } + } + + public string txtListRptBody + { + get + { + return _txtListRptBody; + } + set + { + _txtListRptBody = value; + } + } + + public string txtListRptFooter + { + get + { + return _txtListRptFooter; + } + set + { + _txtListRptFooter = value; + } + } + + public string txtDayEventTimeBegin + { + get + { + return _txtDayEventTimeBegin; + } + set + { + _txtDayEventTimeBegin = value; + } + } + + public string txtDayEventTimeEnd + { + get + { + return _txtDayEventTimeEnd; + } + set + { + _txtDayEventTimeEnd = value; + } + } + + public string txtDayLocation + { + get + { + return _txtDayLocation; + } + set + { + _txtDayLocation = value; + } + } + + public string txtDayEventDescription + { + get + { + return _txtDayEventDescription; + } + set + { + _txtDayEventDescription = value; + } + } + + public string txtWeekEventText + { + get + { + return _txtWeekEventText; + } + set + { + _txtWeekEventText = value; + } + } + + public string txtWeekTitleDate + { + get + { + return _txtWeekTitleDate; + } + set + { + _txtWeekTitleDate = value; + } + } + + public string txtMonthEventText + { + get + { + return _txtMonthEventText; + } + set + { + _txtMonthEventText = value; + } + } + + public string txtMonthDayEventCount + { + get + { + return _txtMonthDayEventCount; + } + set + { + _txtMonthDayEventCount = value; + } + } + + public string txtRSSTitle + { + get + { + return _txtRSSTitle; + } + set + { + _txtRSSTitle = value; + } + } + + public string txtRSSDescription + { + get + { + return _txtRSSDescription; + } + set + { + _txtRSSDescription = value; + } + } + + public string txtSEOPageTitle + { + get + { + return _txtSEOPageTitle; + } + set + { + _txtSEOPageTitle = value; + } + } + + public string txtSEOPageDescription + { + get + { + return _txtSEOPageDescription; + } + set + { + _txtSEOPageDescription = value; + } + } + + public string EventiCalSubject + { + get + { + return _EventiCalSubject; + } + set + { + _EventiCalSubject = value; + } + } + + public string EventiCalBody + { + get + { + return _EventiCalBody; + } + set + { + _EventiCalBody = value; + } + } + // ReSharper restore InconsistentNaming + +#endregion + + } +#endregion + + } + diff --git a/Components/EventModuleSettings.vb b/Components/EventModuleSettings.vb deleted file mode 100644 index e1b2876..0000000 --- a/Components/EventModuleSettings.vb +++ /dev/null @@ -1,2856 +0,0 @@ -' -' Copyright (c) 2004-2009 DNN-Europe, http://www.dnn-europe.net -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this -' software and associated documentation files (the "Software"), to deal in the Software -' without restriction, including without limitation the rights to use, copy, modify, merge, -' publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -' to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or -' substantial portions of the Software. - -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -' INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -' PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -' FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -' ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -' -Imports DotNetNuke.Common.Utilities.DataCache -Imports DotNetNuke.Entities.Modules - -Namespace DotNetNuke.Modules.Events - -#Region "EventModuleSettings" - - Public Class EventModuleSettings - Public Enum TimeZones As Integer - UserTZ = 1 - ModuleTZ - PortalTZ - End Enum - - Public Enum CategoriesSelected As Integer - All = 1 - Some - None - End Enum - - Public Enum DisplayCategories As Integer - DoNotDisplay = 1 - SingleSelect - MultiSelect - End Enum - - Public Enum LocationsSelected As Integer - All = 1 - Some - None - End Enum - - Public Enum DisplayLocations As Integer - DoNotDisplay = 1 - SingleSelect - MultiSelect - End Enum - - Public Enum SocialModule As Integer - No = 1 - SocialGroup - UserProfile - End Enum - - Public Enum SocialGroupPrivacy As Integer - OpenToAll = 1 - EditByGroup - PrivateToGroup - End Enum - -#Region " Private Members " - Private ReadOnly _allsettings As Hashtable - Private _moduleID As Integer = -1 - Private ReadOnly _localresourcefile As String = Nothing - - Private _version As String = "" - Private _ownerchangeallowed As Boolean = False - Private _eventsignup As Boolean = False - Private _eventsignupallowpaid As Boolean = True - Private _timeinterval As String = "30" - Private _timeZone As String = Nothing - Private _timeZoneId As String = Nothing - Private _enableEventTimeZones As Boolean = False - Private _primaryTimeZone As TimeZones = TimeZones.UserTZ - Private _secondaryTimeZone As TimeZones = TimeZones.PortalTZ - Private _eventtooltipmonth As Boolean = True - Private _eventtooltipweek As Boolean = True - Private _eventtooltipday As Boolean = True - Private _eventtooltiplist As Boolean = True - Private _eventtooltiplength As Integer = 10000 - Private _monthcellnoevents As Boolean = False - ' ReSharper disable FieldCanBeMadeReadOnly.Local - Private _disablecategories As Boolean = False - ' ReSharper restore FieldCanBeMadeReadOnly.Local - Private _enablecategories As DisplayCategories = 0 - Private _restrictcategories As Boolean = False - Private _restrictcategoriestotimeframe As Boolean = False - ' ReSharper disable FieldCanBeMadeReadOnly.Local - Private _disablelocations As Boolean = False - ' ReSharper restore FieldCanBeMadeReadOnly.Local - Private _enablelocations As DisplayLocations = 0 - Private _restrictlocations As Boolean = False - Private _restrictlocationstotimeframe As Boolean = False - Private _enablecontainerskin As Boolean = True - Private _eventdetailnewpage As Boolean = False - Private _maxrecurrences As String = "1000" - Private _enableenrollpopup As Boolean = True - Private _eventdaynewpage As Boolean = False - Private _defaultView As String = "EventMonth.ascx" - Private _eventnotify As Boolean = True - Private _notifyanon As Boolean = False - Private _sendreminderdefault As Boolean = False - Private _neweventemails As String = "Never" - Private _neweventemailrole As Integer = -1 - Private _newpereventemail As Boolean = False - Private _tzdisplay As Boolean = False - Private _paypalurl As String = "https://www.paypal.com" - Private _disableEventnav As Boolean = False - Private _collapserecurring As Boolean = False - Private _fulltimescale As Boolean = False - Private _includeendvalue As Boolean = True - Private _showvaluemarks As Boolean = False - Private _eventimage As Boolean = True - Private _allowreoccurring As Boolean = True - Private _eventsearch As Boolean = True - Private _preventconflicts As Boolean = False - Private _locationconflict As Boolean = False - Private _showEventsAlways As Boolean = False - Private _timeintitle As Boolean = False - Private _monthdayselect As Boolean = False - Private _masterEvent As Boolean = False - Private _addsubmodulename As Boolean = True - Private _enforcesubcalperms As Boolean = True - Private _fridayweekend As Boolean = False - Private _eventdefaultenrollview As Boolean = False - Private _paypalaccount As String = Nothing - Private _moderateall As Boolean = False - Private _reminderfrom As String = Nothing - Private _eventsListSelectType As String = "EVENTS" - Private _eventsListNumEvents As Integer = 10 - Private _eventsListEventDays As Integer = 365 - Private _eventsListPageSize As Integer = 10 - Private _eventsListSortDirection As String = "ASC" - Private _rssEnable As Boolean = False - Private _rssDateField As String = "UPDATEDDATE" - Private _rssDays As Integer = 365 - Private _rssTitle As String = Nothing - Private _rssDesc As String = Nothing - Private _expireevents As String = "" - Private _exportowneremail As Boolean = False - Private _exportanonowneremail As Boolean = False - Private _monthAllowed As Boolean = True - Private _weekAllowed As Boolean = True - Private _listAllowed As Boolean = True - Private _eventImageMonth As Boolean = True - Private _eventImageWeek As Boolean = False - Private _iconBar As String = "TOP" - Private _enrollEditFields As String = "03;05;" - Private _enrollViewFields As String = "" - Private _enrollAnonFields As String = "02;06;" - Private _eventhidefullenroll As Boolean = False - Private _maxnoenrolees As Integer = 1 - Private _enrolcanceldays As Integer = 0 - Private _detailPageAllowed As Boolean = False - Private _enrollmentPageAllowed As Boolean = False - Private _enrollmentPageDefaultUrl As String = "" - Private _eventsCustomField1 As Boolean = False - Private _eventsCustomField2 As Boolean = False - Private _iconMonthPrio As Boolean = True - Private _iconMonthRec As Boolean = True - Private _iconMonthReminder As Boolean = True - Private _iconMonthEnroll As Boolean = True - Private _iconWeekPrio As Boolean = True - Private _iconWeekRec As Boolean = True - Private _iconWeekReminder As Boolean = True - Private _iconWeekEnroll As Boolean = True - Private _iconListPrio As Boolean = True - Private _iconListRec As Boolean = True - Private _iconListReminder As Boolean = True - Private _iconListEnroll As Boolean = True - Private _privateMessage As String = "" - Private _eventTheme As String = "" - Private _eventThemeDefault As String = "0,MinimalExtropy," - Private _eventsListFields As String = "BD;ED;EN" - Private _eventsListShowHeader As String = "Yes" - Private _eventsListBeforeDays As Integer = 1 - Private _eventsListAfterDays As Integer = 7 - Private _recurDummy As String = Nothing - Private _templates As EventTemplates - Private Const ModuleCategoryID As Integer = -1 - Private _moduleCategoryIDs As ArrayList = Nothing - Private _moduleCategoriesSelected As CategoriesSelected = CategoriesSelected.All - Private Const ModuleLocationID As Integer = -1 - Private _moduleLocationIDs As ArrayList = Nothing - Private _moduleLocationsSelected As LocationsSelected = LocationsSelected.All - Private _eventsListSortColumn As String = "EventDateBegin" - Private _htmlEmail As String = "html" - Private _iCalDaysBefore As Integer = 365 - Private _iCalDaysAfter As Integer = 365 - Private _icalURLAppend As String = "" - Private _icalDefaultImage As String = "" - Private _icalOnIconBar As Boolean = False - Private _icalEmailEnable As Boolean = False - Private _iIcalURLInLocation As Boolean = True - Private _iIcalIncludeCalname As Boolean = False - Private _enableSEO As Boolean = True - Private _seoDescriptionLength As Integer = 256 - Private _enableSitemap As Boolean = False - Private _siteMapPriority As Single = 0.5 - Private _siteMapDaysBefore As Integer = 365 - Private _siteMapDaysAfter As Integer = 365 - Private _listViewGrid As Boolean = True - Private _listViewTable As Boolean = True - Private _rptColumns As Integer = 1 - Private _rptRows As Integer = 5 - Private _weekStart As System.Web.UI.WebControls.FirstDayOfWeek = System.Web.UI.WebControls.FirstDayOfWeek.Default - Private _listViewUseTime As Boolean = False - Private _standardEmail As String = Nothing - Private _fbAdmins As String = "" - Private _fbAppID As String = "" - Private _maxThumbWidth As Integer = 125 - Private _maxThumbHeight As Integer = 125 - Private _sendEnrollMessageApproved As Boolean = True - Private _sendEnrollMessageWaiting As Boolean = True - Private _sendEnrollMessageDenied As Boolean = True - Private _sendEnrollMessageAdded As Boolean = True - Private _sendEnrollMessageDeleted As Boolean = True - Private _sendEnrollMessagePaying As Boolean = True - Private _sendEnrollMessagePending As Boolean = True - Private _sendEnrollMessagePaid As Boolean = True - Private _sendEnrollMessageIncorrect As Boolean = True - Private _sendEnrollMessageCancelled As Boolean = True - Private _allowanonenroll As Boolean = False - Private _socialGroupModule As SocialModule = SocialModule.No - Private _enrolListSortDirection As SortDirection = SortDirection.Descending - Private _enrolListDaysBefore As Integer = (365 * 4) + 1 - Private _enrolListDaysAfter As Integer = (365 * 4) + 1 - Private _journalIntegration As Boolean = True - Private _socialUserPrivate As Boolean = True - Private _socialGroupSecurity As SocialGroupPrivacy = SocialGroupPrivacy.EditByGroup - -#End Region - -#Region " Constructors " - - Public Sub New() - End Sub - - Public Sub New(ByVal moduleId As Integer, ByVal localResourceFile As String) - _moduleID = moduleId - Dim mc As New ModuleController - _allsettings = mc.GetModuleSettings(_moduleID) - _localresourcefile = localResourceFile - - ' Set default correct for those where the basic default is affected by upgrade - UpdateDefaults() - - ReadValue(_allsettings, "version", Version) - ReadValue(_allsettings, "timeinterval", Timeinterval) - ReadValue(_allsettings, "TimeZone", TimeZone) - ReadValue(_allsettings, "TimeZoneId", TimeZoneId) - ReadValue(_allsettings, "EnableEventTimeZones", EnableEventTimeZones) - ReadValue(_allsettings, "PrimaryTimeZone", PrimaryTimeZone) - ReadValue(_allsettings, "SecondaryTimeZone", SecondaryTimeZone) - ReadValue(_allsettings, "eventtooltipmonth", Eventtooltipmonth) - ReadValue(_allsettings, "eventtooltipweek", Eventtooltipweek) - ReadValue(_allsettings, "eventtooltipday", Eventtooltipday) - ReadValue(_allsettings, "eventtooltiplist", Eventtooltiplist) - ReadValue(_allsettings, "eventtooltiplength", Eventtooltiplength) - ReadValue(_allsettings, "monthcellnoevents", Monthcellnoevents) - ReadValue(_allsettings, "disablecategories", _disablecategories) - ReadValue(_allsettings, "enablecategories", Enablecategories) - ReadValue(_allsettings, "restrictcategories", Restrictcategories) - ReadValue(_allsettings, "restrictcategoriestotimeframe", RestrictCategoriesToTimeFrame) - ReadValue(_allsettings, "disablelocations", _disablelocations) - ReadValue(_allsettings, "enablelocations", Enablelocations) - ReadValue(_allsettings, "restrictlocations", Restrictlocations) - ReadValue(_allsettings, "restrictlocationstotimeframe", RestrictLocationsToTimeFrame) - ReadValue(_allsettings, "enablecontainerskin", Enablecontainerskin) - ReadValue(_allsettings, "eventdetailnewpage", Eventdetailnewpage) - ReadValue(_allsettings, "maxrecurrences", Maxrecurrences) - ReadValue(_allsettings, "enableenrollpopup", Enableenrollpopup) - ReadValue(_allsettings, "eventdaynewpage", Eventdaynewpage) - ReadValue(_allsettings, "DefaultView", DefaultView) - ReadValue(_allsettings, "Eventnotify", Eventnotify) - ReadValue(_allsettings, "notifyanon", Notifyanon) - ReadValue(_allsettings, "sendreminderdefault", Sendreminderdefault) - ReadValue(_allsettings, "neweventemails", Neweventemails) - ReadValue(_allsettings, "neweventemailrole", Neweventemailrole) - ReadValue(_allsettings, "newpereventemail", Newpereventemail) - ReadValue(_allsettings, "tzdisplay", Tzdisplay) - ReadValue(_allsettings, "paypalurl", Paypalurl) - ReadValue(_allsettings, "disableEventnav", DisableEventnav) - ReadValue(_allsettings, "collapserecurring", Collapserecurring) - ReadValue(_allsettings, "fulltimescale", Fulltimescale) - ReadValue(_allsettings, "includeendvalue", Includeendvalue) - ReadValue(_allsettings, "showvaluemarks", Showvaluemarks) - ReadValue(_allsettings, "eventimage", Eventimage) - ReadValue(_allsettings, "allowreoccurring", Allowreoccurring) - ReadValue(_allsettings, "Eventsearch", Eventsearch) - ReadValue(_allsettings, "preventconflicts", Preventconflicts) - ReadValue(_allsettings, "locationconflict", Locationconflict) - ReadValue(_allsettings, "showEventsAlways", ShowEventsAlways) - ReadValue(_allsettings, "timeintitle", Timeintitle) - ReadValue(_allsettings, "monthdayselect", Monthdayselect) - ReadValue(_allsettings, "masterEvent", MasterEvent) - ReadValue(_allsettings, "addsubmodulename", Addsubmodulename) - ReadValue(_allsettings, "enforcesubcalperms", Enforcesubcalperms) - ReadValue(_allsettings, "eventsignup", Eventsignup) - ReadValue(_allsettings, "eventsignupallowpaid", Eventsignupallowpaid) - ReadValue(_allsettings, "fridayweekend", Fridayweekend) - ReadValue(_allsettings, "eventdefaultenrollview", Eventdefaultenrollview) - ReadValue(_allsettings, "paypalaccount", Paypalaccount) - ReadValue(_allsettings, "moderateall", Moderateall) - ReadValue(_allsettings, "reminderfrom", Reminderfrom) - ReadValue(_allsettings, "EventsListSelectType", EventsListSelectType) - ReadValue(_allsettings, "EventsListNumEvents", EventsListNumEvents) - ReadValue(_allsettings, "EventsListEventDays", EventsListEventDays) - ReadValue(_allsettings, "EventsListPageSize", EventsListPageSize) - ReadValue(_allsettings, "EventsListSortDirection", EventsListSortDirection) - ReadValue(_allsettings, "RSSEnable", RSSEnable) - ReadValue(_allsettings, "RSSDateField", RSSDateField) - ReadValue(_allsettings, "RSSDays", RSSDays) - ReadValue(_allsettings, "RSSTitle", RSSTitle) - ReadValue(_allsettings, "RSSDesc", RSSDesc) - ReadValue(_allsettings, "expireevents", Expireevents) - ReadValue(_allsettings, "exportowneremail", Exportowneremail) - ReadValue(_allsettings, "exportanonowneremail", Exportanonowneremail) - ReadValue(_allsettings, "ownerchangeallowed", Ownerchangeallowed) - ReadValue(_allsettings, "MonthAllowed", MonthAllowed) - ReadValue(_allsettings, "WeekAllowed", WeekAllowed) - ReadValue(_allsettings, "ListAllowed", ListAllowed) - ReadValue(_allsettings, "EventImageMonth", EventImageMonth) - ReadValue(_allsettings, "EventImageWeek", EventImageWeek) - ReadValue(_allsettings, "IconBar", IconBar) - ReadValue(_allsettings, "EnrollEditFields", EnrollEditFields) - ReadValue(_allsettings, "EnrollViewFields", EnrollViewFields) - ReadValue(_allsettings, "EnrollAnonFields", EnrollAnonFields) - ReadValue(_allsettings, "eventhidefullenroll", Eventhidefullenroll()) - ReadValue(_allsettings, "maxnoenrolees", Maxnoenrolees) - ReadValue(_allsettings, "enrolcanceldays", Enrolcanceldays) - ReadValue(_allsettings, "DetailPageAllowed", DetailPageAllowed) - ReadValue(_allsettings, "EnrollmentPageAllowed", EnrollmentPageAllowed) - ReadValue(_allsettings, "EnrollmentPageDefaultUrl", EnrollmentPageDefaultUrl) - ReadValue(_allsettings, "EventsCustomField1", EventsCustomField1) - ReadValue(_allsettings, "EventsCustomField2", EventsCustomField2) - ReadValue(_allsettings, "IconMonthPrio", IconMonthPrio) - ReadValue(_allsettings, "IconMonthRec", IconMonthRec) - ReadValue(_allsettings, "IconMonthReminder", IconMonthReminder) - ReadValue(_allsettings, "IconMonthEnroll", IconMonthEnroll) - ReadValue(_allsettings, "IconWeekPrio", IconWeekPrio) - ReadValue(_allsettings, "IconWeekRec", IconWeekRec) - ReadValue(_allsettings, "IconWeekReminder", IconWeekReminder) - ReadValue(_allsettings, "IconWeekEnroll", IconWeekEnroll) - ReadValue(_allsettings, "IconListPrio", IconListPrio) - ReadValue(_allsettings, "IconListRec", IconListRec) - ReadValue(_allsettings, "IconListReminder", IconListReminder) - ReadValue(_allsettings, "IconListEnroll", IconListEnroll) - ReadValue(_allsettings, "PrivateMessage", PrivateMessage) - ReadValue(_allsettings, "EventTheme", EventTheme) - ReadValue(_allsettings, "EventThemeDefault", EventThemeDefault) - ReadValue(_allsettings, "EventsListFields", EventsListFields) - ReadValue(_allsettings, "EventsListShowHeader", EventsListShowHeader) - ReadValue(_allsettings, "EventsListBeforeDays", EventsListBeforeDays) - ReadValue(_allsettings, "EventsListAfterDays", EventsListAfterDays) - ReadValue(_allsettings, "RecurDummy", RecurDummy) - ReadValue(_allsettings, "modulecategoryid", ModuleCategoryID) - ReadValue(_allsettings, "modulecategoryids", ModuleCategoryIDs) - ReadValue(_allsettings, "modulelocationid", ModuleLocationID) - ReadValue(_allsettings, "modulelocationids", ModuleLocationIDs) - ReadValue(_allsettings, "eventslistsortcolumn", EventsListSortColumn) - ReadValue(_allsettings, "HTMLEmail", HTMLEmail) - ReadValue(_allsettings, "iCalDaysBefore", IcalDaysBefore) - ReadValue(_allsettings, "iCalDaysAfter", IcalDaysAfter) - ReadValue(_allsettings, "iCalURLAppend", IcalURLAppend) - ReadValue(_allsettings, "iCalDefaultImage", IcalDefaultImage) - ReadValue(_allsettings, "iCalURLinLocation", IcalURLInLocation) - ReadValue(_allsettings, "iCalIncludeCalname", IcalIncludeCalname) - ReadValue(_allsettings, "enableSEO", EnableSEO) - ReadValue(_allsettings, "SEODescriptionLength", SEODescriptionLength) - ReadValue(_allsettings, "enableSitemap", EnableSitemap) - ReadValue(_allsettings, "siteMapPriority", SiteMapPriority) - ReadValue(_allsettings, "siteMapDaysBefore", SiteMapDaysBefore) - ReadValue(_allsettings, "siteMapDaysAfter", SiteMapDaysAfter) - ReadValue(_allsettings, "ListViewGrid", ListViewGrid) - ReadValue(_allsettings, "ListViewTable", ListViewTable) - ReadValue(_allsettings, "rptColumns", RptColumns) - ReadValue(_allsettings, "rptRows", RptRows) - ReadValue(_allsettings, "WeekStart", WeekStart) - ReadValue(_allsettings, "ListViewUseTime", ListViewUseTime) - ReadValue(_allsettings, "iCalOnIconBar", IcalOnIconBar) - ReadValue(_allsettings, "iCalEmailEnable", IcalEmailEnable) - ReadValue(_allsettings, "StandardEmail", StandardEmail) - ReadValue(_allsettings, "FBAdmins", FBAdmins) - ReadValue(_allsettings, "FBAppID", FBAppID) - ReadValue(_allsettings, "MaxThumbWidth", MaxThumbWidth) - ReadValue(_allsettings, "MaxThumbHeight", MaxThumbHeight) - ReadValue(_allsettings, "SendEnrollMessageApproved", SendEnrollMessageApproved) - ReadValue(_allsettings, "SendEnrollMessageWaiting", SendEnrollMessageWaiting) - ReadValue(_allsettings, "SendEnrollMessageDenied", SendEnrollMessageDenied) - ReadValue(_allsettings, "SendEnrollMessageAdded", SendEnrollMessageAdded) - ReadValue(_allsettings, "SendEnrollMessageDeleted", SendEnrollMessageDeleted) - ReadValue(_allsettings, "SendEnrollMessagePaying", SendEnrollMessagePaying) - ReadValue(_allsettings, "SendEnrollMessagePending", SendEnrollMessagePending) - ReadValue(_allsettings, "SendEnrollMessagePaid", SendEnrollMessagePaid) - ReadValue(_allsettings, "SendEnrollMessageIncorrect", SendEnrollMessageIncorrect) - ReadValue(_allsettings, "SendEnrollMessageCancelled", SendEnrollMessageCancelled) - ReadValue(_allsettings, "allowanonenroll", AllowAnonEnroll) - ReadValue(_allsettings, "SocialGroupModule", SocialGroupModule) - ReadValue(_allsettings, "SocialUserPrivate", SocialUserPrivate) - ReadValue(_allsettings, "SSocialGroupSecurity", SocialGroupSecurity) - ReadValue(_allsettings, "EnrolListSortDirection", EnrolListSortDirection) - ReadValue(_allsettings, "EnrolListDaysBefore", EnrolListDaysBefore) - ReadValue(_allsettings, "EnrolListDaysAfter", EnrolListDaysAfter) - ReadValue(_allsettings, "JournalIntegration", JournalIntegration) - Templates = New EventTemplates(_moduleID, _allsettings, _localresourcefile) - End Sub - -#End Region - -#Region " Public Methods " - - Public Function GetEventModuleSettings(ByVal moduleID As Integer, ByVal localResourceFile As String) As EventModuleSettings - _moduleID = moduleID - If _moduleID > 0 Then - Dim cacheKey As String = "EventsSettings" & moduleID.ToString - Dim bs As EventModuleSettings - bs = CType(GetCache(cacheKey), EventModuleSettings) - If bs Is Nothing Then - bs = New EventModuleSettings(_moduleID, localResourceFile) - If Not localResourceFile Is Nothing Then - SetCache(cacheKey, bs) - End If - End If - Return bs - End If - Return Nothing - End Function - - - Public Sub SaveSettings(ByVal moduleId As Integer) - - Dim objModules As New ModuleController - With objModules - Dim objDesktopModule As DesktopModuleInfo - objDesktopModule = DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", 0) - .UpdateModuleSetting(moduleId, "version", objDesktopModule.Version) - - .UpdateModuleSetting(moduleId, "timeinterval", Timeinterval.ToString) - .UpdateModuleSetting(moduleId, "TimeZoneId", TimeZoneId) - .UpdateModuleSetting(moduleId, "EnableEventTimeZones", EnableEventTimeZones.ToString) - .UpdateModuleSetting(moduleId, "PrimaryTimeZone", CInt(PrimaryTimeZone).ToString) - .UpdateModuleSetting(moduleId, "SecondaryTimeZone", CInt(SecondaryTimeZone).ToString) - .UpdateModuleSetting(moduleId, "eventtooltipmonth", Eventtooltipmonth.ToString) - .UpdateModuleSetting(moduleId, "eventtooltipweek", Eventtooltipweek.ToString) - .UpdateModuleSetting(moduleId, "eventtooltipday", Eventtooltipday.ToString) - .UpdateModuleSetting(moduleId, "eventtooltiplist", Eventtooltiplist.ToString) - .UpdateModuleSetting(moduleId, "eventtooltiplength", Eventtooltiplength.ToString) - .UpdateModuleSetting(moduleId, "monthcellnoevents", Monthcellnoevents.ToString) - .UpdateModuleSetting(moduleId, "enablecategories", CInt(Enablecategories).ToString) - .UpdateModuleSetting(moduleId, "restrictcategories", Restrictcategories.ToString) - .UpdateModuleSetting(moduleId, "restrictcategoriestotimeframe", RestrictCategoriesToTimeFrame.ToString) - .UpdateModuleSetting(moduleId, "enablelocations", CInt(Enablelocations).ToString) - .UpdateModuleSetting(moduleId, "restrictlocations", Restrictlocations.ToString) - .UpdateModuleSetting(moduleId, "restrictlocationstotimeframe", RestrictLocationsToTimeFrame.ToString) - .UpdateModuleSetting(moduleId, "enablecontainerskin", Enablecontainerskin.ToString) - .UpdateModuleSetting(moduleId, "eventdetailnewpage", Eventdetailnewpage.ToString) - .UpdateModuleSetting(moduleId, "maxrecurrences", Maxrecurrences.ToString) - .UpdateModuleSetting(moduleId, "enableenrollpopup", Enableenrollpopup.ToString) - .UpdateModuleSetting(moduleId, "eventdaynewpage", Eventdaynewpage.ToString) - .UpdateModuleSetting(moduleId, "DefaultView", DefaultView.ToString) - .UpdateModuleSetting(moduleId, "Eventnotify", Eventnotify.ToString) - .UpdateModuleSetting(moduleId, "notifyanon", Notifyanon.ToString) - .UpdateModuleSetting(moduleId, "sendreminderdefault", Sendreminderdefault.ToString) - .UpdateModuleSetting(moduleId, "neweventemails", Neweventemails.ToString) - .UpdateModuleSetting(moduleId, "neweventemailrole", Neweventemailrole.ToString) - .UpdateModuleSetting(moduleId, "newpereventemail", Newpereventemail.ToString) - .UpdateModuleSetting(moduleId, "tzdisplay", Tzdisplay.ToString) - .UpdateModuleSetting(moduleId, "paypalurl", Paypalurl.ToString) - .UpdateModuleSetting(moduleId, "disableEventnav", DisableEventnav.ToString) - .UpdateModuleSetting(moduleId, "collapserecurring", Collapserecurring.ToString) - .UpdateModuleSetting(moduleId, "fulltimescale", Fulltimescale.ToString) - .UpdateModuleSetting(moduleId, "includeendvalue", Includeendvalue.ToString) - .UpdateModuleSetting(moduleId, "showvaluemarks", Showvaluemarks.ToString) - .UpdateModuleSetting(moduleId, "eventimage", Eventimage.ToString) - .UpdateModuleSetting(moduleId, "allowreoccurring", Allowreoccurring.ToString) - .UpdateModuleSetting(moduleId, "Eventsearch", Eventsearch.ToString) - .UpdateModuleSetting(moduleId, "preventconflicts", Preventconflicts.ToString) - .UpdateModuleSetting(moduleId, "locationconflict", Locationconflict.ToString) - .UpdateModuleSetting(moduleId, "showEventsAlways", ShowEventsAlways.ToString) - .UpdateModuleSetting(moduleId, "timeintitle", Timeintitle.ToString) - .UpdateModuleSetting(moduleId, "monthdayselect", Monthdayselect.ToString) - .UpdateModuleSetting(moduleId, "masterEvent", MasterEvent.ToString) - .UpdateModuleSetting(moduleId, "addsubmodulename", Addsubmodulename.ToString) - .UpdateModuleSetting(moduleId, "enforcesubcalperms", Enforcesubcalperms.ToString) - .UpdateModuleSetting(moduleId, "eventsignup", Eventsignup.ToString) - .UpdateModuleSetting(moduleId, "eventsignupallowpaid", Eventsignupallowpaid.ToString) - .UpdateModuleSetting(moduleId, "fridayweekend", Fridayweekend.ToString) - .UpdateModuleSetting(moduleId, "eventdefaultenrollview", Eventdefaultenrollview.ToString) - .UpdateModuleSetting(moduleId, "paypalaccount", Paypalaccount.ToString) - .UpdateModuleSetting(moduleId, "moderateall", Moderateall.ToString) - .UpdateModuleSetting(moduleId, "reminderfrom", Reminderfrom.ToString) - .UpdateModuleSetting(moduleId, "EventsListSelectType", EventsListSelectType.ToString) - .UpdateModuleSetting(moduleId, "EventsListNumEvents", EventsListNumEvents.ToString) - .UpdateModuleSetting(moduleId, "EventsListEventDays", EventsListEventDays.ToString) - .UpdateModuleSetting(moduleId, "EventsListPageSize", EventsListPageSize.ToString) - .UpdateModuleSetting(moduleId, "EventsListSortDirection", EventsListSortDirection.ToString) - .UpdateModuleSetting(moduleId, "RSSEnable", RSSEnable.ToString) - .UpdateModuleSetting(moduleId, "RSSDateField", RSSDateField.ToString) - .UpdateModuleSetting(moduleId, "RSSDays", RSSDays.ToString) - .UpdateModuleSetting(moduleId, "RSSTitle", RSSTitle.ToString) - .UpdateModuleSetting(moduleId, "RSSDesc", RSSDesc.ToString) - .UpdateModuleSetting(moduleId, "expireevents", Expireevents.ToString) - .UpdateModuleSetting(moduleId, "exportowneremail", Exportowneremail.ToString) - .UpdateModuleSetting(moduleId, "exportanonowneremail", Exportanonowneremail.ToString) - .UpdateModuleSetting(moduleId, "ownerchangeallowed", Ownerchangeallowed.ToString) - .UpdateModuleSetting(moduleId, "MonthAllowed", MonthAllowed.ToString) - .UpdateModuleSetting(moduleId, "WeekAllowed", WeekAllowed.ToString) - .UpdateModuleSetting(moduleId, "ListAllowed", ListAllowed.ToString) - .UpdateModuleSetting(moduleId, "EventImageMonth", EventImageMonth.ToString) - .UpdateModuleSetting(moduleId, "EventImageWeek", EventImageWeek.ToString) - .UpdateModuleSetting(moduleId, "IconBar", IconBar.ToString) - .UpdateModuleSetting(moduleId, "EnrollEditFields", EnrollEditFields.ToString) - .UpdateModuleSetting(moduleId, "EnrollViewFields", EnrollViewFields.ToString) - .UpdateModuleSetting(moduleId, "EnrollAnonFields", EnrollAnonFields.ToString) - .UpdateModuleSetting(moduleId, "eventhidefullenroll", Eventhidefullenroll().ToString) - .UpdateModuleSetting(moduleId, "maxnoenrolees", Maxnoenrolees.ToString) - .UpdateModuleSetting(moduleId, "enrolcanceldays", Enrolcanceldays.ToString) - .UpdateModuleSetting(moduleId, "DetailPageAllowed", DetailPageAllowed.ToString) - .UpdateModuleSetting(moduleId, "EnrollmentPageAllowed", EnrollmentPageAllowed.ToString) - .UpdateModuleSetting(moduleId, "EnrollmentPageDefaultUrl", EnrollmentPageDefaultUrl.ToString) - .UpdateModuleSetting(moduleId, "EventsCustomField1", EventsCustomField1.ToString) - .UpdateModuleSetting(moduleId, "EventsCustomField2", EventsCustomField2.ToString) - .UpdateModuleSetting(moduleId, "IconMonthPrio", IconMonthPrio.ToString) - .UpdateModuleSetting(moduleId, "IconMonthRec", IconMonthRec.ToString) - .UpdateModuleSetting(moduleId, "IconMonthReminder", IconMonthReminder.ToString) - .UpdateModuleSetting(moduleId, "IconMonthEnroll", IconMonthEnroll.ToString) - .UpdateModuleSetting(moduleId, "IconWeekPrio", IconWeekPrio.ToString) - .UpdateModuleSetting(moduleId, "IconWeekRec", IconWeekRec.ToString) - .UpdateModuleSetting(moduleId, "IconWeekReminder", IconWeekReminder.ToString) - .UpdateModuleSetting(moduleId, "IconWeekEnroll", IconWeekEnroll.ToString) - .UpdateModuleSetting(moduleId, "IconListPrio", IconListPrio.ToString) - .UpdateModuleSetting(moduleId, "IconListRec", IconListRec.ToString) - .UpdateModuleSetting(moduleId, "IconListReminder", IconListReminder.ToString) - .UpdateModuleSetting(moduleId, "IconListEnroll", IconListEnroll.ToString) - .UpdateModuleSetting(moduleId, "PrivateMessage", PrivateMessage.ToString) - .UpdateModuleSetting(moduleId, "EventTheme", EventTheme.ToString) - ' Hard coded value, not set anywhere - ' .UpdateModuleSetting(ModuleId, "EventThemeDefault", EventThemeDefault.ToString) - .UpdateModuleSetting(moduleId, "EventsListFields", EventsListFields.ToString) - .UpdateModuleSetting(moduleId, "EventsListShowHeader", EventsListShowHeader.ToString) - .UpdateModuleSetting(moduleId, "EventsListBeforeDays", EventsListBeforeDays.ToString) - .UpdateModuleSetting(moduleId, "EventsListAfterDays", EventsListAfterDays.ToString) - If Not RecurDummy Is Nothing Then - .UpdateModuleSetting(moduleId, "RecurDummy", RecurDummy.ToString) - End If - .UpdateModuleSetting(moduleId, "modulecategoryids", String.Join(",", CType(ModuleCategoryIDs.ToArray(GetType(String)), String()))) - .UpdateModuleSetting(moduleId, "modulelocationids", String.Join(",", CType(ModuleLocationIDs.ToArray(GetType(String)), String()))) - .UpdateModuleSetting(moduleId, "eventslistsortcolumn", EventsListSortColumn.ToString) - .UpdateModuleSetting(moduleId, "HTMLEmail", HTMLEmail.ToString) - .UpdateModuleSetting(moduleId, "iCalDaysBefore", IcalDaysBefore.ToString) - .UpdateModuleSetting(moduleId, "iCalDaysAfter", IcalDaysAfter.ToString) - .UpdateModuleSetting(moduleId, "iCalURLAppend", IcalURLAppend.ToString) - .UpdateModuleSetting(moduleId, "iCalDefaultImage", IcalDefaultImage.ToString) - .UpdateModuleSetting(moduleId, "iCalURLinLocation", IcalURLInLocation.ToString) - .UpdateModuleSetting(moduleId, "iCalIncludeCalname", IcalIncludeCalname.ToString) - .UpdateModuleSetting(moduleId, "enableSEO", EnableSEO.ToString) - .UpdateModuleSetting(moduleId, "SEODescriptionLength", SEODescriptionLength.ToString) - .UpdateModuleSetting(moduleId, "enableSitemap", EnableSitemap.ToString) - .UpdateModuleSetting(moduleId, "siteMapPriority", SiteMapPriority.ToString) - .UpdateModuleSetting(moduleId, "siteMapDaysBefore", SiteMapDaysBefore.ToString) - .UpdateModuleSetting(moduleId, "siteMapDaysAfter", SiteMapDaysAfter.ToString) - .UpdateModuleSetting(moduleId, "ListViewGrid", ListViewGrid.ToString) - .UpdateModuleSetting(moduleId, "ListViewTable", ListViewTable.ToString) - .UpdateModuleSetting(moduleId, "rptColumns", RptColumns.ToString) - .UpdateModuleSetting(moduleId, "rptRows", RptRows.ToString) - .UpdateModuleSetting(moduleId, "WeekStart", CInt(WeekStart).ToString) - .UpdateModuleSetting(moduleId, "ListViewUseTime", ListViewUseTime.ToString) - .UpdateModuleSetting(moduleId, "iCalOnIconBar", IcalOnIconBar.ToString) - .UpdateModuleSetting(moduleId, "iCalEmailEnable", IcalEmailEnable.ToString) - .UpdateModuleSetting(moduleId, "StandardEmail", StandardEmail.ToString) - .UpdateModuleSetting(moduleId, "FBAdmins", FBAdmins.ToString) - .UpdateModuleSetting(moduleId, "FBAppID", FBAppID.ToString) - .UpdateModuleSetting(moduleId, "MaxThumbHeight", MaxThumbHeight.ToString) - .UpdateModuleSetting(moduleId, "MaxThumbWidth", MaxThumbWidth.ToString) - .UpdateModuleSetting(moduleId, "SendEnrollMessageApproved", SendEnrollMessageApproved.ToString) - .UpdateModuleSetting(moduleId, "SendEnrollMessageWaiting", SendEnrollMessageWaiting.ToString) - .UpdateModuleSetting(moduleId, "SendEnrollMessageDenied", SendEnrollMessageDenied.ToString) - .UpdateModuleSetting(moduleId, "SendEnrollMessageAdded", SendEnrollMessageAdded.ToString) - .UpdateModuleSetting(moduleId, "SendEnrollMessageDeleted", SendEnrollMessageDeleted.ToString) - .UpdateModuleSetting(moduleId, "SendEnrollMessagePaying", SendEnrollMessagePaying.ToString) - .UpdateModuleSetting(moduleId, "SendEnrollMessagePending", SendEnrollMessagePending.ToString) - .UpdateModuleSetting(moduleId, "SendEnrollMessagePaid", SendEnrollMessagePaid.ToString) - .UpdateModuleSetting(moduleId, "SendEnrollMessageIncorrect", SendEnrollMessageIncorrect.ToString) - .UpdateModuleSetting(moduleId, "SendEnrollMessageCancelled", SendEnrollMessageCancelled.ToString) - .UpdateModuleSetting(moduleId, "allowanonenroll", AllowAnonEnroll.ToString) - .UpdateModuleSetting(moduleId, "SocialGroupModule", CInt(SocialGroupModule).ToString) - .UpdateModuleSetting(moduleId, "SocialUserPrivate", SocialUserPrivate.ToString) - .UpdateModuleSetting(moduleId, "SocialGroupSecurity", CInt(SocialGroupSecurity).ToString) - .UpdateModuleSetting(moduleId, "EnrolListSortDirection", CInt(EnrolListSortDirection).ToString) - .UpdateModuleSetting(moduleId, "EnrolListDaysBefore", CInt(EnrolListDaysBefore).ToString) - .UpdateModuleSetting(moduleId, "EnrolListDaysAfter", CInt(EnrolListDaysAfter).ToString) - .UpdateModuleSetting(moduleId, "JournalIntegration", JournalIntegration.ToString) - End With - Dim cacheKey As String = "EventsSettings" & moduleId.ToString - SetCache(cacheKey, Me) - - End Sub - -#End Region - -#Region " Private Methods " - - Private Shared Sub ReadValue(ByRef valueTable As Hashtable, ByVal valueName As String, ByRef variable As String) - If Not valueTable.Item(valueName) Is Nothing Then - Try - variable = CType(valueTable.Item(valueName), String) - Catch ex As Exception - End Try - End If - End Sub - - Private Shared Sub ReadValue(ByRef valueTable As Hashtable, ByVal valueName As String, ByRef variable As Integer) - If Not valueTable.Item(valueName) Is Nothing Then - Try - variable = CType(valueTable.Item(valueName), Integer) - Catch ex As Exception - End Try - End If - End Sub - - Private Shared Sub ReadValue(ByRef valueTable As Hashtable, ByVal valueName As String, ByRef variable As Boolean) - If Not valueTable.Item(valueName) Is Nothing Then - Try - variable = CType(valueTable.Item(valueName), Boolean) - Catch ex As Exception - End Try - End If - End Sub - - Private Shared Sub ReadValue(ByRef valueTable As Hashtable, ByVal valueName As String, ByRef variable As System.Web.UI.WebControls.FirstDayOfWeek) - If Not valueTable.Item(valueName) Is Nothing Then - Try - variable = CType(CInt(valueTable.Item(valueName)), System.Web.UI.WebControls.FirstDayOfWeek) - Catch ex As Exception - End Try - End If - End Sub - - Private Shared Sub ReadValue(ByRef valueTable As Hashtable, ByVal valueName As String, ByRef variable As Single) - If Not valueTable.Item(valueName) Is Nothing Then - Try - variable = CType(valueTable.Item(valueName), Single) - Catch ex As Exception - End Try - End If - End Sub - - Private Shared Sub ReadValue(ByRef valueTable As Hashtable, ByVal valueName As String, ByRef variable As TimeZones) - If Not valueTable.Item(valueName) Is Nothing Then - Try - variable = CType(valueTable.Item(valueName), TimeZones) - Catch ex As Exception - End Try - End If - End Sub - - Private Shared Sub ReadValue(ByRef valueTable As Hashtable, ByVal valueName As String, ByRef variable As DisplayCategories) - If Not valueTable.Item(valueName) Is Nothing Then - Try - variable = CType(valueTable.Item(valueName), DisplayCategories) - Catch ex As Exception - End Try - End If - End Sub - - Private Shared Sub ReadValue(ByRef valueTable As Hashtable, ByVal valueName As String, ByRef variable As DisplayLocations) - If Not valueTable.Item(valueName) Is Nothing Then - Try - variable = CType(valueTable.Item(valueName), DisplayLocations) - Catch ex As Exception - End Try - End If - End Sub - - Private Shared Sub ReadValue(ByRef valueTable As Hashtable, ByVal valueName As String, ByRef variable As SocialModule) - If Not valueTable.Item(valueName) Is Nothing Then - Try - variable = CType(valueTable.Item(valueName), SocialModule) - Catch ex As Exception - End Try - End If - End Sub - - Private Shared Sub ReadValue(ByRef valueTable As Hashtable, ByVal valueName As String, ByRef variable As SocialGroupPrivacy) - If Not valueTable.Item(valueName) Is Nothing Then - Try - variable = CType(valueTable.Item(valueName), SocialGroupPrivacy) - Catch ex As Exception - End Try - End If - End Sub - - Private Shared Sub ReadValue(ByRef valueTable As Hashtable, ByVal valueName As String, ByRef variable As SortDirection) - If Not valueTable.Item(valueName) Is Nothing Then - Try - variable = CType(valueTable.Item(valueName), SortDirection) - Catch ex As Exception - End Try - End If - End Sub - - Private Shared Sub ReadValue(ByRef valueTable As Hashtable, ByVal valueName As String, ByRef variable As ArrayList) - If Not valueTable.Item(valueName) Is Nothing Then - Try - Dim tmpArray() As String = Split(CType(valueTable.Item(valueName), String), ",") - variable.Clear() - For i As Integer = 0 To tmpArray.Length - 1 - If tmpArray(i) <> "" Then - variable.Add(CInt(tmpArray(i))) - End If - Next - Catch ex As Exception - End Try - End If - End Sub - - Private Sub UpdateDefaults() - Dim vers As String = CType(_allsettings("version"), String) - If Not _allsettings("onlyview") Is Nothing And CType(_allsettings("onlyview"), Boolean) Then - If CType(_allsettings("DefaultView"), String) = "EventList.ascx" Then - _listAllowed = True - Else - _listAllowed = False - End If - If CType(_allsettings("DefaultView"), String) = "EventWeek.ascx" Then - _weekAllowed = True - Else - _weekAllowed = False - End If - If CType(_allsettings("DefaultView"), String) = "EventMonth.ascx" Then - _monthAllowed = True - Else - _monthAllowed = False - End If - End If - If vers = "" Then - _enforcesubcalperms = True - Else - _enforcesubcalperms = False - End If - If Not _allsettings("allowsubscriptions") Is Nothing And CType(_allsettings("allowsubscriptions"), Boolean) Then - _neweventemails = "Subscribe" - End If - If vers = "" Then - _enablecontainerskin = True - ElseIf CInt(Left(vers, InStr(vers, ".") - 1)) < 5 Then - _enablecontainerskin = False - Else - _enablecontainerskin = True - End If - If Not _allsettings("eventtooltip") Is Nothing Then - _eventtooltipmonth = CType(_allsettings("eventtooltip"), Boolean) - _eventtooltipweek = CType(_allsettings("eventtooltip"), Boolean) - _eventtooltipday = CType(_allsettings("eventtooltip"), Boolean) - _eventtooltiplist = CType(_allsettings("eventtooltip"), Boolean) - End If - If Not _allsettings("SocialGroupModule") Is Nothing Then - If CType(_allsettings("SocialGroupModule"), SocialModule) = SocialModule.UserProfile Then - _socialUserPrivate = False - End If - If CType(_allsettings("SocialGroupModule"), SocialModule) = SocialModule.SocialGroup Then - _socialGroupSecurity = SocialGroupPrivacy.OpenToAll - End If - End If - End Sub - -#End Region - -#Region " Properties " - Public Property MaxThumbWidth() As Integer - Get - Return _maxThumbWidth - End Get - Set(ByVal value As Integer) - _maxThumbWidth = value - End Set - End Property - - Public Property MaxThumbHeight() As Integer - Get - Return _maxThumbHeight - End Get - Set(ByVal value As Integer) - _maxThumbHeight = value - End Set - End Property - - Public Property FBAppID() As String - Get - Return _fbAppID - End Get - Set(ByVal value As String) - _fbAppID = value - End Set - End Property - - Public Property FBAdmins() As String - Get - Return _fbAdmins - End Get - Set(ByVal value As String) - _fbAdmins = value - End Set - End Property - - Public Property StandardEmail() As String - Get - If _standardEmail Is Nothing Then - Dim portalsettings As Entities.Portals.PortalSettings = Entities.Portals.PortalController.GetCurrentPortalSettings - If Not portalsettings Is Nothing Then - _standardEmail = portalsettings.Email - End If - End If - Return _standardEmail - End Get - Set(ByVal value As String) - _standardEmail = value - End Set - End Property - - Public Property IcalIncludeCalname() As Boolean - Get - Return _iIcalIncludeCalname - End Get - Set(ByVal value As Boolean) - _iIcalIncludeCalname = value - End Set - End Property - - Public Property IcalEmailEnable() As Boolean - Get - Return _icalEmailEnable - End Get - Set(ByVal value As Boolean) - _icalEmailEnable = value - End Set - End Property - - Public Property IcalURLInLocation() As Boolean - Get - Return _iIcalURLInLocation - End Get - Set(ByVal value As Boolean) - _iIcalURLInLocation = value - End Set - End Property - - Public Property IcalOnIconBar() As Boolean - Get - Return _icalOnIconBar - End Get - Set(ByVal value As Boolean) - _icalOnIconBar = value - End Set - End Property - - Public Property ListViewUseTime() As Boolean - Get - Return _listViewUseTime - End Get - Set(ByVal value As Boolean) - _listViewUseTime = value - End Set - End Property - - Public Property WeekStart() As System.Web.UI.WebControls.FirstDayOfWeek - Get - Return _weekStart - End Get - Set(ByVal value As System.Web.UI.WebControls.FirstDayOfWeek) - _weekStart = value - End Set - End Property - - Public Property RptRows() As Integer - Get - Return _rptRows - End Get - Set(ByVal value As Integer) - _rptRows = value - End Set - End Property - - Public Property RptColumns() As Integer - Get - Return _rptColumns - End Get - Set(ByVal value As Integer) - _rptColumns = value - End Set - End Property - - Public Property ListViewTable() As Boolean - Get - Return _listViewTable - End Get - Set(ByVal value As Boolean) - _listViewTable = value - End Set - End Property - - Public Property ListViewGrid() As Boolean - Get - Return _listViewGrid - End Get - Set(ByVal value As Boolean) - _listViewGrid = value - End Set - End Property - - Public Property SiteMapDaysAfter() As Integer - Get - Return _siteMapDaysAfter - End Get - Set(ByVal value As Integer) - _siteMapDaysAfter = value - End Set - End Property - - Public Property SiteMapDaysBefore() As Integer - Get - Return _siteMapDaysBefore - End Get - Set(ByVal value As Integer) - _siteMapDaysBefore = value - End Set - End Property - - Public Property SiteMapPriority() As Single - Get - Return _siteMapPriority - End Get - Set(ByVal value As Single) - _siteMapPriority = value - End Set - End Property - - Public Property EnableSitemap() As Boolean - Get - Return _enableSitemap - End Get - Set(ByVal value As Boolean) - _enableSitemap = value - End Set - End Property - - Public Property SEODescriptionLength() As Integer - Get - Return _seoDescriptionLength - End Get - Set(ByVal value As Integer) - _seoDescriptionLength = value - End Set - End Property - - Public Property EnableSEO() As Boolean - Get - Return _enableSEO - End Get - Set(ByVal value As Boolean) - _enableSEO = value - End Set - End Property - - Public Property IcalDefaultImage() As String - Get - Return _icalDefaultImage - End Get - Set(ByVal value As String) - _icalDefaultImage = value - End Set - End Property - - Public Property IcalURLAppend() As String - Get - Return _icalURLAppend - End Get - Set(ByVal value As String) - _icalURLAppend = value - End Set - End Property - - Public Property IcalDaysAfter() As Integer - Get - Return _iCalDaysAfter - End Get - Set(ByVal value As Integer) - _iCalDaysAfter = value - End Set - End Property - - Public Property IcalDaysBefore() As Integer - Get - Return _iCalDaysBefore - End Get - Set(ByVal value As Integer) - _iCalDaysBefore = value - End Set - End Property - - Public Property HTMLEmail() As String - Get - Return _htmlEmail - End Get - Set(ByVal value As String) - _htmlEmail = value - End Set - End Property - - Public Property EventsListSortColumn() As String - Get - Return _eventsListSortColumn - End Get - Set(ByVal value As String) - _eventsListSortColumn = value - End Set - End Property - - Public Property ModuleCategoryIDs() As ArrayList - Get - If _moduleCategoryIDs Is Nothing Then - Dim arCat As New ArrayList - arCat.Add(ModuleCategoryID) - _moduleCategoryIDs = arCat - End If - Return _moduleCategoryIDs - End Get - Set(ByVal value As ArrayList) - _moduleCategoryIDs = value - End Set - End Property - - Public Property ModuleCategoriesSelected() As CategoriesSelected - Get - If ModuleCategoryIDs.Count = 0 Then - _moduleCategoriesSelected = CategoriesSelected.None - ElseIf CInt(ModuleCategoryIDs.Item(0)) = -1 Then - _moduleCategoriesSelected = CategoriesSelected.All - Else - _moduleCategoriesSelected = CategoriesSelected.Some - End If - Return _moduleCategoriesSelected - End Get - Set(ByVal value As CategoriesSelected) - _moduleCategoriesSelected = value - End Set - End Property - - Public Property ModuleLocationIDs() As ArrayList - Get - If _moduleLocationIDs Is Nothing Then - Dim arLoc As New ArrayList - arLoc.Add(ModuleLocationID) - _moduleLocationIDs = arLoc - End If - Return _moduleLocationIDs - End Get - Set(ByVal value As ArrayList) - _moduleLocationIDs = value - End Set - End Property - - Public Property ModuleLocationsSelected() As LocationsSelected - Get - If ModuleLocationIDs.Count = 0 Then - _moduleLocationsSelected = LocationsSelected.None - ElseIf CInt(ModuleLocationIDs.Item(0)) = -1 Then - _moduleLocationsSelected = LocationsSelected.All - Else - _moduleLocationsSelected = LocationsSelected.Some - End If - Return _moduleLocationsSelected - End Get - Set(ByVal value As LocationsSelected) - _moduleLocationsSelected = value - End Set - End Property - - Public Property RecurDummy() As String - Get - Return _recurDummy - End Get - Set(ByVal value As String) - _recurDummy = value - End Set - End Property - - Public Property EventsListAfterDays() As Integer - Get - Return _eventsListAfterDays - End Get - Set(ByVal value As Integer) - _eventsListAfterDays = value - End Set - End Property - - Public Property EventsListBeforeDays() As Integer - Get - Return _eventsListBeforeDays - End Get - Set(ByVal value As Integer) - _eventsListBeforeDays = value - End Set - End Property - - Public Property EventsListShowHeader() As String - Get - Return _eventsListShowHeader - End Get - Set(ByVal value As String) - _eventsListShowHeader = value - End Set - End Property - - Public Property EventsListFields() As String - Get - Return _eventsListFields - End Get - Set(ByVal value As String) - _eventsListFields = value - End Set - End Property - - Public Property EventThemeDefault() As String - Get - Return _eventThemeDefault - End Get - Set(ByVal value As String) - _eventThemeDefault = value - End Set - End Property - - Public Property EventTheme() As String - Get - If _eventTheme = Nothing Then - _eventTheme = _eventThemeDefault - End If - Return _eventTheme - End Get - Set(ByVal value As String) - _eventTheme = value - End Set - End Property - - Public Property PrivateMessage() As String - Get - Return _privateMessage - End Get - Set(ByVal value As String) - _privateMessage = value - End Set - End Property - - Public Property IconListEnroll() As Boolean - Get - Return _iconListEnroll - End Get - Set(ByVal value As Boolean) - _iconListEnroll = value - End Set - End Property - - Public Property IconListReminder() As Boolean - Get - Return _iconListReminder - End Get - Set(ByVal value As Boolean) - _iconListReminder = value - End Set - End Property - - Public Property IconListRec() As Boolean - Get - Return _iconListRec - End Get - Set(ByVal value As Boolean) - _iconListRec = value - End Set - End Property - - Public Property IconListPrio() As Boolean - Get - Return _iconListPrio - End Get - Set(ByVal value As Boolean) - _iconListPrio = value - End Set - End Property - - Public Property IconWeekEnroll() As Boolean - Get - Return _iconWeekEnroll - End Get - Set(ByVal value As Boolean) - _iconWeekEnroll = value - End Set - End Property - - Public Property IconWeekReminder() As Boolean - Get - Return _iconWeekReminder - End Get - Set(ByVal value As Boolean) - _iconWeekReminder = value - End Set - End Property - - Public Property IconWeekRec() As Boolean - Get - Return _iconWeekRec - End Get - Set(ByVal value As Boolean) - _iconWeekRec = value - End Set - End Property - - Public Property IconWeekPrio() As Boolean - Get - Return _iconWeekPrio - End Get - Set(ByVal value As Boolean) - _iconWeekPrio = value - End Set - End Property - - Public Property IconMonthEnroll() As Boolean - Get - Return _iconMonthEnroll - End Get - Set(ByVal value As Boolean) - _iconMonthEnroll = value - End Set - End Property - - Public Property IconMonthReminder() As Boolean - Get - Return _iconMonthReminder - End Get - Set(ByVal value As Boolean) - _iconMonthReminder = value - End Set - End Property - - Public Property IconMonthRec() As Boolean - Get - Return _iconMonthRec - End Get - Set(ByVal value As Boolean) - _iconMonthRec = value - End Set - End Property - - Public Property IconMonthPrio() As Boolean - Get - Return _iconMonthPrio - End Get - Set(ByVal value As Boolean) - _iconMonthPrio = value - End Set - End Property - - Public Property EventsCustomField2() As Boolean - Get - Return _eventsCustomField2 - End Get - Set(ByVal value As Boolean) - _eventsCustomField2 = value - End Set - End Property - - Public Property EventsCustomField1() As Boolean - Get - Return _eventsCustomField1 - End Get - Set(ByVal value As Boolean) - _eventsCustomField1 = value - End Set - End Property - - Public Property DetailPageAllowed() As Boolean - Get - Return _detailPageAllowed - End Get - Set(ByVal value As Boolean) - _detailPageAllowed = value - End Set - End Property - - Public Property EnrollmentPageAllowed() As Boolean - Get - Return _enrollmentPageAllowed - End Get - Set(ByVal value As Boolean) - _enrollmentPageAllowed = value - End Set - End Property - - Public Property EnrollmentPageDefaultUrl() As String - Get - Return _enrollmentPageDefaultUrl - End Get - Set(ByVal value As String) - _enrollmentPageDefaultUrl = value - End Set - End Property - - Public Property Enrolcanceldays() As Integer - Get - Return _enrolcanceldays - End Get - Set(ByVal value As Integer) - _enrolcanceldays = value - End Set - End Property - - Public Property Maxnoenrolees() As Integer - Get - Return _maxnoenrolees - End Get - Set(ByVal value As Integer) - _maxnoenrolees = value - End Set - End Property - - Public Property Eventhidefullenroll() As Boolean - Get - Return _eventhidefullenroll - End Get - Set(ByVal value As Boolean) - _eventhidefullenroll = value - End Set - End Property - - Public Property EnrollAnonFields() As String - Get - Return _enrollAnonFields - End Get - Set(ByVal value As String) - _enrollAnonFields = value - End Set - End Property - - Public Property EnrollViewFields() As String - Get - Return _enrollViewFields - End Get - Set(ByVal value As String) - _enrollViewFields = value - End Set - End Property - - Public Property EnrollEditFields() As String - Get - Return _enrollEditFields - End Get - Set(ByVal value As String) - _enrollEditFields = value - End Set - End Property - - Public Property IconBar() As String - Get - Return _iconBar - End Get - Set(ByVal value As String) - _iconBar = value - End Set - End Property - - Public Property EventImageWeek() As Boolean - Get - Return _eventImageWeek - End Get - Set(ByVal value As Boolean) - _eventImageWeek = value - End Set - End Property - - Public Property EventImageMonth() As Boolean - Get - Return _eventImageMonth - End Get - Set(ByVal value As Boolean) - _eventImageMonth = value - End Set - End Property - - Public Property ListAllowed() As Boolean - Get - Return _listAllowed - End Get - Set(ByVal value As Boolean) - _listAllowed = value - End Set - End Property - - Public Property WeekAllowed() As Boolean - Get - Return _weekAllowed - End Get - Set(ByVal value As Boolean) - _weekAllowed = value - End Set - End Property - - Public Property MonthAllowed() As Boolean - Get - Return _monthAllowed - End Get - Set(ByVal value As Boolean) - _monthAllowed = value - End Set - End Property - - Public Property Exportanonowneremail() As Boolean - Get - Return _exportanonowneremail - End Get - Set(ByVal value As Boolean) - _exportanonowneremail = value - End Set - End Property - - Public Property Exportowneremail() As Boolean - Get - Return _exportowneremail - End Get - Set(ByVal value As Boolean) - _exportowneremail = value - End Set - End Property - - Public Property Expireevents() As String - Get - Return _expireevents - End Get - Set(ByVal value As String) - _expireevents = value - End Set - End Property - - Public Property RSSDesc() As String - Get - If _rssDesc = Nothing And Not _localresourcefile Is Nothing Then - _rssDesc = Localization.GetString("RSSFeedDescDefault", _localresourcefile) - End If - Return _rssDesc - End Get - Set(ByVal value As String) - _rssDesc = value - End Set - End Property - - Public Property RSSTitle() As String - Get - If _rssTitle = Nothing And Not _localresourcefile Is Nothing Then - _rssTitle = Localization.GetString("RSSFeedTitleDefault", _localresourcefile) - End If - Return _rssTitle - End Get - Set(ByVal value As String) - _rssTitle = value - End Set - End Property - - Public Property RSSDays() As Integer - Get - Return _rssDays - End Get - Set(ByVal value As Integer) - _rssDays = value - End Set - End Property - - Public Property RSSDateField() As String - Get - Return _rssDateField - End Get - Set(ByVal value As String) - _rssDateField = value - End Set - End Property - - Public Property RSSEnable() As Boolean - Get - Return _rssEnable - End Get - Set(ByVal value As Boolean) - _rssEnable = value - End Set - End Property - - Public Property EventsListSortDirection() As String - Get - Return _eventsListSortDirection - End Get - Set(ByVal value As String) - _eventsListSortDirection = value - End Set - End Property - - Public Property EventsListPageSize() As Integer - Get - Return _eventsListPageSize - End Get - Set(ByVal value As Integer) - _eventsListPageSize = value - End Set - End Property - - Public Property EventsListEventDays() As Integer - Get - Return _eventsListEventDays - End Get - Set(ByVal value As Integer) - _eventsListEventDays = value - End Set - End Property - - Public Property EventsListNumEvents() As Integer - Get - Return _eventsListNumEvents - End Get - Set(ByVal value As Integer) - _eventsListNumEvents = value - End Set - End Property - - Public Property EventsListSelectType() As String - Get - Return _eventsListSelectType - End Get - Set(ByVal value As String) - _eventsListSelectType = value - End Set - End Property - - Public Property Reminderfrom() As String - Get - If _reminderfrom Is Nothing Then - Dim portalsettings As Entities.Portals.PortalSettings = Entities.Portals.PortalController.GetCurrentPortalSettings - If Not portalsettings Is Nothing Then - _reminderfrom = portalsettings.Email - End If - End If - Return _reminderfrom - End Get - Set(ByVal value As String) - _reminderfrom = value - End Set - End Property - - Public Property Moderateall() As Boolean - Get - Return _moderateall - End Get - Set(ByVal value As Boolean) - _moderateall = value - End Set - End Property - - Public Property Paypalaccount() As String - Get - If _paypalaccount Is Nothing Then - Dim portalsettings As Entities.Portals.PortalSettings = Entities.Portals.PortalController.GetCurrentPortalSettings - If Not portalsettings Is Nothing Then - _paypalaccount = portalsettings.Email - End If - End If - Return _paypalaccount - End Get - Set(ByVal value As String) - _paypalaccount = value - End Set - End Property - - Public Property Eventdefaultenrollview() As Boolean - Get - Return _eventdefaultenrollview - End Get - Set(ByVal value As Boolean) - _eventdefaultenrollview = value - End Set - End Property - - Public Property Fridayweekend() As Boolean - Get - Return _fridayweekend - End Get - Set(ByVal value As Boolean) - _fridayweekend = value - End Set - End Property - - Public Property Enforcesubcalperms() As Boolean - Get - Return _enforcesubcalperms - End Get - Set(ByVal value As Boolean) - _enforcesubcalperms = value - End Set - End Property - - Public Property Addsubmodulename() As Boolean - Get - Return _addsubmodulename - End Get - Set(ByVal value As Boolean) - _addsubmodulename = value - End Set - End Property - - Public Property MasterEvent() As Boolean - Get - Return _masterEvent - End Get - Set(ByVal value As Boolean) - _masterEvent = value - End Set - End Property - - Public Property Monthdayselect() As Boolean - Get - Return _monthdayselect - End Get - Set(ByVal value As Boolean) - _monthdayselect = value - End Set - End Property - - Public Property Timeintitle() As Boolean - Get - Return _timeintitle - End Get - Set(ByVal value As Boolean) - _timeintitle = value - End Set - End Property - - Public Property ShowEventsAlways() As Boolean - Get - Return _showEventsAlways - End Get - Set(ByVal value As Boolean) - _showEventsAlways = value - End Set - End Property - - Public Property Locationconflict() As Boolean - Get - Return _locationconflict - End Get - Set(ByVal value As Boolean) - _locationconflict = value - End Set - End Property - - Public Property Preventconflicts() As Boolean - Get - Return _preventconflicts - End Get - Set(ByVal value As Boolean) - _preventconflicts = value - End Set - End Property - - Public Property Eventsearch() As Boolean - Get - Return _eventsearch - End Get - Set(ByVal value As Boolean) - _eventsearch = value - End Set - End Property - - Public Property Allowreoccurring() As Boolean - Get - Return _allowreoccurring - End Get - Set(ByVal value As Boolean) - _allowreoccurring = value - End Set - End Property - - Public Property Eventimage() As Boolean - Get - Return _eventimage - End Get - Set(ByVal value As Boolean) - _eventimage = value - End Set - End Property - - Public Property Showvaluemarks() As Boolean - Get - Return _showvaluemarks - End Get - Set(ByVal value As Boolean) - _showvaluemarks = value - End Set - End Property - - Public Property Includeendvalue() As Boolean - Get - Return _includeendvalue - End Get - Set(ByVal value As Boolean) - _includeendvalue = value - End Set - End Property - - Public Property Fulltimescale() As Boolean - Get - Return _fulltimescale - End Get - Set(ByVal value As Boolean) - _fulltimescale = value - End Set - End Property - - Public Property Collapserecurring() As Boolean - Get - Return _collapserecurring - End Get - Set(ByVal value As Boolean) - _collapserecurring = value - End Set - End Property - - Public Property DisableEventnav() As Boolean - Get - Return _disableEventnav - End Get - Set(ByVal value As Boolean) - _disableEventnav = value - End Set - End Property - - Public Property Paypalurl() As String - Get - Return _paypalurl - End Get - Set(ByVal value As String) - _paypalurl = value - End Set - End Property - - Public Property Tzdisplay() As Boolean - Get - Return _tzdisplay - End Get - Set(ByVal value As Boolean) - _tzdisplay = value - End Set - End Property - - Public Property Newpereventemail() As Boolean - Get - Return _newpereventemail - End Get - Set(ByVal value As Boolean) - _newpereventemail = value - End Set - End Property - - Public Property Neweventemailrole() As Integer - Get - If _neweventemailrole < 0 Then - Dim portalsettings As Entities.Portals.PortalSettings = Entities.Portals.PortalController.GetCurrentPortalSettings - If Not portalsettings Is Nothing Then - _neweventemailrole = portalsettings.RegisteredRoleId - End If - End If - Return _neweventemailrole - End Get - Set(ByVal value As Integer) - _neweventemailrole = value - End Set - End Property - - Public Property Neweventemails() As String - Get - Return _neweventemails - End Get - Set(ByVal value As String) - _neweventemails = value - End Set - End Property - - Public Property Sendreminderdefault() As Boolean - Get - Return _sendreminderdefault - End Get - Set(ByVal value As Boolean) - _sendreminderdefault = value - End Set - End Property - - Public Property Notifyanon() As Boolean - Get - Return _notifyanon - End Get - Set(ByVal value As Boolean) - _notifyanon = value - End Set - End Property - - Public Property Eventnotify() As Boolean - Get - Return _eventnotify - End Get - Set(ByVal value As Boolean) - _eventnotify = value - End Set - End Property - - Public Property DefaultView() As String - Get - Return _defaultView - End Get - Set(ByVal value As String) - _defaultView = value - End Set - End Property - - Public Property Eventdaynewpage() As Boolean - Get - Return _eventdaynewpage - End Get - Set(ByVal value As Boolean) - _eventdaynewpage = value - End Set - End Property - - Public Property Enableenrollpopup() As Boolean - Get - Return _enableenrollpopup - End Get - Set(ByVal value As Boolean) - _enableenrollpopup = value - End Set - End Property - - Public Property Maxrecurrences() As String - Get - Return _maxrecurrences - End Get - Set(ByVal value As String) - _maxrecurrences = value - End Set - End Property - - Public Property Version() As String - Get - Return _version - End Get - Set(ByVal value As String) - _version = value - End Set - End Property - - Public Property Timeinterval() As String - Get - Return _timeinterval - End Get - Set(ByVal value As String) - _timeinterval = value - End Set - End Property - - Private Property TimeZone() As String - Get - Return _timeZone - End Get - Set(ByVal value As String) - _timeZone = value - End Set - End Property - - Public Property TimeZoneId() As String - Get - If _timeZoneId Is Nothing Then - If _timeZone Is Nothing Then - Dim portalsettings As Entities.Portals.PortalSettings = Entities.Portals.PortalController.GetCurrentPortalSettings - If Not portalsettings Is Nothing Then - _timeZoneId = portalsettings.TimeZone.Id - End If - Else - _timeZoneId = Localization.ConvertLegacyTimeZoneOffsetToTimeZoneInfo(CInt(_timeZone)).Id - End If - End If - Return _timeZoneId - End Get - Set(ByVal value As String) - _timeZoneId = value - End Set - End Property - - Public Property EnableEventTimeZones() As Boolean - Get - Return _enableEventTimeZones - End Get - Set(ByVal value As Boolean) - _enableEventTimeZones = value - End Set - End Property - - Public Property PrimaryTimeZone() As TimeZones - Get - Return _primaryTimeZone - End Get - Set(ByVal value As TimeZones) - _primaryTimeZone = value - End Set - End Property - - Public Property SecondaryTimeZone() As TimeZones - Get - Return _secondaryTimeZone - End Get - Set(ByVal value As TimeZones) - _secondaryTimeZone = value - End Set - End Property - - Public Property Eventtooltiplist() As Boolean - Get - Return _eventtooltiplist - End Get - Set(ByVal value As Boolean) - _eventtooltiplist = value - End Set - End Property - - Public Property Eventtooltipday() As Boolean - Get - Return _eventtooltipday - End Get - Set(ByVal value As Boolean) - _eventtooltipday = value - End Set - End Property - - Public Property Eventtooltipweek() As Boolean - Get - Return _eventtooltipweek - End Get - Set(ByVal value As Boolean) - _eventtooltipweek = value - End Set - End Property - - Public Property Eventtooltipmonth() As Boolean - Get - Return _eventtooltipmonth - End Get - Set(ByVal value As Boolean) - _eventtooltipmonth = value - End Set - End Property - - Public Property Eventtooltiplength() As Integer - Get - Return _eventtooltiplength - End Get - Set(ByVal value As Integer) - _eventtooltiplength = value - End Set - End Property - - Public Property Monthcellnoevents() As Boolean - Get - Return _monthcellnoevents - End Get - Set(ByVal value As Boolean) - _monthcellnoevents = value - End Set - End Property - - Public Property Restrictcategories() As Boolean - Get - Return _restrictcategories - End Get - Set(ByVal value As Boolean) - _restrictcategories = value - End Set - End Property - - Public Property RestrictCategoriesToTimeFrame() As Boolean - Get - Return _restrictcategoriestotimeframe - End Get - Set(ByVal value As Boolean) - _restrictcategoriestotimeframe = value - End Set - End Property - - Public Property Enablecategories() As DisplayCategories - Get - If _enablecategories = 0 Then - If _disablecategories Then - Return DisplayCategories.DoNotDisplay - Else - Return DisplayCategories.MultiSelect - End If - Else - Return _enablecategories - End If - End Get - Set(ByVal value As DisplayCategories) - _enablecategories = value - End Set - End Property - - Public Property Restrictlocations() As Boolean - Get - Return _restrictlocations - End Get - Set(ByVal value As Boolean) - _restrictlocations = value - End Set - End Property - - Public Property RestrictLocationsToTimeFrame() As Boolean - Get - Return _restrictlocationstotimeframe - End Get - Set(ByVal value As Boolean) - _restrictlocationstotimeframe = value - End Set - End Property - - Public Property Enablelocations() As DisplayLocations - Get - If _enablelocations = 0 Then - If _disablelocations Then - Return DisplayLocations.DoNotDisplay - Else - Return DisplayLocations.MultiSelect - End If - Else - Return _enablelocations - End If - End Get - Set(ByVal value As DisplayLocations) - _enablelocations = value - End Set - End Property - - Public Property Enablecontainerskin() As Boolean - Get - Return _enablecontainerskin - End Get - Set(ByVal value As Boolean) - _enablecontainerskin = value - End Set - End Property - - Public Property Eventdetailnewpage() As Boolean - Get - Return _eventdetailnewpage - End Get - Set(ByVal value As Boolean) - _eventdetailnewpage = value - End Set - End Property - - Public Property Ownerchangeallowed() As Boolean - Get - Return _ownerchangeallowed - End Get - Set(ByVal value As Boolean) - _ownerchangeallowed = value - End Set - End Property - - Public Property Eventsignupallowpaid() As Boolean - Get - Return _eventsignupallowpaid - End Get - Set(ByVal value As Boolean) - _eventsignupallowpaid = value - End Set - End Property - - Public Property Eventsignup() As Boolean - Get - Return _eventsignup - End Get - Set(ByVal value As Boolean) - _eventsignup = value - End Set - End Property - - Public Property SendEnrollMessageApproved() As Boolean - Get - Return _sendEnrollMessageApproved - End Get - Set(ByVal value As Boolean) - _sendEnrollMessageApproved = value - End Set - End Property - - Public Property SendEnrollMessageWaiting() As Boolean - Get - Return _sendEnrollMessageWaiting - End Get - Set(ByVal value As Boolean) - _sendEnrollMessageWaiting = value - End Set - End Property - - Public Property SendEnrollMessageDenied() As Boolean - Get - Return _sendEnrollMessageDenied - End Get - Set(ByVal value As Boolean) - _sendEnrollMessageDenied = value - End Set - End Property - - Public Property SendEnrollMessageAdded() As Boolean - Get - Return _sendEnrollMessageAdded - End Get - Set(ByVal value As Boolean) - _sendEnrollMessageAdded = value - End Set - End Property - - Public Property SendEnrollMessageDeleted() As Boolean - Get - Return _sendEnrollMessageDeleted - End Get - Set(ByVal value As Boolean) - _sendEnrollMessageDeleted = value - End Set - End Property - - Public Property SendEnrollMessagePaying() As Boolean - Get - Return _sendEnrollMessagePaying - End Get - Set(ByVal value As Boolean) - _sendEnrollMessagePaying = value - End Set - End Property - - Public Property SendEnrollMessagePending() As Boolean - Get - Return _sendEnrollMessagePending - End Get - Set(ByVal value As Boolean) - _sendEnrollMessagePending = value - End Set - End Property - - Public Property SendEnrollMessagePaid() As Boolean - Get - Return _sendEnrollMessagePaid - End Get - Set(ByVal value As Boolean) - _sendEnrollMessagePaid = value - End Set - End Property - - Public Property SendEnrollMessageIncorrect() As Boolean - Get - Return _sendEnrollMessageIncorrect - End Get - Set(ByVal value As Boolean) - _sendEnrollMessageIncorrect = value - End Set - End Property - - Public Property SendEnrollMessageCancelled() As Boolean - Get - Return _sendEnrollMessageCancelled - End Get - Set(ByVal value As Boolean) - _sendEnrollMessageCancelled = value - End Set - End Property - - Public Property AllowAnonEnroll() As Boolean - Get - Return _allowanonenroll - End Get - Set(ByVal value As Boolean) - _allowanonenroll = value - End Set - End Property - - Public Property SocialGroupModule() As SocialModule - Get - Return _socialGroupModule - End Get - Set(ByVal value As SocialModule) - _socialGroupModule = value - End Set - End Property - - Public Property SocialUserPrivate() As Boolean - Get - Return _socialUserPrivate - End Get - Set(ByVal value As Boolean) - _socialUserPrivate = value - End Set - End Property - - Public Property SocialGroupSecurity() As SocialGroupPrivacy - Get - Return _socialGroupSecurity - End Get - Set(ByVal value As SocialGroupPrivacy) - _socialGroupSecurity = value - End Set - End Property - - Public Property EnrolListSortDirection() As SortDirection - Get - Return _enrolListSortDirection - End Get - Set(ByVal value As SortDirection) - _enrolListSortDirection = value - End Set - End Property - - Public Property EnrolListDaysBefore() As Integer - Get - Return _enrolListDaysBefore - End Get - Set(ByVal value As Integer) - _enrolListDaysBefore = value - End Set - End Property - - Public Property EnrolListDaysAfter() As Integer - Get - Return _enrolListDaysAfter - End Get - Set(ByVal value As Integer) - _enrolListDaysAfter = value - End Set - End Property - - Public Property JournalIntegration() As Boolean - Get - Return _journalIntegration - End Get - Set(ByVal value As Boolean) - _journalIntegration = value - End Set - End Property - - Public Property Templates() As EventTemplates - Get - Return _templates - End Get - Set(ByVal value As EventTemplates) - _templates = value - End Set - End Property - -#End Region - - End Class - -#End Region - -#Region "EventTemplates" - - - Public Class EventTemplates - -#Region " Private Members " - ' ReSharper disable InconsistentNaming - Private _EventDetailsTemplate As String = Nothing - Private _NewEventTemplate As String = Nothing - Private _txtToolTipTemplateTitleNT As String = Nothing - Private _txtToolTipTemplateBodyNT As String = Nothing - Private _txtToolTipTemplateTitle As String = Nothing - Private _txtToolTipTemplateBody As String = Nothing - Private _moderateemailsubject As String = Nothing - Private _moderateemailmessage As String = Nothing - Private _txtEmailSubject As String = Nothing - Private _txtEmailMessage As String = Nothing - Private _txtEnrollMessageSubject As String = Nothing - Private _txtEnrollMessageApproved As String = Nothing - Private _txtEnrollMessageWaiting As String = Nothing - Private _txtEnrollMessageDenied As String = Nothing - Private _txtEnrollMessageAdded As String = Nothing - Private _txtEnrollMessageDeleted As String = Nothing - Private _txtEnrollMessagePaying As String = Nothing - Private _txtEnrollMessagePending As String = Nothing - Private _txtEnrollMessagePaid As String = Nothing - Private _txtEnrollMessageIncorrect As String = Nothing - Private _txtEnrollMessageCancelled As String = Nothing - Private _txtEditViewEmailSubject As String = Nothing - Private _txtEditViewEmailBody As String = Nothing - Private _txtSubject As String = Nothing - Private _txtMessage As String = Nothing - Private _txtNewEventEmailSubject As String = Nothing - Private _txtNewEventEmailMessage As String = Nothing - Private _txtListEventTimeBegin As String = Nothing - Private _txtListEventTimeEnd As String = Nothing - Private _txtListLocation As String = Nothing - Private _txtListEventDescription As String = Nothing - Private _txtListRptHeader As String = Nothing - Private _txtListRptBody As String = Nothing - Private _txtListRptFooter As String = Nothing - Private _txtDayEventTimeBegin As String = Nothing - Private _txtDayEventTimeEnd As String = Nothing - Private _txtDayLocation As String = Nothing - Private _txtDayEventDescription As String = Nothing - Private _txtWeekEventText As String = Nothing - Private _txtWeekTitleDate As String = Nothing - Private _txtMonthEventText As String = Nothing - Private _txtMonthDayEventCount As String = Nothing - Private _txtRSSTitle As String = Nothing - Private _txtRSSDescription As String = Nothing - Private _txtSEOPageTitle As String = Nothing - Private _txtSEOPageDescription As String = Nothing - Private _EventiCalSubject As String = Nothing - Private _EventiCalBody As String = Nothing - ' ReSharper restore InconsistentNaming - -#End Region - -#Region " Constructors " - - Public Sub New(ByVal moduleID As Integer, ByVal allsettings As Hashtable, ByVal localResourceFile As String) - - Dim t As Type = Me.GetType - Dim p As System.Reflection.PropertyInfo - For Each p In t.GetProperties - Dim pn As String = p.Name - Dim pv As String = Nothing - If Not allsettings.Item(pn) Is Nothing Then - pv = CType(allsettings.Item(pn), String) - If Len(pv) > 1900 Then - If Not allsettings.Item(pn + "2") Is Nothing Then - pv = pv + CType(allsettings.Item(pn + "2"), String) - End If - End If - Else - If Not localResourceFile Is Nothing Then - pv = Localization.GetString(pn, localResourceFile) - If moduleID > 0 Then - SaveTemplate(moduleID, pn, pv) - End If - End If - End If - p.SetValue(Me, pv, Nothing) - Next - - End Sub - -#End Region - -#Region " Public Methods " - Public Function GetTemplate(ByVal templateName As String) As String - Dim t As Type = Me.GetType - Dim p As System.Reflection.PropertyInfo - For Each p In t.GetProperties - If p.Name = templateName Then - Return p.GetValue(Me, Nothing).ToString - End If - Next - Return "" - End Function - - Public Sub SaveTemplate(ByVal moduleID As Integer, ByVal templateName As String, ByVal templateValue As String) - Dim t As Type = Me.GetType - Dim p As System.Reflection.PropertyInfo - For Each p In t.GetProperties - If p.Name = templateName Then - p.SetValue(Me, templateValue, Nothing) - Dim objModules As New ModuleController - - If Len(templateValue) > 2000 Then - objModules.UpdateModuleSetting(moduleID, templateName, Left(templateValue, 2000)) - objModules.UpdateModuleSetting(moduleID, templateName + "2", Mid(templateValue, 2001)) - Else - objModules.UpdateModuleSetting(moduleID, templateName, templateValue.Trim) - objModules.DeleteModuleSetting(moduleID, templateName + "2") - End If - End If - Next - Dim cacheKey As String = "EventsSettings" & moduleID.ToString - ClearCache(cacheKey) - End Sub - - Public Sub ResetTemplate(ByVal moduleID As Integer, ByVal templateName As String, ByVal localResourceFile As String) - Dim templateValue As String = Localization.GetString(templateName, localResourceFile) - SaveTemplate(moduleID, templateName, templateValue) - - End Sub - -#End Region - -#Region " Private Methods " - -#End Region - -#Region " Properties " - ' ReSharper disable InconsistentNaming - Public Property EventDetailsTemplate() As String - Get - Return _EventDetailsTemplate - End Get - Set(ByVal value As String) - _EventDetailsTemplate = value - End Set - End Property - - Public Property NewEventTemplate() As String - Get - Return _NewEventTemplate - End Get - Set(ByVal value As String) - _NewEventTemplate = value - End Set - End Property - - Public Property txtTooltipTemplateTitleNT() As String - Get - Return _txtToolTipTemplateTitleNT - End Get - Set(ByVal value As String) - _txtToolTipTemplateTitleNT = value - End Set - End Property - - Public Property txtTooltipTemplateBodyNT() As String - Get - Return _txtToolTipTemplateBodyNT - End Get - Set(ByVal value As String) - _txtToolTipTemplateBodyNT = value - End Set - End Property - - Public Property txtTooltipTemplateTitle() As String - Get - Return _txtToolTipTemplateTitle - End Get - Set(ByVal value As String) - _txtToolTipTemplateTitle = value - End Set - End Property - - Public Property txtTooltipTemplateBody() As String - Get - Return _txtToolTipTemplateBody - End Get - Set(ByVal value As String) - _txtToolTipTemplateBody = value - End Set - End Property - - Public Property moderateemailsubject() As String - Get - Return _moderateemailsubject - End Get - Set(ByVal value As String) - _moderateemailsubject = value - End Set - End Property - - Public Property moderateemailmessage() As String - Get - Return _moderateemailmessage - End Get - Set(ByVal value As String) - _moderateemailmessage = value - End Set - End Property - - Public Property txtEmailSubject() As String - Get - Return _txtEmailSubject - End Get - Set(ByVal value As String) - _txtEmailSubject = value - End Set - End Property - - Public Property txtEmailMessage() As String - Get - Return _txtEmailMessage - End Get - Set(ByVal value As String) - _txtEmailMessage = value - End Set - End Property - - Public Property txtEnrollMessageSubject() As String - Get - Return _txtEnrollMessageSubject - End Get - Set(ByVal value As String) - _txtEnrollMessageSubject = value - End Set - End Property - - Public Property txtEnrollMessageApproved() As String - Get - Return _txtEnrollMessageApproved - End Get - Set(ByVal value As String) - _txtEnrollMessageApproved = value - End Set - End Property - - Public Property txtEnrollMessageWaiting() As String - Get - Return _txtEnrollMessageWaiting - End Get - Set(ByVal value As String) - _txtEnrollMessageWaiting = value - End Set - End Property - - Public Property txtEnrollMessageDenied() As String - Get - Return _txtEnrollMessageDenied - End Get - Set(ByVal value As String) - _txtEnrollMessageDenied = value - End Set - End Property - - Public Property txtEnrollMessageAdded() As String - Get - Return _txtEnrollMessageAdded - End Get - Set(ByVal value As String) - _txtEnrollMessageAdded = value - End Set - End Property - - Public Property txtEnrollMessageDeleted() As String - Get - Return _txtEnrollMessageDeleted - End Get - Set(ByVal value As String) - _txtEnrollMessageDeleted = value - End Set - End Property - - Public Property txtEnrollMessagePaying() As String - Get - Return _txtEnrollMessagePaying - End Get - Set(ByVal value As String) - _txtEnrollMessagePaying = value - End Set - End Property - - Public Property txtEnrollMessagePending() As String - Get - Return _txtEnrollMessagePending - End Get - Set(ByVal value As String) - _txtEnrollMessagePending = value - End Set - End Property - - Public Property txtEnrollMessagePaid() As String - Get - Return _txtEnrollMessagePaid - End Get - Set(ByVal value As String) - _txtEnrollMessagePaid = value - End Set - End Property - - Public Property txtEnrollMessageIncorrect() As String - Get - Return _txtEnrollMessageIncorrect - End Get - Set(ByVal value As String) - _txtEnrollMessageIncorrect = value - End Set - End Property - - Public Property txtEnrollMessageCancelled() As String - Get - Return _txtEnrollMessageCancelled - End Get - Set(ByVal value As String) - _txtEnrollMessageCancelled = value - End Set - End Property - - Public Property txtEditViewEmailSubject() As String - Get - Return _txtEditViewEmailSubject - End Get - Set(ByVal value As String) - _txtEditViewEmailSubject = value - End Set - End Property - - Public Property txtEditViewEmailBody() As String - Get - Return _txtEditViewEmailBody - End Get - Set(ByVal value As String) - _txtEditViewEmailBody = value - End Set - End Property - - Public Property txtSubject() As String - Get - Return _txtSubject - End Get - Set(ByVal value As String) - _txtSubject = value - End Set - End Property - - Public Property txtMessage() As String - Get - Return _txtMessage - End Get - Set(ByVal value As String) - _txtMessage = value - End Set - End Property - - Public Property txtNewEventEmailSubject() As String - Get - Return _txtNewEventEmailSubject - End Get - Set(ByVal value As String) - _txtNewEventEmailSubject = value - End Set - End Property - - Public Property txtNewEventEmailMessage() As String - Get - Return _txtNewEventEmailMessage - End Get - Set(ByVal value As String) - _txtNewEventEmailMessage = value - End Set - End Property - - Public Property txtListEventTimeBegin() As String - Get - Return _txtListEventTimeBegin - End Get - Set(ByVal value As String) - _txtListEventTimeBegin = value - End Set - End Property - - Public Property txtListEventTimeEnd() As String - Get - Return _txtListEventTimeEnd - End Get - Set(ByVal value As String) - _txtListEventTimeEnd = value - End Set - End Property - - Public Property txtListLocation() As String - Get - Return _txtListLocation - End Get - Set(ByVal value As String) - _txtListLocation = value - End Set - End Property - - Public Property txtListEventDescription() As String - Get - Return _txtListEventDescription - End Get - Set(ByVal value As String) - _txtListEventDescription = value - End Set - End Property - - Public Property txtListRptHeader() As String - Get - Return _txtListRptHeader - End Get - Set(ByVal value As String) - _txtListRptHeader = value - End Set - End Property - - Public Property txtListRptBody() As String - Get - Return _txtListRptBody - End Get - Set(ByVal value As String) - _txtListRptBody = value - End Set - End Property - - Public Property txtListRptFooter() As String - Get - Return _txtListRptFooter - End Get - Set(ByVal value As String) - _txtListRptFooter = value - End Set - End Property - - Public Property txtDayEventTimeBegin() As String - Get - Return _txtDayEventTimeBegin - End Get - Set(ByVal value As String) - _txtDayEventTimeBegin = value - End Set - End Property - - Public Property txtDayEventTimeEnd() As String - Get - Return _txtDayEventTimeEnd - End Get - Set(ByVal value As String) - _txtDayEventTimeEnd = value - End Set - End Property - - Public Property txtDayLocation() As String - Get - Return _txtDayLocation - End Get - Set(ByVal value As String) - _txtDayLocation = value - End Set - End Property - - Public Property txtDayEventDescription() As String - Get - Return _txtDayEventDescription - End Get - Set(ByVal value As String) - _txtDayEventDescription = value - End Set - End Property - - Public Property txtWeekEventText() As String - Get - Return _txtWeekEventText - End Get - Set(ByVal value As String) - _txtWeekEventText = value - End Set - End Property - - Public Property txtWeekTitleDate() As String - Get - Return _txtWeekTitleDate - End Get - Set(ByVal value As String) - _txtWeekTitleDate = value - End Set - End Property - - Public Property txtMonthEventText() As String - Get - Return _txtMonthEventText - End Get - Set(ByVal value As String) - _txtMonthEventText = value - End Set - End Property - - Public Property txtMonthDayEventCount() As String - Get - Return _txtMonthDayEventCount - End Get - Set(ByVal value As String) - _txtMonthDayEventCount = value - End Set - End Property - - Public Property txtRSSTitle() As String - Get - Return _txtRSSTitle - End Get - Set(ByVal value As String) - _txtRSSTitle = value - End Set - End Property - - Public Property txtRSSDescription() As String - Get - Return _txtRSSDescription - End Get - Set(ByVal value As String) - _txtRSSDescription = value - End Set - End Property - - Public Property txtSEOPageTitle() As String - Get - Return _txtSEOPageTitle - End Get - Set(ByVal value As String) - _txtSEOPageTitle = value - End Set - End Property - - Public Property txtSEOPageDescription() As String - Get - Return _txtSEOPageDescription - End Get - Set(ByVal value As String) - _txtSEOPageDescription = value - End Set - End Property - - Public Property EventiCalSubject() As String - Get - Return _EventiCalSubject - End Get - Set(ByVal value As String) - _EventiCalSubject = value - End Set - End Property - - Public Property EventiCalBody() As String - Get - Return _EventiCalBody - End Get - Set(ByVal value As String) - _EventiCalBody = value - End Set - End Property - ' ReSharper restore InconsistentNaming - -#End Region - - End Class -#End Region - -End Namespace diff --git a/Components/EventModuleSettingsInfo.cs b/Components/EventModuleSettingsInfo.cs new file mode 100644 index 0000000..fb1b271 --- /dev/null +++ b/Components/EventModuleSettingsInfo.cs @@ -0,0 +1,504 @@ +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Web; +//using DotNetNuke.Entities.Modules.Settings; + +//namespace Components +//{ +// using System.Collections; +// using System.Web.UI.WebControls; +// using DotNetNuke.Modules.Events; + +// public class EventModuleSettingsInfo +// { +// [ModuleSetting] +// public int _moduleID { get; set; } = -1; + +// [ModuleSetting] +// public string _localresourcefile { get; set; } = null; + +// [ModuleSetting] +// public string _version { get; set; } = ""; + +// [ModuleSetting] +// public bool _ownerchangeallowed { get; set; } = false; + +// [ModuleSetting] +// public bool _eventsignup { get; set; } = false; + +// [ModuleSetting] +// public bool _eventsignupallowpaid { get; set; } = true; + +// [ModuleSetting] +// public string _timeinterval { get; set; } = "30"; + +// [ModuleSetting] +// public string _timeZone { get; set; } = null; + +// [ModuleSetting] +// public string _timeZoneId { get; set; } = null; + +// [ModuleSetting] +// public bool _enableEventTimeZones { get; set; } = false; + +// [ModuleSetting] +// public EventModuleSettings.TimeZones _primaryTimeZone { get; set; } = EventModuleSettings.TimeZones.UserTZ; + +// [ModuleSetting] +// public EventModuleSettings.TimeZones _secondaryTimeZone { get; set; } = EventModuleSettings.TimeZones.PortalTZ; + +// [ModuleSetting] +// public bool _eventtooltipmonth { get; set; } = true; + +// [ModuleSetting] +// public bool _eventtooltipweek { get; set; } = true; + +// [ModuleSetting] +// public bool _eventtooltipday { get; set; } = true; + +// [ModuleSetting] +// public bool _eventtooltiplist { get; set; } = true; + +// [ModuleSetting] +// public int _eventtooltiplength { get; set; } = 10000; + +// [ModuleSetting] +// public bool _monthcellnoevents { get; set; } = false; + +// [ModuleSetting] +// public bool _disablecategories { get; set; } = false; + +// [ModuleSetting] +// public EventModuleSettings.DisplayCategories _enablecategories { get; set; } = (EventModuleSettings.DisplayCategories)0; + +// [ModuleSetting] +// public bool _restrictcategories { get; set; } = false; + +// [ModuleSetting] +// public bool _restrictcategoriestotimeframe { get; set; } = false; + +// [ModuleSetting] +// public bool _disablelocations { get; set; } = false; + +// [ModuleSetting] +// public EventModuleSettings.DisplayLocations _enablelocations { get; set; } = (EventModuleSettings.DisplayLocations)0; + +// [ModuleSetting] +// public bool _restrictlocations { get; set; } = false; + +// [ModuleSetting] +// public bool _restrictlocationstotimeframe { get; set; } = false; + +// [ModuleSetting] +// public bool _enablecontainerskin { get; set; } = true; + +// [ModuleSetting] +// public bool _eventdetailnewpage { get; set; } = false; + +// [ModuleSetting] +// public string _maxrecurrences { get; set; } = "1000"; + +// [ModuleSetting] +// public bool _enableenrollpopup { get; set; } = true; + +// [ModuleSetting] +// public bool _eventdaynewpage { get; set; } = false; + +// [ModuleSetting] +// public string _defaultView { get; set; } = "EventMonth.ascx"; + +// [ModuleSetting] +// public bool _eventnotify { get; set; } = true; + +// [ModuleSetting] +// public bool _notifyanon { get; set; } = false; + +// [ModuleSetting] +// public bool _sendreminderdefault { get; set; } = false; + +// [ModuleSetting] +// public string _neweventemails { get; set; } = "Never"; + +// [ModuleSetting] +// public int _neweventemailrole { get; set; } = -1; + +// [ModuleSetting] +// public bool _newpereventemail { get; set; } = false; + +// [ModuleSetting] +// public bool _tzdisplay { get; set; } = false; + +// [ModuleSetting] +// public string _paypalurl { get; set; } = "https://www.paypal.com"; + +// [ModuleSetting] +// public bool _disableEventnav { get; set; } = false; + +// [ModuleSetting] +// public bool _collapserecurring { get; set; } = false; + +// [ModuleSetting] +// public bool _fulltimescale { get; set; } = false; + +// [ModuleSetting] +// public bool _includeendvalue { get; set; } = true; + +// [ModuleSetting] +// public bool _showvaluemarks { get; set; } = false; + +// [ModuleSetting] +// public bool _eventimage { get; set; } = true; + +// [ModuleSetting] +// public bool _allowreoccurring { get; set; } = true; + +// [ModuleSetting] +// public bool _eventsearch { get; set; } = true; + +// [ModuleSetting] +// public bool _preventconflicts { get; set; } = false; + +// [ModuleSetting] +// public bool _locationconflict { get; set; } = false; + +// [ModuleSetting] +// public bool _showEventsAlways { get; set; } = false; + +// [ModuleSetting] +// public bool _timeintitle { get; set; } = false; + +// [ModuleSetting] +// public bool _monthdayselect { get; set; } = false; + +// [ModuleSetting] +// public bool _masterEvent { get; set; } = false; + +// [ModuleSetting] +// public bool _addsubmodulename { get; set; } = true; + +// [ModuleSetting] +// public bool _enforcesubcalperms { get; set; } = true; + +// [ModuleSetting] +// public bool _fridayweekend { get; set; } = false; + +// [ModuleSetting] +// public bool _eventdefaultenrollview { get; set; } = false; + +// [ModuleSetting] +// public string _paypalaccount { get; set; } = null; + +// [ModuleSetting] +// public bool _moderateall { get; set; } = false; + +// [ModuleSetting] +// public string _reminderfrom { get; set; } = null; + +// [ModuleSetting] +// public string _eventsListSelectType { get; set; } = "EVENTS"; + +// [ModuleSetting] +// public int _eventsListNumEvents { get; set; } = 10; + +// [ModuleSetting] +// public int _eventsListEventDays { get; set; } = 365; + +// [ModuleSetting] +// public int _eventsListPageSize { get; set; } = 10; + +// [ModuleSetting] +// public string _eventsListSortDirection { get; set; } = "ASC"; + +// [ModuleSetting] +// public bool _rssEnable { get; set; } = false; + +// [ModuleSetting] +// public string _rssDateField { get; set; } = "UPDATEDDATE"; + +// [ModuleSetting] +// public int _rssDays { get; set; } = 365; + +// [ModuleSetting] +// public string _rssTitle { get; set; } = null; + +// [ModuleSetting] +// public string _rssDesc { get; set; } = null; + +// [ModuleSetting] +// public string _expireevents { get; set; } = ""; + +// [ModuleSetting] +// public bool _exportowneremail { get; set; } = false; + +// [ModuleSetting] +// public bool _exportanonowneremail { get; set; } = false; + +// [ModuleSetting] +// public bool _monthAllowed { get; set; } = true; + +// [ModuleSetting] +// public bool _weekAllowed { get; set; } = true; + +// [ModuleSetting] +// public bool _listAllowed { get; set; } = true; + +// [ModuleSetting] +// public bool _eventImageMonth { get; set; } = true; + +// [ModuleSetting] +// public bool _eventImageWeek { get; set; } = false; + +// [ModuleSetting] +// public string _iconBar { get; set; } = "TOP"; + +// [ModuleSetting] +// public string _enrollEditFields { get; set; } = "03;05;"; + +// [ModuleSetting] +// public string _enrollViewFields { get; set; } = ""; + +// [ModuleSetting] +// public string _enrollAnonFields { get; set; } = "02;06;"; + +// [ModuleSetting] +// public bool _eventhidefullenroll { get; set; } = false; + +// [ModuleSetting] +// public int _maxnoenrolees { get; set; } = 1; + +// [ModuleSetting] +// public int _enrolcanceldays { get; set; } = 0; + +// [ModuleSetting] +// public bool _detailPageAllowed { get; set; } = false; + +// [ModuleSetting] +// public bool _enrollmentPageAllowed { get; set; } = false; + +// [ModuleSetting] +// public string _enrollmentPageDefaultUrl { get; set; } = ""; + +// [ModuleSetting] +// public bool _eventsCustomField1 { get; set; } = false; + +// [ModuleSetting] +// public bool _eventsCustomField2 { get; set; } = false; + +// [ModuleSetting] +// public bool _iconMonthPrio { get; set; } = true; + +// [ModuleSetting] +// public bool _iconMonthRec { get; set; } = true; + +// [ModuleSetting] +// public bool _iconMonthReminder { get; set; } = true; + +// [ModuleSetting] +// public bool _iconMonthEnroll { get; set; } = true; + +// [ModuleSetting] +// public bool _iconWeekPrio { get; set; } = true; + +// [ModuleSetting] +// public bool _iconWeekRec { get; set; } = true; + +// [ModuleSetting] +// public bool _iconWeekReminder { get; set; } = true; + +// [ModuleSetting] +// public bool _iconWeekEnroll { get; set; } = true; + +// [ModuleSetting] +// public bool _iconListPrio { get; set; } = true; + +// [ModuleSetting] +// public bool _iconListRec { get; set; } = true; + +// [ModuleSetting] +// public bool _iconListReminder { get; set; } = true; + +// [ModuleSetting] +// public bool _iconListEnroll { get; set; } = true; + +// [ModuleSetting] +// public string _publicMessage { get; set; } = ""; + +// [ModuleSetting] +// public string _eventTheme { get; set; } = ""; + +// [ModuleSetting] +// public string _eventThemeDefault { get; set; } = "0,MinimalExtropy,"; + +// [ModuleSetting] +// public string _eventsListFields { get; set; } = "BD;ED;EN"; + +// [ModuleSetting] +// public string _eventsListShowHeader { get; set; } = "Yes"; + +// [ModuleSetting] +// public int _eventsListBeforeDays { get; set; } = 1; + +// [ModuleSetting] +// public int _eventsListAfterDays { get; set; } = 7; + +// [ModuleSetting] +// public string _recurDummy { get; set; } = null; + +// [ModuleSetting] +// public EventTemplates _templates { get; set; } + +// [ModuleSetting] +// public int ModuleCategoryID { get; set; } = -1; + +// [ModuleSetting] +// public ArrayList _moduleCategoryIDs { get; set; } = null; + +// [ModuleSetting] +// public EventModuleSettings.CategoriesSelected _moduleCategoriesSelected { get; set; } = EventModuleSettings.CategoriesSelected.All; + +// [ModuleSetting] +// public int ModuleLocationID { get; set; } = -1; + +// [ModuleSetting] +// public ArrayList _moduleLocationIDs { get; set; } = null; + +// [ModuleSetting] +// public EventModuleSettings.LocationsSelected _moduleLocationsSelected { get; set; } = EventModuleSettings.LocationsSelected.All; + +// [ModuleSetting] +// public string _eventsListSortColumn { get; set; } = "EventDateBegin"; + +// [ModuleSetting] +// public string _htmlEmail { get; set; } = "html"; + +// [ModuleSetting] +// public int _iCalDaysBefore { get; set; } = 365; + +// [ModuleSetting] +// public int _iCalDaysAfter { get; set; } = 365; + +// [ModuleSetting] +// public string _icalURLAppend { get; set; } = ""; + +// [ModuleSetting] +// public string _icalDefaultImage { get; set; } = ""; + +// [ModuleSetting] +// public bool _icalOnIconBar { get; set; } = false; + +// [ModuleSetting] +// public bool _icalEmailEnable { get; set; } = false; + +// [ModuleSetting] +// public bool _iIcalURLInLocation { get; set; } = true; + +// [ModuleSetting] +// public bool _iIcalIncludeCalname { get; set; } = false; + +// [ModuleSetting] +// public bool _enableSEO { get; set; } = true; + +// [ModuleSetting] +// public int _seoDescriptionLength { get; set; } = 256; + +// [ModuleSetting] +// public bool _enableSitemap { get; set; } = false; + +// [ModuleSetting] +// public float _siteMapPriority { get; set; } = (float)(0.5F); + +// [ModuleSetting] +// public int _siteMapDaysBefore { get; set; } = 365; + +// [ModuleSetting] +// public int _siteMapDaysAfter { get; set; } = 365; + +// [ModuleSetting] +// public bool _listViewGrid { get; set; } = true; + +// [ModuleSetting] +// public bool _listViewTable { get; set; } = true; + +// [ModuleSetting] +// public int _rptColumns { get; set; } = 1; + +// [ModuleSetting] +// public int _rptRows { get; set; } = 5; + +// [ModuleSetting] +// public System.Web.UI.WebControls.FirstDayOfWeek _weekStart { get; set; } = System.Web.UI.WebControls.FirstDayOfWeek.Default; + +// [ModuleSetting] +// public bool _listViewUseTime { get; set; } = false; + +// [ModuleSetting] +// public string _standardEmail { get; set; } = null; + +// [ModuleSetting] +// public string _fbAdmins { get; set; } = ""; + +// [ModuleSetting] +// public string _fbAppID { get; set; } = ""; + +// [ModuleSetting] +// public int _maxThumbWidth { get; set; } = 125; + +// [ModuleSetting] +// public int _maxThumbHeight { get; set; } = 125; + +// [ModuleSetting] +// public bool _sendEnrollMessageApproved { get; set; } = true; + +// [ModuleSetting] +// public bool _sendEnrollMessageWaiting { get; set; } = true; + +// [ModuleSetting] +// public bool _sendEnrollMessageDenied { get; set; } = true; + +// [ModuleSetting] +// public bool _sendEnrollMessageAdded { get; set; } = true; + +// [ModuleSetting] +// public bool _sendEnrollMessageDeleted { get; set; } = true; + +// [ModuleSetting] +// public bool _sendEnrollMessagePaying { get; set; } = true; + +// [ModuleSetting] +// public bool _sendEnrollMessagePending { get; set; } = true; + +// [ModuleSetting] +// public bool _sendEnrollMessagePaid { get; set; } = true; + +// [ModuleSetting] +// public bool _sendEnrollMessageIncorrect { get; set; } = true; + +// [ModuleSetting] +// public bool _sendEnrollMessageCancelled { get; set; } = true; + +// [ModuleSetting] +// public bool _allowanonenroll { get; set; } = false; + +// [ModuleSetting] +// public EventModuleSettings.SocialModule _socialGroupModule { get; set; } = EventModuleSettings.SocialModule.No; + +// [ModuleSetting] +// public SortDirection _enrolListSortDirection { get; set; } = SortDirection.Descending; + +// [ModuleSetting] +// public int _enrolListDaysBefore { get; set; } = (365 * 4) + 1; + +// [ModuleSetting] +// public int _enrolListDaysAfter { get; set; } = (365 * 4) + 1; + +// [ModuleSetting] +// public bool _journalIntegration { get; set; } = true; + +// [ModuleSetting] +// public bool _socialUserpublic { get; set; } = true; + +// [ModuleSetting] +// public EventModuleSettings.SocialGroupPrivacy _socialGroupSecurity { get; set; } = EventModuleSettings.SocialGroupPrivacy.EditByGroup; +// } +//} \ No newline at end of file diff --git a/Components/EventNotification.cs b/Components/EventNotification.cs new file mode 100644 index 0000000..6b794b9 --- /dev/null +++ b/Components/EventNotification.cs @@ -0,0 +1,334 @@ +using DotNetNuke.Services.Exceptions; +using Microsoft.VisualBasic; +using System.Collections; +using System.Web; +using DotNetNuke.Services.Localization; +using System; +using DotNetNuke.Entities.Portals; +using DotNetNuke.Entities.Modules; + + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events + { + public class EventNotification : Services.Scheduling.SchedulerClient + { + +#region Constructors + public EventNotification(Services.Scheduling.ScheduleHistoryItem objScheduleHistoryItem) + { + ScheduleHistoryItem = objScheduleHistoryItem; + } +#endregion + +#region Methods + public override void DoWork() + { + try + { + //notification that the event is progressing + Progressing(); //OPTIONAL + + string returnStrCleanup = ""; + returnStrCleanup = CleanupExpired(); + if (!string.IsNullOrEmpty(returnStrCleanup)) + { + ScheduleHistoryItem.AddLogNote("
" + returnStrCleanup + "
"); + } + + string returnStr = ""; + returnStr = SendEventNotifications(); + ScheduleHistoryItem.AddLogNote(returnStr); + + ScheduleHistoryItem.Succeeded = true; //REQUIRED + + } + catch (Exception exc) //REQUIRED + { + ScheduleHistoryItem.Succeeded = false; //REQUIRED + ScheduleHistoryItem.AddLogNote("Event Notification failed." + exc.ToString() + (int) DotNetNuke.Common.Globals.Status); //OPTIONAL + //notification that we have errored + Errored(ref exc); //REQUIRED + //log the exception + Exceptions.LogException(exc); //OPTIONAL + } + } + + private string SendEventNotifications() + { + EventController objEvents = new EventController(); + EventInfo objEvent = default(EventInfo); + EventNotificationController objEventNotifications = new EventNotificationController(); + ArrayList notifyEvents = default(ArrayList); + string returnStr = "Event Notification completed."; + + this.Status = "Sending Event Notifications"; + + //*** All Event Notifications are stored in UTC internally. + notifyEvents = objEventNotifications.EventsNotificationsToSend(DateTime.UtcNow); + + foreach (EventNotificationInfo objNotification in notifyEvents) + { + //Get the Associated Event + objEvent = objEvents.EventsGet(objNotification.EventID, objNotification.ModuleID); + + if (!(ReferenceEquals(objEvent, null))) + { + // Setup PortalSettings + PortalSettings portalSettings = CreatePortalSettings(objNotification.PortalAliasID, objNotification.TabID); + string folderName = DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", objEvent.PortalID).FolderName; + + if (!ReferenceEquals(portalSettings, null)) + { + // Make up the LocalResourceFile value + string templateSourceDirectory = Common.Globals.ApplicationPath; + string localResourceFile = templateSourceDirectory + "/DesktopModules/" + folderName + "/" + Localization.LocalResourceDirectory + "/EventNotification.ascx.resx"; + + // Send the email + EventEmailInfo objEventEmailInfo = new EventEmailInfo(); + EventEmails objEventEmail = new EventEmails(portalSettings.PortalId, objNotification.ModuleID, localResourceFile, objNotification.NotifyLanguage); + objEventEmailInfo.TxtEmailSubject = objEvent.Notify; + objEventEmailInfo.TxtEmailBody = objEvent.Reminder; + objEventEmailInfo.TxtEmailFrom = objEvent.ReminderFrom; + objEventEmailInfo.UserEmails.Add(objNotification.UserEmail); + objEventEmailInfo.UserLocales.Add(objNotification.NotifyLanguage); + objEventEmailInfo.UserTimeZoneIds.Add(objEvent.EventTimeZoneId); + string domainurl = portalSettings.PortalAlias.HTTPAlias; + if (domainurl.IndexOf("/", StringComparison.Ordinal) > 0) + { + domainurl = domainurl.Substring(0, domainurl.IndexOf("/", StringComparison.Ordinal)); + } + + objEventEmail.SendEmails(objEventEmailInfo, objEvent, domainurl); + } + + //*** Update Notification (so we don't send again) + objNotification.NotificationSent = true; + objEventNotifications.EventsNotificationSave(objNotification); + returnStr = "Event Notification completed. " + notifyEvents.Count.ToString() + " Notification(s) sent!"; + } + } + + //**** Delete Expired EventNotifications (older than 30 days) + DateTime endDate = DateTime.UtcNow.AddDays(-30); + objEventNotifications.EventsNotificationDelete(endDate); + + this.Status = "Event Notifications Sent Successfully"; + ScheduleHistoryItem.Succeeded = true; + return returnStr; + + } + + private string CleanupExpired() + { + string returnStr = "Event Cleanup completed."; + int noDeletedEvents = 0; + + this.Status = "Performing Event Cleanup"; + + DesktopModuleInfo objDesktopModule = default(DesktopModuleInfo); + objDesktopModule = DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", 0); + + if (ReferenceEquals(objDesktopModule, null)) + { + return "Module Definition 'DNN_Events' not found. Cleanup cannot be performed."; + } + + this.Status = "Performing Event Cleanup: Dummy"; + this.Status = "Performing Event Cleanup:" + objDesktopModule.FriendlyName; + + Entities.Portals.PortalController objPortals = new Entities.Portals.PortalController(); + Entities.Portals.PortalInfo objPortal = default(Entities.Portals.PortalInfo); + ModuleController objModules = new ModuleController(); + ModuleInfo objModule = default(ModuleInfo); + + ArrayList lstportals = objPortals.GetPortals(); + foreach (Entities.Portals.PortalInfo tempLoopVar_objPortal in lstportals) + { + objPortal = tempLoopVar_objPortal; + this.Status = "Performing Event Cleanup:" + objDesktopModule.FriendlyName + " PortalID: Dummy"; + this.Status = "Performing Event Cleanup:" + objDesktopModule.FriendlyName + " PortalID:" + objPortal.PortalID.ToString(); + + ArrayList lstModules = objModules.GetModulesByDefinition(objPortal.PortalID, objDesktopModule.FriendlyName); + foreach (ModuleInfo tempLoopVar_objModule in lstModules) + { + objModule = tempLoopVar_objModule; + // This check for objModule = Nothing because of error in DNN 5.0.0 in GetModulesByDefinition + if (ReferenceEquals(objModule, null)) + { + continue; + } + this.Status = "Performing Event Cleanup:" + objDesktopModule.FriendlyName + " PortalID:" + objPortal.PortalID.ToString() + " ModuleID: Dummy"; + this.Status = "Performing Event Cleanup:" + objDesktopModule.FriendlyName + " PortalID:" + objPortal.PortalID.ToString() + " ModuleID:" + objModule.ModuleID.ToString(); + + EventModuleSettings ems = new EventModuleSettings(); + EventModuleSettings settings = ems.GetEventModuleSettings(objModule.ModuleID, null); + if (settings.Expireevents != "") + { + this.Status = "Performing Event Cleanup:" + objDesktopModule.FriendlyName + " PortalID:" + objPortal.PortalID.ToString() + " ModuleID:" + objModule.ModuleID.ToString() + " IN PROGRESS"; + + EventController objEventCtl = new EventController(); + DateTime expireDate = DateAndTime.DateAdd(DateInterval.Day, - System.Convert.ToInt32(settings.Expireevents), DateTime.UtcNow); + DateTime startdate = expireDate.AddYears(-10); + DateTime endDate = expireDate.AddDays(1); + EventInfoHelper objEventInfoHelper = new EventInfoHelper(objModule.ModuleID, settings); + ArrayList categoryIDs = new ArrayList(); + categoryIDs.Add("-1"); + ArrayList locationIDs = new ArrayList(); + locationIDs.Add("-1"); + ArrayList lstEvents = objEventInfoHelper.GetEvents(startdate, endDate, false, categoryIDs, locationIDs, -1, -1); + + EventTimeZoneUtilities objEventTimeZoneUtilities = new EventTimeZoneUtilities(); + foreach (EventInfo objEvent in lstEvents) + { + DateTime eventTime = objEventTimeZoneUtilities.ConvertToUTCTimeZone(objEvent.EventTimeEnd, objEvent.EventTimeZoneId); + if (eventTime < expireDate) + { + objEvent.Cancelled = true; + objEventCtl.EventsSave(objEvent, true, 0, true); + noDeletedEvents++; + returnStr = "Event Cleanup completed. " + noDeletedEvents.ToString() + " Events deleted."; + } + } + objEventCtl.EventsCleanupExpired(objModule.PortalID, objModule.ModuleID); + } + } + } + this.Status = "Cleanup complete"; + return returnStr; + } + + public PortalSettings CreatePortalSettings(int portalAliasID, int tabID) + { + string cacheKey = "EventsPortalSettings" + portalAliasID.ToString(); + PortalSettings ps = new PortalSettings(); + PortalSettings pscache = (PortalSettings) (Common.Utilities.DataCache.GetCache(cacheKey)); + + if (ReferenceEquals(pscache, null)) + { + // Setup PortalSettings + PortalAliasController objPortalAliases = new PortalAliasController(); + PortalAliasInfo objPortalAlias = default(PortalAliasInfo); + + objPortalAlias = objPortalAliases.GetPortalAliasByPortalAliasID(portalAliasID); + if (ReferenceEquals(objPortalAlias, null)) + { + return null; + } + PortalController portalController = new PortalController(); + Entities.Portals.PortalInfo portal = portalController.GetPortal(objPortalAlias.PortalID); + + + ps.PortalAlias = objPortalAlias; + ps.PortalId = portal.PortalID; + ps.PortalName = portal.PortalName; + ps.LogoFile = portal.LogoFile; + ps.FooterText = portal.FooterText; + ps.ExpiryDate = portal.ExpiryDate; + ps.UserRegistration = portal.UserRegistration; + ps.BannerAdvertising = portal.BannerAdvertising; + ps.Currency = portal.Currency; + ps.AdministratorId = portal.AdministratorId; + ps.Email = portal.Email; + ps.HostFee = portal.HostFee; + ps.HostSpace = portal.HostSpace; + ps.PageQuota = portal.PageQuota; + ps.UserQuota = portal.UserQuota; + ps.AdministratorRoleId = portal.AdministratorRoleId; + ps.AdministratorRoleName = portal.AdministratorRoleName; + ps.RegisteredRoleId = portal.RegisteredRoleId; + ps.RegisteredRoleName = portal.RegisteredRoleName; + ps.Description = portal.Description; + ps.KeyWords = portal.KeyWords; + ps.BackgroundFile = portal.BackgroundFile; + ps.GUID = portal.GUID; + ps.SiteLogHistory = portal.SiteLogHistory; + ps.AdminTabId = portal.AdminTabId; + ps.SuperTabId = portal.SuperTabId; + ps.SplashTabId = portal.SuperTabId; + ps.HomeTabId = portal.HomeTabId; + ps.LoginTabId = portal.LoginTabId; + ps.UserTabId = portal.UserTabId; + ps.DefaultLanguage = portal.DefaultLanguage; + ps.Pages = portal.Pages; + ps.Users = portal.Users; + if (ps.HostSpace == null) + { + ps.HostSpace = 0; + } + if (ReferenceEquals(ps.DefaultLanguage, null)) + { + ps.DefaultLanguage = Localization.SystemLocale; + } + if (ReferenceEquals(ps.TimeZone, null)) + { + ps.TimeZone = TimeZoneInfo.FindSystemTimeZoneById(Localization.SystemTimeZone); + } + ps.HomeDirectory = Common.Globals.ApplicationPath + "/" + portal.HomeDirectory + "/"; + Common.Utilities.DataCache.SetCache(cacheKey, ps); + } + else + { + ps = pscache; + } + Entities.Tabs.TabController tabController = new Entities.Tabs.TabController(); + Entities.Tabs.TabInfo tab = tabController.GetTab(tabID, ps.PortalId, false); + if (ReferenceEquals(tab, null)) + { + return null; + } + ps.ActiveTab = tab; + + try + { + // Now to put it into the HTTPContext + if (ReferenceEquals(HttpContext.Current, null)) + { + string page = ps.PortalAlias.HTTPAlias; + string query = string.Empty; + System.IO.TextWriter output = null; + System.Web.Hosting.SimpleWorkerRequest workerrequest = new System.Web.Hosting.SimpleWorkerRequest(page, query, output); + HttpContext.Current = new HttpContext(workerrequest); + HttpContext.Current.Items.Add("PortalSettings", ps); + } + else + { + HttpContext.Current.Items.Remove("PortalSettings"); + HttpContext.Current.Items.Add("PortalSettings", ps); + } + } + catch (Exception) + { + } + + return ps; + } +#endregion + + } + + } + + diff --git a/Components/EventNotification.vb b/Components/EventNotification.vb deleted file mode 100644 index 94f2d90..0000000 --- a/Components/EventNotification.vb +++ /dev/null @@ -1,290 +0,0 @@ -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports System.Collections -Imports DotNetNuke.Entities.Portals -Imports DotNetNuke.Entities.Modules - - - - -Namespace DotNetNuke.Modules.Events - Public Class EventNotification - Inherits Services.Scheduling.SchedulerClient - -#Region "Constructors" - Public Sub New(ByVal objScheduleHistoryItem As Services.Scheduling.ScheduleHistoryItem) - MyBase.new() - ScheduleHistoryItem = objScheduleHistoryItem - End Sub -#End Region - -#Region "Methods" - Public Overrides Sub DoWork() - Try - 'notification that the event is progressing - Progressing() 'OPTIONAL - - Dim returnStrCleanup As String - returnStrCleanup = CleanupExpired() - If returnStrCleanup <> "" Then - ScheduleHistoryItem.AddLogNote("
" & returnStrCleanup & "
") - End If - - Dim returnStr As String - returnStr = SendEventNotifications() - ScheduleHistoryItem.AddLogNote(returnStr) - - ScheduleHistoryItem.Succeeded = True 'REQUIRED - - Catch exc As Exception 'REQUIRED - ScheduleHistoryItem.Succeeded = False 'REQUIRED - ScheduleHistoryItem.AddLogNote("Event Notification failed." + exc.ToString + Status) 'OPTIONAL - 'notification that we have errored - Errored(exc) 'REQUIRED - 'log the exception - LogException(exc) 'OPTIONAL - End Try - End Sub - - Private Function SendEventNotifications() As String - Dim objEvents As EventController = New EventController - Dim objEvent As EventInfo - Dim objEventNotifications As EventNotificationController = New EventNotificationController - Dim notifyEvents As ArrayList - Dim returnStr As String = "Event Notification completed." - - Status = "Sending Event Notifications" - - '*** All Event Notifications are stored in UTC internally. - notifyEvents = objEventNotifications.EventsNotificationsToSend(Date.UtcNow) - - For Each objNotification As EventNotificationInfo In notifyEvents - 'Get the Associated Event - objEvent = objEvents.EventsGet(objNotification.EventID, objNotification.ModuleID) - - If Not (objEvent Is Nothing) Then - ' Setup PortalSettings - Dim portalSettings As PortalSettings = CreatePortalSettings(objNotification.PortalAliasID, objNotification.TabID) - Dim folderName As String = DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", objEvent.PortalID).FolderName - - If Not portalSettings Is Nothing Then - ' Make up the LocalResourceFile value - Dim templateSourceDirectory As String = Common.Globals.ApplicationPath - Dim localResourceFile As String = templateSourceDirectory & "/DesktopModules/" & folderName & "/" & Localization.LocalResourceDirectory & "/EventNotification.ascx.resx" - - ' Send the email - Dim objEventEmailInfo As New EventEmailInfo - Dim objEventEmail As New EventEmails(portalSettings.PortalId, objNotification.ModuleID, localResourceFile, objNotification.NotifyLanguage) - objEventEmailInfo.TxtEmailSubject = objEvent.Notify - objEventEmailInfo.TxtEmailBody = objEvent.Reminder - objEventEmailInfo.TxtEmailFrom() = objEvent.ReminderFrom - objEventEmailInfo.UserEmails.Add(objNotification.UserEmail) - objEventEmailInfo.UserLocales.Add(objNotification.NotifyLanguage) - objEventEmailInfo.UserTimeZoneIds.Add(objEvent.EventTimeZoneId) - Dim domainurl As String = portalSettings.PortalAlias.HTTPAlias - If domainurl.IndexOf("/", StringComparison.Ordinal) > 0 Then - domainurl = domainurl.Substring(0, domainurl.IndexOf("/", StringComparison.Ordinal)) - End If - - objEventEmail.SendEmails(objEventEmailInfo, objEvent, domainurl) - End If - - '*** Update Notification (so we don't send again) - objNotification.NotificationSent = True - objEventNotifications.EventsNotificationSave(objNotification) - returnStr = "Event Notification completed. " + notifyEvents.Count.ToString + " Notification(s) sent!" - End If - Next - - '**** Delete Expired EventNotifications (older than 30 days) - Dim endDate As DateTime = Date.UtcNow.AddDays(-30) - objEventNotifications.EventsNotificationDelete(endDate) - - Status = "Event Notifications Sent Successfully" - ScheduleHistoryItem.Succeeded = True - Return returnStr - - End Function - - Private Function CleanupExpired() As String - Dim returnStr As String = "Event Cleanup completed." - Dim noDeletedEvents As Integer = 0 - - Status = "Performing Event Cleanup" - - Dim objDesktopModule As DesktopModuleInfo - objDesktopModule = DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", 0) - - If objDesktopModule Is Nothing Then - Return "Module Definition 'DNN_Events' not found. Cleanup cannot be performed." - End If - - Status = "Performing Event Cleanup: Dummy" - Status = "Performing Event Cleanup:" + objDesktopModule.FriendlyName - - Dim objPortals As New Entities.Portals.PortalController - Dim objPortal As Entities.Portals.PortalInfo - Dim objModules As New ModuleController - Dim objModule As ModuleInfo - - Dim lstportals As ArrayList = objPortals.GetPortals() - For Each objPortal In lstportals - Status = "Performing Event Cleanup:" + objDesktopModule.FriendlyName + " PortalID: Dummy" - Status = "Performing Event Cleanup:" + objDesktopModule.FriendlyName + " PortalID:" + objPortal.PortalID.ToString - - Dim lstModules As ArrayList = objModules.GetModulesByDefinition(objPortal.PortalID, objDesktopModule.FriendlyName) - For Each objModule In lstModules - ' This check for objModule = Nothing because of error in DNN 5.0.0 in GetModulesByDefinition - If objModule Is Nothing Then - Continue For - End If - Status = "Performing Event Cleanup:" + objDesktopModule.FriendlyName + " PortalID:" + objPortal.PortalID.ToString + " ModuleID: Dummy" - Status = "Performing Event Cleanup:" + objDesktopModule.FriendlyName + " PortalID:" + objPortal.PortalID.ToString + " ModuleID:" + objModule.ModuleID.ToString - - Dim ems As New EventModuleSettings - Dim settings As EventModuleSettings = ems.GetEventModuleSettings(objModule.ModuleID, Nothing) - If settings.expireevents <> "" Then - Status = "Performing Event Cleanup:" + objDesktopModule.FriendlyName + " PortalID:" + objPortal.PortalID.ToString + " ModuleID:" + objModule.ModuleID.ToString + " IN PROGRESS" - - Dim objEventCtl As New EventController - Dim expireDate As DateTime = DateAdd(DateInterval.Day, -CType(settings.expireevents, Integer), Date.UtcNow) - Dim startdate As DateTime = expireDate.AddYears(-10) - Dim endDate As DateTime = expireDate.AddDays(1) - Dim objEventInfoHelper As New EventInfoHelper(objModule.ModuleID, settings) - Dim categoryIDs As New ArrayList - categoryIDs.Add("-1") - Dim locationIDs As New ArrayList - locationIDs.Add("-1") - Dim lstEvents As ArrayList = objEventInfoHelper.GetEvents(startdate, endDate, False, categoryIDs, locationIDs, -1, -1) - - Dim objEventTimeZoneUtilities As New EventTimeZoneUtilities - For Each objEvent As EventInfo In lstEvents - Dim eventTime As DateTime = objEventTimeZoneUtilities.ConvertToUTCTimeZone(objEvent.EventTimeEnd, objEvent.EventTimeZoneId) - If eventTime < expireDate Then - objEvent.Cancelled = True - objEventCtl.EventsSave(objEvent, True, Nothing, True) - noDeletedEvents += 1 - returnStr = "Event Cleanup completed. " + noDeletedEvents.ToString + " Events deleted." - End If - Next - objEventCtl.EventsCleanupExpired(objModule.PortalID, objModule.ModuleID) - End If - Next - Next - Status = "Cleanup complete" - Return returnStr - End Function - - Public Function CreatePortalSettings(ByVal portalAliasID As Integer, ByVal tabID As Integer) As PortalSettings - Dim cacheKey As String = "EventsPortalSettings" & portalAliasID.ToString - Dim ps As New PortalSettings - Dim pscache As PortalSettings = CType(Common.Utilities.DataCache.GetCache(cacheKey), PortalSettings) - - If pscache Is Nothing Then - ' Setup PortalSettings - Dim objPortalAliases As PortalAliasController = New PortalAliasController - Dim objPortalAlias As PortalAliasInfo - - objPortalAlias = objPortalAliases.GetPortalAliasByPortalAliasID(portalAliasID) - If objPortalAlias Is Nothing Then - Return Nothing - End If - Dim portalController As New PortalController - Dim portal As Entities.Portals.PortalInfo = portalController.GetPortal(objPortalAlias.PortalID) - - - With ps - .PortalAlias = objPortalAlias - .PortalId = portal.PortalID - .PortalName = portal.PortalName - .LogoFile = portal.LogoFile - .FooterText = portal.FooterText - .ExpiryDate = portal.ExpiryDate - .UserRegistration = portal.UserRegistration - .BannerAdvertising = portal.BannerAdvertising - .Currency = portal.Currency - .AdministratorId = portal.AdministratorId - .Email = portal.Email - .HostFee = portal.HostFee - .HostSpace = portal.HostSpace - .PageQuota = portal.PageQuota - .UserQuota = portal.UserQuota - .AdministratorRoleId = portal.AdministratorRoleId - .AdministratorRoleName = portal.AdministratorRoleName - .RegisteredRoleId = portal.RegisteredRoleId - .RegisteredRoleName = portal.RegisteredRoleName - .Description = portal.Description - .KeyWords = portal.KeyWords - .BackgroundFile = portal.BackgroundFile - .GUID = portal.GUID - .SiteLogHistory = portal.SiteLogHistory - .AdminTabId = portal.AdminTabId - .SuperTabId = portal.SuperTabId - .SplashTabId = portal.SuperTabId - .HomeTabId = portal.HomeTabId - .LoginTabId = portal.LoginTabId - .UserTabId = portal.UserTabId - .DefaultLanguage = portal.DefaultLanguage - .Pages = portal.Pages - .Users = portal.Users - If .HostSpace = Nothing Then - .HostSpace = 0 - End If - If .DefaultLanguage Is Nothing Then - .DefaultLanguage = Localization.SystemLocale - End If - If .TimeZone Is Nothing Then - .TimeZone = TimeZoneInfo.FindSystemTimeZoneById(Localization.SystemTimeZone) - End If - .HomeDirectory = Common.Globals.ApplicationPath + "/" + portal.HomeDirectory + "/" - End With - Common.Utilities.DataCache.SetCache(cacheKey, ps) - Else - ps = pscache - End If - Dim tabController As New Entities.Tabs.TabController - Dim tab As Entities.Tabs.TabInfo = tabController.GetTab(TabID, ps.PortalId, False) - If tab Is Nothing Then - Return Nothing - End If - ps.ActiveTab = tab - - Try - ' Now to put it into the HTTPContext - If HttpContext.Current Is Nothing Then - Dim page As String = ps.PortalAlias.HTTPAlias - Dim query As String = String.Empty - Dim output As IO.TextWriter = Nothing - Dim workerrequest As Hosting.SimpleWorkerRequest = New Hosting.SimpleWorkerRequest(page, query, output) - HttpContext.Current = New HttpContext(workerrequest) - HttpContext.Current.Items.Add("PortalSettings", ps) - Else - HttpContext.Current.Items.Remove("PortalSettings") - HttpContext.Current.Items.Add("PortalSettings", ps) - End If - Catch exc As Exception - End Try - - Return ps - End Function -#End Region - - End Class - -End Namespace diff --git a/Components/EventTokenReplace.cs b/Components/EventTokenReplace.cs new file mode 100644 index 0000000..63fb6b3 --- /dev/null +++ b/Components/EventTokenReplace.cs @@ -0,0 +1,1095 @@ +using DotNetNuke.Entities.Users; +using Microsoft.VisualBasic; +using System.Web.UI.WebControls; +using System.Collections; +using DotNetNuke.Common.Utilities; +using System.Web; +using DotNetNuke.Services.Localization; +using System; +using System.Text; +using DotNetNuke.Entities.Modules; +using DotNetNuke.Entities.Portals; +using DotNetNuke.Security.Roles; + + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events + { + +#region TokenReplaceController Class + /// + /// Replaces the tokens that are defined for the Event e-mails and views + /// + public class TokenReplaceControllerClass + { + +#region Member Variables + private string _localResourceFile; + private int _moduleId; +#endregion + +#region Constructor + public TokenReplaceControllerClass(int moduleID, string localResourceFile) + { + this.ModuleID = moduleID; + this.LocalResourceFile = localResourceFile; + } +#endregion + +#region Properties + private int ModuleID + { + get + { + return _moduleId; + } + set + { + _moduleId = value; + } + } + + private string LocalResourceFile + { + get + { + return _localResourceFile; + } + set + { + _localResourceFile = value; + } + } +#endregion + +#region Methods + /// + /// Replace tokens in sourcetext with eventspecific token + /// + public string TokenReplaceEvent(EventInfo eventInfo, string sourceText) + { + return TokenReplaceEvent(eventInfo, sourceText, null, false); + } + public string TokenReplaceEvent(EventInfo eventInfo, string sourceText, EventSignupsInfo eventSignupsInfo) + { + return TokenReplaceEvent(eventInfo, sourceText, eventSignupsInfo, false); + } + public string TokenReplaceEvent(EventInfo eventInfo, string sourceText, bool addsubmodulename) + { + return TokenReplaceEvent(eventInfo, sourceText, null, addsubmodulename); + } + public string TokenReplaceEvent(EventInfo eventInfo, string sourceText, EventSignupsInfo eventSignupsInfo, bool addsubmodulename) + { + return TokenReplaceEvent(eventInfo, sourceText, eventSignupsInfo, addsubmodulename, false); + } + public string TokenReplaceEvent(EventInfo eventInfo, string sourceText, EventSignupsInfo eventSignupsInfo, bool addsubmodulename, bool isEventEditor) + { + + System.Collections.Generic.Dictionary dict = new System.Collections.Generic.Dictionary(); + + string cacheKey = "EventsFolderName" + ModuleID.ToString(); + string folderName = System.Convert.ToString(Common.Utilities.DataCache.GetCache(cacheKey)); + if (ReferenceEquals(folderName, null)) + { + folderName = DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", eventInfo.PortalID).FolderName; + Common.Utilities.DataCache.SetCache(cacheKey, folderName); + } + + //Module settings + EventModuleSettings ems = new EventModuleSettings(); + EventModuleSettings settings = ems.GetEventModuleSettings(ModuleID, LocalResourceFile); + + + Services.Tokens.TokenReplace trn = new Services.Tokens.TokenReplace(Services.Tokens.Scope.DefaultSettings, ModuleID); + + //Parameter processing + sourceText = TokenParameters(sourceText, eventInfo, settings); + + //title + if (!dict.ContainsKey("title")) + { + if (addsubmodulename && eventInfo.ModuleTitle != null) + { + //Eventname and moduletitle + dict.Add("title", string.Format("{0} ({1})", eventInfo.EventName, eventInfo.ModuleTitle.Trim())); + } + else + { + //Just eventname + dict.Add("title", eventInfo.EventName); + } + } + + //submodule name + if (eventInfo.ModuleTitle != null && ModuleID != eventInfo.ModuleID) + { + dict.Add("subcalendarname", string.Format("({0})", eventInfo.ModuleTitle.Trim())); + dict.Add("subcalendarnameclean", eventInfo.ModuleTitle.Trim()); + } + + //alldayeventtext + dict.Add("alldayeventtext", Localization.GetString("TokenAllDayEventText", LocalResourceFile)); + + //startdatelabel + dict.Add("startdatelabel", Localization.GetString("TokenStartdateLabel", LocalResourceFile)); + + //startdate + sourceText = TokenReplaceDate(sourceText, "event", "startdate", eventInfo.EventTimeBegin); + + //enddatelabel + dict.Add("enddatelabel", Localization.GetString("TokenEnddateLabel", LocalResourceFile)); + + //enddate + sourceText = TokenReplaceDate(sourceText, "event", "enddate", eventInfo.EventTimeEnd); + + //timezone + // Added a try/catch since dnn core can failing getting timezone info + try + { + string value = TimeZoneInfo.FindSystemTimeZoneById(eventInfo.EventTimeZoneId).DisplayName; + dict.Add("timezone", value); + } + catch + { + dict.Add("timezone", ""); + } + + //Duration + dict.Add("durationdayslabel", Localization.GetString("TokenDurationDaysLabel", LocalResourceFile)); + dict.Add("durationdays", System.Convert.ToInt32(Conversion.Int((double) eventInfo.Duration / 1440 + 1))); + + //descriptionlabel + dict.Add("descriptionlabel", Localization.GetString("TokenDescriptionLabel", LocalResourceFile)); + + //description + if (!dict.ContainsKey("description")) + { + dict.Add("description", HttpUtility.HtmlDecode(eventInfo.EventDesc)); + } + sourceText = TokenLength(sourceText, "event", "description", dict); + + //categorylabel + if (!ReferenceEquals(eventInfo.CategoryName, null)) + { + dict.Add("categorylabel", Localization.GetString("TokenCategoryLabel", LocalResourceFile)); + } + else + { + dict.Add("categorylabel", ""); + } + + //category, categoryfontcolor, categorybackcolor + if (!ReferenceEquals(eventInfo.CategoryName, null)) + { + if (eventInfo.Color.Length > 0) + { + dict.Add("category", string.Format("
{0}
", eventInfo.CategoryName, eventInfo.Color, eventInfo.FontColor)); + dict.Add("categoryfontcolor", eventInfo.FontColor); + dict.Add("categorybackcolor", eventInfo.Color); + } + else + { + dict.Add("category", eventInfo.CategoryName); + } + dict.Add("categoryname", eventInfo.CategoryName); + } + else + { + dict.Add("category", ""); + dict.Add("categoryname", ""); + } + + //locationlabel + if (!ReferenceEquals(eventInfo.LocationName, null)) + { + dict.Add("locationlabel", Localization.GetString("TokenLocationLabel", LocalResourceFile)); + } + else + { + dict.Add("locationlabel", ""); + } + + //location, locationurl + if (!ReferenceEquals(eventInfo.MapURL, null) && eventInfo.MapURL != "") + { + dict.Add("location", string.Format("{0}", eventInfo.LocationName, eventInfo.MapURL)); + dict.Add("locationurl", eventInfo.MapURL); + } + else + { + dict.Add("location", eventInfo.LocationName); + dict.Add("locationurl", ""); + } + + //locationname + dict.Add("locationname", eventInfo.LocationName); + + //Other location properties. + EventLocationInfo eventLocation = new EventLocationInfo(); + eventLocation = new EventLocationController().EventsLocationGet(eventInfo.Location, eventInfo.PortalID); + if (eventLocation != null) + { + dict.Add("locationaddresslabel", Localization.GetString("TokenLocationAddressLabel", LocalResourceFile)); + dict.Add("locationstreet", eventLocation.Street); + dict.Add("locationpostalcode", eventLocation.PostalCode); + dict.Add("locationcity", eventLocation.City); + dict.Add("locationregion", eventLocation.Region); + dict.Add("locationcountry", eventLocation.Country); + } + else + { + dict.Add("locationaddresslabel", ""); + dict.Add("locationstreet", ""); + dict.Add("locationpostalcode", ""); + dict.Add("locationcity", ""); + dict.Add("locationregion", ""); + dict.Add("locationcountry", ""); + } + + //customfield1 + if (settings.EventsCustomField1) + { + dict.Add("customfield1", eventInfo.CustomField1); + } + else + { + dict.Add("customfield1", ""); + } + + //customfield1label + if (settings.EventsCustomField1) + { + dict.Add("customfield1label", Localization.GetString("TokenCustomField1Label", LocalResourceFile)); + } + else + { + dict.Add("customfield1label", ""); + } + + //customfield2 + if (settings.EventsCustomField2) + { + dict.Add("customfield2", eventInfo.CustomField2); + } + else + { + dict.Add("customfield2", ""); + } + + //customfield2label + if (settings.EventsCustomField2) + { + dict.Add("customfield2label", Localization.GetString("TokenCustomField2Label", LocalResourceFile)); + } + else + { + dict.Add("customfield2label", ""); + } + + //descriptionlabel + dict.Add("summarylabel", Localization.GetString("TokenSummaryLabel", LocalResourceFile)); + + //description + if (!dict.ContainsKey("summary")) + { + dict.Add("summary", HttpUtility.HtmlDecode(eventInfo.Summary)); + } + sourceText = TokenLength(sourceText, "event", "summary", dict); + + //eventid + dict.Add("eventid", eventInfo.EventID); + + //eventmoduleid + dict.Add("eventmoduleid", eventInfo.ModuleID); + + + //Createddate + //TokenCreatedOnLabel.Text on + dict.Add("createddatelabel", Localization.GetString("TokenCreatedOnLabel", LocalResourceFile)); + sourceText = TokenReplaceDate(sourceText, "event", "createddate", eventInfo.CreatedDate); + + //LastUpdateddate + //TokenLastUpdatedOnLabel.Text Last updated on + dict.Add("lastupdateddatelabel", Localization.GetString("TokenLastUpdatedOnLabel", LocalResourceFile)); + sourceText = TokenReplaceDate(sourceText, "event", "lastupdateddate", eventInfo.LastUpdatedAt); + + if (settings.Eventsignup && eventInfo.Signups) + { + //maxenrollmentslabel + //maxenrollments + dict.Add("maxenrollmentslabel", Localization.GetString("TokenMaxEnrollmentsLabel", LocalResourceFile)); + if (eventInfo.MaxEnrollment > 0) + { + dict.Add("maxenrollments", eventInfo.MaxEnrollment.ToString()); + } + else + { + dict.Add("maxenrollments", Localization.GetString("Unlimited", LocalResourceFile)); + } + + //noenrollmentslabel + //noenrollments + dict.Add("noenrollmentslabel", Localization.GetString("TokenNoEnrollmentsLabel", LocalResourceFile)); + dict.Add("noenrollments", eventInfo.Enrolled.ToString()); + + //novacancieslabel + //novacancies + dict.Add("novacancieslabel", Localization.GetString("TokenNoVacanciesLabel", LocalResourceFile)); + if (eventInfo.MaxEnrollment > 0) + { + dict.Add("novacancies", (eventInfo.MaxEnrollment - eventInfo.Enrolled).ToString()); + } + else + { + dict.Add("novacancies", Localization.GetString("Unlimited", LocalResourceFile)); + } + } + else + { + dict.Add("maxenrollmentslabel", ""); + dict.Add("maxenrollments", ""); + dict.Add("noenrollmentslabel", ""); + dict.Add("noenrollments", ""); + } + + if (eventInfo.SocialGroupId > 0) + { + //groupnamelabel + //groupname + RoleController roleController = new RoleController(); + string rolename = roleController.GetRole(eventInfo.SocialGroupId, eventInfo.PortalID).RoleName; + dict.Add("socialgrouprolenamelabel", Localization.GetString("TokenSocialGroupRoleNameLabel", LocalResourceFile)); + dict.Add("socialgrouprolename", rolename); + dict.Add("socialgrouproleid", eventInfo.SocialGroupId.ToString()); + } + + if (eventInfo.SocialUserUserName != null) + { + //socialuserusernamelabel + //socialuserusername + dict.Add("socialuserusernamelabel", Localization.GetString("TokenSocialUserUserNameLabel", LocalResourceFile)); + dict.Add("socialuserusername", eventInfo.SocialUserUserName); + } + + if (eventInfo.SocialUserDisplayName != null) + { + //socialuserdisplaynamelabel + //socialuserdisplayname + dict.Add("socialuserdisplaynamelabel", Localization.GetString("TokenSocialUserDisplayNameLabel", LocalResourceFile)); + dict.Add("socialuserdisplayname", eventInfo.SocialUserDisplayName); + } + + // Process Event Signups Info is passed + if (eventSignupsInfo != null) + { + //signupuserid + dict.Add("signupuserid", eventSignupsInfo.UserID); + + //signupusername, ... + if (eventSignupsInfo.UserID != -1) + { + dict.Add("signupusername", eventSignupsInfo.UserName); + dict.Add("signupuserfirstname", ""); + dict.Add("signupuserlastname", ""); + dict.Add("signupuseremail", ""); + dict.Add("signupuserstreet", ""); + dict.Add("signupuserpostalcode", ""); + dict.Add("signupusercity", ""); + dict.Add("signupuserregion", ""); + dict.Add("signupusercountry", ""); + dict.Add("signupusercompany", ""); + dict.Add("signupuserjobtitle", ""); + dict.Add("signupuserrefnumber", ""); + } + else + { + dict.Add("signupusername", eventSignupsInfo.AnonName); + dict.Add("signupuserfirstname", eventSignupsInfo.FirstName); + dict.Add("signupuserlastname", eventSignupsInfo.LastName); + dict.Add("signupuseremail", eventSignupsInfo.AnonEmail); + dict.Add("signupuserstreet", eventSignupsInfo.Street); + dict.Add("signupuserpostalcode", eventSignupsInfo.PostalCode); + dict.Add("signupusercity", eventSignupsInfo.City); + dict.Add("signupuserregion", eventSignupsInfo.Region); + dict.Add("signupusercountry", eventSignupsInfo.Country); + dict.Add("signupusercompany", eventSignupsInfo.Company); + dict.Add("signupuserjobtitle", eventSignupsInfo.JobTitle); + dict.Add("signupuserrefnumber", eventSignupsInfo.ReferenceNumber); + } + + //signupdatelabel + dict.Add("signupdatelabel", Localization.GetString("TokenSignupdateLabel", LocalResourceFile)); + + //signupdate + sourceText = TokenReplaceDate(sourceText, "event", "signupdate", eventSignupsInfo.PayPalPaymentDate); + + //noenroleeslabel + dict.Add("noenroleeslabel", Localization.GetString("TokenNoenroleesLabel", LocalResourceFile)); + + //noenrolees + dict.Add("noenrolees", eventSignupsInfo.NoEnrolees); + } + + //Custom/external enrollment page + if (settings.EnrollmentPageAllowed) + { + dict.Add("enrollmentdefaulturl", settings.EnrollmentPageDefaultUrl); + } + else + { + dict.Add("enrollmentdefaulturl", ""); + } + + //try and get the portalsettings. When in scheduled mode (EventNotifications) + //and no permissions, these will not be available and will error + PortalSettings ps = null; + try + { + ps = (Entities.Portals.PortalSettings) (HttpContext.Current.Items["PortalSettings"]); + } + catch (Exception) + { + } + if (!ReferenceEquals(ps, null)) + { + // add tokens for items that use PortalSettings + TokenReplacewithPortalSettings(ps, eventInfo, settings, dict, folderName, sourceText, isEventEditor); + } + + return trn.ReplaceEnvironmentTokens(sourceText, dict, "event"); + } + + private string TokenLength(string sourceText, string customCaption, string customToken, System.Collections.Generic.Dictionary dict) + { + Services.Tokens.TokenReplace trn = new Services.Tokens.TokenReplace(Services.Tokens.Scope.DefaultSettings, ModuleID); + string tokenText = System.Convert.ToString(trn.ReplaceEnvironmentTokens("[" + customCaption + ":" + customToken + "]", dict, customCaption)); + while (sourceText.IndexOf("[" + customCaption + ":" + customToken + "]") + 1 > 0 || sourceText.IndexOf("[" + customCaption + ":" + customToken + "|") + 1 > 0) + { + var with_1 = GetTokenFormat(sourceText, customToken, customCaption); + if (with_1.Tokenfound) + { + if (!string.IsNullOrEmpty(with_1.Formatstring)) + { + sourceText = sourceText.Replace("[" + customCaption + ":" + customToken + "|" + with_1.Formatstring + "]", HtmlUtils.Shorten(tokenText, int.Parse(with_1.Formatstring), "...")); + } + else + { + sourceText = sourceText.Replace("[" + customCaption + ":" + customToken + "]", tokenText); + } + } + } + return sourceText; + } + + private string TokenReplaceDate(string sourceText, string customCaption, string customToken, DateTime customDate) + { + + DateTime tokenDate = customDate.Date.AddMinutes(customDate.TimeOfDay.TotalMinutes); + while (sourceText.IndexOf("[" + customCaption + ":" + customToken + "]") + 1 > 0 || sourceText.IndexOf("[" + customCaption + ":" + customToken + "|") + 1 > 0) + { + var with_1 = GetTokenFormat(sourceText, customToken, customCaption); + if (with_1.Tokenfound) + { + if (!string.IsNullOrEmpty(with_1.Formatstring)) + { + sourceText = sourceText.Replace("[" + customCaption + ":" + customToken + "|" + with_1.Formatstring + "]", string.Format("{0:" + with_1.Formatstring + "}", tokenDate)); + } + else + { + sourceText = sourceText.Replace("[" + customCaption + ":" + customToken + "]", string.Format("{0:f}", tokenDate)); + } + } + } + + return sourceText; + + } + + public string TokenParameters(string sourceText, EventInfo eventInfo, EventModuleSettings settings) + { + + if (eventInfo.AllDayEvent) + { + sourceText = TokenOneParameter(sourceText, "ALLDAYEVENT", true); + sourceText = TokenOneParameter(sourceText, "NOTALLDAYEVENT", false); + } + else + { + sourceText = TokenOneParameter(sourceText, "ALLDAYEVENT", false); + sourceText = TokenOneParameter(sourceText, "NOTALLDAYEVENT", true); + } + if (eventInfo.DisplayEndDate) + { + sourceText = TokenOneParameter(sourceText, "DISPLAYENDDATE", true); + } + else + { + sourceText = TokenOneParameter(sourceText, "DISPLAYENDDATE", false); + } + + object eventimagesetting = settings.Eventimage; + bool eventimagebool = false; + if (bool.TryParse(Convert.ToString(eventimagesetting), out eventimagebool) && (eventimagebool && eventInfo.ImageDisplay)) + { + sourceText = TokenOneParameter(sourceText, "IFHASIMAGE", true); + sourceText = TokenOneParameter(sourceText, "IFNOTHASIMAGE", false); + } + else + { + sourceText = TokenOneParameter(sourceText, "IFHASIMAGE", false); + sourceText = TokenOneParameter(sourceText, "IFNOTHASIMAGE", true); + } + + if (eventInfo.Category > 0) + { + sourceText = TokenOneParameter(sourceText, "IFHASCATEGORY", true); + } + else + { + sourceText = TokenOneParameter(sourceText, "IFHASCATEGORY", false); + } + if (eventInfo.Location > 0) + { + sourceText = TokenOneParameter(sourceText, "IFHASLOCATION", true); + } + else + { + sourceText = TokenOneParameter(sourceText, "IFHASLOCATION", false); + } + if (eventInfo.MapURL != "") + { + sourceText = TokenOneParameter(sourceText, "IFHASLOCATIONURL", true); + } + else + { + sourceText = TokenOneParameter(sourceText, "IFHASLOCATIONURL", false); + } + if (eventInfo.MapURL == "") + { + sourceText = TokenOneParameter(sourceText, "IFNOTHASLOCATIONURL", true); + } + else + { + sourceText = TokenOneParameter(sourceText, "IFNOTHASLOCATIONURL", false); + } + if (settings.Eventsignup && eventInfo.Signups) + { + sourceText = TokenOneParameter(sourceText, "IFALLOWSENROLLMENTS", true); + } + else + { + sourceText = TokenOneParameter(sourceText, "IFALLOWSENROLLMENTS", false); + } + if (settings.EventsCustomField1) + { + sourceText = TokenOneParameter(sourceText, "DISPLAYCUSTOMFIELD1", true); + } + else + { + sourceText = TokenOneParameter(sourceText, "DISPLAYCUSTOMFIELD1", false); + } + if (settings.EventsCustomField2) + { + sourceText = TokenOneParameter(sourceText, "DISPLAYCUSTOMFIELD2", true); + } + else + { + sourceText = TokenOneParameter(sourceText, "DISPLAYCUSTOMFIELD2", false); + } + if (settings.DetailPageAllowed && eventInfo.DetailPage) + { + sourceText = TokenOneParameter(sourceText, "CUSTOMDETAILPAGE", true); + } + else + { + sourceText = TokenOneParameter(sourceText, "CUSTOMDETAILPAGE", false); + } + if (eventInfo.EventTimeBegin.Date == eventInfo.EventTimeEnd.Date) //one day event... + { + sourceText = TokenOneParameter(sourceText, "ONEDAYEVENT", true); + sourceText = TokenOneParameter(sourceText, "NOTONEDAYEVENT", false); + } + else + { + sourceText = TokenOneParameter(sourceText, "ONEDAYEVENT", false); + sourceText = TokenOneParameter(sourceText, "NOTONEDAYEVENT", true); + } + if (eventInfo.RRULE != "") //recurring event + { + sourceText = TokenOneParameter(sourceText, "RECURRINGEVENT", true); + sourceText = TokenOneParameter(sourceText, "NOTRECURRINGEVENT", false); + } + else + { + sourceText = TokenOneParameter(sourceText, "RECURRINGEVENT", false); + sourceText = TokenOneParameter(sourceText, "NOTRECURRINGEVENT", true); + } + if (eventInfo.IsPrivate) //Is private event + { + sourceText = TokenOneParameter(sourceText, "PRIVATE", true); + sourceText = TokenOneParameter(sourceText, "NOTPRIVATE", false); + } + else + { + sourceText = TokenOneParameter(sourceText, "PRIVATE", false); + sourceText = TokenOneParameter(sourceText, "NOTPRIVATE", true); + } + if (settings.Tzdisplay) + { + sourceText = TokenOneParameter(sourceText, "IFTIMEZONEDISPLAY", true); + } + else + { + sourceText = TokenOneParameter(sourceText, "IFTIMEZONEDISPLAY", false); + } + if (eventInfo.Duration > 1440) + { + sourceText = TokenOneParameter(sourceText, "IFMULTIDAY", true); + sourceText = TokenOneParameter(sourceText, "IFNOTMULTIDAY", false); + } + else + { + sourceText = TokenOneParameter(sourceText, "IFMULTIDAY", false); + sourceText = TokenOneParameter(sourceText, "IFNOTMULTIDAY", true); + } + + if (sourceText.Contains("[HASROLE_") || sourceText.Contains("[HASNOTROLE_")) + { + RoleInfo role = default(RoleInfo); + RoleController roleController = new RoleController(); + System.Collections.Generic.IList userRolesIList = default(System.Collections.Generic.IList); + ArrayList userRoles = new ArrayList(); + if (!ReferenceEquals(UserController.GetCurrentUserInfo(), null)) + { + userRolesIList = roleController.GetUserRoles(UserController.GetCurrentUserInfo(), true); + // ReSharper disable NotAccessedVariable + int i = 0; + // ReSharper restore NotAccessedVariable + foreach (UserRoleInfo userRole in userRolesIList) + { + userRoles.Add(userRole.RoleName); + i++; + } + } + foreach (RoleInfo tempLoopVar_role in roleController.GetPortalRoles(eventInfo.PortalID)) + { + role = tempLoopVar_role; + sourceText = TokenOneParameter(sourceText, "HASROLE_" + role.RoleName, userRoles.Contains(role.RoleName)); + sourceText = TokenOneParameter(sourceText, "HASNOTROLE_" + role.RoleName, !userRoles.Contains(role.RoleName)); + } + } + + if (eventInfo.Summary != "") + { + sourceText = TokenOneParameter(sourceText, "IFHASSUMMARY", true); + } + else + { + sourceText = TokenOneParameter(sourceText, "IFHASSUMMARY", false); + } + if (eventInfo.Summary == "") + { + sourceText = TokenOneParameter(sourceText, "IFNOTHASSUMMARY", true); + } + else + { + sourceText = TokenOneParameter(sourceText, "IFNOTHASSUMMARY", false); + } + + if (sourceText.Contains("[IFENROLED]") || sourceText.Contains("[IFNOTENROLED]")) + { + bool blEnroled = false; + bool blNotEnroled = false; + if (eventInfo.Signups) + { + blNotEnroled = true; + if (!ReferenceEquals(UserController.GetCurrentUserInfo(), null)) + { + EventSignupsController signupsController = new EventSignupsController(); + EventSignupsInfo signupInfo = signupsController.EventsSignupsGetUser(eventInfo.EventID, UserController.GetCurrentUserInfo().UserID, eventInfo.ModuleID); + if (!ReferenceEquals(signupInfo, null)) + { + blEnroled = signupInfo.Approved; + blNotEnroled = !signupInfo.Approved; + } + } + } + sourceText = TokenOneParameter(sourceText, "IFENROLED", blEnroled); + sourceText = TokenOneParameter(sourceText, "IFNOTENROLED", blNotEnroled); + } + + if (eventInfo.SocialUserId > 0) + { + sourceText = TokenOneParameter(sourceText, "IFISSOCIALUSER", true); + } + else + { + sourceText = TokenOneParameter(sourceText, "IFISSOCIALUSER", false); + } + + if (eventInfo.SocialGroupId > 0) + { + sourceText = TokenOneParameter(sourceText, "IFISSOCIALGROUP", true); + } + else + { + sourceText = TokenOneParameter(sourceText, "IFISSOCIALGROUP", false); + } + + if (eventInfo.MaxEnrollment > 0 && eventInfo.Enrolled >= eventInfo.MaxEnrollment) + { + sourceText = TokenOneParameter(sourceText, "IFISFULL", true); + } + else + { + sourceText = TokenOneParameter(sourceText, "IFISFULL", false); + } + if ((eventInfo.MaxEnrollment > 0 && eventInfo.Enrolled < eventInfo.MaxEnrollment) || eventInfo.MaxEnrollment == 0) + { + sourceText = TokenOneParameter(sourceText, "IFNOTISFULL", true); + } + else + { + sourceText = TokenOneParameter(sourceText, "IFNOTISFULL", false); + } + + return sourceText; + } + + public string TokenOneParameter(string sourceText, string parameterName, bool parameterKeep) + { + StringBuilder sourceTextOut = new StringBuilder(); + if (parameterKeep) + { + sourceTextOut.Insert(0, sourceText); + sourceTextOut.Replace("[" + parameterName + "]", ""); + sourceTextOut.Replace("[/" + parameterName + "]", ""); + } + else + { + System.Text.RegularExpressions.Regex rgx = new System.Text.RegularExpressions.Regex("\\[" + parameterName + "][.\\s\\S]*?\\[/" + parameterName + "]"); + sourceTextOut.Insert(0, rgx.Replace(sourceText, "")); + } + return sourceTextOut.ToString(); + } + + private void TokenReplacewithPortalSettings(PortalSettings ps, EventInfo eventInfo, EventModuleSettings settings, System.Collections.Generic.Dictionary dict, string folderName, string sourceText, bool isEventEditor) + { + //Build URL for event images + EventInfoHelper eventInfoHelper = new EventInfoHelper(ModuleID, ps.ActiveTab.TabID, eventInfo.PortalID, settings); + + // Dim portalurl As String = ps.PortalAlias.HTTPAlias + // Dim domainurl As String = ps.PortalAlias.HTTPAlias + string domainurl = eventInfoHelper.GetDomainURL(); + string portalurl = domainurl; + if (ps.PortalAlias.HTTPAlias.IndexOf("/", StringComparison.Ordinal) > 0) + { + portalurl = portalurl + Common.Globals.ApplicationPath; + } + string imagepath = DotNetNuke.Common.Globals.AddHTTP(string.Format("{0}/DesktopModules/{1}/Images/", portalurl, folderName)); + + //eventimage + if (settings.Eventimage && eventInfo.ImageDisplay) + { + string imageSrc = eventInfo.ImageURL; + + if (eventInfo.ImageURL.StartsWith("FileID=")) + { + int fileId = int.Parse(eventInfo.ImageURL.Substring(7)); + Services.FileSystem.IFileInfo objFileInfo = Services.FileSystem.FileManager.Instance.GetFile(fileId); + if (!ReferenceEquals(objFileInfo, null)) + { + imageSrc = System.Convert.ToString(objFileInfo.Folder + objFileInfo.FileName); + if (imageSrc.IndexOf("://") + 1 == 0) + { + Entities.Portals.PortalController pi = new Entities.Portals.PortalController(); + imageSrc = DotNetNuke.Common.Globals.AddHTTP(string.Format("{0}/{1}/{2}", portalurl, pi.GetPortal(eventInfo.PortalID).HomeDirectory, imageSrc)); + } + } + } + + if (eventInfo.ImageWidth > 0 & eventInfo.ImageHeight > 0) + { + dict.Add("eventimage", string.Format("", imageSrc, Unit.Pixel(eventInfo.ImageWidth), Unit.Pixel(eventInfo.ImageHeight))); + int thumbWidth = eventInfo.ImageWidth; + int thumbHeight = eventInfo.ImageHeight; + if (eventInfo.ImageHeight > settings.MaxThumbHeight) + { + thumbHeight = settings.MaxThumbHeight; + thumbWidth = System.Convert.ToInt32((double) eventInfo.ImageWidth * settings.MaxThumbHeight / eventInfo.ImageHeight); + } + if (thumbWidth > settings.MaxThumbWidth) + { + thumbWidth = settings.MaxThumbWidth; + thumbHeight = System.Convert.ToInt32((double) eventInfo.ImageHeight * settings.MaxThumbWidth / eventInfo.ImageWidth); + } + dict.Add("eventthumb", string.Format("", imageSrc, Unit.Pixel(thumbWidth), Unit.Pixel(thumbHeight))); + } + else + { + dict.Add("eventimage", string.Format("", imageSrc)); + dict.Add("eventthumb", string.Format("", imageSrc)); + } + dict.Add("imageurl", imageSrc); + } + else + { + //? + dict.Add("eventimage", ""); + dict.Add("eventthumb", ""); + dict.Add("imageurl", ""); + } + + //importancelabel + dict.Add("importancelabel", Localization.GetString("TokenImporatanceLabel", LocalResourceFile)); + + //importance, importanceicon + string result = "{2} {3}"; + switch (eventInfo.Importance) + { + case EventInfo.Priority.High: + dict.Add("importance", string.Format(result, imagepath, "HighPrio.gif", Localization.GetString("HighPrio", this.LocalResourceFile), Localization.GetString("HighPrio", this.LocalResourceFile), "EventIconHigh")); + dict.Add("importanceicon", string.Format(result, imagepath, "HighPrio.gif", Localization.GetString("HighPrio", this.LocalResourceFile), "", "EventIconHigh")); + break; + case EventInfo.Priority.Low: + dict.Add("importance", string.Format(result, imagepath, "LowPrio.gif", Localization.GetString("LowPrio", this.LocalResourceFile), Localization.GetString("LowPrio", this.LocalResourceFile), "EventIconLow")); + dict.Add("importanceicon", string.Format(result, imagepath, "LowPrio.gif", Localization.GetString("HighPrio", this.LocalResourceFile), "", "EventIconLow")); + break; + case EventInfo.Priority.Medium: + dict.Add("importance", Localization.GetString("NormPrio", this.LocalResourceFile)); + dict.Add("importanceicon", ""); + break; + } + + //reminderlabel + dict.Add("reminderlabel", Localization.GetString("TokenReminderLabel", LocalResourceFile)); + + //reminder, remindericon + string img = ""; + if (!ReferenceEquals(sourceText, null)) + { + if (sourceText.Contains("[event:reminder]") || sourceText.Contains("[event:remindericon]")) + { + string notificationInfo = ""; + img = ""; + string userEmail = Entities.Users.UserController.GetCurrentUserInfo().Email; + if (eventInfo.SendReminder && HttpContext.Current.Request.IsAuthenticated) + { + EventNotificationController objEventNotificationController = new EventNotificationController(); + notificationInfo = objEventNotificationController.NotifyInfo(eventInfo.EventID, userEmail, eventInfo.ModuleID, LocalResourceFile, eventInfo.EventTimeZoneId); + } + if (eventInfo.SendReminder && HttpContext.Current.Request.IsAuthenticated && !string.IsNullOrEmpty(notificationInfo)) + { + img = string.Format("{1}", imagepath, Localization.GetString("ReminderEnabled", LocalResourceFile) + ": " + notificationInfo, "EventIconRem"); + } + else if (eventInfo.SendReminder && (settings.Notifyanon || HttpContext.Current.Request.IsAuthenticated)) + { + img = string.Format("{1}", imagepath, Localization.GetString("ReminderEnabled", LocalResourceFile), "EventIconRem"); + } + dict.Add("reminder", notificationInfo); + dict.Add("remindericon", img); + } + } + //enrollicon + EventSignupsController objEventSignupsController = new EventSignupsController(); + img = ""; + if (objEventSignupsController.DisplayEnrollIcon(eventInfo) && settings.Eventsignup) + { + if (eventInfo.MaxEnrollment == 0 | eventInfo.Enrolled < eventInfo.MaxEnrollment) + { + img = string.Format("{1}", imagepath, Localization.GetString("EnrollEnabled", LocalResourceFile), "EventIconEnroll"); + } + else + { + img = string.Format("{1}", imagepath, Localization.GetString("EnrollFull", LocalResourceFile), "EventIconEnrollFull"); + } + } + dict.Add("enrollicon", img); + + //recurringlabel + dict.Add("recurringlabel", Localization.GetString("TokenRecurranceLabel", LocalResourceFile)); + + //recurring, recurringicon + EventRRULEInfo objEventRRULE = default(EventRRULEInfo); + EventRecurMasterController objCtlEventRecurMaster = new EventRecurMasterController(); + objEventRRULE = objCtlEventRecurMaster.DecomposeRRULE(eventInfo.RRULE, eventInfo.EventTimeBegin); + result = objCtlEventRecurMaster.RecurrenceText(objEventRRULE, LocalResourceFile, System.Threading.Thread.CurrentThread.CurrentCulture, eventInfo.EventTimeBegin); + img = ""; + if (eventInfo.RRULE != "") + { + img = string.Format("{1}", imagepath, Localization.GetString("RecurringEvent", LocalResourceFile), "EventIconRec"); + result = img + " " + result + " " + objCtlEventRecurMaster.RecurrenceInfo(eventInfo, LocalResourceFile); + } + dict.Add("recurring", result); + dict.Add("recurringicon", img); + + //titleurl + string eventurl = eventInfoHelper.DetailPageURL(eventInfo); + dict.Add("eventurl", eventurl); + if (eventInfo.DetailPage && eventInfo.DetailNewWin) + { + dict.Add("titleurl", "" + eventInfo.EventName + ""); + } + else + { + dict.Add("titleurl", "" + eventInfo.EventName + ""); + } + + //View page url + if (settings.DetailPageAllowed && eventInfo.DetailPage) + { + string strUserID = Entities.Users.UserController.GetCurrentUserInfo().UserID.ToString(); + int userID = -1; + if (Information.IsNumeric(strUserID)) + { + userID = int.Parse(strUserID); + } + bool blAuthenticated = false; + if (userID > -1) + { + blAuthenticated = true; + } + if (eventInfo.CreatedByID == userID | eventInfo.OwnerID == userID | eventInfo.RmOwnerID == userID || eventInfoHelper.IsModerator(blAuthenticated) == true || Security.PortalSecurity.IsInRole(ps.AdministratorRoleName.ToString())) + { + string imgurl = Entities.Icons.IconController.IconURL("View"); + img = string.Format("\"{2}\"", eventInfoHelper.GetDetailPageRealURL(eventInfo.EventID, eventInfo.SocialGroupId, eventInfo.SocialUserId), imgurl, Localization.GetString("ViewEvent", LocalResourceFile)); + dict.Add("viewicon", img); + } + } + else + { + dict.Add("viewicon", ""); + } + + //Createdby + //TokenCreatedByLabel.Text Created by, Created by ID, Created by Link + EventUser objEventUser = eventInfoHelper.UserDisplayNameProfile(eventInfo.CreatedByID, eventInfo.CreatedBy, LocalResourceFile); + dict.Add("createdbylabel", Localization.GetString("TokenCreatedByLabel", LocalResourceFile)); + dict.Add("createdby", objEventUser.DisplayName); + dict.Add("createdbyid", objEventUser.UserID); + dict.Add("createdbyurl", objEventUser.ProfileURL); + dict.Add("createdbyprofile", objEventUser.DisplayNameURL); + + //ownedby + //TokenOwnedByLabel.Text Owned by, OwnerID, Owned by Link + objEventUser = eventInfoHelper.UserDisplayNameProfile(eventInfo.OwnerID, eventInfo.OwnerName, LocalResourceFile); + dict.Add("ownedbylabel", Localization.GetString("TokenOwnedByLabel", LocalResourceFile)); + dict.Add("ownedby", objEventUser.DisplayName); + dict.Add("ownedbyid", objEventUser.UserID); + dict.Add("ownedbyurl", objEventUser.ProfileURL); + dict.Add("ownedbyprofile", objEventUser.DisplayNameURL); + + //LastUpdatedby + //TokenLastUpdatedByLabel.Text Last updated by, Last updated ID, Last update by ID + objEventUser = eventInfoHelper.UserDisplayNameProfile(eventInfo.LastUpdatedID, eventInfo.LastUpdatedBy, LocalResourceFile); + dict.Add("lastupdatedbylabel", Localization.GetString("TokenLastUpdatedByLabel", LocalResourceFile)); + dict.Add("lastupdatedby", objEventUser.DisplayName); + dict.Add("lastupdatedbyid", objEventUser.UserID); + dict.Add("lastupdatedbyurl", objEventUser.ProfileURL); + dict.Add("lastupdatedbyprofile", objEventUser.DisplayNameURL); + + if (settings.Eventsignup && eventInfo.Signups) + { + //enrollfeelabel + //enrollfee + dict.Add("enrollfeelabel", Localization.GetString("TokenEnrollFeeLabel", LocalResourceFile)); + if (eventInfo.EnrollType == "PAID") + { + string tokenEnrollFeePaid = Localization.GetString("TokenEnrollFeePaid", LocalResourceFile).Replace("{0}", "{0:#0.00}"); + dict.Add("enrollfee", string.Format(tokenEnrollFeePaid, eventInfo.EnrollFee, ps.Currency)); + } + else + { + dict.Add("enrollfee", Localization.GetString("TokenEnrollFeeFree", LocalResourceFile)); + } + } + else + { + dict.Add("enrollfeelabel", ""); + dict.Add("enrollfee", ""); + } + + if (settings.Moderateall) + { + dict.Add("moderateurl", eventInfoHelper.GetModerateUrl()); + } + else + { + dict.Add("moderateurl", ""); + } + + //edit button + if (isEventEditor) + { + string imgurl = Entities.Icons.IconController.IconURL("Edit"); + img = string.Format("{1}", imgurl, Localization.GetString("EditEvent", LocalResourceFile), "EventIconEdit", eventInfoHelper.GetEditURL(eventInfo.EventID, eventInfo.SocialGroupId, eventInfo.SocialUserId)); + dict.Add("editbutton", img); + } + else + { + dict.Add("editbutton", ""); + } + } +#endregion + +#region Helperfunctions + private struct GetTokenFormatResult + { + public string Formatstring; + public bool Tokenfound; + } + + private GetTokenFormatResult GetTokenFormat(string tokenstring, string token, string customcaption) + { + string search1 = string.Format("[{0}:{1}]", customcaption, token); + string search2 = string.Format("[{0}:{1}|", customcaption, token); + int starttoken1 = tokenstring.IndexOf(search1, StringComparison.Ordinal); + int starttoken2 = tokenstring.IndexOf(search2, StringComparison.Ordinal); + if (starttoken1 == -1 & starttoken2 == -1) + { + //Not found + return new GetTokenFormatResult() {Formatstring = null, Tokenfound = false}; + } + + GetTokenFormatResult result = new GetTokenFormatResult(); + result.Tokenfound = true; + if (starttoken1 == -1) + { + int endtoken = System.Convert.ToInt32(tokenstring.Substring(starttoken2).IndexOf("]", StringComparison.Ordinal)); + result.Formatstring = tokenstring.Substring(starttoken2 + search2.Length, endtoken - search2.Length); + } + else + { + result.Formatstring = ""; + } + + return result; + } + +#endregion + } +#endregion + + } diff --git a/Components/EventTokenReplace.vb b/Components/EventTokenReplace.vb deleted file mode 100644 index 751577d..0000000 --- a/Components/EventTokenReplace.vb +++ /dev/null @@ -1,859 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports System.Text -Imports DotNetNuke.Entities.Modules -Imports DotNetNuke.Entities.Portals -Imports DotNetNuke.Security.Roles - - - -Namespace DotNetNuke.Modules.Events - -#Region "TokenReplaceController Class" - ''' - ''' Replaces the tokens that are defined for the Event e-mails and views - ''' - Public Class TokenReplaceControllerClass - -#Region "Member Variables" - Private _localResourceFile As String - Private _moduleId As Int32 -#End Region - -#Region "Constructor" - Sub New(ByVal moduleID As Integer, ByVal localResourceFile As String) - Me.ModuleID = ModuleID - Me.LocalResourceFile = localResourceFile - End Sub -#End Region - -#Region "Properties" - Private Property ModuleID() As Integer - Get - Return _moduleId - End Get - Set(ByVal value As Integer) - _moduleId = value - End Set - End Property - - Private Overloads Property LocalResourceFile() As String - Get - Return _localResourceFile - End Get - Set(ByVal value As String) - _localResourceFile = value - End Set - End Property -#End Region - -#Region "Methods" - ''' - ''' Replace tokens in sourcetext with eventspecific token - ''' - Public Function TokenReplaceEvent(ByVal eventInfo As EventInfo, ByVal sourceText As String) As String - Return TokenReplaceEvent(eventInfo, sourceText, Nothing, False) - End Function - Public Function TokenReplaceEvent(ByVal eventInfo As EventInfo, ByVal sourceText As String, ByVal eventSignupsInfo As EventSignupsInfo) As String - Return TokenReplaceEvent(eventInfo, sourceText, eventSignupsInfo, False) - End Function - Public Function TokenReplaceEvent(ByVal eventInfo As EventInfo, ByVal sourceText As String, ByVal addsubmodulename As Boolean) As String - Return TokenReplaceEvent(eventInfo, sourceText, Nothing, addsubmodulename) - End Function - Public Function TokenReplaceEvent(ByVal eventInfo As EventInfo, ByVal sourceText As String, ByVal eventSignupsInfo As EventSignupsInfo, ByVal addsubmodulename As Boolean) As String - Return TokenReplaceEvent(eventInfo, sourceText, eventSignupsInfo, addsubmodulename, False) - End Function - Public Function TokenReplaceEvent(ByVal eventInfo As EventInfo, ByVal sourceText As String, ByVal eventSignupsInfo As EventSignupsInfo, ByVal addsubmodulename As Boolean, ByVal isEventEditor As Boolean) As String - - Dim dict As New Generic.Dictionary(Of String, Object) - - Dim cacheKey As String = "EventsFolderName" & ModuleID.ToString - Dim folderName As String = CType(Common.Utilities.DataCache.GetCache(cacheKey), String) - If folderName Is Nothing Then - folderName = DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", eventInfo.PortalID).FolderName - Common.Utilities.DataCache.SetCache(cacheKey, folderName) - End If - - 'Module settings - Dim ems As New EventModuleSettings - Dim settings As EventModuleSettings = ems.GetEventModuleSettings(ModuleID, LocalResourceFile) - - - Dim trn As New Services.Tokens.TokenReplace(Services.Tokens.Scope.DefaultSettings, ModuleID) - - 'Parameter processing - sourceText = TokenParameters(sourceText, eventInfo, settings) - - 'title - If Not dict.ContainsKey("title") Then - If addsubmodulename And eventInfo.ModuleTitle <> Nothing Then - 'Eventname and moduletitle - dict.Add("title", String.Format("{0} ({1})", eventInfo.EventName, Trim(eventInfo.ModuleTitle))) - Else - 'Just eventname - dict.Add("title", eventInfo.EventName) - End If - End If - - 'submodule name - If eventInfo.ModuleTitle <> Nothing And ModuleID <> eventInfo.ModuleID Then - dict.Add("subcalendarname", String.Format("({0})", Trim(eventInfo.ModuleTitle))) - dict.Add("subcalendarnameclean", Trim(eventInfo.ModuleTitle)) - End If - - 'alldayeventtext - dict.Add("alldayeventtext", Localization.GetString("TokenAllDayEventText", LocalResourceFile)) - - 'startdatelabel - dict.Add("startdatelabel", Localization.GetString("TokenStartdateLabel", LocalResourceFile)) - - 'startdate - sourceText = TokenReplaceDate(sourceText, "event", "startdate", eventInfo.EventTimeBegin) - - 'enddatelabel - dict.Add("enddatelabel", Localization.GetString("TokenEnddateLabel", LocalResourceFile)) - - 'enddate - sourceText = TokenReplaceDate(sourceText, "event", "enddate", eventInfo.EventTimeEnd) - - 'timezone - ' Added a try/catch since dnn core can failing getting timezone info - Try - Dim value As String = TimeZoneInfo.FindSystemTimeZoneById(eventInfo.EventTimeZoneId).DisplayName - dict.Add("timezone", value) - Catch - dict.Add("timezone", "") - End Try - - 'Duration - dict.Add("durationdayslabel", Localization.GetString("TokenDurationDaysLabel", LocalResourceFile)) - dict.Add("durationdays", CType(Int(eventInfo.Duration / 1440 + 1), Integer)) - - 'descriptionlabel - dict.Add("descriptionlabel", Localization.GetString("TokenDescriptionLabel", LocalResourceFile)) - - 'description - If Not dict.ContainsKey("description") Then - dict.Add("description", HttpUtility.HtmlDecode(eventInfo.EventDesc)) - End If - sourceText = TokenLength(sourceText, "event", "description", dict) - - 'categorylabel - If Not eventInfo.CategoryName Is Nothing Then - dict.Add("categorylabel", Localization.GetString("TokenCategoryLabel", LocalResourceFile)) - Else - dict.Add("categorylabel", "") - End If - - 'category, categoryfontcolor, categorybackcolor - If Not eventInfo.CategoryName Is Nothing Then - If eventInfo.Color.Length > 0 Then - dict.Add("category", String.Format("
{0}
", eventInfo.CategoryName, eventInfo.Color, eventInfo.FontColor)) - dict.Add("categoryfontcolor", eventInfo.FontColor) - dict.Add("categorybackcolor", eventInfo.Color) - Else - dict.Add("category", eventInfo.CategoryName) - End If - dict.Add("categoryname", eventInfo.CategoryName) - Else - dict.Add("category", "") - dict.Add("categoryname", "") - End If - - 'locationlabel - If Not eventInfo.LocationName Is Nothing Then - dict.Add("locationlabel", Localization.GetString("TokenLocationLabel", LocalResourceFile)) - Else - dict.Add("locationlabel", "") - End If - - 'location, locationurl - If Not eventInfo.MapURL Is Nothing And eventInfo.MapURL <> "" Then - dict.Add("location", String.Format("{0}", eventInfo.LocationName, eventInfo.MapURL)) - dict.Add("locationurl", eventInfo.MapURL) - Else - dict.Add("location", eventInfo.LocationName) - dict.Add("locationurl", "") - End If - - 'locationname - dict.Add("locationname", eventInfo.LocationName) - - 'Other location properties. - Dim eventLocation As New EventLocationInfo - eventLocation = New EventLocationController().EventsLocationGet(eventInfo.Location, eventInfo.PortalID) - If eventLocation IsNot Nothing Then - dict.Add("locationaddresslabel", Localization.GetString("TokenLocationAddressLabel", LocalResourceFile)) - dict.Add("locationstreet", eventLocation.Street) - dict.Add("locationpostalcode", eventLocation.PostalCode) - dict.Add("locationcity", eventLocation.City) - dict.Add("locationregion", eventLocation.Region) - dict.Add("locationcountry", eventLocation.Country) - Else - dict.Add("locationaddresslabel", "") - dict.Add("locationstreet", "") - dict.Add("locationpostalcode", "") - dict.Add("locationcity", "") - dict.Add("locationregion", "") - dict.Add("locationcountry", "") - End If - - 'customfield1 - If settings.EventsCustomField1 Then - dict.Add("customfield1", eventInfo.CustomField1) - Else : dict.Add("customfield1", "") - End If - - 'customfield1label - If settings.EventsCustomField1 Then - dict.Add("customfield1label", Localization.GetString("TokenCustomField1Label", LocalResourceFile)) - Else : dict.Add("customfield1label", "") - End If - - 'customfield2 - If settings.EventsCustomField2 Then - dict.Add("customfield2", eventInfo.CustomField2) - Else : dict.Add("customfield2", "") - End If - - 'customfield2label - If settings.EventsCustomField2 Then - dict.Add("customfield2label", Localization.GetString("TokenCustomField2Label", LocalResourceFile)) - Else : dict.Add("customfield2label", "") - End If - - 'descriptionlabel - dict.Add("summarylabel", Localization.GetString("TokenSummaryLabel", LocalResourceFile)) - - 'description - If Not dict.ContainsKey("summary") Then - dict.Add("summary", HttpUtility.HtmlDecode(eventInfo.Summary)) - End If - sourceText = TokenLength(sourceText, "event", "summary", dict) - - 'eventid - dict.Add("eventid", eventInfo.EventID) - - 'eventmoduleid - dict.Add("eventmoduleid", eventInfo.ModuleID) - - - 'Createddate - 'TokenCreatedOnLabel.Text on - dict.Add("createddatelabel", Localization.GetString("TokenCreatedOnLabel", LocalResourceFile)) - sourceText = TokenReplaceDate(sourceText, "event", "createddate", eventInfo.CreatedDate) - - 'LastUpdateddate - 'TokenLastUpdatedOnLabel.Text Last updated on - dict.Add("lastupdateddatelabel", Localization.GetString("TokenLastUpdatedOnLabel", LocalResourceFile)) - sourceText = TokenReplaceDate(sourceText, "event", "lastupdateddate", eventInfo.LastUpdatedAt) - - If settings.Eventsignup And eventInfo.Signups Then - 'maxenrollmentslabel - 'maxenrollments - dict.Add("maxenrollmentslabel", Localization.GetString("TokenMaxEnrollmentsLabel", LocalResourceFile)) - If eventInfo.MaxEnrollment > 0 Then - dict.Add("maxenrollments", eventInfo.MaxEnrollment.ToString) - Else - dict.Add("maxenrollments", Localization.GetString("Unlimited", LocalResourceFile)) - End If - - 'noenrollmentslabel - 'noenrollments - dict.Add("noenrollmentslabel", Localization.GetString("TokenNoEnrollmentsLabel", LocalResourceFile)) - dict.Add("noenrollments", eventInfo.Enrolled.ToString) - - 'novacancieslabel - 'novacancies - dict.Add("novacancieslabel", Localization.GetString("TokenNoVacanciesLabel", LocalResourceFile)) - If eventInfo.MaxEnrollment > 0 Then - dict.Add("novacancies", (eventInfo.MaxEnrollment - eventInfo.Enrolled).ToString) - Else - dict.Add("novacancies", Localization.GetString("Unlimited", LocalResourceFile)) - End If - Else - dict.Add("maxenrollmentslabel", "") - dict.Add("maxenrollments", "") - dict.Add("noenrollmentslabel", "") - dict.Add("noenrollments", "") - End If - - If eventInfo.SocialGroupId > 0 Then - 'groupnamelabel - 'groupname - Dim roleController As New RoleController - Dim rolename As String = roleController.GetRole(eventInfo.SocialGroupId, eventInfo.PortalID).RoleName - dict.Add("socialgrouprolenamelabel", Localization.GetString("TokenSocialGroupRoleNameLabel", LocalResourceFile)) - dict.Add("socialgrouprolename", rolename) - dict.Add("socialgrouproleid", eventInfo.SocialGroupId.ToString) - End If - - If eventInfo.SocialUserUserName IsNot Nothing Then - 'socialuserusernamelabel - 'socialuserusername - dict.Add("socialuserusernamelabel", Localization.GetString("TokenSocialUserUserNameLabel", LocalResourceFile)) - dict.Add("socialuserusername", eventInfo.SocialUserUserName) - End If - - If eventInfo.SocialUserDisplayName IsNot Nothing Then - 'socialuserdisplaynamelabel - 'socialuserdisplayname - dict.Add("socialuserdisplaynamelabel", Localization.GetString("TokenSocialUserDisplayNameLabel", LocalResourceFile)) - dict.Add("socialuserdisplayname", eventInfo.SocialUserDisplayName) - End If - - ' Process Event Signups Info is passed - If eventSignupsInfo IsNot Nothing Then - 'signupuserid - dict.Add("signupuserid", eventSignupsInfo.UserID) - - 'signupusername, ... - If eventSignupsInfo.UserID <> -1 Then - dict.Add("signupusername", eventSignupsInfo.UserName) - dict.Add("signupuserfirstname", "") - dict.Add("signupuserlastname", "") - dict.Add("signupuseremail", "") - dict.Add("signupuserstreet", "") - dict.Add("signupuserpostalcode", "") - dict.Add("signupusercity", "") - dict.Add("signupuserregion", "") - dict.Add("signupusercountry", "") - dict.Add("signupusercompany", "") - dict.Add("signupuserjobtitle", "") - dict.Add("signupuserrefnumber", "") - Else - dict.Add("signupusername", eventSignupsInfo.AnonName) - dict.Add("signupuserfirstname", eventSignupsInfo.FirstName) - dict.Add("signupuserlastname", eventSignupsInfo.LastName) - dict.Add("signupuseremail", eventSignupsInfo.AnonEmail) - dict.Add("signupuserstreet", eventSignupsInfo.Street) - dict.Add("signupuserpostalcode", eventSignupsInfo.PostalCode) - dict.Add("signupusercity", eventSignupsInfo.City) - dict.Add("signupuserregion", eventSignupsInfo.Region) - dict.Add("signupusercountry", eventSignupsInfo.Country) - dict.Add("signupusercompany", eventSignupsInfo.Company) - dict.Add("signupuserjobtitle", eventSignupsInfo.JobTitle) - dict.Add("signupuserrefnumber", eventSignupsInfo.ReferenceNumber) - End If - - 'signupdatelabel - dict.Add("signupdatelabel", Localization.GetString("TokenSignupdateLabel", LocalResourceFile)) - - 'signupdate - sourceText = TokenReplaceDate(sourceText, "event", "signupdate", eventSignupsInfo.PayPalPaymentDate) - - 'noenroleeslabel - dict.Add("noenroleeslabel", Localization.GetString("TokenNoenroleesLabel", LocalResourceFile)) - - 'noenrolees - dict.Add("noenrolees", eventSignupsInfo.NoEnrolees) - End If - - 'Custom/external enrollment page - If settings.EnrollmentPageAllowed Then - dict.Add("enrollmentdefaulturl", settings.EnrollmentPageDefaultUrl) - Else - dict.Add("enrollmentdefaulturl", "") - End If - - 'try and get the portalsettings. When in scheduled mode (EventNotifications) - 'and no permissions, these will not be available and will error - Dim ps As PortalSettings = Nothing - Try - ps = CType(HttpContext.Current.Items("PortalSettings"), Entities.Portals.PortalSettings) - Catch exc As Exception - End Try - If Not ps Is Nothing Then - ' add tokens for items that use PortalSettings - TokenReplacewithPortalSettings(ps, eventInfo, settings, dict, folderName, sourceText, isEventEditor) - End If - - Return trn.ReplaceEnvironmentTokens(sourceText, dict, "event") - End Function - - Private Function TokenLength(ByVal sourceText As String, ByVal customCaption As String, ByVal customToken As String, ByVal dict As Generic.Dictionary(Of String, Object)) As String - Dim trn As New Services.Tokens.TokenReplace(Services.Tokens.Scope.DefaultSettings, ModuleID) - Dim tokenText As String = trn.ReplaceEnvironmentTokens("[" + customCaption + ":" + customToken + "]", dict, customCaption) - Do While InStr(sourceText, "[" + customCaption + ":" + customToken + "]") > 0 Or InStr(sourceText, "[" + customCaption + ":" + customToken + "|") > 0 - With GetTokenFormat(sourceText, customToken, customCaption) - If .tokenfound Then - If .formatstring <> "" Then - sourceText = Replace(sourceText, "[" + customCaption + ":" + customToken + "|" + .formatstring + "]", HtmlUtils.Shorten(tokenText, CInt(.formatstring), "...")) - Else - sourceText = Replace(sourceText, "[" + customCaption + ":" + customToken + "]", tokenText) - End If - End If - End With - Loop - Return sourceText - End Function - - Private Function TokenReplaceDate(ByVal sourceText As String, ByVal customCaption As String, ByVal customToken As String, ByVal customDate As DateTime) As String - - Dim tokenDate As DateTime = customDate.Date.AddMinutes(customDate.TimeOfDay.TotalMinutes) - Do While InStr(sourceText, "[" + customCaption + ":" + customToken + "]") > 0 Or InStr(sourceText, "[" + customCaption + ":" + customToken + "|") > 0 - With GetTokenFormat(sourceText, customToken, customCaption) - If .tokenfound Then - If .formatstring <> "" Then - sourceText = Replace(sourceText, "[" + customCaption + ":" + customToken + "|" + .formatstring + "]", String.Format("{0:" & .formatstring & "}", tokenDate)) - Else - sourceText = Replace(sourceText, "[" + customCaption + ":" + customToken + "]", String.Format("{0:f}", tokenDate)) - End If - End If - End With - Loop - - Return sourceText - - End Function - - Public Function TokenParameters(ByVal sourceText As String, ByVal eventInfo As EventInfo, ByVal settings As EventModuleSettings) As String - - If eventInfo.AllDayEvent Then - sourceText = TokenOneParameter(sourceText, "ALLDAYEVENT", True) - sourceText = TokenOneParameter(sourceText, "NOTALLDAYEVENT", False) - Else - sourceText = TokenOneParameter(sourceText, "ALLDAYEVENT", False) - sourceText = TokenOneParameter(sourceText, "NOTALLDAYEVENT", True) - End If - If eventInfo.DisplayEndDate Then - sourceText = TokenOneParameter(sourceText, "DISPLAYENDDATE", True) - Else - sourceText = TokenOneParameter(sourceText, "DISPLAYENDDATE", False) - End If - - Dim eventimagesetting As Object = Settings.eventimage - Dim eventimagebool As Boolean - If Boolean.TryParse(CStr(eventimagesetting), eventimagebool) AndAlso (eventimagebool And eventInfo.ImageDisplay) Then - sourceText = TokenOneParameter(sourceText, "IFHASIMAGE", True) - sourceText = TokenOneParameter(sourceText, "IFNOTHASIMAGE", False) - Else - sourceText = TokenOneParameter(sourceText, "IFHASIMAGE", False) - sourceText = TokenOneParameter(sourceText, "IFNOTHASIMAGE", True) - End If - - If eventInfo.Category > 0 Then - sourceText = TokenOneParameter(sourceText, "IFHASCATEGORY", True) - Else - sourceText = TokenOneParameter(sourceText, "IFHASCATEGORY", False) - End If - If eventInfo.Location > 0 Then - sourceText = TokenOneParameter(sourceText, "IFHASLOCATION", True) - Else - sourceText = TokenOneParameter(sourceText, "IFHASLOCATION", False) - End If - If eventInfo.MapURL <> "" Then - sourceText = TokenOneParameter(sourceText, "IFHASLOCATIONURL", True) - Else - sourceText = TokenOneParameter(sourceText, "IFHASLOCATIONURL", False) - End If - If eventInfo.MapURL = "" Then - sourceText = TokenOneParameter(sourceText, "IFNOTHASLOCATIONURL", True) - Else - sourceText = TokenOneParameter(sourceText, "IFNOTHASLOCATIONURL", False) - End If - If Settings.eventsignup And eventInfo.Signups Then - sourceText = TokenOneParameter(sourceText, "IFALLOWSENROLLMENTS", True) - Else - sourceText = TokenOneParameter(sourceText, "IFALLOWSENROLLMENTS", False) - End If - If Settings.EventsCustomField1 Then - sourceText = TokenOneParameter(sourceText, "DISPLAYCUSTOMFIELD1", True) - Else - sourceText = TokenOneParameter(sourceText, "DISPLAYCUSTOMFIELD1", False) - End If - If Settings.EventsCustomField2 Then - sourceText = TokenOneParameter(sourceText, "DISPLAYCUSTOMFIELD2", True) - Else - sourceText = TokenOneParameter(sourceText, "DISPLAYCUSTOMFIELD2", False) - End If - If Settings.DetailPageAllowed And eventInfo.DetailPage Then - sourceText = TokenOneParameter(sourceText, "CUSTOMDETAILPAGE", True) - Else - sourceText = TokenOneParameter(sourceText, "CUSTOMDETAILPAGE", False) - End If - If eventInfo.EventTimeBegin.Date = eventInfo.EventTimeEnd.Date Then 'one day event... - sourceText = TokenOneParameter(sourceText, "ONEDAYEVENT", True) - sourceText = TokenOneParameter(sourceText, "NOTONEDAYEVENT", False) - Else - sourceText = TokenOneParameter(sourceText, "ONEDAYEVENT", False) - sourceText = TokenOneParameter(sourceText, "NOTONEDAYEVENT", True) - End If - If eventInfo.RRULE <> "" Then 'recurring event - sourceText = TokenOneParameter(sourceText, "RECURRINGEVENT", True) - sourceText = TokenOneParameter(sourceText, "NOTRECURRINGEVENT", False) - Else - sourceText = TokenOneParameter(sourceText, "RECURRINGEVENT", False) - sourceText = TokenOneParameter(sourceText, "NOTRECURRINGEVENT", True) - End If - If eventInfo.IsPrivate Then 'Is private event - sourceText = TokenOneParameter(sourceText, "PRIVATE", True) - sourceText = TokenOneParameter(sourceText, "NOTPRIVATE", False) - Else - sourceText = TokenOneParameter(sourceText, "PRIVATE", False) - sourceText = TokenOneParameter(sourceText, "NOTPRIVATE", True) - End If - If Settings.tzdisplay Then - sourceText = TokenOneParameter(sourceText, "IFTIMEZONEDISPLAY", True) - Else - sourceText = TokenOneParameter(sourceText, "IFTIMEZONEDISPLAY", False) - End If - If eventInfo.Duration > 1440 Then - sourceText = TokenOneParameter(sourceText, "IFMULTIDAY", True) - sourceText = TokenOneParameter(sourceText, "IFNOTMULTIDAY", False) - Else - sourceText = TokenOneParameter(sourceText, "IFMULTIDAY", False) - sourceText = TokenOneParameter(sourceText, "IFNOTMULTIDAY", True) - End If - - If sourceText.Contains("[HASROLE_") Or sourceText.Contains("[HASNOTROLE_") Then - Dim role As RoleInfo - Dim roleController As New RoleController - Dim userRolesIList As Generic.IList(Of UserRoleInfo) - Dim userRoles As New ArrayList - If Not UserController.GetCurrentUserInfo() Is Nothing Then - userRolesIList = roleController.GetUserRoles(UserController.GetCurrentUserInfo, True) - ' ReSharper disable NotAccessedVariable - Dim i As Integer = 0 - ' ReSharper restore NotAccessedVariable - For Each userRole As UserRoleInfo In userRolesIList - userRoles.Add(userRole.RoleName) - i += 1 - Next - End If - For Each role In roleController.GetPortalRoles(eventInfo.PortalID) - sourceText = TokenOneParameter(sourceText, "HASROLE_" + role.RoleName, userRoles.Contains(role.RoleName)) - sourceText = TokenOneParameter(sourceText, "HASNOTROLE_" + role.RoleName, Not userRoles.Contains(role.RoleName)) - Next - End If - - If eventInfo.Summary <> "" Then - sourceText = TokenOneParameter(sourceText, "IFHASSUMMARY", True) - Else - sourceText = TokenOneParameter(sourceText, "IFHASSUMMARY", False) - End If - If eventInfo.Summary = "" Then - sourceText = TokenOneParameter(sourceText, "IFNOTHASSUMMARY", True) - Else - sourceText = TokenOneParameter(sourceText, "IFNOTHASSUMMARY", False) - End If - - If (sourceText.Contains("[IFENROLED]") Or sourceText.Contains("[IFNOTENROLED]")) Then - Dim blEnroled As Boolean = False - Dim blNotEnroled As Boolean = False - If eventInfo.Signups Then - blNotEnroled = True - If Not UserController.GetCurrentUserInfo() Is Nothing Then - Dim signupsController As New EventSignupsController - Dim signupInfo As EventSignupsInfo = signupsController.EventsSignupsGetUser(eventInfo.EventID, UserController.GetCurrentUserInfo().UserID, eventInfo.ModuleID) - If Not signupInfo Is Nothing Then - blEnroled = signupInfo.Approved - blNotEnroled = Not signupInfo.Approved - End If - End If - End If - sourceText = TokenOneParameter(sourceText, "IFENROLED", blEnroled) - sourceText = TokenOneParameter(sourceText, "IFNOTENROLED", blNotEnroled) - End If - - If eventInfo.SocialUserId > 0 Then - sourceText = TokenOneParameter(sourceText, "IFISSOCIALUSER", True) - Else - sourceText = TokenOneParameter(sourceText, "IFISSOCIALUSER", False) - End If - - If eventInfo.SocialGroupId > 0 Then - sourceText = TokenOneParameter(sourceText, "IFISSOCIALGROUP", True) - Else - sourceText = TokenOneParameter(sourceText, "IFISSOCIALGROUP", False) - End If - - If eventInfo.MaxEnrollment > 0 AndAlso eventInfo.Enrolled >= eventInfo.MaxEnrollment Then - sourceText = TokenOneParameter(sourceText, "IFISFULL", True) - Else - sourceText = TokenOneParameter(sourceText, "IFISFULL", False) - End If - If (eventInfo.MaxEnrollment > 0 AndAlso eventInfo.Enrolled < eventInfo.MaxEnrollment) OrElse eventInfo.MaxEnrollment = 0 Then - sourceText = TokenOneParameter(sourceText, "IFNOTISFULL", True) - Else - sourceText = TokenOneParameter(sourceText, "IFNOTISFULL", False) - End If - - Return sourceText - End Function - - Public Function TokenOneParameter(ByVal sourceText As String, ByVal parameterName As String, ByVal parameterKeep As Boolean) As String - Dim sourceTextOut As New StringBuilder - If parameterKeep Then - sourceTextOut.Insert(0, sourceText) - sourceTextOut.Replace("[" + parameterName + "]", "") - sourceTextOut.Replace("[/" + parameterName + "]", "") - Else - Dim rgx As New RegularExpressions.Regex("\[" + parameterName + "][.\s\S]*?\[/" + parameterName + "]") - sourceTextOut.Insert(0, rgx.Replace(sourceText, "")) - End If - Return sourceTextOut.ToString - End Function - - Private Sub TokenReplacewithPortalSettings(ByVal ps As PortalSettings, ByVal eventInfo As EventInfo, ByVal settings As EventModuleSettings, ByVal dict As Generic.Dictionary(Of String, Object), ByVal folderName As String, ByVal sourceText As String, ByVal isEventEditor As Boolean) - 'Build URL for event images - Dim eventInfoHelper As New EventInfoHelper(ModuleID, ps.ActiveTab.TabID, eventInfo.PortalID, settings) - - ' Dim portalurl As String = ps.PortalAlias.HTTPAlias - ' Dim domainurl As String = ps.PortalAlias.HTTPAlias - Dim domainurl As String = eventInfoHelper.GetDomainURL() - Dim portalurl As String = domainurl - If ps.PortalAlias.HTTPAlias.IndexOf("/", StringComparison.Ordinal) > 0 Then - portalurl = portalurl & Common.Globals.ApplicationPath - End If - Dim imagepath As String = AddHTTP(String.Format("{0}/DesktopModules/{1}/Images/", portalurl, folderName)) - - 'eventimage - If settings.Eventimage And eventInfo.ImageDisplay Then - Dim imageSrc As String = eventInfo.ImageURL - - If eventInfo.ImageURL.StartsWith("FileID=") Then - Dim fileId As Integer = Integer.Parse(eventInfo.ImageURL.Substring(7)) - Dim objFileInfo As Services.FileSystem.IFileInfo = Services.FileSystem.FileManager.Instance.GetFile(fileId) - If Not objFileInfo Is Nothing Then - imageSrc = objFileInfo.Folder + objFileInfo.FileName - If InStr(1, imageSrc, "://") = 0 Then - Dim pi As New Entities.Portals.PortalController - imageSrc = AddHTTP(String.Format("{0}/{1}/{2}", portalurl, pi.GetPortal(eventInfo.PortalID).HomeDirectory, imageSrc)) - End If - End If - End If - - If eventInfo.ImageWidth > 0 And eventInfo.ImageHeight > 0 Then - dict.Add("eventimage", String.Format("", imageSrc, Unit.Pixel(eventInfo.ImageWidth), Unit.Pixel(eventInfo.ImageHeight))) - Dim thumbWidth As Integer = eventInfo.ImageWidth - Dim thumbHeight As Integer = eventInfo.ImageHeight - If eventInfo.ImageHeight > settings.MaxThumbHeight Then - thumbHeight = settings.MaxThumbHeight - thumbWidth = CInt(eventInfo.ImageWidth * settings.MaxThumbHeight / eventInfo.ImageHeight) - End If - If thumbWidth > settings.MaxThumbWidth Then - thumbWidth = settings.MaxThumbWidth - thumbHeight = CInt(eventInfo.ImageHeight * settings.MaxThumbWidth / eventInfo.ImageWidth) - End If - dict.Add("eventthumb", String.Format("", imageSrc, Unit.Pixel(thumbWidth), Unit.Pixel(thumbHeight))) - Else - dict.Add("eventimage", String.Format("", imageSrc)) - dict.Add("eventthumb", String.Format("", imageSrc)) - End If - dict.Add("imageurl", imageSrc) - Else - '?? - dict.Add("eventimage", "") - dict.Add("eventthumb", "") - dict.Add("imageurl", "") - End If - - 'importancelabel - dict.Add("importancelabel", Localization.GetString("TokenImporatanceLabel", LocalResourceFile)) - - 'importance, importanceicon - Dim result As String = "{2} {3}" - Select Case eventInfo.Importance - Case eventInfo.Priority.High - dict.Add("importance", String.Format(result, imagepath, "HighPrio.gif", Localization.GetString("HighPrio", LocalResourceFile), Localization.GetString("HighPrio", LocalResourceFile), "EventIconHigh")) - dict.Add("importanceicon", String.Format(result, imagepath, "HighPrio.gif", Localization.GetString("HighPrio", LocalResourceFile), "", "EventIconHigh")) - Case eventInfo.Priority.Low - dict.Add("importance", String.Format(result, imagepath, "LowPrio.gif", Localization.GetString("LowPrio", LocalResourceFile), Localization.GetString("LowPrio", LocalResourceFile), "EventIconLow")) - dict.Add("importanceicon", String.Format(result, imagepath, "LowPrio.gif", Localization.GetString("HighPrio", LocalResourceFile), "", "EventIconLow")) - Case eventInfo.Priority.Medium - dict.Add("importance", Localization.GetString("NormPrio", LocalResourceFile)) - dict.Add("importanceicon", "") - End Select - - 'reminderlabel - dict.Add("reminderlabel", Localization.GetString("TokenReminderLabel", LocalResourceFile)) - - 'reminder, remindericon - Dim img As String - If Not sourceText Is Nothing Then - If (sourceText.Contains("[event:reminder]") Or sourceText.Contains("[event:remindericon]")) Then - Dim notificationInfo As String = "" - img = "" - Dim userEmail As String = Entities.Users.UserController.GetCurrentUserInfo().Email - If eventInfo.SendReminder And HttpContext.Current.Request.IsAuthenticated Then - Dim objEventNotificationController As EventNotificationController = New EventNotificationController - notificationInfo = objEventNotificationController.NotifyInfo(eventInfo.EventID, userEmail, eventInfo.ModuleID, LocalResourceFile, eventInfo.EventTimeZoneId) - End If - If eventInfo.SendReminder And HttpContext.Current.Request.IsAuthenticated And notificationInfo <> "" Then - img = String.Format("{1}", imagepath, Localization.GetString("ReminderEnabled", LocalResourceFile) + ": " + notificationInfo, "EventIconRem") - ElseIf eventInfo.SendReminder And (settings.notifyanon Or HttpContext.Current.Request.IsAuthenticated) Then - img = String.Format("{1}", imagepath, Localization.GetString("ReminderEnabled", LocalResourceFile), "EventIconRem") - End If - dict.Add("reminder", notificationInfo) - dict.Add("remindericon", img) - End If - End If - 'enrollicon - Dim objEventSignupsController As New EventSignupsController - img = "" - If objEventSignupsController.DisplayEnrollIcon(eventInfo) And settings.eventsignup Then - If eventInfo.MaxEnrollment = 0 Or eventInfo.Enrolled < eventInfo.MaxEnrollment Then - img = String.Format("{1}", imagepath, Localization.GetString("EnrollEnabled", LocalResourceFile), "EventIconEnroll") - Else - img = String.Format("{1}", imagepath, Localization.GetString("EnrollFull", LocalResourceFile), "EventIconEnrollFull") - End If - End If - dict.Add("enrollicon", img) - - 'recurringlabel - dict.Add("recurringlabel", Localization.GetString("TokenRecurranceLabel", LocalResourceFile)) - - 'recurring, recurringicon - Dim objEventRRULE As EventRRULEInfo - Dim objCtlEventRecurMaster As New EventRecurMasterController - objEventRRULE = objCtlEventRecurMaster.DecomposeRRULE(eventInfo.RRULE, eventInfo.EventTimeBegin) - result = objCtlEventRecurMaster.RecurrenceText(objEventRRULE, LocalResourceFile, Threading.Thread.CurrentThread.CurrentCulture, eventInfo.EventTimeBegin) - img = "" - If eventInfo.RRULE <> "" Then - img = String.Format("{1}", imagepath, Localization.GetString("RecurringEvent", LocalResourceFile), "EventIconRec") - result = img & " " & result & " " & objCtlEventRecurMaster.RecurrenceInfo(eventInfo, LocalResourceFile) - End If - dict.Add("recurring", result) - dict.Add("recurringicon", img) - - 'titleurl - Dim eventurl As String = eventInfoHelper.DetailPageURL(eventInfo) - dict.Add("eventurl", eventurl) - If eventInfo.DetailPage And eventInfo.DetailNewWin Then - dict.Add("titleurl", "" & eventInfo.EventName & "") - Else - dict.Add("titleurl", "" & eventInfo.EventName & "") - End If - - 'View page url - If settings.DetailPageAllowed And eventInfo.DetailPage Then - Dim strUserID As String = Entities.Users.UserController.GetCurrentUserInfo().UserID.ToString - Dim userID As Integer = -1 - If IsNumeric(strUserID) Then - userID = CInt(strUserID) - End If - Dim blAuthenticated As Boolean = False - If userID > -1 Then - blAuthenticated = True - End If - If eventInfo.CreatedByID = userID Or eventInfo.OwnerID = userID Or eventInfo.RmOwnerID = userID Or _ - eventInfoHelper.IsModerator(blAuthenticated) = True Or _ - Security.PortalSecurity.IsInRole(ps.AdministratorRoleName.ToString) Then - Dim imgurl As String = Entities.Icons.IconController.IconURL("View") - img = String.Format("", eventInfoHelper.GetDetailPageRealURL(eventInfo.EventID, eventInfo.SocialGroupId, eventInfo.SocialUserId), imgurl, Localization.GetString("ViewEvent", LocalResourceFile)) - dict.Add("viewicon", img) - End If - Else - dict.Add("viewicon", "") - End If - - 'Createdby - 'TokenCreatedByLabel.Text Created by, Created by ID, Created by Link - Dim objEventUser As EventUser = eventInfoHelper.UserDisplayNameProfile(eventInfo.CreatedByID, eventInfo.CreatedBy, LocalResourceFile) - dict.Add("createdbylabel", Localization.GetString("TokenCreatedByLabel", LocalResourceFile)) - dict.Add("createdby", objEventUser.DisplayName) - dict.Add("createdbyid", objEventUser.UserID) - dict.Add("createdbyurl", objEventUser.ProfileURL) - dict.Add("createdbyprofile", objEventUser.DisplayNameURL) - - 'ownedby - 'TokenOwnedByLabel.Text Owned by, OwnerID, Owned by Link - objEventUser = eventInfoHelper.UserDisplayNameProfile(eventInfo.OwnerID, eventInfo.OwnerName, LocalResourceFile) - dict.Add("ownedbylabel", Localization.GetString("TokenOwnedByLabel", LocalResourceFile)) - dict.Add("ownedby", objEventUser.DisplayName) - dict.Add("ownedbyid", objEventUser.UserID) - dict.Add("ownedbyurl", objEventUser.ProfileURL) - dict.Add("ownedbyprofile", objEventUser.DisplayNameURL) - - 'LastUpdatedby - 'TokenLastUpdatedByLabel.Text Last updated by, Last updated ID, Last update by ID - objEventUser = eventInfoHelper.UserDisplayNameProfile(eventInfo.LastUpdatedID, eventInfo.LastUpdatedBy, LocalResourceFile) - dict.Add("lastupdatedbylabel", Localization.GetString("TokenLastUpdatedByLabel", LocalResourceFile)) - dict.Add("lastupdatedby", objEventUser.DisplayName) - dict.Add("lastupdatedbyid", objEventUser.UserID) - dict.Add("lastupdatedbyurl", objEventUser.ProfileURL) - dict.Add("lastupdatedbyprofile", objEventUser.DisplayNameURL) - - If settings.eventsignup And eventInfo.Signups Then - 'enrollfeelabel - 'enrollfee - dict.Add("enrollfeelabel", Localization.GetString("TokenEnrollFeeLabel", LocalResourceFile)) - If eventInfo.EnrollType = "PAID" Then - Dim tokenEnrollFeePaid As String = Replace(Localization.GetString("TokenEnrollFeePaid", LocalResourceFile), "{0}", "{0:#0.00}") - dict.Add("enrollfee", String.Format(tokenEnrollFeePaid, eventInfo.EnrollFee, ps.Currency)) - Else - dict.Add("enrollfee", Localization.GetString("TokenEnrollFeeFree", LocalResourceFile)) - End If - Else - dict.Add("enrollfeelabel", "") - dict.Add("enrollfee", "") - End If - - If settings.moderateall Then - dict.Add("moderateurl", eventInfoHelper.GetModerateUrl) - Else - dict.Add("moderateurl", "") - End If - - 'edit button - If IsEventEditor Then - Dim imgurl As String = Entities.Icons.IconController.IconURL("Edit") - img = String.Format("{1}", imgurl, Localization.GetString("EditEvent", LocalResourceFile), "EventIconEdit", eventInfoHelper.GetEditURL(eventInfo.EventID, eventInfo.SocialGroupId, eventInfo.SocialUserId)) - dict.Add("editbutton", img) - Else - dict.Add("editbutton", "") - End If - End Sub -#End Region - -#Region "Helperfunctions" - Private Structure GetTokenFormatResult - Public Formatstring As String - Public Tokenfound As Boolean - End Structure - - Private Function GetTokenFormat(ByVal tokenstring As String, ByVal token As String, ByVal customcaption As String) As GetTokenFormatResult - Dim search1 As String = String.Format("[{0}:{1}]", customcaption, token) - Dim search2 As String = String.Format("[{0}:{1}|", customcaption, token) - Dim starttoken1 As Int32 = tokenstring.IndexOf(search1, StringComparison.Ordinal) - Dim starttoken2 As Int32 = tokenstring.IndexOf(search2, StringComparison.Ordinal) - If starttoken1 = -1 And starttoken2 = -1 Then - 'Not found - Return New GetTokenFormatResult() With {.formatstring = Nothing, .tokenfound = False} - End If - - Dim result As New GetTokenFormatResult - result.tokenfound = True - If starttoken1 = -1 Then - Dim endtoken As Int32 = tokenstring.Substring(starttoken2).IndexOf("]", StringComparison.Ordinal) - result.formatstring = (tokenstring.Substring(starttoken2 + search2.Length, endtoken - search2.Length)) - Else - result.formatstring = "" - End If - - Return result - End Function - -#End Region - End Class -#End Region - -End Namespace \ No newline at end of file diff --git a/Components/Integration/Constants.cs b/Components/Integration/Constants.cs new file mode 100644 index 0000000..136d04c --- /dev/null +++ b/Components/Integration/Constants.cs @@ -0,0 +1,45 @@ +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events.Components.Integration + { + + public class Constants + { + +#region Misc. + + /// + /// The name of the content type stored in the ContentTypes table of the core. + /// + public const string ContentEventRecurMasterTypeName = "DNN_Events_EventRecurMaster"; + public const string ContentEventTypeName = "DNN_Events_Event"; + public const string JournalEventCreateTypeName = "eventcreate"; + public const string JournalEventAttendTypeName = "eventattend"; + +#endregion + + } + } + + diff --git a/Components/Integration/Constants.vb b/Components/Integration/Constants.vb deleted file mode 100644 index 2ad52d5..0000000 --- a/Components/Integration/Constants.vb +++ /dev/null @@ -1,40 +0,0 @@ - -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2012 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - -Namespace DotNetNuke.Modules.Events.Components.Integration - - Public Class Constants - -#Region "Misc." - - ''' - ''' The name of the content type stored in the ContentTypes table of the core. - ''' - Public Const ContentEventRecurMasterTypeName As String = "DNN_Events_EventRecurMaster" - Public Const ContentEventTypeName As String = "DNN_Events_Event" - Public Const JournalEventCreateTypeName As String = "eventcreate" - Public Const JournalEventAttendTypeName As String = "eventattend" - -#End Region - - End Class -End Namespace - diff --git a/Components/Integration/Content.cs b/Components/Integration/Content.cs new file mode 100644 index 0000000..816263e --- /dev/null +++ b/Components/Integration/Content.cs @@ -0,0 +1,172 @@ +using DotNetNuke.Common.Utilities; +using DotNetNuke.Entities.Content.Common; +using DotNetNuke.Entities.Content; + + + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events.Components.Integration + { + using System.Linq; + + public class Content + { + + /// + /// This should only run after the Event exists in the data store. + /// + /// The newly created ContentItemID from the data store. + internal ContentItem CreateContentEventRecurMaster(EventRecurMasterInfo objEventRecurMaster, int tabId) + { + + ContentItem objContent = new ContentItem() {Content = objEventRecurMaster.EventDesc, + ContentTypeId = GetContentTypeId(Constants.ContentEventRecurMasterTypeName), + Indexed = false, + ContentKey = "RecurItemID=" + objEventRecurMaster.RecurMasterID.ToString() + "&mctl=EventDetails", + ModuleID = objEventRecurMaster.ModuleID, + TabID = tabId}; + + objContent.ContentItemId = System.Convert.ToInt32(Util.GetContentController().AddContentItem(objContent)); + + return objContent; + } + + /// + /// This is used to update the content in the ContentItems table. Should be called when an Event is updated. + /// + internal void UpdateContentEventRecurMaster(EventRecurMasterInfo objEventRecurMaster) + { + ContentItem objContent = Util.GetContentController().GetContentItem(objEventRecurMaster.ContentItemID); + + if (ReferenceEquals(objContent, null)) + { + return ; + } + objContent.Content = objEventRecurMaster.EventDesc; + objContent.ContentKey = "ItemID=" + objEventRecurMaster.RecurMasterID.ToString() + "&mctl=EventDetails"; + + Util.GetContentController().UpdateContentItem(objContent); + + } + + /// + /// This should only run after the Event exists in the data store. + /// + /// The newly created ContentItemID from the data store. + internal ContentItem CreateContentEvent(EventInfo objEvent, int tabId) + { + + ContentItem objContent = new ContentItem() {Content = objEvent.EventDesc, + ContentTypeId = GetContentTypeId(Constants.ContentEventTypeName), + Indexed = false, + ContentKey = "ItemID=" + objEvent.EventID.ToString() + "&mctl=EventDetails", + ModuleID = objEvent.ModuleID, + TabID = tabId}; + + objContent.ContentItemId = System.Convert.ToInt32(Util.GetContentController().AddContentItem(objContent)); + + return objContent; + } + + /// + /// This is used to update the content in the ContentItems table. Should be called when an Event is updated. + /// + internal void UpdateContentEvent(EventInfo objEvent) + { + ContentItem objContent = Util.GetContentController().GetContentItem(objEvent.ContentItemID); + + if (ReferenceEquals(objContent, null)) + { + return ; + } + objContent.Content = objEvent.EventDesc; + objContent.ContentKey = "ItemID=" + objEvent.EventID.ToString() + "&mctl=EventDetails"; + + Util.GetContentController().UpdateContentItem(objContent); + + } + + /// + /// This removes a content item associated with an event from the data store. + /// + /// + internal void DeleteContentItem(int contentItemId) + { + if (contentItemId <= Null.NullInteger) + { + return ; + } + ContentItem objContent = Util.GetContentController().GetContentItem(contentItemId); + if (ReferenceEquals(objContent, null)) + { + return ; + } + + Util.GetContentController().DeleteContentItem(objContent); + } + + /// + /// This is used to determine the ContentTypeID (part of the Core API) based on this module's content type. If the content type doesn't exist yet for the module, it is created. + /// + /// The primary key value (ContentTypeID) from the core API's Content Types table. + internal static int GetContentTypeId(string contentTypeConstant) + { + ContentTypeController typeController = new ContentTypeController(); + System.Collections.Generic.IEnumerable colContentTypes = from t in typeController.GetContentTypes() where t.ContentType == contentTypeConstant select t; + int contentTypeId = 0; + + if (colContentTypes.Any()) + { + ContentType contentType = colContentTypes.Single(); + contentTypeId = System.Convert.ToInt32(ReferenceEquals(contentType, null) ? (CreateContentType(contentTypeConstant)) : contentType.ContentTypeId); + } + else + { + contentTypeId = CreateContentType(contentTypeConstant); + } + + return contentTypeId; + } + +#region Private Methods + + /// + /// Creates a Content Type (for taxonomy) in the data store. + /// + /// The primary key value of the new ContentType. + private static int CreateContentType(string contentTypeConstant) + { + ContentTypeController typeController = new ContentTypeController(); + ContentType objContentType = new ContentType() {ContentType = contentTypeConstant}; + + return typeController.AddContentType(objContentType); + } + +#endregion + + } + } + + diff --git a/Components/Integration/Content.vb b/Components/Integration/Content.vb deleted file mode 100644 index 7a7be1c..0000000 --- a/Components/Integration/Content.vb +++ /dev/null @@ -1,157 +0,0 @@ - -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2012 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - -Imports System.Linq -Imports DotNetNuke.Entities.Content.Common -Imports DotNetNuke.Entities.Content -Imports DotNetNuke.Common.Utilities - -Namespace DotNetNuke.Modules.Events.Components.Integration - - Public Class Content - - ''' - ''' This should only run after the Event exists in the data store. - ''' - ''' The newly created ContentItemID from the data store. - Friend Function CreateContentEventRecurMaster(objEventRecurMaster As EventRecurMasterInfo, tabId As Integer) As ContentItem - - Dim objContent As New ContentItem With { _ - .Content = objEventRecurMaster.EventDesc, _ - .ContentTypeId = GetContentTypeID(Constants.ContentEventRecurMasterTypeName), _ - .Indexed = False, _ - .ContentKey = "RecurItemID=" & objEventRecurMaster.RecurMasterID.ToString & "&mctl=EventDetails", _ - .ModuleID = objEventRecurMaster.ModuleID, _ - .TabID = tabId _ - } - - objContent.ContentItemId = Util.GetContentController().AddContentItem(objContent) - - Return objContent - End Function - - ''' - ''' This is used to update the content in the ContentItems table. Should be called when an Event is updated. - ''' - Friend Sub UpdateContentEventRecurMaster(objEventRecurMaster As EventRecurMasterInfo) - Dim objContent As ContentItem = Util.GetContentController().GetContentItem(objEventRecurMaster.ContentItemID) - - If objContent Is Nothing Then - Return - End If - objContent.Content = objEventRecurMaster.EventDesc - objContent.ContentKey = "ItemID=" & objEventRecurMaster.RecurMasterID.ToString & "&mctl=EventDetails" - - Util.GetContentController().UpdateContentItem(objContent) - - End Sub - - ''' - ''' This should only run after the Event exists in the data store. - ''' - ''' The newly created ContentItemID from the data store. - Friend Function CreateContentEvent(objEvent As EventInfo, tabId As Integer) As ContentItem - - Dim objContent As New ContentItem With { _ - .Content = objEvent.EventDesc, _ - .ContentTypeId = GetContentTypeID(Constants.ContentEventTypeName), _ - .Indexed = False, _ - .ContentKey = "ItemID=" & objEvent.EventID.ToString & "&mctl=EventDetails", _ - .ModuleID = objEvent.ModuleID, _ - .TabID = tabId _ - } - - objContent.ContentItemId = Util.GetContentController().AddContentItem(objContent) - - Return objContent - End Function - - ''' - ''' This is used to update the content in the ContentItems table. Should be called when an Event is updated. - ''' - Friend Sub UpdateContentEvent(objEvent As EventInfo) - Dim objContent As ContentItem = Util.GetContentController().GetContentItem(objEvent.ContentItemID) - - If objContent Is Nothing Then - Return - End If - objContent.Content = objEvent.EventDesc - objContent.ContentKey = "ItemID=" & objEvent.EventID.ToString & "&mctl=EventDetails" - - Util.GetContentController().UpdateContentItem(objContent) - - End Sub - - ''' - ''' This removes a content item associated with an event from the data store. - ''' - ''' - Friend Sub DeleteContentItem(contentItemId As Integer) - If contentItemId <= Null.NullInteger Then - Return - End If - Dim objContent As ContentItem = Util.GetContentController().GetContentItem(contentItemId) - If objContent Is Nothing Then - Return - End If - - Util.GetContentController().DeleteContentItem(objContent) - End Sub - - ''' - ''' This is used to determine the ContentTypeID (part of the Core API) based on this module's content type. If the content type doesn't exist yet for the module, it is created. - ''' - ''' The primary key value (ContentTypeID) from the core API's Content Types table. - Friend Shared Function GetContentTypeId(ByVal contentTypeConstant As String) As Integer - Dim typeController As New ContentTypeController - Dim colContentTypes As Generic.IEnumerable(Of ContentType) = (From t In typeController.GetContentTypes() Where t.ContentType = contentTypeConstant) - Dim contentTypeId As Integer - - If colContentTypes.Any() Then - Dim contentType As ContentType = colContentTypes.[Single]() - contentTypeId = If(contentType Is Nothing, CreateContentType(contentTypeConstant), contentType.ContentTypeId) - Else - contentTypeId = CreateContentType(contentTypeConstant) - End If - - Return contentTypeId - End Function - -#Region "Private Methods" - - ''' - ''' Creates a Content Type (for taxonomy) in the data store. - ''' - ''' The primary key value of the new ContentType. - Private Shared Function CreateContentType(ByVal contentTypeConstant As String) As Integer - Dim typeController As New ContentTypeController - Dim objContentType As New ContentType With { _ - .ContentType = contentTypeConstant _ - } - - Return typeController.AddContentType(objContentType) - End Function - -#End Region - - End Class -End Namespace - diff --git a/Components/Integration/Journal.cs b/Components/Integration/Journal.cs new file mode 100644 index 0000000..3c3c20d --- /dev/null +++ b/Components/Integration/Journal.cs @@ -0,0 +1,206 @@ +using DotNetNuke.Services.Journal; +using System.Linq; + + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events.Components.Integration + { + public class Journal + { + + +#region Internal Methods + + /// + /// Informs the core journal that an event has been created. + /// + /// + /// + /// + /// + public void NewEvent(EventInfo objEvent, int tabId, string url, string imageurl) + { + string objectKey = Constants.ContentEventTypeName + "_" + Constants.JournalEventCreateTypeName + "_" + string.Format("{0}:{1}", objEvent.ModuleID, objEvent.EventID); + JournalItem ji = JournalController.Instance.GetJournalItemByKey(objEvent.PortalID, objectKey); + + if (ji != null) + { + JournalController.Instance.DeleteJournalItemByKey(objEvent.PortalID, objectKey); + } + + string securitySet = "E,"; + int socialGroupId = 0; + if (objEvent.SocialGroupId > 0) + { + securitySet = ","; + socialGroupId = objEvent.SocialGroupId; + } + else if (objEvent.SocialUserId > 0) + { + securitySet = ","; + } + + ji = new JournalItem() {PortalId = objEvent.PortalID, + ProfileId = objEvent.OwnerID, + UserId = objEvent.CreatedByID, + ContentItemId = objEvent.ContentItemID, + Title = objEvent.EventName, + ItemData = new ItemData() {Url = url, ImageUrl = imageurl}, + Summary = objEvent.Summary, + Body = objEvent.EventDesc, + JournalTypeId = GetEventCreateJournalTypeId(objEvent.PortalID), + ObjectKey = objectKey, + SecuritySet = securitySet, + SocialGroupId = socialGroupId}; + + JournalController.Instance.SaveJournalItem(ji, tabId); + } + + /// + /// Informs the core journal that an event has been deleted. + /// + /// + public void DeleteEvent(EventInfo objEvent) + { + string objectKey = Constants.ContentEventTypeName + "_" + Constants.JournalEventCreateTypeName + "_" + string.Format("{0}:{1}", objEvent.ModuleID, objEvent.EventID); + JournalController.Instance.DeleteJournalItemByKey(objEvent.PortalID, objectKey); + } + + /// + /// Informs the core journal that a user has enrolled to attend an event. + /// + /// + /// + /// + /// + /// + public void NewEnrollment(EventSignupsInfo objEventSignup, EventInfo objEvent, int tabId, string url, int userid) + { + string objectKey = Constants.ContentEventTypeName + "_" + Constants.JournalEventAttendTypeName + "_" + string.Format("{0}:{1};{2}", objEventSignup.ModuleID, objEventSignup.EventID, objEventSignup.SignupID); + JournalItem ji = JournalController.Instance.GetJournalItemByKey(objEvent.PortalID, objectKey); + + if (ji != null) + { + JournalController.Instance.DeleteJournalItemByKey(objEvent.PortalID, objectKey); + } + + string securitySet = "E,"; + int socialGroupId = 0; + if (objEvent.SocialGroupId > 0) + { + securitySet = ","; + socialGroupId = objEvent.SocialGroupId; + } + + ji = new JournalItem() {PortalId = objEvent.PortalID, + ProfileId = objEventSignup.UserID, + UserId = userid, + ContentItemId = 0, + Title = objEvent.EventName, + ItemData = new ItemData() {Url = url}, + Summary = null, + Body = null, + JournalTypeId = GetEventAttendJournalTypeId(objEvent.PortalID), + ObjectKey = objectKey, + SecuritySet = securitySet, + SocialGroupId = socialGroupId}; + + JournalController.Instance.SaveJournalItem(ji, tabId); + } + + + /// + /// Informs the core journal that a user has unenrolled from attend an event. + /// + /// + /// + /// + /// + public void DeleteEnrollment(int moduleId, int eventId, int signupId, int portalId) + { + string objectKey = Constants.ContentEventTypeName + "_" + Constants.JournalEventAttendTypeName + "_" + string.Format("{0}:{1};{2}", moduleId, eventId, signupId); + JournalController.Instance.DeleteJournalItemByKey(portalId, objectKey); + } + + +#endregion + +#region Private Methods + + /// + /// Returns a journal type associated with new event creation (using one of the core built in journal types). + /// + /// + /// + private static int GetEventCreateJournalTypeId(int portalId) + { + System.Collections.Generic.IEnumerable colJournalTypes = from t in JournalController.Instance.GetJournalTypes(portalId) where t.JournalType == Constants.JournalEventCreateTypeName select t; + int journalTypeId = 0; + + System.Collections.Generic.IEnumerable journalTypeInfos = (colJournalTypes as JournalTypeInfo[] != null) ? (colJournalTypes as JournalTypeInfo[]) : (colJournalTypes.ToArray()); + if (journalTypeInfos.Any()) + { + JournalTypeInfo journalType = journalTypeInfos.Single(); + journalTypeId = journalType.JournalTypeId; + } + else + { + journalTypeId = 21; + } + + return journalTypeId; + } + + /// + /// Returns a journal type associated with user event enrollment (using one of the core built in journal types). + /// + /// + /// + private static int GetEventAttendJournalTypeId(int portalId) + { + System.Collections.Generic.IEnumerable colJournalTypes = from t in JournalController.Instance.GetJournalTypes(portalId) where t.JournalType == Constants.JournalEventAttendTypeName select t; + int journalTypeId = 0; + + System.Collections.Generic.IEnumerable journalTypeInfos = (colJournalTypes as JournalTypeInfo[] != null) ? (colJournalTypes as JournalTypeInfo[]) : (colJournalTypes.ToArray()); + if (journalTypeInfos.Any()) + { + JournalTypeInfo journalType = journalTypeInfos.Single(); + journalTypeId = journalType.JournalTypeId; + } + else + { + journalTypeId = 22; + } + + return journalTypeId; + } + + +#endregion + + } + } + + diff --git a/Components/Integration/Journal.vb b/Components/Integration/Journal.vb deleted file mode 100644 index 4f0213d..0000000 --- a/Components/Integration/Journal.vb +++ /dev/null @@ -1,185 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2012 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - -Imports System.Linq -Imports DotNetNuke.Services.Journal -Imports System.Collections.Generic - -Namespace DotNetNuke.Modules.Events.Components.Integration - Public Class Journal - - -#Region "Internal Methods" - - ''' - ''' Informs the core journal that an event has been created. - ''' - ''' - ''' - ''' - ''' - Public Sub NewEvent(ByVal objEvent As EventInfo, ByVal tabId As Integer, url As String, ByVal imageurl As String) - Dim objectKey As String = Constants.ContentEventTypeName + "_" + Constants.JournalEventCreateTypeName & "_" & String.Format("{0}:{1}", objEvent.ModuleID, objEvent.EventID) - Dim ji As JournalItem = JournalController.Instance.GetJournalItemByKey(objEvent.PortalID, objectKey) - - If (ji IsNot Nothing) Then - JournalController.Instance.DeleteJournalItemByKey(objEvent.PortalID, objectKey) - End If - - Dim securitySet As String = "E," - Dim socialGroupId As Integer = Nothing - If objEvent.SocialGroupId > 0 Then - securitySet = "," - socialGroupId = objEvent.SocialGroupId - ElseIf objEvent.SocialUserId > 0 Then - securitySet = "," - End If - - ji = New JournalItem() With { _ - .PortalId = objEvent.PortalID, _ - .ProfileId = objEvent.OwnerID, _ - .UserId = objEvent.CreatedByID, _ - .ContentItemId = objEvent.ContentItemID, _ - .Title = objEvent.EventName, _ - .ItemData = New ItemData() With {.Url = url, .ImageUrl = imageurl}, _ - .Summary = objEvent.Summary, _ - .Body = objEvent.EventDesc, _ - .JournalTypeId = GetEventCreateJournalTypeId(objEvent.PortalID), _ - .ObjectKey = objectKey, _ - .SecuritySet = securitySet, _ - .SocialGroupId = socialGroupId _ - } - - JournalController.Instance.SaveJournalItem(ji, tabId) - End Sub - - ''' - ''' Informs the core journal that an event has been deleted. - ''' - ''' - Public Sub DeleteEvent(ByVal objEvent As EventInfo) - Dim objectKey As String = Constants.ContentEventTypeName + "_" + Constants.JournalEventCreateTypeName & "_" & String.Format("{0}:{1}", objEvent.ModuleID, objEvent.EventID) - JournalController.Instance.DeleteJournalItemByKey(objEvent.PortalID, objectKey) - End Sub - - ''' - ''' Informs the core journal that a user has enrolled to attend an event. - ''' - ''' - ''' - ''' - ''' - ''' - Public Sub NewEnrollment(ByVal objEventSignup As EventSignupsInfo, ByVal objEvent As EventInfo, ByVal tabId As Integer, url As String, ByVal userid As Integer) - Dim objectKey As String = Constants.ContentEventTypeName + "_" + Constants.JournalEventAttendTypeName & "_" & String.Format("{0}:{1};{2}", objEventSignup.ModuleID, objEventSignup.EventID, objEventSignup.SignupID) - Dim ji As JournalItem = JournalController.Instance.GetJournalItemByKey(objEvent.PortalID, objectKey) - - If (ji IsNot Nothing) Then - JournalController.Instance.DeleteJournalItemByKey(objEvent.PortalID, objectKey) - End If - - Dim securitySet As String = "E," - Dim socialGroupId As Integer = Nothing - If objEvent.SocialGroupId > 0 Then - securitySet = "," - socialGroupId = objEvent.SocialGroupId - End If - - ji = New JournalItem() With { _ - .PortalId = objEvent.PortalID, _ - .ProfileId = objEventSignup.UserID, _ - .UserId = userid, _ - .ContentItemId = Nothing, _ - .Title = objEvent.EventName, _ - .ItemData = New ItemData() With {.Url = url}, _ - .Summary = Nothing, _ - .Body = Nothing, _ - .JournalTypeId = GetEventAttendJournalTypeID(objEvent.PortalID), _ - .ObjectKey = objectKey, _ - .SecuritySet = securitySet, _ - .SocialGroupId = socialGroupId _ - } - - JournalController.Instance.SaveJournalItem(ji, tabId) - End Sub - - - ''' - ''' Informs the core journal that a user has unenrolled from attend an event. - ''' - ''' - ''' - ''' - ''' - Public Sub DeleteEnrollment(ByVal moduleId As Integer, eventId As Integer, signupId As Integer, ByVal portalId As Integer) - Dim objectKey As String = Constants.ContentEventTypeName + "_" + Constants.JournalEventAttendTypeName & "_" & String.Format("{0}:{1};{2}", moduleId, eventId, signupId) - JournalController.Instance.DeleteJournalItemByKey(portalId, objectKey) - End Sub - - -#End Region - -#Region "Private Methods" - - ''' - ''' Returns a journal type associated with new event creation (using one of the core built in journal types). - ''' - ''' - ''' - Private Shared Function GetEventCreateJournalTypeId(portalId As Integer) As Integer - Dim colJournalTypes As IEnumerable(Of JournalTypeInfo) = (From t In JournalController.Instance.GetJournalTypes(portalId) Where t.JournalType = Constants.JournalEventCreateTypeName) - Dim journalTypeId As Integer - - Dim journalTypeInfos As IEnumerable(Of JournalTypeInfo) = If(TryCast(colJournalTypes, JournalTypeInfo()), colJournalTypes.ToArray()) - If journalTypeInfos.Any() Then - Dim journalType As JournalTypeInfo = journalTypeInfos.[Single]() - journalTypeId = journalType.JournalTypeId - Else - journalTypeId = 21 - End If - - Return journalTypeId - End Function - - ''' - ''' Returns a journal type associated with user event enrollment (using one of the core built in journal types). - ''' - ''' - ''' - Private Shared Function GetEventAttendJournalTypeId(portalId As Integer) As Integer - Dim colJournalTypes As IEnumerable(Of JournalTypeInfo) = (From t In JournalController.Instance.GetJournalTypes(portalId) Where t.JournalType = Constants.JournalEventAttendTypeName) - Dim journalTypeId As Integer - - Dim journalTypeInfos As IEnumerable(Of JournalTypeInfo) = If(TryCast(colJournalTypes, JournalTypeInfo()), colJournalTypes.ToArray()) - If journalTypeInfos.Any() Then - Dim journalType As JournalTypeInfo = journalTypeInfos.[Single]() - journalTypeId = journalType.JournalTypeId - Else - journalTypeId = 22 - End If - - Return journalTypeId - End Function - - -#End Region - - End Class -End Namespace diff --git a/Components/SiteMapProvider.cs b/Components/SiteMapProvider.cs new file mode 100644 index 0000000..75c7112 --- /dev/null +++ b/Components/SiteMapProvider.cs @@ -0,0 +1,172 @@ +using Microsoft.VisualBasic; +using System.Collections; +using System; +using DotNetNuke.Entities.Portals; +using DotNetNuke.Services.Sitemap; + + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events.Providers + { + + public class Sitemap : SitemapProvider + { +#region Public Methods + public override System.Collections.Generic.List GetUrls(int portalID, PortalSettings ps, string version) + { + System.Collections.Generic.List sitemapUrls = new System.Collections.Generic.List(); + + Entities.Modules.DesktopModuleInfo objDesktopModule = default(Entities.Modules.DesktopModuleInfo); + objDesktopModule = Entities.Modules.DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", portalID); + + Entities.Modules.ModuleController objModules = new Entities.Modules.ModuleController(); + Entities.Modules.ModuleInfo objModule = default(Entities.Modules.ModuleInfo); + ArrayList lstModules = objModules.GetModulesByDefinition(portalID, objDesktopModule.FriendlyName); + ArrayList moduleIds = new ArrayList(); + ArrayList visibleModuleIds = new ArrayList(); + ArrayList visibleTabModuleIds = new ArrayList(); + foreach (Entities.Modules.ModuleInfo tempLoopVar_objModule in lstModules) + { + objModule = tempLoopVar_objModule; + DotNetNuke.Security.Permissions.TabPermissionCollection objTabPermissions = DotNetNuke.Security.Permissions.TabPermissionController.GetTabPermissions(objModule.TabID, portalID); + DotNetNuke.Security.Permissions.TabPermissionInfo objTabPermission = default(DotNetNuke.Security.Permissions.TabPermissionInfo); + foreach (DotNetNuke.Security.Permissions.TabPermissionInfo tempLoopVar_objTabPermission in objTabPermissions) + { + objTabPermission = tempLoopVar_objTabPermission; + if (objTabPermission.PermissionKey == "VIEW" && objTabPermission.RoleName != "" && objTabPermission.AllowAccess && (objTabPermission.RoleID == -1 | objTabPermission.RoleID == -3)) + { + if (objModule.InheritViewPermissions) + { + visibleTabModuleIds.Add("Tab" + objModule.TabID.ToString() + "Mod" + objModule.ModuleID.ToString()); + visibleModuleIds.Add(objModule.ModuleID); + break; + } + else + { + DotNetNuke.Security.Permissions.ModulePermissionInfo objModulePermission = default(DotNetNuke.Security.Permissions.ModulePermissionInfo); + // ReSharper disable LoopCanBeConvertedToQuery + foreach (DotNetNuke.Security.Permissions.ModulePermissionInfo tempLoopVar_objModulePermission in objModule.ModulePermissions) + { + objModulePermission = tempLoopVar_objModulePermission; + // ReSharper restore LoopCanBeConvertedToQuery + if (objModulePermission.PermissionKey == "VIEW" && objModulePermission.RoleName != "" && objModulePermission.AllowAccess && (objModulePermission.RoleID == -1 | objModulePermission.RoleID == -3)) + { + visibleTabModuleIds.Add("Tab" + objModule.TabID.ToString() + "Mod" + objModule.ModuleID.ToString()); + visibleModuleIds.Add(objModule.ModuleID); + break; + } + } + } + } + } + } + foreach (Entities.Modules.ModuleInfo tempLoopVar_objModule in lstModules) + { + objModule = tempLoopVar_objModule; + // This check for objModule = Nothing because of error in DNN 5.0.0 in GetModulesByDefinition + if (ReferenceEquals(objModule, null)) + { + continue; + } + if (objModule.IsDeleted) + { + continue; + } + if (moduleIds.Contains(objModule.ModuleID)) + { + continue; + } + if (!visibleTabModuleIds.Contains("Tab" + objModule.TabID.ToString() + "Mod" + objModule.ModuleID.ToString())) + { + continue; + } + moduleIds.Add(objModule.ModuleID); + + EventModuleSettings ems = new EventModuleSettings(); + EventModuleSettings settings = ems.GetEventModuleSettings(objModule.ModuleID, null); + if (!settings.EnableSitemap) + { + continue; + } + if (settings.SocialGroupModule == EventModuleSettings.SocialModule.UserProfile) + { + continue; + } + + ArrayList iCategoryIDs = new ArrayList(); + if (settings.Enablecategories == EventModuleSettings.DisplayCategories.DoNotDisplay) + { + iCategoryIDs = settings.ModuleCategoryIDs; + } + else + { + iCategoryIDs.Add("-1"); + } + ArrayList ilocationIDs = new ArrayList(); + if (settings.Enablelocations == EventModuleSettings.DisplayLocations.DoNotDisplay) + { + ilocationIDs = settings.ModuleLocationIDs; + } + else + { + ilocationIDs.Add("-1"); + } + + EventTimeZoneUtilities objEventTimeZoneUtilities = new EventTimeZoneUtilities(); + DateTime currDate = objEventTimeZoneUtilities.ConvertFromUTCToModuleTimeZone(DateTime.UtcNow, settings.TimeZoneId); + DateTime dtStartDate = DateAndTime.DateAdd(DateInterval.Day, System.Convert.ToDouble(- settings.SiteMapDaysBefore), currDate); + DateTime dtEndDate = DateAndTime.DateAdd(DateInterval.Day, settings.SiteMapDaysAfter, currDate); + + EventInfoHelper objEventInfoHelper = new EventInfoHelper(objModule.ModuleID, objModule.TabID, portalID, settings); + ArrayList lstevents = default(ArrayList); + lstevents = objEventInfoHelper.GetEvents(dtStartDate, dtEndDate, settings.MasterEvent, iCategoryIDs, ilocationIDs, -1, -1); + + EventInfo objEvent = default(EventInfo); + foreach (EventInfo tempLoopVar_objEvent in lstevents) + { + objEvent = tempLoopVar_objEvent; + if (settings.Enforcesubcalperms && !visibleModuleIds.Contains(objEvent.ModuleID)) + { + continue; + } + SitemapUrl pageUrl = new SitemapUrl(); + pageUrl.Url = objEventInfoHelper.DetailPageURL(objEvent, false); + pageUrl.Priority = settings.SiteMapPriority; + pageUrl.LastModified = objEvent.LastUpdatedAt; + pageUrl.ChangeFrequency = SitemapChangeFrequency.Daily; + sitemapUrls.Add(pageUrl); + } + } + + return sitemapUrls; + } + +#endregion + + } + + } + + diff --git a/Components/SiteMapProvider.vb b/Components/SiteMapProvider.vb deleted file mode 100644 index 75cd47b..0000000 --- a/Components/SiteMapProvider.vb +++ /dev/null @@ -1,134 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports DotNetNuke.Entities.Portals -Imports DotNetNuke.Services.Sitemap - -Namespace DotNetNuke.Modules.Events.Providers - - Public Class Sitemap - Inherits SitemapProvider -#Region "Public Methods" - Public Overrides Function GetUrls(ByVal portalID As Integer, ByVal ps As PortalSettings, ByVal version As String) As Generic.List(Of SitemapUrl) - Dim sitemapUrls As New Generic.List(Of SitemapUrl) - - Dim objDesktopModule As Entities.Modules.DesktopModuleInfo - objDesktopModule = Entities.Modules.DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", portalID) - - Dim objModules As New Entities.Modules.ModuleController - Dim objModule As Entities.Modules.ModuleInfo - Dim lstModules As ArrayList = objModules.GetModulesByDefinition(portalID, objDesktopModule.FriendlyName) - Dim moduleIds As New ArrayList - Dim visibleModuleIds As New ArrayList - Dim visibleTabModuleIds As New ArrayList - For Each objModule In lstModules - Dim objTabPermissions As Security.Permissions.TabPermissionCollection = Security.Permissions.TabPermissionController.GetTabPermissions(objModule.TabID, portalID) - Dim objTabPermission As Security.Permissions.TabPermissionInfo - For Each objTabPermission In objTabPermissions - If objTabPermission.PermissionKey = "VIEW" And objTabPermission.RoleName <> "" And objTabPermission.AllowAccess And (objTabPermission.RoleID = -1 Or objTabPermission.RoleID = -3) Then - If objModule.InheritViewPermissions Then - visibleTabModuleIds.Add("Tab" & objModule.TabID.ToString & "Mod" & objModule.ModuleID.ToString) - visibleModuleIds.Add(objModule.ModuleID) - Exit For - Else - Dim objModulePermission As Security.Permissions.ModulePermissionInfo - ' ReSharper disable LoopCanBeConvertedToQuery - For Each objModulePermission In objModule.ModulePermissions - ' ReSharper restore LoopCanBeConvertedToQuery - If objModulePermission.PermissionKey = "VIEW" And objModulePermission.RoleName <> "" And objModulePermission.AllowAccess And (objModulePermission.RoleID = -1 Or objModulePermission.RoleID = -3) Then - visibleTabModuleIds.Add("Tab" & objModule.TabID.ToString & "Mod" & objModule.ModuleID.ToString) - visibleModuleIds.Add(objModule.ModuleID) - Exit For - End If - Next - End If - End If - Next - Next - For Each objModule In lstModules - ' This check for objModule = Nothing because of error in DNN 5.0.0 in GetModulesByDefinition - If objModule Is Nothing Then - Continue For - End If - If objModule.IsDeleted Then - Continue For - End If - If moduleIds.Contains(objModule.ModuleID) Then - Continue For - End If - If Not visibleTabModuleIds.Contains("Tab" & objModule.TabID.ToString & "Mod" & objModule.ModuleID.ToString) Then - Continue For - End If - moduleIds.Add(objModule.ModuleID) - - Dim ems As New EventModuleSettings - Dim settings As EventModuleSettings = ems.GetEventModuleSettings(objModule.ModuleID, Nothing) - If Not settings.enableSitemap Then - Continue For - End If - If settings.SocialGroupModule = EventModuleSettings.SocialModule.UserProfile Then - Continue For - End If - - Dim iCategoryIDs As New ArrayList - If settings.enablecategories = EventModuleSettings.DisplayCategories.DoNotDisplay Then - iCategoryIDs = settings.ModuleCategoryIDs - Else - iCategoryIDs.Add("-1") - End If - Dim ilocationIDs As New ArrayList - If settings.Enablelocations = EventModuleSettings.DisplayLocations.DoNotDisplay Then - ilocationIDs = settings.ModuleLocationIDs - Else - ilocationIDs.Add("-1") - End If - - Dim objEventTimeZoneUtilities As New EventTimeZoneUtilities - Dim currDate As DateTime = objEventTimeZoneUtilities.ConvertFromUTCToModuleTimeZone(Date.UtcNow, settings.TimeZoneId) - Dim dtStartDate As DateTime = DateAdd(DateInterval.Day, -settings.siteMapDaysBefore, currDate) - Dim dtEndDate As DateTime = DateAdd(DateInterval.Day, settings.siteMapDaysAfter, currDate) - - Dim objEventInfoHelper As New EventInfoHelper(objModule.ModuleID, objModule.TabID, portalID, settings) - Dim lstevents As ArrayList - lstevents = objEventInfoHelper.GetEvents(dtStartDate, dtEndDate, settings.MasterEvent, iCategoryIDs, ilocationIDs, -1, -1) - - Dim objEvent As EventInfo - For Each objEvent In lstevents - If settings.enforcesubcalperms And Not visibleModuleIds.Contains(objEvent.ModuleID) Then - Continue For - End If - Dim pageUrl As New SitemapUrl - With pageUrl - .Url = objEventInfoHelper.DetailPageURL(objEvent, False) - .Priority = settings.siteMapPriority - .LastModified = objEvent.LastUpdatedAt - .ChangeFrequency = SitemapChangeFrequency.Daily - End With - sitemapUrls.Add(pageUrl) - Next - Next - - Return sitemapUrls - End Function - -#End Region - - End Class - -End Namespace diff --git a/Components/SqlDataProvider.cs b/Components/SqlDataProvider.cs new file mode 100644 index 0000000..5f046d4 --- /dev/null +++ b/Components/SqlDataProvider.cs @@ -0,0 +1,430 @@ +using System.Data; +using System; +using Microsoft.ApplicationBlocks.Data; + + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events + { + + public class SqlDataProvider : DataProvider + { + + +#region Private Data + private const string ProviderType = "data"; + private Framework.Providers.ProviderConfiguration _providerConfiguration = Framework.Providers.ProviderConfiguration.GetProviderConfiguration(ProviderType); + private string _connectionString; + private string _providerPath; + private string _objectQualifier; + private string _databaseOwner; +#endregion + +#region Base Methods + public SqlDataProvider() + { + + // Read the configuration specific information for this provider + Framework.Providers.Provider objProvider = (Framework.Providers.Provider) (_providerConfiguration.Providers[_providerConfiguration.DefaultProvider]); + + // This code handles getting the connection string from either the connectionString / appsetting section and uses the connectionstring section by default if it exists. + // Get Connection string from web.config + _connectionString = Common.Utilities.Config.GetConnectionString(); + + // If above funtion does not return anything then connectionString must be set in the dataprovider section. + if (string.IsNullOrEmpty(_connectionString)) + { + // Use connection string specified in provider + _connectionString = objProvider.Attributes["connectionString"]; + } + + _providerPath = objProvider.Attributes["providerPath"]; + + _objectQualifier = objProvider.Attributes["objectQualifier"]; + if (!string.IsNullOrEmpty(_objectQualifier)&& _objectQualifier.EndsWith("_") == false) + { + _objectQualifier += "_"; + } + + _databaseOwner = objProvider.Attributes["databaseOwner"]; + if (!string.IsNullOrEmpty(_databaseOwner)&& _databaseOwner.EndsWith(".") == false) + { + _databaseOwner += "."; + } + + } + + public string ConnectionString + { + get + { + return _connectionString; + } + } + + public string ProviderPath + { + get + { + return _providerPath; + } + } + + public override string ObjectQualifier + { + get + { + return _objectQualifier; + } + } + + public override string DatabaseOwner + { + get + { + return _databaseOwner; + } + } +#endregion + +#region Event Methods + + public override void EventsDelete(int eventId, int moduleId) + { + SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsDelete", eventId, moduleId); + } + + public override IDataReader EventsGet(int eventId, int moduleId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsGet", eventId, moduleId))); + } + + public override IDataReader EventsGetByRange(string modules, DateTime beginDate, DateTime endDate, string categoryIDs, string locationIDs, int socialGroupId, int socialUserId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsGetByRange", modules, beginDate, endDate, categoryIDs, locationIDs, socialGroupId, socialUserId))); + } + + public override IDataReader EventsSave(int portalId, int eventId, int recurMasterId, int moduleId, DateTime eventTimeBegin, int duration, string eventName, string eventDesc, int importance, string createdById, string notify, bool approved, bool signups, int maxEnrollment, int enrollRoleId, decimal enrollFee, string enrollType, string payPalAccount, bool cancelled, bool detailPage, bool detailNewWin, string detailUrl, string imageUrl, string imageType, int imageWidth, int imageHeight, bool imageDisplay, int location, int category, string reminder, bool sendReminder, int reminderTime, string reminderTimeMeasurement, string reminderFrom, bool searchSubmitted, string customField1, string customField2, bool enrollListView, bool displayEndDate, bool allDayEvent, int ownerId, int lastUpdatedId, DateTime originalDateBegin, bool newEventEmailSent, bool allowAnonEnroll, int contentItemId, bool journalItem, string summary, bool saveOnly) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsSave", portalId, eventId, recurMasterId, moduleId, + eventTimeBegin, duration, eventName, eventDesc, importance, + createdById, notify, approved, signups, maxEnrollment, enrollRoleId, + enrollFee, enrollType, payPalAccount, cancelled, detailPage, detailNewWin, detailUrl, + imageUrl, imageType, imageWidth, imageHeight, + imageDisplay, location, category, + reminder, sendReminder, reminderTime, reminderTimeMeasurement, reminderFrom, searchSubmitted, + customField1, customField2, enrollListView, displayEndDate, allDayEvent, + ownerId, lastUpdatedId, originalDateBegin, newEventEmailSent, allowAnonEnroll, contentItemId, journalItem, summary, saveOnly))); + } + + public override IDataReader EventsModerateEvents(int moduleId, int socialGroupId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsModerateEvents", moduleId, socialGroupId))); + } + + public override int EventsTimeZoneCount(int moduleId) + { + return System.Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsTimeZoneCount", moduleId)); + } + + public override void EventsUpgrade(string moduleVersion) + { + SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsUpgrade", moduleVersion); + } + + public override void EventsCleanupExpired(int portalId, int moduleId) + { + SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsCleanupExpired", portalId, moduleId); + } + + public override IDataReader EventsGetRecurrences(int recurMasterId, int moduleId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsGetRecurrences", recurMasterId, moduleId))); + } + + +#endregion + +#region Master Events Methods + + public override void EventsMasterDelete(int masterId, int moduleId) + { + SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsMasterDelete", masterId, moduleId); + } + + public override IDataReader EventsMasterAssignedModules(int moduleId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsMasterAssignedModules", moduleId))); + } + + public override IDataReader EventsMasterAvailableModules(int portalId, int moduleId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsMasterAvailableModules", portalId, moduleId))); + } + + public override IDataReader EventsMasterGet(int moduleId, int subEventId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsMasterGet", moduleId, subEventId))); + } + + public override IDataReader EventsMasterSave(int masterId, int moduleId, int subEventId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsMasterSave", masterId, moduleId, subEventId))); + } + +#endregion + +#region Events Signup Methods + public override void EventsSignupsDelete(int signupId, int moduleId) + { + SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsSignupsDelete", signupId, moduleId); + } + + public override IDataReader EventsSignupsGet(int signupId, int moduleId, bool ppipn) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsSignupsGet", signupId, moduleId, ppipn))); + } + + public override IDataReader EventsSignupsGetEvent(int eventId, int moduleId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsSignupsGetEvent", eventId, moduleId))); + } + + public override IDataReader EventsSignupsGetEventRecurMaster(int recurMasterId, int moduleId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsSignupsGetEventRecurMaster", recurMasterId, moduleId))); + } + + public override IDataReader EventsSignupsGetUser(int eventId, int userId, int moduleId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsSignupsGetUser", eventId, userId, moduleId))); + } + + public override IDataReader EventsSignupsGetAnonUser(int eventId, string anonEmail, int moduleId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsSignupsGetAnonUser", eventId, anonEmail, moduleId))); + } + + public override IDataReader EventsSignupsMyEnrollments(int moduleId, int userId, int socialGroupId, string categoryIDs, DateTime beginDate, DateTime endDate) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsSignupsMyEnrollments", moduleId, userId, socialGroupId, categoryIDs, beginDate, endDate))); + } + + public override IDataReader EventsSignupsSave(int eventId, int signupId, int moduleId, int userId, bool approved, string + payPalStatus, string payPalReason, string payPalTransId, string payPalPayerId, string payPalPayerStatus, + string payPalRecieverEmail, string payPalUserEmail, string payPalPayerEmail, + string payPalFirstName, string payPalLastName, string payPalAddress, string payPalCity, + string payPalState, string payPalZip, string payPalCountry, string payPalCurrency, + DateTime payPalPaymentDate, decimal payPalAmount, decimal payPalFee, + int noEnrolees, string anonEmail, string anonName, string anonTelephone, string anonCulture, + string anonTimeZoneId, string firstName, string lastName, string company, + string jobTitle, string referenceNumber, string street, + string postalCode, string city, string region, string country) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsSignupsSave", + eventId, signupId, moduleId, userId, approved, + payPalStatus, payPalReason, payPalTransId, payPalPayerId, + payPalPayerStatus, payPalRecieverEmail, payPalUserEmail, + payPalPayerEmail, payPalFirstName, payPalLastName, payPalAddress, + payPalCity, payPalState, payPalZip, payPalCountry, + payPalCurrency, payPalPaymentDate, payPalAmount, payPalFee, noEnrolees, anonEmail, anonName, anonTelephone, + anonCulture, anonTimeZoneId, firstName, lastName, company, jobTitle, referenceNumber, + street, postalCode, city, region, country))); + } + + public override IDataReader EventsModerateSignups(int moduleId, int socialGroupId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsModerateSignups", moduleId, socialGroupId))); + } + + +#endregion + +#region Events Category and Location Methods + public override void EventsCategoryDelete(int category, int portalId) + { + SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsCategoryDelete", category, portalId); + } + + public override IDataReader EventsCategoryGet(int category, int portalId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsCategoryGet", category, portalId))); + } + + public override IDataReader EventsCategoryGetByName(string categoryName, int portalId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsCategoryGetByName", categoryName, portalId))); + } + + public override IDataReader EventsCategoryList(int portalId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsCategoryList", portalId))); + } + + public override IDataReader EventsCategorySave(int portalId, int category, string + categoryName, string color, string fontColor) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsCategorySave", portalId, category, + categoryName, color, fontColor))); + } + + public override void EventsLocationDelete(int location, int portalId) + { + SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsLocationDelete", location, portalId); + } + + public override IDataReader EventsLocationGet(int location, int portalId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsLocationGet", location, portalId))); + } + + public override IDataReader EventsLocationGetByName(string locationName, int portalId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsLocationGetByName", locationName, portalId))); + } + + public override IDataReader EventsLocationList(int portalId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsLocationList", portalId))); + } + + public override IDataReader EventsLocationSave(int portalId, int location, string + locationName, string mapUrl, string street, + string postalCode, string city, string region, + string country) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsLocationSave", portalId, location, + locationName, mapUrl, street, postalCode, city, region, country))); + } +#endregion + +#region PPErrorLog Methods + + public override IDataReader EventsPpErrorLogAdd(int signupId, string + payPalStatus, string payPalReason, string payPalTransId, string payPalPayerId, string payPalPayerStatus, + string payPalRecieverEmail, string payPalUserEmail, string payPalPayerEmail, + string payPalFirstName, string payPalLastName, string payPalAddress, string payPalCity, + string payPalState, string payPalZip, string payPalCountry, string payPalCurrency, + DateTime payPalPaymentDate, double payPalAmount, double payPalFee) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsPPErrorLogAdd", + signupId, + payPalStatus, payPalReason, payPalTransId, payPalPayerId, + payPalPayerStatus, payPalRecieverEmail, payPalUserEmail, + payPalPayerEmail, payPalFirstName, payPalLastName, payPalAddress, + payPalCity, payPalState, payPalZip, payPalCountry, + payPalCurrency, payPalPaymentDate, payPalAmount, payPalFee))); + } + +#endregion + +#region Events Notification Methods + public override void EventsNotificationTimeChange(int eventId, DateTime eventTimeBegin, int moduleId) + { + SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsNotificationTimeChange", eventId, eventTimeBegin, moduleId); + } + + public override void EventsNotificationDelete(DateTime deleteDate) + { + SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsNotificationDelete", deleteDate); + } + + public override IDataReader EventsNotificationGet(int eventId, string userEmail, int moduleId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsNotificationGet", eventId, userEmail, moduleId))); + } + + public override IDataReader EventsNotificationsToSend(DateTime notifyTime) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsNotificationsToSend", notifyTime))); + } + + public override IDataReader EventsNotificationSave(int notificationId, int eventId, int portalAliasId, string userEmail, bool notificationSent, DateTime notifyByDateTime, DateTime eventTimeBegin, string notifyLanguage, int moduleId, int tabId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsNotificationSave", notificationId, eventId, portalAliasId, userEmail, notificationSent, notifyByDateTime, eventTimeBegin, notifyLanguage, moduleId, tabId))); + } + +#endregion + +#region Event Recur Master Methods + public override void EventsRecurMasterDelete(int recurMasterId, int moduleId) + { + SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsRecurMasterDelete", recurMasterId, moduleId); + } + + public override IDataReader EventsRecurMasterGet(int recurMasterId, int moduleId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsRecurMasterGet", recurMasterId, moduleId))); + } + + public override IDataReader EventsRecurMasterSave(int recurMasterId, int moduleId, int portalId, string rrule, DateTime dtstart, string duration, DateTime Until, string eventName, string eventDesc, int importance, string notify, bool approved, bool signups, int maxEnrollment, int enrollRoleId, decimal enrollFee, string enrollType, string payPalAccount, bool detailPage, bool detailNewWin, string detailUrl, string imageUrl, string imageType, int imageWidth, int imageHeight, bool imageDisplay, int location, int category, string reminder, bool sendReminder, int reminderTime, string reminderTimeMeasurement, string reminderFrom, string customField1, string customField2, bool enrollListView, bool displayEndDate, bool allDayEvent, string cultureName, int ownerId, int createdById, int updatedById, string eventTimeZoneId, bool allowAnonEnroll, int contentItemId, int socialGroupId, int socialUserId, string summary) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsRecurMasterSave", recurMasterId, moduleId, portalId, rrule, + dtstart, duration, Until, eventName, eventDesc, importance, notify, approved, + signups, maxEnrollment, enrollRoleId, + enrollFee, enrollType, payPalAccount, detailPage, detailNewWin, detailUrl, imageUrl, imageType, imageWidth, imageHeight, + imageDisplay, location, category, reminder, sendReminder, reminderTime, + reminderTimeMeasurement, reminderFrom, customField1, customField2, enrollListView, displayEndDate, allDayEvent, cultureName, ownerId, + createdById, updatedById, eventTimeZoneId, allowAnonEnroll, contentItemId, socialGroupId, socialUserId, summary))); + } + + public override IDataReader EventsRecurMasterModerate(int moduleId, int socialGroupId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsRecurMasterModerate", moduleId, socialGroupId))); + } + + +#endregion + +#region Event Subscription Methods + public override void EventsSubscriptionDeleteUser(int userId, int moduleId) + { + SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsSubscriptionDeleteUser", userId, moduleId); + } + + public override IDataReader EventsSubscriptionGetUser(int userId, int moduleId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsSubscriptionGetUser", userId, moduleId))); + } + + public override IDataReader EventsSubscriptionGetModule(int moduleId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsSubscriptionGetModule", moduleId))); + } + + public override IDataReader EventsSubscriptionGetSubModule(int moduleId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsSubscriptionGetSubModule", moduleId))); + } + + public override IDataReader EventsSubscriptionSave(int subscriptionId, int moduleId, int portalId, int userId) + { + return ((IDataReader) (SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner + ObjectQualifier + "EventsSubscriptionSave", subscriptionId, moduleId, portalId, userId))); + } + +#endregion + } + + } diff --git a/Components/SqlDataProvider.vb b/Components/SqlDataProvider.vb deleted file mode 100644 index 303a614..0000000 --- a/Components/SqlDataProvider.vb +++ /dev/null @@ -1,392 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports System -Imports System.Data -Imports Microsoft.ApplicationBlocks.Data - -Namespace DotNetNuke.Modules.Events - - Public Class SqlDataProvider - - Inherits DataProvider - -#Region "Private Data" - Private Const ProviderType As String = "data" - Private ReadOnly _providerConfiguration As Framework.Providers.ProviderConfiguration = Framework.Providers.ProviderConfiguration.GetProviderConfiguration(ProviderType) - Private ReadOnly _connectionString As String - Private ReadOnly _providerPath As String - Private ReadOnly _objectQualifier As String - Private ReadOnly _databaseOwner As String -#End Region - -#Region "Base Methods" - Public Sub New() - - ' Read the configuration specific information for this provider - Dim objProvider As Framework.Providers.Provider = CType(_providerConfiguration.Providers(_providerConfiguration.DefaultProvider), Framework.Providers.Provider) - - ' This code handles getting the connection string from either the connectionString / appsetting section and uses the connectionstring section by default if it exists. - ' Get Connection string from web.config - _connectionString = Common.Utilities.Config.GetConnectionString() - - ' If above funtion does not return anything then connectionString must be set in the dataprovider section. - If _connectionString = "" Then - ' Use connection string specified in provider - _connectionString = objProvider.Attributes("connectionString") - End If - - _providerPath = objProvider.Attributes("providerPath") - - _objectQualifier = objProvider.Attributes("objectQualifier") - If _objectQualifier <> "" And _objectQualifier.EndsWith("_") = False Then - _objectQualifier += "_" - End If - - _databaseOwner = objProvider.Attributes("databaseOwner") - If _databaseOwner <> "" And _databaseOwner.EndsWith(".") = False Then - _databaseOwner += "." - End If - - End Sub - - Public ReadOnly Property ConnectionString() As String - Get - Return _connectionString - End Get - End Property - - Public ReadOnly Property ProviderPath() As String - Get - Return _providerPath - End Get - End Property - - Public Overrides ReadOnly Property ObjectQualifier() As String - Get - Return _objectQualifier - End Get - End Property - - Public Overrides ReadOnly Property DatabaseOwner() As String - Get - Return _databaseOwner - End Get - End Property -#End Region - -#Region "Event Methods" - - Public Overrides Sub EventsDelete(ByVal eventId As Integer, ByVal moduleId As Integer) - SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsDelete", eventId, moduleId) - End Sub - - Public Overrides Function EventsGet(ByVal eventId As Integer, ByVal moduleId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsGet", eventId, moduleId), IDataReader) - End Function - - Public Overrides Function EventsGetByRange(ByVal modules As String, ByVal beginDate As DateTime, ByVal endDate As DateTime, ByVal categoryIDs As String, ByVal locationIDs As String, ByVal socialGroupId As Integer, ByVal socialUserId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsGetByRange", modules, beginDate, endDate, categoryIDs, locationIDs, socialGroupId, socialUserId), IDataReader) - End Function - - Public Overrides Function EventsSave(ByVal portalId As Integer, ByVal eventId As Integer, ByVal recurMasterId As Integer, ByVal moduleId As Integer, _ - ByVal eventTimeBegin As DateTime, ByVal duration As Integer, ByVal eventName As String, _ - ByVal eventDesc As String, ByVal importance As Integer, ByVal createdById As String, _ - ByVal notify As String, ByVal approved As Boolean, _ - ByVal signups As Boolean, ByVal maxEnrollment As Integer, ByVal enrollRoleId As Integer, _ - ByVal enrollFee As Decimal, ByVal enrollType As String, ByVal payPalAccount As String, _ - ByVal cancelled As Boolean, ByVal detailPage As Boolean, ByVal detailNewWin As Boolean, ByVal detailUrl As String, _ - ByVal imageUrl As String, ByVal imageType As String, ByVal imageWidth As Integer, ByVal imageHeight As Integer, _ - ByVal imageDisplay As Boolean, ByVal location As Integer, _ - ByVal category As Integer, _ - ByVal reminder As String, ByVal sendReminder As Boolean, ByVal reminderTime As Integer, _ - ByVal reminderTimeMeasurement As String, ByVal reminderFrom As String, ByVal searchSubmitted As Boolean, _ - ByVal customField1 As String, ByVal customField2 As String, ByVal enrollListView As Boolean, ByVal displayEndDate As Boolean, _ - ByVal allDayEvent As Boolean, ByVal ownerId As Integer, ByVal lastUpdatedId As Integer, ByVal originalDateBegin As DateTime, _ - ByVal newEventEmailSent As Boolean, ByVal allowAnonEnroll As Boolean, ByVal contentItemId As Integer, ByVal journalItem As Boolean, _ - ByVal summary As String, ByVal saveOnly As Boolean) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsSave", portalId, eventId, recurMasterId, moduleId, _ - eventTimeBegin, duration, eventName, eventDesc, importance, _ - createdById, notify, approved, signups, maxEnrollment, enrollRoleId, _ - enrollFee, enrollType, payPalAccount, cancelled, detailPage, detailNewWin, detailUrl, _ - imageUrl, imageType, imageWidth, imageHeight, _ - imageDisplay, location, category, _ - reminder, sendReminder, reminderTime, reminderTimeMeasurement, reminderFrom, searchSubmitted, _ - customField1, customField2, enrollListView, displayEndDate, allDayEvent, _ - ownerId, lastUpdatedId, originalDateBegin, newEventEmailSent, allowAnonEnroll, contentItemId, journalItem, summary, saveOnly), IDataReader) - End Function - - Public Overrides Function EventsModerateEvents(ByVal moduleId As Integer, ByVal socialGroupId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsModerateEvents", moduleId, socialGroupId), IDataReader) - End Function - - Public Overrides Function EventsTimeZoneCount(ByVal moduleId As Integer) As Integer - Return CType(SqlHelper.ExecuteScalar(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsTimeZoneCount", moduleId), Integer) - End Function - - Public Overrides Sub EventsUpgrade(ByVal moduleVersion As String) - SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsUpgrade", moduleVersion) - End Sub - - Public Overrides Sub EventsCleanupExpired(ByVal portalId As Integer, ByVal moduleId As Integer) - SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsCleanupExpired", portalId, moduleId) - End Sub - - Public Overrides Function EventsGetRecurrences(ByVal recurMasterId As Integer, ByVal moduleId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsGetRecurrences", recurMasterId, moduleId), IDataReader) - End Function - - -#End Region - -#Region "Master Events Methods" - - Public Overrides Sub EventsMasterDelete(ByVal masterId As Integer, ByVal moduleId As Integer) - SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsMasterDelete", MasterID, ModuleID) - End Sub - - Public Overrides Function EventsMasterAssignedModules(ByVal moduleId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsMasterAssignedModules", ModuleID), IDataReader) - End Function - - Public Overrides Function EventsMasterAvailableModules(ByVal portalId As Integer, ByVal moduleId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsMasterAvailableModules", PortalID, ModuleID), IDataReader) - End Function - - Public Overrides Function EventsMasterGet(ByVal moduleId As Integer, ByVal subEventId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsMasterGet", moduleId, subEventId), IDataReader) - End Function - - Public Overrides Function EventsMasterSave(ByVal masterId As Integer, ByVal moduleId As Integer, ByVal subEventId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsMasterSave", masterId, moduleId, subEventId), IDataReader) - End Function - -#End Region - -#Region "Events Signup Methods" - Public Overrides Sub EventsSignupsDelete(ByVal signupId As Integer, ByVal moduleId As Integer) - SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsSignupsDelete", SignupID, ModuleID) - End Sub - - Public Overrides Function EventsSignupsGet(ByVal signupId As Integer, ByVal moduleId As Integer, ByVal ppipn As Boolean) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsSignupsGet", signupId, moduleId, PPIPN), IDataReader) - End Function - - Public Overrides Function EventsSignupsGetEvent(ByVal eventId As Integer, ByVal moduleId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsSignupsGetEvent", EventID, ModuleID), IDataReader) - End Function - - Public Overrides Function EventsSignupsGetEventRecurMaster(ByVal recurMasterId As Integer, ByVal moduleId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsSignupsGetEventRecurMaster", RecurMasterID, ModuleID), IDataReader) - End Function - - Public Overrides Function EventsSignupsGetUser(ByVal eventId As Integer, ByVal userId As Integer, ByVal moduleId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsSignupsGetUser", EventID, UserID, ModuleID), IDataReader) - End Function - - Public Overrides Function EventsSignupsGetAnonUser(ByVal eventId As Integer, ByVal anonEmail As String, ByVal moduleId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsSignupsGetAnonUser", eventId, AnonEmail, ModuleID), IDataReader) - End Function - - Public Overrides Function EventsSignupsMyEnrollments(ByVal moduleId As Integer, ByVal userId As Integer, ByVal socialGroupId As Integer, ByVal categoryIDs As String, ByVal beginDate As DateTime, ByVal endDate As DateTime) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsSignupsMyEnrollments", moduleId, userId, socialGroupId, categoryIDs, beginDate, EndDate), IDataReader) - End Function - - Public Overrides Function EventsSignupsSave(ByVal eventId As Integer, ByVal signupId As Integer, ByVal moduleId As Integer, ByVal userId As Integer, ByVal approved As Boolean, _ - ByVal payPalStatus As String, ByVal payPalReason As String, ByVal payPalTransId As String, ByVal payPalPayerId As String, _ - ByVal payPalPayerStatus As String, ByVal payPalRecieverEmail As String, ByVal payPalUserEmail As String, _ - ByVal payPalPayerEmail As String, ByVal payPalFirstName As String, ByVal payPalLastName As String, ByVal payPalAddress As String, _ - ByVal payPalCity As String, ByVal payPalState As String, ByVal payPalZip As String, ByVal payPalCountry As String, _ - ByVal payPalCurrency As String, ByVal payPalPaymentDate As DateTime, ByVal payPalAmount As Decimal, ByVal payPalFee As Decimal, _ - ByVal noEnrolees As Integer, ByVal anonEmail As String, ByVal anonName As String, ByVal anonTelephone As String, _ - ByVal anonCulture As String, ByVal anonTimeZoneId As String, ByVal firstName As String, ByVal lastName As String, _ - ByVal company As String, ByVal jobTitle As String, ByVal referenceNumber As String, _ - ByVal street As String, ByVal postalCode As String, ByVal city As String, ByVal region As String, ByVal country As String _ - ) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsSignupsSave", _ - eventId, signupId, moduleId, userId, approved, _ - payPalStatus, payPalReason, payPalTransId, payPalPayerId, _ - payPalPayerStatus, payPalRecieverEmail, payPalUserEmail, _ - payPalPayerEmail, payPalFirstName, payPalLastName, payPalAddress, _ - payPalCity, payPalState, payPalZip, payPalCountry, _ - payPalCurrency, payPalPaymentDate, payPalAmount, payPalFee, noEnrolees, anonEmail, anonName, anonTelephone, _ - anonCulture, anonTimeZoneId, firstName, lastName, company, jobTitle, referenceNumber, _ - street, postalCode, city, region, country), IDataReader) - End Function - - Public Overrides Function EventsModerateSignups(ByVal moduleId As Integer, ByVal socialGroupId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsModerateSignups", ModuleID, SocialGroupId), IDataReader) - End Function - - -#End Region - -#Region "Events Category and Location Methods" - Public Overrides Sub EventsCategoryDelete(ByVal category As Integer, ByVal portalId As Integer) - SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsCategoryDelete", Category, PortalID) - End Sub - - Public Overrides Function EventsCategoryGet(ByVal category As Integer, ByVal portalId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsCategoryGet", Category, PortalID), IDataReader) - End Function - - Public Overrides Function EventsCategoryGetByName(ByVal categoryName As String, ByVal portalId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsCategoryGetByName", CategoryName, PortalID), IDataReader) - End Function - - Public Overrides Function EventsCategoryList(ByVal portalId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsCategoryList", PortalId), IDataReader) - End Function - - Public Overrides Function EventsCategorySave(ByVal portalId As Integer, ByVal category As Integer, _ - ByVal categoryName As String, ByVal color As String, ByVal fontColor As String) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsCategorySave", PortalID, Category, _ - CategoryName, Color, FontColor), IDataReader) - End Function - - Public Overrides Sub EventsLocationDelete(ByVal location As Integer, ByVal portalId As Integer) - SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsLocationDelete", Location, PortalID) - End Sub - - Public Overrides Function EventsLocationGet(ByVal location As Integer, ByVal portalId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsLocationGet", Location, PortalID), IDataReader) - End Function - - Public Overrides Function EventsLocationGetByName(ByVal locationName As String, ByVal portalId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsLocationGetByName", locationName, portalId), IDataReader) - End Function - - Public Overrides Function EventsLocationList(ByVal portalId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsLocationList", PortalId), IDataReader) - End Function - - Public Overrides Function EventsLocationSave(ByVal portalId As Integer, ByVal location As Integer, _ - ByVal locationName As String, ByVal mapUrl As String, _ - ByVal street As String, ByVal postalCode As String, ByVal city As String, _ - ByVal region As String, ByVal country As String) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsLocationSave", portalId, location, _ - locationName, mapUrl, street, postalCode, city, region, country), IDataReader) - End Function -#End Region - -#Region "PPErrorLog Methods" - - Public Overrides Function EventsPpErrorLogAdd(ByVal signupId As Integer, _ - ByVal payPalStatus As String, ByVal payPalReason As String, ByVal payPalTransId As String, ByVal payPalPayerId As String, _ - ByVal payPalPayerStatus As String, ByVal payPalRecieverEmail As String, ByVal payPalUserEmail As String, _ - ByVal payPalPayerEmail As String, ByVal payPalFirstName As String, ByVal payPalLastName As String, ByVal payPalAddress As String, _ - ByVal payPalCity As String, ByVal payPalState As String, ByVal payPalZip As String, ByVal payPalCountry As String, _ - ByVal payPalCurrency As String, ByVal payPalPaymentDate As DateTime, ByVal payPalAmount As Double, ByVal payPalFee As Double) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsPPErrorLogAdd", _ - signupId, _ - payPalStatus, payPalReason, payPalTransId, payPalPayerId, _ - payPalPayerStatus, payPalRecieverEmail, payPalUserEmail, _ - payPalPayerEmail, payPalFirstName, payPalLastName, payPalAddress, _ - payPalCity, payPalState, payPalZip, payPalCountry, _ - payPalCurrency, payPalPaymentDate, payPalAmount, PayPalFee _ - ), IDataReader) - End Function - -#End Region - -#Region "Events Notification Methods" - Public Overrides Sub EventsNotificationTimeChange(ByVal eventId As Integer, ByVal eventTimeBegin As DateTime, ByVal moduleId As Integer) - SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsNotificationTimeChange", EventID, EventTimeBegin, ModuleID) - End Sub - - Public Overrides Sub EventsNotificationDelete(ByVal deleteDate As DateTime) - SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsNotificationDelete", DeleteDate) - End Sub - - Public Overrides Function EventsNotificationGet(ByVal eventId As Integer, ByVal userEmail As String, ByVal moduleId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsNotificationGet", eventId, UserEmail, ModuleID), IDataReader) - End Function - - Public Overrides Function EventsNotificationsToSend(ByVal notifyTime As DateTime) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsNotificationsToSend", NotifyTime), IDataReader) - End Function - - Public Overrides Function EventsNotificationSave(ByVal notificationId As Integer, ByVal eventId As Integer, ByVal portalAliasId As Integer, ByVal userEmail As String, ByVal notificationSent As Boolean, ByVal notifyByDateTime As DateTime, ByVal eventTimeBegin As DateTime, ByVal notifyLanguage As String, ByVal moduleId As Integer, ByVal tabId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsNotificationSave", notificationId, eventId, portalAliasId, userEmail, notificationSent, notifyByDateTime, eventTimeBegin, notifyLanguage, ModuleID, TabID), IDataReader) - End Function - -#End Region - -#Region "Event Recur Master Methods" - Public Overrides Sub EventsRecurMasterDelete(ByVal recurMasterId As Integer, ByVal moduleId As Integer) - SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsRecurMasterDelete", RecurMasterID, ModuleID) - End Sub - - Public Overrides Function EventsRecurMasterGet(ByVal recurMasterId As Integer, ByVal moduleId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsRecurMasterGet", RecurMasterID, ModuleID), IDataReader) - End Function - - Public Overrides Function EventsRecurMasterSave(ByVal recurMasterId As Integer, ByVal moduleId As Integer, ByVal portalId As Integer, ByVal rrule As String, _ - ByVal dtstart As DateTime, ByVal duration As String, ByVal until As DateTime, _ - ByVal eventName As String, ByVal eventDesc As String, ByVal importance As Integer, ByVal notify As String, ByVal approved As Boolean, _ - ByVal signups As Boolean, ByVal maxEnrollment As Integer, ByVal enrollRoleId As Integer, _ - ByVal enrollFee As Decimal, ByVal enrollType As String, ByVal payPalAccount As String, _ - ByVal detailPage As Boolean, ByVal detailNewWin As Boolean, ByVal detailUrl As String, ByVal imageUrl As String, _ - ByVal imageType As String, ByVal imageWidth As Integer, ByVal imageHeight As Integer, ByVal imageDisplay As Boolean, ByVal location As Integer, _ - ByVal category As Integer, ByVal reminder As String, ByVal sendReminder As Boolean, ByVal reminderTime As Integer, _ - ByVal reminderTimeMeasurement As String, ByVal reminderFrom As String, ByVal customField1 As String, ByVal customField2 As String, _ - ByVal enrollListView As Boolean, ByVal displayEndDate As Boolean, ByVal allDayEvent As Boolean, ByVal cultureName As String, _ - ByVal ownerId As Integer, ByVal createdById As Integer, ByVal updatedById As Integer, ByVal eventTimeZoneId As String, ByVal allowAnonEnroll As Boolean, _ - ByVal contentItemId As Integer, ByVal socialGroupId As Integer, ByVal socialUserId As Integer, ByVal summary As String) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsRecurMasterSave", recurMasterId, moduleId, portalId, rrule, _ - dtstart, duration, until, eventName, eventDesc, importance, notify, approved, _ - signups, maxEnrollment, enrollRoleId, _ - enrollFee, enrollType, payPalAccount, detailPage, detailNewWin, detailUrl, imageUrl, imageType, imageWidth, imageHeight, _ - imageDisplay, location, category, reminder, sendReminder, reminderTime, _ - reminderTimeMeasurement, reminderFrom, customField1, customField2, enrollListView, displayEndDate, allDayEvent, cultureName, ownerId, _ - createdById, updatedById, eventTimeZoneId, allowAnonEnroll, ContentItemId, SocialGroupId, SocialUserId, Summary), IDataReader) - End Function - - Public Overrides Function EventsRecurMasterModerate(ByVal moduleId As Integer, ByVal socialGroupId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsRecurMasterModerate", ModuleID, SocialGroupId), IDataReader) - End Function - - -#End Region - -#Region "Event Subscription Methods" - Public Overrides Sub EventsSubscriptionDeleteUser(ByVal userId As Integer, ByVal moduleId As Integer) - SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsSubscriptionDeleteUser", UserID, ModuleID) - End Sub - - Public Overrides Function EventsSubscriptionGetUser(ByVal userId As Integer, ByVal moduleId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsSubscriptionGetUser", UserID, ModuleID), IDataReader) - End Function - - Public Overrides Function EventsSubscriptionGetModule(ByVal moduleId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsSubscriptionGetModule", ModuleID), IDataReader) - End Function - - Public Overrides Function EventsSubscriptionGetSubModule(ByVal moduleId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsSubscriptionGetSubModule", ModuleID), IDataReader) - End Function - - Public Overrides Function EventsSubscriptionSave(ByVal subscriptionId As Integer, ByVal moduleId As Integer, ByVal portalId As Integer, ByVal userId As Integer) As IDataReader - Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "EventsSubscriptionSave", subscriptionId, moduleId, PortalID, UserID), IDataReader) - End Function - -#End Region - End Class - -End Namespace \ No newline at end of file diff --git a/Components/iCalProvider.cs b/Components/iCalProvider.cs new file mode 100644 index 0000000..0a1cdd3 --- /dev/null +++ b/Components/iCalProvider.cs @@ -0,0 +1,1262 @@ +using DotNetNuke.Entities.Users; +using Microsoft.VisualBasic; +using System.Collections; +using DotNetNuke.Common.Utilities; +using System.Web; +using DotNetNuke.Services.Localization; +using System; +using DotNetNuke.Entities.Modules; +using DotNetNuke.Entities.Portals; +using DotNetNuke.Security; +using System.Globalization; +using System.Text; +using System.Collections.Generic; +using System.Linq; + + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events + { + #region vEvent Class + + public class VEvent : IHttpHandler + { + +#region Private Properties + private int _moduleID; + private HttpContext _oContext; + private bool _blOwnerEmail = false; + private bool _blAnonOwnerEmail = false; + private StringBuilder _sExdate = new StringBuilder(); + private EventInfoHelper _objEventInfoHelper; + private bool _blSeries = false; + private bool _blEventSignup = false; + private bool _blEnrolleeEmail = false; + private bool _blAnonEmail = false; + private bool _blViewEmail = false; + private bool _blEditEmail = false; + private bool _blImages = false; + private int _iUserid = -1; + private string _domainName = ""; + private string _portalurl = ""; + private DateTime _timeZoneStart; + private DateTime _timeZoneEnd; + private string _iCalURLAppend = ""; + private string _iCalDefaultImage = ""; + private string _icsFilename = ""; + private EventModuleSettings _settings = null; + private ArrayList _vTimeZoneIds = new ArrayList(); + +#endregion + +#region Constructor + public VEvent() + { + } + + public VEvent(bool series, HttpContext context) + { + _blSeries = series; + _oContext = context; + } +#endregion + +#region Properties + public bool IsReusable + { + get + { + return true; + } + } + +#endregion + +#region Public Methods + + void IHttpHandler.ProcessRequest(HttpContext inContext) + { + this.ProcessVCalRequest(inContext); + } + + public void ProcessVCalRequest(HttpContext inContext) + { + + // Is this a valid request + long iItemID = 0; + int iModuleID = 0; + int iTabID = 0; + string iCategoryName = ""; + int iCategoryID = -1; + int iSocialGroupId = -1; + string calname = ""; + _moduleID = 0; + + // Get the scope information + _oContext = inContext; + if ((iItemID == 0) && (_oContext.Request.QueryString["itemID"] == "")) + { + return; + } + if (!(_oContext.Request.QueryString["itemID"] == "")) + { + iItemID = System.Convert.ToInt64(_oContext.Request.QueryString["itemID"]); + } + + if ((iModuleID == 0) && (_oContext.Request.QueryString["Mid"] == "")) + { + return; + } + if (!(_oContext.Request.QueryString["Mid"] == "")) + { + iModuleID = System.Convert.ToInt32(_oContext.Request.QueryString["Mid"]); + } + + //Save this in the private property value + _moduleID = iModuleID; + + if ((iTabID == 0) && (_oContext.Request.QueryString["TabId"] == "")) + { + return; + } + if (!(_oContext.Request.QueryString["TabId"] == "")) + { + iTabID = System.Convert.ToInt32(_oContext.Request.QueryString["TabId"]); + } + + if (iItemID > 0 && (_oContext.Request.QueryString["Series"] == "")) + { + return; + } + else + { + _blSeries = false; + } + if (!(_oContext.Request.QueryString["Series"] == "")) + { + _blSeries = System.Convert.ToBoolean(_oContext.Request.QueryString["series"]); + } + + if (!(_oContext.Request.QueryString["CategoryName"] == "")) + { + iCategoryName = _oContext.Request.QueryString["CategoryName"]; + PortalSecurity objSecurity = new PortalSecurity(); + iCategoryName = objSecurity.InputFilter(iCategoryName, PortalSecurity.FilterFlag.NoSQL); + } + if (!(HttpContext.Current.Request.QueryString["CategoryID"] == "")) + { + iCategoryID = System.Convert.ToInt32(_oContext.Request.QueryString["CategoryID"]); + } + + if (!(_oContext.Request.QueryString["groupid"] == "")) + { + iSocialGroupId = System.Convert.ToInt32(_oContext.Request.QueryString["groupid"]); + } + + if (!(HttpContext.Current.Request.QueryString["Calname"] == "")) + { + calname = _oContext.Request.QueryString["Calname"]; + } + + string iCal = ""; + iCal = CreateiCal(iTabID, iModuleID, iItemID, iSocialGroupId, iCategoryName, iCategoryID, calname); + + // Stream The vCalendar + HttpResponse oStream = default(HttpResponse); + oStream = _oContext.Response; + oStream.ContentEncoding = Encoding.UTF8; + oStream.ContentType = "text/Calendar"; + oStream.AppendHeader("Content-Disposition", "filename=" + HttpUtility.UrlEncode(_icsFilename) +".ics"); + oStream.Write(iCal); + + } + + public string CreateiCal(int iTabID, int iModuleID, long iItemID, int socialGroupId, string iCategoryName = "", int iCategoryID = -1, string iLocationName = "", int iLocationID = -1, string calname = "") + { + // Get relevant module settings + EventModuleSettings ems = new EventModuleSettings(); + _settings = ems.GetEventModuleSettings(iModuleID, null); + + // Set up for this module + PortalSettings portalSettings = (PortalSettings) (HttpContext.Current.Items["PortalSettings"]); + _objEventInfoHelper = new EventInfoHelper(iModuleID, iTabID, portalSettings.PortalId, _settings); + _portalurl = _objEventInfoHelper.GetDomainURL(); + if (portalSettings.PortalAlias.HTTPAlias.IndexOf("/", StringComparison.Ordinal) > 0) + { + _portalurl = _portalurl + Common.Globals.ApplicationPath; + } + + _blOwnerEmail = _settings.Exportowneremail; + if (_blOwnerEmail) + { + _blAnonOwnerEmail = _settings.Exportanonowneremail; + } + _blEventSignup = _settings.Eventsignup; + if (_settings.EnrollAnonFields.LastIndexOf("03", StringComparison.Ordinal) > -1) + { + _blAnonEmail = true; + } + if (_settings.EnrollViewFields.LastIndexOf("03", StringComparison.Ordinal) > -1) + { + _blViewEmail = true; + } + if (_settings.EnrollEditFields.LastIndexOf("03", StringComparison.Ordinal) > -1) + { + _blEditEmail = true; + } + + int socialUserId = -1; + if (_settings.SocialGroupModule == EventModuleSettings.SocialModule.UserProfile) + { + socialUserId = portalSettings.UserId; + } + + _blImages = _settings.Eventimage; + _iUserid = portalSettings.UserId; + _domainName = portalSettings.PortalAlias.HTTPAlias; + int iCalDaysBefore = _settings.IcalDaysBefore; + int iCalDaysAfter = _settings.IcalDaysAfter; + if (!(HttpContext.Current.Request.QueryString["DaysBefore"] == "")) + { + iCalDaysBefore = System.Convert.ToInt32(HttpContext.Current.Request.QueryString["DaysBefore"]); + } + if (!(HttpContext.Current.Request.QueryString["DaysAfter"] == "")) + { + iCalDaysAfter = System.Convert.ToInt32(HttpContext.Current.Request.QueryString["DaysAfter"]); + } + + + _iCalURLAppend = _settings.IcalURLAppend; + _iCalDefaultImage = _settings.IcalDefaultImage.Substring(6); + + // Lookup DesktopModuleID + DesktopModuleInfo objDesktopModule = default(DesktopModuleInfo); + objDesktopModule = DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", portalSettings.PortalId); + + // Build the filename + ModuleController objCtlModule = new ModuleController(); + ModuleInfo objModuleInfo = objCtlModule.GetModule(iModuleID, iTabID, false); + _icsFilename = Common.Utilities.HtmlUtils.StripTags(objModuleInfo.ModuleTitle, false); + + // Get the event that is being viewed + EventInfo oEvent = new EventInfo(); + EventController oCntrl = new EventController(); + if (iItemID > 0) + { + oEvent = oCntrl.EventsGet((int) iItemID, iModuleID); + } + + StringBuilder vEvents = new StringBuilder(); + if (_blSeries && iItemID == 0) + { + // Not supported yet + } + else if (_blSeries && iItemID > 0) + { + // Process the series + EventRecurMasterInfo oEventRecurMaster = default(EventRecurMasterInfo); + EventRecurMasterController oCntrlRecurMaster = new EventRecurMasterController(); + oEventRecurMaster = oCntrlRecurMaster.EventsRecurMasterGet(oEvent.RecurMasterID, oEvent.ModuleID); + vEvents.Append(CreateRecurvEvent(oEventRecurMaster)); + + _icsFilename = oEventRecurMaster.EventName; + } + else if (!_blSeries && iItemID == 0) + { + // Process all events for the module + ArrayList categoryIDs = new ArrayList(); + if (_settings.Enablecategories == EventModuleSettings.DisplayCategories.DoNotDisplay) + { + categoryIDs = _settings.ModuleCategoryIDs; + iCategoryName = ""; + } + if (iCategoryName != "") + { + EventCategoryController oCntrlEventCategory = new EventCategoryController(); + EventCategoryInfo oEventCategory = oCntrlEventCategory.EventCategoryGetByName(iCategoryName, portalSettings.PortalId); + if (!ReferenceEquals(oEventCategory, null)) + { + categoryIDs.Add(oEventCategory.Category); + } + } + if (categoryIDs.Count == 0) + { + categoryIDs.Add("-1"); + } + ArrayList locationIDs = new ArrayList(); + if (_settings.Enablelocations == EventModuleSettings.DisplayLocations.DoNotDisplay) + { + locationIDs = _settings.ModuleLocationIDs; + iLocationName = ""; + } + if (iLocationName != "") + { + EventLocationController oCntrlEventLocation = new EventLocationController(); + EventLocationInfo oEventLocation = oCntrlEventLocation.EventsLocationGetByName(iLocationName, portalSettings.PortalId); + if (!ReferenceEquals(oEventLocation, null)) + { + locationIDs.Add(oEventLocation.Location); + } + } + if (locationIDs.Count == 0) + { + locationIDs.Add("-1"); + } + + EventTimeZoneUtilities objEventTimeZoneUtilities = new EventTimeZoneUtilities(); + DateTime moduleDateNow = objEventTimeZoneUtilities.ConvertFromUTCToModuleTimeZone(DateTime.UtcNow, _settings.TimeZoneId); + DateTime startdate = DateAndTime.DateAdd(DateInterval.Day, 0 - iCalDaysBefore - 1, moduleDateNow); + DateTime enddate = DateAndTime.DateAdd(DateInterval.Day, iCalDaysAfter + 1, moduleDateNow); + ArrayList lstEvents = default(ArrayList); + lstEvents = _objEventInfoHelper.GetEvents(startdate, enddate, _settings.MasterEvent, categoryIDs, locationIDs, socialGroupId, socialUserId); + foreach (EventInfo tempLoopVar_oEvent in lstEvents) + { + oEvent = tempLoopVar_oEvent; + DateTime utcEventTimeBegin = objEventTimeZoneUtilities.ConvertToUTCTimeZone(oEvent.EventTimeBegin, oEvent.EventTimeZoneId); + DateTime utcEventTimeEnd = objEventTimeZoneUtilities.ConvertToUTCTimeZone(oEvent.EventTimeEnd, oEvent.EventTimeZoneId); + DateTime utcStart = DateAndTime.DateAdd(DateInterval.Day, 0 - iCalDaysBefore, DateTime.UtcNow); + DateTime utcEnd = DateAndTime.DateAdd(DateInterval.Day, iCalDaysAfter, DateTime.UtcNow); + if (utcEventTimeEnd > utcStart && utcEventTimeBegin < utcEnd) + { + vEvents.Append(CreatevEvent(oEvent, oEvent.EventTimeBegin, false, false)); + } + } + } + else + { + // Process the single event + vEvents.Append(CreatevEvent(oEvent, oEvent.EventTimeBegin, false, false)); + _icsFilename = oEvent.EventName; + } + + // Create the initial VCALENDAR + StringBuilder vCalendar = new StringBuilder(); + vCalendar.Append("BEGIN:VCALENDAR" + Environment.NewLine); + vCalendar.Append("VERSION:2.0" + Environment.NewLine); + vCalendar.Append(FoldText("PRODID:-//DNN//" + objDesktopModule.FriendlyName + " " + objDesktopModule.Version + "//EN") + Environment.NewLine); + vCalendar.Append("CALSCALE:GREGORIAN" + Environment.NewLine); + vCalendar.Append("METHOD:PUBLISH" + Environment.NewLine); + if (calname != "") + { + vCalendar.Append("X-WR-CALNAME:" + calname + Environment.NewLine); + } + else if (_settings.IcalIncludeCalname) + { + vCalendar.Append("X-WR-CALNAME:" + _icsFilename + Environment.NewLine); + } + + // Create the VTIMEZONE + if (_timeZoneStart == DateTime.MinValue) + { + _timeZoneStart = DateTime.Now; + _timeZoneEnd = DateAndTime.DateAdd(DateInterval.Minute, 30, _timeZoneStart); + } + + vCalendar.Append(CreatevTimezones(_timeZoneStart, _timeZoneEnd)); + + // Output the events + vCalendar.Append(vEvents.ToString()); + + // Close off the VCALENDAR + vCalendar.Append("END:VCALENDAR" + Environment.NewLine); + + return vCalendar.ToString(); + + } + + private string CreatevTimezones(DateTime dtStartDate, DateTime dtEndDate) + { + StringBuilder vTimezone = new StringBuilder(); + foreach (string vTimeZoneId in _vTimeZoneIds) + { + TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById(vTimeZoneId); + TimeZoneInfo.AdjustmentRule[] adjustments = tzi.GetAdjustmentRules(); + + vTimezone.Append("BEGIN:VTIMEZONE" + Environment.NewLine); + vTimezone.Append("TZID:" + tzi.Id + Environment.NewLine); + + if (adjustments.Any()) + { + // Identify last DST change before start of recurrences + int intYear = 0; + DateTime lastDSTStartDate = new DateTime(); + DateTime lastDSTEndDate = new DateTime(); + for (intYear = dtStartDate.Year - 1; intYear <= dtEndDate.Year; intYear++) + { + YearDayLight yearDayLight = GetAdjustment(adjustments, intYear); + DateTime daylightStart = yearDayLight.StartDate; + DateTime daylightEnd = yearDayLight.EndDate; + if ((lastDSTStartDate == DateTime.MinValue || daylightStart > lastDSTStartDate) && daylightStart < dtStartDate) + { + lastDSTStartDate = daylightStart; + } + if ((lastDSTEndDate == DateTime.MinValue || daylightEnd > lastDSTEndDate) && daylightEnd < dtStartDate) + { + lastDSTEndDate = daylightEnd; + } + } + for (intYear = dtStartDate.Year - 1; intYear <= dtEndDate.Year; intYear++) + { + YearDayLight yearDayLight = GetAdjustment(adjustments, intYear); + DateTime daylightStart = yearDayLight.StartDate; + DateTime daylightEnd = yearDayLight.EndDate; + + double iByDay = Conversion.Int((double) daylightEnd.Day / 7) + 1; + string sDayOfWeek = ""; + switch (daylightEnd.DayOfWeek) + { + case DayOfWeek.Sunday: + sDayOfWeek = "SU"; + break; + case DayOfWeek.Monday: + sDayOfWeek = "MO"; + break; + case DayOfWeek.Tuesday: + sDayOfWeek = "TU"; + break; + case DayOfWeek.Wednesday: + sDayOfWeek = "WE"; + break; + case DayOfWeek.Thursday: + sDayOfWeek = "TH"; + break; + case DayOfWeek.Friday: + sDayOfWeek = "FR"; + break; + case DayOfWeek.Saturday: + sDayOfWeek = "SA"; + break; + } + + string sByDay = iByDay.ToString() + sDayOfWeek; + string sByMonth = daylightEnd.Month.ToString(); + + // Allow for timezone with no DST, and don't include Timezones after end + if (daylightStart.Year > 1 && daylightStart < dtEndDate && !(daylightStart < lastDSTStartDate)) + { + string dtFrom = FormatTZTime(tzi.GetUtcOffset(DateAndTime.DateAdd(DateInterval.Day, -2, daylightStart))); + string dtTo = FormatTZTime(tzi.GetUtcOffset(DateAndTime.DateAdd(DateInterval.Day, System.Convert.ToDouble(+ 2), daylightStart))); + vTimezone.Append("BEGIN:DAYLIGHT" + Environment.NewLine); + vTimezone.Append("TZOFFSETFROM:" + dtFrom + Environment.NewLine); + vTimezone.Append("TZOFFSETTO:" + dtTo + Environment.NewLine); + vTimezone.Append("DTSTART:" + CreateTZIDDate(daylightStart, daylightStart, false, false, tzi.Id) + Environment.NewLine); + vTimezone.Append("END:DAYLIGHT" + Environment.NewLine); + } + + // Allow for timezone with no DST, and don't include Timezones after end + if (daylightEnd.Year > 1 && daylightEnd < dtEndDate && !(daylightEnd < lastDSTEndDate)) + { + string dtFrom = FormatTZTime(tzi.GetUtcOffset(DateAndTime.DateAdd(DateInterval.Day, -2, daylightEnd))); + string dtTo = FormatTZTime(tzi.GetUtcOffset(DateAndTime.DateAdd(DateInterval.Day, System.Convert.ToDouble(+ 2), daylightEnd))); + vTimezone.Append("BEGIN:STANDARD" + Environment.NewLine); + vTimezone.Append(FoldText("RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=" + sByMonth + ";BYDAY=" + sByDay + ";COUNT=1") + Environment.NewLine); + vTimezone.Append("TZOFFSETFROM:" + dtFrom + Environment.NewLine); + vTimezone.Append("TZOFFSETTO:" + dtTo + Environment.NewLine); + vTimezone.Append("DTSTART:" + CreateTZIDDate(daylightEnd, daylightEnd, false, false, tzi.Id) + Environment.NewLine); + vTimezone.Append("END:STANDARD" + Environment.NewLine); + } + + if (!(daylightStart.Year > 1)) + { + vTimezone.Append(CreatevTimezone1601(tzi)); + break; + } + } + } + else + { + vTimezone.Append(CreatevTimezone1601(tzi)); + } + vTimezone.Append("END:VTIMEZONE" + Environment.NewLine); + } + return vTimezone.ToString(); + } + + private YearDayLight GetAdjustment(IEnumerable adjustments, int year) + { + // Iterate adjustment rules for time zone + foreach (TimeZoneInfo.AdjustmentRule adjustment in adjustments) + { + // Determine if this adjustment rule covers year desired + if (adjustment.DateStart.Year <= year & adjustment.DateEnd.Year >= year) + { + TimeZoneInfo.TransitionTime startTransition = default(TimeZoneInfo.TransitionTime); + TimeZoneInfo.TransitionTime endTransition = default(TimeZoneInfo.TransitionTime); + YearDayLight yearDayLight = new YearDayLight(); + startTransition = adjustment.DaylightTransitionStart; + yearDayLight.StartDate = ProcessAdjustmentDate(startTransition, year); + endTransition = adjustment.DaylightTransitionEnd; + yearDayLight.EndDate = ProcessAdjustmentDate(endTransition, year); + yearDayLight.Delta = System.Convert.ToInt32(adjustment.DaylightDelta.TotalMinutes); + return yearDayLight; + } + } + return null; + } + + // VBConversions Note: Former VB static variables moved to class level because they aren't supported in C#. + private System.Globalization.Calendar ProcessAdjustmentDate_cal = CultureInfo.CurrentCulture.Calendar; + + private DateTime ProcessAdjustmentDate(TimeZoneInfo.TransitionTime processTransition, int year) + { + int transitionDay = 0; + if (processTransition.IsFixedDateRule) + { + transitionDay = processTransition.Day; + } + else + { + // For non-fixed date rules, get local calendar + // static Calendar cal = CultureInfo.CurrentCulture.Calendar; VBConversions Note: Static variable moved to class level and renamed ProcessAdjustmentDate_cal. Local static variables are not supported in C#. + + // Get first day of week for transition + // For example, the 3rd week starts no earlier than the 15th of the month + int startOfWeek = processTransition.Week * 7 - 6; + // What day of the week does the month start on + int firstDayOfWeek = (int) (ProcessAdjustmentDate_cal.GetDayOfWeek(new DateTime(year, processTransition.Month, 1))); + // Determine how much start date has to be adjusted + int changeDayOfWeek = (int) processTransition.DayOfWeek; + + if (firstDayOfWeek <= changeDayOfWeek) + { + transitionDay = startOfWeek + (changeDayOfWeek - firstDayOfWeek); + } + else + { + transitionDay = startOfWeek + (7 - firstDayOfWeek + changeDayOfWeek); + } + // Adjust for months with no fifth week + if (transitionDay > ProcessAdjustmentDate_cal.GetDaysInMonth(year, processTransition.Month)) + { + transitionDay -= 7; + } + } + return DateTime.ParseExact(string.Format("{0:0000}/{1:00}/{2:00} {3:HH:mm}", year, processTransition.Month, transitionDay, processTransition.TimeOfDay), "yyyy/MM/dd HH:mm", CultureInfo.InvariantCulture); + } + + private string CreatevTimezone1601(TimeZoneInfo tzi) + { + StringBuilder vTimezone1601 = new StringBuilder(); + CultureInfo invCuluture = CultureInfo.InvariantCulture; + DateTime dt1601Date = DateTime.ParseExact("01/01/1601 00:00:00", "MM/dd/yyyy HH:mm:ss", invCuluture); + string dtTo = FormatTZTime(tzi.GetUtcOffset(dt1601Date)); + string dtFrom = FormatTZTime(tzi.GetUtcOffset(dt1601Date)); + vTimezone1601.Append("BEGIN:STANDARD" + Environment.NewLine); + vTimezone1601.Append("TZOFFSETFROM:" + dtFrom + Environment.NewLine); + vTimezone1601.Append("TZOFFSETTO:" + dtTo + Environment.NewLine); + vTimezone1601.Append("DTSTART:" + CreateTZIDDate(dt1601Date, dt1601Date, false, false, tzi.Id) + Environment.NewLine); + vTimezone1601.Append("END:STANDARD" + Environment.NewLine); + return vTimezone1601.ToString(); + } + + private string CreateRecurvEvent(EventRecurMasterInfo oEventRecurMaster) + { + StringBuilder vEvent = new StringBuilder(); + + ArrayList lstEvents = default(ArrayList); + EventInfo oEvent = default(EventInfo); + EventController oCntrl = new EventController(); + lstEvents = oCntrl.EventsGetRecurrences(oEventRecurMaster.RecurMasterID, oEventRecurMaster.ModuleID); + // Create the single VEVENT + foreach (EventInfo tempLoopVar_oEvent in lstEvents) + { + oEvent = tempLoopVar_oEvent; + if (oEvent.EventTimeBegin.TimeOfDay == oEventRecurMaster.Dtstart.TimeOfDay && Convert.ToString(oEvent.Duration) + "M" == oEventRecurMaster.Duration && + oEvent.EventName == oEventRecurMaster.EventName && + oEvent.EventDesc == oEventRecurMaster.EventDesc && + oEvent.OwnerID == oEventRecurMaster.OwnerID & + oEvent.Location == oEventRecurMaster.Location && + (int)oEvent.Importance == (int)oEventRecurMaster.Importance && + oEvent.SendReminder == oEventRecurMaster.SendReminder && + oEvent.ReminderTime == oEventRecurMaster.ReminderTime && + oEvent.AllDayEvent == oEventRecurMaster.AllDayEvent && + oEvent.ReminderTimeMeasurement == oEventRecurMaster.ReminderTimeMeasurement && + oEvent.Cancelled == false && + (oEvent.Enrolled == 0 || !_blEventSignup || !oEvent.EnrollListView || !oEvent.Signups)) + { + if (!_blImages || + (_blImages && oEvent.ImageDisplay == oEventRecurMaster.ImageDisplay && oEvent.ImageURL == oEventRecurMaster.ImageURL)) + { + continue; + } + } + vEvent.Append(CreatevEvent(oEvent, oEventRecurMaster.Dtstart, false, oEventRecurMaster.AllDayEvent)); + } + + if (lstEvents.Count == 0) + { + return ""; + } + EventInfo oFirstEvent = (EventInfo) (lstEvents[0]); + EventLocationInfo objEventLocation = new EventLocationInfo(); + EventLocationController objCtlEventLocation = new EventLocationController(); + + if (oEventRecurMaster.Location > 0) + { + objEventLocation = objCtlEventLocation.EventsLocationGet(oEventRecurMaster.Location, oEventRecurMaster.PortalID); + } + + EventTimeZoneUtilities objEventTimeZoneUtilities = new EventTimeZoneUtilities(); + DateTime recurUntil = objEventTimeZoneUtilities.ConvertToUTCTimeZone(oEventRecurMaster.Until, oEventRecurMaster.EventTimeZoneId); + + // Calculate timezone start/end dates + int intDuration = 0; + intDuration = int.Parse(oEventRecurMaster.Duration.Substring(0, oEventRecurMaster.Duration.Length - 1)); + if (_timeZoneStart == DateTime.MinValue || _timeZoneStart > oEventRecurMaster.Dtstart) + { + _timeZoneStart = oEventRecurMaster.Dtstart; + } + if (_timeZoneEnd == DateTime.MinValue || _timeZoneEnd < DateAndTime.DateAdd(DateInterval.Minute, intDuration, oEventRecurMaster.Until)) + { + _timeZoneEnd = DateAndTime.DateAdd(DateInterval.Minute, intDuration, oEventRecurMaster.Until); + } + + // Build Item + UserController objUsers = new UserController(); + UserInfo objUser = objUsers.GetUser(oEventRecurMaster.PortalID, oEventRecurMaster.OwnerID); + string creatoremail = ""; + string creatoranonemail = ""; + string creatorname = ""; + if (!ReferenceEquals(objUser, null)) + { + creatoremail = ":MAILTO:" + objUser.Email; + creatoranonemail = ":MAILTO:" + objUser.FirstName +"." + objUser.LastName + "@no_email.com"; + creatorname = "CN=\"" + objUser.DisplayName + "\""; + } + else + { + Entities.Portals.PortalController objPortals = new Entities.Portals.PortalController(); + PortalInfo objPortal = default(PortalInfo); + objPortal = objPortals.GetPortal(oEventRecurMaster.PortalID); + creatoremail = ":MAILTO:" + objPortal.Email; + creatoranonemail = ":MAILTO:" + "anonymous@no_email.com"; + creatorname = "CN=\"Anonymous\""; + } + + string sEmail = ""; + if ((_oContext.Request.IsAuthenticated && _blOwnerEmail) || _blAnonOwnerEmail) + { + sEmail = FoldText("ORGANIZER;" + creatorname + creatoremail) + Environment.NewLine; + } + else + { + sEmail = FoldText("ORGANIZER;" + creatorname + creatoranonemail) + Environment.NewLine; + } + + ArrayList aTimes = default(ArrayList); + string sStartTime = ""; + string sEndTime = ""; + string sDtStamp = ""; + string sSequence = ""; + + aTimes = TimeFormat(oFirstEvent.OriginalDateBegin.Date + oEventRecurMaster.Dtstart.TimeOfDay, intDuration, oFirstEvent.EventTimeZoneId, recurUntil); + if (!oEventRecurMaster.AllDayEvent) + { + sStartTime = "DTSTART;" + Convert.ToString(aTimes[0]) + Environment.NewLine; + sEndTime = "DTEND;" + Convert.ToString(aTimes[1]) + Environment.NewLine; + } + else + { + sStartTime = "DTSTART;VALUE=DATE:" + AllDayEventDate(oFirstEvent.OriginalDateBegin.Date) + Environment.NewLine; + // +1 deals with use of 1439 minutes instead of 1440 + sEndTime = "DTEND;VALUE=DATE:" + AllDayEventDate(oFirstEvent.OriginalDateBegin.Date.AddMinutes(intDuration + 1)) + Environment.NewLine; + } + sDtStamp = "DTSTAMP:" + CreateTZIDDate(DateTime.UtcNow, DateTime.UtcNow, true, false, oEventRecurMaster.EventTimeZoneId) + Environment.NewLine; + sSequence = "SEQUENCE:" + Convert.ToString(oEventRecurMaster.Sequence) + Environment.NewLine; + + string sLocation = ""; + if (oEventRecurMaster.Location > 0) + { + if (objEventLocation.MapURL != "" && _settings.IcalURLInLocation) + { + sLocation = objEventLocation.LocationName + " - " + objEventLocation.MapURL; + } + else + { + sLocation = objEventLocation.LocationName; + } + sLocation = FoldText("LOCATION:" + CreateText(sLocation)) + Environment.NewLine; + } + string sDescription = CreateDescription(oEventRecurMaster.EventDesc); + string altDescription = CreateAltDescription(oEventRecurMaster.EventDesc); + + // ToDo: HIER! + // Make up the LocalResourceFile value + string templateSourceDirectory = Common.Globals.ApplicationPath; + string localResourceFile = templateSourceDirectory + "/DesktopModules/Events/" + Localization.LocalResourceDirectory + "/SharedResources.ascx.resx"; + TokenReplaceControllerClass tcc = new TokenReplaceControllerClass(_moduleID, localResourceFile); + + string tmpSummary = _settings.Templates.EventiCalSubject; + //tmpSummary = tcc.TokenReplaceEvent(oEventRecurMaster, tmpSummary) + //Dim sSummary As String = FoldText("SUMMARY:" & CreateText(oEventRecurMaster.EventName)) & Environment.NewLine + + string sSummary = FoldText("SUMMARY-RM:" + CreateText(oEventRecurMaster.EventName)) + Environment.NewLine; + string sPriority = "PRIORITY:" + Priority((System.Int32) oEventRecurMaster.Importance) + Environment.NewLine; + + string sURL = FoldText("URL:" + _objEventInfoHelper.DetailPageURL(oFirstEvent, false) + _iCalURLAppend) + Environment.NewLine; + + vEvent.Append("BEGIN:VEVENT" + Environment.NewLine); + string strUID = string.Format("{0:00000}", oEventRecurMaster.ModuleID) + string.Format("{0:0000000}", oEventRecurMaster.RecurMasterID); + vEvent.Append("UID:DNNEvent" + strUID + "@" + _domainName + Environment.NewLine); + vEvent.Append(sSequence); + if (oEventRecurMaster.RRULE != "") + { + vEvent.Append("RRULE:" + oEventRecurMaster.RRULE + ";" + "UNTIL=" + Convert.ToString(aTimes[2]) + Environment.NewLine); + } + if (_sExdate.ToString() != "") + { + vEvent.Append(_sExdate.ToString()); + } + vEvent.Append(sStartTime); + vEvent.Append(sEndTime); + vEvent.Append(sDtStamp); + vEvent.Append(sURL); + vEvent.Append(sEmail); + vEvent.Append(sDescription); + vEvent.Append(sSummary); + vEvent.Append(altDescription); + vEvent.Append(sPriority); + vEvent.Append(sLocation); + + int iMinutes = 0; + if (oEventRecurMaster.SendReminder) + { + switch (oEventRecurMaster.ReminderTimeMeasurement) + { + case "d": + iMinutes = oEventRecurMaster.ReminderTime * 60 * 24; + break; + case "h": + iMinutes = oEventRecurMaster.ReminderTime * 60; + break; + case "m": + iMinutes = oEventRecurMaster.ReminderTime; + break; + } + } + + vEvent.Append("CLASS:PUBLIC" + Environment.NewLine); + vEvent.Append("CREATED:" + CreateTZIDDate(oEventRecurMaster.CreatedDate, oEventRecurMaster.CreatedDate, true, false, oEventRecurMaster.EventTimeZoneId) + Environment.NewLine); + vEvent.Append("LAST-MODIFIED:" + CreateTZIDDate(oEventRecurMaster.UpdatedDate, oEventRecurMaster.UpdatedDate, true, false, oEventRecurMaster.EventTimeZoneId) + Environment.NewLine); + if (oEventRecurMaster.SendReminder) + { + vEvent.Append("BEGIN:VALARM" + Environment.NewLine); + vEvent.Append("TRIGGER:-PT" + iMinutes.ToString() + "M" + Environment.NewLine); + vEvent.Append("ACTION:DISPLAY" + Environment.NewLine); + vEvent.Append("DESCRIPTION:Reminder" + Environment.NewLine); + vEvent.Append("END:VALARM" + Environment.NewLine); + } + + if (_blImages && oEventRecurMaster.ImageDisplay) + { + vEvent.Append(FoldText("ATTACH:" + GetImageUrl(oEventRecurMaster.ImageURL, oEventRecurMaster.PortalID)) + Environment.NewLine); + } + else if (_blImages && !string.IsNullOrEmpty(_iCalDefaultImage)) + { + vEvent.Append(FoldText("ATTACH:" + GetImageUrl(_iCalDefaultImage, oEventRecurMaster.PortalID)) + Environment.NewLine); + } + + vEvent.Append("TRANSP:OPAQUE" + Environment.NewLine); + + vEvent.Append("END:VEVENT" + Environment.NewLine); + + return vEvent.ToString(); + + } + + private string CreatevEvent(EventInfo oEvent, DateTime dtstart, bool blURLOnly, bool blAllDay) + { + + if (!_vTimeZoneIds.Contains(oEvent.EventTimeZoneId)) + { + _vTimeZoneIds.Add(oEvent.EventTimeZoneId); + } + + oEvent.OriginalDateBegin = oEvent.OriginalDateBegin.Date + dtstart.TimeOfDay; + + // Calculate timezone start/end dates + if (_timeZoneStart == DateTime.MinValue || _timeZoneStart > oEvent.EventTimeBegin) + { + _timeZoneStart = oEvent.EventTimeBegin; + } + if (_timeZoneEnd == DateTime.MinValue || _timeZoneEnd < DateAndTime.DateAdd(DateInterval.Minute, oEvent.Duration, oEvent.EventTimeBegin)) + { + _timeZoneEnd = DateAndTime.DateAdd(DateInterval.Minute, oEvent.Duration, oEvent.EventTimeBegin); + } + + // Build Item + StringBuilder vEvent = new StringBuilder(); + + UserController objUsers = new UserController(); + UserInfo objUser = objUsers.GetUser(oEvent.PortalID, oEvent.OwnerID); + string creatoremail = ""; + string creatoranonemail = ""; + string creatorname = ""; + if (!ReferenceEquals(objUser, null)) + { + creatoremail = ":MAILTO:" + objUser.Email; + creatoranonemail = ":MAILTO:" + objUser.FirstName +"." + objUser.LastName + "@no_email.com"; + creatorname = "CN=\"" + objUser.DisplayName + "\""; + } + else + { + Entities.Portals.PortalController objPortals = new Entities.Portals.PortalController(); + Entities.Portals.PortalInfo objPortal = default(Entities.Portals.PortalInfo); + objPortal = objPortals.GetPortal(oEvent.PortalID); + creatoremail = ":MAILTO:" + objPortal.Email; + creatoranonemail = ":MAILTO:" + "anonymous@no_email.com"; + creatorname = "CN=\"Anonymous\""; + } + + string sEmail = ""; + if ((_oContext.Request.IsAuthenticated && _blOwnerEmail) || _blAnonOwnerEmail) + { + sEmail = FoldText("ORGANIZER;" + creatorname + creatoremail) + Environment.NewLine; + } + else + { + sEmail = FoldText("ORGANIZER;" + creatorname + creatoranonemail) + Environment.NewLine; + } + + ArrayList aTimes = default(ArrayList); + string sStartTime = ""; + string sEndTime = ""; + string sDtStamp = ""; + string sSequence = ""; + + aTimes = TimeFormat(dBeginDateTime: oEvent.EventTimeBegin, iDuration: oEvent.Duration, timeZoneId: oEvent.EventTimeZoneId, dOriginal: oEvent.OriginalDateBegin); + if (oEvent.Cancelled) + { + _sExdate.Append("EXDATE;" + Convert.ToString(aTimes[3]) + Environment.NewLine); + return ""; + } + + if (!oEvent.AllDayEvent) + { + sStartTime = "DTSTART;" + Convert.ToString(aTimes[0]) + Environment.NewLine; + sEndTime = "DTEND;" + Convert.ToString(aTimes[1]) + Environment.NewLine; + } + else + { + sStartTime = "DTSTART;VALUE=DATE:" + AllDayEventDate(oEvent.EventTimeBegin.Date) + Environment.NewLine; + // +1 deals with use of 1439 minutes instead of 1440 + sEndTime = "DTEND;VALUE=DATE:" + AllDayEventDate(oEvent.EventTimeBegin.Date.AddMinutes(oEvent.Duration + 1)) + Environment.NewLine; + } + if (!_blSeries) + { + sDtStamp = "DTSTAMP:" + CreateTZIDDate(DateTime.UtcNow, DateTime.UtcNow, true, false, oEvent.EventTimeZoneId) + Environment.NewLine; + } + sSequence = "SEQUENCE:" + Convert.ToString(oEvent.Sequence) + Environment.NewLine; + + string sLocation = ""; + if (oEvent.Location > 0) + { + if (oEvent.MapURL != "" && _settings.IcalURLInLocation) + { + sLocation = oEvent.LocationName + " - " + oEvent.MapURL; + } + else + { + sLocation = oEvent.LocationName; + } + sLocation = FoldText("LOCATION:" + CreateText(sLocation)) + Environment.NewLine; + } + + string sDescription = CreateDescription(oEvent.EventDesc); + string altDescription = CreateAltDescription(oEvent.EventDesc); + + + //Create the templated version of the summary + string templateSourceDirectory = Common.Globals.ApplicationPath; + string localResourceFile = templateSourceDirectory + "/DesktopModules/Events/" + Localization.LocalResourceDirectory + "/SharedResources.ascx.resx"; + TokenReplaceControllerClass tcc = new TokenReplaceControllerClass(_moduleID, localResourceFile); + string tmpSummary = _settings.Templates.EventiCalSubject; + tmpSummary = tcc.TokenReplaceEvent(oEvent, tmpSummary); + + string sSummary = FoldText("SUMMARY:" + CreateText(tmpSummary)) + Environment.NewLine; + + string sPriority = "PRIORITY:" + Priority((System.Int32) oEvent.Importance) + Environment.NewLine; + + string sURL = FoldText("URL:" + _objEventInfoHelper.DetailPageURL(oEvent, false) + _iCalURLAppend) + Environment.NewLine; + + vEvent.Append("BEGIN:VEVENT" + Environment.NewLine); + string strUID = string.Format("{0:00000}", oEvent.ModuleID) + string.Format("{0:0000000}", oEvent.RecurMasterID); + if (!_blSeries) + { + strUID += string.Format("{0:0000000}", oEvent.EventID); + } + vEvent.Append("UID:DNNEvent" + strUID + "@" + _domainName + Environment.NewLine); + vEvent.Append(sSequence); + if (_blSeries) + { + if (!blAllDay) + { + vEvent.Append("RECURRENCE-ID;" + Convert.ToString(aTimes[3]) + Environment.NewLine); + } + else + { + vEvent.Append("RECURRENCE-ID;VALUE=DATE:" + AllDayEventDate(oEvent.OriginalDateBegin) + Environment.NewLine); + } + } + vEvent.Append(sStartTime); + vEvent.Append(sEndTime); + vEvent.Append(sDtStamp); + vEvent.Append(sURL); + if (!blURLOnly) + { + vEvent.Append(sEmail); + vEvent.Append(sDescription); + vEvent.Append(sSummary); + vEvent.Append(altDescription); + vEvent.Append(sPriority); + vEvent.Append(sLocation); + + if (_blEventSignup && oEvent.EnrollListView && oEvent.Signups && oEvent.Enrolled > 0) + { + _blEnrolleeEmail = false; + if ((IsModerator() || (oEvent.CreatedByID == _iUserid | oEvent.RmOwnerID == _iUserid | oEvent.OwnerID == _iUserid)) && _blEditEmail) + { + _blEnrolleeEmail = true; + } + if (_oContext.Request.IsAuthenticated && (_blViewEmail || _blAnonEmail)) + { + _blEnrolleeEmail = true; + } + if (!_oContext.Request.IsAuthenticated && _blAnonEmail) + { + _blEnrolleeEmail = true; + } + vEvent.Append(CreateAttendee(oEvent)); + } + + int iMinutes = 0; + if (oEvent.SendReminder) + { + switch (oEvent.ReminderTimeMeasurement) + { + case "d": + iMinutes = oEvent.ReminderTime * 60 * 24; + break; + case "h": + iMinutes = oEvent.ReminderTime * 60; + break; + case "m": + iMinutes = oEvent.ReminderTime; + break; + } + } + + vEvent.Append("CLASS:PUBLIC" + Environment.NewLine); + vEvent.Append("CREATED:" + CreateTZIDDate(oEvent.CreatedDate, oEvent.CreatedDate, true, false, oEvent.EventTimeZoneId) + Environment.NewLine); + vEvent.Append("LAST-MODIFIED:" + CreateTZIDDate(oEvent.LastUpdatedAt, oEvent.LastUpdatedAt, true, false, oEvent.EventTimeZoneId) + Environment.NewLine); + if (oEvent.SendReminder) + { + vEvent.Append("BEGIN:VALARM" + Environment.NewLine); + vEvent.Append("TRIGGER:-PT" + iMinutes.ToString() + "M" + Environment.NewLine); + vEvent.Append("ACTION:DISPLAY" + Environment.NewLine); + vEvent.Append("DESCRIPTION:Reminder" + Environment.NewLine); + vEvent.Append("END:VALARM" + Environment.NewLine); + } + + if (_blImages && oEvent.ImageDisplay) + { + vEvent.Append(FoldText("ATTACH:" + GetImageUrl(oEvent.ImageURL, oEvent.PortalID)) + Environment.NewLine); + } + else if (_blImages && !string.IsNullOrEmpty(_iCalDefaultImage)) + { + vEvent.Append(FoldText("ATTACH:" + GetImageUrl(_iCalDefaultImage, oEvent.PortalID)) + Environment.NewLine); + } + } + + vEvent.Append("TRANSP:OPAQUE" + Environment.NewLine); + + vEvent.Append("END:VEVENT" + Environment.NewLine); + + return vEvent.ToString(); + } + + private string CreateAttendee(EventInfo oEvent) + { + StringBuilder attendees = new StringBuilder(); + ArrayList oSignups = default(ArrayList); + EventSignupsInfo oSignup = default(EventSignupsInfo); + EventSignupsController oCtlEventSignups = new EventSignupsController(); + UserController objUsers = new UserController(); + oSignups = oCtlEventSignups.EventsSignupsGetEvent(oEvent.EventID, oEvent.ModuleID); + foreach (EventSignupsInfo tempLoopVar_oSignup in oSignups) + { + oSignup = tempLoopVar_oSignup; + UserInfo objUser = objUsers.GetUser(oEvent.PortalID, oSignup.UserID); + string attendeeemail = ""; + string attendeeanonemail = ""; + string attendeename = ""; + string sPartStat = "ACCEPTED"; + if (!oSignup.Approved) + { + sPartStat = "NEEDS-ACTION"; + } + if (!ReferenceEquals(objUser, null)) + { + attendeeemail = ":MAILTO:" + objUser.Email; + attendeeanonemail = ":MAILTO:" + objUser.FirstName +"." + objUser.LastName + "@no_email.com"; + attendeename = "CN=\"" + objUser.DisplayName + "\""; + } + else + { + attendeeemail = ":MAILTO:" + "anonymous@no_email.com"; + attendeeanonemail = ":MAILTO:" + "anonymous@no_email.com"; + attendeename = "CN=\"Anonymous-" + oSignup.UserID.ToString() + "\""; + } + string sAttendee = ""; + if (_blEnrolleeEmail) + { + sAttendee = "ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=" + sPartStat + ";" + attendeename + attendeeemail + Environment.NewLine; + } + else + { + sAttendee = "ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=" + sPartStat + ";" + attendeename + attendeeanonemail + Environment.NewLine; + } + attendees.Append(sAttendee); + } + return attendees.ToString(); + } +#endregion + +#region Private Support Functions + private static ArrayList TimeFormat(DateTime dBeginDateTime, int iDuration, string timeZoneId, DateTime dUntil = default(DateTime), DateTime dOriginal = default(DateTime)) + { + // VBConversions Note: dUntil assigned to default value below, since optional parameter values must be static and C# doesn't support date literals. + if (dUntil == default(DateTime)) + dUntil = DateTime.MinValue; + + // VBConversions Note: dOriginal assigned to default value below, since optional parameter values must be static and C# doesn't support date literals. + if (dOriginal == default(DateTime)) + dOriginal = DateTime.MinValue; + + ArrayList aTimes = new ArrayList(); + DateTime eDate = default(DateTime); + DateTime tempDateTime = dBeginDateTime.Date + dBeginDateTime.TimeOfDay; + + //Begin Time Format + aTimes.Add(CreateTZIDDate(dBeginDateTime, dBeginDateTime, false, true, timeZoneId)); + + //End Time Format + eDate = tempDateTime.AddMinutes(iDuration); + aTimes.Add(CreateTZIDDate(eDate, eDate, false, true, timeZoneId)); + + //Until Time Format + CultureInfo invCuluture = CultureInfo.InvariantCulture; + aTimes.Add(CreateTZIDDate(dUntil, DateTime.ParseExact("01/01/2002 23:59:59", "MM/dd/yyyy HH:mm:ss", invCuluture), true, false, timeZoneId)); + + //Original Time Format + aTimes.Add(CreateTZIDDate(dOriginal, dOriginal, false, true, timeZoneId)); + + return aTimes; + } + + private static string CreateTZIDDate(DateTime dDate, DateTime dTime, bool blUTC, bool blTZAdd, string timeZoneId) + { + StringBuilder sTime = new StringBuilder(); + if (blTZAdd) + { + sTime.Append("TZID=\"" + timeZoneId + "\":"); + } + sTime.Append(dDate.Year.ToString()); + sTime.Append(Strings.Format(dDate.Month, "0#").ToString()); + sTime.Append(Strings.Format(dDate.Day, "0#").ToString()); + sTime.Append("T"); + sTime.Append(Strings.Format(dTime.Hour, "0#").ToString()); + sTime.Append(Strings.Format(dTime.Minute, "0#").ToString()); + sTime.Append(Strings.Format(dTime.Second, "0#").ToString()); + if (blUTC) + { + sTime.Append("Z"); + } + return sTime.ToString(); + } + + private static string AllDayEventDate(DateTime dDate) + { + StringBuilder sDate = new StringBuilder(); + sDate.Append(dDate.Year.ToString()); + sDate.Append(Strings.Format(dDate.Month, "0#").ToString()); + sDate.Append(Strings.Format(dDate.Day, "0#").ToString()); + return sDate.ToString(); + } + + private string Priority(int importance) + { + switch (importance) + { + case 1: + return "1"; + case 3: + return "9"; + default: + return "5"; + } + } + + private string CreateAltDescription(string eventDesc) + { + string altDescription = "X-ALT-DESC;FMTTYPE=text/html:\\n"; + altDescription += "\\n"; + altDescription += "\\n"; + altDescription += "\\n"; + altDescription += "\\n"; + altDescription += "\\n"; + altDescription += "\\n"; + altDescription += HtmlUtils.StripWhiteSpace(HttpUtility.HtmlDecode(eventDesc), true).Replace(Environment.NewLine, "") + "\\n"; + altDescription += "\\n"; + altDescription += ""; + altDescription = FoldText(altDescription) + Environment.NewLine; + + return altDescription; + } + + private string CreateDescription(string eventDesc) + { + string sDescription = "DESCRIPTION:"; + const int descriptionLength = 1950; + string tmpDesc = CreateText(eventDesc); + tmpDesc = HtmlUtils.Shorten(tmpDesc, descriptionLength, "..."); + sDescription = FoldText(sDescription + tmpDesc + "\\n") + Environment.NewLine; + return sDescription; + } + + private string CreateText(string eventText) + { + string tmpText = HtmlUtils.StripTags(HttpUtility.HtmlDecode(eventText), false); + // Double decode, for things that were encoded by RadEditor + tmpText = HttpUtility.HtmlDecode(tmpText); + tmpText = tmpText.Replace("\\", "\\\\"); + tmpText = tmpText.Replace(",", "\\,"); + tmpText = tmpText.Replace(";", "\\;"); + tmpText = tmpText.Replace(Environment.NewLine, "\\n"); + return tmpText; + } + + private string FormatTZTime(TimeSpan dtTimeSpan) + { + string dtSign = "+"; + if (dtTimeSpan.Hours < 0) + { + dtSign = "-"; + } + return dtSign + Strings.Format(Math.Abs(dtTimeSpan.Hours), "0#") + Strings.Format(Math.Abs(dtTimeSpan.Minutes), "0#"); + } + + private bool IsModerator() + { + return _objEventInfoHelper.IsModerator(true); + } + + private string GetImageUrl(string imageURL, int portalID) + { + string imageSrc = imageURL; + + if (imageURL.StartsWith("FileID=")) + { + int fileId = int.Parse(imageURL.Substring(7)); + Services.FileSystem.IFileInfo objFileInfo = Services.FileSystem.FileManager.Instance.GetFile(fileId); + if (!ReferenceEquals(objFileInfo, null)) + { + imageSrc = System.Convert.ToString(objFileInfo.Folder + objFileInfo.FileName); + if (imageSrc.IndexOf("://") + 1 == 0) + { + Entities.Portals.PortalController pi = new Entities.Portals.PortalController(); + imageSrc = DotNetNuke.Common.Globals.AddHTTP(string.Format("{0}/{1}/{2}", _portalurl, pi.GetPortal(portalID).HomeDirectory, imageSrc)); + } + } + } + + return imageSrc; + + } + + private string FoldText(string inText) + { + string outText = ""; + while (inText.Length > 75) + { + outText = outText + inText.Substring(0, 75) + Environment.NewLine + " "; + inText = inText.Substring(75); + } + outText = outText + inText; + return outText; + } + + private class YearDayLight + { + private DateTime _startDate; + public DateTime StartDate + { + get + { + return _startDate; + } + set + { + _startDate = value; + } + } + private DateTime _endDate; + public DateTime EndDate + { + get + { + return _endDate; + } + set + { + _endDate = value; + } + } + private int _delta; + public int Delta + { + // ReSharper disable UnusedMember.Local + get + { + // ReSharper restore UnusedMember.Local + return _delta; + } + set + { + _delta = value; + } + } + + } + +#endregion + + } +#endregion + + } + + + diff --git a/Components/iCalProvider.vb b/Components/iCalProvider.vb deleted file mode 100644 index d3fc11c..0000000 --- a/Components/iCalProvider.vb +++ /dev/null @@ -1,1024 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports System -Imports DotNetNuke.Entities.Modules -Imports DotNetNuke.Entities.Portals -Imports DotNetNuke.Security -Imports System.Globalization -Imports System.Text -Imports System.Collections.Generic - - -Namespace DotNetNuke.Modules.Events -#Region "vEvent Class" - - Public Class VEvent : Implements IHttpHandler - -#Region " Private Properties" - Private _oContext As HttpContext - Private _blOwnerEmail As Boolean = False - Private _blAnonOwnerEmail As Boolean = False - Private ReadOnly _sExdate As New StringBuilder - Private _objEventInfoHelper As EventInfoHelper - Private _blSeries As Boolean = False - Private _blEventSignup As Boolean = False - Private _blEnrolleeEmail As Boolean = False - Private _blAnonEmail As Boolean = False - Private _blViewEmail As Boolean = False - Private _blEditEmail As Boolean = False - Private _blImages As Boolean = False - Private _iUserid As Integer = -1 - Private _domainName As String = "" - Private _portalurl As String = "" - Private _timeZoneStart As DateTime - Private _timeZoneEnd As DateTime - Private _iCalURLAppend As String = "" - Private _iCalDefaultImage As String = "" - Private _icsFilename As String = "" - Private _settings As EventModuleSettings = Nothing - Private ReadOnly _vTimeZoneIds As New ArrayList - -#End Region - -#Region "Constructor" - Sub New() - End Sub - - Sub New(ByVal series As Boolean, ByVal context As HttpContext) - _blSeries = series - _oContext = context - End Sub -#End Region - -#Region " Properties" - ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable - Get - Return True - End Get - End Property - -#End Region - -#Region " Public Methods" - - Public Sub ProcessVCalRequest(ByVal inContext As HttpContext) Implements IHttpHandler.ProcessRequest - - ' Is this a valid request ? - Dim iItemID As Long = 0 - Dim iModuleID As Integer = 0 - Dim iTabID As Integer = 0 - Dim iCategoryName As String = "" - Dim iCategoryID As Integer = -1 - Dim iSocialGroupId As Integer = -1 - Dim calname As String = "" - - ' Get the scope information - _oContext = inContext - If (iItemID = 0) And (_oContext.Request.QueryString("itemID") = "") Then - Exit Sub - End If - If Not _oContext.Request.QueryString("itemID") = "" Then - iItemID = CType(_oContext.Request.QueryString("itemID"), Long) - End If - - If (iModuleID = 0) And (_oContext.Request.QueryString("Mid") = "") Then - Exit Sub - End If - If Not _oContext.Request.QueryString("Mid") = "" Then - iModuleID = CType(_oContext.Request.QueryString("Mid"), Integer) - End If - - If (iTabID = 0) And (_oContext.Request.QueryString("TabId") = "") Then - Exit Sub - End If - If Not _oContext.Request.QueryString("TabId") = "" Then - iTabID = CType(_oContext.Request.QueryString("TabId"), Integer) - End If - - If iItemID > 0 And (_oContext.Request.QueryString("Series") = "") Then - Exit Sub - Else - _blSeries = False - End If - If Not _oContext.Request.QueryString("Series") = "" Then - _blSeries = CType(_oContext.Request.QueryString("series"), Boolean) - End If - - If Not _oContext.Request.QueryString("CategoryName") = "" Then - iCategoryName = _oContext.Request.QueryString("CategoryName") - Dim objSecurity As New PortalSecurity - iCategoryName = objSecurity.InputFilter(iCategoryName, PortalSecurity.FilterFlag.NoSQL) - End If - If Not HttpContext.Current.Request.QueryString("CategoryID") = "" Then - iCategoryID = CType(_oContext.Request.QueryString("CategoryID"), Integer) - End If - - If Not _oContext.Request.QueryString("groupid") = "" Then - iSocialGroupId = CType(_oContext.Request.QueryString("groupid"), Integer) - End If - - If Not HttpContext.Current.Request.QueryString("Calname") = "" Then - calname = _oContext.Request.QueryString("Calname") - End If - - Dim iCal As String - iCal = CreateiCal(iTabID, iModuleID, iItemID, iSocialGroupId, iCategoryName, iCategoryID, calname) - - ' Stream The vCalendar - Dim oStream As HttpResponse - oStream = _oContext.Response - oStream.ContentEncoding = Encoding.UTF8 - oStream.ContentType = "text/Calendar" - oStream.AppendHeader("Content-Disposition", "filename=" & HttpUtility.UrlEncode(_icsFilename) & ".ics") - oStream.Write(iCal) - - End Sub - - Public Function CreateiCal(ByVal iTabID As Integer, ByVal iModuleID As Integer, ByVal iItemID As Long, ByVal socialGroupId As Integer, Optional ByVal iCategoryName As String = "", Optional ByVal iCategoryID As Integer = -1, Optional ByVal iLocationName As String = "", Optional ByVal iLocationID As Integer = -1, Optional ByVal calname As String = "") As String - ' Get relevant module settings - Dim ems As New EventModuleSettings - _settings = ems.GetEventModuleSettings(iModuleID, Nothing) - - ' Set up for this module - Dim portalSettings As PortalSettings = CType(HttpContext.Current.Items("PortalSettings"), PortalSettings) - _objEventInfoHelper = New EventInfoHelper(iModuleID, iTabID, portalSettings.PortalId, _settings) - _portalurl = _objEventInfoHelper.GetDomainURL() - If portalSettings.PortalAlias.HTTPAlias.IndexOf("/", StringComparison.Ordinal) > 0 Then - _portalurl = _portalurl & Common.Globals.ApplicationPath - End If - - _blOwnerEmail = _settings.Exportowneremail - If _blOwnerEmail Then - _blAnonOwnerEmail = _settings.Exportanonowneremail - End If - _blEventSignup = _settings.Eventsignup - If _settings.EnrollAnonFields.LastIndexOf("03", StringComparison.Ordinal) > -1 Then - _blAnonEmail = True - End If - If _settings.EnrollViewFields.LastIndexOf("03", StringComparison.Ordinal) > -1 Then - _blViewEmail = True - End If - If _settings.EnrollEditFields.LastIndexOf("03", StringComparison.Ordinal) > -1 Then - _blEditEmail = True - End If - - Dim socialUserId As Integer = -1 - If _settings.SocialGroupModule = EventModuleSettings.SocialModule.UserProfile Then - socialUserId = portalSettings.UserId - End If - - _blImages = _settings.Eventimage - _iUserid = portalSettings.UserId - _domainName = portalSettings.PortalAlias.HTTPAlias - Dim iCalDaysBefore As Integer = _settings.IcalDaysBefore - Dim iCalDaysAfter As Integer = _settings.IcalDaysAfter - If Not HttpContext.Current.Request.QueryString("DaysBefore") = "" Then - iCalDaysBefore = CType(HttpContext.Current.Request.QueryString("DaysBefore"), Integer) - End If - If Not HttpContext.Current.Request.QueryString("DaysAfter") = "" Then - iCalDaysAfter = CType(HttpContext.Current.Request.QueryString("DaysAfter"), Integer) - End If - - - _iCalURLAppend = _settings.IcalURLAppend - _iCalDefaultImage = Mid(_settings.IcalDefaultImage, 7) - - ' Lookup DesktopModuleID - Dim objDesktopModule As DesktopModuleInfo - objDesktopModule = DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", portalSettings.PortalId) - - ' Build the filename - Dim objCtlModule As New ModuleController - Dim objModuleInfo As ModuleInfo = objCtlModule.GetModule(iModuleID, iTabID, False) - _icsFilename = Common.Utilities.HtmlUtils.StripTags(objModuleInfo.ModuleTitle, False) - - ' Get the event that is being viewed - Dim oEvent As New EventInfo - Dim oCntrl As New EventController - If iItemID > 0 Then - oEvent = oCntrl.EventsGet(CInt(iItemID), CInt(iModuleID)) - End If - - Dim vEvents As New StringBuilder - If _blSeries And iItemID = 0 Then - ' Not supported yet - ElseIf _blSeries And iItemID > 0 Then - ' Process the series - Dim oEventRecurMaster As EventRecurMasterInfo - Dim oCntrlRecurMaster As New EventRecurMasterController - oEventRecurMaster = oCntrlRecurMaster.EventsRecurMasterGet(oEvent.RecurMasterID, oEvent.ModuleID) - vEvents.Append(CreateRecurvEvent(oEventRecurMaster)) - - _icsFilename = oEventRecurMaster.EventName - ElseIf Not _blSeries And iItemID = 0 Then - ' Process all events for the module - Dim categoryIDs As New ArrayList - If _settings.Enablecategories = EventModuleSettings.DisplayCategories.DoNotDisplay Then - categoryIDs = _settings.ModuleCategoryIDs - iCategoryName = "" - End If - If iCategoryName <> "" Then - Dim oCntrlEventCategory As New EventCategoryController - Dim oEventCategory As EventCategoryInfo = oCntrlEventCategory.EventCategoryGetByName(iCategoryName, portalSettings.PortalId) - If Not oEventCategory Is Nothing Then - categoryIDs.Add(oEventCategory.Category) - End If - End If - If categoryIDs.Count = 0 Then - categoryIDs.Add("-1") - End If - Dim locationIDs As New ArrayList - If _settings.Enablelocations = EventModuleSettings.DisplayLocations.DoNotDisplay Then - locationIDs = _settings.ModuleLocationIDs - iLocationName = "" - End If - If iLocationName <> "" Then - Dim oCntrlEventLocation As New EventLocationController - Dim oEventLocation As EventLocationInfo = oCntrlEventLocation.EventsLocationGetByName(iLocationName, portalSettings.PortalId) - If Not oEventLocation Is Nothing Then - locationIDs.Add(oEventLocation.Location) - End If - End If - If locationIDs.Count = 0 Then - locationIDs.Add("-1") - End If - - Dim objEventTimeZoneUtilities As New EventTimeZoneUtilities - Dim moduleDateNow As DateTime = objEventTimeZoneUtilities.ConvertFromUTCToModuleTimeZone(Date.UtcNow, _settings.TimeZoneId) - Dim startdate As DateTime = DateAdd(DateInterval.Day, 0 - iCalDaysBefore - 1, moduleDateNow) - Dim enddate As DateTime = DateAdd(DateInterval.Day, iCalDaysAfter + 1, moduleDateNow) - Dim lstEvents As ArrayList - lstEvents = _objEventInfoHelper.GetEvents(startdate, enddate, _settings.MasterEvent, categoryIDs, locationIDs, socialGroupId, socialUserId) - For Each oEvent In lstEvents - Dim utcEventTimeBegin As DateTime = objEventTimeZoneUtilities.ConvertToUTCTimeZone(oEvent.EventTimeBegin, oEvent.EventTimeZoneId) - Dim utcEventTimeEnd As DateTime = objEventTimeZoneUtilities.ConvertToUTCTimeZone(oEvent.EventTimeEnd, oEvent.EventTimeZoneId) - Dim utcStart As DateTime = DateAdd(DateInterval.Day, 0 - iCalDaysBefore, Date.UtcNow) - Dim utcEnd As DateTime = DateAdd(DateInterval.Day, iCalDaysAfter, Date.UtcNow) - If utcEventTimeEnd > utcStart And utcEventTimeBegin < utcEnd Then - vEvents.Append(CreatevEvent(oEvent, oEvent.EventTimeBegin, False, False)) - End If - Next - Else - ' Process the single event - vEvents.Append(CreatevEvent(oEvent, oEvent.EventTimeBegin, False, False)) - _icsFilename = oEvent.EventName - End If - - ' Create the initial VCALENDAR - Dim vCalendar As New StringBuilder - vCalendar.Append("BEGIN:VCALENDAR" & Environment.NewLine) - vCalendar.Append("VERSION:2.0" & Environment.NewLine) - vCalendar.Append(FoldText("PRODID:-//DNN//" & objDesktopModule.FriendlyName & " " & objDesktopModule.Version & "//EN") & Environment.NewLine) - vCalendar.Append("CALSCALE:GREGORIAN" & Environment.NewLine) - vCalendar.Append("METHOD:PUBLISH" & Environment.NewLine) - If calname <> "" Then - vCalendar.Append("X-WR-CALNAME:" & calname & Environment.NewLine) - ElseIf _settings.IcalIncludeCalname Then - vCalendar.Append("X-WR-CALNAME:" & _icsFilename & Environment.NewLine) - End If - - ' Create the VTIMEZONE - If _timeZoneStart = Nothing Then - _timeZoneStart = Now() - _timeZoneEnd = DateAdd(DateInterval.Minute, 30, _timeZoneStart) - End If - - vCalendar.Append(CreatevTimezones(_timeZoneStart, _timeZoneEnd)) - - ' Output the events - vCalendar.Append(vEvents.ToString) - - ' Close off the VCALENDAR - vCalendar.Append("END:VCALENDAR" & Environment.NewLine) - - Return vCalendar.ToString - - End Function - - Private Function CreatevTimezones(ByVal dtStartDate As DateTime, ByVal dtEndDate As DateTime) As String - Dim vTimezone As New StringBuilder - For Each vTimeZoneId As String In _vTimeZoneIds - Dim tzi As TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(vTimeZoneId) - Dim adjustments() As TimeZoneInfo.AdjustmentRule = tzi.GetAdjustmentRules() - - With vTimezone - .Append("BEGIN:VTIMEZONE" & Environment.NewLine) - .Append("TZID:" & tzi.Id & Environment.NewLine) - - If adjustments.Count > 0 Then - ' Identify last DST change before start of recurrences - Dim intYear As Integer - Dim lastDSTStartDate As New DateTime - Dim lastDSTEndDate As New DateTime - For intYear = dtStartDate.Year - 1 To dtEndDate.Year Step 1 - Dim yearDayLight As YearDayLight = GetAdjustment(adjustments, intYear) - Dim daylightStart As DateTime = yearDayLight.StartDate - Dim daylightEnd As DateTime = yearDayLight.EndDate - If (lastDSTStartDate = Nothing Or daylightStart > lastDSTStartDate) And daylightStart < dtStartDate Then - lastDSTStartDate = daylightStart - End If - If (lastDSTEndDate = Nothing Or daylightEnd > lastDSTEndDate) And daylightEnd < dtStartDate Then - lastDSTEndDate = daylightEnd - End If - Next - For intYear = dtStartDate.Year - 1 To dtEndDate.Year Step 1 - Dim yearDayLight As YearDayLight = GetAdjustment(adjustments, intYear) - Dim daylightStart As DateTime = yearDayLight.StartDate - Dim daylightEnd As DateTime = yearDayLight.EndDate - - Dim iByDay As Double = Int(daylightEnd.Day / 7) + 1 - Dim sDayOfWeek As String = "" - Select Case daylightEnd.DayOfWeek - Case DayOfWeek.Sunday - sDayOfWeek = "SU" - Case DayOfWeek.Monday - sDayOfWeek = "MO" - Case DayOfWeek.Tuesday - sDayOfWeek = "TU" - Case DayOfWeek.Wednesday - sDayOfWeek = "WE" - Case DayOfWeek.Thursday - sDayOfWeek = "TH" - Case DayOfWeek.Friday - sDayOfWeek = "FR" - Case DayOfWeek.Saturday - sDayOfWeek = "SA" - End Select - - Dim sByDay As String = iByDay.ToString & sDayOfWeek - Dim sByMonth As String = daylightEnd.Month.ToString - - ' Allow for timezone with no DST, and don't include Timezones after end - If daylightStart.Year > 1 And daylightStart < dtEndDate And Not daylightStart < lastDSTStartDate Then - Dim dtFrom As String = FormatTZTime(tzi.GetUtcOffset(DateAdd(DateInterval.Day, -2, daylightStart))) - Dim dtTo As String = FormatTZTime(tzi.GetUtcOffset(DateAdd(DateInterval.Day, +2, daylightStart))) - .Append("BEGIN:DAYLIGHT" & Environment.NewLine) - .Append("TZOFFSETFROM:" & dtFrom & Environment.NewLine) - .Append("TZOFFSETTO:" & dtTo & Environment.NewLine) - .Append("DTSTART:" & CreateTZIDDate(daylightStart, daylightStart, False, False, tzi.Id) & Environment.NewLine) - .Append("END:DAYLIGHT" & Environment.NewLine) - End If - - ' Allow for timezone with no DST, and don't include Timezones after end - If daylightEnd.Year > 1 And daylightEnd < dtEndDate And Not daylightEnd < lastDSTEndDate Then - Dim dtFrom As String = FormatTZTime(tzi.GetUtcOffset(DateAdd(DateInterval.Day, -2, daylightEnd))) - Dim dtTo As String = FormatTZTime(tzi.GetUtcOffset(DateAdd(DateInterval.Day, +2, daylightEnd))) - .Append("BEGIN:STANDARD" & Environment.NewLine) - .Append(FoldText("RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=" & sByMonth & ";BYDAY=" & sByDay & ";COUNT=1") & Environment.NewLine) - .Append("TZOFFSETFROM:" & dtFrom & Environment.NewLine) - .Append("TZOFFSETTO:" & dtTo & Environment.NewLine) - .Append("DTSTART:" & CreateTZIDDate(daylightEnd, daylightEnd, False, False, tzi.Id) & Environment.NewLine) - .Append("END:STANDARD" & Environment.NewLine) - End If - - If Not daylightStart.Year > 1 Then - .Append(CreatevTimezone1601(tzi)) - Exit For - End If - Next - Else - .Append(CreatevTimezone1601(tzi)) - End If - .Append("END:VTIMEZONE" & Environment.NewLine) - End With - Next - Return vTimezone.ToString - End Function - - Private Function GetAdjustment(ByVal adjustments As IEnumerable(Of TimeZoneInfo.AdjustmentRule), _ - ByVal year As Integer) As YearDayLight - ' Iterate adjustment rules for time zone - For Each adjustment As TimeZoneInfo.AdjustmentRule In adjustments - ' Determine if this adjustment rule covers year desired - If adjustment.DateStart.Year <= year And adjustment.DateEnd.Year >= year Then - Dim startTransition, endTransition As TimeZoneInfo.TransitionTime - Dim yearDayLight As New YearDayLight - startTransition = adjustment.DaylightTransitionStart - yearDayLight.StartDate = ProcessAdjustmentDate(startTransition, year) - endTransition = adjustment.DaylightTransitionEnd - yearDayLight.EndDate = ProcessAdjustmentDate(endTransition, year) - yearDayLight.Delta = CInt(adjustment.DaylightDelta.TotalMinutes) - Return yearDayLight - End If - Next - Return Nothing - End Function - - Private Function ProcessAdjustmentDate(ByVal processTransition As TimeZoneInfo.TransitionTime, ByVal year As Integer) As DateTime - Dim transitionDay As Integer - If processTransition.IsFixedDateRule Then - transitionDay = processTransition.Day - Else - ' For non-fixed date rules, get local calendar - Static cal As Calendar = CultureInfo.CurrentCulture.Calendar - - ' Get first day of week for transition - ' For example, the 3rd week starts no earlier than the 15th of the month - Dim startOfWeek As Integer = processTransition.Week * 7 - 6 - ' What day of the week does the month start on? - Dim firstDayOfWeek As Integer = cal.GetDayOfWeek(New Date(Year, processTransition.Month, 1)) - ' Determine how much start date has to be adjusted - Dim changeDayOfWeek As Integer = processTransition.DayOfWeek - - If firstDayOfWeek <= changeDayOfWeek Then - transitionDay = startOfWeek + (changeDayOfWeek - firstDayOfWeek) - Else - transitionDay = startOfWeek + (7 - firstDayOfWeek + changeDayOfWeek) - End If - ' Adjust for months with no fifth week - If transitionDay > cal.GetDaysInMonth(Year, processTransition.Month) Then - transitionDay -= 7 - End If - End If - Return Date.ParseExact(String.Format("{0:0000}/{1:00}/{2:00} {3:HH:mm}", Year, processTransition.Month, transitionDay, processTransition.TimeOfDay), "yyyy/MM/dd HH:mm", CultureInfo.InvariantCulture) - End Function - - Private Function CreatevTimezone1601(ByVal tzi As TimeZoneInfo) As String - Dim vTimezone1601 As New StringBuilder - Dim invCuluture As CultureInfo = CultureInfo.InvariantCulture - Dim dt1601Date As DateTime = Date.ParseExact("01/01/1601 00:00:00", "MM/dd/yyyy HH:mm:ss", invCuluture) - Dim dtTo As String = FormatTZTime(tzi.GetUtcOffset(dt1601Date)) - Dim dtFrom As String = FormatTZTime(tzi.GetUtcOffset(dt1601Date)) - With vTimezone1601 - .Append("BEGIN:STANDARD" & Environment.NewLine) - .Append("TZOFFSETFROM:" & dtFrom & Environment.NewLine) - .Append("TZOFFSETTO:" & dtTo & Environment.NewLine) - .Append("DTSTART:" & CreateTZIDDate(dt1601Date, dt1601Date, False, False, tzi.Id) & Environment.NewLine) - .Append("END:STANDARD" & Environment.NewLine) - End With - Return vTimezone1601.ToString - End Function - - Private Function CreateRecurvEvent(ByVal oEventRecurMaster As EventRecurMasterInfo) As String - Dim vEvent As New StringBuilder - - Dim lstEvents As ArrayList - Dim oEvent As EventInfo - Dim oCntrl As New EventController - lstEvents = oCntrl.EventsGetRecurrences(oEventRecurMaster.RecurMasterID, oEventRecurMaster.ModuleID) - ' Create the single VEVENT - For Each oEvent In lstEvents - If oEvent.EventTimeBegin.TimeOfDay = oEventRecurMaster.Dtstart.TimeOfDay And _ - CStr(oEvent.Duration) & "M" = oEventRecurMaster.Duration And _ - oEvent.EventName = oEventRecurMaster.EventName And _ - oEvent.EventDesc = oEventRecurMaster.EventDesc And _ - oEvent.OwnerID = oEventRecurMaster.OwnerID And _ - oEvent.Location = oEventRecurMaster.Location And _ - oEvent.Importance = oEventRecurMaster.Importance And _ - oEvent.SendReminder = oEventRecurMaster.SendReminder And _ - oEvent.ReminderTime = oEventRecurMaster.ReminderTime And _ - oEvent.AllDayEvent = oEventRecurMaster.AllDayEvent And _ - oEvent.ReminderTimeMeasurement = oEventRecurMaster.ReminderTimeMeasurement And _ - oEvent.Cancelled = False And _ - (oEvent.Enrolled = 0 Or Not _blEventSignup Or Not oEvent.EnrollListView Or Not oEvent.Signups) Then - If Not _blImages Or _ - (_blImages And oEvent.ImageDisplay = oEventRecurMaster.ImageDisplay And oEvent.ImageURL = oEventRecurMaster.ImageURL) Then - Continue For - End If - End If - vEvent.Append(CreatevEvent(oEvent, oEventRecurMaster.Dtstart, False, oEventRecurMaster.AllDayEvent)) - Next - - If lstEvents.Count = 0 Then - Return "" - End If - Dim oFirstEvent As EventInfo = CType(lstEvents.Item(0), EventInfo) - Dim objEventLocation As New EventLocationInfo - Dim objCtlEventLocation As New EventLocationController - - If oEventRecurMaster.Location > 0 Then - objEventLocation = objCtlEventLocation.EventsLocationGet(oEventRecurMaster.Location, oEventRecurMaster.PortalID) - End If - - Dim objEventTimeZoneUtilities As New EventTimeZoneUtilities - Dim recurUntil As DateTime = objEventTimeZoneUtilities.ConvertToUTCTimeZone(oEventRecurMaster.Until, oEventRecurMaster.EventTimeZoneId) - - ' Calculate timezone start/end dates - Dim intDuration As Integer - intDuration = CInt(Left(oEventRecurMaster.Duration, Len(oEventRecurMaster.Duration) - 1)) - If _timeZoneStart = Nothing Or _timeZoneStart > oEventRecurMaster.Dtstart Then - _timeZoneStart = oEventRecurMaster.Dtstart - End If - If _timeZoneEnd = Nothing Or _timeZoneEnd < DateAdd(DateInterval.Minute, intDuration, oEventRecurMaster.Until) Then - _timeZoneEnd = DateAdd(DateInterval.Minute, intDuration, oEventRecurMaster.Until) - End If - - ' Build Item - Dim objUsers As New UserController - Dim objUser As UserInfo = objUsers.GetUser(oEventRecurMaster.PortalID, oEventRecurMaster.OwnerID) - Dim creatoremail As String - Dim creatoranonemail As String - Dim creatorname As String - If Not objUser Is Nothing Then - creatoremail = ":MAILTO:" & objUser.Email - creatoranonemail = ":MAILTO:" & objUser.FirstName & "." & objUser.LastName & "@no_email.com" - creatorname = "CN=""" & objUser.DisplayName & """" - Else - Dim objPortals As New Entities.Portals.PortalController - Dim objPortal As PortalInfo - objPortal = objPortals.GetPortal(oEventRecurMaster.PortalID) - creatoremail = ":MAILTO:" & objPortal.Email() - creatoranonemail = ":MAILTO:" & "anonymous@no_email.com" - creatorname = "CN=""Anonymous""" - End If - - Dim sEmail As String - If (_oContext.Request.IsAuthenticated And _blOwnerEmail) Or _blAnonOwnerEmail Then - sEmail = FoldText("ORGANIZER;" & creatorname & creatoremail) & Environment.NewLine - Else - sEmail = FoldText("ORGANIZER;" & creatorname & creatoranonemail) & Environment.NewLine - End If - - Dim aTimes As ArrayList - Dim sStartTime As String - Dim sEndTime As String - Dim sDtStamp As String - Dim sSequence As String - - aTimes = TimeFormat(oFirstEvent.OriginalDateBegin.Date + oEventRecurMaster.Dtstart.TimeOfDay, intDuration, oFirstEvent.EventTimeZoneId, recurUntil) - If Not oEventRecurMaster.AllDayEvent Then - sStartTime = "DTSTART;" & CStr(aTimes(0)) & Environment.NewLine - sEndTime = "DTEND;" & CStr(aTimes(1)) & Environment.NewLine - Else - sStartTime = "DTSTART;VALUE=DATE:" & AllDayEventDate(oFirstEvent.OriginalDateBegin.Date) & Environment.NewLine - ' +1 deals with use of 1439 minutes instead of 1440 - sEndTime = "DTEND;VALUE=DATE:" & AllDayEventDate(oFirstEvent.OriginalDateBegin.Date.AddMinutes(intDuration + 1)) & Environment.NewLine - End If - sDtStamp = "DTSTAMP:" + CreateTZIDDate(DateTime.UtcNow, DateTime.UtcNow, True, False, oEventRecurMaster.EventTimeZoneId) & Environment.NewLine - sSequence = "SEQUENCE:" & CStr(oEventRecurMaster.Sequence) & Environment.NewLine - - Dim sLocation As String = "" - If oEventRecurMaster.Location > 0 Then - If objEventLocation.MapURL <> "" And _settings.IcalURLInLocation Then - sLocation = objEventLocation.LocationName & " - " & objEventLocation.MapURL - Else - sLocation = objEventLocation.LocationName - End If - sLocation = FoldText("LOCATION:" & CreateText(sLocation)) & Environment.NewLine - End If - Dim sDescription As String = CreateDescription(oEventRecurMaster.EventDesc) - Dim altDescription As String = CreateAltDescription(oEventRecurMaster.EventDesc) - Dim sSummary As String = FoldText("SUMMARY:" & CreateText(oEventRecurMaster.EventName)) & Environment.NewLine - Dim sPriority As String = "PRIORITY:" & Priority(oEventRecurMaster.Importance) & Environment.NewLine - - Dim sURL As String = FoldText("URL:" & _objEventInfoHelper.DetailPageURL(oFirstEvent, False) & _iCalURLAppend) & Environment.NewLine - - With vEvent - .Append("BEGIN:VEVENT" & Environment.NewLine) - Dim strUID As String = String.Format("{0:00000}", oEventRecurMaster.ModuleID) & String.Format("{0:0000000}", oEventRecurMaster.RecurMasterID) - .Append("UID:DNNEvent" & strUID & "@" & _domainName & Environment.NewLine) - .Append(sSequence) - If oEventRecurMaster.RRULE <> "" Then - .Append("RRULE:" & oEventRecurMaster.RRULE & ";" & "UNTIL=" & CStr(aTimes(2)) & Environment.NewLine) - End If - If _sExdate.ToString <> "" Then - .Append(_sExdate.ToString) - End If - .Append(sStartTime) - .Append(sEndTime) - .Append(sDtStamp) - .Append(sURL) - .Append(sEmail) - .Append(sDescription) - .Append(sSummary) - .Append(altDescription) - .Append(sPriority) - .Append(sLocation) - - Dim iMinutes As Integer = 0 - If oEventRecurMaster.SendReminder Then - Select Case oEventRecurMaster.ReminderTimeMeasurement - Case "d" - iMinutes = oEventRecurMaster.ReminderTime * 60 * 24 - Case "h" - iMinutes = oEventRecurMaster.ReminderTime * 60 - Case "m" - iMinutes = oEventRecurMaster.ReminderTime - End Select - End If - - .Append("CLASS:PUBLIC" & Environment.NewLine) - .Append("CREATED:" & CreateTZIDDate(oEventRecurMaster.CreatedDate, oEventRecurMaster.CreatedDate, True, False, oEventRecurMaster.EventTimeZoneId) & Environment.NewLine) - .Append("LAST-MODIFIED:" & CreateTZIDDate(oEventRecurMaster.UpdatedDate, oEventRecurMaster.UpdatedDate, True, False, oEventRecurMaster.EventTimeZoneId) & Environment.NewLine) - If oEventRecurMaster.SendReminder Then - .Append("BEGIN:VALARM" & Environment.NewLine) - .Append("TRIGGER:-PT" & iMinutes.ToString & "M" & Environment.NewLine) - .Append("ACTION:DISPLAY" & Environment.NewLine) - .Append("DESCRIPTION:Reminder" & Environment.NewLine) - .Append("END:VALARM" & Environment.NewLine) - End If - - If _blImages And oEventRecurMaster.ImageDisplay Then - .Append(FoldText("ATTACH:" & GetImageUrl(oEventRecurMaster.ImageURL, oEventRecurMaster.PortalID)) & Environment.NewLine) - ElseIf _blImages And _iCalDefaultImage <> "" Then - .Append(FoldText("ATTACH:" & GetImageUrl(_iCalDefaultImage, oEventRecurMaster.PortalID)) & Environment.NewLine) - End If - - .Append("TRANSP:OPAQUE" & Environment.NewLine) - - .Append("END:VEVENT" & Environment.NewLine) - End With - - Return vEvent.ToString - - End Function - - Private Function CreatevEvent(ByVal oEvent As EventInfo, ByVal dtstart As DateTime, ByVal blURLOnly As Boolean, ByVal blAllDay As Boolean) As String - - If Not _vTimeZoneIds.Contains(oEvent.EventTimeZoneId) Then - _vTimeZoneIds.Add(oEvent.EventTimeZoneId) - End If - - oEvent.OriginalDateBegin = oEvent.OriginalDateBegin.Date + dtstart.TimeOfDay - - ' Calculate timezone start/end dates - If _timeZoneStart = Nothing Or _timeZoneStart > oEvent.EventTimeBegin Then - _timeZoneStart = oEvent.EventTimeBegin - End If - If _timeZoneEnd = Nothing Or _timeZoneEnd < DateAdd(DateInterval.Minute, oEvent.Duration, oEvent.EventTimeBegin) Then - _timeZoneEnd = DateAdd(DateInterval.Minute, oEvent.Duration, oEvent.EventTimeBegin) - End If - - ' Build Item - Dim vEvent As New StringBuilder - - Dim objUsers As New UserController - Dim objUser As UserInfo = objUsers.GetUser(oEvent.PortalID, oEvent.OwnerID) - Dim creatoremail As String - Dim creatoranonemail As String - Dim creatorname As String - If Not objUser Is Nothing Then - creatoremail = ":MAILTO:" & objUser.Email - creatoranonemail = ":MAILTO:" & objUser.FirstName & "." & objUser.LastName & "@no_email.com" - creatorname = "CN=""" & objUser.DisplayName & """" - Else - Dim objPortals As New Entities.Portals.PortalController - Dim objPortal As Entities.Portals.PortalInfo - objPortal = objPortals.GetPortal(oEvent.PortalID) - creatoremail = ":MAILTO:" & objPortal.Email() - creatoranonemail = ":MAILTO:" & "anonymous@no_email.com" - creatorname = "CN=""Anonymous""" - End If - - Dim sEmail As String - If (_oContext.Request.IsAuthenticated And _blOwnerEmail) Or _blAnonOwnerEmail Then - sEmail = FoldText("ORGANIZER;" & creatorname & creatoremail) & Environment.NewLine - Else - sEmail = FoldText("ORGANIZER;" & creatorname & creatoranonemail) & Environment.NewLine - End If - - Dim aTimes As ArrayList - Dim sStartTime As String - Dim sEndTime As String - Dim sDtStamp As String = "" - Dim sSequence As String - - aTimes = TimeFormat(oEvent.EventTimeBegin, oEvent.Duration, oEvent.EventTimeZoneId, , oEvent.OriginalDateBegin) - If oEvent.Cancelled Then - _sExdate.Append("EXDATE;" & CStr(aTimes(3)) & Environment.NewLine) - Return "" - End If - - If Not oEvent.AllDayEvent Then - sStartTime = "DTSTART;" & CStr(aTimes(0)) & Environment.NewLine - sEndTime = "DTEND;" & CStr(aTimes(1)) & Environment.NewLine - Else - sStartTime = "DTSTART;VALUE=DATE:" & AllDayEventDate(oEvent.EventTimeBegin.Date) & Environment.NewLine - ' +1 deals with use of 1439 minutes instead of 1440 - sEndTime = "DTEND;VALUE=DATE:" & AllDayEventDate(oEvent.EventTimeBegin.Date.AddMinutes(oEvent.Duration + 1)) & Environment.NewLine - End If - If Not _blSeries Then - sDtStamp = "DTSTAMP:" + CreateTZIDDate(DateTime.UtcNow, DateTime.UtcNow, True, False, oEvent.EventTimeZoneId) & Environment.NewLine - End If - sSequence = "SEQUENCE:" & CStr(oEvent.Sequence) & Environment.NewLine - - Dim sLocation As String = "" - If oEvent.Location > 0 Then - If oEvent.MapURL <> "" And _settings.IcalURLInLocation Then - sLocation = oEvent.LocationName & " - " & oEvent.MapURL - Else - sLocation = oEvent.LocationName - End If - sLocation = FoldText("LOCATION:" & CreateText(sLocation)) & Environment.NewLine - End If - Dim sDescription As String = CreateDescription(oEvent.EventDesc) - Dim altDescription As String = CreateAltDescription(oEvent.EventDesc) - Dim sSummary As String = FoldText("SUMMARY:" & CreateText(oEvent.EventName)) & Environment.NewLine - Dim sPriority As String = "PRIORITY:" & Priority(oEvent.Importance) & Environment.NewLine - - Dim sURL As String = FoldText("URL:" & _objEventInfoHelper.DetailPageURL(oEvent, False) & _iCalURLAppend) & Environment.NewLine - - With vEvent - .Append("BEGIN:VEVENT" & Environment.NewLine) - Dim strUID As String = String.Format("{0:00000}", oEvent.ModuleID) & String.Format("{0:0000000}", oEvent.RecurMasterID) - If Not _blSeries Then - strUID += String.Format("{0:0000000}", oEvent.EventID) - End If - .Append("UID:DNNEvent" & strUID & "@" & _domainName & Environment.NewLine) - .Append(sSequence) - If _blSeries Then - If Not blAllDay Then - .Append("RECURRENCE-ID;" & CStr(aTimes(3)) & Environment.NewLine) - Else - .Append("RECURRENCE-ID;VALUE=DATE:" & AllDayEventDate(oEvent.OriginalDateBegin) & Environment.NewLine) - End If - End If - .Append(sStartTime) - .Append(sEndTime) - .Append(sDtStamp) - .Append(sURL) - If Not blURLOnly Then - .Append(sEmail) - .Append(sDescription) - .Append(sSummary) - .Append(altDescription) - .Append(sPriority) - .Append(sLocation) - - If _blEventSignup And oEvent.EnrollListView And oEvent.Signups And oEvent.Enrolled > 0 Then - _blEnrolleeEmail = False - If (IsModerator() Or _ - (oEvent.CreatedByID = _iUserid Or oEvent.RmOwnerID = _iUserid Or oEvent.OwnerID = _iUserid)) And _ - _blEditEmail Then - _blEnrolleeEmail = True - End If - If _oContext.Request.IsAuthenticated And _ - (_blViewEmail Or _blAnonEmail) Then - _blEnrolleeEmail = True - End If - If Not _oContext.Request.IsAuthenticated And _ - _blAnonEmail Then - _blEnrolleeEmail = True - End If - .Append(CreateAttendee(oEvent)) - End If - - Dim iMinutes As Integer = 0 - If oEvent.SendReminder Then - Select Case oEvent.ReminderTimeMeasurement - Case "d" - iMinutes = oEvent.ReminderTime * 60 * 24 - Case "h" - iMinutes = oEvent.ReminderTime * 60 - Case "m" - iMinutes = oEvent.ReminderTime - End Select - End If - - .Append("CLASS:PUBLIC" & Environment.NewLine) - .Append("CREATED:" & CreateTZIDDate(oEvent.CreatedDate, oEvent.CreatedDate, True, False, oEvent.EventTimeZoneId) & Environment.NewLine) - .Append("LAST-MODIFIED:" & CreateTZIDDate(oEvent.LastUpdatedAt, oEvent.LastUpdatedAt, True, False, oEvent.EventTimeZoneId) & Environment.NewLine) - If oEvent.SendReminder Then - .Append("BEGIN:VALARM" & Environment.NewLine) - .Append("TRIGGER:-PT" & iMinutes.ToString & "M" & Environment.NewLine) - .Append("ACTION:DISPLAY" & Environment.NewLine) - .Append("DESCRIPTION:Reminder" & Environment.NewLine) - .Append("END:VALARM" & Environment.NewLine) - End If - - If _blImages And oEvent.ImageDisplay Then - .Append(FoldText("ATTACH:" & GetImageUrl(oEvent.ImageURL, oEvent.PortalID)) & Environment.NewLine) - ElseIf _blImages And _iCalDefaultImage <> "" Then - .Append(FoldText("ATTACH:" & GetImageUrl(_iCalDefaultImage, oEvent.PortalID)) & Environment.NewLine) - End If - End If - - .Append("TRANSP:OPAQUE" & Environment.NewLine) - - .Append("END:VEVENT" & Environment.NewLine) - End With - - Return vEvent.ToString - End Function - - Private Function CreateAttendee(ByVal oEvent As EventInfo) As String - Dim attendees As New StringBuilder - Dim oSignups As ArrayList - Dim oSignup As EventSignupsInfo - Dim oCtlEventSignups As New EventSignupsController - Dim objUsers As New UserController - oSignups = oCtlEventSignups.EventsSignupsGetEvent(oEvent.EventID, oEvent.ModuleID) - For Each oSignup In oSignups - Dim objUser As UserInfo = objUsers.GetUser(oEvent.PortalID, oSignup.UserID) - Dim attendeeemail As String - Dim attendeeanonemail As String - Dim attendeename As String - Dim sPartStat As String = "ACCEPTED" - If Not oSignup.Approved Then - sPartStat = "NEEDS-ACTION" - End If - If Not objUser Is Nothing Then - attendeeemail = ":MAILTO:" & objUser.Email - attendeeanonemail = ":MAILTO:" & objUser.FirstName & "." & objUser.LastName & "@no_email.com" - attendeename = "CN=""" & objUser.DisplayName & """" - Else - attendeeemail = ":MAILTO:" & "anonymous@no_email.com" - attendeeanonemail = ":MAILTO:" & "anonymous@no_email.com" - attendeename = "CN=""Anonymous-" & oSignup.UserID.ToString & """" - End If - Dim sAttendee As String - If _blEnrolleeEmail Then - sAttendee = "ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=" & sPartStat & ";" & attendeename & attendeeemail & Environment.NewLine - Else - sAttendee = "ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=" & sPartStat & ";" & attendeename & attendeeanonemail & Environment.NewLine - End If - attendees.Append(sAttendee) - Next - Return attendees.ToString - End Function -#End Region - -#Region " Private Support Functions" - Private Shared Function TimeFormat(ByVal dBeginDateTime As Date, ByVal iDuration As Integer, ByVal timeZoneId As String, Optional ByVal dUntil As DateTime = Nothing, Optional ByVal dOriginal As DateTime = Nothing) As ArrayList - Dim aTimes As New ArrayList - Dim eDate As DateTime - Dim tempDateTime As DateTime = dBeginDateTime.Date + dBeginDateTime.TimeOfDay - - 'Begin Time Format - aTimes.Add(CreateTZIDDate(dBeginDateTime, dBeginDateTime, False, True, timeZoneId)) - - 'End Time Format - eDate = tempDateTime.AddMinutes(iDuration) - aTimes.Add(CreateTZIDDate(eDate, eDate, False, True, timeZoneId)) - - 'Until Time Format - Dim invCuluture As CultureInfo = CultureInfo.InvariantCulture - aTimes.Add(CreateTZIDDate(dUntil, Date.ParseExact("01/01/2002 23:59:59", "MM/dd/yyyy HH:mm:ss", invCuluture), True, False, timeZoneId)) - - 'Original Time Format - aTimes.Add(CreateTZIDDate(dOriginal, dOriginal, False, True, timeZoneId)) - - Return aTimes - End Function - - Private Shared Function CreateTZIDDate(ByVal dDate As DateTime, ByVal dTime As DateTime, ByVal blUTC As Boolean, ByVal blTZAdd As Boolean, ByVal timeZoneId As String) As String - Dim sTime As New StringBuilder - If blTZAdd Then - sTime.Append("TZID=""" & timeZoneId & """:") - End If - sTime.Append(dDate.Year.ToString) - sTime.Append(Format(dDate.Month, "0#").ToString) - sTime.Append(Format(dDate.Day, "0#").ToString) - sTime.Append("T") - sTime.Append(Format(dTime.Hour, "0#").ToString) - sTime.Append(Format(dTime.Minute, "0#").ToString) - sTime.Append(Format(dTime.Second, "0#").ToString) - If blUTC Then - sTime.Append("Z") - End If - Return sTime.ToString - End Function - - Private Shared Function AllDayEventDate(ByVal dDate As DateTime) As String - Dim sDate As New StringBuilder - sDate.Append(dDate.Year.ToString) - sDate.Append(Format(dDate.Month, "0#").ToString) - sDate.Append(Format(dDate.Day, "0#").ToString) - Return sDate.ToString - End Function - - Private Function Priority(ByVal importance As Integer) As String - Select Case Importance - Case 1 - Return "1" - Case 3 - Return "9" - Case Else - Return "5" - End Select - End Function - - Private Function CreateAltDescription(ByVal eventDesc As String) As String - Dim altDescription As String = "X-ALT-DESC;FMTTYPE=text/html:\n" - altDescription += "\n" - altDescription += "\n" - altDescription += "\n" - altDescription += "\n" - altDescription += "\n" - altDescription += "\n" - altDescription += HtmlUtils.StripWhiteSpace(HttpUtility.HtmlDecode(eventDesc), True).Replace(Environment.NewLine, "") & "\n" - altDescription += "\n" - altDescription += "" - altDescription = FoldText(altDescription) & Environment.NewLine - - Return altDescription - End Function - - Private Function CreateDescription(ByVal eventDesc As String) As String - Dim sDescription As String = "DESCRIPTION:" - Const descriptionLength As Integer = 1950 - Dim tmpDesc As String = CreateText(eventDesc) - tmpDesc = HtmlUtils.Shorten(tmpDesc, descriptionLength, "...") - sDescription = FoldText(sDescription & tmpDesc & "\n") & Environment.NewLine - Return sDescription - End Function - - Private Function CreateText(ByVal eventText As String) As String - Dim tmpText As String = HtmlUtils.StripTags(HttpUtility.HtmlDecode(eventText), False) - ' Double decode, for things that were encoded by RadEditor - tmpText = HttpUtility.HtmlDecode(tmpText) - tmpText = tmpText.Replace("\", "\\") - tmpText = tmpText.Replace(",", "\,") - tmpText = tmpText.Replace(";", "\;") - tmpText = tmpText.Replace(Environment.NewLine, "\n") - Return tmpText - End Function - - Private Function FormatTZTime(ByVal dtTimeSpan As TimeSpan) As String - Dim dtSign As String = "+" - If dtTimeSpan.Hours < 0 Then - dtSign = "-" - End If - Return dtSign & Format(Math.Abs(dtTimeSpan.Hours), "0#") & Format(Math.Abs(dtTimeSpan.Minutes), "0#") - End Function - - Private Function IsModerator() As Boolean - Return _objEventInfoHelper.IsModerator(True) - End Function - - Private Function GetImageUrl(ByVal imageURL As String, ByVal portalID As Integer) As String - Dim imageSrc As String = imageURL - - If imageURL.StartsWith("FileID=") Then - Dim fileId As Integer = Integer.Parse(imageURL.Substring(7)) - Dim objFileInfo As Services.FileSystem.IFileInfo = Services.FileSystem.FileManager.Instance.GetFile(fileId) - If Not objFileInfo Is Nothing Then - imageSrc = objFileInfo.Folder + objFileInfo.FileName - If InStr(1, imageSrc, "://") = 0 Then - Dim pi As New Entities.Portals.PortalController - imageSrc = AddHTTP(String.Format("{0}/{1}/{2}", _portalurl, pi.GetPortal(PortalID).HomeDirectory, imageSrc)) - End If - End If - End If - - Return imageSrc - - End Function - - Private Function FoldText(ByVal inText As String) As String - Dim outText As String = "" - Do While Len(inText) > 75 - outText = outText & Left(inText, 75) & Environment.NewLine & " " - inText = Mid(inText, 76) - Loop - outText = outText & inText - Return outText - End Function - - Private Class YearDayLight - Private _startDate As DateTime - Property StartDate() As DateTime - Get - Return _StartDate - End Get - Set(ByVal value As DateTime) - _startDate = Value - End Set - End Property - Private _endDate As DateTime - Property EndDate() As DateTime - Get - Return _EndDate - End Get - Set(ByVal value As DateTime) - _endDate = Value - End Set - End Property - Private _delta As Integer - Property Delta() As Integer - ' ReSharper disable UnusedMember.Local - Get - ' ReSharper restore UnusedMember.Local - Return _delta - End Get - Set(ByVal value As Integer) - _delta = Value - End Set - End Property - - End Class - -#End Region - - End Class -#End Region - -End Namespace - diff --git a/Controls/DotNetNuke.Events.ScheduleControl/DNNCalendar.cs b/Controls/DotNetNuke.Events.ScheduleControl/DNNCalendar.cs new file mode 100644 index 0000000..e4c4d49 --- /dev/null +++ b/Controls/DotNetNuke.Events.ScheduleControl/DNNCalendar.cs @@ -0,0 +1,972 @@ +using System; +using System.Collections; +using System.ComponentModel; +using System.Drawing; +using System.Globalization; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.HtmlControls; +using System.Web.UI.WebControls; + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + + +namespace DotNetNuke.Modules.Events.ScheduleControl +{ + namespace MonthControl + { + + /// + /// Enumerator for Days of Week + /// + [Flags()]public enum MyDayOfWeek + { + /// + /// Monday + /// + Monday = 1, + /// + /// Tuesday + /// + Tuesday = 2, + /// + /// Wednesday + /// + Wednesday = 4, + /// + /// Thursday + /// + Thursday = 8, + /// + /// Friday + /// + Friday = 16, + /// + /// Saturday + /// + Saturday = 32, + /// + /// Sunday + /// + Sunday = 64 + } + + /// + /// Fixes Web Calendar Control Style Issues + /// + [CLSCompliant(true), DefaultEvent("SelectionChanged"), ToolboxBitmap(typeof(DNNCalendar), "DNNCalendar.bmp"), ToolboxData("<{0}:DNNCalendar runat=\"server\">")]public class DNNCalendar : System.Web.UI.WebControls.Calendar + { + + // Mapping of built-in DayOfWeek and our custom MyDayOfWeek + private MyDayOfWeek DayOfWeekMapping(DayOfWeek orig) + { + MyDayOfWeek ret = default(MyDayOfWeek); + switch (orig) + { + case DayOfWeek.Monday: + ret = MyDayOfWeek.Monday; + break; + case DayOfWeek.Tuesday: + ret = MyDayOfWeek.Tuesday; + break; + case DayOfWeek.Wednesday: + ret = MyDayOfWeek.Wednesday; + break; + case DayOfWeek.Thursday: + ret = MyDayOfWeek.Thursday; + break; + case DayOfWeek.Friday: + ret = MyDayOfWeek.Friday; + break; + case DayOfWeek.Saturday: + ret = MyDayOfWeek.Saturday; + break; + case DayOfWeek.Sunday: + ret = MyDayOfWeek.Sunday; + break; + default: + ret = MyDayOfWeek.Saturday; + break; + } + + return ret; + } + + /// + /// Set WeekEnd days + /// + [Bindable(true), Browsable(true), Category("Appearance"), Description("What days are considered Weekend Days"), DefaultValue(MyDayOfWeek.Saturday | MyDayOfWeek.Sunday)]public MyDayOfWeek WeekEndDays + { + get + { + MyDayOfWeek wed = (MyDayOfWeek) ((int) (MyDayOfWeek.Saturday) | (int) MyDayOfWeek.Sunday); + object obj = this.ViewState["wed"]; + if (obj != null) + { + wed = (MyDayOfWeek) obj; + } + return wed; + } + set + { + this.ViewState["wed"] = value; + } + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// Use this constructor to create and initialize a new instance of + /// the class. + /// + public DNNCalendar() + { + } + +#region Private properties + // Gets the date that specifies the month to be displayed. This will + // be VisibleDate unless that property is defaulted to + // DateTime.MinValue, in which case TodaysDate is returned instead. + private DateTime TargetDate + { + get + { + if (this.VisibleDate == DateTime.MinValue) + { + return this.TodaysDate; + } + else + { + return this.VisibleDate; + } + } + } + + // This is the date used for creating day count values, i.e., the + // number of days between some date and this one. These values are + // used to create post back event arguments identical to those used + // by the base Calendar class. + private static readonly DateTime DayCountBaseDate = new DateTime(2000, 1, 1); +#endregion + +#region Control rendering + + /// + /// This member overrides . + /// + protected override void Render(HtmlTextWriter output) + { + // Create the main table. + Table table = new Table(); + table.CellPadding = this.CellPadding; + table.CellSpacing = this.CellSpacing; + + if (this.ShowGridLines) + { + table.GridLines = GridLines.Both; + } + else + { + table.GridLines = GridLines.None; + } + + // If ShowTitle is true, add a row with the calendar title. + if (this.ShowTitle) + { + // Create a one-cell table row. + TableRow row = new TableRow(); + TableCell cell = new TableCell(); + if (this.HasWeekSelectors(this.SelectionMode)) + { + cell.ColumnSpan = 8; + } + else + { + cell.ColumnSpan = 7; + } + + // Apply styling. + cell.MergeStyle(this.TitleStyle); + + // Add the title table to the cell. + cell.Controls.Add(this.TitleTable()); + row.Cells.Add(cell); + + // Add it to the table. + table.Rows.Add(row); + } + + // If ShowDayHeader is true, add a row with the days header. + if (this.ShowDayHeader) + { + table.Rows.Add(DaysHeaderTableRow()); + } + + // Find the first date that will be visible on the calendar. + DateTime date = this.GetFirstCalendarDate(); + + // Create a list for storing nonselectable dates. + ArrayList nonselectableDates = new ArrayList(); + + // Add rows for the dates (six rows are always displayed). + for (int i = 0; i <= 5; i++) + { + TableRow row = new TableRow(); + + // Create a week selector, if needed. + if (this.HasWeekSelectors(this.SelectionMode)) + { + TableCell cell = new TableCell(); + cell.HorizontalAlign = HorizontalAlign.Center; + cell.MergeStyle(this.SelectorStyle); + + if (this.Enabled) + { + // Create the post back link. + HtmlAnchor anchor = new HtmlAnchor(); + string arg = string.Format("R{0}07", this.DayCountFromDate(date)); + anchor.HRef = this.Page.ClientScript.GetPostBackClientHyperlink(this, arg); + anchor.Controls.Add(new LiteralControl(this.SelectWeekText)); + + // Add a color style to the anchor if it is explicitly + // set. + if (!this.SelectorStyle.ForeColor.IsEmpty) + { + anchor.Attributes.Add("style", string.Format("color:{0}", this.SelectorStyle.ForeColor.Name)); + } + + cell.Controls.Add(anchor); + } + else + { + cell.Controls.Add(new LiteralControl(this.SelectWeekText)); + } + + row.Cells.Add(cell); + } + + // Add the days (there are always seven days per row). + for (int j = 0; j <= 6; j++) + { + // Create a CalendarDay and a TableCell for the date. + CalendarDay day = this.Day(date); + TableCell cell = this.Cell(day); + + // Raise the OnDayRender event. + this.OnDayRender(cell, day); + + // If the day was marked nonselectable, add it to the list. + if (!day.IsSelectable) + { + nonselectableDates.Add(day.Date.ToShortDateString()); + } + + // If the day is selectable, and the selection mode allows + // it, convert the text to a link with post back. + if (this.Enabled && day.IsSelectable && this.SelectionMode != CalendarSelectionMode.None) + { + try + { + // Create the post back link. + HtmlAnchor anchor = new HtmlAnchor(); + string arg = System.Convert.ToString(this.DayCountFromDate(date).ToString()); + anchor.HRef = this.Page.ClientScript.GetPostBackClientHyperlink(this, arg); + + // Copy the existing text. + anchor.Controls.Add(new LiteralControl(((LiteralControl) (cell.Controls[0])).Text)); + + // Add a color style to the anchor if it is + // explicitly set. Note that the style precedence + // follows that of the base Calendar control. + string s = ""; + if (!this.DayStyle.ForeColor.IsEmpty) + { + s = this.DayStyle.ForeColor.Name; + } + MyDayOfWeek currdayofweek = DayOfWeekMapping(day.Date.DayOfWeek); + if (((this.WeekEndDays & currdayofweek) == currdayofweek) && (!this.WeekendDayStyle.ForeColor.IsEmpty)) + { + s = this.WeekendDayStyle.ForeColor.Name; + } + if (day.IsOtherMonth && !this.OtherMonthDayStyle.ForeColor.IsEmpty) + { + s = this.OtherMonthDayStyle.ForeColor.Name; + } + if (day.IsToday && !this.TodayDayStyle.ForeColor.IsEmpty) + { + s = this.TodayDayStyle.ForeColor.Name; + } + if (this.SelectedDates.Contains(day.Date) && !this.SelectedDayStyle.ForeColor.IsEmpty) + { + s = this.SelectedDayStyle.ForeColor.Name; + } + if (s.Length > 0) + { + anchor.Attributes.Add("style", string.Format("color:{0}", s)); + } + + // Replace the literal control in the cell with + // the anchor. + cell.Controls.RemoveAt(0); + cell.Controls.AddAt(0, anchor); + } + catch (Exception) + { + } + } + + // Add the cell to the current table row. + row.Cells.Add(cell); + + // Bump the date. + date = date.AddDays(1); + } + + // Add the row. + table.Rows.Add(row); + } + + // Save the list of nonselectable dates. + if (nonselectableDates.Count > 0) + { + this.SaveNonselectableDates(nonselectableDates); + } + + // Apply styling. + this.AddAttributesToRender(output); + + // Render the table. + table.RenderControl(output); + } + + // ==================================================================== + // Helper functions for rendering the control. + // ==================================================================== + + // + // Generates a Table control for the calendar title. + // + private Table TitleTable() + { + // Create a table row. + TableRow row = new TableRow(); + TableCell cell = default(TableCell); + HtmlAnchor anchor = default(HtmlAnchor); + DateTime date = default(DateTime); + string text = ""; + + // Add a table cell with the previous month. + if (this.ShowNextPrevMonth) + { + cell = new TableCell(); + cell.MergeStyle(this.NextPrevStyle); + cell.Style.Add("width", "15%"); + + // Find the first of the previous month, needed for post back + // processing. + try + { + date = new DateTime(this.TargetDate.Year, this.TargetDate.Month, 1).AddMonths(-1); + } + catch (Exception) + { + date = this.TargetDate; + } + + // Get the previous month text. + if (this.NextPrevFormat == NextPrevFormat.CustomText) + { + text = this.PrevMonthText; + } + else + { + if (this.NextPrevFormat == NextPrevFormat.ShortMonth) + { + text = date.ToString("MMM"); + } + else + { + text = date.ToString("MMMM"); + } + } + + if (this.Enabled) + { + // Create the post back link. + anchor = new HtmlAnchor(); + string arg = string.Format("V{0}", this.DayCountFromDate(date)); + anchor.HRef = this.Page.ClientScript.GetPostBackClientHyperlink(this, arg); + anchor.Controls.Add(new LiteralControl(text)); + + // Add a color style to the anchor if it is explicitly + // set. + if (!this.NextPrevStyle.ForeColor.IsEmpty) + { + anchor.Attributes.Add("style", string.Format("color:{0}", this.NextPrevStyle.ForeColor.Name)); + } + + // Add the link to the cell. + // } + cell.Controls.Add(anchor); + } + else + { + cell.Controls.Add(new LiteralControl(text)); + } + + row.Cells.Add(cell); + } + + // Add a table cell for the title text. + cell = new TableCell(); + cell.HorizontalAlign = HorizontalAlign.Center; + cell.VerticalAlign = VerticalAlign.Middle; + if (this.ShowNextPrevMonth) + { + cell.Style.Add("width", "70%"); + } + if (this.TitleFormat == TitleFormat.Month) + { + cell.Text = this.TargetDate.ToString("MMMM"); + } + else + { + cell.Text = System.Convert.ToString(this.TargetDate.ToString("y").Replace(", ", " ")); + } + row.Cells.Add(cell); + + // Add a table cell for the next month. + if (this.ShowNextPrevMonth) + { + cell = new TableCell(); + cell.HorizontalAlign = HorizontalAlign.Right; + cell.MergeStyle(this.NextPrevStyle); + cell.Style.Add("width", "15%"); + + // Find the first of the next month, needed for post back + // processing. + try + { + date = new DateTime(this.TargetDate.Year, this.TargetDate.Month, 1).AddMonths(1); + } + catch (Exception) + { + date = this.TargetDate; + } + + // Get the next month text. + if (this.NextPrevFormat == NextPrevFormat.CustomText) + { + text = this.NextMonthText; + } + else + { + if (this.NextPrevFormat == NextPrevFormat.ShortMonth) + { + text = date.ToString("MMM"); + } + else + { + text = date.ToString("MMMM"); + } + } + + if (this.Enabled) + { + // Create the post back link. + anchor = new HtmlAnchor(); + string arg = string.Format("V{0}", this.DayCountFromDate(date)); + anchor.HRef = this.Page.ClientScript.GetPostBackClientHyperlink(this, arg); + anchor.Controls.Add(new LiteralControl(text)); + + // Add a color style to the anchor if it is explicitly + // set. + if (!this.NextPrevStyle.ForeColor.IsEmpty) + { + anchor.Attributes.Add("style", string.Format("color:{0}", this.NextPrevStyle.ForeColor.Name)); + } + + // Add the link to the cell. + // } + cell.Controls.Add(anchor); + } + else + { + cell.Controls.Add(new LiteralControl(text)); + } + + row.Cells.Add(cell); + } + + // Create the table and add the title row to it. + Table table = new Table(); + table.CellPadding = 0; + table.CellSpacing = 0; + table.Attributes.Add("style", "width:100%;height:100%"); + table.Rows.Add(row); + + return table; + } + + // + // Generates a TableRow control for the calendar days header. + // + private TableRow DaysHeaderTableRow() + { + // Create the table row. + TableRow row = new TableRow(); + + // Create an array of days. + DayOfWeek[] days = new DayOfWeek[] {DayOfWeek.Sunday, DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday, + DayOfWeek.Saturday}; + + // Adjust the array to get the specified starting day at the first index. + DayOfWeek first = this.GetFirstDayOfWeek(); + while (days[0] != first) + { + DayOfWeek temp = days[0]; + for (int i = 0; i <= days.Length - 2; i++) + { + days[i] = days[i + 1]; + } + days[days.Length - 1] = temp; + } + + // Add a month selector column, if needed. + if (this.HasWeekSelectors(this.SelectionMode)) + { + TableCell cell = new TableCell(); + cell.HorizontalAlign = HorizontalAlign.Center; + + // If months are selectable, create the selector. + if (this.SelectionMode == CalendarSelectionMode.DayWeekMonth) + { + // Find the first of the month. + DateTime date = new DateTime(this.TargetDate.Year, this.TargetDate.Month, 1); + + // Use the selector style. + cell.MergeStyle(this.SelectorStyle); + + // Create the post back link. + if (this.Enabled) + { + HtmlAnchor anchor = new HtmlAnchor(); + string arg = string.Format("R{0}{1}", this.DayCountFromDate(date), DateTime.DaysInMonth(date.Year, date.Month)); + anchor.HRef = this.Page.ClientScript.GetPostBackClientHyperlink(this, arg); + anchor.Controls.Add(new LiteralControl(this.SelectMonthText)); + + // Add a color style to the anchor if it is explicitly + // set. + if (!this.SelectorStyle.ForeColor.IsEmpty) + { + anchor.Attributes.Add("style", string.Format("color:{0}", this.SelectorStyle.ForeColor.Name)); + } + + cell.Controls.Add(anchor); + } + else + { + cell.Controls.Add(new LiteralControl(this.SelectMonthText)); + } + } + else + { + // Use the day header style. + cell.CssClass = this.DayHeaderStyle.CssClass; + } + + row.Cells.Add(cell); + } + + // Add the day names to the header. + foreach (System.DayOfWeek day in days) + { + row.Cells.Add(this.DayHeaderTableCell(day)); + } + + return row; + } + + // + // Returns a table cell containing a day name for the calendar day + // header. + // + private TableCell DayHeaderTableCell(System.DayOfWeek dayOfWeek) + { + // Generate the day name text based on the specified format. + string s = ""; + if (this.DayNameFormat == DayNameFormat.Short) + { + s = CultureInfo.CurrentCulture.DateTimeFormat.AbbreviatedDayNames[System.Convert.ToInt32(dayOfWeek)]; + } + else + { + s = CultureInfo.CurrentCulture.DateTimeFormat.DayNames[System.Convert.ToInt32(dayOfWeek)]; + if (this.DayNameFormat == DayNameFormat.FirstTwoLetters) + { + s = s.Substring(0, 2); + } + if (this.DayNameFormat == DayNameFormat.FirstLetter) + { + s = s.Substring(0, 1); + } + } + + // Create the cell, set the style and the text. + TableCell cell = new TableCell(); + cell.HorizontalAlign = HorizontalAlign.Center; + cell.MergeStyle(this.DayHeaderStyle); + cell.Text = s; + + return cell; + } + + // + // Determines the first day of the week based on the FirstDayOfWeek + // property setting. + // + private System.DayOfWeek GetFirstDayOfWeek() + { + // If the default value is specifed, use the system default. + if (this.FirstDayOfWeek == System.Web.UI.WebControls.FirstDayOfWeek.Default) + { + return CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek; + } + else + { + return ((DayOfWeek) this.FirstDayOfWeek); + } + } + + // + // Returns the date that should appear in the first day cell of the + // calendar display. + // + private DateTime GetFirstCalendarDate() + { + // Start with the first of the month. + DateTime date = new DateTime(this.TargetDate.Year, this.TargetDate.Month, 1); + + // While that day does not fall on the first day of the week, move back. + DayOfWeek firstDay = this.GetFirstDayOfWeek(); + while (date.DayOfWeek != firstDay) + { + date = date.AddDays(-1); + } + + return date; + } + + // + // Creates a CalendarDay instance for the given date. + // + // This object is included in the DayRenderEventArgs passed to + // the DayRender event handler. + // + private CalendarDay Day(DateTime date) + { + CalendarDay calday = new CalendarDay(date, date.DayOfWeek == DayOfWeek.Saturday || date.DayOfWeek == DayOfWeek.Sunday, date == this.TodaysDate, date == this.SelectedDate, !(date.Month == this.TargetDate.Month && date.Year == this.TargetDate.Year), date.Day.ToString()); + + // Default the day to selectable. + calday.IsSelectable = true; + + return calday; + } + + // + // Creates a TableCell control for the given calendar day. + // + // Note: This object is included in the DayRenderEventArgs passed to + // the DayRender event handler. + // + private TableCell Cell(CalendarDay day) + { + TableCell tbcell = new TableCell(); + tbcell.HorizontalAlign = HorizontalAlign.Center; + + // Add styling based on day flags. + // - Styles are applied per the precedence order used by the + // base Calendar control. + // - For CssClass, multiple class names may be added. + StringBuilder sb = new StringBuilder(); + MyDayOfWeek currdayofweek = DayOfWeekMapping(day.Date.DayOfWeek); + if (((this.WeekEndDays & currdayofweek) == currdayofweek) && (!day.IsOtherMonth) && (!(ReferenceEquals(this.WeekendDayStyle, null)))) + { + tbcell.MergeStyle(this.WeekendDayStyle); + sb.AppendFormat(" {0}", this.WeekendDayStyle.CssClass); + } + if (day.IsOtherMonth) + { + if (day.IsWeekend) + { + tbcell.ApplyStyle(this.OtherMonthDayStyle); + sb = new StringBuilder(); + sb.AppendFormat(" {0}", this.OtherMonthDayStyle.CssClass); + } + else + { + tbcell.MergeStyle(this.OtherMonthDayStyle); + sb.AppendFormat(" {0}", this.OtherMonthDayStyle.CssClass); + } + } + + if (this.SelectedDates.Contains(day.Date)) + { + tbcell.MergeStyle(this.SelectedDayStyle); + sb.AppendFormat(" {0}", this.SelectedDayStyle.CssClass); + } + if (day.IsToday) + { + tbcell.MergeStyle(this.TodayDayStyle); + sb.AppendFormat(" {0}", this.TodayDayStyle.CssClass); + } + + tbcell.MergeStyle(this.DayStyle); + sb.AppendFormat(" {0}", this.DayStyle.CssClass); + + string s = System.Convert.ToString(sb.ToString().Trim()); + if (s.Length > 0) + { + tbcell.CssClass = s; + } + + // Add a literal control to the cell using the day number for the + // text. + tbcell.Controls.Add(new LiteralControl(day.DayNumberText)); + + return tbcell; + } + + // + // Returns true if the selection mode includes week selectors. + // + private new bool HasWeekSelectors(CalendarSelectionMode selectionMode) + { + if (selectionMode == CalendarSelectionMode.DayWeek || selectionMode == CalendarSelectionMode.DayWeekMonth) + { + return true; + } + else + { + return false; + } + } +#endregion + +#region Post back event handling + // ==================================================================== + // Functions for converting between DateTime and day count values. + // ==================================================================== + + // + // Returns the number of days between the given DateTime value and the + // base date. + // + private int DayCountFromDate(DateTime date) + { + return (date - DNNCalendar.DayCountBaseDate).Days; + } + + // + // Returns a DateTime value equal to the base date plus the given number + // of days. + // + private DateTime DateFromDayCount(int dayCount) + { + return DNNCalendar.DayCountBaseDate.AddDays(dayCount); + } + + // ==================================================================== + // Functions to save and load the nonselectable dates list. + // + // A hidden form field is used to store this data rather than the + // view state because the nonselectable dates are not known until after + // the DayRender event has been raised for each day as the control is + // rendered. + // + // To minimize the amount of data stored in that field, the dates are + // represented as day count values. + // ==================================================================== + + // + // Saves a list of dates to the hidden form field. + // + private void SaveNonselectableDates(ArrayList dates) + { + // Build a string array by converting each date to a day count + // value. + string[] list = new string[dates.Count - 1+ 1]; + for (int i = 0; i <= list.Length - 1; i++) + { + list[i] = System.Convert.ToString(this.DayCountFromDate(DateTime.Parse(System.Convert.ToString(dates[i].ToString()))).ToString()); + } + + // Get the hidden field name. + string fieldName = this.GetHiddenFieldName(); + + // For the field value, create a comma-separated list from the day + // count values. + string fieldValue = HttpUtility.HtmlAttributeEncode(string.Join(",", list)); + + // Add the hidden form field to the page. + //EVT-9313 this.Page.RegisterHiddenField(fieldName, fieldValue); + this.Page.ClientScript.RegisterHiddenField(fieldName, fieldValue); + } + + // + // Returns a list of dates stored in the hidden form field. + // + private ArrayList LoadNonselectableDates() + { + // Create an empty list. + ArrayList dates = new ArrayList(); + + // Get the value stored in the hidden form field. + string fieldName = this.GetHiddenFieldName(); + string fieldValue = this.Page.Request.Form[fieldName]; + + // If no dates were stored, return the empty list. + if (ReferenceEquals(fieldValue, null)) + { + return dates; + } + + // Extract the individual day count values. + string[] list = fieldValue.Split(','); + + // Convert those values to dates and store them in an array list. + foreach (string s in list) + { + dates.Add(this.DateFromDayCount(int.Parse(s))); + } + + return dates; + } + + // + // Returns the name of the hidden field used to store nonselectable + // dates on the form. + // + private string GetHiddenFieldName() + { + // Create a unique field name. + return string.Format("{0}_NonselectableDates", this.ClientID); + } + + // ==================================================================== + // Implementation of the IPostBackEventHandler.RaisePostBackEvent + // event handler. + // ==================================================================== + + /// + /// Handles a post back event targeted at the control. + /// + /// + /// A representing the event argument passed to the handler. + /// + public new void RaisePostBackEvent(string eventArgument) + { + // Was the post back initiated by a previous or next month link + if (eventArgument.StartsWith("V")) + { + try + { + // Save the current visible date. + DateTime previousDate = this.TargetDate; + + // Extract the day count from the argument and use it to + // change the visible date. + int d = int.Parse(eventArgument.Substring(1)); + this.VisibleDate = this.DateFromDayCount(d); + + // Raise the VisibleMonthChanged event. + OnVisibleMonthChanged(this.VisibleDate, previousDate); + } + catch (Exception) + { + } + return; + } + + // Was the post back initiated by a month or week selector link + if (eventArgument.StartsWith("R")) + { + try + { + // Extract the day count and number of days from the + // argument. + int d = int.Parse(eventArgument.Substring(1, eventArgument.Length - 3)); + int n = int.Parse(eventArgument.Substring(eventArgument.Length - 2)); + + // Get the starting date. + DateTime date = this.DateFromDayCount(d); + + // Reset the selected dates collection to include all the + // dates in the given range. + this.SelectedDates.Clear(); + this.SelectedDates.SelectRange(date, date.AddDays(n - 1)); + + // // If SelectAllInRange is false, remove any dates found + // // in the nonselectable date list. + // if (!this.SelectAllInRange) + // { + // ArrayList nonselectableDates = this.LoadNonselectableDates(); + // foreach(DateTime badDate in nonselectableDates) + // this.SelectedDates.Remove(badDate); + // } + + // Raise the SelectionChanged event. + OnSelectionChanged(); + } + catch (Exception) + { + } + return; + } + + // The post back must have been initiated by a calendar day link. + try + { + // Get the day count from the argument. + int d = int.Parse(eventArgument); + + // Reset the selected dates collection to include only the + // newly selected date. + this.SelectedDates.Clear(); + this.SelectedDates.Add(this.DateFromDayCount(d)); + + // Raise the SelectionChanged event. + OnSelectionChanged(); + } + catch (Exception) + { + } + } +#endregion + + } + } + } diff --git a/Controls/DotNetNuke.Events.ScheduleControl/DNNCalendar.vb b/Controls/DotNetNuke.Events.ScheduleControl/DNNCalendar.vb deleted file mode 100644 index 6129da4..0000000 --- a/Controls/DotNetNuke.Events.ScheduleControl/DNNCalendar.vb +++ /dev/null @@ -1,836 +0,0 @@ -' -'DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - -Imports System -Imports System.Collections -Imports System.ComponentModel -Imports System.Drawing -Imports System.Globalization -Imports System.Text -Imports System.Web -Imports System.Web.UI -Imports System.Web.UI.HtmlControls -Imports System.Web.UI.WebControls - -Namespace MonthControl - - ''' - ''' Enumerator for Days of Week - ''' - _ - Public Enum MyDayOfWeek - ''' - ''' Monday - ''' - Monday = 1 - ''' - ''' Tuesday - ''' - Tuesday = 2 - ''' - ''' Wednesday - ''' - Wednesday = 4 - ''' - ''' Thursday - ''' - Thursday = 8 - ''' - ''' Friday - ''' - Friday = 16 - ''' - ''' Saturday - ''' - Saturday = 32 - ''' - ''' Sunday - ''' - Sunday = 64 - End Enum - - ''' - ''' Fixes Web Calendar Control Style Issues - ''' - ")> _ - Public Class DNNCalendar - Inherits System.Web.UI.WebControls.Calendar - - ' Mapping of built-in DayOfWeek and our custom MyDayOfWeek - Private Function DayOfWeekMapping(ByVal orig As DayOfWeek) As MyDayOfWeek - Dim ret As MyDayOfWeek - Select Case orig - Case DayOfWeek.Monday - ret = MyDayOfWeek.Monday - Exit Select - Case DayOfWeek.Tuesday - ret = MyDayOfWeek.Tuesday - Exit Select - Case DayOfWeek.Wednesday - ret = MyDayOfWeek.Wednesday - Exit Select - Case DayOfWeek.Thursday - ret = MyDayOfWeek.Thursday - Exit Select - Case DayOfWeek.Friday - ret = MyDayOfWeek.Friday - Exit Select - Case DayOfWeek.Saturday - ret = MyDayOfWeek.Saturday - Exit Select - Case DayOfWeek.Sunday - ret = MyDayOfWeek.Sunday - Exit Select - Case Else - ret = MyDayOfWeek.Saturday - Exit Select - End Select - - Return ret - End Function - - ''' - ''' Set WeekEnd days - ''' - _ - Public Property WeekEndDays() As MyDayOfWeek - Get - Dim wed As MyDayOfWeek = MyDayOfWeek.Saturday Or MyDayOfWeek.Sunday - Dim obj As Object = Me.ViewState("wed") - If obj IsNot Nothing Then - wed = DirectCast(obj, MyDayOfWeek) - End If - Return wed - End Get - Set(ByVal value As MyDayOfWeek) - Me.ViewState("wed") = value - End Set - End Property - - ''' - ''' Initializes a new instance of the class. - ''' - ''' - ''' Use this constructor to create and initialize a new instance of - ''' the class. - ''' - Public Sub New() - MyBase.New() - End Sub - -#Region "Private properties" - ' Gets the date that specifies the month to be displayed. This will - ' be VisibleDate unless that property is defaulted to - ' DateTime.MinValue, in which case TodaysDate is returned instead. - Private ReadOnly Property TargetDate() As DateTime - Get - If Me.VisibleDate = DateTime.MinValue Then - Return Me.TodaysDate - Else - Return Me.VisibleDate - End If - End Get - End Property - - ' This is the date used for creating day count values, i.e., the - ' number of days between some date and this one. These values are - ' used to create post back event arguments identical to those used - ' by the base Calendar class. - Private Shared ReadOnly DayCountBaseDate As New DateTime(2000, 1, 1) -#End Region - -#Region "Control rendering" - - ''' - ''' This member overrides . - ''' - Protected Overloads Overrides Sub Render(ByVal output As HtmlTextWriter) - ' Create the main table. - Dim table As New Table() - table.CellPadding = Me.CellPadding - table.CellSpacing = Me.CellSpacing - - If Me.ShowGridLines Then - table.GridLines = GridLines.Both - Else - table.GridLines = GridLines.None - End If - - ' If ShowTitle is true, add a row with the calendar title. - If Me.ShowTitle Then - ' Create a one-cell table row. - Dim row As New TableRow() - Dim cell As New TableCell() - If Me.HasWeekSelectors(Me.SelectionMode) Then - cell.ColumnSpan = 8 - Else - cell.ColumnSpan = 7 - End If - - ' Apply styling. - cell.MergeStyle(Me.TitleStyle) - - ' Add the title table to the cell. - cell.Controls.Add(Me.TitleTable()) - row.Cells.Add(cell) - - ' Add it to the table. - table.Rows.Add(row) - End If - - ' If ShowDayHeader is true, add a row with the days header. - If Me.ShowDayHeader Then - table.Rows.Add(DaysHeaderTableRow()) - End If - - ' Find the first date that will be visible on the calendar. - Dim [date] As DateTime = Me.GetFirstCalendarDate() - - ' Create a list for storing nonselectable dates. - Dim nonselectableDates As New ArrayList() - - ' Add rows for the dates (six rows are always displayed). - For i As Integer = 0 To 5 - Dim row As New TableRow() - - ' Create a week selector, if needed. - If Me.HasWeekSelectors(Me.SelectionMode) Then - Dim cell As New TableCell() - cell.HorizontalAlign = HorizontalAlign.Center - cell.MergeStyle(Me.SelectorStyle) - - If Me.Enabled Then - ' Create the post back link. - Dim anchor As New HtmlAnchor() - Dim arg As String = [String].Format("R{0}07", Me.DayCountFromDate([date])) - anchor.HRef = Me.Page.ClientScript.GetPostBackClientHyperlink(Me, arg) - anchor.Controls.Add(New LiteralControl(Me.SelectWeekText)) - - ' Add a color style to the anchor if it is explicitly - ' set. - If Not Me.SelectorStyle.ForeColor.IsEmpty Then - anchor.Attributes.Add("style", [String].Format("color:{0}", Me.SelectorStyle.ForeColor.Name)) - End If - - cell.Controls.Add(anchor) - Else - cell.Controls.Add(New LiteralControl(Me.SelectWeekText)) - End If - - row.Cells.Add(cell) - End If - - ' Add the days (there are always seven days per row). - For j As Integer = 0 To 6 - ' Create a CalendarDay and a TableCell for the date. - Dim day As CalendarDay = Me.Day([date]) - Dim cell As TableCell = Me.Cell(day) - - ' Raise the OnDayRender event. - Me.OnDayRender(cell, day) - - ' If the day was marked nonselectable, add it to the list. - If Not day.IsSelectable Then - nonselectableDates.Add(day.[Date].ToShortDateString()) - End If - - ' If the day is selectable, and the selection mode allows - ' it, convert the text to a link with post back. - If Me.Enabled AndAlso day.IsSelectable AndAlso Me.SelectionMode <> CalendarSelectionMode.None Then - Try - ' Create the post back link. - Dim anchor As New HtmlAnchor() - Dim arg As String = Me.DayCountFromDate([date]).ToString() - anchor.HRef = Me.Page.ClientScript.GetPostBackClientHyperlink(Me, arg) - - ' Copy the existing text. - anchor.Controls.Add(New LiteralControl(DirectCast(cell.Controls(0), LiteralControl).Text)) - - ' Add a color style to the anchor if it is - ' explicitly set. Note that the style precedence - ' follows that of the base Calendar control. - Dim s As String = "" - If Not Me.DayStyle.ForeColor.IsEmpty Then - s = Me.DayStyle.ForeColor.Name - End If - Dim currdayofweek As MyDayOfWeek = DayOfWeekMapping(day.[Date].DayOfWeek) - If ((Me.WeekEndDays And currdayofweek) = currdayofweek) And (Not Me.WeekendDayStyle.ForeColor.IsEmpty) Then - s = Me.WeekendDayStyle.ForeColor.Name - End If - If day.IsOtherMonth AndAlso Not Me.OtherMonthDayStyle.ForeColor.IsEmpty Then - s = Me.OtherMonthDayStyle.ForeColor.Name - End If - If day.IsToday AndAlso Not Me.TodayDayStyle.ForeColor.IsEmpty Then - s = Me.TodayDayStyle.ForeColor.Name - End If - If Me.SelectedDates.Contains(day.[Date]) AndAlso Not Me.SelectedDayStyle.ForeColor.IsEmpty Then - s = Me.SelectedDayStyle.ForeColor.Name - End If - If s.Length > 0 Then - anchor.Attributes.Add("style", [String].Format("color:{0}", s)) - End If - - ' Replace the literal control in the cell with - ' the anchor. - cell.Controls.RemoveAt(0) - cell.Controls.AddAt(0, anchor) - Catch generatedExceptionName As Exception - End Try - End If - - ' Add the cell to the current table row. - row.Cells.Add(cell) - - ' Bump the date. - [date] = [date].AddDays(1) - Next - - ' Add the row. - table.Rows.Add(row) - Next - - ' Save the list of nonselectable dates. - If nonselectableDates.Count > 0 Then - Me.SaveNonselectableDates(nonselectableDates) - End If - - ' Apply styling. - Me.AddAttributesToRender(output) - - ' Render the table. - table.RenderControl(output) - End Sub - - ' ==================================================================== - ' Helper functions for rendering the control. - ' ==================================================================== - - ' - ' Generates a Table control for the calendar title. - ' - Private Function TitleTable() As Table - ' Create a table row. - Dim row As New TableRow() - Dim cell As TableCell - Dim anchor As HtmlAnchor - Dim [date] As DateTime - Dim text As String - - ' Add a table cell with the previous month. - If Me.ShowNextPrevMonth Then - cell = New TableCell() - cell.MergeStyle(Me.NextPrevStyle) - cell.Style.Add("width", "15%") - - ' Find the first of the previous month, needed for post back - ' processing. - Try - [date] = New DateTime(Me.TargetDate.Year, Me.TargetDate.Month, 1).AddMonths(-1) - Catch generatedExceptionName As Exception - [date] = Me.TargetDate - End Try - - ' Get the previous month text. - If Me.NextPrevFormat = NextPrevFormat.CustomText Then - text = Me.PrevMonthText - Else - If Me.NextPrevFormat = NextPrevFormat.ShortMonth Then - text = [date].ToString("MMM") - Else - text = [date].ToString("MMMM") - End If - End If - - If Me.Enabled Then - ' Create the post back link. - anchor = New HtmlAnchor() - Dim arg As String = [String].Format("V{0}", Me.DayCountFromDate([date])) - anchor.HRef = Me.Page.ClientScript.GetPostBackClientHyperlink(Me, arg) - anchor.Controls.Add(New LiteralControl(text)) - - ' Add a color style to the anchor if it is explicitly - ' set. - If Not Me.NextPrevStyle.ForeColor.IsEmpty Then - anchor.Attributes.Add("style", [String].Format("color:{0}", Me.NextPrevStyle.ForeColor.Name)) - End If - - ' Add the link to the cell. - ' } - cell.Controls.Add(anchor) - Else - cell.Controls.Add(New LiteralControl(text)) - End If - - row.Cells.Add(cell) - End If - - ' Add a table cell for the title text. - cell = New TableCell() - cell.HorizontalAlign = HorizontalAlign.Center - cell.VerticalAlign = VerticalAlign.Middle - If Me.ShowNextPrevMonth Then - cell.Style.Add("width", "70%") - End If - If Me.TitleFormat = TitleFormat.Month Then - cell.Text = Me.TargetDate.ToString("MMMM") - Else - cell.Text = Me.TargetDate.ToString("y").Replace(", ", " ") - End If - row.Cells.Add(cell) - - ' Add a table cell for the next month. - If Me.ShowNextPrevMonth Then - cell = New TableCell() - cell.HorizontalAlign = HorizontalAlign.Right - cell.MergeStyle(Me.NextPrevStyle) - cell.Style.Add("width", "15%") - - ' Find the first of the next month, needed for post back - ' processing. - Try - [date] = New DateTime(Me.TargetDate.Year, Me.TargetDate.Month, 1).AddMonths(1) - Catch generatedExceptionName As Exception - [date] = Me.TargetDate - End Try - - ' Get the next month text. - If Me.NextPrevFormat = NextPrevFormat.CustomText Then - text = Me.NextMonthText - Else - If Me.NextPrevFormat = NextPrevFormat.ShortMonth Then - text = [date].ToString("MMM") - Else - text = [date].ToString("MMMM") - End If - End If - - If Me.Enabled Then - ' Create the post back link. - anchor = New HtmlAnchor() - Dim arg As String = [String].Format("V{0}", Me.DayCountFromDate([date])) - anchor.HRef = Me.Page.ClientScript.GetPostBackClientHyperlink(Me, arg) - anchor.Controls.Add(New LiteralControl(text)) - - ' Add a color style to the anchor if it is explicitly - ' set. - If Not Me.NextPrevStyle.ForeColor.IsEmpty Then - anchor.Attributes.Add("style", [String].Format("color:{0}", Me.NextPrevStyle.ForeColor.Name)) - End If - - ' Add the link to the cell. - ' } - cell.Controls.Add(anchor) - Else - cell.Controls.Add(New LiteralControl(text)) - End If - - row.Cells.Add(cell) - End If - - ' Create the table and add the title row to it. - Dim table As New Table() - table.CellPadding = 0 - table.CellSpacing = 0 - table.Attributes.Add("style", "width:100%;height:100%") - table.Rows.Add(row) - - Return table - End Function - - ' - ' Generates a TableRow control for the calendar days header. - ' - Private Function DaysHeaderTableRow() As TableRow - ' Create the table row. - Dim row As New TableRow() - - ' Create an array of days. - Dim days As DayOfWeek() = {DayOfWeek.Sunday, DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday, _ - DayOfWeek.Saturday} - - ' Adjust the array to get the specified starting day at the first index. - Dim first As DayOfWeek = Me.GetFirstDayOfWeek() - While days(0) <> first - Dim temp As DayOfWeek = days(0) - For i As Integer = 0 To days.Length - 2 - days(i) = days(i + 1) - Next - days(days.Length - 1) = temp - End While - - ' Add a month selector column, if needed. - If Me.HasWeekSelectors(Me.SelectionMode) Then - Dim cell As New TableCell() - cell.HorizontalAlign = HorizontalAlign.Center - - ' If months are selectable, create the selector. - If Me.SelectionMode = CalendarSelectionMode.DayWeekMonth Then - ' Find the first of the month. - Dim [date] As New DateTime(Me.TargetDate.Year, Me.TargetDate.Month, 1) - - ' Use the selector style. - cell.MergeStyle(Me.SelectorStyle) - - ' Create the post back link. - If Me.Enabled Then - Dim anchor As New HtmlAnchor() - Dim arg As String = [String].Format("R{0}{1}", Me.DayCountFromDate([date]), DateTime.DaysInMonth([date].Year, [date].Month)) - anchor.HRef = Me.Page.ClientScript.GetPostBackClientHyperlink(Me, arg) - anchor.Controls.Add(New LiteralControl(Me.SelectMonthText)) - - ' Add a color style to the anchor if it is explicitly - ' set. - If Not Me.SelectorStyle.ForeColor.IsEmpty Then - anchor.Attributes.Add("style", [String].Format("color:{0}", Me.SelectorStyle.ForeColor.Name)) - End If - - cell.Controls.Add(anchor) - Else - cell.Controls.Add(New LiteralControl(Me.SelectMonthText)) - End If - Else - ' Use the day header style. - cell.CssClass = Me.DayHeaderStyle.CssClass - End If - - row.Cells.Add(cell) - End If - - ' Add the day names to the header. - For Each day As System.DayOfWeek In days - row.Cells.Add(Me.DayHeaderTableCell(day)) - Next - - Return row - End Function - - ' - ' Returns a table cell containing a day name for the calendar day - ' header. - ' - Private Function DayHeaderTableCell(ByVal dayOfWeek As System.DayOfWeek) As TableCell - ' Generate the day name text based on the specified format. - Dim s As String - If Me.DayNameFormat = DayNameFormat.[Short] Then - s = CultureInfo.CurrentCulture.DateTimeFormat.AbbreviatedDayNames(CInt(dayOfWeek)) - Else - s = CultureInfo.CurrentCulture.DateTimeFormat.DayNames(CInt(dayOfWeek)) - If Me.DayNameFormat = DayNameFormat.FirstTwoLetters Then - s = s.Substring(0, 2) - End If - If Me.DayNameFormat = DayNameFormat.FirstLetter Then - s = s.Substring(0, 1) - End If - End If - - ' Create the cell, set the style and the text. - Dim cell As New TableCell() - cell.HorizontalAlign = HorizontalAlign.Center - cell.MergeStyle(Me.DayHeaderStyle) - cell.Text = s - - Return cell - End Function - - ' - ' Determines the first day of the week based on the FirstDayOfWeek - ' property setting. - ' - Private Function GetFirstDayOfWeek() As System.DayOfWeek - ' If the default value is specifed, use the system default. - If Me.FirstDayOfWeek = FirstDayOfWeek.[Default] Then - Return CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek - Else - Return DirectCast(Me.FirstDayOfWeek, DayOfWeek) - End If - End Function - - ' - ' Returns the date that should appear in the first day cell of the - ' calendar display. - ' - Private Function GetFirstCalendarDate() As DateTime - ' Start with the first of the month. - Dim [date] As New DateTime(Me.TargetDate.Year, Me.TargetDate.Month, 1) - - ' While that day does not fall on the first day of the week, move back. - Dim firstDay As DayOfWeek = Me.GetFirstDayOfWeek() - While [date].DayOfWeek <> firstDay - [date] = [date].AddDays(-1) - End While - - Return [date] - End Function - - ' - ' Creates a CalendarDay instance for the given date. - ' - ' This object is included in the DayRenderEventArgs passed to - ' the DayRender event handler. - ' - Private Function Day(ByVal [date] As DateTime) As CalendarDay - Dim calday As New CalendarDay([date], [date].DayOfWeek = DayOfWeek.Saturday OrElse [date].DayOfWeek = DayOfWeek.Sunday, [date] = Me.TodaysDate, [date] = Me.SelectedDate, Not ([date].Month = Me.TargetDate.Month AndAlso [date].Year = Me.TargetDate.Year), [date].Day.ToString()) - - ' Default the day to selectable. - calday.IsSelectable = True - - Return calday - End Function - - ' - ' Creates a TableCell control for the given calendar day. - ' - ' Note: This object is included in the DayRenderEventArgs passed to - ' the DayRender event handler. - ' - Private Function Cell(ByVal day As CalendarDay) As TableCell - Dim tbcell As New TableCell() - tbcell.HorizontalAlign = HorizontalAlign.Center - - ' Add styling based on day flags. - ' - Styles are applied per the precedence order used by the - ' base Calendar control. - ' - For CssClass, multiple class names may be added. - Dim sb As New StringBuilder() - Dim currdayofweek As MyDayOfWeek = DayOfWeekMapping(day.[Date].DayOfWeek) - If ((Me.WeekEndDays And currdayofweek) = currdayofweek) And (Not day.IsOtherMonth) And (Not (Me.WeekendDayStyle Is Nothing)) Then - tbcell.MergeStyle(Me.WeekendDayStyle) - sb.AppendFormat(" {0}", Me.WeekendDayStyle.CssClass) - End If - If day.IsOtherMonth Then - If day.IsWeekend Then - tbcell.ApplyStyle(Me.OtherMonthDayStyle) - sb = New StringBuilder() - sb.AppendFormat(" {0}", Me.OtherMonthDayStyle.CssClass) - Else - tbcell.MergeStyle(Me.OtherMonthDayStyle) - sb.AppendFormat(" {0}", Me.OtherMonthDayStyle.CssClass) - End If - End If - - If Me.SelectedDates.Contains(day.[Date]) Then - tbcell.MergeStyle(Me.SelectedDayStyle) - sb.AppendFormat(" {0}", Me.SelectedDayStyle.CssClass) - End If - If day.IsToday Then - tbcell.MergeStyle(Me.TodayDayStyle) - sb.AppendFormat(" {0}", Me.TodayDayStyle.CssClass) - End If - - tbcell.MergeStyle(Me.DayStyle) - sb.AppendFormat(" {0}", Me.DayStyle.CssClass) - - Dim s As String = sb.ToString().Trim() - If s.Length > 0 Then - tbcell.CssClass = s - End If - - ' Add a literal control to the cell using the day number for the - ' text. - tbcell.Controls.Add(New LiteralControl(day.DayNumberText)) - - Return tbcell - End Function - - ' - ' Returns true if the selection mode includes week selectors. - ' - Private Shadows Function HasWeekSelectors(ByVal selectionMode As CalendarSelectionMode) As Boolean - If selectionMode = CalendarSelectionMode.DayWeek OrElse selectionMode = CalendarSelectionMode.DayWeekMonth Then - Return True - Else - Return False - End If - End Function -#End Region - -#Region "Post back event handling" - ' ==================================================================== - ' Functions for converting between DateTime and day count values. - ' ==================================================================== - - ' - ' Returns the number of days between the given DateTime value and the - ' base date. - ' - Private Function DayCountFromDate(ByVal [date] As DateTime) As Integer - Return ([date] - DNNCalendar.DayCountBaseDate).Days - End Function - - ' - ' Returns a DateTime value equal to the base date plus the given number - ' of days. - ' - Private Function DateFromDayCount(ByVal dayCount As Integer) As DateTime - Return DNNCalendar.DayCountBaseDate.AddDays(dayCount) - End Function - - ' ==================================================================== - ' Functions to save and load the nonselectable dates list. - ' - ' A hidden form field is used to store this data rather than the - ' view state because the nonselectable dates are not known until after - ' the DayRender event has been raised for each day as the control is - ' rendered. - ' - ' To minimize the amount of data stored in that field, the dates are - ' represented as day count values. - ' ==================================================================== - - ' - ' Saves a list of dates to the hidden form field. - ' - Private Sub SaveNonselectableDates(ByVal dates As ArrayList) - ' Build a string array by converting each date to a day count - ' value. - Dim list As String() = New String(dates.Count - 1) {} - For i As Integer = 0 To list.Length - 1 - list(i) = Me.DayCountFromDate(DateTime.Parse(dates(i).ToString())).ToString() - Next - - ' Get the hidden field name. - Dim fieldName As String = Me.GetHiddenFieldName() - - ' For the field value, create a comma-separated list from the day - ' count values. - Dim fieldValue As String = HttpUtility.HtmlAttributeEncode([String].Join(",", list)) - - ' Add the hidden form field to the page. - 'EVT-9313 this.Page.RegisterHiddenField(fieldName, fieldValue); - Me.Page.ClientScript.RegisterHiddenField(fieldName, fieldValue) - End Sub - - ' - ' Returns a list of dates stored in the hidden form field. - ' - Private Function LoadNonselectableDates() As ArrayList - ' Create an empty list. - Dim dates As New ArrayList() - - ' Get the value stored in the hidden form field. - Dim fieldName As String = Me.GetHiddenFieldName() - Dim fieldValue As String = Me.Page.Request.Form(fieldName) - - ' If no dates were stored, return the empty list. - If fieldValue Is Nothing Then - Return dates - End If - - ' Extract the individual day count values. - Dim list As String() = fieldValue.Split(","c) - - ' Convert those values to dates and store them in an array list. - For Each s As String In list - dates.Add(Me.DateFromDayCount(Int32.Parse(s))) - Next - - Return dates - End Function - - ' - ' Returns the name of the hidden field used to store nonselectable - ' dates on the form. - ' - Private Function GetHiddenFieldName() As String - ' Create a unique field name. - Return [String].Format("{0}_NonselectableDates", Me.ClientID) - End Function - - ' ==================================================================== - ' Implementation of the IPostBackEventHandler.RaisePostBackEvent - ' event handler. - ' ==================================================================== - - ''' - ''' Handles a post back event targeted at the control. - ''' - ''' - ''' A representing the event argument passed to the handler. - ''' - Public Shadows Sub RaisePostBackEvent(ByVal eventArgument As String) - ' Was the post back initiated by a previous or next month link? - If eventArgument.StartsWith("V") Then - Try - ' Save the current visible date. - Dim previousDate As DateTime = Me.TargetDate - - ' Extract the day count from the argument and use it to - ' change the visible date. - Dim d As Integer = Int32.Parse(eventArgument.Substring(1)) - Me.VisibleDate = Me.DateFromDayCount(d) - - ' Raise the VisibleMonthChanged event. - OnVisibleMonthChanged(Me.VisibleDate, previousDate) - Catch generatedExceptionName As Exception - End Try - Exit Sub - End If - - ' Was the post back initiated by a month or week selector link? - If eventArgument.StartsWith("R") Then - Try - ' Extract the day count and number of days from the - ' argument. - Dim d As Integer = Int32.Parse(eventArgument.Substring(1, eventArgument.Length - 3)) - Dim n As Integer = Int32.Parse(eventArgument.Substring(eventArgument.Length - 2)) - - ' Get the starting date. - Dim [date] As DateTime = Me.DateFromDayCount(d) - - ' Reset the selected dates collection to include all the - ' dates in the given range. - Me.SelectedDates.Clear() - Me.SelectedDates.SelectRange([date], [date].AddDays(n - 1)) - - ' // If SelectAllInRange is false, remove any dates found - ' // in the nonselectable date list. - ' if (!this.SelectAllInRange) - ' { - ' ArrayList nonselectableDates = this.LoadNonselectableDates(); - ' foreach(DateTime badDate in nonselectableDates) - ' this.SelectedDates.Remove(badDate); - ' } - - ' Raise the SelectionChanged event. - OnSelectionChanged() - Catch generatedExceptionName As Exception - End Try - Exit Sub - End If - - ' The post back must have been initiated by a calendar day link. - Try - ' Get the day count from the argument. - Dim d As Integer = Int32.Parse(eventArgument) - - ' Reset the selected dates collection to include only the - ' newly selected date. - Me.SelectedDates.Clear() - Me.SelectedDates.Add(Me.DateFromDayCount(d)) - - ' Raise the SelectionChanged event. - OnSelectionChanged() - Catch generatedExceptionName As Exception - End Try - End Sub -#End Region - - End Class -End Namespace \ No newline at end of file diff --git a/Controls/DotNetNuke.Events.ScheduleControl/DotNetNuke.Events.ScheduleControl.vbproj b/Controls/DotNetNuke.Events.ScheduleControl/DotNetNuke.Events.ScheduleControl.csproj similarity index 82% rename from Controls/DotNetNuke.Events.ScheduleControl/DotNetNuke.Events.ScheduleControl.vbproj rename to Controls/DotNetNuke.Events.ScheduleControl/DotNetNuke.Events.ScheduleControl.csproj index 8cea1c7..bb58443 100644 --- a/Controls/DotNetNuke.Events.ScheduleControl/DotNetNuke.Events.ScheduleControl.vbproj +++ b/Controls/DotNetNuke.Events.ScheduleControl/DotNetNuke.Events.ScheduleControl.csproj @@ -1,4 +1,4 @@ - + Local @@ -55,8 +55,8 @@ - Bin\ - DotNetNuke.Modules.Events.ScheduleControl.xml + bin\ + bin\DotNetNuke.Modules.Events.ScheduleControl.xml 285212672 @@ -70,14 +70,14 @@ false false 1 - 42016,42017,42018,42019,42032,42353,42354,42355 +1591,660,661 full AllRules.ruleset false - Bin\ - DotNetNuke.Modules.Events.ScheduleControl.xml + bin\ + bin\DotNetNuke.Modules.Events.ScheduleControl.xml 285212672 @@ -91,12 +91,15 @@ false false 1 - 42016,42017,42018,42019,42032,42353,42354,42355 +1591,660,661 None AllRules.ruleset false + + + System @@ -126,49 +129,42 @@ - - - - - - - - + Code - + Form - + Code - + Code - - - + + + Code - + Code - + Code - + Code - + Code - + Code - calendarpropertybuilder.vb + calendarpropertybuilder.cs Designer @@ -207,11 +203,11 @@ false - + - \ No newline at end of file + diff --git a/Controls/DotNetNuke.Events.ScheduleControl/DotNetNuke.Modules.Events.ScheduleControl.xml b/Controls/DotNetNuke.Events.ScheduleControl/DotNetNuke.Modules.Events.ScheduleControl.xml new file mode 100644 index 0000000..a353b31 --- /dev/null +++ b/Controls/DotNetNuke.Events.ScheduleControl/DotNetNuke.Modules.Events.ScheduleControl.xml @@ -0,0 +1,1168 @@ + + + + DotNetNuke.Modules.Events.ScheduleControl + + + + ----------------------------------------------------------------------------- + + Standard item in a schedule + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Alternating standard item in a schedule + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Item in the range header column or row. In the derived ScheduleCalendar, + this is an item in the time header. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Item in the title header column or row. In the derived ScheduleCalendar, + this is an item in the date header. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Item in the optional date header column or row. + Only used in the derived ScheduleGeneral control. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + In Horizontal layout, the range values (times in ScheduleCalendar) are shown horizontally + in the first row, and the titles (dates in ScheduleCalendar) are shown vertically in the first column. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + In Vertical layout, the range values (times in ScheduleCalendar) are shown vertically + in the first column, and the titles (dates in ScheduleCalendar) are shown horizontally in the first row. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + Project : schedule + Class : BaseSchedule + + ----------------------------------------------------------------------------- + + BaseSchedule is the base class for the ScheduleGeneral and ScheduleCalendar controls + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + list with values to be shown in row header + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Items is a collection object that contains the ScheduleItem objects + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Whether to show the EmptyDataTemplate or not when no data is found + + + Overridden in ScheduleCalendar when FullTimeScale=True + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + If IncludeEndValue is true, the event is shown including the end row or column + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + If ShowValueMarks is true, value marks will be shown in the range header column or row. + Applied only when IncludeEndValue is false. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The data source that is used to show items in the schedule + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The table or view used for binding when a DataSet is used as a data source. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The database field containing the start of the items. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The database field containing the end of the items. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The database field providing the titles. + In Calendar mode this field should be of type Date when TimeFieldsContainDate=false. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + An optional database field providing the item styles (in the form of a css class name). + If not provided, then the ItemStyle property will be used for all items. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Boolean value indicating if a full time scale should be shown. + If true, show a full time scale. + If false, show only the occurring values in the data source. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The number of minutes between each mark on the time scale. Only used when FullTimeScale is true. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The start of the time scale. Only used when FullTimeScale is true. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The end of the time scale. Only used when FullTimeScale is true. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The cell padding of the rendered table. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The cell spacing of the rendered table. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The grid lines to be shown in the rendered table. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The horizontal alignment of text in the table. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + When true, clicking on an empty slot in the control will raize the OnEmptySlotClick event. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + ToolTip on empty slots. Only shown when EmptySlotClickEnabled is true. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The style applied to schedule items. + + + + ----------------------------------------------------------------------------- + + The style applied to alternating schedule items. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The style applied to range header items. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The style applied to title items. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The style applied to the background cells. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Main template providing content for each regular item in the body of the schedule. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Optional template providing content to be shown when the data source is empty. + This template is not used by the ScheduleCalendar control when FullTimeScale=True. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Raised when EnableEmptySlotClick is true and the user clicks on an empty slot. + + Event argument with information about the cell that was clicked + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Raised when a CommandEvent occurs within an item. + + + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Raised when an item is created and is ready for customization. + + + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Raised when an item is data-bound. + + + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Occurs when the user clicks on an empty slot. + + + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Checks if the application is running on the proper version of ASP.NET. + If not, an exception is thrown. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Overrides Control.Databind. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Overrides Control.OnDatabinding. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Check if all properties are set to make the control work + Override this function in derived versions. + + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Create the list with all range header values (Start or End) + + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Remove any doubles from the ArrayList and + + The ArrayList object + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Pre-process the data in the dataview + Currently only used in ScheduleCalendar to split the items that span midnight + + The DataView object containing the data + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Create the list with all the title values + + The DataView object containing the data + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Get the number of times the control should repeat the schedule + (every time with new headers) + + An integer value indicating the repetition count + + Overridden in ScheduleCalendar to return NumberOfRepetitions (usually number of weeks) + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Create a Table control with the right number of rows and columns. + The actual content is added later. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Add date headers to the table when SeparateDateHeader=True + Overridden only in ScheduleGeneral to add date header data + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Iterate the arrRangeValues array, creating a new header item for each data item + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Add the actual items from the data source to the body of the table + + The data view that contains the data items + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Add range value marks to indicate the range values + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Calculate the range cell index in the table, given the objRangeValue and the objTitleValue + The values refer to the real cell index in the table, taking into account whether cells are + spanning over value marks (in horizontal mode) + In vertical layout, the result is the real row index in the table + In horizontal layout, the result is the real cell index in the row (before any merging + of cells due to value spanning) + + The range value from the data source + The title value from the data source + False if we're calculating the range value index for the + start of the item, True if it's the end + The range cell index + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Calculate the TitleIndex in the table, given the objTitleValue + + The title value from the data source + The title index + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Merge cells starting at startCellIndex + + Index of the first cell to merge. + Row or column containing the adjacent cells. + Number of columns or rows that the newly merged cell should span. + The newly merged cell if successful. Nothing when merging fails. + + In horizontal layout, merging may start at 0 + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Removes all the cells from startValueIndex to endValueIndex, except the first cell + + Index of the first cell to remove. + Index of the last cell to remove. + Row or column containing the adjacent cells. + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Removes the cell at cellValueIndex + + Cell value index of the cell to be removed. + Title index of the cell to be removed. + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + in vertical layout, get the column span. In horizontal layout, get the row span + + Value index of the cell + Title index of the cell + Integer value indicating the span width + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Check if the cells at titleIndex are already spanning over multiple rows or columns + for the given range. The span must be the same over that range. + + Title index of the range + + + True or false + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Split a column or row in 2 in order to allow the display of overlapping items. + + Title index of the cells to be split + Index of the first cell in the range to split + Index of the last cell in the range to split + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Get the DataView from the DataSource and DataMember properties + + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Instantiate item using the corresponding template (if any) + + ScheduleItem to instantiate + corresponding table cell + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + when there's no template, try to present the data in a reasonable format + + Value of the item + Type of the item + A formatted string + ----------------------------------------------------------------------------- + + + + Create the item + + Cell value index of the item + Title index of the item + Type of the item + Whether databinding should be performed + Data item of the item + Index of the item in the dataset + The newly created ScheduleItem + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + In vertical layout, get the row span. In horizontal layout, get the column span + + Cell value index of the item + Title index of the item + The integer value of the span + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + in vertical layout, set the row span. In horizontal layout, set the column span + + Cell value index of the item + Title index of the item + The new span value + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Get the cell at the given indexes. + + Cell value index of the item + Title index of the item + The TableCell object of the corresponding cell + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Show the EmptyDataTemplate when the data source is empty + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Handle events raised by children by overriding OnBubbleEvent. + + the source of the event + event data + true if the event has been handled + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + RaisePostBackEvent is called when the user clicks on an empty slot + (see clickabletablecell.vb) + + String with the event argument. + Contains something like "3-7", where 3 is the row and 7 the column + ----------------------------------------------------------------------------- + + + ' ----------------------------------------------------------------------------- + ' + ' Calculate the title value given the cell index + ' + ' Title index of the cell + ' Object containing the title + ' ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Calculate the range value index given the cell index + + Row of the cell + Column of the cell + Integer containing the range value index + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Calculate the number of rows per repetition + + Integer containing the number of rows + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Save information for use in round trips (enough to re-create the control tree). + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Recreate the control tree from viewstate + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Customized state management to handle saving state of contained objects. + + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Customize state management to handle saving state of contained objects such as styles. + + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Customize state management to handle saving state of contained objects such as styles. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + Project : schedule + Class : CalendarPropertyBuilder + + ----------------------------------------------------------------------------- + + CalendarPropertyBuilder provides an easy interface to set all the properties + for the ScheduleCalendar control. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + Project : schedule + Class : ClickableTableCell + + ----------------------------------------------------------------------------- + + The ClickableTableCell class is used for causing postback when the user + clicks on empty slots + + + + ----------------------------------------------------------------------------- + Project : schedule + Class : ClickableTableCellEventArgs + + ----------------------------------------------------------------------------- + + The ClickableTableCellEventArgs class is used when the user clicks on an empty slot + + + + + Enumerator for Days of Week + + + + + Monday + + + + + Tuesday + + + + + Wednesday + + + + + Thursday + + + + + Friday + + + + + Saturday + + + + + Sunday + + + + + Fixes Web Calendar Control Style Issues + + + + + Set WeekEnd days + + + + + Initializes a new instance of the class. + + + Use this constructor to create and initialize a new instance of + the class. + + + + + This member overrides . + + + + + Handles a post back event targeted at the control. + + + A representing the event argument passed to the handler. + + + + ----------------------------------------------------------------------------- + Project : schedule + Class : ScheduleCalendar + + ----------------------------------------------------------------------------- + + The ScheduleCalendar web control is designed to represent a schedule in a calendar format. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Whether to show the EmptyDataTemplate or not when no data is found + + + Overrides default value (True) + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The database field containing the start time of the events. This field should also contain the date when TimeFieldsContainDate=true + + + StartTimeField replaces DataRangeStartField for ScheduleCalendar + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The database field containing the end time of the events. This field should also contain the date when TimeFieldsContainDate=true + + + EndTimeField replaces DataRangeEndField for ScheduleCalendar + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The database field providing the dates. Ignored when TimeFieldsContainDate=true. When TimeFieldsContainDate=false, this field should be of type Date + + + DateField replaces TitleField for ScheduleCalendar + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The first date to display. + The calendar will start on this date, if not overridden by the + StartDay and NumberOfDays settings. + The default value is the date at the time of display. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The first day of the week to display. + The calendar will start on this day of the week. + This value is used only when NumberOfDays equals 7. + The default is Monday. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The number of days to display. + This number may be repeated multiple times in Vertical layout when the NumberOfRepetitions + property is greater than 1. + De default value is 7 (weekly calendar). + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The number of repetitions to show at a time. Only used in Vertical layout. + Especially useful if you want to show several weeks in the calendar, one + below the other. + This property replaces the Weeks property starting from version 1.6.1. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Obsolete since version 1.6.1. Use the NumberOfRepetitions property instead. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The format used for the date if the DateTemplate is missing, e.g. {0:ddd d} + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The format used for the time if the TimeTemplate is missing, e.g. {0:hh:mm} + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Indicates whether the time fields (StartTimeField and EndTimeField) contain the date as well. Whe true, this allows midnight spanning for calendar events. When false, the DateField contains the date. + + + TimeFieldsContainDate replaces UseTitleFieldAsDate for ScheduleCalendar + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The style applied to time header items. + + + TimeStyle replaces RangeHeaderStyle for ScheduleCalendar + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The style applied to date header items. + + + DateStyle replaces TitleStyle for ScheduleCalendar + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + create the list with all times (Start or End) + + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + When TimeFieldsContainDate=True, items could span over midnight, even several days. + Split them. + + + Used to be called "SplitItemsThatSpanMidnight" + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + calculate the TitleIndex in the table, given the objTitleValue + + + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Calculate the range cell index in the table, given the objRangeValue and the objTitleValue + The values refer to the real cell index in the table, taking into account whether cells are + spanning over value marks (in horizontal mode) + In vertical layout, the result is the real row index in the table + In horizontal layout, the result is the real cell index in the row (before any merging + of cells due to value spanning) + + The range value from the data source + The title value from the data source + False if we're calculating the range value index for the start of the item, True if it's the end + The range cell index + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + when there's no template, try to present the data in a reasonable format + + Value of the item + Type of the item + A formatted string + ----------------------------------------------------------------------------- + + + ' ----------------------------------------------------------------------------- + ' + ' Calculate the title value given the cell index + ' + ' Title index of the cell + ' Object containing the title + ' ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + Project : schedule + Class : ScheduleItemEventArgs + + ----------------------------------------------------------------------------- + + The ScheduleItemEventArgs class can be used with the OnItemCommand event of the Schedule controls + + + + ----------------------------------------------------------------------------- + Project : schedule + Class : ScheduleGeneral + + ----------------------------------------------------------------------------- + + The ScheduleGeneral web control is designed to represent a schedule in a general format. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + list with values to be shown in title header + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + When true, a separate header will be added for the date. + This requires DataRangeStartField and DataRangeEndField to be of type DateTime. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The format used for the title if the TitleTemplate is missing, e.g. {0:ddd d} + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The format used for the ranges if the RangeHeaderTemplate is missing, e.g. {0:hh:mm} + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The format used for the date header if SeparateDateHeader=True and the DateHeaderTemplate is missing, e.g. {0:dd/MM} + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + When true, titles will automatically be sorted alphabetically. + When false, you may provide your own sorting order for the titles, but make sure + that the items with the same titles are grouped together, and that for each title, + the items are sorted on DataRangeStartField first and on DataRangeEndField next. + (for example: if you want to sort on a field called "SortOrder", the + DataRangeStartField is "StartTime", and the DataRangeEndField is "EndTime", + use the sorting expression "ORDER BY SortOrder ASC, StartTime ASC, EndTime ASC") + The default value for AutoSortTitles is true. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + create the list with all range header values (Start or End) + + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + create the list with all titles + + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Add date headers to the table when SeparateDateHeader=True + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + calculate the TitleIndex in the table, given the objTitleValue + + + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + Calculate the range cell index in the table, given the objRangeValue and the objTitleValue + The values refer to the real cell index in the table, taking into account whether cells are + spanning over value marks (in horizontal mode) + In vertical layout, the result is the real row index in the table + In horizontal layout, the result is the real cell index in the row (before any merging + of cells due to value spanning) + + The range value from the data source + The title value from the data source + False if we're calculating the range value index for the start of the item, True if it's the end + The range cell index + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + when there's no template, try to present the data in a reasonable format + + Value of the item + Type of the item + A formatted string + ----------------------------------------------------------------------------- + + + ' ----------------------------------------------------------------------------- + ' + ' Calculate the title (data source value) given the cell index + ' + ' Title index of the cell + ' Object containing the title + ' ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + Project : schedule + Class : ScheduleItem + + ----------------------------------------------------------------------------- + + The ScheduleItem class represents an item in the Schedule control. + It can either be an item in the schedule itself, or a header item. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + Project : schedule + Class : ScheduleItemCollection + + ----------------------------------------------------------------------------- + + The ScheduleItemCollection class represents a collection of ScheduleItem objects. + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + Project : schedule + Class : ScheduleItemEventArgs + + ----------------------------------------------------------------------------- + + The ScheduleItemEventArgs class can be used with the OnItemCreated and + OnItemDataBound events of the Schedule controls + + + + diff --git a/Controls/DotNetNuke.Events.ScheduleControl/My Project/AssemblyInfo.vb b/Controls/DotNetNuke.Events.ScheduleControl/My Project/AssemblyInfo.vb deleted file mode 100644 index 6bbfb25..0000000 --- a/Controls/DotNetNuke.Events.ScheduleControl/My Project/AssemblyInfo.vb +++ /dev/null @@ -1,35 +0,0 @@ -Imports System -Imports System.Reflection -Imports System.Runtime.InteropServices - -' General Information about an assembly is controlled through the following -' set of attributes. Change these attribute values to modify the information -' associated with an assembly. - -' Review the values of the assembly attributes - - - - - - - - - - - -'The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: - - - diff --git a/Controls/DotNetNuke.Events.ScheduleControl/Properties/AssemblyInfo.cs b/Controls/DotNetNuke.Events.ScheduleControl/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..175597d --- /dev/null +++ b/Controls/DotNetNuke.Events.ScheduleControl/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System; +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. + +// Review the values of the assembly attributes +[assembly: CLSCompliant(true)] + +[assembly: AssemblyTitle("DotNetNuke.Modules.Events")] +[assembly: AssemblyDescription("Open Source Web Application Framework")] +[assembly: AssemblyCompany("DNNCorp")] +[assembly: AssemblyProduct("http://www.dnnsoftware.com")] +[assembly: AssemblyCopyright("DotNetNuke® is copyright 2002-2015 by DNNCorp. All Rights Reserved.")] +[assembly: AssemblyTrademark("DotNetNuke")] + +[assembly: ComVisible(false)] + +//The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3e538b3d-a9ae-417a-8b00-b7e3865b8235")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("7.0.0.0")] +[assembly: AssemblyFileVersion("7.0.0.0")] + diff --git a/Controls/DotNetNuke.Events.ScheduleControl/baseschedule.cs b/Controls/DotNetNuke.Events.ScheduleControl/baseschedule.cs new file mode 100644 index 0000000..9d66054 --- /dev/null +++ b/Controls/DotNetNuke.Events.ScheduleControl/baseschedule.cs @@ -0,0 +1,2873 @@ +using System; +using System.Data; +using Microsoft.VisualBasic; +using System.Collections; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.ComponentModel; + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events.ScheduleControl +{ + + [CLSCompliant(true)]public enum ScheduleItemType : int + { + /// ----------------------------------------------------------------------------- + /// + /// Standard item in a schedule + /// + /// ----------------------------------------------------------------------------- + Item = 0, + /// ----------------------------------------------------------------------------- + /// + /// Alternating standard item in a schedule + /// + /// ----------------------------------------------------------------------------- + AlternatingItem, + /// ----------------------------------------------------------------------------- + /// + /// Item in the range header column or row. In the derived ScheduleCalendar, + /// this is an item in the time header. + /// + /// ----------------------------------------------------------------------------- + RangeHeader, + /// ----------------------------------------------------------------------------- + /// + /// Item in the title header column or row. In the derived ScheduleCalendar, + /// this is an item in the date header. + /// + /// ----------------------------------------------------------------------------- + TitleHeader, + /// ----------------------------------------------------------------------------- + /// + /// Item in the optional date header column or row. + /// Only used in the derived ScheduleGeneral control. + /// + /// ----------------------------------------------------------------------------- + DateHeader + } + + public enum LayoutEnum + { + /// ----------------------------------------------------------------------------- + /// + /// In Horizontal layout, the range values (times in ScheduleCalendar) are shown horizontally + /// in the first row, and the titles (dates in ScheduleCalendar) are shown vertically in the first column. + /// + /// ----------------------------------------------------------------------------- + Horizontal = 0, + /// ----------------------------------------------------------------------------- + /// + /// In Vertical layout, the range values (times in ScheduleCalendar) are shown vertically + /// in the first column, and the titles (dates in ScheduleCalendar) are shown horizontally in the first row. + /// + /// ----------------------------------------------------------------------------- + Vertical + } + + /// ----------------------------------------------------------------------------- + /// Project : schedule + /// Class : BaseSchedule + /// + /// ----------------------------------------------------------------------------- + /// + /// BaseSchedule is the base class for the ScheduleGeneral and ScheduleCalendar controls + /// + /// ----------------------------------------------------------------------------- + + [ParseChildren(true)]public abstract class BaseSchedule : WebControl, INamingContainer, IPostBackEventHandler + { + + +#region Private and protected properties + + private object _dataSource; + + private ScheduleItemCollection _items; + private ArrayList _itemsArrayList; + + protected Table Table1; + + private TableItemStyle _itemStyle; + private TableItemStyle _alternatingItemStyle; + private TableItemStyle _RangeHeaderStyle; + private TableItemStyle _TitleStyle; + private TableItemStyle _BackgroundStyle; + + private string _emptySlotToolTip = "Click here to add data"; + + /// ----------------------------------------------------------------------------- + /// + /// list with values to be shown in row header + /// + /// ----------------------------------------------------------------------------- + protected ArrayList arrRangeValues + { + get + { + return ((ArrayList) (ViewState["arrRangeValues"])); + } + set + { + ViewState["arrRangeValues"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// Items is a collection object that contains the ScheduleItem objects + /// + /// ----------------------------------------------------------------------------- + protected virtual ScheduleItemCollection Items + { + get + { + if (ReferenceEquals(_items, null)) + { + if (ReferenceEquals(_itemsArrayList, null)) + { + EnsureChildControls(); + } + _items = new ScheduleItemCollection(_itemsArrayList); + } + return _items; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// Whether to show the EmptyDataTemplate or not when no data is found + /// + /// + /// Overridden in ScheduleCalendar when FullTimeScale=True + /// + /// ----------------------------------------------------------------------------- + protected virtual bool ShowEmptyDataTemplate + { + get + { + return true; // Overridden in ScheduleCalendar + } + } + +#endregion + +#region Public properties + [Description("The direction in which the item ranges are shown."), + DefaultValue(LayoutEnum.Vertical), Bindable(false), Category("Appearance")]public LayoutEnum Layout + { + get + { + object o = ViewState["Layout"]; + if (!(ReferenceEquals(o, null))) + { + return ((LayoutEnum) o); + } + return LayoutEnum.Vertical; + } + set + { + ViewState["Layout"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// If IncludeEndValue is true, the event is shown including the end row or column + /// + /// ----------------------------------------------------------------------------- + [Description("If true, the event is shown including the end row or column"), + DefaultValue(false), Bindable(false), Category("Behavior")]public bool IncludeEndValue + { + get + { + object o = ViewState["IncludeEndValue"]; + if (!(ReferenceEquals(o, null))) + { + return System.Convert.ToBoolean(o); + } + return false; + } + set + { + ViewState["IncludeEndValue"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// If ShowValueMarks is true, value marks will be shown in the range header column or row. + /// Applied only when IncludeEndValue is false. + /// + /// ----------------------------------------------------------------------------- + [Description("If true, value marks will be shown in the range header column or row. Applied only when IncludeEndValue is false."), + DefaultValue(false), Bindable(false), Category("Behavior")]public bool ShowValueMarks + { + get + { + object o = ViewState["ShowValueMarks"]; + if (!(ReferenceEquals(o, null))) + { + return System.Convert.ToBoolean(o); + } + return false; + } + set + { + ViewState["ShowValueMarks"] = value; + } + } + + + + /// ----------------------------------------------------------------------------- + /// + /// The data source that is used to show items in the schedule + /// + /// ----------------------------------------------------------------------------- + [Description("The data source that is used to show items in the schedule"), + Bindable(true), DefaultValue(null, ""), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), + Category("Data")]public dynamic DataSource + { + get + { + return _dataSource; + } + set + { + if ((ReferenceEquals(value, null)) || (value is DataTable) || (value is DataSet) || (value is DataView)) + { + _dataSource = value; + } + else + { + throw (new HttpException("The DataSource must be a DataTable, DataSet or DataView object")); + } + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The table or view used for binding when a DataSet is used as a data source. + /// + /// ----------------------------------------------------------------------------- + [Description("The table or view used for binding when a DataSet is used as a data source."), + DefaultValue(""), Category("Data")]public string DataMember + { + get + { + object o = ViewState["DataMember"]; + if (!(ReferenceEquals(o, null))) + { + return Convert.ToString(o); + } + return string.Empty; + } + set + { + ViewState["DataMember"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The database field containing the start of the items. + /// + /// ----------------------------------------------------------------------------- + [Description("The database field containing the start of the items."), + Bindable(false), Category("Data")]public string DataRangeStartField + { + get + { + object o = ViewState["DataRangeStartField"]; + if (!(ReferenceEquals(o, null))) + { + return Convert.ToString(o); + } + return ""; + } + set + { + ViewState["DataRangeStartField"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The database field containing the end of the items. + /// + /// ----------------------------------------------------------------------------- + [Description("The database field containing the end of the items."), Bindable(false), Category("Data")]public string DataRangeEndField + { + get + { + object o = ViewState["DataRangeEndField"]; + if (!(ReferenceEquals(o, null))) + { + return Convert.ToString(o); + } + return ""; + } + set + { + ViewState["DataRangeEndField"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The database field providing the titles. + /// In Calendar mode this field should be of type Date when TimeFieldsContainDate=false. + /// + /// ----------------------------------------------------------------------------- + [Description("The database field providing the titles. In Calendar mode this field should be of type Date when TimeFieldsContainDate=false."), Bindable(false), Category("Data")]public string TitleField + { + get + { + object o = ViewState["TitleField"]; + if (!(ReferenceEquals(o, null))) + { + return Convert.ToString(o); + } + return ""; + } + set + { + ViewState["TitleField"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// An optional database field providing the item styles (in the form of a css class name). + /// If not provided, then the ItemStyle property will be used for all items. + /// + /// ----------------------------------------------------------------------------- + [Description("Optional database field providing the item styles. If not provided, then the ItemStyle property will be used for all items."), Bindable(false), Category("Data")]public string ItemStyleField + { + get + { + object o = ViewState["ItemStyleField"]; + if (!(ReferenceEquals(o, null))) + { + return Convert.ToString(o); + } + return ""; + } + set + { + ViewState["ItemStyleField"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// Boolean value indicating if a full time scale should be shown. + /// If true, show a full time scale. + /// If false, show only the occurring values in the data source. + /// + /// ----------------------------------------------------------------------------- + [Description("If true, show a full time scale. If false, show only the occurring values in the data source."), DefaultValue(false), Bindable(true), Category("Behavior")]public bool FullTimeScale + { + get + { + object o = ViewState["FullTimeScale"]; + if (!(ReferenceEquals(o, null))) + { + return System.Convert.ToBoolean(o); + } + return false; + } + set + { + ViewState["FullTimeScale"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The number of minutes between each mark on the time scale. Only used when FullTimeScale is true. + /// + /// ----------------------------------------------------------------------------- + [Description("The number of minutes between each mark on the time scale. Only used when FullTimeScale is true."), DefaultValue(60), Bindable(true), Category("Behavior")]public int TimeScaleInterval + { + get + { + object o = ViewState["TimeScaleInterval"]; + if (!(ReferenceEquals(o, null))) + { + return System.Convert.ToInt32(o); + } + return 60; + } + set + { + if (value == 0) + { + throw (new HttpException("TimeScaleInterval can not be 0")); + } + ViewState["TimeScaleInterval"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The start of the time scale. Only used when FullTimeScale is true. + /// + /// ----------------------------------------------------------------------------- + [Description("The start of the time scale. Only used when FullTimeScale is true."), DefaultValue("8:00:00"), Bindable(true), Category("Behavior")]public TimeSpan StartOfTimeScale + { + get + { + object o = ViewState["StartOfTimeScale"]; + if (!(ReferenceEquals(o, null))) + { + return ((TimeSpan) o); + } + if (FullTimeScale) + { + return new TimeSpan(0, 0, 0); // = 0:00 + } + return new TimeSpan(8, 0, 0); // = 8:00 AM + } + set + { + if (value.Days == 0) + { + ViewState["StartOfTimeScale"] = value; + } + else + { + throw (new HttpException("StartOfTimeScale should be between 0:00:00 and 23:59:00")); + } + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The end of the time scale. Only used when FullTimeScale is true. + /// + /// ----------------------------------------------------------------------------- + [Description("The end of the time scale. Only used when FullTimeScale is true."), DefaultValue("17:00:00"), Bindable(true), Category("Behavior")]public TimeSpan EndOfTimeScale + { + get + { + object o = ViewState["EndOfTimeScale"]; + if (!(ReferenceEquals(o, null))) + { + return ((TimeSpan) o); + } + if (FullTimeScale) + { + return new TimeSpan(1, 0, 0, 0); // = 24:00 + } + return new TimeSpan(17, 0, 0); // = 5:00 PM + } + set + { + if (value.Days == 0 || value.Equals(new TimeSpan(1, 0, 0, 0))) + { + ViewState["EndOfTimeScale"] = value; + } + else + { + throw (new HttpException("EndOfTimeScale should be between 0:00:00 and 1.00:00:00 (24h)")); + } + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The cell padding of the rendered table. + /// + /// ----------------------------------------------------------------------------- + [Bindable(true), Category("Appearance"), DefaultValue(-1), Description("The cell padding of the rendered table.")]public virtual int CellPadding + { + get + { + if (ControlStyleCreated == false) + { + return -1; + } + return ((TableStyle) ControlStyle).CellPadding; + } + set + { + if (ControlStyle is TableStyle) + { + ((TableStyle) ControlStyle).CellPadding = value; + } + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The cell spacing of the rendered table. + /// + /// ----------------------------------------------------------------------------- + [Bindable(true), Category("Appearance"), DefaultValue(1), Description("The cell spacing of the rendered table.")]public virtual int CellSpacing + { + get + { + if (ControlStyleCreated == false) + { + return 1; + } + return ((TableStyle) ControlStyle).CellSpacing; + } + set + { + if (ControlStyle is TableStyle) + { + ((TableStyle) ControlStyle).CellSpacing = value; + } + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The grid lines to be shown in the rendered table. + /// + /// ----------------------------------------------------------------------------- + [Bindable(true), Category("Appearance"), DefaultValue(System.Web.UI.WebControls.GridLines.None), Description("The grid lines to be shown in the rendered table.")]public virtual GridLines GridLines + { + get + { + if (ControlStyleCreated == false) + { + return GridLines.None; + } + return ((TableStyle) ControlStyle).GridLines; + } + set + { + if (ControlStyle is TableStyle) + { + ((TableStyle) ControlStyle).GridLines = value; + } + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The horizontal alignment of text in the table. + /// + /// ----------------------------------------------------------------------------- + [Bindable(true), Category("Appearance"), DefaultValue(System.Web.UI.WebControls.HorizontalAlign.NotSet), Description("The horizontal alignment of text in the table.")]public virtual HorizontalAlign HorizontalAlign + { + get + { + if (ControlStyleCreated == false) + { + return HorizontalAlign.NotSet; + } + return ((TableStyle) ControlStyle).HorizontalAlign; + } + set + { + if (ControlStyle is TableStyle) + { + ((TableStyle) ControlStyle).HorizontalAlign = value; + } + } + } + + /// ----------------------------------------------------------------------------- + /// + /// When true, clicking on an empty slot in the control will raize the OnEmptySlotClick event. + /// + /// ----------------------------------------------------------------------------- + [Description("When true, clicking on an empty slot in the control will raize the OnEmptySlotClick event."), DefaultValue(false), Bindable(false), Category("Behavior")]public bool EnableEmptySlotClick + { + get + { + object o = ViewState["EnableEmptySlotClick"]; + if (!(ReferenceEquals(o, null))) + { + return System.Convert.ToBoolean(o); + } + return false; + } + set + { + ViewState["EnableEmptySlotClick"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// ToolTip on empty slots. Only shown when EmptySlotClickEnabled is true. + /// + /// ----------------------------------------------------------------------------- + [Description("ToolTip on empty slots. Only shown when EmptySlotClickEnabled is true."), DefaultValue("Click here to add data"), Bindable(false), Category("Behavior")]public string EmptySlotToolTip + { + get + { + return this._emptySlotToolTip; + } + set + { + this._emptySlotToolTip = value; + } + } + + protected override System.Web.UI.HtmlTextWriterTag TagKey + { + get + { + return HtmlTextWriterTag.Div; + } + } + +#endregion + +#region Styles + + /// ----------------------------------------------------------------------------- + /// + /// The style applied to schedule items. + /// + + [Description("The style applied to schedule items. "), Bindable(false), Category("Style"), NotifyParentProperty(true), PersistenceMode(PersistenceMode.InnerProperty)]public virtual TableItemStyle ItemStyle + { + get + { + if (ReferenceEquals(_itemStyle, null)) + { + _itemStyle = new TableItemStyle(); + if (IsTrackingViewState) + { + ((IStateManager) _itemStyle).TrackViewState(); + } + } + return _itemStyle; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The style applied to alternating schedule items. + /// + /// ----------------------------------------------------------------------------- + [Description("The style applied to alternating schedule items. "), Bindable(false), Category("Style"), NotifyParentProperty(true), PersistenceMode(PersistenceMode.InnerProperty)]public virtual TableItemStyle AlternatingItemStyle + { + get + { + if (ReferenceEquals(_alternatingItemStyle, null)) + { + _alternatingItemStyle = new TableItemStyle(); + if (IsTrackingViewState) + { + ((IStateManager) _alternatingItemStyle).TrackViewState(); + } + } + return _alternatingItemStyle; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The style applied to range header items. + /// + /// ----------------------------------------------------------------------------- + [Description("The style applied to range header items. "), Bindable(false), Category("Style"), NotifyParentProperty(true), PersistenceMode(PersistenceMode.InnerProperty)]public virtual TableItemStyle RangeHeaderStyle + { + get + { + if (ReferenceEquals(_RangeHeaderStyle, null)) + { + _RangeHeaderStyle = new TableItemStyle(); + if (IsTrackingViewState) + { + ((IStateManager) _RangeHeaderStyle).TrackViewState(); + } + } + return _RangeHeaderStyle; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The style applied to title items. + /// + /// ----------------------------------------------------------------------------- + [Description("The style applied to title items. "), Bindable(false), Category("Style"), NotifyParentProperty(true), PersistenceMode(PersistenceMode.InnerProperty)]public virtual TableItemStyle TitleStyle + { + get + { + if (ReferenceEquals(_TitleStyle, null)) + { + _TitleStyle = new TableItemStyle(); + if (IsTrackingViewState) + { + ((IStateManager) _TitleStyle).TrackViewState(); + } + } + return _TitleStyle; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The style applied to the background cells. + /// + /// ----------------------------------------------------------------------------- + [Description("The style applied to the background cells. "), Bindable(false), Category("Style"), NotifyParentProperty(true), PersistenceMode(PersistenceMode.InnerProperty)]public virtual TableItemStyle BackgroundStyle + { + get + { + if (ReferenceEquals(_BackgroundStyle, null)) + { + _BackgroundStyle = new TableItemStyle(); + if (IsTrackingViewState) + { + ((IStateManager) _BackgroundStyle).TrackViewState(); + } + } + return _BackgroundStyle; + } + } + +#endregion + +#region Templates + + private ITemplate _itemTemplate = null; + + /// ----------------------------------------------------------------------------- + /// + /// Main template providing content for each regular item in the body of the schedule. + /// + /// ----------------------------------------------------------------------------- + [TemplateContainer(typeof(ScheduleItem)), Browsable(false), Description("The content to be shown in each regular item."), PersistenceMode(PersistenceMode.InnerProperty)]public ITemplate ItemTemplate + { + get + { + return _itemTemplate; + } + set + { + _itemTemplate = value; + + } + } + + private ITemplate _emptyDataTemplate = null; + + /// ----------------------------------------------------------------------------- + /// + /// Optional template providing content to be shown when the data source is empty. + /// This template is not used by the ScheduleCalendar control when FullTimeScale=True. + /// + /// ----------------------------------------------------------------------------- + [TemplateContainer(typeof(ScheduleItem)), Browsable(false), Description("The content to be shown when the data source is empty. This template is not used by the ScheduleCalendar control when FullTimeScale=True."), PersistenceMode(PersistenceMode.InnerProperty)]public ITemplate EmptyDataTemplate + { + get + { + return _emptyDataTemplate; + } + set + { + _emptyDataTemplate = value; + + } + } +#endregion + +#region Events + + protected virtual void OnItemCommand(ScheduleCommandEventArgs e) + { + if (ItemCommandEvent != null) + ItemCommandEvent(this, e); + } + + protected virtual void OnItemCreated(ScheduleItemEventArgs e) + { + if (ItemCreatedEvent != null) + ItemCreatedEvent(this, e); + } + + protected virtual void OnItemDataBound(ScheduleItemEventArgs e) + { + if (ItemDataBoundEvent != null) + ItemDataBoundEvent(this, e); + } + + + /// ----------------------------------------------------------------------------- + /// + /// Raised when EnableEmptySlotClick is true and the user clicks on an empty slot. + /// + /// Event argument with information about the cell that was clicked + /// ----------------------------------------------------------------------------- + protected virtual void OnEmptySlotClick(ClickableTableCellEventArgs e) + { + if (EmptySlotClickEvent != null) + EmptySlotClickEvent(this, e); + } + + /// ----------------------------------------------------------------------------- + /// + /// Raised when a CommandEvent occurs within an item. + /// + /// + /// + /// ----------------------------------------------------------------------------- + [Category("Action"), Description("Raised when a CommandEvent occurs within an item.")]private ScheduleCommandEventHandler ItemCommandEvent; + public event ScheduleCommandEventHandler ItemCommand + { + add + { + ItemCommandEvent = (ScheduleCommandEventHandler) System.Delegate.Combine(ItemCommandEvent, value); + } + remove + { + ItemCommandEvent = (ScheduleCommandEventHandler) System.Delegate.Remove(ItemCommandEvent, value); + } + } + + + /// ----------------------------------------------------------------------------- + /// + /// Raised when an item is created and is ready for customization. + /// + /// + /// + /// ----------------------------------------------------------------------------- + [Category("Behavior"), Description("Raised when an item is created and is ready for customization.")]private ScheduleItemEventHandler ItemCreatedEvent; + public event ScheduleItemEventHandler ItemCreated + { + add + { + ItemCreatedEvent = (ScheduleItemEventHandler) System.Delegate.Combine(ItemCreatedEvent, value); + } + remove + { + ItemCreatedEvent = (ScheduleItemEventHandler) System.Delegate.Remove(ItemCreatedEvent, value); + } + } + + + /// ----------------------------------------------------------------------------- + /// + /// Raised when an item is data-bound. + /// + /// + /// + /// ----------------------------------------------------------------------------- + [Category("Behavior"), Description("Raised when an item is data-bound.")]private ScheduleItemEventHandler ItemDataBoundEvent; + public event ScheduleItemEventHandler ItemDataBound + { + add + { + ItemDataBoundEvent = (ScheduleItemEventHandler) System.Delegate.Combine(ItemDataBoundEvent, value); + } + remove + { + ItemDataBoundEvent = (ScheduleItemEventHandler) System.Delegate.Remove(ItemDataBoundEvent, value); + } + } + + /// ----------------------------------------------------------------------------- + /// + /// Occurs when the user clicks on an empty slot. + /// + /// + /// + /// ----------------------------------------------------------------------------- + [Category("Action"), Description("Occurs when the user clicks on an empty slot.")]private ClickableTableCellEventHandler EmptySlotClickEvent; + public event ClickableTableCellEventHandler EmptySlotClick + { + add + { + EmptySlotClickEvent = (ClickableTableCellEventHandler) System.Delegate.Combine(EmptySlotClickEvent, value); + } + remove + { + EmptySlotClickEvent = (ClickableTableCellEventHandler) System.Delegate.Remove(EmptySlotClickEvent, value); + } + } + + +#endregion + +#region Methods and Implementation + + protected BaseSchedule() // hide constructor in this abstract class + { + } + + + + protected override void CreateChildControls() + { + CheckVersion(); + Controls.Clear(); + if ((!ReferenceEquals(ViewState["RowCount"], null)) || (!ReferenceEquals(ViewState["Empty"], null))) + { + // Create the control hierarchy using the view state, not the data source. + CreateControlHierarchy(false); + } + else + { + _itemsArrayList = new ArrayList(); + ClearChildViewState(); + } + } + + /// ----------------------------------------------------------------------------- + /// + /// Checks if the application is running on the proper version of ASP.NET. + /// If not, an exception is thrown. + /// + /// ----------------------------------------------------------------------------- + public void CheckVersion() + { + } + + + + /// ----------------------------------------------------------------------------- + /// + /// Overrides Control.Databind. + /// + /// ----------------------------------------------------------------------------- + public override void DataBind() + { + OnDataBinding(EventArgs.Empty); // See BaseDatalist control in mono + } + + /// ----------------------------------------------------------------------------- + /// + /// Overrides Control.OnDatabinding. + /// + /// ----------------------------------------------------------------------------- + protected override void OnDataBinding(EventArgs e) + { + base.OnDataBinding(e); + if (!ReferenceEquals(DataSource, null)) + { + Controls.Clear(); // clear any existing child controls + + // clear any previous viewstate for existing child controls + ClearChildViewState(); + CreateControlHierarchy(true); + + // prevent child controls from being created again + ChildControlsCreated = true; + TrackViewState(); + } + } + public void CreateControlHierarchy(bool useDataSource) + { + if (!(ReferenceEquals(_itemsArrayList, null))) + { + _itemsArrayList.Clear(); + _items = null; + } + else + { + _itemsArrayList = new ArrayList(); + } + + + if (useDataSource) + { + string strCheckConfiguration = CheckConfiguration(); + // check if all the necessary properties are set + if (!string.IsNullOrEmpty(strCheckConfiguration)) + { + throw (new HttpException(strCheckConfiguration)); + } + + DataView dv = GetDataView(); + + Controls.Clear(); + if ((ReferenceEquals(dv, null) || dv.Count == 0) && ShowEmptyDataTemplate) + { + RenderEmptyDataTemplate(); + return ; + } + // clear any existing child controls + Table1 = new Table(); + Controls.Add(Table1); + Table1.CopyBaseAttributes(this); + if (ControlStyleCreated) + { + Table1.ApplyStyle(ControlStyle); + } + + PreprocessData(ref dv); + + FillRangeValueArray(ref dv); + FillTitleValueArray(ref dv); + + CreateEmptyTable(); + + AddRangeHeaderData(); + AddTitleHeaderData(); + + AddData(dv); + + if (!IncludeEndValue && ShowValueMarks) + { + AddRangeValueMarks(); + } + + AddDateHeaderData(); + + // Save information for use in round trips (enough to re-create the control tree). + if (!ReferenceEquals(HttpContext.Current, null)) + { + SaveControlTree(); + } + } + else // Not useDataSource + { + LoadControlTree(); // Recreate the control tree from viewstate + } + } + + /// ----------------------------------------------------------------------------- + /// + /// Check if all properties are set to make the control work + /// Override this function in derived versions. + /// + /// + /// ----------------------------------------------------------------------------- + abstract public string CheckConfiguration(); + + /// ----------------------------------------------------------------------------- + /// + /// Create the list with all range header values (Start or End) + /// + /// + /// ----------------------------------------------------------------------------- + abstract public void FillRangeValueArray(ref DataView dv); + + /// ----------------------------------------------------------------------------- + /// + /// Remove any doubles from the ArrayList and + /// + /// The ArrayList object + /// ----------------------------------------------------------------------------- + public static void RemoveDoubles(ArrayList arr) + { + int count = arr.Count; + int i = 0; + for (i = count - 1; i >= 1; i--) + { + if (arr[i].ToString() == arr[i - 1].ToString()) + { + arr.RemoveAt(i); + } + } + } + + /// ----------------------------------------------------------------------------- + /// + /// Pre-process the data in the dataview + /// Currently only used in ScheduleCalendar to split the items that span midnight + /// + /// The DataView object containing the data + /// ----------------------------------------------------------------------------- + virtual public void PreprocessData(ref DataView dv) + { + // override to add usefull processing if any + } + + /// ----------------------------------------------------------------------------- + /// + /// Create the list with all the title values + /// + /// The DataView object containing the data + /// ----------------------------------------------------------------------------- + virtual public void FillTitleValueArray(ref DataView dvView) + { + // Override in ScheduleGeneral to fill title array + } + + /// ----------------------------------------------------------------------------- + /// + /// Get the number of times the control should repeat the schedule + /// (every time with new headers) + /// + /// An integer value indicating the repetition count + /// + /// Overridden in ScheduleCalendar to return NumberOfRepetitions (usually number of weeks) + /// + /// ----------------------------------------------------------------------------- + virtual public int GetRepetitionCount() + { + return 1; + } + + /// ----------------------------------------------------------------------------- + /// + /// Create a Table control with the right number of rows and columns. + /// The actual content is added later. + /// + /// ----------------------------------------------------------------------------- + public void CreateEmptyTable() + { + int col = 0; // counters + int row = 0; + int iWeek = 0; + + int nTitles = GetTitleCount(); + + if (Layout == LayoutEnum.Vertical) + { + for (iWeek = 1; iWeek <= GetRepetitionCount(); iWeek++) + { + // Add a row of title header cells + Table1.Rows.Add(new TableRow()); + TableRow tr0 = Table1.Rows[Table1.Rows.Count - 1]; + for (col = 1; col <= nTitles + 1; col++) + { + tr0.Cells.Add(new TableHeaderCell()); + tr0.Cells[tr0.Cells.Count - 1].ApplyStyle(TitleStyle); + tr0.Cells[tr0.Cells.Count - 1].Text = " "; + } + + int nRows = 0; + if (!IncludeEndValue && ShowValueMarks) + { + // Create 2 rows for each value allowing for a value mark to be added in between + nRows = arrRangeValues.Count * 2; + } + else + { + nRows = arrRangeValues.Count; + } + + for (row = 1; row <= nRows; row++) + { + // add a cell for the range header + Table1.Rows.Add(new TableRow()); + TableRow tr = Table1.Rows[Table1.Rows.Count - 1]; + // add a cell for the header column + tr.Cells.Add(new TableHeaderCell()); + TableCell cell0 = tr.Cells[tr.Cells.Count - 1]; + cell0.ApplyStyle(RangeHeaderStyle); + cell0.Text = " "; + + // If no value marks are needed add cells to all the rows + // Else show only the even rows and the first row + + if (IncludeEndValue || !ShowValueMarks || row % 2 == 0 | row == 1) + { + + // add a cell for each normal column + for (col = 1; col <= nTitles; col++) + { + if (EnableEmptySlotClick && (!(ShowValueMarks && !IncludeEndValue && (row == 1 | row == nRows)))) + { + tr.Cells.Add(new ClickableTableCell(Table1.Rows.Count - 1, col)); + } + else + { + tr.Cells.Add(new TableCell()); + } + TableCell cell = tr.Cells[tr.Cells.Count - 1]; + cell.ApplyStyle(BackgroundStyle); + + if (!IncludeEndValue && ShowValueMarks) + { + if (row > 1 & row < nRows) + { + // the first and last row only have a span of 1 + cell.Text = " "; + cell.RowSpan = 2; + } + } + else + { + cell.Text = " "; + } + } + } + } + } + } + else // Horizontal + { + int nColumnsForRangeHeaders = arrRangeValues.Count; + if (!IncludeEndValue && ShowValueMarks) + { + // Create 2 columns for each value allowing for a value mark to be added in between + nColumnsForRangeHeaders = arrRangeValues.Count * 2; + } + + // In Horizontal layout, ignore repetition count: show 1 week only + // Add range header cell + Table1.Rows.Add(new TableRow()); + TableRow tr0 = Table1.Rows[0]; + tr0.Cells.Add(new TableHeaderCell()); + tr0.Cells[0].ApplyStyle(TitleStyle); + tr0.Cells[0].Text = " "; + for (col = 1; col <= nColumnsForRangeHeaders; col++) + { + tr0.Cells.Add(new TableHeaderCell()); + TableCell cell = tr0.Cells[col]; + cell.ApplyStyle(RangeHeaderStyle); + cell.Text = " "; + } + + int nColumns = arrRangeValues.Count; + if (!IncludeEndValue && ShowValueMarks) + { + // Extra column to allow the range headers to sit on the separation + // When for example there are 4 values, we make 5 columns + // 1 startcolumn, 3 columns sitting each between 2 values, and an end column + nColumns++; + } + + for (row = 1; row <= nTitles; row++) + { + Table1.Rows.Add(new TableRow()); + TableRow tr = Table1.Rows[row]; + // add a cell for the title header + tr.Cells.Add(new TableHeaderCell()); + tr.Cells[0].ApplyStyle(TitleStyle); + tr.Cells[0].Text = " "; + + // add a cell for each column + for (col = 1; col <= nColumns; col++) + { + if (EnableEmptySlotClick && (!(!IncludeEndValue && ShowValueMarks && (col == 1 | col == nColumns)))) + { + tr.Cells.Add(new ClickableTableCell(row, col)); + } + else + { + tr.Cells.Add(new TableCell()); + } + TableCell cell = tr.Cells[col]; + cell.ApplyStyle(BackgroundStyle); + cell.Text = " "; + + if (!IncludeEndValue && ShowValueMarks && col > 1 & col < nColumns) + { + // the first and last column only have a span of 1 + cell.ColumnSpan = 2; + } + } + } + } + + } + + /// ----------------------------------------------------------------------------- + /// + /// Add date headers to the table when SeparateDateHeader=True + /// Overridden only in ScheduleGeneral to add date header data + /// + /// ----------------------------------------------------------------------------- + virtual public void AddDateHeaderData() + { + // Override in ScheduleGeneral to add date header data + } + + /// ----------------------------------------------------------------------------- + /// + /// Iterate the arrRangeValues array, creating a new header item for each data item + /// + /// ----------------------------------------------------------------------------- + public void AddRangeHeaderData() + { + int cellsPerWeek = 1 + arrRangeValues.Count; + if (!IncludeEndValue && ShowValueMarks) + { + cellsPerWeek = 1 + arrRangeValues.Count * 2; + } + + int j = 0; + for (j = 0; j <= GetRepetitionCount() - 1; j++) + { + int i = 0; + for (i = 0; i <= arrRangeValues.Count - 1; i++) + { + object obj = arrRangeValues[i]; + + int rangeValueIndex = i + 1 + j * cellsPerWeek; + if (!IncludeEndValue && ShowValueMarks) + { + rangeValueIndex = i * 2 + 1 + j * cellsPerWeek; + } + + CreateItem(rangeValueIndex, 0, ScheduleItemType.RangeHeader, true, obj, -1); + } + } + } + + abstract public void AddTitleHeaderData(); + + abstract public string GetSortOrder(); + + /// ----------------------------------------------------------------------------- + /// + /// Add the actual items from the data source to the body of the table + /// + /// The data view that contains the data items + /// ----------------------------------------------------------------------------- + public void AddData(DataView dvView) + { + + if (ReferenceEquals(ItemTemplate, null)) + { + throw (new HttpException("The ItemTemplate is missing.")); + } + + if (ReferenceEquals(dvView, null)) + { + return ; + } + + string strSortOrder = GetSortOrder(); + if (!string.IsNullOrEmpty(strSortOrder)) + { + dvView.Sort = strSortOrder; + } + + // iterate DataSource creating a new item for each data item + int prevTitleIndex = -1; + int prevStartCellIndex = -1; + + int i = 0; + // make sure the data is processed in the right order: from bottom right up to top left. + for (i = dvView.Count - 1; i >= 0; i--) + { + + DataRowView drv = dvView[i]; + // this dataRowView of data will be one entry in the schedule + + // Let's find out where it should be displayed + // Instead of column or row numbers, we use titleIndex and valueIndex + // These can be used in the same way, whether layout is horizontal or vertical + // titleIndex is the row number in Horizontal mode and the column number in vertical mode + // valueIndex is the row number in Vertical mode and the column number in Horizontal mode + // Both start at 0 + object objTitleField = drv[GetTitleField()]; + int titleIndex = CalculateTitleIndex(objTitleField); + if (titleIndex < 1) + { + break; // since titleIndex is descending, and this one is too low already, skip all the rest too + } + + object objStartValue = drv[DataRangeStartField]; + object objEndValue = drv[DataRangeEndField]; + int startCellIndex = CalculateRangeCellIndex(objStartValue, objTitleField, false); + int endCellIndex = CalculateRangeCellIndex(objEndValue, objTitleField, true); + if (startCellIndex > -1 & endCellIndex > -1) // if not out of range + { + if (!IncludeEndValue) + { + endCellIndex--; + } + int Span = endCellIndex - startCellIndex + 1; + if (Span == 0) + { + Span = 1; + } + + int maxStartCellIndex = 0; + if (Layout == LayoutEnum.Vertical) + { + maxStartCellIndex = Table1.Rows.Count - 1; + } + else // Horizontal + { + if (titleIndex >= Table1.Rows.Count) + { + // make sure nothing is added in this case + maxStartCellIndex = -2; + } + else + { + maxStartCellIndex = System.Convert.ToInt32(Table1.Rows[titleIndex].Cells.Count - 1); + } + } + if (startCellIndex > 0 && startCellIndex <= maxStartCellIndex) + { + + int cellIndex = startCellIndex; + if (titleIndex == prevTitleIndex && startCellIndex + Span > prevStartCellIndex) + { + // this cell is overlapping with the previous one (the one below or to the right) + // prevStartValue is the starting cell index of the previous item + // (in vertical layout the one below and in horizontal layout the one to the right) + // this index is higher than this cell's index + // (because the previous starting cell is under or to the right of this starting cell) + // that's because we work from bottom right to top left + // split the column or row that's overlapping so that we can show both contents + // the last value to split is the end value of this item + SplitTitle(titleIndex, startCellIndex, endCellIndex); + } + // create new content + ScheduleItemType type = ScheduleItemType.Item; + if (i % 2 == 1) + { + type = ScheduleItemType.AlternatingItem; + } + // use the index in _itemsArrayList as dataSetIndex + if (Layout == LayoutEnum.Vertical || cellIndex <= System.Convert.ToInt32(Table1.Rows[titleIndex].Cells.Count - 1)) + { + ScheduleItem Item = CreateItem(cellIndex, titleIndex, type, true, drv, _itemsArrayList.Count); + MergeCells(cellIndex, titleIndex, Span); + _itemsArrayList.Add(Item); + } + // save location for next item to compare with + prevTitleIndex = titleIndex; + prevStartCellIndex = startCellIndex; + } + } + } + + } + + /// ----------------------------------------------------------------------------- + /// + /// Add range value marks to indicate the range values + /// + /// ----------------------------------------------------------------------------- + protected void AddRangeValueMarks() + { + if (Layout == LayoutEnum.Vertical) + { + // Insert an extra column for range marks after the first column + + int rowsPerWeek = 1 + arrRangeValues.Count * 2; + int j = 0; + for (j = 0; j <= GetRepetitionCount() - 1; j++) + { + // First insert a cell in the title row + int rangeValueIndex = j * rowsPerWeek; + Table1.Rows[rangeValueIndex].Cells.AddAt(1, new TableHeaderCell()); + TableCell tc1 = Table1.Rows[rangeValueIndex].Cells[1]; + tc1.Text = " "; + tc1.ApplyStyle(TitleStyle); + + int i = 0; + for (i = 1; i <= rowsPerWeek - 1; i++) + { + rangeValueIndex = i + j * rowsPerWeek; + + Table1.Rows[rangeValueIndex].Cells.AddAt(1, new TableHeaderCell()); + TableCell tc = Table1.Rows[rangeValueIndex].Cells[1]; + tc.Text = " "; + TableCell tc0 = Table1.Rows[rangeValueIndex].Cells[0]; + } + for (i = 1; i <= rowsPerWeek - 1; i += 2) + { + // each rangeheader spans 2 rows (over the rangeheader mark) + // merge these cells over 2 rows in the first column + rangeValueIndex = i + j * rowsPerWeek; + MergeCells(rangeValueIndex, 0, 2); + } + } + } + else // Horizontal + { + TableRow tr0 = Table1.Rows[0]; + // Add new row for rangevalue marks + Table1.Rows.AddAt(1, new TableRow()); + TableRow tr1 = Table1.Rows[1]; + + // title column + tr1.Cells.Add(new TableHeaderCell()); + TableCell tc1 = tr1.Cells[0]; + tc1.Text = " "; + tc1.ApplyStyle(TitleStyle); + + int nColumns = arrRangeValues.Count * 2 + 1; + int i = 0; + for (i = 1; i <= nColumns - 1; i++) + { + TableCell tc0 = tr0.Cells[i]; + tr1.Cells.Add(new TableHeaderCell()); + TableCell tc = tr1.Cells[i]; + tc.Text = " "; + } + // iterate the cells in reverse order for merging + for (i = nColumns - 2; i >= 1; i -= 2) + { + // each rangeheader spans 2 rows (over the rangeheader mark) + // merge these cells over 2 columns in the first column + MergeCells(i, 0, 2); + } + } + } + + protected virtual string GetTitleField() + { + // overridden in ScheduleCalendar + return TitleField; + } + + /// ----------------------------------------------------------------------------- + /// + /// Calculate the range cell index in the table, given the objRangeValue and the objTitleValue + /// The values refer to the real cell index in the table, taking into account whether cells are + /// spanning over value marks (in horizontal mode) + /// In vertical layout, the result is the real row index in the table + /// In horizontal layout, the result is the real cell index in the row (before any merging + /// of cells due to value spanning) + /// + /// The range value from the data source + /// The title value from the data source + /// False if we're calculating the range value index for the + /// start of the item, True if it's the end + /// The range cell index + /// ----------------------------------------------------------------------------- + protected abstract int CalculateRangeCellIndex(object objRangeValue, object objTitleValue, bool isEndValue); + + /// ----------------------------------------------------------------------------- + /// + /// Calculate the TitleIndex in the table, given the objTitleValue + /// + /// The title value from the data source + /// The title index + /// ----------------------------------------------------------------------------- + protected abstract int CalculateTitleIndex(object objTitleValue); + + /// ----------------------------------------------------------------------------- + /// + /// Merge cells starting at startCellIndex + /// + /// Index of the first cell to merge. + /// Row or column containing the adjacent cells. + /// Number of columns or rows that the newly merged cell should span. + /// The newly merged cell if successful. Nothing when merging fails. + /// + /// In horizontal layout, merging may start at 0 + /// + /// ----------------------------------------------------------------------------- + public TableCell MergeCells(int startCellIndex, int titleIndex, int span) + { + if (titleIndex > GetTitleCount()) + { + return null; + } + + int minValueIndex = System.Convert.ToInt32(System.Convert.ToInt32(Layout == LayoutEnum.Horizontal ? 0 : 1)); + if (startCellIndex < minValueIndex) + { + return null; + } + if (span < 2) + { + return null; + } + + int maxValueIndex = 0; + if (Layout == LayoutEnum.Horizontal) + { + maxValueIndex = System.Convert.ToInt32(Table1.Rows[0].Cells.Count - 1); + } + else // Vertical + { + maxValueIndex = Table1.Rows.Count - 1; + } + + if (startCellIndex > maxValueIndex) + { + return null; + } + + if (startCellIndex + span - 1 > maxValueIndex) + { + span = maxValueIndex - startCellIndex + 1; + } + + try + { + if (!IncludeEndValue && ShowValueMarks && Layout == LayoutEnum.Horizontal & titleIndex > 0) + { + // in this case every item spans 2 columns + span = span * 2; + } + + if (span <= GetValueSpan(startCellIndex, titleIndex)) + { + return null; + } + RemoveCells(startCellIndex, startCellIndex + span, titleIndex); + // change span property to extend the cell + SetValueSpan(startCellIndex, titleIndex, span); + return GetCell(startCellIndex, titleIndex); + } + catch (Exception ex) + { + if (!ReferenceEquals(HttpContext.Current, null)) + { + Context.Trace.Warn(ex.Message); + } + } + return null; + } + + /// ----------------------------------------------------------------------------- + /// + /// Removes all the cells from startValueIndex to endValueIndex, except the first cell + /// + /// Index of the first cell to remove. + /// Index of the last cell to remove. + /// Row or column containing the adjacent cells. + /// ----------------------------------------------------------------------------- + private void RemoveCells(int startCellIndex, int endCellIndex, int titleIndex) + { + // When cells are merged in HTML, it is done by increasing the span of the first cell, + // and removing the other cells. + int prevSpan = GetValueSpan(startCellIndex, titleIndex); + + int valueCellIndex = startCellIndex + prevSpan; + while (valueCellIndex < endCellIndex) + { + int nextCellIndex = 0; + if (Layout == LayoutEnum.Vertical) + { + nextCellIndex = valueCellIndex; + } + else + { + nextCellIndex = startCellIndex + 1; // use +1, not +prevSpan + } + prevSpan = GetValueSpan(nextCellIndex, titleIndex); + RemoveCell(nextCellIndex, titleIndex); + valueCellIndex += prevSpan; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// Removes the cell at cellValueIndex + /// + /// Cell value index of the cell to be removed. + /// Title index of the cell to be removed. + /// ----------------------------------------------------------------------------- + private void RemoveCell(int cellValueIndex, int titleIndex) + { + if (Layout == LayoutEnum.Vertical) + { + Table1.Rows[cellValueIndex].Cells.RemoveAt(titleIndex); + } + else // Horizontal + { + Table1.Rows[titleIndex].Cells.RemoveAt(cellValueIndex); + } + } + + /// ----------------------------------------------------------------------------- + /// + /// in vertical layout, get the column span. In horizontal layout, get the row span + /// + /// Value index of the cell + /// Title index of the cell + /// Integer value indicating the span width + /// ----------------------------------------------------------------------------- + private int GetSplitSpan(int valueIndex, int titleIndex) + { + int returnValue = 0; + if (Layout == LayoutEnum.Vertical) + { + returnValue = Table1.Rows[valueIndex].Cells[titleIndex].ColumnSpan; + } + else + { + returnValue = Table1.Rows[titleIndex].Cells[valueIndex].RowSpan; + } + if (returnValue == 0) + { + returnValue = 1; + } + return returnValue; + } + + /// ----------------------------------------------------------------------------- + /// + /// Check if the cells at titleIndex are already spanning over multiple rows or columns + /// for the given range. The span must be the same over that range. + /// + /// Title index of the range + /// + /// + /// True or false + /// ----------------------------------------------------------------------------- + private bool IsRangeAlreadySpanning(int titleIndex, int firstCellIndex, int lastCellIndex) + { + int SplitSpan = GetSplitSpan(firstCellIndex, titleIndex); + if (SplitSpan == 1) + { + return false; + } + if (Layout == LayoutEnum.Vertical) // v1.6.0.4 bugfix + { + int row = firstCellIndex + GetValueSpan(firstCellIndex, titleIndex); + while (row <= lastCellIndex) + { + if (GetSplitSpan(row, titleIndex) != SplitSpan) + { + return false; + } + row = row + GetValueSpan(row, titleIndex); + } + // the last cell of the range must also end at startOfRange + // if not, we can't split the range without adding a new column or row + if (row > lastCellIndex + 1) + { + return false; + } + } + else // Horizontal + { + int cellIndex = firstCellIndex + 1; // v1.6.0.3 bugfix + for (cellIndex = firstCellIndex + 1; cellIndex <= lastCellIndex; cellIndex++) + { + if (GetSplitSpan(cellIndex, titleIndex) != SplitSpan) + { + return false; + } + } + } + return true; + } + + /// ----------------------------------------------------------------------------- + /// + /// Split a column or row in 2 in order to allow the display of overlapping items. + /// + /// Title index of the cells to be split + /// Index of the first cell in the range to split + /// Index of the last cell in the range to split + /// ----------------------------------------------------------------------------- + private void SplitTitle(int titleIndex, int firstCellIndexToSplit, int lastCellIndexToSplit) + { + // To show overlapping items, we simply split the entire column or row in 2, + // except when it was already split before. + // Only the overlapping items are actually shown in 2 columns or rows, the other items + // are shown sitting on both columns or rows. + // This works well only when there are not yet any split columns or rows to the left of or above this one + // If we work from right to left and bottom to top, this should be OK + // + // Because of the way tables work in HTML, the approach is different for each layout. + // In vertical layout, we'll split the column by adding cells in several rows. + // In horizontal layout, we'll add a new row, and add several cells to it. + int cellsPerWeek = 1 + arrRangeValues.Count; // including one cell for title headers + + if (!IncludeEndValue && ShowValueMarks) + { + if (Layout == LayoutEnum.Horizontal) + { + // Extra column to allow the range headers to sit on the separation + // When for example there are 4 values, we make 6 columns + // 1 title column, 1 start column, 3 columns (each sitting between 2 values), + // and an end column + cellsPerWeek = 2 + arrRangeValues.Count; + } + else + { + // Each item takes 2 rows + cellsPerWeek = 1 + arrRangeValues.Count * 2; + } + } + + int firstCellIndexInThisWeek = System.Convert.ToInt32((firstCellIndexToSplit / cellsPerWeek) * cellsPerWeek); + int lastCellIndexInThisWeek = firstCellIndexInThisWeek + cellsPerWeek - 1; + + bool SplitEntireColumnOrRow = !IsRangeAlreadySpanning(titleIndex, firstCellIndexToSplit, lastCellIndexToSplit); + + TableRow newRow = null; // only used in horizontal layout if SplitEntireColumnOrRow=True + if (SplitEntireColumnOrRow && Layout == LayoutEnum.Horizontal) + { + // insert a new row + Table1.Rows.AddAt(titleIndex, new TableRow()); + newRow = Table1.Rows[titleIndex]; + titleIndex++; + } + + if (Layout == LayoutEnum.Vertical) + { + // in vertical layout, realCellIndex is the same as valueIndex + int row = firstCellIndexInThisWeek; + while (row <= lastCellIndexInThisWeek) + { + // first, get the span of the original cell + int originalCellSpan = GetValueSpan(row, titleIndex); + + if (row >= firstCellIndexToSplit && row <= lastCellIndexToSplit) + { + // split the cell in this row by inserting a new cell + ClickableTableCell ctc0 = new ClickableTableCell(row, titleIndex); + Table1.Rows[row].Cells.AddAt(titleIndex, ctc0); + TableCell tc = Table1.Rows[row].Cells[titleIndex]; + tc.RowSpan = originalCellSpan; + if (!SplitEntireColumnOrRow) + { + // no extra column was added, only an extra cell + // therefore: reduce the columnspan of the original cell + TableCell tcOriginal = Table1.Rows[row].Cells[titleIndex + 1]; + tc.ColumnSpan = tcOriginal.ColumnSpan - 1; + tcOriginal.ColumnSpan = 1; + } + else // SplitEntireColumnOrRow + { + if (row + originalCellSpan - 1 > lastCellIndexToSplit) + { + // previous item went below this one, so split the remainder too + // this is done by inserting another empty cell + tc.RowSpan = lastCellIndexToSplit - row + 1; + // split the remainder as well + ClickableTableCell ctc = new ClickableTableCell(lastCellIndexToSplit + 1, titleIndex); + Table1.Rows[lastCellIndexToSplit + 1].Cells.AddAt(titleIndex, ctc); + TableCell tc2 = Table1.Rows[lastCellIndexToSplit + 1].Cells[titleIndex]; + tc2.ApplyStyle(BackgroundStyle); + tc2.Text = " "; + tc2.RowSpan = row + originalCellSpan - 1 - lastCellIndexToSplit; + } + } + } + else // this cell should not be split + { + if (SplitEntireColumnOrRow) + { + // we have added an extra column, but this cell should not be split, + // it should only be spread over the extra column + TableCell tc = Table1.Rows[row].Cells[titleIndex]; + int ColumnSpan = tc.ColumnSpan; + if (ColumnSpan == 0) + { + ColumnSpan = 1; + } + tc.ColumnSpan = ColumnSpan + 1; + } + } + row = row + originalCellSpan; // skip as many rows as this span + } + } + else // Horizontal + { + // in horizontal layout, valueIndex is still the index referring to the list of values + // realCellIndex indicates the index (offset) of the cell in the TableRow + // this is not the same, when a cell has a horizontal span of 2, the next cell will have + // a realCellIndex that is 1 higher, but a valueIndex that is 2 higher. + int valueIndex = firstCellIndexInThisWeek; + int realCellIndex = valueIndex; + while (valueIndex <= lastCellIndexInThisWeek) + { + // first, get the span of the original cell + int originalCellSpan = GetValueSpan(realCellIndex, titleIndex); + int originalValueSpan = originalCellSpan; + if (!IncludeEndValue && ShowValueMarks) + { + // in this case a normal item already has a span of 2, but it's only 1 cell + originalValueSpan = originalCellSpan / 2; + if (originalValueSpan == 0) + { + originalValueSpan = 1; + } + } + + if (valueIndex >= firstCellIndexToSplit && valueIndex <= lastCellIndexToSplit) + { + if (!SplitEntireColumnOrRow) + { + // the current cell is already spanning several rows + // there is no need to add another row, just split the current cell + // over the rows that it's already occupying. + TableRow thisRow = Table1.Rows[titleIndex]; + int SplitSpan = thisRow.Cells[valueIndex].RowSpan; + TableRow lastRowInSpan = Table1.Rows[titleIndex + SplitSpan - 1]; + // move the current cell down to the last row of the rows that are being spanned + // it should become the first cell in that row + lastRowInSpan.Cells.AddAt(0, thisRow.Cells[realCellIndex]); + lastRowInSpan.Cells[0].RowSpan = 1; + // add a new cell in this row + ClickableTableCell ctc = new ClickableTableCell(titleIndex, valueIndex); + thisRow.Cells.AddAt(realCellIndex, ctc); + thisRow.Cells[realCellIndex].ColumnSpan = originalCellSpan; + thisRow.Cells[realCellIndex].RowSpan = SplitSpan - 1; + } + else // SplitEntireColumnOrRow + { + // split the cell in this column by inserting a new cell + ClickableTableCell ctc0 = new ClickableTableCell(titleIndex - 1, valueIndex); + newRow.Cells.Add(ctc0); + TableCell tc = newRow.Cells[newRow.Cells.Count - 1]; + tc.ColumnSpan = originalCellSpan; + if (valueIndex + originalValueSpan - 1 > lastCellIndexToSplit) + { + // previous item ended further to the right than this one, so split the remainder too + // this is done by inserting another empty cell + int newValueSpan = lastCellIndexToSplit - valueIndex + 1; + if (!IncludeEndValue && ShowValueMarks) + { + // in this case a normal item has a span of 2 + newValueSpan *= 2; + } + + tc.ColumnSpan = newValueSpan; + // split the remainder as well + ClickableTableCell ctc = new ClickableTableCell(titleIndex - 1, valueIndex + originalValueSpan - 1); + newRow.Cells.Add(ctc); + TableCell tc2 = newRow.Cells[newRow.Cells.Count - 1]; + int newValueSpan2 = valueIndex + originalValueSpan - 1 - lastCellIndexToSplit; + if (!IncludeEndValue && ShowValueMarks) + { + // in this case a normal item has a span of 2 + newValueSpan2 *= 2; + } + tc2.ColumnSpan = newValueSpan2; + tc2.ApplyStyle(BackgroundStyle); + tc2.Text = " "; + } + } + } + else // this cell should not be split + { + if (SplitEntireColumnOrRow) + { + // we have added an extra row, but this cell should not be split, + // it should only be spread over the extra row + // move this cell up one row to the new row, and spread it over more rows + newRow.Cells.Add(Table1.Rows[titleIndex].Cells[realCellIndex]); + realCellIndex--; // decrease cellindex, because one cell has been removed + // the cell was moved, and it is currently the last cell of newRow + TableCell tc2 = newRow.Cells[newRow.Cells.Count - 1]; + int RowSpan = tc2.RowSpan; // get its span + if (RowSpan == 0) + { + RowSpan = 1; + } + tc2.RowSpan = RowSpan + 1; // increase it + } + } + valueIndex = valueIndex + originalValueSpan; // for the index, skip as many rows/columns as this span + realCellIndex++; // if horizontal, just take the next cell + } + } + + } + + + /// ----------------------------------------------------------------------------- + /// + /// Get the DataView from the DataSource and DataMember properties + /// + /// + /// ----------------------------------------------------------------------------- + public DataView GetDataView() + { + DataView returnValue = default(DataView); + returnValue = null; + + if (!ReferenceEquals(this.DataSource, null)) + { + // determine if the datasource is a DataSet, DataTable or DataView + if (this.DataSource is DataView) + { + returnValue = (DataView) this.DataSource; + } + else if (this.DataSource is DataTable) + { + returnValue = new DataView((DataTable) this.DataSource); + } + else if (this.DataSource is DataSet) + { + DataSet ds = (DataSet) this.DataSource; + if (ReferenceEquals(this.DataMember, null) || this.DataMember == "") + { + // if data member isn't supplied, default to the first table + returnValue = new DataView(ds.Tables[0]); + } + else + { + returnValue = new DataView(ds.Tables[this.DataMember]); // if data member is supplied, use it + } + } + } + // throw an exception if there is a problem with the data source + if (ReferenceEquals(returnValue, null)) + { + throw (new HttpException("Error finding the DataSource. " + "Please check the DataSource and DataMember properties.")); + } + return returnValue; + } + + // Override to get the corresponding templates + protected abstract ITemplate GetTemplate(ScheduleItemType type); + + protected virtual TableItemStyle GetStyle(ScheduleItemType type) + { + TableItemStyle returnValue = default(TableItemStyle); + // Override to add additional styles (such as the style for DateHeaders in ScheduleGeneral) + returnValue = null; + switch (type) + { + case ScheduleItemType.RangeHeader: + return RangeHeaderStyle; + case ScheduleItemType.TitleHeader: + return TitleStyle; + case ScheduleItemType.Item: + return ItemStyle; + case ScheduleItemType.AlternatingItem: + returnValue = new TableItemStyle(); + if (!ReferenceEquals(_itemStyle, null)) + { + returnValue.MergeWith(ItemStyle); + } + if (!ReferenceEquals(_alternatingItemStyle, null)) + { + returnValue.CopyFrom(AlternatingItemStyle); + } + break; + } + return returnValue; + } + + /// ----------------------------------------------------------------------------- + /// + /// Instantiate item using the corresponding template (if any) + /// + /// ScheduleItem to instantiate + /// corresponding table cell + /// ----------------------------------------------------------------------------- + private void InstantiateItem(ScheduleItem item, TableCell cell) + { + ITemplate template = GetTemplate(item.ItemType); + if (!ReferenceEquals(template, null)) + { + template.InstantiateIn(item); // initialize item from template + } + else + { + if (item.ItemType == ScheduleItemType.Item | item.ItemType == ScheduleItemType.AlternatingItem) + { + // this exception should never fire: another should already have fired in AddData() + throw (new HttpException("The ItemTemplate is missing")); + } + // no template provided, just show data item + object value = item.DataItem; // for header items, DataItem is just a String or a Date + Literal lit = new Literal(); + if (!ReferenceEquals(value, null)) + { + lit.Text = FormatDataValue(value, item.ItemType); + } + else + { + // On postback, viewstate should keep the contents, but it fails to do so *** + // The headers stay blank on postback if no template is provided. + // For now, to make it work on postback too, make sure you provide all the templates + lit.Text = " "; + } + item.Controls.Add(lit); + } + TableItemStyle myStyle = GetStyle(item.ItemType); + if (!ReferenceEquals(myStyle, null)) + { + cell.ApplyStyle(myStyle); + } + + } + + /// ----------------------------------------------------------------------------- + /// + /// when there's no template, try to present the data in a reasonable format + /// + /// Value of the item + /// Type of the item + /// A formatted string + /// ----------------------------------------------------------------------------- + protected abstract string FormatDataValue(object value, ScheduleItemType type); + + /// + /// Create the item + /// + /// Cell value index of the item + /// Title index of the item + /// Type of the item + /// Whether databinding should be performed + /// Data item of the item + /// Index of the item in the dataset + /// The newly created ScheduleItem + /// ----------------------------------------------------------------------------- + protected ScheduleItem CreateItem(int cellValueIndex, int titleIndex, ScheduleItemType itemType, bool dataBind, object dataItem, int dataSetIndex) + { + + ScheduleItem item = new ScheduleItem(dataSetIndex, itemType); + if (dataBind) + { + item.DataItem = dataItem; + } + TableCell cell = GetCell(cellValueIndex, titleIndex); + InstantiateItem(item, cell); + + if (item.ItemType == ScheduleItemType.Item | item.ItemType == ScheduleItemType.AlternatingItem) + { + if (ItemStyleField != "" && !ReferenceEquals(dataItem, null)) + { + DataRowView drv = (DataRowView) dataItem; + object objItemStyle = drv[ItemStyleField]; + if (!Information.IsDBNull(objItemStyle)) + { + TableItemStyle style = new TableItemStyle(); + style.CssClass = Convert.ToString(objItemStyle); + cell.ApplyStyle(style); + } + } + } + + ScheduleItemEventArgs e = new ScheduleItemEventArgs(item); + OnItemCreated(e); + GetCell(cellValueIndex, titleIndex).Controls.Add(item); + + if (dataBind) + { + item.DataBind(); + OnItemDataBound(e); + //item.DataItem = Nothing + } + return item; + } + + protected abstract int GetTitleCount(); + + virtual public int GetRangeHeaderIndex() + { + // overridden in ScheduleGeneral when using Date Headers + return 0; + } + + private int GetMinTitleIndex() + { + if (!IncludeEndValue && ShowValueMarks) + { + return GetRangeHeaderIndex() + 2; + } + else + { + return GetRangeHeaderIndex() + 1; + } + } + + private int GetMaxTitleIndex() + { + return GetMinTitleIndex() + GetTitleCount() - 1; + } + + /// ----------------------------------------------------------------------------- + /// + /// In vertical layout, get the row span. In horizontal layout, get the column span + /// + /// Cell value index of the item + /// Title index of the item + /// The integer value of the span + /// ----------------------------------------------------------------------------- + protected int GetValueSpan(int cellValueIndex, int titleIndex) + { + int returnValue = 0; + if (Layout == LayoutEnum.Vertical) + { + returnValue = Table1.Rows[cellValueIndex].Cells[titleIndex].RowSpan; + } + else + { + returnValue = Table1.Rows[titleIndex].Cells[cellValueIndex].ColumnSpan; + } + if (returnValue == 0) + { + returnValue = 1; + } + return returnValue; + } + + /// ----------------------------------------------------------------------------- + /// + /// in vertical layout, set the row span. In horizontal layout, set the column span + /// + /// Cell value index of the item + /// Title index of the item + /// The new span value + /// ----------------------------------------------------------------------------- + private void SetValueSpan(int cellValueIndex, int titleIndex, int span) + { + if (Layout == LayoutEnum.Vertical) + { + Table1.Rows[cellValueIndex].Cells[titleIndex].RowSpan = span; + } + else + { + Table1.Rows[titleIndex].Cells[cellValueIndex].ColumnSpan = span; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// Get the cell at the given indexes. + /// + /// Cell value index of the item + /// Title index of the item + /// The TableCell object of the corresponding cell + /// ----------------------------------------------------------------------------- + private TableCell GetCell(int cellValueIndex, int titleIndex) + { + TableCell returnValue = default(TableCell); + if (Layout == LayoutEnum.Vertical) + { + returnValue = Table1.Rows[cellValueIndex].Cells[titleIndex]; + } + else + { + returnValue = Table1.Rows[titleIndex].Cells[cellValueIndex]; + } + return returnValue; + } + + /// ----------------------------------------------------------------------------- + /// + /// Show the EmptyDataTemplate when the data source is empty + /// + /// ----------------------------------------------------------------------------- + private void RenderEmptyDataTemplate() + { + if (!ReferenceEquals(EmptyDataTemplate, null)) + { + PlaceHolder plh = new PlaceHolder(); + EmptyDataTemplate.InstantiateIn(plh); // initialize from template + Controls.Add(plh); + ViewState["Empty"] = true; // raize a flag + } + } + + /// ----------------------------------------------------------------------------- + /// + /// Handle events raised by children by overriding OnBubbleEvent. + /// + /// the source of the event + /// event data + /// true if the event has been handled + /// ----------------------------------------------------------------------------- + protected override bool OnBubbleEvent(object source, EventArgs e) + { + if (e is ScheduleCommandEventArgs) + { + ScheduleCommandEventArgs ce = (ScheduleCommandEventArgs) e; + OnItemCommand(ce); + string cmdName = ce.CommandName.ToLower(); + + } + return true; + } + + /// ----------------------------------------------------------------------------- + /// + /// RaisePostBackEvent is called when the user clicks on an empty slot + /// (see clickabletablecell.vb) + /// + /// String with the event argument. + /// Contains something like "3-7", where 3 is the row and 7 the column + /// ----------------------------------------------------------------------------- + public void RaisePostBackEvent(string eventArgument) + { + // get column and row number from eventArgument + string[] args = eventArgument.Split('-'); + int row = int.Parse(args[0]); + int column = int.Parse(args[1]); + object Title = null; + object RangeStartValue = null; + object RangeEndValue = null; + int RangeStartValueIndex = CalculateRangeValueIndex(row, column); + if (Layout == LayoutEnum.Horizontal) + { + Title = CalculateTitle(row, column); + } + else + { + Title = CalculateTitle(column, row); + } + RangeStartValue = arrRangeValues[RangeStartValueIndex]; //CalculateRangeValue(row - 1) + int RangeEndValueIndex = RangeStartValueIndex + 1; + if (RangeEndValueIndex >= arrRangeValues.Count) + { + RangeEndValueIndex = arrRangeValues.Count - 1; + } + RangeEndValue = arrRangeValues[RangeEndValueIndex]; //CalculateRangeValue(endRow) + + ClickableTableCellEventArgs ctcea = new ClickableTableCellEventArgs(Title, RangeStartValue, RangeEndValue); + OnEmptySlotClick(ctcea); + } + + ///' ----------------------------------------------------------------------------- + ///' + ///' Calculate the title value given the cell index + ///' + ///' Title index of the cell + ///' Object containing the title + ///' ----------------------------------------------------------------------------- + public abstract dynamic CalculateTitle(int titleIndex, int cellIndex); + + /// ----------------------------------------------------------------------------- + /// + /// Calculate the range value index given the cell index + /// + /// Row of the cell + /// Column of the cell + /// Integer containing the range value index + /// ----------------------------------------------------------------------------- + public int CalculateRangeValueIndex(int row, int column) + { + if (Layout == LayoutEnum.Horizontal) + { + return column - 1 - System.Convert.ToInt32(!IncludeEndValue && ShowValueMarks ? 1 : 0); + } + else + { + int rowsPerWeek = CalculateRowsPerRepetition(); + int RangeValueIndex = 0; + if (!IncludeEndValue && ShowValueMarks) + { + RangeValueIndex = System.Convert.ToInt32((row % rowsPerWeek) / 2 - 1); + } + else + { + RangeValueIndex = System.Convert.ToInt32((row % rowsPerWeek) - 1); + } + if (RangeValueIndex < 0) + { + RangeValueIndex = 0; + } + return RangeValueIndex; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// Calculate the number of rows per repetition + /// + /// Integer containing the number of rows + /// ----------------------------------------------------------------------------- + public int CalculateRowsPerRepetition() + { + int returnValue = 0; + if (!IncludeEndValue && ShowValueMarks) + { + returnValue = arrRangeValues.Count * 2 + 1; + } + else + { + returnValue = arrRangeValues.Count + 1; + } + return returnValue; + } + + /// ----------------------------------------------------------------------------- + /// + /// Save information for use in round trips (enough to re-create the control tree). + /// + /// ----------------------------------------------------------------------------- + private void SaveControlTree() + { + if (Items.Count == 0) + { + return ; + } + int[] arrCellCount = new int[Table1.Rows.Count + 1]; // number of cells in each row + int[] arrHeaderCount = new int[Table1.Rows.Count + 1]; // number of header cells in each row + int[] arrItemCols = new int[Items.Count + 1]; + int[] arrItemRows = new int[Items.Count + 1]; + + int nCells = Table1.Rows.Count * Table1.Rows[0].Cells.Count; + if (Table1.Rows.Count > 0 && Table1.Rows[1].Cells.Count > Table1.Rows[0].Cells.Count) + { + nCells = Table1.Rows.Count * Table1.Rows[1].Cells.Count; + } + int[] arrClickRows = new int[nCells + 1]; // row of each clickable cell + int[] arrClickColumns = new int[nCells + 1]; // column of each clickable cell + + int row = 0; + int col = 0; + int ClickableCellCount = 0; + for (row = 0; row <= Table1.Rows.Count - 1; row++) + { + int cellsInThisRow = Table1.Rows[row].Cells.Count; + arrCellCount[row] = cellsInThisRow; + for (col = 0; col <= cellsInThisRow - 1; col++) + { + if (Table1.Rows[row].Cells[col] is TableHeaderCell) + { + arrHeaderCount[row] = col + 1; // will continue to increase until normal cells start + } + if (EnableEmptySlotClick && Table1.Rows[row].Cells[col] is ClickableTableCell) + { + ClickableTableCell ccell = (ClickableTableCell) (Table1.Rows[row].Cells[col]); + arrClickColumns[ClickableCellCount] = ccell.Column; + arrClickRows[ClickableCellCount] = ccell.Row; + ClickableCellCount++; + } + TableCell cell = Table1.Rows[row].Cells[col]; + if (cell.HasControls()) + { + if (cell.Controls[0] is ScheduleItem) + { + ScheduleItem item = (ScheduleItem) (cell.Controls[0]); + int dataSetIndex = item.DataSetIndex; + if (dataSetIndex >= 0) // body item + { + arrItemRows[dataSetIndex] = row; + arrItemCols[dataSetIndex] = col; + } + } + } + } + } + ViewState["RowCount"] = Table1.Rows.Count; // number of rows + ViewState["ItemCount"] = Items.Count; // number of items in datasource + ViewState["arrCellCount"] = arrCellCount; // number of cells in each row + ViewState["arrHeaderCount"] = arrHeaderCount; // number of header cells in each row + ViewState["arrItemCols"] = arrItemCols; // column index of each item + ViewState["arrItemRows"] = arrItemRows; // row index of each item + + if (EnableEmptySlotClick) + { + Array.Resize(ref arrClickRows, ClickableCellCount + 1); // reduce viewstate + ViewState["arrClickRows"] = arrClickRows; // row of each clickable cell + Array.Resize(ref arrClickColumns, ClickableCellCount + 1); + ViewState["arrClickColumns"] = arrClickColumns; // column of each clickable cell + } + } + + /// ----------------------------------------------------------------------------- + /// + /// Recreate the control tree from viewstate + /// + /// ----------------------------------------------------------------------------- + private void LoadControlTree() + { + Controls.Clear(); + if (System.Convert.ToBoolean(ViewState["Empty"]) == true) + { + // empty control: use EmptyDataTemplate + PlaceHolder plh = new PlaceHolder(); + EmptyDataTemplate.InstantiateIn(plh); + Controls.Add(plh); + return ; + } + // When the control is empty, and EmptyDataTemplate does not exist: + if (ReferenceEquals(ViewState["RowCount"], null)) + { + return ; + } + int RowCount = System.Convert.ToInt32(ViewState["RowCount"]); + int ItemCount = System.Convert.ToInt32(ViewState["ItemCount"]); + int[] arrCellCount = (int[]) (ViewState["arrCellCount"]); // number of cells in each row + int[] arrHeaderCount = (int[]) (ViewState["arrHeaderCount"]); // number of row header cells in each row + int[] arrItemCols = (int[]) (ViewState["arrItemCols"]); // column index of each data item + int[] arrItemRows = (int[]) (ViewState["arrItemRows"]); // row index of each data item + int[] arrClickRows = null; + int[] arrClickColumns = null; + if (EnableEmptySlotClick) + { + arrClickRows = (int[]) (ViewState["arrClickRows"]); // row of each clickable cell + arrClickColumns = (int[]) (ViewState["arrClickColumns"]); // column of each clickable cell + } + // clear any existing child controls + Table1 = new Table(); + Controls.Add(Table1); + + int week = 0; + int row = 0; + int col = 0; + int ClickableCellCount = 0; + int rowsPerRepetition = RowCount / GetRepetitionCount(); // Only used in vertical layout + + // first recreate the table + for (row = 0; row <= RowCount - 1; row++) + { + Table1.Rows.Add(new TableRow()); + TableRow tr = Table1.Rows[Table1.Rows.Count - 1]; + for (col = 0; col <= arrCellCount[row] - 1; col++) + { + if (col < arrHeaderCount[row]) + { + // create row header cells for this week + tr.Cells.Add(new TableHeaderCell()); + } + else + { + if (EnableEmptySlotClick) + { + bool isClickableCell = true; + if (ShowValueMarks && !IncludeEndValue) + { + if (Layout == LayoutEnum.Horizontal & arrHeaderCount[row] > 0) + { + // first and last columns should not be clickable + // when the title is split over several rows, only check the first row + if (col == arrHeaderCount[row]) + { + isClickableCell = false; + } + if (col == arrCellCount[row] - 1) + { + isClickableCell = false; + } + } + else // Vertical + { + int rowInThisRepetition = row % rowsPerRepetition; + if (rowInThisRepetition == 1) + { + isClickableCell = false; + } + if (rowInThisRepetition == rowsPerRepetition - 1) + { + isClickableCell = false; + } + } + } + if (isClickableCell) + { + // col may differ from the real column because of cells + // spanning several rows + // We need the real column here for the EmptySlotClick to work + // It's too complicated to calculate, therefore, we use ViewState + int fixedColumn = arrClickColumns[ClickableCellCount]; + int fixedRow = arrClickRows[ClickableCellCount]; + tr.Cells.Add(new ClickableTableCell(fixedRow, fixedColumn)); + ClickableCellCount++; + } + else + { + tr.Cells.Add(new TableCell()); + } + } + else + { + tr.Cells.Add(new TableCell()); + } + } + } + } + + // now add the items + // it's imperative that we do it in the same order as before the postback + // 1) RangeHeader items + // 2) TitleHeader items + // 3) Normal Items + // 4) DateHeader items (if any) + // + // add RangeHeader items + if (Layout == LayoutEnum.Horizontal) + { + // create range header items in the first or second row + int rangeHeaderRow = GetRangeHeaderIndex(); + for (col = 1; col <= arrCellCount[rangeHeaderRow] - 1; col++) + { + CreateItem(col, rangeHeaderRow, ScheduleItemType.RangeHeader, false, null, -1); + } + } + else // Layout = LayoutEnum.Vertical + { + for (week = 0; week <= GetRepetitionCount() - 1; week++) + { + // create range header items of this repetition in the first or second column + int minRangeHeaderRow = week * rowsPerRepetition + 1; + int maxRangeHeaderRow = week * rowsPerRepetition + rowsPerRepetition - 1; + int iStep = System.Convert.ToInt32(!IncludeEndValue && ShowValueMarks ? 2 : 1); + + for (row = minRangeHeaderRow; row <= maxRangeHeaderRow; row += iStep) + { + col = arrHeaderCount[row] - 1; // the range header column is the right-most column of the header columns + if (!IncludeEndValue && ShowValueMarks) + { + // in this case, the range header column is the 2nd to the right of the header columns + col--; + } + + if (col >= 0) + { + CreateItem(row, col, ScheduleItemType.RangeHeader, false, null, -1); + } + } + } + } + + // add Title Header items + if (Layout == LayoutEnum.Vertical) + { + for (col = GetMinTitleIndex(); col <= arrCellCount[0] - 1; col++) + { + for (week = 0; week <= GetRepetitionCount() - 1; week++) + { + // create title header items in the first row of the week + int titleHeaderRow = week * rowsPerRepetition; + CreateItem(titleHeaderRow, col, ScheduleItemType.TitleHeader, false, null, -1); + } + } + } + else // Layout = LayoutEnum.Horizontal + { + // create title header items in the first column + for (row = GetMinTitleIndex(); row <= RowCount - 1; row++) + { + // titles may be merged over rows. Only the first row of a title contains the item + // So check if there is a title in this row + if (arrHeaderCount[row] == 1) + { + CreateItem(0, row, ScheduleItemType.TitleHeader, false, null, -1); + } + } + + } + + // add the (non-header) items + int i = 0; + for (i = 0; i <= ItemCount - 1; i++) + { + // reconstruct the items + row = arrItemRows[i]; + col = arrItemCols[i]; + ScheduleItem item = default(ScheduleItem); + if (i % 2 == 1) + { + if (Layout == LayoutEnum.Vertical) + { + item = CreateItem(row, col, ScheduleItemType.AlternatingItem, false, null, -1); + } + else + { + item = CreateItem(col, row, ScheduleItemType.AlternatingItem, false, null, -1); + } + } + else + { + if (Layout == LayoutEnum.Vertical) + { + item = CreateItem(row, col, ScheduleItemType.Item, false, null, -1); + } + else + { + item = CreateItem(col, row, ScheduleItemType.Item, false, null, -1); + } + } + } + + if (GetRangeHeaderIndex() == 1) + { + // add DateHeader items + if (Layout == LayoutEnum.Horizontal) + { + // first row is the date header row + for (col = 1; col <= arrCellCount[0] - 1; col++) + { + CreateItem(col, 0, ScheduleItemType.RangeHeader, false, null, -1); + } + } + else // Layout = LayoutEnum.Vertical + { + for (week = 0; week <= GetRepetitionCount() - 1; week++) + { + // create date header items in the first column + int minDateHeaderRow = week * rowsPerRepetition + 1; + int maxDateHeaderRow = week * rowsPerRepetition + rowsPerRepetition - 1; + for (row = minDateHeaderRow; row <= maxDateHeaderRow; row++) + { + // date headers may be merged over columns. + // Only the first column of a date header contains the item + // So check if there is a title in this column + int headersInDateHeaderRow = 2; + if (!IncludeEndValue && ShowValueMarks) + { + headersInDateHeaderRow = 3; + } + + if (arrHeaderCount[row] == headersInDateHeaderRow) + { + // first column contains a date header + CreateItem(row, 0, ScheduleItemType.RangeHeader, false, null, -1); + } + } + } + } + } + + } + + protected override Style CreateControlStyle() + { + // Since the Schedule control renders an HTML table, + // an instance of the TableStyle class is used as the control style. + TableStyle mystyle = new TableStyle(ViewState); + // Set up default initial state. + //mystyle.CellSpacing = 0 + mystyle.CellPadding = -1; + mystyle.GridLines = System.Web.UI.WebControls.GridLines.None; + return mystyle; + } + + + /// ----------------------------------------------------------------------------- + /// + /// Customized state management to handle saving state of contained objects. + /// + /// + /// ----------------------------------------------------------------------------- + protected override void LoadViewState(object savedState) + { + if (!(ReferenceEquals(savedState, null))) + { + object[] myState = (object[]) savedState; + + if (!(ReferenceEquals(myState[0], null))) + { + base.LoadViewState(myState[0]); + } + if (!(ReferenceEquals(myState[1], null))) + { + ((IStateManager) ItemStyle).LoadViewState(myState[1]); + } + if (!(ReferenceEquals(myState[2], null))) + { + ((IStateManager) AlternatingItemStyle).LoadViewState(myState[2]); + } + if (!(ReferenceEquals(myState[3], null))) + { + ((IStateManager) RangeHeaderStyle).LoadViewState(myState[3]); + } + if (!(ReferenceEquals(myState[4], null))) + { + ((IStateManager) TitleStyle).LoadViewState(myState[4]); + } + if (!(ReferenceEquals(myState[5], null))) + { + ((IStateManager) BackgroundStyle).LoadViewState(myState[5]); + } + } + } + + /// ----------------------------------------------------------------------------- + /// + /// Customize state management to handle saving state of contained objects such as styles. + /// + /// + /// ----------------------------------------------------------------------------- + protected override dynamic SaveViewState() + { + object baseState = base.SaveViewState(); + object itemStyleState = null; + object alternatingItemStyleState = null; + object RangeHeaderStyleState = null; + object TitleStyleState = null; + object BackgroundStyleState = null; + + if (!(ReferenceEquals(_itemStyle, null))) + { + itemStyleState = ((IStateManager) _itemStyle).SaveViewState(); + } + else + { + itemStyleState = null; + } + if (!(ReferenceEquals(_alternatingItemStyle, null))) + { + alternatingItemStyleState = ((IStateManager) _alternatingItemStyle).SaveViewState(); + } + else + { + alternatingItemStyleState = null; + } + if (!(ReferenceEquals(_RangeHeaderStyle, null))) + { + RangeHeaderStyleState = ((IStateManager) _RangeHeaderStyle).SaveViewState(); + } + else + { + RangeHeaderStyleState = null; + } + if (!(ReferenceEquals(_TitleStyle, null))) + { + TitleStyleState = ((IStateManager) _TitleStyle).SaveViewState(); + } + else + { + TitleStyleState = null; + } + if (!(ReferenceEquals(_BackgroundStyle, null))) + { + BackgroundStyleState = ((IStateManager) _BackgroundStyle).SaveViewState(); + } + else + { + BackgroundStyleState = null; + } + + object[] myState = new object[7]; + myState[0] = baseState; + myState[1] = itemStyleState; + myState[2] = alternatingItemStyleState; + myState[3] = RangeHeaderStyleState; + myState[4] = TitleStyleState; + myState[5] = BackgroundStyleState; + return myState; + } + + /// ----------------------------------------------------------------------------- + /// + /// Customize state management to handle saving state of contained objects such as styles. + /// + /// ----------------------------------------------------------------------------- + protected override void TrackViewState() + { + base.TrackViewState(); + + if (!(ReferenceEquals(_itemStyle, null))) + { + ((IStateManager) _itemStyle).TrackViewState(); + } + if (!(ReferenceEquals(_alternatingItemStyle, null))) + { + ((IStateManager) _alternatingItemStyle).TrackViewState(); + } + if (!(ReferenceEquals(_RangeHeaderStyle, null))) + { + ((IStateManager) _RangeHeaderStyle).TrackViewState(); + } + if (!(ReferenceEquals(_TitleStyle, null))) + { + ((IStateManager) _TitleStyle).TrackViewState(); + } + if (!(ReferenceEquals(_BackgroundStyle, null))) + { + ((IStateManager) _BackgroundStyle).TrackViewState(); + } + } + +#endregion + + } + } diff --git a/Controls/DotNetNuke.Events.ScheduleControl/baseschedule.vb b/Controls/DotNetNuke.Events.ScheduleControl/baseschedule.vb deleted file mode 100644 index e8f0861..0000000 --- a/Controls/DotNetNuke.Events.ScheduleControl/baseschedule.vb +++ /dev/null @@ -1,2504 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Option Strict On - -Imports System -Imports System.Data -Imports System.Collections -Imports System.Web -Imports System.Web.UI -Imports System.Web.UI.WebControls -Imports Microsoft.VisualBasic ' needed for IIf definition -Imports System.ComponentModel - - _ -Public Enum ScheduleItemType As Integer - ''' ----------------------------------------------------------------------------- - ''' - ''' Standard item in a schedule - ''' - ''' ----------------------------------------------------------------------------- - Item = 0 - ''' ----------------------------------------------------------------------------- - ''' - ''' Alternating standard item in a schedule - ''' - ''' ----------------------------------------------------------------------------- - AlternatingItem - ''' ----------------------------------------------------------------------------- - ''' - ''' Item in the range header column or row. In the derived ScheduleCalendar, - ''' this is an item in the time header. - ''' - ''' ----------------------------------------------------------------------------- - RangeHeader - ''' ----------------------------------------------------------------------------- - ''' - ''' Item in the title header column or row. In the derived ScheduleCalendar, - ''' this is an item in the date header. - ''' - ''' ----------------------------------------------------------------------------- - TitleHeader - ''' ----------------------------------------------------------------------------- - ''' - ''' Item in the optional date header column or row. - ''' Only used in the derived ScheduleGeneral control. - ''' - ''' ----------------------------------------------------------------------------- - DateHeader -End Enum - -Public Enum LayoutEnum - ''' ----------------------------------------------------------------------------- - ''' - ''' In Horizontal layout, the range values (times in ScheduleCalendar) are shown horizontally - ''' in the first row, and the titles (dates in ScheduleCalendar) are shown vertically in the first column. - ''' - ''' ----------------------------------------------------------------------------- - Horizontal = 0 - ''' ----------------------------------------------------------------------------- - ''' - ''' In Vertical layout, the range values (times in ScheduleCalendar) are shown vertically - ''' in the first column, and the titles (dates in ScheduleCalendar) are shown horizontally in the first row. - ''' - ''' ----------------------------------------------------------------------------- - Vertical -End Enum - -''' ----------------------------------------------------------------------------- -''' Project : schedule -''' Class : BaseSchedule -''' -''' ----------------------------------------------------------------------------- -''' -''' BaseSchedule is the base class for the ScheduleGeneral and ScheduleCalendar controls -''' -''' ----------------------------------------------------------------------------- -#If NET_2_0 = 1 Then - _ - Public MustInherit Class BaseSchedule - Inherits CompositeDataBoundControl -#Else ' .NET 1.x - _ -Public MustInherit Class BaseSchedule - Inherits WebControl - Implements INamingContainer -#End If - Implements IPostBackEventHandler - -#Region "Private and protected properties" -#If Not NET_2_0 = 1 Then - Private _dataSource As Object -#End If - Private _items As ScheduleItemCollection - Private _itemsArrayList As ArrayList - - Protected Table1 As Table - - Private _itemStyle As TableItemStyle - Private _alternatingItemStyle As TableItemStyle - Private _RangeHeaderStyle As TableItemStyle - Private _TitleStyle As TableItemStyle - Private _BackgroundStyle As TableItemStyle - - Private _emptySlotToolTip As String = "Click here to add data" - - ''' ----------------------------------------------------------------------------- - ''' - ''' list with values to be shown in row header - ''' - ''' ----------------------------------------------------------------------------- - Protected Property arrRangeValues() As ArrayList - Get - Return CType(ViewState("arrRangeValues"), ArrayList) - End Get - Set(ByVal value As ArrayList) - ViewState("arrRangeValues") = value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' Items is a collection object that contains the ScheduleItem objects - ''' - ''' ----------------------------------------------------------------------------- - Protected Overridable ReadOnly Property Items() As ScheduleItemCollection - Get - If _items Is Nothing Then - If _itemsArrayList Is Nothing Then - EnsureChildControls() - End If - _items = New ScheduleItemCollection(_itemsArrayList) - End If - Return _items - End Get - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' Whether to show the EmptyDataTemplate or not when no data is found - ''' - ''' - ''' Overridden in ScheduleCalendar when FullTimeScale=True - ''' - ''' ----------------------------------------------------------------------------- - Protected Overridable ReadOnly Property ShowEmptyDataTemplate() As Boolean - Get - Return True ' Overridden in ScheduleCalendar - End Get - End Property - -#End Region - -#Region "Public properties" - _ - Public Property Layout() As LayoutEnum - Get - Dim o As Object = ViewState("Layout") - If Not (o Is Nothing) Then - Return CType(o, LayoutEnum) - End If - Return LayoutEnum.Vertical - End Get - Set(ByVal Value As LayoutEnum) - ViewState("Layout") = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' If IncludeEndValue is true, the event is shown including the end row or column - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property IncludeEndValue() As Boolean - Get - Dim o As Object = ViewState("IncludeEndValue") - If Not (o Is Nothing) Then - Return CBool(o) - End If - Return False - End Get - Set(ByVal Value As Boolean) - ViewState("IncludeEndValue") = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' If ShowValueMarks is true, value marks will be shown in the range header column or row. - ''' Applied only when IncludeEndValue is false. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property ShowValueMarks() As Boolean - Get - Dim o As Object = ViewState("ShowValueMarks") - If Not (o Is Nothing) Then - Return CBool(o) - End If - Return False - End Get - Set(ByVal Value As Boolean) - ViewState("ShowValueMarks") = Value - End Set - End Property - -#If Not NET_2_0 = 1 Then - - ''' ----------------------------------------------------------------------------- - ''' - ''' The data source that is used to show items in the schedule - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property DataSource() As Object - Get - Return _dataSource - End Get - Set(ByVal Value As Object) - If ((Value Is Nothing) OrElse (TypeOf Value Is DataTable) OrElse (TypeOf Value Is DataSet) OrElse (TypeOf Value Is DataView)) Then - _dataSource = Value - Else - Throw New HttpException("The DataSource must be a DataTable, DataSet or DataView object") - End If - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The table or view used for binding when a DataSet is used as a data source. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property DataMember() As String - Get - Dim o As Object = ViewState("DataMember") - If Not (o Is Nothing) Then - Return CStr(o) - End If - Return String.Empty - End Get - Set(ByVal Value As String) - ViewState("DataMember") = Value - End Set - End Property -#End If - ''' ----------------------------------------------------------------------------- - ''' - ''' The database field containing the start of the items. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property DataRangeStartField() As String - Get - Dim o As Object = ViewState("DataRangeStartField") - If Not (o Is Nothing) Then Return CStr(o) - Return "" - End Get - Set(ByVal Value As String) - ViewState("DataRangeStartField") = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The database field containing the end of the items. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property DataRangeEndField() As String - Get - Dim o As Object = ViewState("DataRangeEndField") - If Not (o Is Nothing) Then Return CStr(o) - Return "" - End Get - Set(ByVal Value As String) - ViewState("DataRangeEndField") = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The database field providing the titles. - ''' In Calendar mode this field should be of type Date when TimeFieldsContainDate=false. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property TitleField() As String - Get - Dim o As Object = ViewState("TitleField") - If Not (o Is Nothing) Then Return CStr(o) - Return "" - End Get - Set(ByVal Value As String) - ViewState("TitleField") = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' An optional database field providing the item styles (in the form of a css class name). - ''' If not provided, then the ItemStyle property will be used for all items. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property ItemStyleField() As String - Get - Dim o As Object = ViewState("ItemStyleField") - If Not (o Is Nothing) Then Return CStr(o) - Return "" - End Get - Set(ByVal Value As String) - ViewState("ItemStyleField") = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' Boolean value indicating if a full time scale should be shown. - ''' If true, show a full time scale. - ''' If false, show only the occurring values in the data source. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property FullTimeScale() As Boolean - Get - Dim o As Object = ViewState("FullTimeScale") - If Not (o Is Nothing) Then Return CBool(o) - Return False - End Get - Set(ByVal Value As Boolean) - ViewState("FullTimeScale") = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The number of minutes between each mark on the time scale. Only used when FullTimeScale is true. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property TimeScaleInterval() As Integer - Get - Dim o As Object = ViewState("TimeScaleInterval") - If Not (o Is Nothing) Then Return CInt(o) - Return 60 - End Get - Set(ByVal Value As Integer) - If (Value = 0) Then - Throw New HttpException("TimeScaleInterval can not be 0") - End If - ViewState("TimeScaleInterval") = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The start of the time scale. Only used when FullTimeScale is true. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property StartOfTimeScale() As TimeSpan - Get - Dim o As Object = ViewState("StartOfTimeScale") - If Not (o Is Nothing) Then Return CType(o, TimeSpan) - If (FullTimeScale) Then Return New TimeSpan(0, 0, 0) ' = 0:00 - Return New TimeSpan(8, 0, 0) ' = 8:00 AM - End Get - Set(ByVal Value As TimeSpan) - If (Value.Days = 0) Then - ViewState("StartOfTimeScale") = Value - Else - Throw New HttpException("StartOfTimeScale should be between 0:00:00 and 23:59:00") - End If - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The end of the time scale. Only used when FullTimeScale is true. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property EndOfTimeScale() As TimeSpan - Get - Dim o As Object = ViewState("EndOfTimeScale") - If Not (o Is Nothing) Then Return CType(o, TimeSpan) - If (FullTimeScale) Then Return New TimeSpan(1, 0, 0, 0) ' = 24:00 - Return New TimeSpan(17, 0, 0) ' = 5:00 PM - End Get - Set(ByVal Value As TimeSpan) - If (Value.Days = 0 Or Value.Equals(New TimeSpan(1, 0, 0, 0))) Then - ViewState("EndOfTimeScale") = Value - Else - Throw New HttpException("EndOfTimeScale should be between 0:00:00 and 1.00:00:00 (24h)") - End If - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The cell padding of the rendered table. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Overridable Property CellPadding() As Integer - Get - If ControlStyleCreated = False Then Return -1 - Return CType(ControlStyle, TableStyle).CellPadding - End Get - Set(ByVal Value As Integer) - If (TypeOf ControlStyle Is TableStyle) Then - CType(ControlStyle, TableStyle).CellPadding = Value - End If - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The cell spacing of the rendered table. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Overridable Property CellSpacing() As Integer - Get - If ControlStyleCreated = False Then Return 1 - Return CType(ControlStyle, TableStyle).CellSpacing - End Get - Set(ByVal Value As Integer) - If (TypeOf ControlStyle Is TableStyle) Then - CType(ControlStyle, TableStyle).CellSpacing = Value - End If - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The grid lines to be shown in the rendered table. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Overridable Property GridLines() As GridLines - Get - If ControlStyleCreated = False Then Return GridLines.None - Return CType(ControlStyle, TableStyle).GridLines - End Get - Set(ByVal Value As GridLines) - If (TypeOf ControlStyle Is TableStyle) Then - CType(ControlStyle, TableStyle).GridLines = Value - End If - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The horizontal alignment of text in the table. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Overridable Property HorizontalAlign() As HorizontalAlign - Get - If ControlStyleCreated = False Then Return HorizontalAlign.NotSet - Return CType(ControlStyle, TableStyle).HorizontalAlign - End Get - Set(ByVal Value As HorizontalAlign) - If (TypeOf ControlStyle Is TableStyle) Then - CType(ControlStyle, TableStyle).HorizontalAlign = Value - End If - End Set - End Property - -#If NET_2_0 = 1 Then - ''' ----------------------------------------------------------------------------- - ''' - ''' Gets the data key value of the selected item in a Schedule control - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property SelectedValue() As Object - Get - Return ViewState("SelectedValue") - End Get - Set(ByVal value As Object) - ViewState("SelectedValue") = value - End Set - End Property - - _ - Public Property DataKeyNames() As String() - Get - Dim o As Object = ViewState("DataKeyNames") - If (o [IsNot] Nothing) Then Return CType(o, String()) - Dim emptyKeys(0) As String - Return emptyKeys - End Get - Set(ByVal value As String()) - ViewState("DataKeyNames") = value - 'RequiresDataBinding = True - End Set - End Property - -#End If - - ''' ----------------------------------------------------------------------------- - ''' - ''' When true, clicking on an empty slot in the control will raize the OnEmptySlotClick event. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property EnableEmptySlotClick() As Boolean - Get - Dim o As Object = ViewState("EnableEmptySlotClick") - If Not (o Is Nothing) Then Return CBool(o) - Return False - End Get - Set(ByVal value As Boolean) - ViewState("EnableEmptySlotClick") = value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' ToolTip on empty slots. Only shown when EmptySlotClickEnabled is true. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property EmptySlotToolTip() As String - Get - Return Me._emptySlotToolTip - End Get - Set(ByVal value As String) - Me._emptySlotToolTip = value - End Set - End Property - - Protected Overrides ReadOnly Property TagKey() As System.Web.UI.HtmlTextWriterTag - Get - Return HtmlTextWriterTag.Div - End Get - End Property - -#End Region - -#Region "Styles" - - ''' ----------------------------------------------------------------------------- - ''' - ''' The style applied to schedule items. - ''' - - _ - Public Overridable ReadOnly Property ItemStyle() As TableItemStyle - Get - If _itemStyle Is Nothing Then - _itemStyle = New TableItemStyle - If IsTrackingViewState Then - CType(_itemStyle, IStateManager).TrackViewState() - End If - End If - Return _itemStyle - End Get - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The style applied to alternating schedule items. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Overridable ReadOnly Property AlternatingItemStyle() As TableItemStyle - Get - If _alternatingItemStyle Is Nothing Then - _alternatingItemStyle = New TableItemStyle - If IsTrackingViewState Then - CType(_alternatingItemStyle, IStateManager).TrackViewState() - End If - End If - Return _alternatingItemStyle - End Get - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The style applied to range header items. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Overridable ReadOnly Property RangeHeaderStyle() As TableItemStyle - Get - If _RangeHeaderStyle Is Nothing Then - _RangeHeaderStyle = New TableItemStyle - If IsTrackingViewState Then - CType(_RangeHeaderStyle, IStateManager).TrackViewState() - End If - End If - Return _RangeHeaderStyle - End Get - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The style applied to title items. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Overridable ReadOnly Property TitleStyle() As TableItemStyle - Get - If _TitleStyle Is Nothing Then - _TitleStyle = New TableItemStyle - If IsTrackingViewState Then - CType(_TitleStyle, IStateManager).TrackViewState() - End If - End If - Return _TitleStyle - End Get - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The style applied to the background cells. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Overridable ReadOnly Property BackgroundStyle() As TableItemStyle - Get - If _BackgroundStyle Is Nothing Then - _BackgroundStyle = New TableItemStyle - If IsTrackingViewState Then - CType(_BackgroundStyle, IStateManager).TrackViewState() - End If - End If - Return _BackgroundStyle - End Get - End Property - -#End Region - -#Region "Templates" - - Private _itemTemplate As ITemplate = Nothing - - ''' ----------------------------------------------------------------------------- - ''' - ''' Main template providing content for each regular item in the body of the schedule. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property ItemTemplate() As ITemplate - Get - Return _itemTemplate - End Get - Set(ByVal Value As ITemplate) - _itemTemplate = Value -#If NET_2_0 Then - RequiresDataBinding = True -#End If - End Set - End Property - - Private _emptyDataTemplate As ITemplate = Nothing - - ''' ----------------------------------------------------------------------------- - ''' - ''' Optional template providing content to be shown when the data source is empty. - ''' This template is not used by the ScheduleCalendar control when FullTimeScale=True. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property EmptyDataTemplate() As ITemplate - Get - Return _emptyDataTemplate - End Get - Set(ByVal Value As ITemplate) - _emptyDataTemplate = Value -#If NET_2_0 Then - RequiresDataBinding = True -#End If - End Set - End Property -#End Region - -#Region "Events" - - Protected Overridable Sub OnItemCommand(ByVal e As ScheduleCommandEventArgs) - RaiseEvent ItemCommand(Me, e) - End Sub - - Protected Overridable Sub OnItemCreated(ByVal e As ScheduleItemEventArgs) - RaiseEvent ItemCreated(Me, e) - End Sub - - Protected Overridable Sub OnItemDataBound(ByVal e As ScheduleItemEventArgs) - RaiseEvent ItemDataBound(Me, e) - End Sub - -#If NET_2_0 = 1 Then - Protected Overridable Sub OnSelectedIndexChanged(ByVal e As EventArgs) - RaiseEvent SelectedIndexChanged(Me, e) - End Sub -#End If - - ''' ----------------------------------------------------------------------------- - ''' - ''' Raised when EnableEmptySlotClick is true and the user clicks on an empty slot. - ''' - ''' Event argument with information about the cell that was clicked - ''' ----------------------------------------------------------------------------- - Protected Overridable Sub OnEmptySlotClick(ByVal e As ClickableTableCellEventArgs) - RaiseEvent EmptySlotClick(Me, e) - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' Raised when a CommandEvent occurs within an item. - ''' - ''' - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Event ItemCommand As ScheduleCommandEventHandler - - ''' ----------------------------------------------------------------------------- - ''' - ''' Raised when an item is created and is ready for customization. - ''' - ''' - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Event ItemCreated As ScheduleItemEventHandler - - ''' ----------------------------------------------------------------------------- - ''' - ''' Raised when an item is data-bound. - ''' - ''' - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Event ItemDataBound As ScheduleItemEventHandler - -#If NET_2_0 = 1 Then - ''' ----------------------------------------------------------------------------- - ''' - ''' Occurs when the SelectedIndex property has changed. - ''' - ''' - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Event SelectedIndexChanged As EventHandler -#End If - - ''' ----------------------------------------------------------------------------- - ''' - ''' Occurs when the user clicks on an empty slot. - ''' - ''' - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Event EmptySlotClick As ClickableTableCellEventHandler - -#End Region - -#Region "Methods and Implementation" - - Protected Sub New() ' hide constructor in this abstract class - End Sub - -#If Not NET_2_0 = 1 Then - - Protected Overrides Sub CreateChildControls() - CheckVersion() - Controls.Clear() - If ((Not ViewState("RowCount") Is Nothing) Or (Not ViewState("Empty") Is Nothing)) Then - ' Create the control hierarchy using the view state, not the data source. - CreateControlHierarchy(False) - Else - _itemsArrayList = New ArrayList - ClearChildViewState() - End If - End Sub - -#Else - 'CreateChildControls without parameters is implemented by CompositeDataBoundControl - - Protected Overrides Function CreateChildControls(ByVal data As IEnumerable, ByVal dataBinding As Boolean) As Integer - CheckVersion() - - Controls.Clear() - If (dataBinding) Then - _itemsArrayList = New ArrayList - ClearChildViewState() - CreateControlHierarchy(data) - Else - ' Create the control hierarchy using the view state, not the data source. - CreateControlHierarchy(Nothing) - 'RequiresDataBinding = False - End If - Return _itemsArrayList.Count - - End Function -#End If - - ''' ----------------------------------------------------------------------------- - ''' - ''' Checks if the application is running on the proper version of ASP.NET. - ''' If not, an exception is thrown. - ''' - ''' ----------------------------------------------------------------------------- - Sub CheckVersion() -#If NET_2_0 = 1 Then - If Environment.Version.Major < 2 Then - Throw New HttpException("The Schedule controls require ASP.NET 2.0 or higher") - End If -#End If - End Sub - -#If Not NET_2_0 = 1 Then - - ''' ----------------------------------------------------------------------------- - ''' - ''' Overrides Control.Databind. - ''' - ''' ----------------------------------------------------------------------------- - Public Overrides Sub DataBind() - OnDataBinding(EventArgs.Empty) ' See BaseDatalist control in mono - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' Overrides Control.OnDatabinding. - ''' - ''' ----------------------------------------------------------------------------- - Protected Overrides Sub OnDataBinding(ByVal e As EventArgs) - MyBase.OnDataBinding(e) - If Not DataSource Is Nothing Then - Controls.Clear() ' clear any existing child controls - - ' clear any previous viewstate for existing child controls - ClearChildViewState() - CreateControlHierarchy(True) - - ' prevent child controls from being created again - ChildControlsCreated = True - TrackViewState() - End If - End Sub -#End If - -#If NET_2_0 Then - Sub CreateControlHierarchy(ByVal data As IEnumerable) -#Else - Sub CreateControlHierarchy(ByVal useDataSource As Boolean) -#End If - - If Not (_itemsArrayList Is Nothing) Then - _itemsArrayList.Clear() - _items = Nothing - Else - _itemsArrayList = New ArrayList - End If - -#If NET_2_0 Then - If Not IsNothing(data) Then -#Else - If useDataSource Then -#End If - Dim strCheckConfiguration As String = CheckConfiguration() - ' check if all the necessary properties are set - If (strCheckConfiguration <> "") Then - Throw New HttpException(strCheckConfiguration) - End If - -#If NET_2_0 Then - Dim dv As DataView = GetDataView(data) -#Else - Dim dv As DataView = GetDataView() -#End If - Controls.Clear() - If ((dv Is Nothing OrElse dv.Count = 0) And ShowEmptyDataTemplate) Then - RenderEmptyDataTemplate() - Return - End If - ' clear any existing child controls - Table1 = New Table - Controls.Add(Table1) - Table1.CopyBaseAttributes(Me) - If ControlStyleCreated Then Table1.ApplyStyle(ControlStyle) - - PreprocessData(dv) - - FillRangeValueArray(dv) - FillTitleValueArray(dv) - - CreateEmptyTable() - - AddRangeHeaderData() - AddTitleHeaderData() - - AddData(dv) - - If (Not IncludeEndValue And ShowValueMarks) Then AddRangeValueMarks() - - AddDateHeaderData() - - ' Save information for use in round trips (enough to re-create the control tree). - If (Not HttpContext.Current Is Nothing) Then - SaveControlTree() - End If - Else ' Not useDataSource - LoadControlTree() ' Recreate the control tree from viewstate - End If - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' Check if all properties are set to make the control work - ''' Override this function in derived versions. - ''' - ''' - ''' ----------------------------------------------------------------------------- - MustOverride Function CheckConfiguration() As String - - ''' ----------------------------------------------------------------------------- - ''' - ''' Create the list with all range header values (Start or End) - ''' - ''' - ''' ----------------------------------------------------------------------------- - MustOverride Sub FillRangeValueArray(ByRef dv As DataView) - - ''' ----------------------------------------------------------------------------- - ''' - ''' Remove any doubles from the ArrayList and - ''' - ''' The ArrayList object - ''' ----------------------------------------------------------------------------- - Shared Sub RemoveDoubles(ByRef arr As ArrayList) - Dim count As Integer = arr.Count - Dim i As Integer - For i = count - 1 To 1 Step -1 - If (arr(i).ToString() = arr(i - 1).ToString()) Then - arr.RemoveAt(i) - End If - Next i - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' Pre-process the data in the dataview - ''' Currently only used in ScheduleCalendar to split the items that span midnight - ''' - ''' The DataView object containing the data - ''' ----------------------------------------------------------------------------- - Overridable Sub PreprocessData(ByRef dv As DataView) - ' override to add usefull processing if any - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' Create the list with all the title values - ''' - ''' The DataView object containing the data - ''' ----------------------------------------------------------------------------- - Overridable Sub FillTitleValueArray(ByRef dvView As DataView) - ' Override in ScheduleGeneral to fill title array - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' Get the number of times the control should repeat the schedule - ''' (every time with new headers) - ''' - ''' An integer value indicating the repetition count - ''' - ''' Overridden in ScheduleCalendar to return NumberOfRepetitions (usually number of weeks) - ''' - ''' ----------------------------------------------------------------------------- - Overridable Function GetRepetitionCount() As Integer - Return 1 - End Function - - ''' ----------------------------------------------------------------------------- - ''' - ''' Create a Table control with the right number of rows and columns. - ''' The actual content is added later. - ''' - ''' ----------------------------------------------------------------------------- - Sub CreateEmptyTable() - Dim col, row, iWeek As Integer ' counters - - Dim nTitles As Integer = GetTitleCount() - - If (Layout = LayoutEnum.Vertical) Then - For iWeek = 1 To GetRepetitionCount() - ' Add a row of title header cells - Table1.Rows.Add(New TableRow) - Dim tr0 As TableRow = Table1.Rows(Table1.Rows.Count - 1) - For col = 1 To nTitles + 1 - tr0.Cells.Add(New TableHeaderCell) - tr0.Cells(tr0.Cells.Count - 1).ApplyStyle(TitleStyle) - tr0.Cells(tr0.Cells.Count - 1).Text = " " - Next col - - Dim nRows As Integer - If (Not IncludeEndValue And ShowValueMarks) Then - ' Create 2 rows for each value allowing for a value mark to be added in between - nRows = arrRangeValues.Count * 2 - Else - nRows = arrRangeValues.Count - End If - - For row = 1 To nRows - ' add a cell for the range header - Table1.Rows.Add(New TableRow) - Dim tr As TableRow = Table1.Rows(Table1.Rows.Count - 1) - ' add a cell for the header column - tr.Cells.Add(New TableHeaderCell) - Dim cell0 As TableCell = tr.Cells(tr.Cells.Count - 1) - cell0.ApplyStyle(RangeHeaderStyle) - cell0.Text = " " - - ' If no value marks are needed add cells to all the rows - ' Else show only the even rows and the first row - - If (IncludeEndValue Or Not ShowValueMarks Or row Mod 2 = 0 Or row = 1) Then - - ' add a cell for each normal column - For col = 1 To nTitles - If EnableEmptySlotClick And _ - (Not (ShowValueMarks And Not IncludeEndValue And _ - (row = 1 Or row = nRows))) Then - tr.Cells.Add(New ClickableTableCell(Table1.Rows.Count - 1, col)) - Else - tr.Cells.Add(New TableCell) - End If - Dim cell As TableCell = tr.Cells(tr.Cells.Count - 1) - cell.ApplyStyle(BackgroundStyle) - - If (Not IncludeEndValue And ShowValueMarks) Then - If (row > 1 And row < nRows) Then - ' the first and last row only have a span of 1 - cell.Text = " " - cell.RowSpan = 2 - End If - Else - cell.Text = " " - End If - Next col - End If - Next row - Next iWeek - Else ' Horizontal - Dim nColumnsForRangeHeaders As Integer = arrRangeValues.Count - If (Not IncludeEndValue And ShowValueMarks) Then - ' Create 2 columns for each value allowing for a value mark to be added in between - nColumnsForRangeHeaders = arrRangeValues.Count * 2 - End If - - ' In Horizontal layout, ignore repetition count: show 1 week only - ' Add range header cell - Table1.Rows.Add(New TableRow) - Dim tr0 As TableRow = Table1.Rows(0) - tr0.Cells.Add(New TableHeaderCell) - tr0.Cells(0).ApplyStyle(TitleStyle) - tr0.Cells(0).Text = " " - For col = 1 To nColumnsForRangeHeaders - tr0.Cells.Add(New TableHeaderCell) - Dim cell As TableCell = tr0.Cells(col) - cell.ApplyStyle(RangeHeaderStyle) - cell.Text = " " - Next col - - Dim nColumns As Integer = arrRangeValues.Count - If (Not IncludeEndValue And ShowValueMarks) Then - ' Extra column to allow the range headers to sit on the separation - ' When for example there are 4 values, we make 5 columns - ' 1 startcolumn, 3 columns sitting each between 2 values, and an end column - nColumns += 1 - End If - - For row = 1 To nTitles - Table1.Rows.Add(New TableRow) - Dim tr As TableRow = Table1.Rows(row) - ' add a cell for the title header - tr.Cells.Add(New TableHeaderCell) - tr.Cells(0).ApplyStyle(TitleStyle) - tr.Cells(0).Text = " " - - ' add a cell for each column - For col = 1 To nColumns - If EnableEmptySlotClick And _ - (Not (Not IncludeEndValue And ShowValueMarks And _ - (col = 1 Or col = nColumns))) Then - tr.Cells.Add(New ClickableTableCell(row, col)) - Else - tr.Cells.Add(New TableCell) - End If - Dim cell As TableCell = tr.Cells(col) - cell.ApplyStyle(BackgroundStyle) - cell.Text = " " - - If (Not IncludeEndValue And ShowValueMarks And col > 1 And col < nColumns) Then - ' the first and last column only have a span of 1 - cell.ColumnSpan = 2 - End If - Next col - Next row - End If - - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' Add date headers to the table when SeparateDateHeader=True - ''' Overridden only in ScheduleGeneral to add date header data - ''' - ''' ----------------------------------------------------------------------------- - Overridable Sub AddDateHeaderData() - ' Override in ScheduleGeneral to add date header data - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' Iterate the arrRangeValues array, creating a new header item for each data item - ''' - ''' ----------------------------------------------------------------------------- - Sub AddRangeHeaderData() - Dim cellsPerWeek As Integer = 1 + arrRangeValues.Count - If (Not IncludeEndValue And ShowValueMarks) Then - cellsPerWeek = 1 + arrRangeValues.Count * 2 - End If - - Dim j As Integer - For j = 0 To GetRepetitionCount() - 1 - Dim i As Integer - For i = 0 To arrRangeValues.Count - 1 - Dim obj As Object = arrRangeValues.Item(i) - - Dim rangeValueIndex As Integer = i + 1 + j * cellsPerWeek - If (Not IncludeEndValue And ShowValueMarks) Then - rangeValueIndex = i * 2 + 1 + j * cellsPerWeek - End If - - CreateItem(rangeValueIndex, 0, ScheduleItemType.RangeHeader, True, obj, -1) - Next i - Next j - End Sub - - MustOverride Sub AddTitleHeaderData() - - MustOverride Function GetSortOrder() As String - - ''' ----------------------------------------------------------------------------- - ''' - ''' Add the actual items from the data source to the body of the table - ''' - ''' The data view that contains the data items - ''' ----------------------------------------------------------------------------- - Sub AddData(ByVal dvView As DataView) - - If (ItemTemplate Is Nothing) Then - Throw New HttpException("The ItemTemplate is missing.") - End If - - If (dvView Is Nothing) Then Return - - Dim strSortOrder As String = GetSortOrder() - If (strSortOrder <> "") Then dvView.Sort = strSortOrder - - ' iterate DataSource creating a new item for each data item - Dim prevTitleIndex As Integer = -1 - Dim prevStartCellIndex As Integer = -1 - - Dim i As Integer - ' make sure the data is processed in the right order: from bottom right up to top left. - For i = dvView.Count - 1 To 0 Step -1 - - Dim drv As DataRowView = dvView.Item(i) - ' this dataRowView of data will be one entry in the schedule - - ' Let's find out where it should be displayed - ' Instead of column or row numbers, we use titleIndex and valueIndex - ' These can be used in the same way, whether layout is horizontal or vertical - ' titleIndex is the row number in Horizontal mode and the column number in vertical mode - ' valueIndex is the row number in Vertical mode and the column number in Horizontal mode - ' Both start at 0 - Dim objTitleField As Object = drv(GetTitleField()) - Dim titleIndex As Integer = CalculateTitleIndex(objTitleField) - If (titleIndex < 1) Then - Exit For ' since titleIndex is descending, and this one is too low already, skip all the rest too - End If - - Dim objStartValue As Object = drv(DataRangeStartField) - Dim objEndValue As Object = drv(DataRangeEndField) - Dim startCellIndex As Integer = CalculateRangeCellIndex(objStartValue, objTitleField, False) - Dim endCellIndex As Integer = CalculateRangeCellIndex(objEndValue, objTitleField, True) - If (startCellIndex > -1 And endCellIndex > -1) Then ' if not out of range - If (Not IncludeEndValue) Then endCellIndex = endCellIndex - 1 - Dim Span As Integer = endCellIndex - startCellIndex + 1 - If Span = 0 Then Span = 1 - - Dim maxStartCellIndex As Integer - If (Layout = LayoutEnum.Vertical) Then - maxStartCellIndex = Table1.Rows.Count - 1 - Else ' Horizontal - If (titleIndex >= Table1.Rows.Count) Then - ' make sure nothing is added in this case - maxStartCellIndex = -2 - Else - maxStartCellIndex = Table1.Rows(titleIndex).Cells.Count - 1 - End If - End If - If (startCellIndex > 0 AndAlso startCellIndex <= maxStartCellIndex) Then - - Dim cellIndex As Integer = startCellIndex - If (titleIndex = prevTitleIndex AndAlso startCellIndex + Span > prevStartCellIndex) Then - ' this cell is overlapping with the previous one (the one below or to the right) - ' prevStartValue is the starting cell index of the previous item - ' (in vertical layout the one below and in horizontal layout the one to the right) - ' this index is higher than this cell's index - ' (because the previous starting cell is under or to the right of this starting cell) - ' that's because we work from bottom right to top left - ' split the column or row that's overlapping so that we can show both contents - ' the last value to split is the end value of this item - SplitTitle(titleIndex, startCellIndex, endCellIndex) - End If - ' create new content - Dim type As ScheduleItemType = ScheduleItemType.Item - If (i Mod 2 = 1) Then type = ScheduleItemType.AlternatingItem - ' use the index in _itemsArrayList as dataSetIndex - If (Layout = LayoutEnum.Vertical OrElse _ - cellIndex <= Table1.Rows(titleIndex).Cells.Count - 1) Then - Dim Item As ScheduleItem = CreateItem(cellIndex, titleIndex, type, True, drv, _itemsArrayList.Count) - MergeCells(cellIndex, titleIndex, Span) - _itemsArrayList.Add(Item) - End If - ' save location for next item to compare with - prevTitleIndex = titleIndex - prevStartCellIndex = startCellIndex - End If - End If - Next i - - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' Add range value marks to indicate the range values - ''' - ''' ----------------------------------------------------------------------------- - Protected Sub AddRangeValueMarks() - If (Layout = LayoutEnum.Vertical) Then - ' Insert an extra column for range marks after the first column - - Dim rowsPerWeek As Integer = 1 + arrRangeValues.Count * 2 - Dim j As Integer - For j = 0 To GetRepetitionCount() - 1 - ' First insert a cell in the title row - Dim rangeValueIndex As Integer = j * rowsPerWeek - Table1.Rows(rangeValueIndex).Cells.AddAt(1, New TableHeaderCell) - Dim tc1 As TableCell = Table1.Rows(rangeValueIndex).Cells(1) - tc1.Text = " " - tc1.ApplyStyle(TitleStyle) - - Dim i As Integer - For i = 1 To rowsPerWeek - 1 - rangeValueIndex = i + j * rowsPerWeek - - Table1.Rows(rangeValueIndex).Cells.AddAt(1, New TableHeaderCell) - Dim tc As TableCell = Table1.Rows(rangeValueIndex).Cells(1) - tc.Text = " " - Dim tc0 As TableCell = Table1.Rows(rangeValueIndex).Cells(0) - Next i - For i = 1 To rowsPerWeek - 1 Step 2 - ' each rangeheader spans 2 rows (over the rangeheader mark) - ' merge these cells over 2 rows in the first column - rangeValueIndex = i + j * rowsPerWeek - MergeCells(rangeValueIndex, 0, 2) - Next i - Next j - Else ' Horizontal - Dim tr0 As TableRow = Table1.Rows(0) - ' Add new row for rangevalue marks - Table1.Rows.AddAt(1, New TableRow) - Dim tr1 As TableRow = Table1.Rows(1) - - ' title column - tr1.Cells.Add(New TableHeaderCell) - Dim tc1 As TableCell = tr1.Cells(0) - tc1.Text = " " - tc1.ApplyStyle(TitleStyle) - - Dim nColumns As Integer = arrRangeValues.Count * 2 + 1 - Dim i As Integer - For i = 1 To nColumns - 1 - Dim tc0 As TableCell = tr0.Cells(i) - tr1.Cells.Add(New TableHeaderCell) - Dim tc As TableCell = tr1.Cells(i) - tc.Text = " " - Next i - ' iterate the cells in reverse order for merging - For i = nColumns - 2 To 1 Step -2 - ' each rangeheader spans 2 rows (over the rangeheader mark) - ' merge these cells over 2 columns in the first column - MergeCells(i, 0, 2) - Next i - End If - End Sub - - Protected Overridable Function GetTitleField() As String - ' overridden in ScheduleCalendar - Return TitleField - End Function - - ''' ----------------------------------------------------------------------------- - ''' - ''' Calculate the range cell index in the table, given the objRangeValue and the objTitleValue - ''' The values refer to the real cell index in the table, taking into account whether cells are - ''' spanning over value marks (in horizontal mode) - ''' In vertical layout, the result is the real row index in the table - ''' In horizontal layout, the result is the real cell index in the row (before any merging - ''' of cells due to value spanning) - ''' - ''' The range value from the data source - ''' The title value from the data source - ''' False if we're calculating the range value index for the - ''' start of the item, True if it's the end - ''' The range cell index - ''' ----------------------------------------------------------------------------- - Protected MustOverride Function CalculateRangeCellIndex(ByVal objRangeValue As Object, ByVal objTitleValue As Object, _ - ByVal isEndValue As Boolean) As Integer - - ''' ----------------------------------------------------------------------------- - ''' - ''' Calculate the TitleIndex in the table, given the objTitleValue - ''' - ''' The title value from the data source - ''' The title index - ''' ----------------------------------------------------------------------------- - Protected MustOverride Function CalculateTitleIndex(ByVal objTitleValue As Object) As Integer - - ''' ----------------------------------------------------------------------------- - ''' - ''' Merge cells starting at startCellIndex - ''' - ''' Index of the first cell to merge. - ''' Row or column containing the adjacent cells. - ''' Number of columns or rows that the newly merged cell should span. - ''' The newly merged cell if successful. Nothing when merging fails. - ''' - ''' In horizontal layout, merging may start at 0 - ''' - ''' ----------------------------------------------------------------------------- - Function MergeCells(ByVal startCellIndex As Integer, ByVal titleIndex As Integer, ByVal span As Integer) As TableCell - If (titleIndex > GetTitleCount()) Then Return Nothing - - Dim minValueIndex As Integer = CInt(IIf(Layout = LayoutEnum.Horizontal, 0, 1)) - If (startCellIndex < minValueIndex) Then Return Nothing - If (span < 2) Then Return Nothing - - Dim maxValueIndex As Integer - If (Layout = LayoutEnum.Horizontal) Then - maxValueIndex = Table1.Rows(0).Cells.Count - 1 - Else ' Vertical - maxValueIndex = Table1.Rows.Count - 1 - End If - - If (startCellIndex > maxValueIndex) Then Return Nothing - - If (startCellIndex + span - 1 > maxValueIndex) Then - span = maxValueIndex - startCellIndex + 1 - End If - - Try - If (Not IncludeEndValue And ShowValueMarks And _ - Layout = LayoutEnum.Horizontal And titleIndex > 0) Then - ' in this case every item spans 2 columns - span = span * 2 - End If - - If (span <= GetValueSpan(startCellIndex, titleIndex)) Then Return Nothing - RemoveCells(startCellIndex, startCellIndex + span, titleIndex) - ' change span property to extend the cell - SetValueSpan(startCellIndex, titleIndex, span) - Return GetCell(startCellIndex, titleIndex) - Catch ex As Exception - If (Not HttpContext.Current Is Nothing) Then Context.Trace.Warn(ex.Message) - End Try - Return Nothing - End Function - - ''' ----------------------------------------------------------------------------- - ''' - ''' Removes all the cells from startValueIndex to endValueIndex, except the first cell - ''' - ''' Index of the first cell to remove. - ''' Index of the last cell to remove. - ''' Row or column containing the adjacent cells. - ''' ----------------------------------------------------------------------------- - Private Sub RemoveCells(ByVal startCellIndex As Integer, ByVal endCellIndex As Integer, ByVal titleIndex As Integer) - ' When cells are merged in HTML, it is done by increasing the span of the first cell, - ' and removing the other cells. - Dim prevSpan As Integer = GetValueSpan(startCellIndex, titleIndex) - - Dim valueCellIndex As Integer = startCellIndex + prevSpan - While valueCellIndex < endCellIndex - Dim nextCellIndex As Integer - If Layout = LayoutEnum.Vertical Then - nextCellIndex = valueCellIndex - Else - nextCellIndex = startCellIndex + 1 ' use +1, not +prevSpan - End If - prevSpan = GetValueSpan(nextCellIndex, titleIndex) - RemoveCell(nextCellIndex, titleIndex) - valueCellIndex += prevSpan - End While - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' Removes the cell at cellValueIndex - ''' - ''' Cell value index of the cell to be removed. - ''' Title index of the cell to be removed. - ''' ----------------------------------------------------------------------------- - Private Sub RemoveCell(ByVal cellValueIndex As Integer, ByVal titleIndex As Integer) - If Layout = LayoutEnum.Vertical Then - Table1.Rows(cellValueIndex).Cells.RemoveAt(titleIndex) - Else ' Horizontal - Table1.Rows(titleIndex).Cells.RemoveAt(cellValueIndex) - End If - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' in vertical layout, get the column span. In horizontal layout, get the row span - ''' - ''' Value index of the cell - ''' Title index of the cell - ''' Integer value indicating the span width - ''' ----------------------------------------------------------------------------- - Private Function GetSplitSpan(ByVal valueIndex As Integer, ByVal titleIndex As Integer) As Integer - If (Layout = LayoutEnum.Vertical) Then - GetSplitSpan = Table1.Rows(valueIndex).Cells(titleIndex).ColumnSpan - Else - GetSplitSpan = Table1.Rows(titleIndex).Cells(valueIndex).RowSpan - End If - If GetSplitSpan = 0 Then GetSplitSpan = 1 - End Function - - ''' ----------------------------------------------------------------------------- - ''' - ''' Check if the cells at titleIndex are already spanning over multiple rows or columns - ''' for the given range. The span must be the same over that range. - ''' - ''' Title index of the range - ''' - ''' - ''' True or false - ''' ----------------------------------------------------------------------------- - Private Function IsRangeAlreadySpanning(ByVal titleIndex As Integer, ByVal firstCellIndex As Integer, _ - ByVal lastCellIndex As Integer) As Boolean - Dim SplitSpan As Integer = GetSplitSpan(firstCellIndex, titleIndex) - If (SplitSpan = 1) Then Return False - If (Layout = LayoutEnum.Vertical) Then ' v1.6.0.4 bugfix - Dim row As Integer = firstCellIndex + GetValueSpan(firstCellIndex, titleIndex) - While row <= lastCellIndex - If (GetSplitSpan(row, titleIndex) <> SplitSpan) Then Return False - row = row + GetValueSpan(row, titleIndex) - End While - ' the last cell of the range must also end at startOfRange - ' if not, we can't split the range without adding a new column or row - If (row > lastCellIndex + 1) Then Return False - Else ' Horizontal - Dim cellIndex As Integer = firstCellIndex + 1 ' v1.6.0.3 bugfix - For cellIndex = firstCellIndex + 1 To lastCellIndex - If (GetSplitSpan(cellIndex, titleIndex) <> SplitSpan) Then Return False - Next - End If - Return True - End Function - - ''' ----------------------------------------------------------------------------- - ''' - ''' Split a column or row in 2 in order to allow the display of overlapping items. - ''' - ''' Title index of the cells to be split - ''' Index of the first cell in the range to split - ''' Index of the last cell in the range to split - ''' ----------------------------------------------------------------------------- - Private Sub SplitTitle(ByVal titleIndex As Integer, ByVal firstCellIndexToSplit As Integer, _ - ByVal lastCellIndexToSplit As Integer) - ' To show overlapping items, we simply split the entire column or row in 2, - ' except when it was already split before. - ' Only the overlapping items are actually shown in 2 columns or rows, the other items - ' are shown sitting on both columns or rows. - ' This works well only when there are not yet any split columns or rows to the left of or above this one - ' If we work from right to left and bottom to top, this should be OK - ' - ' Because of the way tables work in HTML, the approach is different for each layout. - ' In vertical layout, we'll split the column by adding cells in several rows. - ' In horizontal layout, we'll add a new row, and add several cells to it. - Dim cellsPerWeek As Integer = 1 + arrRangeValues.Count ' including one cell for title headers - - If (Not IncludeEndValue And ShowValueMarks) Then - If (Layout = LayoutEnum.Horizontal) Then - ' Extra column to allow the range headers to sit on the separation - ' When for example there are 4 values, we make 6 columns - ' 1 title column, 1 start column, 3 columns (each sitting between 2 values), - ' and an end column - cellsPerWeek = 2 + arrRangeValues.Count - Else - ' Each item takes 2 rows - cellsPerWeek = 1 + arrRangeValues.Count * 2 - End If - End If - - Dim firstCellIndexInThisWeek As Integer = (firstCellIndexToSplit \ cellsPerWeek) * cellsPerWeek - Dim lastCellIndexInThisWeek As Integer = firstCellIndexInThisWeek + cellsPerWeek - 1 - - Dim SplitEntireColumnOrRow As Boolean = Not IsRangeAlreadySpanning(titleIndex, firstCellIndexToSplit, lastCellIndexToSplit) - - Dim newRow As TableRow = Nothing ' only used in horizontal layout if SplitEntireColumnOrRow=True - If (SplitEntireColumnOrRow And Layout = LayoutEnum.Horizontal) Then - ' insert a new row - Table1.Rows.AddAt(titleIndex, New TableRow) - newRow = Table1.Rows(titleIndex) - titleIndex = titleIndex + 1 - End If - - If Layout = LayoutEnum.Vertical Then - ' in vertical layout, realCellIndex is the same as valueIndex - Dim row As Integer = firstCellIndexInThisWeek - While row <= lastCellIndexInThisWeek - ' first, get the span of the original cell - Dim originalCellSpan As Integer = GetValueSpan(row, titleIndex) - - If (row >= firstCellIndexToSplit AndAlso row <= lastCellIndexToSplit) Then - ' split the cell in this row by inserting a new cell - Dim ctc0 As New ClickableTableCell(row, titleIndex) - Table1.Rows(row).Cells.AddAt(titleIndex, ctc0) - Dim tc As TableCell = Table1.Rows(row).Cells(titleIndex) - tc.RowSpan = originalCellSpan - If (Not SplitEntireColumnOrRow) Then - ' no extra column was added, only an extra cell - ' therefore: reduce the columnspan of the original cell - Dim tcOriginal As TableCell = Table1.Rows(row).Cells(titleIndex + 1) - tc.ColumnSpan = tcOriginal.ColumnSpan - 1 - tcOriginal.ColumnSpan = 1 - Else ' SplitEntireColumnOrRow - If (row + originalCellSpan - 1 > lastCellIndexToSplit) Then - ' previous item went below this one, so split the remainder too - ' this is done by inserting another empty cell - tc.RowSpan = lastCellIndexToSplit - row + 1 - ' split the remainder as well - Dim ctc As New ClickableTableCell(lastCellIndexToSplit + 1, titleIndex) - Table1.Rows(lastCellIndexToSplit + 1).Cells.AddAt(titleIndex, ctc) - Dim tc2 As TableCell = Table1.Rows(lastCellIndexToSplit + 1).Cells(titleIndex) - tc2.ApplyStyle(BackgroundStyle) - tc2.Text = " " - tc2.RowSpan = row + originalCellSpan - 1 - lastCellIndexToSplit - End If - End If - Else ' this cell should not be split - If (SplitEntireColumnOrRow) Then - ' we have added an extra column, but this cell should not be split, - ' it should only be spread over the extra column - Dim tc As TableCell = Table1.Rows(row).Cells(titleIndex) - Dim ColumnSpan As Integer = tc.ColumnSpan - If ColumnSpan = 0 Then ColumnSpan = 1 - tc.ColumnSpan = ColumnSpan + 1 - End If - End If - row = row + originalCellSpan ' skip as many rows as this span - End While - Else ' Horizontal - ' in horizontal layout, valueIndex is still the index referring to the list of values - ' realCellIndex indicates the index (offset) of the cell in the TableRow - ' this is not the same, when a cell has a horizontal span of 2, the next cell will have - ' a realCellIndex that is 1 higher, but a valueIndex that is 2 higher. - Dim valueIndex As Integer = firstCellIndexInThisWeek - Dim realCellIndex As Integer = valueIndex - While valueIndex <= lastCellIndexInThisWeek - ' first, get the span of the original cell - Dim originalCellSpan As Integer = GetValueSpan(realCellIndex, titleIndex) - Dim originalValueSpan As Integer = originalCellSpan - If (Not IncludeEndValue And ShowValueMarks) Then - ' in this case a normal item already has a span of 2, but it's only 1 cell - originalValueSpan = originalCellSpan \ 2 - If (originalValueSpan = 0) Then originalValueSpan = 1 - End If - - If (valueIndex >= firstCellIndexToSplit AndAlso valueIndex <= lastCellIndexToSplit) Then - If (Not SplitEntireColumnOrRow) Then - ' the current cell is already spanning several rows - ' there is no need to add another row, just split the current cell - ' over the rows that it's already occupying. - Dim thisRow As TableRow = Table1.Rows(titleIndex) - Dim SplitSpan As Integer = thisRow.Cells(valueIndex).RowSpan - Dim lastRowInSpan As TableRow = Table1.Rows(titleIndex + SplitSpan - 1) - ' move the current cell down to the last row of the rows that are being spanned - ' it should become the first cell in that row - lastRowInSpan.Cells.AddAt(0, thisRow.Cells(realCellIndex)) - lastRowInSpan.Cells(0).RowSpan = 1 - ' add a new cell in this row - Dim ctc As New ClickableTableCell(titleIndex, valueIndex) - thisRow.Cells.AddAt(realCellIndex, ctc) - thisRow.Cells(realCellIndex).ColumnSpan = originalCellSpan - thisRow.Cells(realCellIndex).RowSpan = SplitSpan - 1 - Else ' SplitEntireColumnOrRow - ' split the cell in this column by inserting a new cell - Dim ctc0 As New ClickableTableCell(titleIndex - 1, valueIndex) - newRow.Cells.Add(ctc0) - Dim tc As TableCell = newRow.Cells(newRow.Cells.Count - 1) - tc.ColumnSpan = originalCellSpan - If (valueIndex + originalValueSpan - 1 > lastCellIndexToSplit) Then - ' previous item ended further to the right than this one, so split the remainder too - ' this is done by inserting another empty cell - Dim newValueSpan As Integer = lastCellIndexToSplit - valueIndex + 1 - If (Not IncludeEndValue And ShowValueMarks) Then - ' in this case a normal item has a span of 2 - newValueSpan *= 2 - End If - - tc.ColumnSpan = newValueSpan - ' split the remainder as well - Dim ctc As New ClickableTableCell(titleIndex - 1, valueIndex + originalValueSpan - 1) - newRow.Cells.Add(ctc) - Dim tc2 As TableCell = newRow.Cells(newRow.Cells.Count - 1) - Dim newValueSpan2 As Integer = valueIndex + originalValueSpan - 1 - lastCellIndexToSplit - If (Not IncludeEndValue And ShowValueMarks) Then - ' in this case a normal item has a span of 2 - newValueSpan2 *= 2 - End If - tc2.ColumnSpan = newValueSpan2 - tc2.ApplyStyle(BackgroundStyle) - tc2.Text = " " - End If - End If - Else ' this cell should not be split - If (SplitEntireColumnOrRow) Then - ' we have added an extra row, but this cell should not be split, - ' it should only be spread over the extra row - ' move this cell up one row to the new row, and spread it over more rows - newRow.Cells.Add(Table1.Rows(titleIndex).Cells(realCellIndex)) - realCellIndex = realCellIndex - 1 ' decrease cellindex, because one cell has been removed - ' the cell was moved, and it is currently the last cell of newRow - Dim tc2 As TableCell = newRow.Cells(newRow.Cells.Count - 1) - Dim RowSpan As Integer = tc2.RowSpan ' get its span - If RowSpan = 0 Then RowSpan = 1 - tc2.RowSpan = RowSpan + 1 ' increase it - End If - End If - valueIndex = valueIndex + originalValueSpan ' for the index, skip as many rows/columns as this span - realCellIndex = realCellIndex + 1 ' if horizontal, just take the next cell - End While - End If - - End Sub - -#If Not NET_2_0 = 1 Then - - ''' ----------------------------------------------------------------------------- - ''' - ''' Get the DataView from the DataSource and DataMember properties - ''' - ''' - ''' ----------------------------------------------------------------------------- - Function GetDataView() As DataView - GetDataView = Nothing - - If (Not Me.DataSource Is Nothing) Then - ' determine if the datasource is a DataSet, DataTable or DataView - If (TypeOf Me.DataSource Is DataView) Then - GetDataView = CType(Me.DataSource, DataView) - ElseIf (TypeOf Me.DataSource Is DataTable) Then - GetDataView = New DataView(CType(Me.DataSource, DataTable)) - ElseIf (TypeOf Me.DataSource Is DataSet) Then - Dim ds As DataSet = CType(Me.DataSource, DataSet) - If (Me.DataMember Is Nothing OrElse Me.DataMember = "") Then - ' if data member isn't supplied, default to the first table - GetDataView = New DataView(ds.Tables(0)) - Else - GetDataView = New DataView(ds.Tables(Me.DataMember)) ' if data member is supplied, use it - End If - End If - End If - ' throw an exception if there is a problem with the data source - If (GetDataView Is Nothing) Then - Throw New HttpException("Error finding the DataSource. " & _ - "Please check the DataSource and DataMember properties.") - End If - End Function - -#Else ' NET_2_0=1 - - ''' ----------------------------------------------------------------------------- - ''' - ''' Get the DataView from the DataSource and DataMember properties - ''' - ''' The DataView object - ''' ----------------------------------------------------------------------------- - Function GetDataView(ByVal data As IEnumerable) As DataView - GetDataView = Nothing - - Dim obj As Object = Nothing - ' Use a trick to get the dataview quickly: get it from the first item - For Each obj In data - Dim drv As DataRowView = CType(obj, DataRowView) - If (Not drv Is Nothing) Then - GetDataView = drv.DataView - Exit For - End If - Next - End Function - -#End If - - ' Override to get the corresponding templates - Protected MustOverride Function GetTemplate(ByVal type As ScheduleItemType) As ITemplate - - Protected Overridable Function GetStyle(ByVal type As ScheduleItemType) As TableItemStyle - ' Override to add additional styles (such as the style for DateHeaders in ScheduleGeneral) - GetStyle = Nothing - Select Case type - Case ScheduleItemType.RangeHeader - Return RangeHeaderStyle - Case ScheduleItemType.TitleHeader - Return TitleStyle - Case ScheduleItemType.Item - Return ItemStyle - Case ScheduleItemType.AlternatingItem - GetStyle = New TableItemStyle - If (Not _itemStyle Is Nothing) Then - GetStyle.MergeWith(ItemStyle) - End If - If (Not _alternatingItemStyle Is Nothing) Then - GetStyle.CopyFrom(AlternatingItemStyle) - End If - End Select - End Function - - ''' ----------------------------------------------------------------------------- - ''' - ''' Instantiate item using the corresponding template (if any) - ''' - ''' ScheduleItem to instantiate - ''' corresponding table cell - ''' ----------------------------------------------------------------------------- - Private Sub InstantiateItem(ByVal item As ScheduleItem, ByVal cell As TableCell) - Dim template As ITemplate = GetTemplate(item.ItemType) - If (Not template Is Nothing) Then - template.InstantiateIn(item) ' initialize item from template - Else - If (item.ItemType = ScheduleItemType.Item Or item.ItemType = ScheduleItemType.AlternatingItem) Then - ' this exception should never fire: another should already have fired in AddData() - Throw New HttpException("The ItemTemplate is missing") - End If - ' no template provided, just show data item - Dim value As Object = item.DataItem ' for header items, DataItem is just a String or a Date - Dim lit As New Literal - If (Not value Is Nothing) Then - lit.Text = FormatDataValue(value, item.ItemType) - Else - ' On postback, viewstate should keep the contents, but it fails to do so *** - ' The headers stay blank on postback if no template is provided. - ' For now, to make it work on postback too, make sure you provide all the templates - lit.Text = " " - End If - item.Controls.Add(lit) - End If - Dim myStyle As TableItemStyle = GetStyle(item.ItemType) - If (Not myStyle Is Nothing) Then cell.ApplyStyle(myStyle) - - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' when there's no template, try to present the data in a reasonable format - ''' - ''' Value of the item - ''' Type of the item - ''' A formatted string - ''' ----------------------------------------------------------------------------- - Protected MustOverride Function FormatDataValue(ByVal value As Object, ByVal type As ScheduleItemType) As String - - ''' - ''' Create the item - ''' - ''' Cell value index of the item - ''' Title index of the item - ''' Type of the item - ''' Whether databinding should be performed - ''' Data item of the item - ''' Index of the item in the dataset - ''' The newly created ScheduleItem - ''' ----------------------------------------------------------------------------- - Protected Function CreateItem(ByVal cellValueIndex As Integer, ByVal titleIndex As Integer, ByVal itemType As ScheduleItemType, _ - ByVal dataBind As Boolean, ByVal dataItem As Object, ByVal dataSetIndex As Integer) As ScheduleItem - - Dim item As New ScheduleItem(dataSetIndex, itemType) - If (dataBind) Then - item.DataItem = dataItem -#If NET_2_0 Then - If (itemType = ScheduleItemType.Item Or itemType = ScheduleItemType.AlternatingItem) Then - If (DataKeyNames(0) [IsNot] Nothing) Then - Dim dk As New DataKey(CreateItemDataKey(item), DataKeyNames) - item.DataKey = dk - End If - ' Don't allow the framework to attribute an automatic ID - ' It may not be the same after postback - ' which will prevent postback events from firing - item.ID = "item" & dataSetIndex - End If -#End If - End If - Dim cell As TableCell = GetCell(cellValueIndex, titleIndex) - InstantiateItem(item, cell) - - If (item.ItemType = ScheduleItemType.Item Or item.ItemType = ScheduleItemType.AlternatingItem) Then - If (ItemStyleField <> "" And Not IsNothing(dataItem)) Then - Dim drv As DataRowView = CType(dataItem, DataRowView) - Dim objItemStyle As Object = drv.Item(ItemStyleField) - If (Not IsDBNull(objItemStyle)) Then - Dim style As New TableItemStyle - style.CssClass = CStr(objItemStyle) - cell.ApplyStyle(style) - End If - End If - End If - - Dim e As New ScheduleItemEventArgs(item) - OnItemCreated(e) - GetCell(cellValueIndex, titleIndex).Controls.Add(item) - - If (dataBind) Then - item.DataBind() - OnItemDataBound(e) - 'item.DataItem = Nothing - End If - Return item - End Function - - Protected MustOverride Function GetTitleCount() As Integer - - Overridable Function GetRangeHeaderIndex() As Integer - ' overridden in ScheduleGeneral when using Date Headers - Return 0 - End Function - - Private Function GetMinTitleIndex() As Integer - If (Not IncludeEndValue And ShowValueMarks) Then - Return GetRangeHeaderIndex() + 2 - Else - Return GetRangeHeaderIndex() + 1 - End If - End Function - - Private Function GetMaxTitleIndex() As Integer - Return GetMinTitleIndex() + GetTitleCount() - 1 - End Function - - ''' ----------------------------------------------------------------------------- - ''' - ''' In vertical layout, get the row span. In horizontal layout, get the column span - ''' - ''' Cell value index of the item - ''' Title index of the item - ''' The integer value of the span - ''' ----------------------------------------------------------------------------- - Protected Function GetValueSpan(ByVal cellValueIndex As Integer, ByVal titleIndex As Integer) As Integer - If (Layout = LayoutEnum.Vertical) Then - GetValueSpan = Table1.Rows(cellValueIndex).Cells(titleIndex).RowSpan - Else - GetValueSpan = Table1.Rows(titleIndex).Cells(cellValueIndex).ColumnSpan - End If - If GetValueSpan = 0 Then GetValueSpan = 1 - End Function - - ''' ----------------------------------------------------------------------------- - ''' - ''' in vertical layout, set the row span. In horizontal layout, set the column span - ''' - ''' Cell value index of the item - ''' Title index of the item - ''' The new span value - ''' ----------------------------------------------------------------------------- - Private Sub SetValueSpan(ByVal cellValueIndex As Integer, ByVal titleIndex As Integer, ByVal span As Integer) - If (Layout = LayoutEnum.Vertical) Then - Table1.Rows(cellValueIndex).Cells(titleIndex).RowSpan = span - Else - Table1.Rows(titleIndex).Cells(cellValueIndex).ColumnSpan = span - End If - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' Get the cell at the given indexes. - ''' - ''' Cell value index of the item - ''' Title index of the item - ''' The TableCell object of the corresponding cell - ''' ----------------------------------------------------------------------------- - Private Function GetCell(ByVal cellValueIndex As Integer, ByVal titleIndex As Integer) As TableCell - If (Layout = LayoutEnum.Vertical) Then - GetCell = Table1.Rows(cellValueIndex).Cells(titleIndex) - Else - GetCell = Table1.Rows(titleIndex).Cells(cellValueIndex) - End If - End Function - -#If NET_2_0 = 1 Then - Private Function CreateItemDataKey(ByVal item As ScheduleItem) As IOrderedDictionary - If Me.DesignMode Then Return Nothing - If DataKeyNames.Length = 0 OrElse DataKeyNames(0) Is Nothing Then Return Nothing - If item.DataItem Is Nothing Then Return Nothing - Dim props As PropertyDescriptorCollection = TypeDescriptor.GetProperties(item.DataItem) - Dim cachedKeyProperties(DataKeyNames.Length - 1) As PropertyDescriptor - For n As Integer = 0 To DataKeyNames.Length - 1 - Dim p As PropertyDescriptor = props(DataKeyNames(n)) - If (p Is Nothing) Then - Throw New InvalidOperationException("Property '" & DataKeyNames(n) & _ - "' not found in object of type " & item.DataItem.GetType().ToString()) - End If - cachedKeyProperties(n) = p - Next - - Dim dic As New OrderedDictionary() - For Each p As PropertyDescriptor In cachedKeyProperties - dic(p.Name) = p.GetValue(item.DataItem) - Next p - Return dic - End Function -#End If - - ''' ----------------------------------------------------------------------------- - ''' - ''' Show the EmptyDataTemplate when the data source is empty - ''' - ''' ----------------------------------------------------------------------------- - Private Sub RenderEmptyDataTemplate() - If (Not EmptyDataTemplate Is Nothing) Then - Dim plh As New PlaceHolder - EmptyDataTemplate.InstantiateIn(plh) ' initialize from template - Controls.Add(plh) - ViewState("Empty") = True ' raize a flag - End If - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' Handle events raised by children by overriding OnBubbleEvent. - ''' - ''' the source of the event - ''' event data - ''' true if the event has been handled - ''' ----------------------------------------------------------------------------- - Protected Overrides Function OnBubbleEvent(ByVal source As Object, ByVal e As EventArgs) As Boolean - If TypeOf e Is ScheduleCommandEventArgs Then - Dim ce As ScheduleCommandEventArgs = CType(e, ScheduleCommandEventArgs) - OnItemCommand(ce) - Dim cmdName As String = ce.CommandName.ToLower() -#If NET_2_0 = 1 Then - If (cmdName = "select") Then - Try - SelectedValue = ce.Item.DataKey.Value - Catch ex As Exception - Throw New InvalidOperationException("Invalid DataKey. Check the DataKeyNames property") - End Try - OnSelectedIndexChanged(EventArgs.Empty) - End If -#End If - End If - Return True - End Function - - ''' ----------------------------------------------------------------------------- - ''' - ''' RaisePostBackEvent is called when the user clicks on an empty slot - ''' (see clickabletablecell.vb) - ''' - ''' String with the event argument. - ''' Contains something like "3-7", where 3 is the row and 7 the column - ''' ----------------------------------------------------------------------------- - Public Sub RaisePostBackEvent(ByVal eventArgument As String) _ - Implements System.Web.UI.IPostBackEventHandler.RaisePostBackEvent - ' get column and row number from eventArgument - Dim args() As String = eventArgument.Split("-"c) - Dim row As Integer = CInt(args(0)) - Dim column As Integer = CInt(args(1)) - Dim Title, RangeStartValue, RangeEndValue As Object - Dim RangeStartValueIndex As Integer = CalculateRangeValueIndex(row, column) - If (Layout = LayoutEnum.Horizontal) Then - Title = CalculateTitle(row, column) - Else - Title = CalculateTitle(column, row) - End If - RangeStartValue = arrRangeValues(RangeStartValueIndex) 'CalculateRangeValue(row - 1) - Dim RangeEndValueIndex As Integer = RangeStartValueIndex + 1 - If (RangeEndValueIndex >= arrRangeValues.Count) Then RangeEndValueIndex = arrRangeValues.Count - 1 - RangeEndValue = arrRangeValues(RangeEndValueIndex) 'CalculateRangeValue(endRow) - ' remove any selected value -#If NET_2_0 = 1 Then - Me.SelectedValue = Nothing -#End If - Dim ctcea As New ClickableTableCellEventArgs(Title, RangeStartValue, RangeEndValue) - OnEmptySlotClick(ctcea) - End Sub - - '''' ----------------------------------------------------------------------------- - '''' - '''' Calculate the title value given the cell index - '''' - '''' Title index of the cell - '''' Object containing the title - '''' ----------------------------------------------------------------------------- - Public MustOverride Function CalculateTitle(ByVal titleIndex As Integer, ByVal cellIndex As Integer) As Object - - ''' ----------------------------------------------------------------------------- - ''' - ''' Calculate the range value index given the cell index - ''' - ''' Row of the cell - ''' Column of the cell - ''' Integer containing the range value index - ''' ----------------------------------------------------------------------------- - Public Function CalculateRangeValueIndex(ByVal row As Integer, ByVal column As Integer) As Integer - If (Layout = LayoutEnum.Horizontal) Then - Return column - 1 - CInt(IIf(Not IncludeEndValue And ShowValueMarks, 1, 0)) - Else - Dim rowsPerWeek As Integer = CalculateRowsPerRepetition() - Dim RangeValueIndex As Integer - If (Not IncludeEndValue And ShowValueMarks) Then - RangeValueIndex = (row Mod rowsPerWeek) \ 2 - 1 - Else - RangeValueIndex = (row Mod rowsPerWeek) - 1 - End If - If (RangeValueIndex < 0) Then RangeValueIndex = 0 - Return RangeValueIndex - End If - End Function - - ''' ----------------------------------------------------------------------------- - ''' - ''' Calculate the number of rows per repetition - ''' - ''' Integer containing the number of rows - ''' ----------------------------------------------------------------------------- - Public Function CalculateRowsPerRepetition() As Integer - If (Not IncludeEndValue And ShowValueMarks) Then - CalculateRowsPerRepetition = arrRangeValues.Count * 2 + 1 - Else - CalculateRowsPerRepetition = arrRangeValues.Count + 1 - End If - End Function - - ''' ----------------------------------------------------------------------------- - ''' - ''' Save information for use in round trips (enough to re-create the control tree). - ''' - ''' ----------------------------------------------------------------------------- - Private Sub SaveControlTree() - If (Items.Count = 0) Then Return - Dim arrCellCount(Table1.Rows.Count) As Integer ' number of cells in each row - Dim arrHeaderCount(Table1.Rows.Count) As Integer ' number of header cells in each row - Dim arrItemCols(Items.Count) As Integer - Dim arrItemRows(Items.Count) As Integer -#If NET_2_0 = 1 Then - Dim arrDataKeys(Items.Count) As IOrderedDictionary -#End If - Dim nCells As Integer = Table1.Rows.Count * Table1.Rows(0).Cells.Count - If (Table1.Rows.Count > 0 AndAlso Table1.Rows(1).Cells.Count > Table1.Rows(0).Cells.Count) Then - nCells = Table1.Rows.Count * Table1.Rows(1).Cells.Count - End If - Dim arrClickRows(nCells) As Integer ' row of each clickable cell - Dim arrClickColumns(nCells) As Integer ' column of each clickable cell - - Dim row, col As Integer - Dim ClickableCellCount As Integer = 0 - For row = 0 To Table1.Rows.Count - 1 - Dim cellsInThisRow As Integer = Table1.Rows(row).Cells.Count - arrCellCount(row) = cellsInThisRow - For col = 0 To cellsInThisRow - 1 - If (TypeOf Table1.Rows(row).Cells(col) Is TableHeaderCell) Then - arrHeaderCount(row) = col + 1 ' will continue to increase until normal cells start - End If - If (EnableEmptySlotClick AndAlso _ - TypeOf Table1.Rows(row).Cells(col) Is ClickableTableCell) Then - Dim ccell As ClickableTableCell = CType(Table1.Rows(row).Cells(col), ClickableTableCell) - arrClickColumns(ClickableCellCount) = ccell.Column - arrClickRows(ClickableCellCount) = ccell.Row - ClickableCellCount += 1 - End If - Dim cell As TableCell = Table1.Rows(row).Cells(col) - If (cell.HasControls()) Then - If (TypeOf cell.Controls(0) Is ScheduleItem) Then - Dim item As ScheduleItem = CType(cell.Controls(0), ScheduleItem) - Dim dataSetIndex As Integer = item.DataSetIndex - If (dataSetIndex >= 0) Then ' body item - arrItemRows(dataSetIndex) = row - arrItemCols(dataSetIndex) = col -#If NET_2_0 = 1 Then - arrDataKeys(dataSetIndex) = CreateItemDataKey(item) -#End If - End If - End If - End If - Next col - Next row - ViewState("RowCount") = Table1.Rows.Count ' number of rows - ViewState("ItemCount") = Items.Count ' number of items in datasource - ViewState("arrCellCount") = arrCellCount ' number of cells in each row - ViewState("arrHeaderCount") = arrHeaderCount ' number of header cells in each row - ViewState("arrItemCols") = arrItemCols ' column index of each item - ViewState("arrItemRows") = arrItemRows ' row index of each item -#If NET_2_0 = 1 Then - ViewState("arrDataKeys") = arrDataKeys ' row index of each item -#End If - If (EnableEmptySlotClick) Then - ReDim Preserve arrClickRows(ClickableCellCount) ' reduce viewstate - ViewState("arrClickRows") = arrClickRows ' row of each clickable cell - ReDim Preserve arrClickColumns(ClickableCellCount) - ViewState("arrClickColumns") = arrClickColumns ' column of each clickable cell - End If - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' Recreate the control tree from viewstate - ''' - ''' ----------------------------------------------------------------------------- - Private Sub LoadControlTree() - Controls.Clear() - If (CBool(ViewState("Empty")) = True) Then - ' empty control: use EmptyDataTemplate - Dim plh As New PlaceHolder - EmptyDataTemplate.InstantiateIn(plh) - Controls.Add(plh) - Return - End If - ' When the control is empty, and EmptyDataTemplate does not exist: - If (ViewState("RowCount") Is Nothing) Then Return - Dim RowCount As Integer = CInt(ViewState("RowCount")) - Dim ItemCount As Integer = CInt(ViewState("ItemCount")) - Dim arrCellCount() As Integer = CType(ViewState("arrCellCount"), Integer()) ' number of cells in each row - Dim arrHeaderCount() As Integer = CType(ViewState("arrHeaderCount"), Integer()) ' number of row header cells in each row - Dim arrItemCols() As Integer = CType(ViewState("arrItemCols"), Integer()) ' column index of each data item - Dim arrItemRows() As Integer = CType(ViewState("arrItemRows"), Integer()) ' row index of each data item -#If NET_2_0 = 1 Then - Dim arrDataKeys() As IOrderedDictionary = CType(ViewState("arrDataKeys"), IOrderedDictionary()) ' row index of each data item -#End If - Dim arrClickRows() As Integer = Nothing - Dim arrClickColumns() As Integer = Nothing - If (EnableEmptySlotClick) Then - arrClickRows = CType(ViewState("arrClickRows"), Integer()) ' row of each clickable cell - arrClickColumns = CType(ViewState("arrClickColumns"), Integer()) ' column of each clickable cell - End If - ' clear any existing child controls - Table1 = New Table - Controls.Add(Table1) - - Dim week, row, col As Integer - Dim ClickableCellCount As Integer = 0 - Dim rowsPerRepetition As Integer = RowCount \ GetRepetitionCount() ' Only used in vertical layout - - ' first recreate the table - For row = 0 To RowCount - 1 - Table1.Rows.Add(New TableRow) - Dim tr As TableRow = Table1.Rows(Table1.Rows.Count - 1) - For col = 0 To arrCellCount(row) - 1 - If (col < arrHeaderCount(row)) Then - ' create row header cells for this week - tr.Cells.Add(New TableHeaderCell) - Else - If (EnableEmptySlotClick) Then - Dim isClickableCell As Boolean = True - If (ShowValueMarks And Not IncludeEndValue) Then - If (Layout = LayoutEnum.Horizontal And arrHeaderCount(row) > 0) Then - ' first and last columns should not be clickable - ' when the title is split over several rows, only check the first row - If (col = arrHeaderCount(row)) Then isClickableCell = False - If (col = arrCellCount(row) - 1) Then isClickableCell = False - Else ' Vertical - Dim rowInThisRepetition As Integer = row Mod rowsPerRepetition - If (rowInThisRepetition = 1) Then isClickableCell = False - If (rowInThisRepetition = rowsPerRepetition - 1) Then isClickableCell = False - End If - End If - If (isClickableCell) Then - ' col may differ from the real column because of cells - ' spanning several rows - ' We need the real column here for the EmptySlotClick to work - ' It's too complicated to calculate, therefore, we use ViewState - Dim fixedColumn As Integer = arrClickColumns(ClickableCellCount) - Dim fixedRow As Integer = arrClickRows(ClickableCellCount) - tr.Cells.Add(New ClickableTableCell(fixedRow, fixedColumn)) - ClickableCellCount += 1 - Else - tr.Cells.Add(New TableCell) - End If - Else - tr.Cells.Add(New TableCell) - End If - End If - Next col - Next row - - ' now add the items - ' it's imperative that we do it in the same order as before the postback - ' 1) RangeHeader items - ' 2) TitleHeader items - ' 3) Normal Items - ' 4) DateHeader items (if any) - ' - ' add RangeHeader items - If (Layout = LayoutEnum.Horizontal) Then - ' create range header items in the first or second row - Dim rangeHeaderRow As Integer = GetRangeHeaderIndex() - For col = 1 To arrCellCount(rangeHeaderRow) - 1 - CreateItem(col, rangeHeaderRow, ScheduleItemType.RangeHeader, False, Nothing, -1) - Next col - Else ' Layout = LayoutEnum.Vertical - For week = 0 To GetRepetitionCount() - 1 - ' create range header items of this repetition in the first or second column - Dim minRangeHeaderRow As Integer = week * rowsPerRepetition + 1 - Dim maxRangeHeaderRow As Integer = week * rowsPerRepetition + rowsPerRepetition - 1 - Dim iStep As Integer = CInt(IIf(Not IncludeEndValue And ShowValueMarks, 2, 1)) - - For row = minRangeHeaderRow To maxRangeHeaderRow Step iStep - col = arrHeaderCount(row) - 1 ' the range header column is the right-most column of the header columns - If (Not IncludeEndValue And ShowValueMarks) Then - ' in this case, the range header column is the 2nd to the right of the header columns - col = col - 1 - End If - - If (col >= 0) Then CreateItem(row, col, ScheduleItemType.RangeHeader, False, Nothing, -1) - Next row - Next week - End If - - ' add Title Header items - If (Layout = LayoutEnum.Vertical) Then - For col = GetMinTitleIndex() To arrCellCount(0) - 1 - For week = 0 To GetRepetitionCount() - 1 - ' create title header items in the first row of the week - Dim titleHeaderRow As Integer = week * rowsPerRepetition - CreateItem(titleHeaderRow, col, ScheduleItemType.TitleHeader, False, Nothing, -1) - Next week - Next col - Else ' Layout = LayoutEnum.Horizontal - ' create title header items in the first column - For row = GetMinTitleIndex() To RowCount - 1 - ' titles may be merged over rows. Only the first row of a title contains the item - ' So check if there is a title in this row - If (arrHeaderCount(row) = 1) Then CreateItem(0, row, ScheduleItemType.TitleHeader, False, Nothing, -1) - Next row - - End If - - ' add the (non-header) items - Dim i As Integer - For i = 0 To ItemCount - 1 - ' reconstruct the items - row = arrItemRows(i) - col = arrItemCols(i) - Dim item As ScheduleItem - If (i Mod 2 = 1) Then - If (Layout = LayoutEnum.Vertical) Then - item = CreateItem(row, col, ScheduleItemType.AlternatingItem, False, Nothing, -1) - Else - item = CreateItem(col, row, ScheduleItemType.AlternatingItem, False, Nothing, -1) - End If - Else - If (Layout = LayoutEnum.Vertical) Then - item = CreateItem(row, col, ScheduleItemType.Item, False, Nothing, -1) - Else - item = CreateItem(col, row, ScheduleItemType.Item, False, Nothing, -1) - End If - End If -#If NET_2_0 = 1 Then - item.DataKey = New DataKey(arrDataKeys(i), DataKeyNames) - ' set the same ID as before the postback - item.ID = "item" & i -#End If - Next i - - If (GetRangeHeaderIndex() = 1) Then - ' add DateHeader items - If (Layout = LayoutEnum.Horizontal) Then - ' first row is the date header row - For col = 1 To arrCellCount(0) - 1 - CreateItem(col, 0, ScheduleItemType.RangeHeader, False, Nothing, -1) - Next col - Else ' Layout = LayoutEnum.Vertical - For week = 0 To GetRepetitionCount() - 1 - ' create date header items in the first column - Dim minDateHeaderRow As Integer = week * rowsPerRepetition + 1 - Dim maxDateHeaderRow As Integer = week * rowsPerRepetition + rowsPerRepetition - 1 - For row = minDateHeaderRow To maxDateHeaderRow - ' date headers may be merged over columns. - ' Only the first column of a date header contains the item - ' So check if there is a title in this column - Dim headersInDateHeaderRow As Integer = 2 - If (Not IncludeEndValue And ShowValueMarks) Then - headersInDateHeaderRow = 3 - End If - - If arrHeaderCount(row) = headersInDateHeaderRow Then - ' first column contains a date header - CreateItem(row, 0, ScheduleItemType.RangeHeader, False, Nothing, -1) - End If - Next row - Next - End If - End If - - End Sub - - Protected Overrides Function CreateControlStyle() As Style - ' Since the Schedule control renders an HTML table, - ' an instance of the TableStyle class is used as the control style. - Dim mystyle As New TableStyle(ViewState) - ' Set up default initial state. - 'mystyle.CellSpacing = 0 - mystyle.CellPadding = -1 - mystyle.GridLines = System.Web.UI.WebControls.GridLines.None - Return mystyle - End Function - -#If Not NET_2_0 = 1 Then - ''' ----------------------------------------------------------------------------- - ''' - ''' Customized state management to handle saving state of contained objects. - ''' - ''' - ''' ----------------------------------------------------------------------------- - Protected Overrides Sub LoadViewState(ByVal savedState As Object) - If Not (savedState Is Nothing) Then - Dim myState As Object() = CType(savedState, Object()) - - If Not (myState(0) Is Nothing) Then - MyBase.LoadViewState(myState(0)) - End If - If Not (myState(1) Is Nothing) Then - CType(ItemStyle, IStateManager).LoadViewState(myState(1)) - End If - If Not (myState(2) Is Nothing) Then - CType(AlternatingItemStyle, IStateManager).LoadViewState(myState(2)) - End If - If Not (myState(3) Is Nothing) Then - CType(RangeHeaderStyle, IStateManager).LoadViewState(myState(3)) - End If - If Not (myState(4) Is Nothing) Then - CType(TitleStyle, IStateManager).LoadViewState(myState(4)) - End If - If Not (myState(5) Is Nothing) Then - CType(BackgroundStyle, IStateManager).LoadViewState(myState(5)) - End If - End If - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' Customize state management to handle saving state of contained objects such as styles. - ''' - ''' - ''' ----------------------------------------------------------------------------- - Protected Overrides Function SaveViewState() As Object - Dim baseState As Object = MyBase.SaveViewState() - Dim itemStyleState As Object - Dim alternatingItemStyleState As Object - Dim RangeHeaderStyleState As Object - Dim TitleStyleState As Object - Dim BackgroundStyleState As Object - - If Not (_itemStyle Is Nothing) Then - itemStyleState = CType(_itemStyle, IStateManager).SaveViewState() - Else - itemStyleState = Nothing - End If - If Not (_alternatingItemStyle Is Nothing) Then - alternatingItemStyleState = CType(_alternatingItemStyle, IStateManager).SaveViewState() - Else - alternatingItemStyleState = Nothing - End If - If Not (_RangeHeaderStyle Is Nothing) Then - RangeHeaderStyleState = CType(_RangeHeaderStyle, IStateManager).SaveViewState() - Else - RangeHeaderStyleState = Nothing - End If - If Not (_TitleStyle Is Nothing) Then - TitleStyleState = CType(_TitleStyle, IStateManager).SaveViewState() - Else - TitleStyleState = Nothing - End If - If Not (_BackgroundStyle Is Nothing) Then - BackgroundStyleState = CType(_BackgroundStyle, IStateManager).SaveViewState() - Else - BackgroundStyleState = Nothing - End If - - Dim myState(6) As Object - myState(0) = baseState - myState(1) = itemStyleState - myState(2) = alternatingItemStyleState - myState(3) = RangeHeaderStyleState - myState(4) = TitleStyleState - myState(5) = BackgroundStyleState - Return myState - End Function - - ''' ----------------------------------------------------------------------------- - ''' - ''' Customize state management to handle saving state of contained objects such as styles. - ''' - ''' ----------------------------------------------------------------------------- - Protected Overrides Sub TrackViewState() - MyBase.TrackViewState() - - If Not (_itemStyle Is Nothing) Then - CType(_itemStyle, IStateManager).TrackViewState() - End If - If Not (_alternatingItemStyle Is Nothing) Then - CType(_alternatingItemStyle, IStateManager).TrackViewState() - End If - If Not (_RangeHeaderStyle Is Nothing) Then - CType(_RangeHeaderStyle, IStateManager).TrackViewState() - End If - If Not (_TitleStyle Is Nothing) Then - CType(_TitleStyle, IStateManager).TrackViewState() - End If - If Not (_BackgroundStyle Is Nothing) Then - CType(_BackgroundStyle, IStateManager).TrackViewState() - End If - End Sub -#End If - -#End Region - -End Class \ No newline at end of file diff --git a/Controls/DotNetNuke.Events.ScheduleControl/calendarpropertybuilder.cs b/Controls/DotNetNuke.Events.ScheduleControl/calendarpropertybuilder.cs new file mode 100644 index 0000000..0f3d8a6 --- /dev/null +++ b/Controls/DotNetNuke.Events.ScheduleControl/calendarpropertybuilder.cs @@ -0,0 +1,638 @@ +// VBConversions Note: VB project level imports +using System; +using System.Diagnostics; +using System.Data; +using Microsoft.VisualBasic; +using System.Collections; +using System.Management; +using System.Linq; +// End of VB project level imports + +using DotNetNuke.Modules.Events.ScheduleControl; + +namespace DotNetNuke.Modules.Events.ScheduleControl +{ + // + // DotNetNuke® - http://www.dnnsoftware.com + // Copyright (c) 2002-2013 + // by DNNCorp + // + // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + // documentation files (the "Software"), to deal in the Software without restriction, including without limitation + // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and + // to permit persons to whom the Software is furnished to do so, subject to the following conditions: + // + // The above copyright notice and this permission notice shall be included in all copies or substantial portions + // of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED + // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + // DEALINGS IN THE SOFTWARE. + // + + /// ----------------------------------------------------------------------------- + /// Project : schedule + /// Class : CalendarPropertyBuilder + /// + /// ----------------------------------------------------------------------------- + /// + /// CalendarPropertyBuilder provides an easy interface to set all the properties + /// for the ScheduleCalendar control. + /// + /// ----------------------------------------------------------------------------- + public class CalendarPropertyBuilder : System.Windows.Forms.Form + { + +#region Windows Form Designer generated code + + public CalendarPropertyBuilder() + { + + //This call is required by the Windows Form Designer. + InitializeComponent(); + + //Add any initialization after the InitializeComponent() call + + } + + //Form overrides dispose to clean up the component list. + protected override void Dispose(bool disposing) + { + if (disposing) + { + if (!(ReferenceEquals(components, null))) + { + components.Dispose(); + } + } + base.Dispose(disposing); + } + + //Required by the Windows Form Designer + private System.ComponentModel.Container components = null; + + //NOTE: The following procedure is required by the Windows Form Designer + //It can be modified using the Windows Form Designer. + //Do not modify it using the code editor. + internal System.Windows.Forms.Button btnOK; + internal System.Windows.Forms.Button btnCancel; + internal System.Windows.Forms.Label Label1; + internal System.Windows.Forms.TextBox tbDateField; + internal System.Windows.Forms.TextBox tbStartTimeField; + internal System.Windows.Forms.Label Label2; + internal System.Windows.Forms.TextBox tbEndTimeField; + internal System.Windows.Forms.Label Label3; + internal System.Windows.Forms.CheckBox cbIncludeEndValue; + internal System.Windows.Forms.Label Label5; + internal System.Windows.Forms.Label Label6; + internal System.Windows.Forms.TextBox tbTimeFormatString; + internal System.Windows.Forms.TextBox tbDateFormatString; + internal System.Windows.Forms.CheckBox cbTimeFieldsContainDate; + internal System.Windows.Forms.TextBox tbNumberOfRepetitions; + internal System.Windows.Forms.Label Label9; + internal System.Windows.Forms.GroupBox GroupBox1; + internal System.Windows.Forms.GroupBox GroupBox2; + internal System.Windows.Forms.CheckBox cbFullTimeScale; + internal System.Windows.Forms.TextBox tbStartTimeScale; + internal System.Windows.Forms.Label Label4; + internal System.Windows.Forms.TextBox tbEndTimeScale; + internal System.Windows.Forms.Label Label7; + internal System.Windows.Forms.TextBox tbInterval; + internal System.Windows.Forms.Label Label8; + internal System.Windows.Forms.Label Label10; + internal System.Windows.Forms.GroupBox GroupBox3; + internal System.Windows.Forms.RadioButton rbHorizontal; + internal System.Windows.Forms.RadioButton rbVertical; + internal System.Windows.Forms.ToolTip ToolTip1; + internal System.Windows.Forms.Label Label11; + internal System.Windows.Forms.CheckBox cbShowValueMarks; + internal System.Windows.Forms.TextBox tbNumberOfDays; + internal System.Windows.Forms.Label Label12; + internal System.Windows.Forms.Label Label13; + internal System.Windows.Forms.ComboBox cbStartDay; + private System.Windows.Forms.GroupBox groupBox4; + internal System.Windows.Forms.Label label14; + internal System.Windows.Forms.TextBox tbEmptySlotToolTip; + internal System.Windows.Forms.CheckBox cbEnableEmptySlotClick; + internal System.Windows.Forms.TextBox tbItemStyleField; + [System.Diagnostics.DebuggerStepThrough()]private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.btnOK = new System.Windows.Forms.Button(); + this.btnOK.Click += new System.EventHandler(this.btnOK_Click); + this.btnCancel = new System.Windows.Forms.Button(); + this.Label1 = new System.Windows.Forms.Label(); + this.tbDateField = new System.Windows.Forms.TextBox(); + this.tbStartTimeField = new System.Windows.Forms.TextBox(); + this.Label2 = new System.Windows.Forms.Label(); + this.tbEndTimeField = new System.Windows.Forms.TextBox(); + this.Label3 = new System.Windows.Forms.Label(); + this.cbIncludeEndValue = new System.Windows.Forms.CheckBox(); + this.cbTimeFieldsContainDate = new System.Windows.Forms.CheckBox(); + this.cbTimeFieldsContainDate.CheckedChanged += new System.EventHandler(this.cbTimeFieldsContainDate_CheckedChanged); + this.tbNumberOfRepetitions = new System.Windows.Forms.TextBox(); + this.Label9 = new System.Windows.Forms.Label(); + this.tbTimeFormatString = new System.Windows.Forms.TextBox(); + this.Label5 = new System.Windows.Forms.Label(); + this.tbDateFormatString = new System.Windows.Forms.TextBox(); + this.Label6 = new System.Windows.Forms.Label(); + this.GroupBox1 = new System.Windows.Forms.GroupBox(); + this.Label11 = new System.Windows.Forms.Label(); + this.tbItemStyleField = new System.Windows.Forms.TextBox(); + this.GroupBox2 = new System.Windows.Forms.GroupBox(); + this.Label10 = new System.Windows.Forms.Label(); + this.tbInterval = new System.Windows.Forms.TextBox(); + this.Label8 = new System.Windows.Forms.Label(); + this.tbEndTimeScale = new System.Windows.Forms.TextBox(); + this.Label7 = new System.Windows.Forms.Label(); + this.tbStartTimeScale = new System.Windows.Forms.TextBox(); + this.Label4 = new System.Windows.Forms.Label(); + this.cbFullTimeScale = new System.Windows.Forms.CheckBox(); + this.cbFullTimeScale.CheckedChanged += new System.EventHandler(this.cbFullTimeScale_CheckedChanged); + this.GroupBox3 = new System.Windows.Forms.GroupBox(); + this.rbVertical = new System.Windows.Forms.RadioButton(); + this.rbHorizontal = new System.Windows.Forms.RadioButton(); + this.rbHorizontal.CheckedChanged += new System.EventHandler(this.rbHorizontal_CheckedChanged); + this.cbShowValueMarks = new System.Windows.Forms.CheckBox(); + this.cbShowValueMarks.CheckedChanged += new System.EventHandler(this.cbShowValueMarks_CheckedChanged); + this.ToolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.tbNumberOfDays = new System.Windows.Forms.TextBox(); + this.tbNumberOfDays.TextChanged += new System.EventHandler(this.tbNumberOfDays_TextChanged); + this.cbStartDay = new System.Windows.Forms.ComboBox(); + this.cbEnableEmptySlotClick = new System.Windows.Forms.CheckBox(); + this.cbEnableEmptySlotClick.CheckedChanged += new System.EventHandler(this.cbEnableEmptySlotClick_CheckedChanged); + this.Label12 = new System.Windows.Forms.Label(); + this.Label13 = new System.Windows.Forms.Label(); + this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.label14 = new System.Windows.Forms.Label(); + this.tbEmptySlotToolTip = new System.Windows.Forms.TextBox(); + this.GroupBox1.SuspendLayout(); + this.GroupBox2.SuspendLayout(); + this.GroupBox3.SuspendLayout(); + this.groupBox4.SuspendLayout(); + this.SuspendLayout(); + // + //btnOK + // + this.btnOK.Location = new System.Drawing.Point(260, 492); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(60, 23); + this.btnOK.TabIndex = 5; + this.btnOK.Text = "OK"; + // + //btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(324, 492); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(60, 23); + this.btnCancel.TabIndex = 6; + this.btnCancel.Text = "Cancel"; + // + //Label1 + // + this.Label1.Location = new System.Drawing.Point(12, 56); + this.Label1.Name = "Label1"; + this.Label1.Size = new System.Drawing.Size(64, 16); + this.Label1.TabIndex = 0; + this.Label1.Text = "Date field:"; + // + //tbDateField + // + this.tbDateField.Location = new System.Drawing.Point(12, 72); + this.tbDateField.Name = "tbDateField"; + this.tbDateField.Size = new System.Drawing.Size(168, 20); + this.tbDateField.TabIndex = 1; + this.ToolTip1.SetToolTip(this.tbDateField, "The database field providing the dates. Ignored when TimeFieldsContainDate=true. " + + "When TimeFieldsContainDate=false, this field should be of type Date."); + // + //tbStartTimeField + // + this.tbStartTimeField.Location = new System.Drawing.Point(12, 116); + this.tbStartTimeField.Name = "tbStartTimeField"; + this.tbStartTimeField.Size = new System.Drawing.Size(168, 20); + this.tbStartTimeField.TabIndex = 5; + this.ToolTip1.SetToolTip(this.tbStartTimeField, "The database field containing the start time of the events. This field should als" + + "o contain the date when TimeFieldsContainDate=true"); + // + //Label2 + // + this.Label2.Location = new System.Drawing.Point(12, 100); + this.Label2.Name = "Label2"; + this.Label2.Size = new System.Drawing.Size(84, 16); + this.Label2.TabIndex = 4; + this.Label2.Text = "Start time field:"; + // + //tbEndTimeField + // + this.tbEndTimeField.Location = new System.Drawing.Point(12, 160); + this.tbEndTimeField.Name = "tbEndTimeField"; + this.tbEndTimeField.Size = new System.Drawing.Size(168, 20); + this.tbEndTimeField.TabIndex = 9; + this.ToolTip1.SetToolTip(this.tbEndTimeField, "The database field containing the end time of the events. This field should also " + + "contain the date when TimeFieldsContainDate=true"); + // + //Label3 + // + this.Label3.Location = new System.Drawing.Point(12, 144); + this.Label3.Name = "Label3"; + this.Label3.Size = new System.Drawing.Size(84, 12); + this.Label3.TabIndex = 8; + this.Label3.Text = "End time field:"; + // + //cbIncludeEndValue + // + this.cbIncludeEndValue.Location = new System.Drawing.Point(268, 279); + this.cbIncludeEndValue.Name = "cbIncludeEndValue"; + this.cbIncludeEndValue.Size = new System.Drawing.Size(116, 24); + this.cbIncludeEndValue.TabIndex = 2; + this.cbIncludeEndValue.Text = "Include end value"; + this.ToolTip1.SetToolTip(this.cbIncludeEndValue, "If true, the event is shown including the end row or column"); + // + //cbTimeFieldsContainDate + // + this.cbTimeFieldsContainDate.Location = new System.Drawing.Point(16, 24); + this.cbTimeFieldsContainDate.Name = "cbTimeFieldsContainDate"; + this.cbTimeFieldsContainDate.Size = new System.Drawing.Size(164, 24); + this.cbTimeFieldsContainDate.TabIndex = 13; + this.cbTimeFieldsContainDate.Text = "Time fields contain date"; + this.ToolTip1.SetToolTip(this.cbTimeFieldsContainDate, "Indicates whether the time fields (StartTimeField and EndTimeField) contain the d" + + "ate as well. When true, this allows midnight spanning for calendar events. When " + + "false, the DateField contains the date."); + // + //tbNumberOfRepetitions + // + this.tbNumberOfRepetitions.Location = new System.Drawing.Point(340, 253); + this.tbNumberOfRepetitions.Name = "tbNumberOfRepetitions"; + this.tbNumberOfRepetitions.Size = new System.Drawing.Size(44, 20); + this.tbNumberOfRepetitions.TabIndex = 1; + this.ToolTip1.SetToolTip(this.tbNumberOfRepetitions, "The NumberOfRepetitions to show at a time. Only used in Vertical layout."); + // + //Label9 + // + this.Label9.Location = new System.Drawing.Point(203, 255); + this.Label9.Name = "Label9"; + this.Label9.Size = new System.Drawing.Size(131, 16); + this.Label9.TabIndex = 1; + this.Label9.Text = "Number of repetitions:"; + this.Label9.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + //tbTimeFormatString + // + this.tbTimeFormatString.Location = new System.Drawing.Point(192, 116); + this.tbTimeFormatString.Name = "tbTimeFormatString"; + this.tbTimeFormatString.Size = new System.Drawing.Size(168, 20); + this.tbTimeFormatString.TabIndex = 7; + this.ToolTip1.SetToolTip(this.tbTimeFormatString, "The format used for the times if the TimeTemplate is missing, e.g. {0:hh:mm}"); + // + //Label5 + // + this.Label5.Location = new System.Drawing.Point(192, 100); + this.Label5.Name = "Label5"; + this.Label5.Size = new System.Drawing.Size(120, 16); + this.Label5.TabIndex = 6; + this.Label5.Text = "Time format string:"; + // + //tbDateFormatString + // + this.tbDateFormatString.Location = new System.Drawing.Point(192, 72); + this.tbDateFormatString.Name = "tbDateFormatString"; + this.tbDateFormatString.Size = new System.Drawing.Size(168, 20); + this.tbDateFormatString.TabIndex = 3; + this.ToolTip1.SetToolTip(this.tbDateFormatString, "The format used for the date if the DateTemplate is missing, e.g. {0:ddd d}"); + // + //Label6 + // + this.Label6.Location = new System.Drawing.Point(192, 56); + this.Label6.Name = "Label6"; + this.Label6.Size = new System.Drawing.Size(120, 16); + this.Label6.TabIndex = 2; + this.Label6.Text = "Date format string:"; + // + //GroupBox1 + // + this.GroupBox1.Controls.Add(this.Label11); + this.GroupBox1.Controls.Add(this.tbItemStyleField); + this.GroupBox1.Controls.Add(this.Label1); + this.GroupBox1.Controls.Add(this.tbDateField); + this.GroupBox1.Controls.Add(this.tbDateFormatString); + this.GroupBox1.Controls.Add(this.Label6); + this.GroupBox1.Controls.Add(this.Label3); + this.GroupBox1.Controls.Add(this.tbStartTimeField); + this.GroupBox1.Controls.Add(this.tbTimeFormatString); + this.GroupBox1.Controls.Add(this.Label5); + this.GroupBox1.Controls.Add(this.Label2); + this.GroupBox1.Controls.Add(this.tbEndTimeField); + this.GroupBox1.Controls.Add(this.cbTimeFieldsContainDate); + this.GroupBox1.Location = new System.Drawing.Point(8, 12); + this.GroupBox1.Name = "GroupBox1"; + this.GroupBox1.Size = new System.Drawing.Size(376, 232); + this.GroupBox1.TabIndex = 0; + this.GroupBox1.TabStop = false; + this.GroupBox1.Text = "Data source fields"; + // + //Label11 + // + this.Label11.Location = new System.Drawing.Point(12, 188); + this.Label11.Name = "Label11"; + this.Label11.Size = new System.Drawing.Size(84, 12); + this.Label11.TabIndex = 14; + this.Label11.Text = "Item style field:"; + // + //tbItemStyleField + // + this.tbItemStyleField.Location = new System.Drawing.Point(12, 204); + this.tbItemStyleField.Name = "tbItemStyleField"; + this.tbItemStyleField.Size = new System.Drawing.Size(168, 20); + this.tbItemStyleField.TabIndex = 15; + this.ToolTip1.SetToolTip(this.tbItemStyleField, "An optional database field providing the item styles (in the form of a css class " + + "name)"); + // + //GroupBox2 + // + this.GroupBox2.Controls.Add(this.Label10); + this.GroupBox2.Controls.Add(this.tbInterval); + this.GroupBox2.Controls.Add(this.Label8); + this.GroupBox2.Controls.Add(this.tbEndTimeScale); + this.GroupBox2.Controls.Add(this.Label7); + this.GroupBox2.Controls.Add(this.tbStartTimeScale); + this.GroupBox2.Controls.Add(this.Label4); + this.GroupBox2.Controls.Add(this.cbFullTimeScale); + this.GroupBox2.Location = new System.Drawing.Point(8, 353); + this.GroupBox2.Name = "GroupBox2"; + this.GroupBox2.Size = new System.Drawing.Size(376, 84); + this.GroupBox2.TabIndex = 4; + this.GroupBox2.TabStop = false; + this.GroupBox2.Text = "Full time scale"; + // + //Label10 + // + this.Label10.Location = new System.Drawing.Point(328, 56); + this.Label10.Name = "Label10"; + this.Label10.Size = new System.Drawing.Size(24, 16); + this.Label10.TabIndex = 7; + this.Label10.Text = "min."; + // + //tbInterval + // + this.tbInterval.Location = new System.Drawing.Point(284, 52); + this.tbInterval.Name = "tbInterval"; + this.tbInterval.Size = new System.Drawing.Size(40, 20); + this.tbInterval.TabIndex = 6; + this.ToolTip1.SetToolTip(this.tbInterval, "The number of minutes between each mark on the time scale. Only used when FullTim" + + "eScale is true."); + // + //Label8 + // + this.Label8.Location = new System.Drawing.Point(232, 56); + this.Label8.Name = "Label8"; + this.Label8.Size = new System.Drawing.Size(48, 16); + this.Label8.TabIndex = 5; + this.Label8.Text = "Interval:"; + // + //tbEndTimeScale + // + this.tbEndTimeScale.Location = new System.Drawing.Point(160, 52); + this.tbEndTimeScale.Name = "tbEndTimeScale"; + this.tbEndTimeScale.Size = new System.Drawing.Size(60, 20); + this.tbEndTimeScale.TabIndex = 4; + this.ToolTip1.SetToolTip(this.tbEndTimeScale, "The end of the time scale. Only used when FullTimeScale is true."); + // + //Label7 + // + this.Label7.Location = new System.Drawing.Point(124, 56); + this.Label7.Name = "Label7"; + this.Label7.Size = new System.Drawing.Size(32, 16); + this.Label7.TabIndex = 3; + this.Label7.Text = "End:"; + // + //tbStartTimeScale + // + this.tbStartTimeScale.Location = new System.Drawing.Point(52, 52); + this.tbStartTimeScale.Name = "tbStartTimeScale"; + this.tbStartTimeScale.Size = new System.Drawing.Size(60, 20); + this.tbStartTimeScale.TabIndex = 2; + this.ToolTip1.SetToolTip(this.tbStartTimeScale, "The start of the time scale. Only used when FullTimeScale is true."); + // + //Label4 + // + this.Label4.Location = new System.Drawing.Point(12, 56); + this.Label4.Name = "Label4"; + this.Label4.Size = new System.Drawing.Size(36, 16); + this.Label4.TabIndex = 1; + this.Label4.Text = "Start:"; + // + //cbFullTimeScale + // + this.cbFullTimeScale.Location = new System.Drawing.Point(12, 24); + this.cbFullTimeScale.Name = "cbFullTimeScale"; + this.cbFullTimeScale.Size = new System.Drawing.Size(148, 24); + this.cbFullTimeScale.TabIndex = 0; + this.cbFullTimeScale.Text = "Use full time scale"; + this.ToolTip1.SetToolTip(this.cbFullTimeScale, "If true, show a full time scale. If false, show only the occurring values in the " + + "data source."); + // + //GroupBox3 + // + this.GroupBox3.Controls.Add(this.rbVertical); + this.GroupBox3.Controls.Add(this.rbHorizontal); + this.GroupBox3.Controls.Add(this.cbShowValueMarks); + this.GroupBox3.Location = new System.Drawing.Point(8, 309); + this.GroupBox3.Name = "GroupBox3"; + this.GroupBox3.Size = new System.Drawing.Size(376, 40); + this.GroupBox3.TabIndex = 3; + this.GroupBox3.TabStop = false; + this.GroupBox3.Text = "Layout"; + // + //rbVertical + // + this.rbVertical.Location = new System.Drawing.Point(96, 16); + this.rbVertical.Name = "rbVertical"; + this.rbVertical.Size = new System.Drawing.Size(68, 20); + this.rbVertical.TabIndex = 1; + this.rbVertical.Text = "Vertical"; + this.ToolTip1.SetToolTip(this.rbVertical, "The direction in which the item ranges are shown."); + // + //rbHorizontal + // + this.rbHorizontal.Location = new System.Drawing.Point(16, 16); + this.rbHorizontal.Name = "rbHorizontal"; + this.rbHorizontal.Size = new System.Drawing.Size(76, 20); + this.rbHorizontal.TabIndex = 0; + this.rbHorizontal.Text = "Horizontal"; + this.ToolTip1.SetToolTip(this.rbHorizontal, "The direction in which the item ranges are shown."); + // + //cbShowValueMarks + // + this.cbShowValueMarks.Location = new System.Drawing.Point(254, 15); + this.cbShowValueMarks.Name = "cbShowValueMarks"; + this.cbShowValueMarks.Size = new System.Drawing.Size(116, 24); + this.cbShowValueMarks.TabIndex = 7; + this.cbShowValueMarks.Text = "Show value marks"; + this.ToolTip1.SetToolTip(this.cbShowValueMarks, "If true, lines will be added to mark range values."); + // + //tbNumberOfDays + // + this.tbNumberOfDays.Location = new System.Drawing.Point(122, 251); + this.tbNumberOfDays.Name = "tbNumberOfDays"; + this.tbNumberOfDays.Size = new System.Drawing.Size(45, 20); + this.tbNumberOfDays.TabIndex = 8; + this.ToolTip1.SetToolTip(this.tbNumberOfDays, "The number of days to show in one repetition"); + // + //cbStartDay + // + this.cbStartDay.Items.AddRange(new object[] {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}); + this.cbStartDay.Location = new System.Drawing.Point(69, 278); + this.cbStartDay.Name = "cbStartDay"; + this.cbStartDay.Size = new System.Drawing.Size(121, 21); + this.cbStartDay.TabIndex = 11; + this.ToolTip1.SetToolTip(this.cbStartDay, "Day of the week to start the calendar with. Only used when Number of days equals " + + "7."); + // + //cbEnableEmptySlotClick + // + this.cbEnableEmptySlotClick.Location = new System.Drawing.Point(13, 19); + this.cbEnableEmptySlotClick.Name = "cbEnableEmptySlotClick"; + this.cbEnableEmptySlotClick.Size = new System.Drawing.Size(94, 17); + this.cbEnableEmptySlotClick.TabIndex = 0; + this.cbEnableEmptySlotClick.Text = "Enable clicking"; + this.ToolTip1.SetToolTip(this.cbEnableEmptySlotClick, "When checked, clicking an empty slot in the calendar will raize the EmptySlotClic" + + "ked event"); + // + //Label12 + // + this.Label12.Location = new System.Drawing.Point(9, 254); + this.Label12.Name = "Label12"; + this.Label12.Size = new System.Drawing.Size(107, 20); + this.Label12.TabIndex = 9; + this.Label12.Text = "Number of days:"; + this.Label12.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + //Label13 + // + this.Label13.Location = new System.Drawing.Point(9, 279); + this.Label13.Name = "Label13"; + this.Label13.Size = new System.Drawing.Size(54, 20); + this.Label13.TabIndex = 10; + this.Label13.Text = "Start on:"; + this.Label13.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + //groupBox4 + // + this.groupBox4.Controls.Add(this.label14); + this.groupBox4.Controls.Add(this.tbEmptySlotToolTip); + this.groupBox4.Controls.Add(this.cbEnableEmptySlotClick); + this.groupBox4.Location = new System.Drawing.Point(8, 441); + this.groupBox4.Name = "groupBox4"; + this.groupBox4.Size = new System.Drawing.Size(376, 45); + this.groupBox4.TabIndex = 8; + this.groupBox4.TabStop = false; + this.groupBox4.Text = "Empty slots"; + // + //label14 + // + this.label14.Location = new System.Drawing.Point(124, 20); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(42, 16); + this.label14.TabIndex = 6; + this.label14.Text = "Tooltip:"; + // + //tbEmptySlotToolTip + // + this.tbEmptySlotToolTip.Location = new System.Drawing.Point(172, 16); + this.tbEmptySlotToolTip.Name = "tbEmptySlotToolTip"; + this.tbEmptySlotToolTip.Size = new System.Drawing.Size(198, 20); + this.tbEmptySlotToolTip.TabIndex = 1; + // + //CalendarPropertyBuilder + // + this.AcceptButton = this.btnOK; + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(394, 520); + this.ControlBox = false; + this.Controls.Add(this.groupBox4); + this.Controls.Add(this.cbStartDay); + this.Controls.Add(this.Label13); + this.Controls.Add(this.Label12); + this.Controls.Add(this.tbNumberOfDays); + this.Controls.Add(this.GroupBox3); + this.Controls.Add(this.GroupBox2); + this.Controls.Add(this.GroupBox1); + this.Controls.Add(this.tbNumberOfRepetitions); + this.Controls.Add(this.cbIncludeEndValue); + this.Controls.Add(this.Label9); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnOK); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.Name = "CalendarPropertyBuilder"; + this.Text = "Properties"; + this.GroupBox1.ResumeLayout(false); + this.GroupBox1.PerformLayout(); + this.GroupBox2.ResumeLayout(false); + this.GroupBox2.PerformLayout(); + this.GroupBox3.ResumeLayout(false); + this.groupBox4.ResumeLayout(false); + this.groupBox4.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + +#endregion + + private void btnOK_Click(System.Object sender, System.EventArgs e) + { + this.DialogResult = System.Windows.Forms.DialogResult.OK; + Close(); + } + + private void cbFullTimeScale_CheckedChanged(System.Object sender, System.EventArgs e) + { + tbStartTimeScale.Enabled = cbFullTimeScale.Checked; + tbEndTimeScale.Enabled = cbFullTimeScale.Checked; + tbInterval.Enabled = cbFullTimeScale.Checked; + } + + private void cbTimeFieldsContainDate_CheckedChanged(System.Object sender, System.EventArgs e) + { + tbDateField.Enabled = !cbTimeFieldsContainDate.Checked; + } + + private void rbHorizontal_CheckedChanged(System.Object sender, System.EventArgs e) + { + if (rbHorizontal.Checked) + { + tbNumberOfRepetitions.Text = "1"; + tbNumberOfRepetitions.Enabled = false; + } + else + { + tbNumberOfRepetitions.Enabled = true; + } + } + + private void cbShowValueMarks_CheckedChanged(System.Object sender, System.EventArgs e) + { + if (cbShowValueMarks.Checked) + { + cbIncludeEndValue.Checked = false; + } + } + + private void tbNumberOfDays_TextChanged(System.Object sender, System.EventArgs e) + { + cbStartDay.Enabled = tbNumberOfDays.Text == "7"; // startday is only used on weekly calendar + } + + private void cbEnableEmptySlotClick_CheckedChanged(System.Object sender, System.EventArgs e) + { + this.tbEmptySlotToolTip.Enabled = this.cbEnableEmptySlotClick.Checked; + } + } + + +} diff --git a/Controls/DotNetNuke.Events.ScheduleControl/calendarpropertybuilder.resx b/Controls/DotNetNuke.Events.ScheduleControl/calendarpropertybuilder.resx index e43a876..13795a7 100644 --- a/Controls/DotNetNuke.Events.ScheduleControl/calendarpropertybuilder.resx +++ b/Controls/DotNetNuke.Events.ScheduleControl/calendarpropertybuilder.resx @@ -1,4 +1,4 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - \ No newline at end of file diff --git a/Controls/DotNetNuke.Events.ScheduleControl/generalpropertybuilder.vb b/Controls/DotNetNuke.Events.ScheduleControl/generalpropertybuilder.vb deleted file mode 100644 index 260d9fe..0000000 --- a/Controls/DotNetNuke.Events.ScheduleControl/generalpropertybuilder.vb +++ /dev/null @@ -1,546 +0,0 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2007 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - -''' ----------------------------------------------------------------------------- -''' Project : schedule -''' Class : GeneralPropertyBuilder -''' -''' ----------------------------------------------------------------------------- -''' -''' GeneralPropertyBuilder provides an easy interface to set all the properties -''' for the GeneralCalendar control. -''' -''' ----------------------------------------------------------------------------- - Public Class GeneralPropertyBuilder - Inherits System.Windows.Forms.Form - -#Region " Windows Form Designer generated code " - - Public Sub New() - MyBase.New() - - 'This call is required by the Windows Form Designer. - InitializeComponent() - - 'Add any initialization after the InitializeComponent() call - - End Sub - - 'Form overrides dispose to clean up the component list. - Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) - If disposing Then - If Not (components Is Nothing) Then - components.Dispose() - End If - End If - MyBase.Dispose(disposing) - End Sub - - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer - - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - Friend WithEvents btnOK As System.Windows.Forms.Button - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents Label1 As System.Windows.Forms.Label - Friend WithEvents Label2 As System.Windows.Forms.Label - Friend WithEvents Label3 As System.Windows.Forms.Label - Friend WithEvents cbIncludeEndValue As System.Windows.Forms.CheckBox - Friend WithEvents Label5 As System.Windows.Forms.Label - Friend WithEvents Label6 As System.Windows.Forms.Label - Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox - Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox - Friend WithEvents cbFullTimeScale As System.Windows.Forms.CheckBox - Friend WithEvents tbStartTimeScale As System.Windows.Forms.TextBox - Friend WithEvents Label4 As System.Windows.Forms.Label - Friend WithEvents tbEndTimeScale As System.Windows.Forms.TextBox - Friend WithEvents Label7 As System.Windows.Forms.Label - Friend WithEvents tbInterval As System.Windows.Forms.TextBox - Friend WithEvents Label8 As System.Windows.Forms.Label - Friend WithEvents Label10 As System.Windows.Forms.Label - Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox - Friend WithEvents rbHorizontal As System.Windows.Forms.RadioButton - Friend WithEvents rbVertical As System.Windows.Forms.RadioButton - Friend WithEvents Label9 As System.Windows.Forms.Label - Friend WithEvents tbTitleField As System.Windows.Forms.TextBox - Friend WithEvents cbSeparateDateHeader As System.Windows.Forms.CheckBox - Friend WithEvents tbTitleFormatString As System.Windows.Forms.TextBox - Friend WithEvents tbDataRangeStartField As System.Windows.Forms.TextBox - Friend WithEvents tbDataRangeEndField As System.Windows.Forms.TextBox - Friend WithEvents tbRangeDataFormatString As System.Windows.Forms.TextBox - Friend WithEvents tbDateHeaderFormatString As System.Windows.Forms.TextBox - Friend WithEvents ToolTip1 As System.Windows.Forms.ToolTip - Friend WithEvents Label11 As System.Windows.Forms.Label - Friend WithEvents cbShowValueMarks As System.Windows.Forms.CheckBox - Friend WithEvents cbAutoSortTitles As System.Windows.Forms.CheckBox - Friend WithEvents groupBox4 As System.Windows.Forms.GroupBox - Friend WithEvents label14 As System.Windows.Forms.Label - Friend WithEvents tbEmptySlotToolTip As System.Windows.Forms.TextBox - Friend WithEvents cbEnableEmptySlotClick As System.Windows.Forms.CheckBox - Friend WithEvents tbItemStyleField As System.Windows.Forms.TextBox - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Me.btnOK = New System.Windows.Forms.Button - Me.btnCancel = New System.Windows.Forms.Button - Me.Label1 = New System.Windows.Forms.Label - Me.tbTitleField = New System.Windows.Forms.TextBox - Me.tbDataRangeStartField = New System.Windows.Forms.TextBox - Me.Label2 = New System.Windows.Forms.Label - Me.tbDataRangeEndField = New System.Windows.Forms.TextBox - Me.Label3 = New System.Windows.Forms.Label - Me.cbIncludeEndValue = New System.Windows.Forms.CheckBox - Me.cbSeparateDateHeader = New System.Windows.Forms.CheckBox - Me.tbRangeDataFormatString = New System.Windows.Forms.TextBox - Me.Label5 = New System.Windows.Forms.Label - Me.tbTitleFormatString = New System.Windows.Forms.TextBox - Me.Label6 = New System.Windows.Forms.Label - Me.GroupBox1 = New System.Windows.Forms.GroupBox - Me.cbAutoSortTitles = New System.Windows.Forms.CheckBox - Me.Label11 = New System.Windows.Forms.Label - Me.tbItemStyleField = New System.Windows.Forms.TextBox - Me.tbDateHeaderFormatString = New System.Windows.Forms.TextBox - Me.Label9 = New System.Windows.Forms.Label - Me.GroupBox2 = New System.Windows.Forms.GroupBox - Me.Label10 = New System.Windows.Forms.Label - Me.tbInterval = New System.Windows.Forms.TextBox - Me.Label8 = New System.Windows.Forms.Label - Me.tbEndTimeScale = New System.Windows.Forms.TextBox - Me.Label7 = New System.Windows.Forms.Label - Me.tbStartTimeScale = New System.Windows.Forms.TextBox - Me.Label4 = New System.Windows.Forms.Label - Me.cbFullTimeScale = New System.Windows.Forms.CheckBox - Me.GroupBox3 = New System.Windows.Forms.GroupBox - Me.cbShowValueMarks = New System.Windows.Forms.CheckBox - Me.rbVertical = New System.Windows.Forms.RadioButton - Me.rbHorizontal = New System.Windows.Forms.RadioButton - Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components) - Me.cbEnableEmptySlotClick = New System.Windows.Forms.CheckBox - Me.groupBox4 = New System.Windows.Forms.GroupBox - Me.label14 = New System.Windows.Forms.Label - Me.tbEmptySlotToolTip = New System.Windows.Forms.TextBox - Me.GroupBox1.SuspendLayout() - Me.GroupBox2.SuspendLayout() - Me.GroupBox3.SuspendLayout() - Me.groupBox4.SuspendLayout() - Me.SuspendLayout() - ' - 'btnOK - ' - Me.btnOK.Location = New System.Drawing.Point(260, 464) - Me.btnOK.Name = "btnOK" - Me.btnOK.Size = New System.Drawing.Size(60, 23) - Me.btnOK.TabIndex = 4 - Me.btnOK.Text = "OK" - ' - 'btnCancel - ' - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(324, 464) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(60, 23) - Me.btnCancel.TabIndex = 5 - Me.btnCancel.Text = "Cancel" - ' - 'Label1 - ' - Me.Label1.Location = New System.Drawing.Point(12, 56) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(64, 16) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Title field:" - ' - 'tbTitleField - ' - Me.tbTitleField.Location = New System.Drawing.Point(12, 72) - Me.tbTitleField.Name = "tbTitleField" - Me.tbTitleField.Size = New System.Drawing.Size(168, 20) - Me.tbTitleField.TabIndex = 1 - Me.ToolTip1.SetToolTip(Me.tbTitleField, "The database field providing the titles. In Calendar mode this field should be of" & _ - " type Date when ") - ' - 'tbDataRangeStartField - ' - Me.tbDataRangeStartField.Location = New System.Drawing.Point(12, 116) - Me.tbDataRangeStartField.Name = "tbDataRangeStartField" - Me.tbDataRangeStartField.Size = New System.Drawing.Size(168, 20) - Me.tbDataRangeStartField.TabIndex = 5 - Me.ToolTip1.SetToolTip(Me.tbDataRangeStartField, "The database field containing the start of the items.") - ' - 'Label2 - ' - Me.Label2.Location = New System.Drawing.Point(12, 100) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(156, 16) - Me.Label2.TabIndex = 4 - Me.Label2.Text = "Data range start field:" - ' - 'tbDataRangeEndField - ' - Me.tbDataRangeEndField.Location = New System.Drawing.Point(12, 160) - Me.tbDataRangeEndField.Name = "tbDataRangeEndField" - Me.tbDataRangeEndField.Size = New System.Drawing.Size(168, 20) - Me.tbDataRangeEndField.TabIndex = 9 - Me.ToolTip1.SetToolTip(Me.tbDataRangeEndField, "The database field containing the end of the items.") - ' - 'Label3 - ' - Me.Label3.Location = New System.Drawing.Point(12, 144) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(152, 12) - Me.Label3.TabIndex = 8 - Me.Label3.Text = "Data range end field:" - ' - 'cbIncludeEndValue - ' - Me.cbIncludeEndValue.Location = New System.Drawing.Point(28, 252) - Me.cbIncludeEndValue.Name = "cbIncludeEndValue" - Me.cbIncludeEndValue.Size = New System.Drawing.Size(116, 24) - Me.cbIncludeEndValue.TabIndex = 1 - Me.cbIncludeEndValue.Text = "Include end value" - Me.ToolTip1.SetToolTip(Me.cbIncludeEndValue, "If true, the event is shown including the end row or column") - ' - 'cbSeparateDateHeader - ' - Me.cbSeparateDateHeader.Location = New System.Drawing.Point(16, 24) - Me.cbSeparateDateHeader.Name = "cbSeparateDateHeader" - Me.cbSeparateDateHeader.Size = New System.Drawing.Size(164, 24) - Me.cbSeparateDateHeader.TabIndex = 13 - Me.cbSeparateDateHeader.Text = "Separate date header" - Me.ToolTip1.SetToolTip(Me.cbSeparateDateHeader, "When true, a separate header will be added for the date. This requires DataRangeS" & _ - "tartField and DataRangeEndField to be of type DateTime.") - ' - 'tbRangeDataFormatString - ' - Me.tbRangeDataFormatString.Location = New System.Drawing.Point(192, 116) - Me.tbRangeDataFormatString.Name = "tbRangeDataFormatString" - Me.tbRangeDataFormatString.Size = New System.Drawing.Size(168, 20) - Me.tbRangeDataFormatString.TabIndex = 7 - Me.ToolTip1.SetToolTip(Me.tbRangeDataFormatString, "The format used for the ranges if the RangeHeaderTemplate is missing, e.g. {0:hh:" & _ - "mm}") - ' - 'Label5 - ' - Me.Label5.Location = New System.Drawing.Point(192, 100) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(160, 16) - Me.Label5.TabIndex = 6 - Me.Label5.Text = "Range data format string:" - ' - 'tbTitleFormatString - ' - Me.tbTitleFormatString.Location = New System.Drawing.Point(192, 72) - Me.tbTitleFormatString.Name = "tbTitleFormatString" - Me.tbTitleFormatString.Size = New System.Drawing.Size(168, 20) - Me.tbTitleFormatString.TabIndex = 3 - Me.ToolTip1.SetToolTip(Me.tbTitleFormatString, "The format used for the title if the TitleTemplate is missing, e.g. {0:ddd d}") - ' - 'Label6 - ' - Me.Label6.Location = New System.Drawing.Point(192, 56) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(120, 16) - Me.Label6.TabIndex = 2 - Me.Label6.Text = "Title format string:" - ' - 'GroupBox1 - ' - Me.GroupBox1.Controls.Add(Me.cbAutoSortTitles) - Me.GroupBox1.Controls.Add(Me.Label11) - Me.GroupBox1.Controls.Add(Me.tbItemStyleField) - Me.GroupBox1.Controls.Add(Me.tbDateHeaderFormatString) - Me.GroupBox1.Controls.Add(Me.Label9) - Me.GroupBox1.Controls.Add(Me.Label1) - Me.GroupBox1.Controls.Add(Me.tbTitleField) - Me.GroupBox1.Controls.Add(Me.tbTitleFormatString) - Me.GroupBox1.Controls.Add(Me.Label6) - Me.GroupBox1.Controls.Add(Me.Label3) - Me.GroupBox1.Controls.Add(Me.tbDataRangeStartField) - Me.GroupBox1.Controls.Add(Me.tbRangeDataFormatString) - Me.GroupBox1.Controls.Add(Me.Label5) - Me.GroupBox1.Controls.Add(Me.Label2) - Me.GroupBox1.Controls.Add(Me.tbDataRangeEndField) - Me.GroupBox1.Controls.Add(Me.cbSeparateDateHeader) - Me.GroupBox1.Location = New System.Drawing.Point(8, 12) - Me.GroupBox1.Name = "GroupBox1" - Me.GroupBox1.Size = New System.Drawing.Size(376, 232) - Me.GroupBox1.TabIndex = 0 - Me.GroupBox1.TabStop = False - Me.GroupBox1.Text = "Data source fields" - ' - 'cbAutoSortTitles - ' - Me.cbAutoSortTitles.Location = New System.Drawing.Point(193, 204) - Me.cbAutoSortTitles.Name = "cbAutoSortTitles" - Me.cbAutoSortTitles.Size = New System.Drawing.Size(116, 24) - Me.cbAutoSortTitles.TabIndex = 18 - Me.cbAutoSortTitles.Text = "Auto sort titles" - Me.ToolTip1.SetToolTip(Me.cbAutoSortTitles, "Sort titles automatically. When false, make sure the data source items are proper" & _ - "ly sorted in advance") - ' - 'Label11 - ' - Me.Label11.Location = New System.Drawing.Point(12, 188) - Me.Label11.Name = "Label11" - Me.Label11.Size = New System.Drawing.Size(152, 12) - Me.Label11.TabIndex = 16 - Me.Label11.Text = "Item style field" - ' - 'tbItemStyleField - ' - Me.tbItemStyleField.Location = New System.Drawing.Point(12, 204) - Me.tbItemStyleField.Name = "tbItemStyleField" - Me.tbItemStyleField.Size = New System.Drawing.Size(168, 20) - Me.tbItemStyleField.TabIndex = 17 - Me.ToolTip1.SetToolTip(Me.tbItemStyleField, "An optional database field providing the item styles (in the form of a css class " & _ - "name)") - ' - 'tbDateHeaderFormatString - ' - Me.tbDateHeaderFormatString.Location = New System.Drawing.Point(192, 160) - Me.tbDateHeaderFormatString.Name = "tbDateHeaderFormatString" - Me.tbDateHeaderFormatString.Size = New System.Drawing.Size(168, 20) - Me.tbDateHeaderFormatString.TabIndex = 15 - Me.ToolTip1.SetToolTip(Me.tbDateHeaderFormatString, "The format used for the date header if SeparateDateHeader=true and the DateHeader" & _ - "Template is missing, e.g. {0:dd/MM}") - ' - 'Label9 - ' - Me.Label9.Location = New System.Drawing.Point(192, 144) - Me.Label9.Name = "Label9" - Me.Label9.Size = New System.Drawing.Size(160, 16) - Me.Label9.TabIndex = 14 - Me.Label9.Text = "Date header format string:" - ' - 'GroupBox2 - ' - Me.GroupBox2.Controls.Add(Me.Label10) - Me.GroupBox2.Controls.Add(Me.tbInterval) - Me.GroupBox2.Controls.Add(Me.Label8) - Me.GroupBox2.Controls.Add(Me.tbEndTimeScale) - Me.GroupBox2.Controls.Add(Me.Label7) - Me.GroupBox2.Controls.Add(Me.tbStartTimeScale) - Me.GroupBox2.Controls.Add(Me.Label4) - Me.GroupBox2.Controls.Add(Me.cbFullTimeScale) - Me.GroupBox2.Location = New System.Drawing.Point(12, 328) - Me.GroupBox2.Name = "GroupBox2" - Me.GroupBox2.Size = New System.Drawing.Size(376, 84) - Me.GroupBox2.TabIndex = 3 - Me.GroupBox2.TabStop = False - Me.GroupBox2.Text = "Full time scale" - ' - 'Label10 - ' - Me.Label10.Location = New System.Drawing.Point(328, 56) - Me.Label10.Name = "Label10" - Me.Label10.Size = New System.Drawing.Size(24, 16) - Me.Label10.TabIndex = 7 - Me.Label10.Text = "min." - ' - 'tbInterval - ' - Me.tbInterval.Location = New System.Drawing.Point(284, 52) - Me.tbInterval.Name = "tbInterval" - Me.tbInterval.Size = New System.Drawing.Size(40, 20) - Me.tbInterval.TabIndex = 6 - Me.ToolTip1.SetToolTip(Me.tbInterval, "The number of minutes between each mark on the time scale. Only used when FullTim" & _ - "eScale is true.") - ' - 'Label8 - ' - Me.Label8.Location = New System.Drawing.Point(232, 56) - Me.Label8.Name = "Label8" - Me.Label8.Size = New System.Drawing.Size(48, 16) - Me.Label8.TabIndex = 5 - Me.Label8.Text = "Interval:" - ' - 'tbEndTimeScale - ' - Me.tbEndTimeScale.Location = New System.Drawing.Point(160, 52) - Me.tbEndTimeScale.Name = "tbEndTimeScale" - Me.tbEndTimeScale.Size = New System.Drawing.Size(60, 20) - Me.tbEndTimeScale.TabIndex = 4 - Me.ToolTip1.SetToolTip(Me.tbEndTimeScale, "The end of the time scale. Only used when FullTimeScale is true.") - ' - 'Label7 - ' - Me.Label7.Location = New System.Drawing.Point(124, 56) - Me.Label7.Name = "Label7" - Me.Label7.Size = New System.Drawing.Size(32, 16) - Me.Label7.TabIndex = 3 - Me.Label7.Text = "End:" - ' - 'tbStartTimeScale - ' - Me.tbStartTimeScale.Location = New System.Drawing.Point(52, 52) - Me.tbStartTimeScale.Name = "tbStartTimeScale" - Me.tbStartTimeScale.Size = New System.Drawing.Size(60, 20) - Me.tbStartTimeScale.TabIndex = 2 - Me.ToolTip1.SetToolTip(Me.tbStartTimeScale, "The start of the time scale. Only used when FullTimeScale is true.") - ' - 'Label4 - ' - Me.Label4.Location = New System.Drawing.Point(12, 56) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(36, 16) - Me.Label4.TabIndex = 1 - Me.Label4.Text = "Start:" - ' - 'cbFullTimeScale - ' - Me.cbFullTimeScale.Location = New System.Drawing.Point(12, 24) - Me.cbFullTimeScale.Name = "cbFullTimeScale" - Me.cbFullTimeScale.Size = New System.Drawing.Size(148, 24) - Me.cbFullTimeScale.TabIndex = 0 - Me.cbFullTimeScale.Text = "Use full time scale" - Me.ToolTip1.SetToolTip(Me.cbFullTimeScale, "If true, show a full time scale. If false, show only the occurring values in the " & _ - "data source.") - ' - 'GroupBox3 - ' - Me.GroupBox3.Controls.Add(Me.cbShowValueMarks) - Me.GroupBox3.Controls.Add(Me.rbVertical) - Me.GroupBox3.Controls.Add(Me.rbHorizontal) - Me.GroupBox3.Location = New System.Drawing.Point(12, 284) - Me.GroupBox3.Name = "GroupBox3" - Me.GroupBox3.Size = New System.Drawing.Size(376, 40) - Me.GroupBox3.TabIndex = 2 - Me.GroupBox3.TabStop = False - Me.GroupBox3.Text = "Layout" - ' - 'cbShowValueMarks - ' - Me.cbShowValueMarks.Location = New System.Drawing.Point(256, 14) - Me.cbShowValueMarks.Name = "cbShowValueMarks" - Me.cbShowValueMarks.Size = New System.Drawing.Size(116, 24) - Me.cbShowValueMarks.TabIndex = 6 - Me.cbShowValueMarks.Text = "Show value marks" - Me.ToolTip1.SetToolTip(Me.cbShowValueMarks, "If true, lines will be added to mark range values.") - ' - 'rbVertical - ' - Me.rbVertical.Location = New System.Drawing.Point(96, 16) - Me.rbVertical.Name = "rbVertical" - Me.rbVertical.Size = New System.Drawing.Size(68, 20) - Me.rbVertical.TabIndex = 1 - Me.rbVertical.Text = "Vertical" - Me.ToolTip1.SetToolTip(Me.rbVertical, "The direction in which the item ranges are shown.") - ' - 'rbHorizontal - ' - Me.rbHorizontal.Location = New System.Drawing.Point(16, 16) - Me.rbHorizontal.Name = "rbHorizontal" - Me.rbHorizontal.Size = New System.Drawing.Size(76, 20) - Me.rbHorizontal.TabIndex = 0 - Me.rbHorizontal.Text = "Horizontal" - Me.ToolTip1.SetToolTip(Me.rbHorizontal, "The direction in which the item ranges are shown.") - ' - 'cbEnableEmptySlotClick - ' - Me.cbEnableEmptySlotClick.Location = New System.Drawing.Point(13, 19) - Me.cbEnableEmptySlotClick.Name = "cbEnableEmptySlotClick" - Me.cbEnableEmptySlotClick.Size = New System.Drawing.Size(94, 17) - Me.cbEnableEmptySlotClick.TabIndex = 0 - Me.cbEnableEmptySlotClick.Text = "Enable clicking" - Me.ToolTip1.SetToolTip(Me.cbEnableEmptySlotClick, "When checked, clicking an empty slot in the calendar will raize the EmptySlotClic" & _ - "ked event") - ' - 'groupBox4 - ' - Me.groupBox4.Controls.Add(Me.label14) - Me.groupBox4.Controls.Add(Me.tbEmptySlotToolTip) - Me.groupBox4.Controls.Add(Me.cbEnableEmptySlotClick) - Me.groupBox4.Location = New System.Drawing.Point(12, 416) - Me.groupBox4.Name = "groupBox4" - Me.groupBox4.Size = New System.Drawing.Size(376, 45) - Me.groupBox4.TabIndex = 9 - Me.groupBox4.TabStop = False - Me.groupBox4.Text = "Empty slots" - ' - 'label14 - ' - Me.label14.Location = New System.Drawing.Point(124, 20) - Me.label14.Name = "label14" - Me.label14.Size = New System.Drawing.Size(42, 16) - Me.label14.TabIndex = 6 - Me.label14.Text = "Tooltip:" - ' - 'tbEmptySlotToolTip - ' - Me.tbEmptySlotToolTip.Location = New System.Drawing.Point(172, 16) - Me.tbEmptySlotToolTip.Name = "tbEmptySlotToolTip" - Me.tbEmptySlotToolTip.Size = New System.Drawing.Size(198, 20) - Me.tbEmptySlotToolTip.TabIndex = 1 - ' - 'GeneralPropertyBuilder - ' - Me.AcceptButton = Me.btnOK - Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) - Me.CancelButton = Me.btnCancel - Me.ClientSize = New System.Drawing.Size(394, 491) - Me.ControlBox = False - Me.Controls.Add(Me.groupBox4) - Me.Controls.Add(Me.GroupBox3) - Me.Controls.Add(Me.GroupBox2) - Me.Controls.Add(Me.GroupBox1) - Me.Controls.Add(Me.cbIncludeEndValue) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnOK) - Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog - Me.MaximizeBox = False - Me.Name = "GeneralPropertyBuilder" - Me.Text = "Properties" - Me.GroupBox1.ResumeLayout(False) - Me.GroupBox1.PerformLayout() - Me.GroupBox2.ResumeLayout(False) - Me.GroupBox2.PerformLayout() - Me.GroupBox3.ResumeLayout(False) - Me.groupBox4.ResumeLayout(False) - Me.groupBox4.PerformLayout() - Me.ResumeLayout(False) - - End Sub - -#End Region - - Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click - Me.DialogResult = DialogResult.OK - Close() - End Sub - - Private Sub cbFullTimeScale_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbFullTimeScale.CheckedChanged - tbStartTimeScale.Enabled = cbFullTimeScale.Checked - tbEndTimeScale.Enabled = cbFullTimeScale.Checked - tbInterval.Enabled = cbFullTimeScale.Checked - End Sub - - Private Sub cbSeparateDateHeader_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbSeparateDateHeader.CheckedChanged - tbDateHeaderFormatString.Enabled = cbSeparateDateHeader.Checked - End Sub - - Private Sub cbShowValueMarks_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbShowValueMarks.CheckedChanged - If (cbShowValueMarks.Checked) Then cbIncludeEndValue.Checked = False - End Sub - - Private Sub cbEnableEmptySlotClick_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbEnableEmptySlotClick.CheckedChanged - Me.tbEmptySlotToolTip.Enabled = Me.cbEnableEmptySlotClick.Checked - End Sub - End Class diff --git a/Controls/DotNetNuke.Events.ScheduleControl/schedulecalendar.cs b/Controls/DotNetNuke.Events.ScheduleControl/schedulecalendar.cs new file mode 100644 index 0000000..0511621 --- /dev/null +++ b/Controls/DotNetNuke.Events.ScheduleControl/schedulecalendar.cs @@ -0,0 +1,985 @@ +using System; +using System.Data; +using System.Collections; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.ComponentModel; + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events.ScheduleControl +{ + + /// ----------------------------------------------------------------------------- + /// Project : schedule + /// Class : ScheduleCalendar + /// + /// ----------------------------------------------------------------------------- + /// + /// The ScheduleCalendar web control is designed to represent a schedule in a calendar format. + /// + /// ----------------------------------------------------------------------------- + [CLSCompliant(true), ParseChildren(true)]public class ScheduleCalendar : BaseSchedule + { + +#region Properties + /// ----------------------------------------------------------------------------- + /// + /// Whether to show the EmptyDataTemplate or not when no data is found + /// + /// + /// Overrides default value (True) + /// + /// ----------------------------------------------------------------------------- + protected override bool ShowEmptyDataTemplate + { + get + { + // When FullTimeScale=True, an empty calendar is shown, so there's no need for a replacement + return !FullTimeScale; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The database field containing the start time of the events. This field should also contain the date when TimeFieldsContainDate=true + /// + /// + /// StartTimeField replaces DataRangeStartField for ScheduleCalendar + /// + /// ----------------------------------------------------------------------------- + [Description("The database field containing the start time of the events. This field should also contain the date when TimeFieldsContainDate=true"), Bindable(false), Category("Data")]public string StartTimeField + { + get + { + return base.DataRangeStartField; + } + set + { + base.DataRangeStartField = value; + } + } + + // Hide DataRangeStartField. For ScheduleCalendar, it's called StartTimeField + [Browsable(false), Obsolete("The DataRangeStartField property is obsolete"), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]public new string DataRangeStartField + { + get + { + return base.DataRangeStartField; + } + set + { + base.DataRangeStartField = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The database field containing the end time of the events. This field should also contain the date when TimeFieldsContainDate=true + /// + /// + /// EndTimeField replaces DataRangeEndField for ScheduleCalendar + /// + /// ----------------------------------------------------------------------------- + [Description("The database field containing the end time of the events. This field should also contain the date when TimeFieldsContainDate=true"), Bindable(false), Category("Data")]public string EndTimeField + { + get + { + return base.DataRangeEndField; + } + set + { + base.DataRangeEndField = value; + } + } + + // Hide DataRangeEndField. For ScheduleCalendar, it's called EndTimeField + [Browsable(false), Obsolete("The DataRangeEndField property is obsolete"), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]public new string DataRangeEndField + { + get + { + return base.DataRangeEndField; + } + set + { + base.DataRangeEndField = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The database field providing the dates. Ignored when TimeFieldsContainDate=true. When TimeFieldsContainDate=false, this field should be of type Date + /// + /// + /// DateField replaces TitleField for ScheduleCalendar + /// + /// ----------------------------------------------------------------------------- + [Description("The database field providing the dates. Ignored when TimeFieldsContainDate=true. When TimeFieldsContainDate=false, this field should be of type Date."), Bindable(false), Category("Data")]public string DateField + { + get + { + return base.TitleField; + } + set + { + base.TitleField = value; + } + } + + // Hide TitleField. For ScheduleCalendar, it's called DateField + [Browsable(false), Obsolete("The TitleField property is obsolete"), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]public new string TitleField + { + get + { + return base.TitleField; + } + set + { + base.TitleField = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The first date to display. + /// The calendar will start on this date, if not overridden by the + /// StartDay and NumberOfDays settings. + /// The default value is the date at the time of display. + /// + /// ----------------------------------------------------------------------------- + [Description("The first date to display. The calendar will start on this date, if not overridden by the StartDay and NumberOfDays settings."), Bindable(true), Category("Behavior")]public DateTime StartDate + { + get + { + object o = ViewState["StartDate"]; + if (!(ReferenceEquals(o, null))) + { + return System.Convert.ToDateTime(o); + } + return DateTime.Today; // default value + } + set + { + ViewState["StartDate"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The first day of the week to display. + /// The calendar will start on this day of the week. + /// This value is used only when NumberOfDays equals 7. + /// The default is Monday. + /// + /// ----------------------------------------------------------------------------- + [Description("The first day of the week to display. The calendar will start on this day of the week. This value is used only when NumberOfDays equals 7."), DefaultValue(DayOfWeek.Monday), Bindable(true), Category("Behavior")]public DayOfWeek StartDay + { + get + { + object o = ViewState["StartDay"]; + if (!(ReferenceEquals(o, null))) + { + return ((DayOfWeek) o); + } + return DayOfWeek.Monday; // default value + } + set + { + ViewState["StartDay"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The number of days to display. + /// This number may be repeated multiple times in Vertical layout when the NumberOfRepetitions + /// property is greater than 1. + /// De default value is 7 (weekly calendar). + /// + /// ----------------------------------------------------------------------------- + [Description("The number of days to display. This number may be repeated multiple times in Vertical layout when the NumberOfRepetitions property is greater than 1."), DefaultValue(7), Bindable(true), Category("Behavior")]public int NumberOfDays + { + get + { + object o = ViewState["NumberOfDays"]; + if (!(ReferenceEquals(o, null))) + { + return System.Convert.ToInt32(o); + } + return 7; // default value + } + set + { + ViewState["NumberOfDays"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The number of repetitions to show at a time. Only used in Vertical layout. + /// Especially useful if you want to show several weeks in the calendar, one + /// below the other. + /// This property replaces the Weeks property starting from version 1.6.1. + /// + /// ----------------------------------------------------------------------------- + [Description("The number of repetitions to show at a time. Only used in Vertical layout."), DefaultValue(1), Bindable(true), Category("Behavior")]public int NumberOfRepetitions + { + get + { + // in horizontal layout, only 1 week is supported + if (Layout == LayoutEnum.Horizontal) + { + return 1; + } + object o = ViewState["NumberOfRepetitions"]; + if (!(ReferenceEquals(o, null))) + { + int w = System.Convert.ToInt32(o); + if (w <= 0) + { + return 1; + } + return w; + } + return 1; + } + set + { + ViewState["NumberOfRepetitions"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// Obsolete since version 1.6.1. Use the NumberOfRepetitions property instead. + /// + /// ----------------------------------------------------------------------------- + [Description("The number of weeks to show at a time. Only used in Vertical layout."), Browsable(false), Bindable(true)]public int Weeks + { + get + { + return NumberOfRepetitions; + } + set + { + NumberOfRepetitions = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The format used for the date if the DateTemplate is missing, e.g. {0:ddd d} + /// + /// ----------------------------------------------------------------------------- + [Description("The format used for the date if the DateTemplate is missing, e.g. {0:ddd d}"), DefaultValue(""), Category("Data")]public string DateFormatString + { + get + { + object o = ViewState["DateFormatString"]; + if (!(ReferenceEquals(o, null))) + { + return Convert.ToString(o); + } + return string.Empty; + } + set + { + ViewState["DateFormatString"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The format used for the time if the TimeTemplate is missing, e.g. {0:hh:mm} + /// + /// ----------------------------------------------------------------------------- + [Description("The format used for the times if the TimeTemplate is missing, e.g. {0:hh:mm}"), DefaultValue(""), Category("Data")]public string TimeFormatString + { + get + { + object o = ViewState["TimeFormatString"]; + if (!(ReferenceEquals(o, null))) + { + return Convert.ToString(o); + } + return string.Empty; + } + set + { + ViewState["TimeFormatString"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// Indicates whether the time fields (StartTimeField and EndTimeField) contain the date as well. Whe true, this allows midnight spanning for calendar events. When false, the DateField contains the date. + /// + /// + /// TimeFieldsContainDate replaces UseTitleFieldAsDate for ScheduleCalendar + /// + /// ----------------------------------------------------------------------------- + [Description("Indicates whether the time fields (StartTimeField and EndTimeField) contain the date as well. When true, this allows midnight spanning for calendar events. When false, the DateField contains the date."), DefaultValue(false), Bindable(true), Category("Data")]public bool TimeFieldsContainDate + { + get + { + object o = ViewState["TimeFieldsContainDate"]; + if (!(ReferenceEquals(o, null))) + { + return System.Convert.ToBoolean(o); + } + return false; + } + set + { + ViewState["TimeFieldsContainDate"] = value; + } + } + +#endregion + +#region Styles + /// ----------------------------------------------------------------------------- + /// + /// The style applied to time header items. + /// + /// + /// TimeStyle replaces RangeHeaderStyle for ScheduleCalendar + /// + /// ----------------------------------------------------------------------------- + [Description("The style applied to time header items. "), Bindable(false), Category("Style"), NotifyParentProperty(true), PersistenceMode(PersistenceMode.InnerProperty)]public virtual TableItemStyle TimeStyle + { + get + { + return base.RangeHeaderStyle; + } + } + + // Hide RangeHeaderStyle. For ScheduleCalendar, it's replaced with TimeStyle + [Browsable(false), Obsolete("The RangeHeaderStyle property is obsolete. Use TimeStyle instead"), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]public new TableItemStyle RangeHeaderStyle + { + get + { + return base.RangeHeaderStyle; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The style applied to date header items. + /// + /// + /// DateStyle replaces TitleStyle for ScheduleCalendar + /// + /// ----------------------------------------------------------------------------- + [Description("The style applied to date header items. "), Bindable(false), Category("Style"), NotifyParentProperty(true), PersistenceMode(PersistenceMode.InnerProperty)]public virtual TableItemStyle DateStyle + { + get + { + return base.TitleStyle; + } + } + + // Hide TitleStyle. For ScheduleCalendar, it's replaced with DateStyle + [Browsable(false), Obsolete("The TitleStyle property is obsolete. Use DateStyle instead."), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]public new TableItemStyle TitleStyle + { + get + { + return base.TitleStyle; + } + } + +#endregion + +#region Templates + + private ITemplate _DateTemplate; + private ITemplate _TimeTemplate; + + // DateTemplate replaces TitleTemplate for ScheduleCalendar + [TemplateContainer(typeof(ScheduleItem)), Browsable(false), Description("The template used to create date header content."), NotifyParentProperty(true), PersistenceMode(PersistenceMode.InnerProperty)]public ITemplate DateTemplate + { + get + { + return _DateTemplate; + } + set + { + _DateTemplate = value; + } + } + + // TimeTemplate replaces RangeHeaderTemplate for ScheduleCalendar + [TemplateContainer(typeof(ScheduleItem)), Browsable(false), Description("The template used to create time header content."), PersistenceMode(PersistenceMode.InnerProperty)]public ITemplate TimeTemplate + { + get + { + return _TimeTemplate; + } + set + { + _TimeTemplate = value; + } + } + +#endregion + +#region Methods + + // Check if all properties are set to make the control work + override public string CheckConfiguration() + { + if (!TimeFieldsContainDate && DateField == "") + { + return "Either the DateField property must have a non blank value, or TimeFieldsContainDate must be true"; + } + if (StartTimeField == "") + { + return "The StartTimeField property is not set"; + } + if (EndTimeField == "") + { + return "The EndTimeField property is not set"; + } + return string.Empty; + } + + /// ----------------------------------------------------------------------------- + /// + /// create the list with all times (Start or End) + /// + /// + /// ----------------------------------------------------------------------------- + override public void FillRangeValueArray(ref DataView dv) + { + arrRangeValues = new ArrayList(); + if (FullTimeScale) + { + TimeSpan tsInc = new TimeSpan(0, TimeScaleInterval, 0); + // ignore data, just fill the time scale + // add incrementing times to the array + TimeSpan t = StartOfTimeScale; + while (TimeSpan.Compare(t, EndOfTimeScale) < 0) + { + // use DateTime objects for easy display + DateTime dt = new DateTime(1, 1, 1, t.Hours, t.Minutes, 0); + arrRangeValues.Add(dt); + t = t.Add(tsInc); + } + // Add the end of the timescale as well to make sure it's there + // e.g. in the case of EndOfTimeScale=23:59 and TimeScaleInterval=1440, this is imperative + DateTime dtEnd = new DateTime(1, 1, 1 + EndOfTimeScale.Days, EndOfTimeScale.Hours, EndOfTimeScale.Minutes, 0); + arrRangeValues.Add(dtEnd); + } + else // Not FullTimeScale + { + // Just add the times from the dataview + int j = 0; + for (j = 0; j <= dv.Count - 1; j++) + { + object t1 = dv[j][StartTimeField]; + object t2 = dv[j][EndTimeField]; + if (!TimeFieldsContainDate) + { + arrRangeValues.Add(t1); + arrRangeValues.Add(t2); + } + else // TimeFieldsContainDate + { + // both t1 and t2 should be of type DateTime now + if (!(t1 is DateTime)) + { + throw (new HttpException("When TimeFieldsContainDate=True, StartTimeField should be of type DateTime")); + } + DateTime dt1 = System.Convert.ToDateTime(t1); + if (!(t2 is DateTime)) + { + throw (new HttpException("When TimeFieldsContainDate=True, EndTimeField should be of type DateTime")); + } + DateTime dt2 = System.Convert.ToDateTime(t2); + // remove date part, only store time part in array + arrRangeValues.Add(new DateTime(1, 1, 1, dt1.Hour, dt1.Minute, dt1.Second)); + if (dt2.Hour > 0 | dt2.Minute > 0 | dt2.Second > 0) + { + arrRangeValues.Add(new DateTime(1, 1, 1, dt2.Hour, dt2.Minute, dt2.Second)); + } + else + { + // if the end is 0:00:00 hour, insert 24:00:00 hour instead + arrRangeValues.Add(new DateTime(1, 1, 2, 0, 0, 0)); + } + } + } + } + + arrRangeValues.Sort(); + RemoveDoubles(arrRangeValues); + + } + + /// ----------------------------------------------------------------------------- + /// + /// When TimeFieldsContainDate=True, items could span over midnight, even several days. + /// Split them. + /// + /// + /// Used to be called "SplitItemsThatSpanMidnight" + /// ----------------------------------------------------------------------------- + override public void PreprocessData(ref DataView dv) + { + ShiftStartDate(); + if (!TimeFieldsContainDate) + { + return ; + } + if (ReferenceEquals(dv, null)) + { + return ; // added in v2.1.0.9 + } + int j = 0; + int count = dv.Count; + while (j < count) + { + DataRowView drv = dv[j]; + DateTime dtStartValue = System.Convert.ToDateTime(drv[StartTimeField]); + DateTime dtEndValue = System.Convert.ToDateTime(drv[EndTimeField]); + DateTime dateStart = new DateTime(dtStartValue.Year, dtStartValue.Month, dtStartValue.Day); + DateTime dateEnd = new DateTime(dtEndValue.Year, dtEndValue.Month, dtEndValue.Day); + if (dtEndValue.Hour == 0 & dtEndValue.Minute == 0 & dtEndValue.Second == 0) + { + // when it ends at 0:00:00 hour, it's representing 24:00 hours of the previous day + dateEnd = dateEnd.AddDays(-1); + } + // Check if the item spans midnight. If so, split it. + if (dateStart < dateEnd) + { + // the item spans midnight. We'll truncate the item first, so that it only + // covers the last day, and we'll add new items for the other day(s) in the loop below. + if (FullTimeScale) + { + // truncate the item by setting its start time to StartOfTimeScale + drv[StartTimeField] = new DateTime(dateEnd.Year, dateEnd.Month, dateEnd.Day, StartOfTimeScale.Hours, StartOfTimeScale.Minutes, StartOfTimeScale.Seconds); + } + else + { + // truncate the item by setting its start time to 0:00:00 hours + drv[StartTimeField] = new DateTime(dateEnd.Year, dateEnd.Month, dateEnd.Day, 0, 0, 0); + } + } + while (dateStart < dateEnd) + { + // If the item spans midnight once, create an additional item for the first day. + // If it spans midnight several times, create additional items for each day. + DataRowView drvNew = dv.AddNew(); + int i = 0; + for (i = 0; i <= dv.Table.Columns.Count - 1; i++) + { + drvNew[i] = drv[i]; // copy columns one by one + } + drvNew[StartTimeField] = dtStartValue; + if (FullTimeScale) + { + // set the end time to the EndOfTimeScale value + DateTime dateEnd2 = new DateTime(dateStart.Year, dateStart.Month, dateStart.Day, EndOfTimeScale.Hours, EndOfTimeScale.Minutes, EndOfTimeScale.Seconds); + if (EndOfTimeScale.Equals(new TimeSpan(1, 0, 0, 0))) + { + // EndOfTimeScale is 24:00 hours. Set the end at 0:00 AM of the next day. + // We'll catch this case later and show the proper value. + dateEnd2.AddDays(1); + } + drvNew[EndTimeField] = dateEnd2; + } + else + { + // Set the end time to 24:00 hours. This is 0:00 AM of the next day. + // We'll catch this case later and show the proper value. + drvNew[EndTimeField] = new DateTime(dateStart.Year, dateStart.Month, dateStart.Day, 0, 0, 0).AddDays(1); + } + drvNew.EndEdit(); + dateStart = dateStart.AddDays(1); + if (FullTimeScale) + { + // next item should start at StartOfTimeScale + dtStartValue = new DateTime(dateStart.Year, dateStart.Month, dateStart.Day, StartOfTimeScale.Hours, StartOfTimeScale.Minutes, StartOfTimeScale.Seconds); + } + else + { + // next item should start at 0:00:00 hour + dtStartValue = new DateTime(dateStart.Year, dateStart.Month, dateStart.Day, 0, 0, 0); + } + } + j++; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// calculate the TitleIndex in the table, given the objTitleValue + /// + /// + /// + /// ----------------------------------------------------------------------------- + protected override int CalculateTitleIndex(object objTitleValue) + { + int returnValue = 0; + returnValue = -1; + if (!(objTitleValue is DateTime)&& !(objTitleValue is DateTime)) + { + throw (new HttpException("DateField should be of type Date or DateTime in Calendar mode")); + } + DateTime dtDate = System.Convert.ToDateTime(objTitleValue); + // remove time part, if any + dtDate = new DateTime(dtDate.Year, dtDate.Month, dtDate.Day, 0, 0, 0); + returnValue = System.Convert.ToInt32((((dtDate.Subtract(StartDate.Date)).Days) % NumberOfDays) + 1); // fix courtesy of Anthony Main + return returnValue; + } + + /// ----------------------------------------------------------------------------- + /// + /// Calculate the range cell index in the table, given the objRangeValue and the objTitleValue + /// The values refer to the real cell index in the table, taking into account whether cells are + /// spanning over value marks (in horizontal mode) + /// In vertical layout, the result is the real row index in the table + /// In horizontal layout, the result is the real cell index in the row (before any merging + /// of cells due to value spanning) + /// + /// The range value from the data source + /// The title value from the data source + /// False if we're calculating the range value index for the start of the item, True if it's the end + /// The range cell index + /// ----------------------------------------------------------------------------- + protected override int CalculateRangeCellIndex(object objRangeValue, object objTitleValue, bool isEndValue) + { + int returnValue = 0; + int RangeValueIndex = -1; + // Find range value index by matching with range values array + if (FullTimeScale && !(objRangeValue is DateTime)) + { + throw (new HttpException("The time field should be of type DateTime when FullTimeScale is set to true")); + } + if (TimeFieldsContainDate && !(objRangeValue is DateTime)) + { + throw (new HttpException("The time field should be of type DateTime when TimeFieldsContainDate is set to true")); + } + int k = 0; + if (FullTimeScale) + { + DateTime Dobj = System.Convert.ToDateTime(objRangeValue); + // omit the date part for comparison + Dobj = new DateTime(1, 1, 1, Dobj.Hour, Dobj.Minute, Dobj.Second); + // if no match is found, use the index of the EndOfTimeScale value + RangeValueIndex = arrRangeValues.Count; + for (k = 0; k <= arrRangeValues.Count - 1; k++) + { + DateTime Dk = System.Convert.ToDateTime(arrRangeValues[k]); + Dk = new DateTime(1, 1, 1, Dk.Hour, Dk.Minute, Dk.Second); // omit date part + if (Dobj < Dk && k == 0 && isEndValue) + { + // ends before start of time scale + return -1; + } + if (Dobj >= Dk && k == arrRangeValues.Count - 1 && !isEndValue) + { + // starts at or after end of time scale + return -1; + } + if (Dobj <= Dk) + { + if (k == 0 && isEndValue) + { + // This can happen when the end value is 24:00:00, which will + // match with the value 0:00:00 and give k=0 + // Instead of the value k=0, use k=arrRangeValues.Count-1 + RangeValueIndex = arrRangeValues.Count; + } + else + { + RangeValueIndex = k + 1; + } + break; + } + } + } + else // Not FullTimeScale + { + if (!TimeFieldsContainDate) + { + // find the matching value in arrRangeValues + for (k = 0; k <= arrRangeValues.Count - 1; k++) + { + if (arrRangeValues[k].ToString() == objRangeValue.ToString()) + { + RangeValueIndex = k + 1; + break; + } + } + } + else + { + // TimeFieldsContainDate=True + DateTime Dobj = System.Convert.ToDateTime(objRangeValue); + // omit the date part for comparison + Dobj = new DateTime(1, 1, 1, Dobj.Hour, Dobj.Minute, Dobj.Second); + for (k = 0; k <= arrRangeValues.Count - 1; k++) + { + DateTime Dk = System.Convert.ToDateTime(arrRangeValues[k]); + Dk = new DateTime(1, 1, 1, Dk.Hour, Dk.Minute, Dk.Second); // omit date part + if (Dobj == Dk) + { + if (k == 0 && isEndValue) + { + // This can happen when the end value is 24:00:00, which will + // match with the value 0:00:00, and give k=0 + // Instead of the value k=0, use k=arrRangeValues.Count-1 + RangeValueIndex = arrRangeValues.Count; + } + else + { + RangeValueIndex = k + 1; + } + break; + } + } + } + } + + if (!IncludeEndValue && ShowValueMarks) + { + if (Layout == LayoutEnum.Vertical) + { + // Each item spans two rows + returnValue = RangeValueIndex * 2; + } + else + { + // Add one cell for the empty background cell on the left + returnValue = RangeValueIndex + 1; + } + } + else + { + returnValue = RangeValueIndex; + } + + // The valueindex that we found corresponds with an item in the first week. + // If the item is in another week, modify the valueindex accordingly. + // To find out, check the date of the item + DateTime dtDate = default(DateTime); + if (!TimeFieldsContainDate) + { + // use objTitleValue for the date + if (!(objTitleValue is DateTime)&& !(objTitleValue is DateTime)) + { + throw (new HttpException("The date field should be of type Date or DateTime in Calendar mode when TimeFieldsContainDate=false.")); + } + dtDate = System.Convert.ToDateTime(objTitleValue); + } + else + { + // use objRangeValue for the date + DateTime Dobj = System.Convert.ToDateTime(objRangeValue); + dtDate = new DateTime(Dobj.Year, Dobj.Month, Dobj.Day); + if (isEndValue && Dobj.Hour == 0 & Dobj.Minute == 0 & Dobj.Second == 0) + { + // when it's the end of the item and the time = 0:00 hours, + // it's representing 24:00 hours of the previous day + dtDate = dtDate.AddDays(-1); + } + } + // if dtDate is more than NumberOfDays after StartDate, add additional rows + int rowsPerWeek = 1 + arrRangeValues.Count; + if (!IncludeEndValue && ShowValueMarks) + { + rowsPerWeek = 1 + arrRangeValues.Count * 2; + } + + returnValue = System.Convert.ToInt32(returnValue + ((dtDate.Subtract(StartDate)).Days / NumberOfDays) * rowsPerWeek); + return returnValue; + } + + protected override int GetTitleCount() + { + return NumberOfDays; // make a title cell for every NumberOfDays + } + + override public void AddTitleHeaderData() + { + int nTitles = GetTitleCount(); + + // iterate arrTitleValues creating a new item for each data item + int titleIndex = 0; + for (titleIndex = 1; titleIndex <= nTitles; titleIndex++) + { + + int iWeek = 0; + for (iWeek = 0; iWeek <= NumberOfRepetitions - 1; iWeek++) + { + object obj = StartDate.AddDays(titleIndex - 1 + iWeek * NumberOfDays); + int rowsPerWeek = 1 + arrRangeValues.Count; + if (!IncludeEndValue && ShowValueMarks) + { + rowsPerWeek = 1 + arrRangeValues.Count * 2; + } + int rangeIndex = iWeek * rowsPerWeek; + CreateItem(rangeIndex, titleIndex, ScheduleItemType.TitleHeader, true, obj, -1); + } + + } + + } + + protected override string GetTitleField() + { + if (TimeFieldsContainDate) + { + // When TimeFieldsContainDate=true, use StartTimeField as Title + return StartTimeField; + } + else + { + return DateField; + } + } + + public void ShiftStartDate() + { + if (NumberOfDays != 7) + { + return ; // change the start date only for a weekly calendar + } + // for any StartDate set by the user, shift it to the previous day indicated by the StartDay property + // (by default, this will be the previous Monday) + StartDate = StartDate.AddDays((System.Convert.ToInt32(StartDay)) - System.Convert.ToInt32(StartDate.DayOfWeek)); + if (System.Convert.ToInt32(StartDay) > System.Convert.ToInt32(StartDate.DayOfWeek)) + { + StartDate = StartDate.AddDays(-7); + } + // StartDate should be on the day of the week indicated by StartDay now + } + + public override string GetSortOrder() + { + // make sure the data is processed in the right order: from bottom right up to top left. + if (!TimeFieldsContainDate) + { + return DateField + " ASC, " + StartTimeField + " ASC, " + EndTimeField + " ASC"; + } + else + { + // In Calendar Mode with TimeFieldsContainDate=True, there is no DateField + return StartTimeField + " ASC, " + EndTimeField + " ASC"; + } + } + + override public int GetRepetitionCount() + { + return NumberOfRepetitions; + } + + /// ----------------------------------------------------------------------------- + /// + /// when there's no template, try to present the data in a reasonable format + /// + /// Value of the item + /// Type of the item + /// A formatted string + /// ----------------------------------------------------------------------------- + protected override string FormatDataValue(object value, ScheduleItemType type) + { + string retVal = string.Empty; + if (!ReferenceEquals(value, null)) + { + if (type == ScheduleItemType.TitleHeader) + { + if (DateFormatString.Length == 0) + { + retVal = value.ToString(); + } + else + { + retVal = string.Format(DateFormatString, value); + } + } + else if (type == ScheduleItemType.RangeHeader) + { + if (TimeFormatString.Length == 0) + { + retVal = value.ToString(); + } + else + { + retVal = string.Format(TimeFormatString, value); + } + } + else + { + retVal = value.ToString(); + } + } + return retVal; + } + + protected override ITemplate GetTemplate(ScheduleItemType type) + { + switch (type) + { + case ScheduleItemType.RangeHeader: + return TimeTemplate; + case ScheduleItemType.TitleHeader: + return DateTemplate; + case ScheduleItemType.Item: + return ItemTemplate; + case ScheduleItemType.AlternatingItem: + return ItemTemplate; + } + return null; + } + + ///' ----------------------------------------------------------------------------- + ///' + ///' Calculate the title value given the cell index + ///' + ///' Title index of the cell + ///' Object containing the title + ///' ----------------------------------------------------------------------------- + public override dynamic CalculateTitle(int titleIndex, int cellIndex) + { + int cellsPerWeek = 0; + if (!IncludeEndValue && ShowValueMarks) + { + cellsPerWeek = arrRangeValues.Count * 2 + 1; + } + else + { + cellsPerWeek = arrRangeValues.Count + 1; + } + int week = cellIndex / cellsPerWeek; + return StartDate.AddDays(titleIndex - 1 + week * 7); + } + +#endregion + + } + +} diff --git a/Controls/DotNetNuke.Events.ScheduleControl/schedulecalendar.vb b/Controls/DotNetNuke.Events.ScheduleControl/schedulecalendar.vb deleted file mode 100644 index 712db2c..0000000 --- a/Controls/DotNetNuke.Events.ScheduleControl/schedulecalendar.vb +++ /dev/null @@ -1,823 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Option Strict On - -Imports System -Imports System.Data -Imports System.Collections -Imports System.Web ' HttpException -Imports System.Web.UI -Imports System.Web.UI.WebControls -Imports System.ComponentModel - -''' ----------------------------------------------------------------------------- -''' Project : schedule -''' Class : ScheduleCalendar -''' -''' ----------------------------------------------------------------------------- -''' -''' The ScheduleCalendar web control is designed to represent a schedule in a calendar format. -''' -''' ----------------------------------------------------------------------------- - _ - Public Class ScheduleCalendar : Inherits BaseSchedule - -#Region "Properties" - ''' ----------------------------------------------------------------------------- - ''' - ''' Whether to show the EmptyDataTemplate or not when no data is found - ''' - ''' - ''' Overrides default value (True) - ''' - ''' ----------------------------------------------------------------------------- - Protected Overrides ReadOnly Property ShowEmptyDataTemplate() As Boolean - Get - ' When FullTimeScale=True, an empty calendar is shown, so there's no need for a replacement - Return Not FullTimeScale - End Get - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The database field containing the start time of the events. This field should also contain the date when TimeFieldsContainDate=true - ''' - ''' - ''' StartTimeField replaces DataRangeStartField for ScheduleCalendar - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property StartTimeField() As String - Get - Return MyBase.DataRangeStartField - End Get - Set(ByVal Value As String) - MyBase.DataRangeStartField = Value - End Set - End Property - - ' Hide DataRangeStartField. For ScheduleCalendar, it's called StartTimeField - _ - Public Shadows Property DataRangeStartField() As String - Get - Return MyBase.DataRangeStartField - End Get - Set(ByVal Value As String) - MyBase.DataRangeStartField = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The database field containing the end time of the events. This field should also contain the date when TimeFieldsContainDate=true - ''' - ''' - ''' EndTimeField replaces DataRangeEndField for ScheduleCalendar - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property EndTimeField() As String - Get - Return MyBase.DataRangeEndField - End Get - Set(ByVal Value As String) - MyBase.DataRangeEndField = Value - End Set - End Property - - ' Hide DataRangeEndField. For ScheduleCalendar, it's called EndTimeField - _ - Public Shadows Property DataRangeEndField() As String - Get - Return MyBase.DataRangeEndField - End Get - Set(ByVal Value As String) - MyBase.DataRangeEndField = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The database field providing the dates. Ignored when TimeFieldsContainDate=true. When TimeFieldsContainDate=false, this field should be of type Date - ''' - ''' - ''' DateField replaces TitleField for ScheduleCalendar - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property DateField() As String - Get - Return MyBase.TitleField - End Get - Set(ByVal Value As String) - MyBase.TitleField = Value - End Set - End Property - - ' Hide TitleField. For ScheduleCalendar, it's called DateField - _ - Public Shadows Property TitleField() As String - Get - Return MyBase.TitleField - End Get - Set(ByVal Value As String) - MyBase.TitleField = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The first date to display. - ''' The calendar will start on this date, if not overridden by the - ''' StartDay and NumberOfDays settings. - ''' The default value is the date at the time of display. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property StartDate() As Date - Get - Dim o As Object = ViewState("StartDate") - If Not (o Is Nothing) Then Return CDate(o) - Return DateTime.Today() ' default value - End Get - Set(ByVal Value As Date) - ViewState("StartDate") = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The first day of the week to display. - ''' The calendar will start on this day of the week. - ''' This value is used only when NumberOfDays equals 7. - ''' The default is Monday. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property StartDay() As DayOfWeek - Get - Dim o As Object = ViewState("StartDay") - If Not (o Is Nothing) Then Return CType(o, DayOfWeek) - Return DayOfWeek.Monday ' default value - End Get - Set(ByVal Value As DayOfWeek) - ViewState("StartDay") = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The number of days to display. - ''' This number may be repeated multiple times in Vertical layout when the NumberOfRepetitions - ''' property is greater than 1. - ''' De default value is 7 (weekly calendar). - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property NumberOfDays() As Integer - Get - Dim o As Object = ViewState("NumberOfDays") - If Not (o Is Nothing) Then Return CInt(o) - Return 7 ' default value - End Get - Set(ByVal Value As Integer) - ViewState("NumberOfDays") = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The number of repetitions to show at a time. Only used in Vertical layout. - ''' Especially useful if you want to show several weeks in the calendar, one - ''' below the other. - ''' This property replaces the Weeks property starting from version 1.6.1. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property NumberOfRepetitions() As Integer - Get - ' in horizontal layout, only 1 week is supported - If (Layout = LayoutEnum.Horizontal) Then Return 1 - Dim o As Object = ViewState("NumberOfRepetitions") - If Not (o Is Nothing) Then - Dim w As Integer = CInt(o) - If (w <= 0) Then Return 1 - Return w - End If - Return 1 - End Get - Set(ByVal Value As Integer) - ViewState("NumberOfRepetitions") = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' Obsolete since version 1.6.1. Use the NumberOfRepetitions property instead. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property Weeks() As Integer - Get - Return NumberOfRepetitions - End Get - Set(ByVal Value As Integer) - NumberOfRepetitions = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The format used for the date if the DateTemplate is missing, e.g. {0:ddd d} - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property DateFormatString() As String - Get - Dim o As Object = ViewState("DateFormatString") - If Not (o Is Nothing) Then Return CStr(o) - Return String.Empty - End Get - Set(ByVal Value As String) - ViewState("DateFormatString") = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The format used for the time if the TimeTemplate is missing, e.g. {0:hh:mm} - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property TimeFormatString() As String - Get - Dim o As Object = ViewState("TimeFormatString") - If Not (o Is Nothing) Then Return CStr(o) - Return String.Empty - End Get - Set(ByVal Value As String) - ViewState("TimeFormatString") = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' Indicates whether the time fields (StartTimeField and EndTimeField) contain the date as well. Whe true, this allows midnight spanning for calendar events. When false, the DateField contains the date. - ''' - ''' - ''' TimeFieldsContainDate replaces UseTitleFieldAsDate for ScheduleCalendar - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property TimeFieldsContainDate() As Boolean - Get - Dim o As Object = ViewState("TimeFieldsContainDate") - If Not (o Is Nothing) Then Return CBool(o) - Return False - End Get - Set(ByVal Value As Boolean) - ViewState("TimeFieldsContainDate") = Value - End Set - End Property - -#End Region - -#Region "Styles" - ''' ----------------------------------------------------------------------------- - ''' - ''' The style applied to time header items. - ''' - ''' - ''' TimeStyle replaces RangeHeaderStyle for ScheduleCalendar - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Overridable ReadOnly Property TimeStyle() As TableItemStyle - Get - Return MyBase.RangeHeaderStyle - End Get - End Property - - ' Hide RangeHeaderStyle. For ScheduleCalendar, it's replaced with TimeStyle - _ - Public Shadows ReadOnly Property RangeHeaderStyle() As TableItemStyle - Get - Return MyBase.RangeHeaderStyle - End Get - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The style applied to date header items. - ''' - ''' - ''' DateStyle replaces TitleStyle for ScheduleCalendar - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Overridable ReadOnly Property DateStyle() As TableItemStyle - Get - Return MyBase.TitleStyle - End Get - End Property - - ' Hide TitleStyle. For ScheduleCalendar, it's replaced with DateStyle - _ - Public Shadows ReadOnly Property TitleStyle() As TableItemStyle - Get - Return MyBase.TitleStyle - End Get - End Property - -#End Region - -#Region "Templates" - - Private _DateTemplate As ITemplate - Private _TimeTemplate As ITemplate - - ' DateTemplate replaces TitleTemplate for ScheduleCalendar - _ - Public Property DateTemplate() As ITemplate - Get - Return _DateTemplate - End Get - Set(ByVal Value As ITemplate) - _DateTemplate = Value - End Set - End Property - - ' TimeTemplate replaces RangeHeaderTemplate for ScheduleCalendar - _ - Public Property TimeTemplate() As ITemplate - Get - Return _TimeTemplate - End Get - Set(ByVal Value As ITemplate) - _TimeTemplate = Value - End Set - End Property - -#End Region - -#Region "Methods" - - ' Check if all properties are set to make the control work - Overrides Function CheckConfiguration() As String - If (Not TimeFieldsContainDate AndAlso DateField = "") Then - Return "Either the DateField property must have a non blank value, or TimeFieldsContainDate must be true" - End If - If (StartTimeField = "") Then - Return "The StartTimeField property is not set" - End If - If (EndTimeField = "") Then - Return "The EndTimeField property is not set" - End If - Return String.Empty - End Function - - ''' ----------------------------------------------------------------------------- - ''' - ''' create the list with all times (Start or End) - ''' - ''' - ''' ----------------------------------------------------------------------------- - Overrides Sub FillRangeValueArray(ByRef dv As DataView) - arrRangeValues = New ArrayList - If (FullTimeScale) Then - Dim tsInc As New TimeSpan(0, TimeScaleInterval, 0) - ' ignore data, just fill the time scale - ' add incrementing times to the array - Dim t As TimeSpan = StartOfTimeScale - While TimeSpan.Compare(t, EndOfTimeScale) < 0 - ' use DateTime objects for easy display - Dim dt As DateTime = New DateTime(1, 1, 1, t.Hours, t.Minutes, 0) - arrRangeValues.Add(dt) - t = t.Add(tsInc) - End While - ' Add the end of the timescale as well to make sure it's there - ' e.g. in the case of EndOfTimeScale=23:59 and TimeScaleInterval=1440, this is imperative - Dim dtEnd As DateTime = New DateTime(1, 1, 1 + EndOfTimeScale.Days, EndOfTimeScale.Hours, EndOfTimeScale.Minutes, 0) - arrRangeValues.Add(dtEnd) - Else ' Not FullTimeScale - ' Just add the times from the dataview - Dim j As Integer - For j = 0 To dv.Count - 1 - Dim t1 As Object = dv.Item(j).Item(StartTimeField) - Dim t2 As Object = dv.Item(j).Item(EndTimeField) - If (Not TimeFieldsContainDate) Then - arrRangeValues.Add(t1) - arrRangeValues.Add(t2) - Else ' TimeFieldsContainDate - ' both t1 and t2 should be of type DateTime now - If (Not TypeOf t1 Is DateTime) Then - Throw New HttpException("When TimeFieldsContainDate=True, StartTimeField should be of type DateTime") - End If - Dim dt1 As DateTime = CType(t1, DateTime) - If (Not TypeOf t2 Is DateTime) Then - Throw New HttpException("When TimeFieldsContainDate=True, EndTimeField should be of type DateTime") - End If - Dim dt2 As DateTime = CType(t2, DateTime) - ' remove date part, only store time part in array - arrRangeValues.Add(New DateTime(1, 1, 1, dt1.Hour, dt1.Minute, dt1.Second)) - If (dt2.Hour > 0 Or dt2.Minute > 0 Or dt2.Second > 0) Then - arrRangeValues.Add(New DateTime(1, 1, 1, dt2.Hour, dt2.Minute, dt2.Second)) - Else - ' if the end is 0:00:00 hour, insert 24:00:00 hour instead - arrRangeValues.Add(New DateTime(1, 1, 2, 0, 0, 0)) - End If - End If - Next j - End If - - arrRangeValues.Sort() - RemoveDoubles(arrRangeValues) - - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' When TimeFieldsContainDate=True, items could span over midnight, even several days. - ''' Split them. - ''' - ''' - ''' Used to be called "SplitItemsThatSpanMidnight" - ''' ----------------------------------------------------------------------------- - Overrides Sub PreprocessData(ByRef dv As DataView) - ShiftStartDate() - If (Not TimeFieldsContainDate) Then Return - If (dv Is Nothing) Then Return ' added in v2.1.0.9 - Dim j As Integer = 0 - Dim count As Integer = dv.Count - While (j < count) - Dim drv As DataRowView = dv.Item(j) - Dim dtStartValue As DateTime = CType(drv(StartTimeField), DateTime) - Dim dtEndValue As DateTime = CType(drv(EndTimeField), DateTime) - Dim dateStart As DateTime = New DateTime(dtStartValue.Year, dtStartValue.Month, dtStartValue.Day) - Dim dateEnd As DateTime = New DateTime(dtEndValue.Year, dtEndValue.Month, dtEndValue.Day) - If (dtEndValue.Hour = 0 And dtEndValue.Minute = 0 And dtEndValue.Second = 0) Then - ' when it ends at 0:00:00 hour, it's representing 24:00 hours of the previous day - dateEnd = dateEnd.AddDays(-1) - End If - ' Check if the item spans midnight. If so, split it. - If (dateStart < dateEnd) Then - ' the item spans midnight. We'll truncate the item first, so that it only - ' covers the last day, and we'll add new items for the other day(s) in the loop below. - If (FullTimeScale) Then - ' truncate the item by setting its start time to StartOfTimeScale - drv(StartTimeField) = New DateTime(dateEnd.Year, dateEnd.Month, dateEnd.Day, _ - StartOfTimeScale.Hours, StartOfTimeScale.Minutes, StartOfTimeScale.Seconds) - Else - ' truncate the item by setting its start time to 0:00:00 hours - drv(StartTimeField) = New DateTime(dateEnd.Year, dateEnd.Month, dateEnd.Day, 0, 0, 0) - End If - End If - While (dateStart < dateEnd) - ' If the item spans midnight once, create an additional item for the first day. - ' If it spans midnight several times, create additional items for each day. - Dim drvNew As DataRowView = dv.AddNew() - Dim i As Integer - For i = 0 To dv.Table.Columns.Count - 1 - drvNew(i) = drv(i) ' copy columns one by one - Next i - drvNew(StartTimeField) = dtStartValue - If (FullTimeScale) Then - ' set the end time to the EndOfTimeScale value - Dim dateEnd2 As New DateTime(dateStart.Year, dateStart.Month, dateStart.Day, _ - EndOfTimeScale.Hours, EndOfTimeScale.Minutes, EndOfTimeScale.Seconds) - If (EndOfTimeScale.Equals(New TimeSpan(1, 0, 0, 0))) Then - ' EndOfTimeScale is 24:00 hours. Set the end at 0:00 AM of the next day. - ' We'll catch this case later and show the proper value. - dateEnd2.AddDays(1) - End If - drvNew(EndTimeField) = dateEnd2 - Else - ' Set the end time to 24:00 hours. This is 0:00 AM of the next day. - ' We'll catch this case later and show the proper value. - drvNew(EndTimeField) = New DateTime(dateStart.Year, dateStart.Month, dateStart.Day, 0, 0, 0).AddDays(1) - End If - drvNew.EndEdit() - dateStart = dateStart.AddDays(1) - If (FullTimeScale) Then - ' next item should start at StartOfTimeScale - dtStartValue = New DateTime(dateStart.Year, dateStart.Month, dateStart.Day, _ - StartOfTimeScale.Hours, StartOfTimeScale.Minutes, StartOfTimeScale.Seconds) - Else - ' next item should start at 0:00:00 hour - dtStartValue = New DateTime(dateStart.Year, dateStart.Month, dateStart.Day, 0, 0, 0) - End If - End While - j = j + 1 - End While - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' calculate the TitleIndex in the table, given the objTitleValue - ''' - ''' - ''' - ''' ----------------------------------------------------------------------------- - Protected Overrides Function CalculateTitleIndex(ByVal objTitleValue As Object) As Integer - CalculateTitleIndex = -1 - If (Not TypeOf objTitleValue Is Date AndAlso Not TypeOf objTitleValue Is DateTime) Then - Throw New HttpException("DateField should be of type Date or DateTime in Calendar mode") - End If - Dim dtDate As DateTime = CDate(objTitleValue) - ' remove time part, if any - dtDate = New DateTime(dtDate.Year, dtDate.Month, dtDate.Day, 0, 0, 0) - CalculateTitleIndex = (((dtDate.Subtract(StartDate.Date)).Days) Mod NumberOfDays) + 1 ' fix courtesy of Anthony Main - End Function - - ''' ----------------------------------------------------------------------------- - ''' - ''' Calculate the range cell index in the table, given the objRangeValue and the objTitleValue - ''' The values refer to the real cell index in the table, taking into account whether cells are - ''' spanning over value marks (in horizontal mode) - ''' In vertical layout, the result is the real row index in the table - ''' In horizontal layout, the result is the real cell index in the row (before any merging - ''' of cells due to value spanning) - ''' - ''' The range value from the data source - ''' The title value from the data source - ''' False if we're calculating the range value index for the start of the item, True if it's the end - ''' The range cell index - ''' ----------------------------------------------------------------------------- - Protected Overrides Function CalculateRangeCellIndex(ByVal objRangeValue As Object, ByVal objTitleValue As Object, _ - ByVal isEndValue As Boolean) As Integer - Dim RangeValueIndex As Integer = -1 - ' Find range value index by matching with range values array - If (FullTimeScale AndAlso Not TypeOf objRangeValue Is DateTime) Then - Throw New HttpException("The time field should be of type DateTime when FullTimeScale is set to true") - End If - If (TimeFieldsContainDate AndAlso Not TypeOf objRangeValue Is DateTime) Then - Throw New HttpException("The time field should be of type DateTime when TimeFieldsContainDate is set to true") - End If - Dim k As Integer - If (FullTimeScale) Then - Dim Dobj As DateTime = CType(objRangeValue, DateTime) - ' omit the date part for comparison - Dobj = New DateTime(1, 1, 1, Dobj.Hour, Dobj.Minute, Dobj.Second) - ' if no match is found, use the index of the EndOfTimeScale value - RangeValueIndex = arrRangeValues.Count - For k = 0 To arrRangeValues.Count - 1 - Dim Dk As DateTime = CType(arrRangeValues(k), DateTime) - Dk = New DateTime(1, 1, 1, Dk.Hour, Dk.Minute, Dk.Second) ' omit date part - If (Dobj < Dk And k = 0 And isEndValue) Then - ' ends before start of time scale - Return -1 - End If - If (Dobj >= Dk And k = arrRangeValues.Count - 1 And Not isEndValue) Then - ' starts at or after end of time scale - Return -1 - End If - If (Dobj <= Dk) Then - If (k = 0 And isEndValue) Then - ' This can happen when the end value is 24:00:00, which will - ' match with the value 0:00:00 and give k=0 - ' Instead of the value k=0, use k=arrRangeValues.Count-1 - RangeValueIndex = arrRangeValues.Count - Else - RangeValueIndex = k + 1 - End If - Exit For - End If - Next k - Else ' Not FullTimeScale - If (Not TimeFieldsContainDate) Then - ' find the matching value in arrRangeValues - For k = 0 To arrRangeValues.Count - 1 - If (arrRangeValues(k).ToString() = objRangeValue.ToString()) Then - RangeValueIndex = k + 1 - Exit For - End If - Next k - Else - ' TimeFieldsContainDate=True - Dim Dobj As DateTime = CType(objRangeValue, DateTime) - ' omit the date part for comparison - Dobj = New DateTime(1, 1, 1, Dobj.Hour, Dobj.Minute, Dobj.Second) - For k = 0 To arrRangeValues.Count - 1 - Dim Dk As DateTime = CType(arrRangeValues(k), DateTime) - Dk = New DateTime(1, 1, 1, Dk.Hour, Dk.Minute, Dk.Second) ' omit date part - If (Dobj = Dk) Then - If (k = 0 And isEndValue) Then - ' This can happen when the end value is 24:00:00, which will - ' match with the value 0:00:00, and give k=0 - ' Instead of the value k=0, use k=arrRangeValues.Count-1 - RangeValueIndex = arrRangeValues.Count - Else - RangeValueIndex = k + 1 - End If - Exit For - End If - Next k - End If - End If - - If (Not IncludeEndValue And ShowValueMarks) Then - If (Layout = LayoutEnum.Vertical) Then - ' Each item spans two rows - CalculateRangeCellIndex = RangeValueIndex * 2 - Else - ' Add one cell for the empty background cell on the left - CalculateRangeCellIndex = RangeValueIndex + 1 - End If - Else - CalculateRangeCellIndex = RangeValueIndex - End If - - ' The valueindex that we found corresponds with an item in the first week. - ' If the item is in another week, modify the valueindex accordingly. - ' To find out, check the date of the item - Dim dtDate As DateTime - If (Not TimeFieldsContainDate) Then - ' use objTitleValue for the date - If (Not TypeOf objTitleValue Is Date AndAlso Not TypeOf objTitleValue Is DateTime) Then - Throw New HttpException("The date field should be of type Date or DateTime in Calendar mode when TimeFieldsContainDate=false.") - End If - dtDate = CDate(objTitleValue) - Else - ' use objRangeValue for the date - Dim Dobj As DateTime = CType(objRangeValue, DateTime) - dtDate = New DateTime(Dobj.Year, Dobj.Month, Dobj.Day) - If (isEndValue And Dobj.Hour = 0 And Dobj.Minute = 0 And Dobj.Second = 0) Then - ' when it's the end of the item and the time = 0:00 hours, - ' it's representing 24:00 hours of the previous day - dtDate = dtDate.AddDays(-1) - End If - End If - ' if dtDate is more than NumberOfDays after StartDate, add additional rows - Dim rowsPerWeek As Integer = 1 + arrRangeValues.Count - If (Not IncludeEndValue And ShowValueMarks) Then rowsPerWeek = 1 + arrRangeValues.Count * 2 - - CalculateRangeCellIndex = CalculateRangeCellIndex + ((dtDate.Subtract(StartDate)).Days \ NumberOfDays) * rowsPerWeek - End Function - - Protected Overrides Function GetTitleCount() As Integer - Return NumberOfDays ' make a title cell for every NumberOfDays - End Function - - Overrides Sub AddTitleHeaderData() - Dim nTitles As Integer = GetTitleCount() - - ' iterate arrTitleValues creating a new item for each data item - Dim titleIndex As Integer - For titleIndex = 1 To nTitles - - Dim iWeek As Integer - For iWeek = 0 To NumberOfRepetitions - 1 - Dim obj As Object = StartDate.AddDays(titleIndex - 1 + iWeek * NumberOfDays) - Dim rowsPerWeek As Integer = 1 + arrRangeValues.Count - If (Not IncludeEndValue And ShowValueMarks) Then rowsPerWeek = 1 + arrRangeValues.Count * 2 - Dim rangeIndex As Integer = iWeek * rowsPerWeek - CreateItem(rangeIndex, titleIndex, ScheduleItemType.TitleHeader, True, obj, -1) - Next iWeek - - Next titleIndex - - End Sub - - Protected Overrides Function GetTitleField() As String - If (TimeFieldsContainDate) Then - ' When TimeFieldsContainDate=true, use StartTimeField as Title - Return StartTimeField - Else - Return DateField - End If - End Function - - Public Sub ShiftStartDate() - If (NumberOfDays <> 7) Then Return ' change the start date only for a weekly calendar - ' for any StartDate set by the user, shift it to the previous day indicated by the StartDay property - ' (by default, this will be the previous Monday) - StartDate = StartDate.AddDays(CInt(StartDay) - CInt(StartDate.DayOfWeek())) - If (CInt(StartDay) > CInt(StartDate.DayOfWeek())) Then - StartDate = StartDate.AddDays(-7) - End If - ' StartDate should be on the day of the week indicated by StartDay now - End Sub - - Public Overrides Function GetSortOrder() As String - ' make sure the data is processed in the right order: from bottom right up to top left. - If (Not TimeFieldsContainDate) Then - Return DateField & " ASC, " & StartTimeField & " ASC, " & EndTimeField & " ASC" - Else - ' In Calendar Mode with TimeFieldsContainDate=True, there is no DateField - Return StartTimeField & " ASC, " & EndTimeField & " ASC" - End If - End Function - - Overrides Function GetRepetitionCount() As Integer - Return NumberOfRepetitions - End Function - - ''' ----------------------------------------------------------------------------- - ''' - ''' when there's no template, try to present the data in a reasonable format - ''' - ''' Value of the item - ''' Type of the item - ''' A formatted string - ''' ----------------------------------------------------------------------------- - Protected Overrides Function FormatDataValue(ByVal value As Object, ByVal type As ScheduleItemType) As String - Dim retVal As String = String.Empty - If (Not value Is Nothing) Then - If type = ScheduleItemType.TitleHeader Then - If DateFormatString.Length = 0 Then - retVal = value.ToString() - Else - retVal = String.Format(DateFormatString, value) - End If - ElseIf type = ScheduleItemType.RangeHeader Then - If TimeFormatString.Length = 0 Then - retVal = value.ToString() - Else - retVal = String.Format(TimeFormatString, value) - End If - Else - retVal = value.ToString() - End If - End If - Return retVal - End Function - - Protected Overrides Function GetTemplate(ByVal type As ScheduleItemType) As ITemplate - Select Case type - Case ScheduleItemType.RangeHeader - Return TimeTemplate - Case ScheduleItemType.TitleHeader - Return DateTemplate - Case ScheduleItemType.Item - Return ItemTemplate - Case ScheduleItemType.AlternatingItem - Return ItemTemplate - End Select - Return Nothing - End Function - - '''' ----------------------------------------------------------------------------- - '''' - '''' Calculate the title value given the cell index - '''' - '''' Title index of the cell - '''' Object containing the title - '''' ----------------------------------------------------------------------------- - Public Overrides Function CalculateTitle(ByVal titleIndex As Integer, ByVal cellIndex As Integer) As Object - Dim cellsPerWeek As Integer - If (Not IncludeEndValue And ShowValueMarks) Then - cellsPerWeek = arrRangeValues.Count * 2 + 1 - Else - cellsPerWeek = arrRangeValues.Count + 1 - End If - Dim week As Integer = cellIndex \ cellsPerWeek - Return StartDate.AddDays(titleIndex - 1 + week * 7) - End Function - -#End Region - -End Class diff --git a/Controls/DotNetNuke.Events.ScheduleControl/schedulecommandeventargs.cs b/Controls/DotNetNuke.Events.ScheduleControl/schedulecommandeventargs.cs new file mode 100644 index 0000000..73b20ab --- /dev/null +++ b/Controls/DotNetNuke.Events.ScheduleControl/schedulecommandeventargs.cs @@ -0,0 +1,70 @@ +using System; +using System.Web.UI.WebControls; + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events.ScheduleControl +{ + + /// ----------------------------------------------------------------------------- + /// Project : schedule + /// Class : ScheduleItemEventArgs + /// + /// ----------------------------------------------------------------------------- + /// + /// The ScheduleItemEventArgs class can be used with the OnItemCommand event of the Schedule controls + /// + [CLSCompliant(true)]public sealed class ScheduleCommandEventArgs : CommandEventArgs + { + + private ScheduleItem _item; + private object _commandSource; + + public ScheduleCommandEventArgs(ScheduleItem item, object commandSource, CommandEventArgs originalArgs) : base(originalArgs) + { + this._item = item; + this._commandSource = commandSource; + } + + public ScheduleItem Item + { + get + { + return _item; + } + } + + public dynamic CommandSource + { + get + { + return _commandSource; + } + } + } + + public delegate void ScheduleCommandEventHandler(object sender, ScheduleCommandEventArgs e); + + +} diff --git a/Controls/DotNetNuke.Events.ScheduleControl/schedulecommandeventargs.vb b/Controls/DotNetNuke.Events.ScheduleControl/schedulecommandeventargs.vb deleted file mode 100644 index 6329d29..0000000 --- a/Controls/DotNetNuke.Events.ScheduleControl/schedulecommandeventargs.vb +++ /dev/null @@ -1,60 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Option Strict On - -Imports System -Imports System.Web.UI.WebControls - -''' ----------------------------------------------------------------------------- -''' Project : schedule -''' Class : ScheduleItemEventArgs -''' -''' ----------------------------------------------------------------------------- -''' -''' The ScheduleItemEventArgs class can be used with the OnItemCommand event of the Schedule controls -''' - _ - Public NotInheritable Class ScheduleCommandEventArgs - Inherits CommandEventArgs - - Private _item As ScheduleItem - Private _commandSource As Object - - Public Sub New(ByVal item As ScheduleItem, ByVal commandSource As Object, ByVal originalArgs As CommandEventArgs) - MyBase.New(originalArgs) - Me._item = item - Me._commandSource = commandSource - End Sub - - Public ReadOnly Property Item() As ScheduleItem - Get - Return _item - End Get - End Property - - Public ReadOnly Property CommandSource() As Object - Get - Return _commandSource - End Get - End Property -End Class - - Public Delegate Sub ScheduleCommandEventHandler(ByVal sender As Object, ByVal e As ScheduleCommandEventArgs) - diff --git a/Controls/DotNetNuke.Events.ScheduleControl/scheduledesigneractionlist.vb b/Controls/DotNetNuke.Events.ScheduleControl/scheduledesigneractionlist.vb deleted file mode 100644 index 8611f0c..0000000 --- a/Controls/DotNetNuke.Events.ScheduleControl/scheduledesigneractionlist.vb +++ /dev/null @@ -1,63 +0,0 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2007 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Option Strict On - -Imports System.ComponentModel -Imports System.ComponentModel.Design - -''' ----------------------------------------------------------------------------- -''' Project : schedule -''' Class : ScheduleDesignerActionList -''' -''' ----------------------------------------------------------------------------- -''' -''' ScheduleDesignerActionList adds items to the smart menu tag of the Schedule controls -''' at design time -''' -''' ----------------------------------------------------------------------------- - Public Class ScheduleDesignerActionList - Inherits DesignerActionList - - Private myScheduleControl As BaseSchedule - Private myDesigner As ScheduleDesigner - Private designerActionSvc As DesignerActionService = Nothing - - Public Sub New(ByVal component As IComponent, ByVal designer As ScheduleDesigner) - - MyBase.New(component) - Me.myScheduleControl = CType(component, BaseSchedule) - Me.myDesigner = designer - - ' Cache a reference to DesignerActionService, so the - ' DesigneractionList can be refreshed. - Me.designerActionSvc = CType(GetService(GetType(DesignerActionService)), DesignerActionService) - End Sub - - Public Sub ShowPropertyBuilder() - myDesigner.OnPropertyBuilder(Nothing, EventArgs.Empty) - End Sub - - Public Overrides Function GetSortedActionItems() As DesignerActionItemCollection - Dim items As DesignerActionItemCollection = New DesignerActionItemCollection() - items.Add(New DesignerActionMethodItem(Me, "ShowPropertyBuilder", "Property Builder...", True)) - Return items - End Function - - End Class diff --git a/Controls/DotNetNuke.Events.ScheduleControl/schedulegeneral.cs b/Controls/DotNetNuke.Events.ScheduleControl/schedulegeneral.cs new file mode 100644 index 0000000..4b07b93 --- /dev/null +++ b/Controls/DotNetNuke.Events.ScheduleControl/schedulegeneral.cs @@ -0,0 +1,718 @@ +using System; +using System.Data; +using Microsoft.VisualBasic; +using System.Collections; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.ComponentModel; + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events.ScheduleControl +{ + + /// ----------------------------------------------------------------------------- + /// Project : schedule + /// Class : ScheduleGeneral + /// + /// ----------------------------------------------------------------------------- + /// + /// The ScheduleGeneral web control is designed to represent a schedule in a general format. + /// + /// ----------------------------------------------------------------------------- + [ParseChildren(true)]public class ScheduleGeneral : BaseSchedule + { + +#region Private and protected properties + /// ----------------------------------------------------------------------------- + /// + /// list with values to be shown in title header + /// + /// ----------------------------------------------------------------------------- + protected ArrayList arrTitleValues + { + get + { + return ((ArrayList) (ViewState["arrTitleValues"])); + } + set + { + ViewState["arrTitleValues"] = value; + } + } +#endregion + +#region Public properties + + /// ----------------------------------------------------------------------------- + /// + /// When true, a separate header will be added for the date. + /// This requires DataRangeStartField and DataRangeEndField to be of type DateTime. + /// + /// ----------------------------------------------------------------------------- + [Description("When true, a separate header will be added for the date. This requires DataRangeStartField and DataRangeEndField to be of type DateTime."), DefaultValue(false), Bindable(false), Category("Behavior")]public virtual bool SeparateDateHeader + { + get + { + object o = ViewState["SeparateDateHeader"]; + if (!(ReferenceEquals(o, null))) + { + return System.Convert.ToBoolean(o); + } + return false; + } + set + { + ViewState["SeparateDateHeader"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The format used for the title if the TitleTemplate is missing, e.g. {0:ddd d} + /// + /// ----------------------------------------------------------------------------- + [Description("The format used for the title if the TitleTemplate is missing, e.g. {0:ddd d}"), DefaultValue(""), Category("Data")]public string TitleDataFormatString + { + get + { + object o = ViewState["TitleDataFormatString"]; + if (!(ReferenceEquals(o, null))) + { + return Convert.ToString(o); + } + return string.Empty; + } + set + { + ViewState["TitleDataFormatString"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The format used for the ranges if the RangeHeaderTemplate is missing, e.g. {0:hh:mm} + /// + /// ----------------------------------------------------------------------------- + [Description("The format used for the ranges if the RangeHeaderTemplate is missing, e.g. {0:hh:mm}"), DefaultValue(""), Category("Data")]public string RangeDataFormatString + { + get + { + object o = ViewState["RangeDataFormatString"]; + if (!(ReferenceEquals(o, null))) + { + return Convert.ToString(o); + } + return string.Empty; + } + set + { + ViewState["RangeDataFormatString"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// The format used for the date header if SeparateDateHeader=True and the DateHeaderTemplate is missing, e.g. {0:dd/MM} + /// + /// ----------------------------------------------------------------------------- + [Description("The format used for the date header if SeparateDateHeader=true and the DateHeaderTemplate is missing, e.g. {0:dd/MM}"), DefaultValue(""), Category("Data")]public string DateHeaderDataFormatString + { + get + { + object o = ViewState["DateHeaderDataFormatString"]; + if (!(ReferenceEquals(o, null))) + { + return Convert.ToString(o); + } + return string.Empty; + } + set + { + ViewState["DateHeaderDataFormatString"] = value; + } + } + + /// ----------------------------------------------------------------------------- + /// + /// When true, titles will automatically be sorted alphabetically. + /// When false, you may provide your own sorting order for the titles, but make sure + /// that the items with the same titles are grouped together, and that for each title, + /// the items are sorted on DataRangeStartField first and on DataRangeEndField next. + /// (for example: if you want to sort on a field called "SortOrder", the + /// DataRangeStartField is "StartTime", and the DataRangeEndField is "EndTime", + /// use the sorting expression "ORDER BY SortOrder ASC, StartTime ASC, EndTime ASC") + /// The default value for AutoSortTitles is true. + /// + /// ----------------------------------------------------------------------------- + [Description("When true, titles will automatically be sorted alphabetically. When false, the data source should be sorted properly before binding."), DefaultValue(true), Bindable(false), Category("Behavior")]public virtual bool AutoSortTitles + { + get + { + object o = ViewState["AutoSortTitles"]; + if (!(ReferenceEquals(o, null))) + { + return System.Convert.ToBoolean(o); + } + return true; + } + set + { + ViewState["AutoSortTitles"] = value; + } + } + +#endregion + +#region Templates + + private ITemplate _TitleTemplate; + private ITemplate _RangeHeaderTemplate; + private ITemplate _dateHeaderTemplate; // only used when DisplayMode=General and SeparateDateHeader=True + + [TemplateContainer(typeof(ScheduleItem)), Browsable(false), Description("The template used to create title header content."), NotifyParentProperty(true), PersistenceMode(PersistenceMode.InnerProperty)]public ITemplate TitleTemplate + { + get + { + return _TitleTemplate; + } + set + { + _TitleTemplate = value; + } + } + + [TemplateContainer(typeof(ScheduleItem)), Browsable(false), Description("The template used to create range header content."), PersistenceMode(PersistenceMode.InnerProperty)]public ITemplate RangeHeaderTemplate + { + get + { + return _RangeHeaderTemplate; + } + set + { + _RangeHeaderTemplate = value; + } + } + + [TemplateContainer(typeof(ScheduleItem)), Browsable(false), Description("The template used to create date header content."), PersistenceMode(PersistenceMode.InnerProperty)]public ITemplate DateHeaderTemplate + { + get + { + return _dateHeaderTemplate; + } + set + { + _dateHeaderTemplate = value; + } + } + +#endregion + +#region Methods + // Check if all properties are set to make the control work + override public string CheckConfiguration() + { + if (TitleField == "") + { + return "The TitleField property is not set"; + } + if (DataRangeStartField == "") + { + return "The DataRangeStartField property is not set"; + } + if (DataRangeEndField == "") + { + return "The DataRangeEndField property is not set"; + } + return string.Empty; + } + /// ----------------------------------------------------------------------------- + /// + /// create the list with all range header values (Start or End) + /// + /// + /// ----------------------------------------------------------------------------- + override public void FillRangeValueArray(ref DataView dv) + { + arrRangeValues = new ArrayList(); + string strOldSort = dv.Sort; + if (FullTimeScale) + { + TimeSpan tsInc = new TimeSpan(0, TimeScaleInterval, 0); + if (dv.Count == 0) + { + return ; // empty database + } + dv.Sort = DataRangeStartField + " ASC "; + // Nulls are allowed (for creating titles without content) but will not show up + int i = 0; + while (i < dv.Count && Information.IsDBNull(dv[i][DataRangeStartField])) + { + i++; + } + if (i >= dv.Count) + { + return ; + } + DateTime dt1 = System.Convert.ToDateTime(dv[i][DataRangeStartField]); // first start time in dataview + dv.Sort = DataRangeEndField + " DESC "; + i = 0; + while (Information.IsDBNull(dv[i][DataRangeStartField])) + { + i++; + } + DateTime dt2 = System.Convert.ToDateTime(dv[i][DataRangeEndField]); // last end time in dataview + // add incrementing times to the array + while (dt1 <= dt2) + { + TimeSpan t = StartOfTimeScale; + while (TimeSpan.Compare(t, EndOfTimeScale) < 0) + { + DateTime dt = new DateTime(dt1.Year, dt1.Month, dt1.Day, t.Hours, t.Minutes, 0); + arrRangeValues.Add(dt); + t = t.Add(tsInc); + } + // Add the end of the timescale as well to make sure it's there + // e.g. in the case of EndOfTimeScale=23:59 and TimeScaleInterval=1440, this is imperative + DateTime dtEnd = new DateTime(dt1.Year, dt1.Month, dt1.Day, EndOfTimeScale.Hours, EndOfTimeScale.Minutes, 0); + arrRangeValues.Add(dtEnd); + dt1 = dt1.AddDays(1); + } + } + else // Not FullTimeScale + { + // Just add the times from the dataview + int j = 0; + for (j = 0; j <= dv.Count - 1; j++) + { + // Nulls are allowed (for creating titles without content) but will not show up + if (!Information.IsDBNull(dv[j][DataRangeStartField])) + { + object t1 = dv[j][DataRangeStartField]; + object t2 = dv[j][DataRangeEndField]; + arrRangeValues.Add(t1); + arrRangeValues.Add(t2); + } + } + } + + arrRangeValues.Sort(); + RemoveDoubles(arrRangeValues); + dv.Sort = strOldSort; + } + + /// ----------------------------------------------------------------------------- + /// + /// create the list with all titles + /// + /// + /// ----------------------------------------------------------------------------- + override public void FillTitleValueArray(ref DataView dv) + { + arrTitleValues = new ArrayList(); + int i = 0; + for (i = 0; i <= dv.Count - 1; i++) + { + object val = dv[i][TitleField]; + arrTitleValues.Add(val); + } + if (AutoSortTitles) + { + arrTitleValues.Sort(); + } + RemoveDoubles(arrTitleValues); + } + + /// ----------------------------------------------------------------------------- + /// + /// Add date headers to the table when SeparateDateHeader=True + /// + /// ----------------------------------------------------------------------------- + override public void AddDateHeaderData() + { + if (!SeparateDateHeader) + { + return ; + } + // merge all cells having the same date in the first (date) header + if (arrRangeValues.Count == 0) + { + return ; + } + if (!(arrRangeValues[0] is DateTime)&& !(arrRangeValues[0] is DateTime)) + { + throw (new HttpException("If SeparateDateHeader is true, then DataRangeStartField " + " and DataRangeEndField need to be of type DateTime")); + } + if (Layout == LayoutEnum.Horizontal) + { + // In horizontal mode, add an extra row for date headers + Table1.Rows.AddAt(0, new TableRow()); + } + Table1.Rows[0].Cells.AddAt(0, new TableHeaderCell()); + Table1.Rows[0].Cells[0].ApplyStyle(TitleStyle); + + DateTime prevRangeValue = System.Convert.ToDateTime(arrRangeValues[arrRangeValues.Count - 1]); + int prevStartValueIndex = arrRangeValues.Count; + if (!IncludeEndValue && ShowValueMarks) + { + prevStartValueIndex = arrRangeValues.Count * 2 - 1; + } + + int i = 0; + for (i = arrRangeValues.Count - 1; i >= 0; i--) + { + DateTime arrRangeValue = System.Convert.ToDateTime(arrRangeValues[i]); + if (arrRangeValue.Date != prevRangeValue.Date) + { + // this value has another date than the previous one (the one below or to the right) + // add a cell below or to the right which spans the cells that have the same date + int ValueIndexOfNextCell = i + 2; // add 1 for the title cell and 1 because it's the next cell, not this one + int Span = prevStartValueIndex - ValueIndexOfNextCell + 1; + + if (!IncludeEndValue && ShowValueMarks) + { + ValueIndexOfNextCell = i * 2 + 3; + Span = prevStartValueIndex - ValueIndexOfNextCell + 2; + } + + TableCell cell = default(TableCell); + if (Layout == LayoutEnum.Vertical) + { + Table1.Rows[ValueIndexOfNextCell].Cells.AddAt(0, new TableHeaderCell()); + cell = Table1.Rows[ValueIndexOfNextCell].Cells[0]; + cell.RowSpan = Span; + } + else // Horizontal + { + Table1.Rows[0].Cells.AddAt(1, new TableHeaderCell()); + cell = Table1.Rows[0].Cells[1]; + cell.ColumnSpan = Span; + } + cell.ApplyStyle(RangeHeaderStyle); + prevRangeValue = arrRangeValue; + prevStartValueIndex = i + 1; + if (!IncludeEndValue && ShowValueMarks) + { + prevStartValueIndex = i * 2 + 1; + } + } + } + // finish by adding the first cell also + TableCell cell0 = default(TableCell); + int Span0 = prevStartValueIndex; + if (!IncludeEndValue && ShowValueMarks) + { + Span0++; + } + + if (Layout == LayoutEnum.Vertical) + { + Table1.Rows[1].Cells.AddAt(0, new TableHeaderCell()); + cell0 = Table1.Rows[1].Cells[0]; + cell0.RowSpan = Span0; + } + else // Horizontal + { + Table1.Rows[0].Cells.AddAt(1, new TableHeaderCell()); + cell0 = Table1.Rows[0].Cells[1]; + cell0.ColumnSpan = Span0; + } + cell0.ApplyStyle(RangeHeaderStyle); + + // iterate arrRangeValues in forward direction creating a new item for each data item + // forward because it has to be in the same order as after postback, and there it's\ + // much easier if it's forward + int cellIndex = 1; + i = 0; + while (i < arrRangeValues.Count) + { + DateTime arrRangeValue = System.Convert.ToDateTime(arrRangeValues[i]); + CreateItem(cellIndex, 0, ScheduleItemType.DateHeader, true, arrRangeValue, -1); + int Span = GetValueSpan(cellIndex, 0); + if (Span == 0) + { + Span = 1; + } + if (Layout == LayoutEnum.Horizontal) + { + cellIndex++; + } + else + { + cellIndex += Span; + } + if (!IncludeEndValue && ShowValueMarks) + { + i += Span / 2; + } + else + { + i += Span; + } + } + } + + /// ----------------------------------------------------------------------------- + /// + /// calculate the TitleIndex in the table, given the objTitleValue + /// + /// + /// + /// ----------------------------------------------------------------------------- + protected override int CalculateTitleIndex(object objTitleValue) + { + // Find the title index by matching with the title values array + int k = 0; + for (k = 0; k <= arrTitleValues.Count - 1; k++) + { + if (arrTitleValues[k].ToString() == objTitleValue.ToString()) + { + return k + 1; + } + } + return -1; + } + + /// ----------------------------------------------------------------------------- + /// + /// Calculate the range cell index in the table, given the objRangeValue and the objTitleValue + /// The values refer to the real cell index in the table, taking into account whether cells are + /// spanning over value marks (in horizontal mode) + /// In vertical layout, the result is the real row index in the table + /// In horizontal layout, the result is the real cell index in the row (before any merging + /// of cells due to value spanning) + /// + /// The range value from the data source + /// The title value from the data source + /// False if we're calculating the range value index for the start of the item, True if it's the end + /// The range cell index + /// ----------------------------------------------------------------------------- + protected override int CalculateRangeCellIndex(object objRangeValue, object objTitleValue, bool isEndValue) + { + if (Information.IsDBNull(objRangeValue)) + { + return -1; + } + int RangeValueIndex = -1; + // Find range value index by matching with range values array + if (FullTimeScale && !(objRangeValue is DateTime)) + { + throw (new HttpException("The range field should be of type DateTime when FullTimeScale is set to true")); + } + int k = 0; + if (FullTimeScale) + { + DateTime Dobj = System.Convert.ToDateTime(objRangeValue); + // if no match is found, use the index of the EndOfTimeScale value + RangeValueIndex = arrRangeValues.Count; + for (k = 0; k <= arrRangeValues.Count - 1; k++) + { + DateTime Dk = System.Convert.ToDateTime(arrRangeValues[k]); + if (Dobj <= Dk) + { + if (k == 0 && isEndValue) + { + // This can happen when the end value is 24:00:00, which will + // match with the value 0:00:00 and give k=0 + // Instead of the value k=0, use k=arrRangeValues.Count-1 + RangeValueIndex = arrRangeValues.Count; + } + else + { + RangeValueIndex = k + 1; + } + break; + } + } + } + else // Not FullTimeScale + { + // find the matching value in arrRangeValues + for (k = 0; k <= arrRangeValues.Count - 1; k++) + { + if (arrRangeValues[k].ToString() == objRangeValue.ToString()) + { + RangeValueIndex = k + 1; + break; + } + } + } + if (!IncludeEndValue && ShowValueMarks) + { + if (Layout == LayoutEnum.Vertical) + { + // Each item spans two rows + return RangeValueIndex * 2; + } + else + { + // Add one cell for the empty background cell on the left + return RangeValueIndex + 1; + } + } + else + { + return RangeValueIndex; + } + } + + protected override int GetTitleCount() + { + return arrTitleValues.Count; + } + + override public int GetRangeHeaderIndex() + { + // when SeparateDateHeader=True, the first index (column or row) is the date header, + // the second (column or row) contains the range values + return System.Convert.ToInt32(SeparateDateHeader ? 1 : 0); + } + + override public void AddTitleHeaderData() + { + int nTitles = GetTitleCount(); + + // iterate arrTitleValues creating a new item for each data item + int titleIndex = 0; + for (titleIndex = 1; titleIndex <= nTitles; titleIndex++) + { + object obj = arrTitleValues[titleIndex - 1]; + CreateItem(0, titleIndex, ScheduleItemType.TitleHeader, true, obj, -1); + } + } + + public override string GetSortOrder() + { + // make sure the data is processed in the right order: from bottom right up to top left. + if (AutoSortTitles) + { + return TitleField + " ASC, " + DataRangeStartField + " ASC, " + DataRangeEndField + " ASC"; + } + else + { + return ""; // leave sort order as it is when AutoSortTitles=False + } + } + + /// ----------------------------------------------------------------------------- + /// + /// when there's no template, try to present the data in a reasonable format + /// + /// Value of the item + /// Type of the item + /// A formatted string + /// ----------------------------------------------------------------------------- + protected override string FormatDataValue(object value, ScheduleItemType type) + { + string retVal = string.Empty; + if (!ReferenceEquals(value, null)) + { + if (type == ScheduleItemType.TitleHeader) + { + if (TitleDataFormatString.Length == 0) + { + retVal = value.ToString(); + } + else + { + retVal = string.Format(TitleDataFormatString, value); + } + } + else if (type == ScheduleItemType.RangeHeader) + { + if (RangeDataFormatString.Length == 0) + { + retVal = value.ToString(); + } + else + { + retVal = string.Format(RangeDataFormatString, value); + } + } + else if (type == ScheduleItemType.DateHeader) + { + if (DateHeaderDataFormatString.Length == 0) + { + retVal = value.ToString(); + } + else + { + retVal = string.Format(DateHeaderDataFormatString, value); + } + } + else + { + retVal = value.ToString(); + } + } + return retVal; + } + + protected override ITemplate GetTemplate(ScheduleItemType type) + { + switch (type) + { + case ScheduleItemType.RangeHeader: + return RangeHeaderTemplate; + case ScheduleItemType.TitleHeader: + return TitleTemplate; + case ScheduleItemType.DateHeader: + return DateHeaderTemplate; + case ScheduleItemType.Item: + return ItemTemplate; + case ScheduleItemType.AlternatingItem: + return ItemTemplate; + } + return null; + } + + protected override TableItemStyle GetStyle(ScheduleItemType type) + { + // handle DateHeader, which is not handled in the base class + if (type == ScheduleItemType.DateHeader) + { + return RangeHeaderStyle; + } + return base.GetStyle(type); + } + + ///' ----------------------------------------------------------------------------- + ///' + ///' Calculate the title (data source value) given the cell index + ///' + ///' Title index of the cell + ///' Object containing the title + ///' ----------------------------------------------------------------------------- + public override dynamic CalculateTitle(int titleIndex, int cellIndex) + { + return arrTitleValues[titleIndex - 1]; + } + +#endregion + + } + + +} diff --git a/Controls/DotNetNuke.Events.ScheduleControl/schedulegeneral.vb b/Controls/DotNetNuke.Events.ScheduleControl/schedulegeneral.vb deleted file mode 100644 index 91976d8..0000000 --- a/Controls/DotNetNuke.Events.ScheduleControl/schedulegeneral.vb +++ /dev/null @@ -1,580 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Option Strict On - -Imports System -Imports System.Data -Imports System.Collections -Imports System.Web -Imports System.Web.UI -Imports System.Web.UI.WebControls -Imports Microsoft.VisualBasic ' needed for IIf definition -Imports System.ComponentModel - -''' ----------------------------------------------------------------------------- -''' Project : schedule -''' Class : ScheduleGeneral -''' -''' ----------------------------------------------------------------------------- -''' -''' The ScheduleGeneral web control is designed to represent a schedule in a general format. -''' -''' ----------------------------------------------------------------------------- - _ - Public Class ScheduleGeneral : Inherits BaseSchedule - -#Region "Private and protected properties" - ''' ----------------------------------------------------------------------------- - ''' - ''' list with values to be shown in title header - ''' - ''' ----------------------------------------------------------------------------- - Protected Property arrTitleValues() As ArrayList - Get - Return CType(ViewState("arrTitleValues"), ArrayList) - End Get - Set(ByVal value As ArrayList) - ViewState("arrTitleValues") = value - End Set - End Property -#End Region - -#Region "Public properties" - - ''' ----------------------------------------------------------------------------- - ''' - ''' When true, a separate header will be added for the date. - ''' This requires DataRangeStartField and DataRangeEndField to be of type DateTime. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Overridable Property SeparateDateHeader() As Boolean - Get - Dim o As Object = ViewState("SeparateDateHeader") - If Not (o Is Nothing) Then - Return CBool(o) - End If - Return False - End Get - Set(ByVal Value As Boolean) - ViewState("SeparateDateHeader") = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The format used for the title if the TitleTemplate is missing, e.g. {0:ddd d} - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property TitleDataFormatString() As String - Get - Dim o As Object = ViewState("TitleDataFormatString") - If Not (o Is Nothing) Then Return CStr(o) - Return String.Empty - End Get - Set(ByVal Value As String) - ViewState("TitleDataFormatString") = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The format used for the ranges if the RangeHeaderTemplate is missing, e.g. {0:hh:mm} - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property RangeDataFormatString() As String - Get - Dim o As Object = ViewState("RangeDataFormatString") - If Not (o Is Nothing) Then Return CStr(o) - Return String.Empty - End Get - Set(ByVal Value As String) - ViewState("RangeDataFormatString") = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' The format used for the date header if SeparateDateHeader=True and the DateHeaderTemplate is missing, e.g. {0:dd/MM} - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Property DateHeaderDataFormatString() As String - Get - Dim o As Object = ViewState("DateHeaderDataFormatString") - If Not (o Is Nothing) Then Return CStr(o) - Return String.Empty - End Get - Set(ByVal Value As String) - ViewState("DateHeaderDataFormatString") = Value - End Set - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' When true, titles will automatically be sorted alphabetically. - ''' When false, you may provide your own sorting order for the titles, but make sure - ''' that the items with the same titles are grouped together, and that for each title, - ''' the items are sorted on DataRangeStartField first and on DataRangeEndField next. - ''' (for example: if you want to sort on a field called "SortOrder", the - ''' DataRangeStartField is "StartTime", and the DataRangeEndField is "EndTime", - ''' use the sorting expression "ORDER BY SortOrder ASC, StartTime ASC, EndTime ASC") - ''' The default value for AutoSortTitles is true. - ''' - ''' ----------------------------------------------------------------------------- - _ - Public Overridable Property AutoSortTitles() As Boolean - Get - Dim o As Object = ViewState("AutoSortTitles") - If Not (o Is Nothing) Then - Return CBool(o) - End If - Return True - End Get - Set(ByVal Value As Boolean) - ViewState("AutoSortTitles") = Value - End Set - End Property - -#End Region - -#Region "Templates" - - Private _TitleTemplate As ITemplate - Private _RangeHeaderTemplate As ITemplate - Private _dateHeaderTemplate As ITemplate ' only used when DisplayMode=General and SeparateDateHeader=True - - _ - Public Property TitleTemplate() As ITemplate - Get - Return _TitleTemplate - End Get - Set(ByVal Value As ITemplate) - _TitleTemplate = Value - End Set - End Property - - _ - Public Property RangeHeaderTemplate() As ITemplate - Get - Return _RangeHeaderTemplate - End Get - Set(ByVal Value As ITemplate) - _RangeHeaderTemplate = Value - End Set - End Property - - _ - Public Property DateHeaderTemplate() As ITemplate - Get - Return _dateHeaderTemplate - End Get - Set(ByVal Value As ITemplate) - _dateHeaderTemplate = Value - End Set - End Property - -#End Region - -#Region "Methods" - ' Check if all properties are set to make the control work - Overrides Function CheckConfiguration() As String - If (TitleField = "") Then - Return "The TitleField property is not set" - End If - If (DataRangeStartField = "") Then - Return "The DataRangeStartField property is not set" - End If - If (DataRangeEndField = "") Then - Return "The DataRangeEndField property is not set" - End If - Return String.Empty - End Function - ''' ----------------------------------------------------------------------------- - ''' - ''' create the list with all range header values (Start or End) - ''' - ''' - ''' ----------------------------------------------------------------------------- - Overrides Sub FillRangeValueArray(ByRef dv As DataView) - arrRangeValues = New ArrayList - Dim strOldSort As String = dv.Sort - If (FullTimeScale) Then - Dim tsInc As New TimeSpan(0, TimeScaleInterval, 0) - If (dv.Count = 0) Then Return ' empty database - dv.Sort = DataRangeStartField & " ASC " - ' Nulls are allowed (for creating titles without content) but will not show up - Dim i As Integer = 0 - While (i < dv.Count AndAlso IsDBNull(dv.Item(i).Item(DataRangeStartField))) - i = i + 1 - End While - If (i >= dv.Count) Then Return - Dim dt1 As DateTime = CType(dv.Item(i).Item(DataRangeStartField), DateTime) ' first start time in dataview - dv.Sort = DataRangeEndField & " DESC " - i = 0 - While (IsDBNull(dv.Item(i).Item(DataRangeStartField))) - i = i + 1 - End While - Dim dt2 As DateTime = CType(dv.Item(i).Item(DataRangeEndField), DateTime) ' last end time in dataview - ' add incrementing times to the array - While dt1 <= dt2 - Dim t As TimeSpan = StartOfTimeScale - While TimeSpan.Compare(t, EndOfTimeScale) < 0 - Dim dt As DateTime = New DateTime(dt1.Year, dt1.Month, dt1.Day, t.Hours, t.Minutes, 0) - arrRangeValues.Add(dt) - t = t.Add(tsInc) - End While - ' Add the end of the timescale as well to make sure it's there - ' e.g. in the case of EndOfTimeScale=23:59 and TimeScaleInterval=1440, this is imperative - Dim dtEnd As DateTime = New DateTime(dt1.Year, dt1.Month, dt1.Day, EndOfTimeScale.Hours, EndOfTimeScale.Minutes, 0) - arrRangeValues.Add(dtEnd) - dt1 = dt1.AddDays(1) - End While - Else ' Not FullTimeScale - ' Just add the times from the dataview - Dim j As Integer - For j = 0 To dv.Count - 1 - ' Nulls are allowed (for creating titles without content) but will not show up - If (Not IsDBNull(dv.Item(j).Item(DataRangeStartField))) Then - Dim t1 As Object = dv.Item(j).Item(DataRangeStartField) - Dim t2 As Object = dv.Item(j).Item(DataRangeEndField) - arrRangeValues.Add(t1) - arrRangeValues.Add(t2) - End If - Next j - End If - - arrRangeValues.Sort() - RemoveDoubles(arrRangeValues) - dv.Sort = strOldSort - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' create the list with all titles - ''' - ''' - ''' ----------------------------------------------------------------------------- - Overrides Sub FillTitleValueArray(ByRef dv As DataView) - arrTitleValues = New ArrayList - Dim i As Integer - For i = 0 To dv.Count - 1 - Dim val As Object = dv.Item(i).Item(TitleField) - arrTitleValues.Add(val) - Next i - If (AutoSortTitles) Then - arrTitleValues.Sort() - End If - RemoveDoubles(arrTitleValues) - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' Add date headers to the table when SeparateDateHeader=True - ''' - ''' ----------------------------------------------------------------------------- - Overrides Sub AddDateHeaderData() - If (Not SeparateDateHeader) Then Return - ' merge all cells having the same date in the first (date) header - If (arrRangeValues.Count = 0) Then Return - If (Not TypeOf arrRangeValues(0) Is DateTime AndAlso Not TypeOf arrRangeValues(0) Is Date) Then - Throw New HttpException("If SeparateDateHeader is true, then DataRangeStartField " & _ - " and DataRangeEndField need to be of type DateTime") - End If - If (Layout = LayoutEnum.Horizontal) Then - ' In horizontal mode, add an extra row for date headers - Table1.Rows.AddAt(0, New TableRow()) - End If - Table1.Rows(0).Cells.AddAt(0, New TableHeaderCell) - Table1.Rows(0).Cells(0).ApplyStyle(TitleStyle) - - Dim prevRangeValue As DateTime = CDate(arrRangeValues(arrRangeValues.Count - 1)) - Dim prevStartValueIndex As Integer = arrRangeValues.Count - If (Not IncludeEndValue And ShowValueMarks) Then prevStartValueIndex = arrRangeValues.Count * 2 - 1 - - Dim i As Integer - For i = arrRangeValues.Count - 1 To 0 Step -1 - Dim arrRangeValue As DateTime = CDate(arrRangeValues(i)) - If (arrRangeValue.Date <> prevRangeValue.Date) Then - ' this value has another date than the previous one (the one below or to the right) - ' add a cell below or to the right which spans the cells that have the same date - Dim ValueIndexOfNextCell As Integer = i + 2 ' add 1 for the title cell and 1 because it's the next cell, not this one - Dim Span As Integer = prevStartValueIndex - ValueIndexOfNextCell + 1 - - If (Not IncludeEndValue And ShowValueMarks) Then - ValueIndexOfNextCell = i * 2 + 3 - Span = prevStartValueIndex - ValueIndexOfNextCell + 2 - End If - - Dim cell As TableCell - If (Layout = LayoutEnum.Vertical) Then - Table1.Rows(ValueIndexOfNextCell).Cells.AddAt(0, New TableHeaderCell()) - cell = Table1.Rows(ValueIndexOfNextCell).Cells(0) - cell.RowSpan = Span - Else ' Horizontal - Table1.Rows(0).Cells.AddAt(1, New TableHeaderCell()) - cell = Table1.Rows(0).Cells(1) - cell.ColumnSpan = Span - End If - cell.ApplyStyle(RangeHeaderStyle) - prevRangeValue = arrRangeValue - prevStartValueIndex = i + 1 - If (Not IncludeEndValue And ShowValueMarks) Then prevStartValueIndex = i * 2 + 1 - End If - Next i - ' finish by adding the first cell also - Dim cell0 As TableCell - Dim Span0 As Integer = prevStartValueIndex - If (Not IncludeEndValue And ShowValueMarks) Then Span0 += 1 - - If (Layout = LayoutEnum.Vertical) Then - Table1.Rows(1).Cells.AddAt(0, New TableHeaderCell()) - cell0 = Table1.Rows(1).Cells(0) - cell0.RowSpan = Span0 - Else ' Horizontal - Table1.Rows(0).Cells.AddAt(1, New TableHeaderCell()) - cell0 = Table1.Rows(0).Cells(1) - cell0.ColumnSpan = Span0 - End If - cell0.ApplyStyle(RangeHeaderStyle) - - ' iterate arrRangeValues in forward direction creating a new item for each data item - ' forward because it has to be in the same order as after postback, and there it's\ - ' much easier if it's forward - Dim cellIndex As Integer = 1 - i = 0 - While i < arrRangeValues.Count - Dim arrRangeValue As DateTime = CDate(arrRangeValues(i)) - CreateItem(cellIndex, 0, ScheduleItemType.DateHeader, True, arrRangeValue, -1) - Dim Span As Integer = GetValueSpan(cellIndex, 0) - If (Span = 0) Then Span = 1 - If Layout = LayoutEnum.Horizontal Then - cellIndex += 1 - Else - cellIndex += Span - End If - If (Not IncludeEndValue And ShowValueMarks) Then - i += Span \ 2 - Else - i += Span - End If - End While - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' calculate the TitleIndex in the table, given the objTitleValue - ''' - ''' - ''' - ''' ----------------------------------------------------------------------------- - Protected Overrides Function CalculateTitleIndex(ByVal objTitleValue As Object) As Integer - ' Find the title index by matching with the title values array - Dim k As Integer - For k = 0 To arrTitleValues.Count - 1 - If (arrTitleValues(k).ToString() = objTitleValue.ToString()) Then - Return k + 1 - End If - Next k - Return -1 - End Function - - ''' ----------------------------------------------------------------------------- - ''' - ''' Calculate the range cell index in the table, given the objRangeValue and the objTitleValue - ''' The values refer to the real cell index in the table, taking into account whether cells are - ''' spanning over value marks (in horizontal mode) - ''' In vertical layout, the result is the real row index in the table - ''' In horizontal layout, the result is the real cell index in the row (before any merging - ''' of cells due to value spanning) - ''' - ''' The range value from the data source - ''' The title value from the data source - ''' False if we're calculating the range value index for the start of the item, True if it's the end - ''' The range cell index - ''' ----------------------------------------------------------------------------- - Protected Overrides Function CalculateRangeCellIndex(ByVal objRangeValue As Object, ByVal objTitleValue As Object, _ - ByVal isEndValue As Boolean) As Integer - If (IsDBNull(objRangeValue)) Then Return -1 - Dim RangeValueIndex As Integer = -1 - ' Find range value index by matching with range values array - If (FullTimeScale AndAlso Not TypeOf objRangeValue Is DateTime) Then - Throw New HttpException("The range field should be of type DateTime when FullTimeScale is set to true") - End If - Dim k As Integer - If (FullTimeScale) Then - Dim Dobj As DateTime = CType(objRangeValue, DateTime) - ' if no match is found, use the index of the EndOfTimeScale value - RangeValueIndex = arrRangeValues.Count - For k = 0 To arrRangeValues.Count - 1 - Dim Dk As DateTime = CType(arrRangeValues(k), DateTime) - If (Dobj <= Dk) Then - If (k = 0 And isEndValue) Then - ' This can happen when the end value is 24:00:00, which will - ' match with the value 0:00:00 and give k=0 - ' Instead of the value k=0, use k=arrRangeValues.Count-1 - RangeValueIndex = arrRangeValues.Count - Else - RangeValueIndex = k + 1 - End If - Exit For - End If - Next k - Else ' Not FullTimeScale - ' find the matching value in arrRangeValues - For k = 0 To arrRangeValues.Count - 1 - If (arrRangeValues(k).ToString() = objRangeValue.ToString()) Then - RangeValueIndex = k + 1 - Exit For - End If - Next k - End If - If (Not IncludeEndValue And ShowValueMarks) Then - If (Layout = LayoutEnum.Vertical) Then - ' Each item spans two rows - Return RangeValueIndex * 2 - Else - ' Add one cell for the empty background cell on the left - Return RangeValueIndex + 1 - End If - Else - Return RangeValueIndex - End If - End Function - - Protected Overrides Function GetTitleCount() As Integer - Return arrTitleValues.Count - End Function - - Overrides Function GetRangeHeaderIndex() As Integer - ' when SeparateDateHeader=True, the first index (column or row) is the date header, - ' the second (column or row) contains the range values - Return CInt(IIf(SeparateDateHeader, 1, 0)) - End Function - - Overrides Sub AddTitleHeaderData() - Dim nTitles As Integer = GetTitleCount() - - ' iterate arrTitleValues creating a new item for each data item - Dim titleIndex As Integer - For titleIndex = 1 To nTitles - Dim obj As Object = arrTitleValues.Item(titleIndex - 1) - CreateItem(0, titleIndex, ScheduleItemType.TitleHeader, True, obj, -1) - Next titleIndex - End Sub - - Public Overrides Function GetSortOrder() As String - ' make sure the data is processed in the right order: from bottom right up to top left. - If (AutoSortTitles) Then - Return TitleField & " ASC, " & DataRangeStartField & " ASC, " & DataRangeEndField & " ASC" - Else - Return "" ' leave sort order as it is when AutoSortTitles=False - End If - End Function - - ''' ----------------------------------------------------------------------------- - ''' - ''' when there's no template, try to present the data in a reasonable format - ''' - ''' Value of the item - ''' Type of the item - ''' A formatted string - ''' ----------------------------------------------------------------------------- - Protected Overrides Function FormatDataValue(ByVal value As Object, ByVal type As ScheduleItemType) As String - Dim retVal As String = String.Empty - If (Not value Is Nothing) Then - If type = ScheduleItemType.TitleHeader Then - If TitleDataFormatString.Length = 0 Then - retVal = value.ToString() - Else - retVal = String.Format(TitleDataFormatString, value) - End If - ElseIf type = ScheduleItemType.RangeHeader Then - If RangeDataFormatString.Length = 0 Then - retVal = value.ToString() - Else - retVal = String.Format(RangeDataFormatString, value) - End If - ElseIf type = ScheduleItemType.DateHeader Then - If DateHeaderDataFormatString.Length = 0 Then - retVal = value.ToString() - Else - retVal = String.Format(DateHeaderDataFormatString, value) - End If - Else - retVal = value.ToString() - End If - End If - Return retVal - End Function - - Protected Overrides Function GetTemplate(ByVal type As ScheduleItemType) As ITemplate - Select Case type - Case ScheduleItemType.RangeHeader - Return RangeHeaderTemplate - Case ScheduleItemType.TitleHeader - Return TitleTemplate - Case ScheduleItemType.DateHeader - Return DateHeaderTemplate - Case ScheduleItemType.Item - Return ItemTemplate - Case ScheduleItemType.AlternatingItem - Return ItemTemplate - End Select - Return Nothing - End Function - - Protected Overrides Function GetStyle(ByVal type As ScheduleItemType) As TableItemStyle - ' handle DateHeader, which is not handled in the base class - If (type = ScheduleItemType.DateHeader) Then - Return RangeHeaderStyle - End If - Return MyBase.GetStyle(type) - End Function - - '''' ----------------------------------------------------------------------------- - '''' - '''' Calculate the title (data source value) given the cell index - '''' - '''' Title index of the cell - '''' Object containing the title - '''' ----------------------------------------------------------------------------- - Public Overrides Function CalculateTitle(ByVal titleIndex As Integer, ByVal cellIndex As Integer) As Object - Return arrTitleValues(titleIndex - 1) - End Function - -#End Region - -End Class - diff --git a/Controls/DotNetNuke.Events.ScheduleControl/scheduleitem.cs b/Controls/DotNetNuke.Events.ScheduleControl/scheduleitem.cs new file mode 100644 index 0000000..cea6472 --- /dev/null +++ b/Controls/DotNetNuke.Events.ScheduleControl/scheduleitem.cs @@ -0,0 +1,115 @@ +using System; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.ComponentModel; + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events.ScheduleControl +{ + + /// ----------------------------------------------------------------------------- + /// Project : schedule + /// Class : ScheduleItem + /// + /// ----------------------------------------------------------------------------- + /// + /// The ScheduleItem class represents an item in the Schedule control. + /// It can either be an item in the schedule itself, or a header item. + /// + /// ----------------------------------------------------------------------------- + [CLSCompliant(true), ToolboxItem(false)]public class ScheduleItem : WebControl, INamingContainer + { + + private int _dataSetIndex = -1; + private ScheduleItemType _itemType; + private object _dataItem; +#if NET_2_0 + private DataKey _dataKey; +#endif + + public dynamic DataItem + { + get + { + return _dataItem; + } + set + { + _dataItem = value; + } + } + +#if NET_2_0 + public DataKey DataKey + { + get + { + return _dataKey; + } + set + { + _dataKey = value; + } + } +#endif + + public virtual int DataSetIndex + { + get + { + return _dataSetIndex; + } + } + + public virtual ScheduleItemType ItemType + { + get + { + return _itemType; + } + } + + public ScheduleItem(int dataSetIndex1, ScheduleItemType itemType1) + { + this._dataSetIndex = dataSetIndex1; + this._itemType = itemType1; + } + + protected override bool OnBubbleEvent(object source, EventArgs e) + { + // pass any command events to the Schedule control itself + if (e is CommandEventArgs) + { + ScheduleCommandEventArgs args = new ScheduleCommandEventArgs(this, source, (CommandEventArgs) e); + RaiseBubbleEvent(this, args); + return true; + } + return false; + } //OnBubbleEvent + + } + + +} diff --git a/Controls/DotNetNuke.Events.ScheduleControl/scheduleitem.vb b/Controls/DotNetNuke.Events.ScheduleControl/scheduleitem.vb deleted file mode 100644 index 4cc990a..0000000 --- a/Controls/DotNetNuke.Events.ScheduleControl/scheduleitem.vb +++ /dev/null @@ -1,98 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Option Strict On - -Imports System -Imports System.Web.UI -Imports System.Web.UI.WebControls -Imports System.ComponentModel ' ToolboxItem - -''' ----------------------------------------------------------------------------- -''' Project : schedule -''' Class : ScheduleItem -''' -''' ----------------------------------------------------------------------------- -''' -''' The ScheduleItem class represents an item in the Schedule control. -''' It can either be an item in the schedule itself, or a header item. -''' -''' ----------------------------------------------------------------------------- - _ - Public Class ScheduleItem - Inherits WebControl - Implements INamingContainer - - Private _dataSetIndex As Integer = -1 - Private _itemType As ScheduleItemType - Private _dataItem As Object -#If NET_2_0 = 1 Then - Private _dataKey As DataKey -#End If - - Public Property DataItem() As Object - Get - Return _dataItem - End Get - Set(ByVal Value As Object) - _dataItem = Value - End Set - End Property - -#If NET_2_0 = 1 Then - Public Property DataKey() As DataKey - Get - Return _dataKey - End Get - Set(ByVal Value As DataKey) - _dataKey = Value - End Set - End Property -#End If - - Public Overridable ReadOnly Property DataSetIndex() As Integer - Get - Return _dataSetIndex - End Get - End Property - - Public Overridable ReadOnly Property ItemType() As ScheduleItemType - Get - Return _itemType - End Get - End Property - - Public Sub New(ByVal dataSetIndex1 As Integer, ByVal itemType1 As ScheduleItemType) - MyBase.New() - Me._dataSetIndex = dataSetIndex1 - Me._itemType = itemType1 - End Sub - - Protected Overrides Function OnBubbleEvent(ByVal [source] As Object, ByVal e As EventArgs) As Boolean - ' pass any command events to the Schedule control itself - If TypeOf e Is CommandEventArgs Then - Dim args As New ScheduleCommandEventArgs(Me, [source], CType(e, CommandEventArgs)) - RaiseBubbleEvent(Me, args) - Return True - End If - Return False - End Function 'OnBubbleEvent - -End Class - diff --git a/Controls/DotNetNuke.Events.ScheduleControl/scheduleitemcollection.cs b/Controls/DotNetNuke.Events.ScheduleControl/scheduleitemcollection.cs new file mode 100644 index 0000000..b09ee26 --- /dev/null +++ b/Controls/DotNetNuke.Events.ScheduleControl/scheduleitemcollection.cs @@ -0,0 +1,108 @@ +using System; +using System.Collections; + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events.ScheduleControl +{ + + /// ----------------------------------------------------------------------------- + /// Project : schedule + /// Class : ScheduleItemCollection + /// + /// ----------------------------------------------------------------------------- + /// + /// The ScheduleItemCollection class represents a collection of ScheduleItem objects. + /// + /// ----------------------------------------------------------------------------- + public class ScheduleItemCollection : ICollection, IEnumerable + { + + private ArrayList items; + + public ScheduleItemCollection(ArrayList items) + { + this.items = items; + } + + public int Count + { + get + { + return items.Count; + } + } + + public bool IsReadOnly + { + get + { + return false; + } + } + + public bool IsSynchronized + { + get + { + return false; + } + } + + public ScheduleItem this[int index] + { + get + { + return ((ScheduleItem) (items[index])); + } + } + + public dynamic SyncRoot + { + get + { + return this; + } + } + + public void CopyTo(Array array, int index) + { + ScheduleItem current = default(ScheduleItem); + foreach (ScheduleItem tempLoopVar_current in this) + { + current = tempLoopVar_current; + array.SetValue(current, index); + index++; + } + } + + public IEnumerator GetEnumerator() + { + return items.GetEnumerator(); + } + + } //ScheduleItemCollection + + +} diff --git a/Controls/DotNetNuke.Events.ScheduleControl/scheduleitemcollection.vb b/Controls/DotNetNuke.Events.ScheduleControl/scheduleitemcollection.vb deleted file mode 100644 index e8f2d59..0000000 --- a/Controls/DotNetNuke.Events.ScheduleControl/scheduleitemcollection.vb +++ /dev/null @@ -1,86 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Option Strict On - -Imports System -Imports System.Collections - -''' ----------------------------------------------------------------------------- -''' Project : schedule -''' Class : ScheduleItemCollection -''' -''' ----------------------------------------------------------------------------- -''' -''' The ScheduleItemCollection class represents a collection of ScheduleItem objects. -''' -''' ----------------------------------------------------------------------------- - Public Class ScheduleItemCollection - Implements ICollection, IEnumerable - - Private items As ArrayList - - Public Sub New(ByVal items As ArrayList) - Me.items = items - End Sub - - Public ReadOnly Property Count() As Integer Implements ICollection.Count - Get - Return items.Count - End Get - End Property - - Public ReadOnly Property IsReadOnly() As Boolean - Get - Return False - End Get - End Property - - Public ReadOnly Property IsSynchronized() As Boolean Implements ICollection.IsSynchronized - Get - Return False - End Get - End Property - - Default Public ReadOnly Property Item(ByVal index As Integer) As ScheduleItem - Get - Return CType(items(index), ScheduleItem) - End Get - End Property - - Public ReadOnly Property SyncRoot() As Object Implements ICollection.SyncRoot - Get - Return Me - End Get - End Property - - Public Sub CopyTo(ByVal array As Array, ByVal index As Integer) Implements ICollection.CopyTo - Dim current As ScheduleItem - For Each current In Me - array.SetValue(current, index) - index = index + 1 - Next current - End Sub - - Public Function GetEnumerator() As IEnumerator Implements ICollection.GetEnumerator - Return items.GetEnumerator() - End Function - - End Class 'ScheduleItemCollection - diff --git a/Controls/DotNetNuke.Events.ScheduleControl/scheduleitemeventargs.cs b/Controls/DotNetNuke.Events.ScheduleControl/scheduleitemeventargs.cs new file mode 100644 index 0000000..395c328 --- /dev/null +++ b/Controls/DotNetNuke.Events.ScheduleControl/scheduleitemeventargs.cs @@ -0,0 +1,60 @@ +using System; + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events.ScheduleControl +{ + + /// ----------------------------------------------------------------------------- + /// Project : schedule + /// Class : ScheduleItemEventArgs + /// + /// ----------------------------------------------------------------------------- + /// + /// The ScheduleItemEventArgs class can be used with the OnItemCreated and + /// OnItemDataBound events of the Schedule controls + /// + [CLSCompliant(true)]public sealed class ScheduleItemEventArgs : EventArgs + { + + private ScheduleItem _item; + + public ScheduleItemEventArgs(ScheduleItem item) + { + this._item = item; + } + + public ScheduleItem Item + { + get + { + return _item; + } + } + } + + public delegate void ScheduleItemEventHandler(object sender, ScheduleItemEventArgs e); + + +} diff --git a/Controls/DotNetNuke.Events.ScheduleControl/scheduleitemeventargs.vb b/Controls/DotNetNuke.Events.ScheduleControl/scheduleitemeventargs.vb deleted file mode 100644 index 4c5bbec..0000000 --- a/Controls/DotNetNuke.Events.ScheduleControl/scheduleitemeventargs.vb +++ /dev/null @@ -1,51 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Option Strict On - -Imports System - -''' ----------------------------------------------------------------------------- -''' Project : schedule -''' Class : ScheduleItemEventArgs -''' -''' ----------------------------------------------------------------------------- -''' -''' The ScheduleItemEventArgs class can be used with the OnItemCreated and -''' OnItemDataBound events of the Schedule controls -''' - _ - Public NotInheritable Class ScheduleItemEventArgs - Inherits EventArgs - - Private _item As ScheduleItem - - Public Sub New(ByVal item As ScheduleItem) - Me._item = item - End Sub - - Public ReadOnly Property Item() As ScheduleItem - Get - Return _item - End Get - End Property -End Class - - Public Delegate Sub ScheduleItemEventHandler(ByVal sender As Object, ByVal e As ScheduleItemEventArgs) - diff --git a/DotNetNuke.Events.vbproj b/DotNetNuke.Events.csproj similarity index 79% rename from DotNetNuke.Events.vbproj rename to DotNetNuke.Events.csproj index 0cd9f6f..736b5f2 100644 --- a/DotNetNuke.Events.vbproj +++ b/DotNetNuke.Events.csproj @@ -1,13 +1,22 @@  - + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + $(SolutionDir)\.build + + Debug AnyCPU 9.0.30729 2.0 {F13CD116-F8CC-4108-8691-F855EEBF7A4F} - {349c5851-65df-11da-9384-00065b846f21};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} + {349c5851-65df-11da-9384-00065b846f21};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Library DotNetNuke.Events @@ -35,7 +44,7 @@ Windows - 4.0 + 12.0 SAK SAK SAK @@ -44,8 +53,8 @@ - Bin\ - DotNetNuke.Modules.Events.xml + bin\ + bin\DotNetNuke.Modules.Events.xml 1072168960 @@ -59,14 +68,14 @@ false false 1 - 42016,42017,42018,42019,42032,42353,42354,42355 + 1591,660,661 full AllRules.ruleset false - Bin\ - DotNetNuke.Modules.Events.xml + bin\ + bin\DotNetNuke.Modules.Events.xml 1072168960 @@ -80,12 +89,16 @@ false false 1 - 42016,42017,42018,42019,42032,42353,42354,42355 + 1591,660,661 None AllRules.ruleset false + + + + False .references\CountryListBox.dll @@ -142,209 +155,190 @@ False + + + - - - - - - - - - - - - - - - - - - - - - - - - - Code - - - - - - - - - + + + + + + + + + + + + ASPXCodeBehind - - - - - + + + + + SelectLocation.ascx - + SelectLocation.ascx ASPXCodeBehind - + EventUserGrid.ascx - + EventUserGrid.ascx ASPXCodeBehind - + EventRpt.ascx - + EventRpt.ascx ASPXCodeBehind - + EventSettings.ascx - + EventSettings.ascx ASPXCodeBehind - + EditEvents.ascx - + EditEvents.ascx ASPXCodeBehind - + ASPXCodeBehind - + EventDay.ascx - + EventDay.ascx ASPXCodeBehind - + EventDetails.ascx - + EventDetails.ascx ASPXCodeBehind - + EventEditCategories.ascx - + EventEditCategories.ascx ASPXCodeBehind - + EventEditLocations.ascx - + EventEditLocations.ascx ASPXCodeBehind - + EventIcons.ascx - + EventIcons.ascx ASPXCodeBehind - + EventIPN.aspx - + EventIPN.aspx ASPXCodeBehind - + EventList.ascx - + EventList.ascx ASPXCodeBehind - + EventModerate.ascx - + EventModerate.ascx ASPXCodeBehind - + EventMonth.ascx - + EventMonth.ascx ASPXCodeBehind - + EventMyEnrollments.ascx - + EventMyEnrollments.ascx ASPXCodeBehind - + EventPPEnroll.ascx - + EventPPEnroll.ascx ASPXCodeBehind - + EventRSS.aspx - + EventRSS.aspx ASPXCodeBehind - + Events.ascx - + Events.ascx ASPXCodeBehind - + EventTemplateHelp.ascx - + EventTemplateHelp.ascx ASPXCodeBehind - + EventVCal.aspx - + EventVCal.aspx ASPXCodeBehind - + EventWeek.ascx - + EventWeek.ascx ASPXCodeBehind - - + + SelectCategory.ascx - + SelectCategory.ascx ASPXCodeBehind - + Settings.ascx - + Settings.ascx ASPXCodeBehind @@ -378,6 +372,8 @@ + + @@ -396,6 +392,9 @@ + + + @@ -577,36 +576,32 @@ + - + Designer - - - web.config - - - web.config - - - - - - {E90DA1B8-E75D-4E59-AE77-407BE089CF1A} + + {e90da1b8-e75d-4e59-ae77-407be089cf1a} DotNetNuke.Events.ScheduleControl + + + + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - + + + @@ -621,6 +616,10 @@ + + + + \ No newline at end of file diff --git a/DotNetNuke.Events.sln b/DotNetNuke.Events.sln index d6a732a..3aed0cd 100644 --- a/DotNetNuke.Events.sln +++ b/DotNetNuke.Events.sln @@ -1,10 +1,11 @@ + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DotNetNuke.Events.ScheduleControl", "Controls\DotNetNuke.Events.ScheduleControl\DotNetNuke.Events.ScheduleControl.vbproj", "{E90DA1B8-E75D-4E59-AE77-407BE089CF1A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetNuke.Events", "DotNetNuke.Events.csproj", "{F13CD116-F8CC-4108-8691-F855EEBF7A4F}" EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DotNetNuke.Events", "DotNetNuke.Events.vbproj", "{F13CD116-F8CC-4108-8691-F855EEBF7A4F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetNuke.Events.ScheduleControl", "Controls\DotNetNuke.Events.ScheduleControl\DotNetNuke.Events.ScheduleControl.csproj", "{E90DA1B8-E75D-4E59-AE77-407BE089CF1A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -12,14 +13,14 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E90DA1B8-E75D-4E59-AE77-407BE089CF1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E90DA1B8-E75D-4E59-AE77-407BE089CF1A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E90DA1B8-E75D-4E59-AE77-407BE089CF1A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E90DA1B8-E75D-4E59-AE77-407BE089CF1A}.Release|Any CPU.Build.0 = Release|Any CPU {F13CD116-F8CC-4108-8691-F855EEBF7A4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F13CD116-F8CC-4108-8691-F855EEBF7A4F}.Debug|Any CPU.Build.0 = Debug|Any CPU {F13CD116-F8CC-4108-8691-F855EEBF7A4F}.Release|Any CPU.ActiveCfg = Release|Any CPU {F13CD116-F8CC-4108-8691-F855EEBF7A4F}.Release|Any CPU.Build.0 = Release|Any CPU + {E90DA1B8-E75D-4E59-AE77-407BE089CF1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E90DA1B8-E75D-4E59-AE77-407BE089CF1A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E90DA1B8-E75D-4E59-AE77-407BE089CF1A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E90DA1B8-E75D-4E59-AE77-407BE089CF1A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/EditEvents.ascx b/EditEvents.ascx index a67d1ea..86e8b43 100644 --- a/EditEvents.ascx +++ b/EditEvents.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="EditEvents.ascx.vb" Inherits="DotNetNuke.Modules.Events.EditEvents" %> +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EditEvents.ascx.cs" Inherits="DotNetNuke.Modules.Events.EditEvents" %> <%@ Register TagPrefix="dnn" TagName="TextEditor" Src="~/controls/texteditor.ascx" %> <%@ Register TagPrefix="dnn" TagName="URL" Src="~/controls/URLControl.ascx" %> <%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %> @@ -46,7 +46,7 @@ + ControlToValidate="tpStartTime" ClientValidationFunction="ValidateTime" cssclass="dnnFormMessage dnnFormError" Text="*" OnServerValidate="valValidStartTime2_ServerValidate"/> + ControlToValidate="tpEndTime" ClientValidationFunction="ValidateTime" cssclass="dnnFormMessage dnnFormError" Text="*" OnServerValidate="valValidEndTime2_ServerValidate"/>
@@ -428,7 +428,7 @@
- +
No. of Enrolees  1  @@ -485,7 +485,7 @@ - + @@ -532,10 +532,10 @@
    -
  • -
  • -
  • -
  • +
  • +
  • +
  • +

@@ -564,3 +564,4 @@ }); } (jQuery, window.Sys)); + diff --git a/EditEvents.ascx.cs b/EditEvents.ascx.cs new file mode 100644 index 0000000..2ae1437 --- /dev/null +++ b/EditEvents.ascx.cs @@ -0,0 +1,2666 @@ +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using DotNetNuke.Entities.Users; +using DotNetNuke.Framework; +using Microsoft.VisualBasic; +using System.Web.UI.WebControls; +using System.Collections; +using DotNetNuke.Common.Utilities; +using DotNetNuke.Services.Localization; +using System; +using DotNetNuke.Security.Permissions; +using DotNetNuke.Security.Roles; +using System.Globalization; +using DotNetNuke.Security; +using DotNetNuke.Web.UI.WebControls.Extensions; + + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events +{ + + [DNNtc.ModuleControlProperties("Edit", "Edit Events", DNNtc.ControlType.View, "https://dnnevents.codeplex.com/documentation", false, true)] + public partial class EditEvents : EventBase + { + + #region Private Area + private int _itemID = -1; + private bool _editRecur = true; + private EventController _objCtlEvent = new EventController(); + private EventRecurMasterController _objCtlEventRecurMaster = new EventRecurMasterController(); + private EventInfo _objEvent = new EventInfo(); + private EventSignupsInfo _objEventSignups = new EventSignupsInfo(); + private EventSignupsController _objCtlEventSignups = new EventSignupsController(); + private ArrayList _lstEvents = new ArrayList(); + private ArrayList _lstOwnerUsers = new ArrayList(); + private CultureInfo _culture = System.Threading.Thread.CurrentThread.CurrentCulture; + private const string RecurTableDisplayType = "inline-block"; + + #endregion + + #region Event Handlers + private void Page_Load(System.Object sender, EventArgs e) + { + try + { + // Verify that the current user has edit access to this module + if (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString()) || + IsModuleEditor()) + { + } + else + { + // to stop errors when not authorised to edit + valReminderTime.MinimumValue = "15"; + valReminderTime.MaximumValue = "60"; + + Response.Redirect(GetSocialNavigateUrl(), true); + } + + grdAddUser.ModuleConfiguration = ModuleConfiguration.Clone(); + + // Add the external Validation.js to the Page + const string csname = "ExtValidationScriptFile"; + Type cstype = System.Reflection.MethodBase.GetCurrentMethod().GetType(); + string cstext = ""; + if (!Page.ClientScript.IsClientScriptBlockRegistered(csname)) + { + Page.ClientScript.RegisterClientScriptBlock(cstype, csname, cstext, false); + } + + // Determine ItemId of Event to Update + if (!(ReferenceEquals(Request.Params["ItemId"], null))) + { + _itemID = int.Parse(Request.Params["ItemId"]); + } + _editRecur = false; + if (!(ReferenceEquals(Request.Params["EditRecur"], null))) + { + if (Request.Params["EditRecur"].ToLower() == "all") + { + _editRecur = true; + } + } + + // Set the selected theme + SetTheme(pnlEventsModuleEdit); + + //EPT: "Changed DotNetNuke.Security.PortalSecurity.HasEditPermissions(ModuleId)" into "IsEditable" + //RWJS: Replaced with custom function IsModuleEditor which checks whether users has editor permissions + if ((IsModuleEditor()) || + (IsModerator()) || + (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString()))) + { + } + else + { + Response.Redirect(GetSocialNavigateUrl(), true); + } + + trOwner.Visible = false; + if ((IsModerator() && Settings.Ownerchangeallowed) || + PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString())) + { + trOwner.Visible = true; + } + + pnlEnroll.Visible = false; + divNoEnrolees.Visible = false; + + if (Settings.Eventsignup) + { + pnlEnroll.Visible = true; + chkSignups.Visible = true; + if (Settings.Maxnoenrolees > 1 && divAddUser.Visible) + { + divNoEnrolees.Visible = true; + } + } + + trTypeOfEnrollment.Visible = Settings.Eventsignupallowpaid; + trPayPalAccount.Visible = Settings.Eventsignupallowpaid; + + tblEventEmail.Attributes.Add("style", "display:none; width:100%"); + if (!Settings.Newpereventemail) + { + pnlEventEmailRole.Visible = false; + } + else if (_itemID == -1 && Settings.Moderateall && !IsModerator()) + { + pnlEventEmailRole.Visible = false; + } + + pnlReminder.Visible = Settings.Eventnotify; + pnlImage.Visible = Settings.Eventimage; + pnlDetailPage.Visible = Settings.DetailPageAllowed; + + // Setup Popup Event + dpStartDate.ClientEvents.OnDateSelected = "function() {if (Page_ClientValidate('startdate')) CopyField('" + dpStartDate.ClientID + "','" + dpEndDate.ClientID + "');}"; + tpStartTime.ClientEvents.OnDateSelected = "function() {SetComboIndex('" + tpStartTime.ClientID + "','" + tpEndTime.ClientID + "','" + dpStartDate.ClientID + "','" + dpEndDate.ClientID + "','" + Settings.Timeinterval + "');}"; + ctlURL.FileFilter = DotNetNuke.Common.Globals.glbImageFileTypes; + if (!Page.IsPostBack) + { + txtSubject.MaxLength++; + txtReminder.MaxLength++; + } + string limitSubject = "javascript:limitText(this," + (txtSubject.MaxLength - 1).ToString() + ",'" + Localization.GetString("LimitChars", LocalResourceFile) + "');"; + string limitReminder = "javascript:limitText(this," + (txtReminder.MaxLength - 1).ToString() + ",'" + Localization.GetString("LimitChars", LocalResourceFile) + "');"; + txtSubject.Attributes.Add("onkeydown", limitSubject); + txtSubject.Attributes.Add("onkeyup", limitSubject); + txtReminder.Attributes.Add("onkeydown", limitReminder); + txtReminder.Attributes.Add("onkeyup", limitReminder); + + Page.ClientScript.RegisterExpandoAttribute(valValidStartTime2.ClientID, "TimeInterval", Settings.Timeinterval); + Page.ClientScript.RegisterExpandoAttribute(valValidStartTime2.ClientID, "ErrorMessage", string.Format(Localization.GetString("valValidStartTime2", LocalResourceFile), Settings.Timeinterval)); + Page.ClientScript.RegisterExpandoAttribute(valValidStartTime2.ClientID, "ClientID", tpStartTime.ClientID); + Page.ClientScript.RegisterExpandoAttribute(valValidEndTime2.ClientID, "TimeInterval", Settings.Timeinterval); + Page.ClientScript.RegisterExpandoAttribute(valValidEndTime2.ClientID, "ErrorMessage", string.Format(Localization.GetString("valValidEndTime2", LocalResourceFile), Settings.Timeinterval)); + Page.ClientScript.RegisterExpandoAttribute(valValidEndTime2.ClientID, "ClientID", tpEndTime.ClientID); + + // If the page is being requested the first time, determine if an + // contact itemId value is specified, and if so populate page + // contents with the contact details + if (!Page.IsPostBack) + { + LocalizeAll(); + LoadEvent(); + } + else + { + string url = System.Convert.ToString(ctlURL.Url); + string urlType = System.Convert.ToString(ctlURL.UrlType); + ctlURL.Url = url; + ctlURL.UrlType = urlType; + } + + if (chkReminder.Checked) + { + tblReminderDetail.Attributes.Add("style", "display:block;"); + } + else + { + tblReminderDetail.Attributes.Add("style", "display:none;"); + } + + if (chkDetailPage.Checked) + { + tblDetailPageDetail.Attributes.Add("style", "display:block;"); + } + else + { + tblDetailPageDetail.Attributes.Add("style", "display:none;"); + } + + if (chkDisplayImage.Checked) + { + tblImageURL.Attributes.Add("style", "display:block;"); + } + else + { + tblImageURL.Attributes.Add("style", "display:none;"); + } + + if (chkSignups.Checked) + { + tblEnrollmentDetails.Attributes.Add("style", "display:block;"); + } + else + { + tblEnrollmentDetails.Attributes.Add("style", "display:none;"); + } + + if (chkReccuring.Checked) + { + tblRecurringDetails.Attributes.Add("style", "display:block;"); + } + else + { + tblRecurringDetails.Attributes.Add("style", "display:none;"); + } + + if (chkEventEmailChk.Checked) + { + tblEventEmailRoleDetail.Attributes.Add("style", "display:block;"); + } + else + { + tblEventEmailRoleDetail.Attributes.Add("style", "display:none;"); + } + + if (rblRepeatTypeP1.Checked) + { + tblDetailP1.Attributes.Add("style", "display:" + RecurTableDisplayType + ";white-space:nowrap;"); + } + else + { + tblDetailP1.Attributes.Add("style", "display:none;white-space:nowrap;"); + } + + if (rblRepeatTypeW1.Checked) + { + tblDetailW1.Attributes.Add("style", "display:" + RecurTableDisplayType + ";"); + } + else + { + tblDetailW1.Attributes.Add("style", "display:none;"); + } + + if (rblRepeatTypeM.Checked) + { + tblDetailM1.Attributes.Add("style", "display:" + RecurTableDisplayType + ";"); + } + else + { + tblDetailM1.Attributes.Add("style", "display:none;"); + } + + if (rblRepeatTypeY1.Checked) + { + tblDetailY1.Attributes.Add("style", "display:" + RecurTableDisplayType + ";"); + } + else + { + tblDetailY1.Attributes.Add("style", "display:none;"); + } + + if (dpY1Period.SelectedDate.ToString().Length == 0) + { + dpY1Period.SelectedDate = SelectedDate.Date; + } + if (txtReminderFrom.Text.Length == 0) + { + txtReminderFrom.Text = Settings.Reminderfrom; + } + if (txtEventEmailFrom.Text.Length == 0) + { + txtEventEmailFrom.Text = Settings.Reminderfrom; + } + + if (chkAllDayEvent.Checked) + { + divStartTime.Attributes.Add("style", "display:none;"); + divEndTime.Attributes.Add("style", "display:none;"); + } + + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + + } + + protected void valValidStartDate3_ServerValidate(object source, System.Web.UI.WebControls.ServerValidateEventArgs args) + { + if (ReferenceEquals(dpStartDate.SelectedDate, null)) + { + args.IsValid = false; + valValidStartDate.Visible = true; + } + } + + protected void valValidStartTime2_ServerValidate(object source, System.Web.UI.WebControls.ServerValidateEventArgs args) + { + DateTime inDate = System.Convert.ToDateTime(tpStartTime.SelectedDate); + valValidStartTime2.ErrorMessage = string.Format(Localization.GetString("valValidStartTime2", LocalResourceFile), Settings.Timeinterval); + args.IsValid = ValidateTime(inDate); + } + + protected void valValidEndTime2_ServerValidate(object source, System.Web.UI.WebControls.ServerValidateEventArgs args) + { + DateTime inDate = System.Convert.ToDateTime(tpEndTime.SelectedDate); + valValidEndTime2.ErrorMessage = string.Format(Localization.GetString("valValidEndTime2", LocalResourceFile), Settings.Timeinterval); + args.IsValid = ValidateTime(inDate); + } + + private void valValidRecurEndDate_ServerValidate(object source, System.Web.UI.WebControls.ServerValidateEventArgs args) + { + if (ReferenceEquals(dpStartDate.SelectedDate, null)) + { + return; + } + DateTime recurDate = System.Convert.ToDateTime(dpRecurEndDate.SelectedDate); + DateTime startDate = System.Convert.ToDateTime(dpStartDate.SelectedDate); + if (recurDate < startDate && !rblRepeatTypeN.Checked) + { + args.IsValid = false; + valValidRecurEndDate.Visible = true; + } + else + { + args.IsValid = true; + valValidRecurEndDate.Visible = false; + } + + } + + #endregion + + #region Helper Methods and Functions + + private void LocalizeAll() + { + CultureInfo culture = System.Threading.Thread.CurrentThread.CurrentCulture; + + txtSubject.Text = Settings.Templates.txtSubject; + txtReminder.Text = Settings.Templates.txtMessage; + + grdEnrollment.Columns[0].HeaderText = Localization.GetString("Select", LocalResourceFile); + grdEnrollment.Columns[1].HeaderText = Localization.GetString("EnrollUserName", LocalResourceFile); + grdEnrollment.Columns[2].HeaderText = Localization.GetString("EnrollDisplayName", LocalResourceFile); + grdEnrollment.Columns[3].HeaderText = Localization.GetString("EnrollEmail", LocalResourceFile); + grdEnrollment.Columns[4].HeaderText = Localization.GetString("EnrollPhone", LocalResourceFile); + grdEnrollment.Columns[5].HeaderText = Localization.GetString("EnrollApproved", LocalResourceFile); + grdEnrollment.Columns[6].HeaderText = Localization.GetString("EnrollNo", LocalResourceFile); + grdEnrollment.Columns[7].HeaderText = Localization.GetString("EventStart", LocalResourceFile); + + chkW1Sun.Text = culture.DateTimeFormat.AbbreviatedDayNames[(int)DayOfWeek.Sunday]; + chkW1Sun2.Text = culture.DateTimeFormat.AbbreviatedDayNames[(int)DayOfWeek.Sunday]; + chkW1Mon.Text = culture.DateTimeFormat.AbbreviatedDayNames[(int)DayOfWeek.Monday]; + chkW1Tue.Text = culture.DateTimeFormat.AbbreviatedDayNames[(int)DayOfWeek.Tuesday]; + chkW1Wed.Text = culture.DateTimeFormat.AbbreviatedDayNames[(int)DayOfWeek.Wednesday]; + chkW1Thu.Text = culture.DateTimeFormat.AbbreviatedDayNames[(int)DayOfWeek.Thursday]; + chkW1Fri.Text = culture.DateTimeFormat.AbbreviatedDayNames[(int)DayOfWeek.Friday]; + chkW1Sat.Text = culture.DateTimeFormat.AbbreviatedDayNames[(int)DayOfWeek.Saturday]; + + cmbM1Period.Items.Clear(); + // Corrected a problem w/Every nth Week on a specific day with the following + cmbM1Period.Items.Add(new ListItem(culture.DateTimeFormat.GetDayName(DayOfWeek.Sunday), "0")); + cmbM1Period.Items.Add(new ListItem(culture.DateTimeFormat.GetDayName(DayOfWeek.Monday), "1")); + cmbM1Period.Items.Add(new ListItem(culture.DateTimeFormat.GetDayName(DayOfWeek.Tuesday), "2")); + cmbM1Period.Items.Add(new ListItem(culture.DateTimeFormat.GetDayName(DayOfWeek.Wednesday), "3")); + cmbM1Period.Items.Add(new ListItem(culture.DateTimeFormat.GetDayName(DayOfWeek.Thursday), "4")); + cmbM1Period.Items.Add(new ListItem(culture.DateTimeFormat.GetDayName(DayOfWeek.Friday), "5")); + cmbM1Period.Items.Add(new ListItem(culture.DateTimeFormat.GetDayName(DayOfWeek.Saturday), "6")); + + cmbM2Period.Items.Clear(); + for (int i = 1; i <= 31; i++) + { + cmbM2Period.Items.Add(new ListItem(Localization.GetString(i.ToString(), LocalResourceFile), i.ToString())); + } + + lblMaxRecurrences.Text = string.Format(Localization.GetString("lblMaxRecurrences", LocalResourceFile), Settings.Maxrecurrences); + + if (culture.DateTimeFormat.FirstDayOfWeek == DayOfWeek.Sunday) + { + chkW1Sun.Attributes.Add("style", "display:inline;"); + chkW1Sun2.Attributes.Add("style", "display:none;"); + } + else + { + chkW1Sun2.Attributes.Add("style", "display:inline;"); + chkW1Sun.Attributes.Add("style", "display:none;"); + } + + dpStartDate.DatePopupButton.ToolTip = Localization.GetString("DatePickerTooltip", LocalResourceFile); + dpEndDate.DatePopupButton.ToolTip = Localization.GetString("DatePickerTooltip", LocalResourceFile); + dpRecurEndDate.DatePopupButton.ToolTip = Localization.GetString("DatePickerTooltip", LocalResourceFile); + dpY1Period.DatePopupButton.ToolTip = Localization.GetString("DatePickerTooltip", LocalResourceFile); + + tpEndTime.TimePopupButton.ToolTip = Localization.GetString("TimePickerTooltip", LocalResourceFile); + + } + + public void LoadEvent() + { + StorePrevPageInViewState(); + + pnlRecurring.Visible = true; + lblMaxRecurrences.Visible = false; + if (!Settings.Allowreoccurring) + { + dpRecurEndDate.Enabled = false; + cmbP1Period.Enabled = false; + txtP1Every.Enabled = false; + dpRecurEndDate.Visible = false; + cmbP1Period.Visible = false; + txtP1Every.Visible = false; + pnlRecurring.Visible = false; + } + else + { + if (Settings.Maxrecurrences != "") + { + lblMaxRecurrences.Visible = true; + } + } + + //Populate the timezone combobox (look up timezone translations based on currently set culture) + cboTimeZone.DataBind(Settings.TimeZoneId); + if (!Settings.EnableEventTimeZones) + { + cboTimeZone.Enabled = false; + } + + if (_editRecur) + { + deleteButton.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("ConfirmEventSeriesDelete", LocalResourceFile) + "');"); + deleteButton.Text = Localization.GetString("deleteSeriesButton", LocalResourceFile); + updateButton.Text = Localization.GetString("updateSeriesButton", LocalResourceFile); + copyButton.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("ConfirmEventCopy", LocalResourceFile) + "');"); + copyButton.Text = Localization.GetString("copySeriesButton", LocalResourceFile); + } + else + { + deleteButton.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("ConfirmEventDelete", LocalResourceFile) + "');"); + deleteButton.Text = Localization.GetString("deleteButton", LocalResourceFile); + updateButton.Text = Localization.GetString("updateButton", LocalResourceFile); + copyButton.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("ConfirmEventCopy", LocalResourceFile) + "');"); + copyButton.Text = Localization.GetString("copyButton", LocalResourceFile); + } + lnkSelectedEmail.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("ConfirmSendToAllSelected", LocalResourceFile) + "');"); + lnkSelectedDelete.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("ConfirmDeleteSelected", LocalResourceFile) + "');"); + + txtPayPalAccount.Text = Settings.Paypalaccount; + + int iInterval = int.Parse(Settings.Timeinterval); + DateTime currentDate = ModuleNow(); + int currentMinutes = currentDate.Minute; + int remainder = currentMinutes % iInterval; + if (remainder > 0) + { + currentDate = currentDate.AddMinutes(iInterval - remainder); + } + + tpStartTime.TimeView.Interval = new TimeSpan(0, iInterval, 0); + tpStartTime.SelectedDate = currentDate; + tpEndTime.TimeView.Interval = new TimeSpan(0, iInterval, 0); + tpEndTime.SelectedDate = currentDate.AddMinutes(iInterval); + + + // Can this event be moderated + lblModerated.Visible = Settings.Moderateall; + + // Send Reminder Default + chkReminder.Checked = Settings.Sendreminderdefault; + + // Populate description + ftbDesktopText.Text = Settings.Templates.NewEventTemplate; + + // Set default validation value + valNoEnrolees.MaximumValue = "9999"; + + // Hide enrolment info by default + lblEnrolledUsers.Visible = false; + grdEnrollment.Visible = false; + lnkSelectedDelete.Visible = false; + lnkSelectedEmail.Visible = false; + + trAllowAnonEnroll.Visible = Settings.AllowAnonEnroll; + + // Populate enrollment email text boxes + txtEventEmailSubject.Text = Settings.Templates.txtEditViewEmailSubject; + txtEventEmailBody.Text = Settings.Templates.txtEditViewEmailBody; + + if (_itemID != -1) + { + // Edit Item Mode + EventInfo objEvent = default(EventInfo); + objEvent = _objCtlEvent.EventsGet(_itemID, ModuleId); + + bool blEventSignup = false; + if (Settings.Eventsignup) + { + blEventSignup = objEvent.Signups; + } + else + { + blEventSignup = false; + } + if (blEventSignup) + { + pnlEnroll.Visible = true; + chkSignups.Visible = true; + lnkSelectedDelete.Visible = true; + lnkSelectedEmail.Visible = true; + if (_itemID != 0) + { + tblEventEmail.Attributes.Add("style", "display:block; width:100%"); + } + } + + // Check user has edit permissions to this event + if (IsEventEditor(objEvent, false)) + { + } + else + { + Response.Redirect(GetSocialNavigateUrl(), true); + } + + // Create an object to consolidate master/single data into - use master object for common data + EventRecurMasterInfo objEventData = default(EventRecurMasterInfo); + objEventData = _objCtlEventRecurMaster.EventsRecurMasterGet(objEvent.RecurMasterID, objEvent.ModuleID); + + // Hide recurrences section, disable timezone change if it is a recurring event + // and we aren't editing the series + if (objEventData.RRULE != "" && !_editRecur) + { + pnlRecurring.Visible = false; + cboTimeZone.Enabled = false; + } + + // If we are editing single item, populate with single event data + if (!_editRecur) + { + objEventData.Dtstart = objEvent.EventTimeBegin; + objEventData.Duration = System.Convert.ToString(System.Convert.ToString(objEvent.Duration) + "M"); + objEventData.Until = objEvent.EventTimeBegin; + objEventData.RRULE = ""; + objEventData.EventName = objEvent.EventName; + objEventData.EventDesc = objEvent.EventDesc; + objEventData.Importance = (EventRecurMasterInfo.Priority)objEvent.Importance; + objEventData.Notify = objEvent.Notify; + objEventData.Approved = objEvent.Approved; + objEventData.Signups = objEvent.Signups; + objEventData.AllowAnonEnroll = objEvent.AllowAnonEnroll; + objEventData.JournalItem = objEvent.JournalItem; + objEventData.MaxEnrollment = objEvent.MaxEnrollment; + objEventData.EnrollRoleID = objEvent.EnrollRoleID; + objEventData.EnrollFee = objEvent.EnrollFee; + objEventData.EnrollType = objEvent.EnrollType; + objEventData.Enrolled = objEvent.Enrolled; + objEventData.PayPalAccount = objEvent.PayPalAccount; + objEventData.DetailPage = objEvent.DetailPage; + objEventData.DetailNewWin = objEvent.DetailNewWin; + objEventData.DetailURL = objEvent.DetailURL; + objEventData.ImageURL = objEvent.ImageURL; + objEventData.ImageType = objEvent.ImageType; + objEventData.ImageWidth = objEvent.ImageWidth; + objEventData.ImageHeight = objEvent.ImageHeight; + objEventData.ImageDisplay = objEvent.ImageDisplay; + objEventData.Location = objEvent.Location; + objEventData.Category = objEvent.Category; + objEventData.Reminder = objEvent.Reminder; + objEventData.SendReminder = objEvent.SendReminder; + objEventData.ReminderTime = objEvent.ReminderTime; + objEventData.ReminderTimeMeasurement = objEvent.ReminderTimeMeasurement; + objEventData.ReminderFrom = objEvent.ReminderFrom; + objEventData.CustomField1 = objEvent.CustomField1; + objEventData.CustomField2 = objEvent.CustomField2; + objEventData.EnrollListView = objEvent.EnrollListView; + objEventData.DisplayEndDate = objEvent.DisplayEndDate; + objEventData.AllDayEvent = objEvent.AllDayEvent; + objEventData.OwnerID = objEvent.OwnerID; + objEventData.SocialGroupID = objEvent.SocialGroupId; + objEventData.SocialUserID = objEvent.SocialUserId; + objEventData.Summary = objEvent.Summary; + } + int intDuration = 0; + intDuration = int.Parse(objEventData.Duration.Substring(0, objEventData.Duration.Length - 1)); + txtTitle.Text = objEventData.EventName; + ftbDesktopText.Text = objEventData.EventDesc; + + // Set Dropdown to Original TimeZone w/ModuleID Settings TimeZone + cboTimeZone.DataBind(objEvent.EventTimeZoneId); + + // Set dates/times + dpStartDate.SelectedDate = objEventData.Dtstart.Date; + dpEndDate.SelectedDate = objEventData.Dtstart.AddMinutes(intDuration).Date; + dpRecurEndDate.SelectedDate = objEventData.Until; + + // Adjust Time not in DropDown Selection... + DateTime starttime = objEventData.Dtstart; + if (starttime.Minute % iInterval > 0) + { + starttime = objEventData.Dtstart.Date.AddMinutes(System.Convert.ToDouble((objEventData.Dtstart.Hour * 60) + (starttime.Minute) - (starttime.Minute % iInterval))); + } + tpStartTime.SelectedDate = starttime; + + DateTime endtime = objEventData.Dtstart.AddMinutes(intDuration); + if (endtime.Minute % iInterval > 0) + { + endtime = System.Convert.ToDateTime(objEventData.Dtstart.AddMinutes(intDuration).Date.AddMinutes(System.Convert.ToDouble(System.Convert.ToInt32(objEventData.Dtstart.AddMinutes(intDuration).Hour * 60) + (endtime.Minute) - (endtime.Minute % iInterval)))); + } + tpEndTime.SelectedDate = endtime; + + chkSignups.Checked = objEventData.Signups; + chkAllowAnonEnroll.Checked = objEventData.AllowAnonEnroll; + txtMaxEnrollment.Text = objEventData.MaxEnrollment.ToString(); + txtEnrolled.Text = objEventData.Enrolled.ToString(); + txtPayPalAccount.Text = objEventData.PayPalAccount.ToString(); + if (objEventData.EnrollType == "PAID") + { + rblFree.Checked = false; + rblPaid.Checked = true; + } + else if (objEventData.EnrollType == "FREE") + { + rblFree.Checked = true; + rblPaid.Checked = false; + } + + txtEnrollFee.Text = string.Format("{0:F2}", objEventData.EnrollFee); + lblTotalCurrency.Text = PortalSettings.Currency; + + if (blEventSignup) + { + // Load Enrolled User Grid + BuildEnrolleeGrid(objEvent); + } + + if (Information.IsNumeric(objEventData.EnrollRoleID)) + { + LoadEnrollRoles(objEventData.EnrollRoleID); + LoadNewEventEmailRoles(objEventData.EnrollRoleID); + } + else + { + LoadEnrollRoles(-1); + LoadNewEventEmailRoles(-1); + } + + LoadCategory(objEventData.Category); + LoadLocation(objEventData.Location); + LoadOwnerUsers(objEventData.OwnerID); + + cmbImportance.SelectedIndex = System.Convert.ToInt16(GetCmbStatus(objEventData.Importance, "cmbImportance")); + CreatedBy.Text = objEvent.CreatedBy; + CreatedDate.Text = objEventData.CreatedDate.ToShortDateString(); + lblCreatedBy.Visible = true; + CreatedBy.Visible = true; + lblOn.Visible = true; + CreatedDate.Visible = true; + pnlAudit.Visible = true; + + EventRRULEInfo objEventRRULE = default(EventRRULEInfo); + objEventRRULE = _objCtlEventRecurMaster.DecomposeRRULE(objEventData.RRULE, objEventData.Dtstart); + string strRepeatType = _objCtlEventRecurMaster.RepeatType(objEventRRULE); + + switch (strRepeatType) + { + case "N": + rblRepeatTypeN.Checked = true; + cmbP1Period.SelectedIndex = 0; + break; + //txtP1Every.Text = "0" + case "P1": + rblRepeatTypeP1.Checked = true; + chkReccuring.Checked = true; + cmbP1Period.SelectedIndex = System.Convert.ToInt16(GetCmbStatus(objEventRRULE.Freq.Substring(0, 1), "cmbP1Period")); + txtP1Every.Text = objEventRRULE.Interval.ToString(); + break; + case "W1": + rblRepeatTypeW1.Checked = true; + chkReccuring.Checked = true; + if (_culture.DateTimeFormat.FirstDayOfWeek == DayOfWeek.Sunday) + { + chkW1Sun.Checked = objEventRRULE.Su; + } + else + { + chkW1Sun2.Checked = objEventRRULE.Su; + } + chkW1Mon.Checked = objEventRRULE.Mo; + chkW1Tue.Checked = objEventRRULE.Tu; + chkW1Wed.Checked = objEventRRULE.We; + chkW1Thu.Checked = objEventRRULE.Th; + chkW1Fri.Checked = objEventRRULE.Fr; + chkW1Sat.Checked = objEventRRULE.Sa; + txtW1Every.Text = objEventRRULE.Interval.ToString(); + break; + case "M1": + rblRepeatTypeM1.Checked = true; + rblRepeatTypeM.Checked = true; + chkReccuring.Checked = true; + txtMEvery.Text = objEventRRULE.Interval.ToString(); + int intEvery = 0; + int intPeriod = 0; + if (objEventRRULE.Su) + { + intPeriod = 0; + intEvery = objEventRRULE.SuNo; + } + if (objEventRRULE.Mo) + { + intPeriod = 1; + intEvery = objEventRRULE.MoNo; + } + if (objEventRRULE.Tu) + { + intPeriod = 2; + intEvery = objEventRRULE.TuNo; + } + if (objEventRRULE.We) + { + intPeriod = 3; + intEvery = objEventRRULE.WeNo; + } + if (objEventRRULE.Th) + { + intPeriod = 4; + intEvery = objEventRRULE.ThNo; + } + if (objEventRRULE.Fr) + { + intPeriod = 5; + intEvery = objEventRRULE.FrNo; + } + if (objEventRRULE.Sa) + { + intPeriod = 6; + intEvery = objEventRRULE.SaNo; + } + cmbM1Period.SelectedIndex = intPeriod; + if (intEvery == -1) + { + cmbM1Every.SelectedIndex = 4; + } + else + { + cmbM1Every.SelectedIndex = intEvery - 1; + } + break; + case "M2": + rblRepeatTypeM2.Checked = true; + rblRepeatTypeM.Checked = true; + chkReccuring.Checked = true; + cmbM2Period.SelectedIndex = objEventRRULE.ByMonthDay - 1; + txtMEvery.Text = objEventRRULE.Interval.ToString(); + break; + case "Y1": + rblRepeatTypeY1.Checked = true; + chkReccuring.Checked = true; + CultureInfo invCulture = CultureInfo.InvariantCulture; + DateTime annualdate = DateTime.ParseExact(Strings.Format(objEventData.Dtstart, "yyyy") + "/" + objEventRRULE.ByMonth.ToString() + "/" + objEventRRULE.ByMonthDay.ToString(), "yyyy/M/d", invCulture); + dpY1Period.SelectedDate = annualdate.Date; + break; + + } + + chkReminder.Checked = objEventData.SendReminder; + txtReminder.Text = objEventData.Reminder; + + if (txtReminder.Text.Length == 0) + { + txtReminder.Text = Settings.Templates.txtMessage; + } + + txtSubject.Text = objEventData.Notify; + if (txtSubject.Text.Length == 0) + { + txtSubject.Text = Settings.Templates.txtSubject; + } + + txtReminderFrom.Text = objEventData.ReminderFrom; + txtEventEmailFrom.Text = objEventData.ReminderFrom; + if (objEventData.ReminderTime < 0) + { + txtReminderTime.Text = System.Convert.ToString(15.ToString()); + } + else + { + txtReminderTime.Text = objEventData.ReminderTime.ToString(); + } + + if (!ReferenceEquals(ddlReminderTimeMeasurement.Items.FindByValue(objEventData.ReminderTimeMeasurement.ToString()), null)) + { + ddlReminderTimeMeasurement.ClearSelection(); + ddlReminderTimeMeasurement.Items.FindByValue(objEventData.ReminderTimeMeasurement.ToString()).Selected = true; + } + + // Set DetailURL + chkDetailPage.Checked = objEventData.DetailPage; + URLDetail.Url = objEventData.DetailURL; + + + // Set Image Control + chkDisplayImage.Checked = objEventData.ImageDisplay; + ctlURL.Url = objEventData.ImageURL; + if (objEventData.ImageURL.StartsWith("FileID=")) + { + int fileId = int.Parse(objEventData.ImageURL.Substring(7)); + Services.FileSystem.IFileInfo objFileInfo = Services.FileSystem.FileManager.Instance.GetFile(fileId); + if (!ReferenceEquals(objFileInfo, null)) + { + ctlURL.Url = objFileInfo.Folder + objFileInfo.FileName; + } + else + { + chkDisplayImage.Checked = false; + } + } + + if (objEventData.ImageWidth != 0 & objEventData.ImageWidth != -1) + { + txtWidth.Text = objEventData.ImageWidth.ToString(); + } + + if (objEventData.ImageHeight != 0 & objEventData.ImageHeight != -1) + { + txtHeight.Text = objEventData.ImageHeight.ToString(); + } + txtCustomField1.Text = objEventData.CustomField1; + txtCustomField2.Text = objEventData.CustomField2; + chkEnrollListView.Checked = objEventData.EnrollListView; + chkDisplayEndDate.Checked = objEventData.DisplayEndDate; + chkAllDayEvent.Checked = objEventData.AllDayEvent; + ftbSummary.Text = objEventData.Summary; + + if (blEventSignup) + { + LoadRegUsers(); + } + + } + else + { + dpStartDate.SelectedDate = SelectedDate.Date; + dpEndDate.SelectedDate = SelectedDate.Date; + txtEnrollFee.Text = string.Format("{0:F2}", 0.0); + lblTotalCurrency.Text = PortalSettings.Currency; + dpRecurEndDate.SelectedDate = SelectedDate.AddDays(1); + dpY1Period.SelectedDate = SelectedDate.Date; + chkEnrollListView.Checked = Settings.Eventdefaultenrollview; + chkDisplayEndDate.Checked = true; + chkAllDayEvent.Checked = false; + + // Do not default recurrance end date + // Force user to key/select + LoadEnrollRoles(-1); + LoadNewEventEmailRoles(-1); + LoadCategory(); + LoadLocation(-1); + LoadOwnerUsers(UserId); + pnlAudit.Visible = false; + deleteButton.Visible = false; + } + + if (_itemID == -1 || _editRecur) + { + divAddUser.Visible = false; + divNoEnrolees.Visible = false; + } + + string errorminutes = Localization.GetString("invalidReminderMinutes", LocalResourceFile); + string errorhours = Localization.GetString("invalidReminderHours", LocalResourceFile); + string errordays = Localization.GetString("invalidReminderDays", LocalResourceFile); + ddlReminderTimeMeasurement.Attributes.Add("onchange", "valRemTime('" + valReminderTime.ClientID + "','" + valReminderTime2.ClientID + "','" + valReminderTime.ValidationGroup + "','" + ddlReminderTimeMeasurement.ClientID + "','" + errorminutes + "','" + errorhours + "','" + errordays + "');"); + switch (ddlReminderTimeMeasurement.SelectedValue) + { + case "m": + valReminderTime.ErrorMessage = errorminutes; + valReminderTime.MinimumValue = "15"; + valReminderTime.MaximumValue = "60"; + break; + case "h": + valReminderTime.ErrorMessage = errorhours; + valReminderTime.MinimumValue = "1"; + valReminderTime.MaximumValue = "24"; + break; + case "d": + valReminderTime.ErrorMessage = errordays; + valReminderTime.MinimumValue = "1"; + valReminderTime.MaximumValue = "30"; + break; + } + valReminderTime2.ErrorMessage = valReminderTime.ErrorMessage; + + if (txtPayPalAccount.Text.Length == 0) + { + txtPayPalAccount.Text = Settings.Paypalaccount; + } + + trCustomField1.Visible = Settings.EventsCustomField1; + trCustomField2.Visible = Settings.EventsCustomField2; + + trTimeZone.Visible = Settings.Tzdisplay; + + chkDetailPage.Attributes.Add("onclick", "javascript:showTbl('" + chkDetailPage.ClientID + "','" + tblDetailPageDetail.ClientID + "');"); + chkReminder.Attributes.Add("onclick", "javascript:showTbl('" + chkReminder.ClientID + "','" + tblReminderDetail.ClientID + "');"); + chkDisplayImage.Attributes.Add("onclick", "javascript:showTbl('" + chkDisplayImage.ClientID + "','" + tblImageURL.ClientID + "');"); + chkReccuring.Attributes.Add("onclick", "javascript:if (this.checked == true) dnn.dom.getById('" + rblRepeatTypeP1.ClientID + "').checked = true; else dnn.dom.getById('" + rblRepeatTypeN.ClientID + "').checked = true;showhideTbls('" + RecurTableDisplayType + "','" + chkReccuring.ClientID + "','" + tblRecurringDetails.ClientID + "','" + rblRepeatTypeP1.ClientID + "','" + tblDetailP1.ClientID + "','" + rblRepeatTypeW1.ClientID + "','" + tblDetailW1.ClientID + "','" + rblRepeatTypeM.ClientID + "','" + tblDetailM1.ClientID + "','" + rblRepeatTypeY1.ClientID + "','" + tblDetailY1.ClientID + "');"); + if (Settings.Eventsignup) + { + chkEventEmailChk.Attributes.Add("onclick", "javascript:showhideChk2('" + chkEventEmailChk.ClientID + "','" + tblEventEmailRoleDetail.ClientID + "','" + chkSignups.ClientID + "','" + tblEventEmail.ClientID + "');"); + } + else + { + chkEventEmailChk.Attributes.Add("onclick", "javascript:showhideChk2('" + chkEventEmailChk.ClientID + "','" + tblEventEmailRoleDetail.ClientID + "','" + chkEventEmailChk.ClientID + "','" + tblEventEmail.ClientID + "');"); + } + rblRepeatTypeP1.Attributes.Add("onclick", "javascript:showhideTbls('" + RecurTableDisplayType + "','" + chkReccuring.ClientID + "','" + tblRecurringDetails.ClientID + "','" + rblRepeatTypeP1.ClientID + "','" + tblDetailP1.ClientID + "','" + rblRepeatTypeW1.ClientID + "','" + tblDetailW1.ClientID + "','" + rblRepeatTypeM.ClientID + "','" + tblDetailM1.ClientID + "','" + rblRepeatTypeY1.ClientID + "','" + tblDetailY1.ClientID + "');"); + rblRepeatTypeW1.Attributes.Add("onclick", "javascript:showhideTbls('" + RecurTableDisplayType + "','" + chkReccuring.ClientID + "','" + tblRecurringDetails.ClientID + "','" + rblRepeatTypeP1.ClientID + "','" + tblDetailP1.ClientID + "','" + rblRepeatTypeW1.ClientID + "','" + tblDetailW1.ClientID + "','" + rblRepeatTypeM.ClientID + "','" + tblDetailM1.ClientID + "','" + rblRepeatTypeY1.ClientID + "','" + tblDetailY1.ClientID + "');"); + rblRepeatTypeM.Attributes.Add("onclick", "javascript:showhideTbls('" + RecurTableDisplayType + "','" + chkReccuring.ClientID + "','" + tblRecurringDetails.ClientID + "','" + rblRepeatTypeP1.ClientID + "','" + tblDetailP1.ClientID + "','" + rblRepeatTypeW1.ClientID + "','" + tblDetailW1.ClientID + "','" + rblRepeatTypeM.ClientID + "','" + tblDetailM1.ClientID + "','" + rblRepeatTypeY1.ClientID + "','" + tblDetailY1.ClientID + "');if (this.checked == true) dnn.dom.getById('" + rblRepeatTypeM1.ClientID + "').checked = true;"); + rblRepeatTypeY1.Attributes.Add("onclick", "javascript:showhideTbls('" + RecurTableDisplayType + "','" + chkReccuring.ClientID + "','" + tblRecurringDetails.ClientID + "','" + rblRepeatTypeP1.ClientID + "','" + tblDetailP1.ClientID + "','" + rblRepeatTypeW1.ClientID + "','" + tblDetailW1.ClientID + "','" + rblRepeatTypeM.ClientID + "','" + tblDetailM1.ClientID + "','" + rblRepeatTypeY1.ClientID + "','" + tblDetailY1.ClientID + "');"); + btnCopyStartdate.Attributes.Add("onclick", string.Format("javascript:CopyStartDateToEnddate('{0}','{1}','{2}','{3}','{4}');", dpStartDate.ClientID, dpEndDate.ClientID, tpStartTime.ClientID, tpEndTime.ClientID, chkAllDayEvent.ClientID)); + chkAllDayEvent.Attributes.Add("onclick", "javascript:showTimes('" + chkAllDayEvent.ClientID + "','" + divStartTime.ClientID + "','" + divEndTime.ClientID + "');"); + + } + + public long GetCmbStatus(object value, string cmbDropDown) + { + int iIndex = 0; + DropDownList oDropDown = default(DropDownList); + + oDropDown = (DropDownList)(FindControl(cmbDropDown)); + for (iIndex = 0; iIndex <= oDropDown.Items.Count - 1; iIndex++) + { + if (oDropDown.Items[iIndex].Value == System.Convert.ToString(value)) + { + return iIndex; + } + } + return iIndex; + } + + public void LoadEnrollRoles(int roleID) + { + RoleController objRoles = new RoleController(); + ddEnrollRoles.DataSource = objRoles.GetPortalRoles(PortalId); + ddEnrollRoles.DataTextField = "RoleName"; + ddEnrollRoles.DataValueField = "RoleID"; + ddEnrollRoles.DataBind(); + //"" + ddEnrollRoles.Items.Insert(0, new ListItem(Localization.GetString("None", LocalResourceFile), "-1")); + if (roleID == 0) + { + ddEnrollRoles.Items.FindByValue("0").Selected = true; + } + else if (roleID > 0) + { + if (ReferenceEquals(ddEnrollRoles.Items.FindByValue(System.Convert.ToString(roleID)), null)) + { + ddEnrollRoles.Items.Insert(0, new ListItem(Localization.GetString("EnrolleeRoleDeleted", LocalResourceFile), roleID.ToString())); + } + ddEnrollRoles.Items.FindByValue(System.Convert.ToString(roleID)).Selected = true; + } + } + + public void LoadNewEventEmailRoles(int roleID) + { + RoleController objRoles = new RoleController(); + ddEventEmailRoles.DataSource = objRoles.GetPortalRoles(PortalId); + ddEventEmailRoles.DataTextField = "RoleName"; + ddEventEmailRoles.DataValueField = "RoleID"; + ddEventEmailRoles.DataBind(); + if (roleID < 0 || ReferenceEquals(ddEventEmailRoles.Items.FindByValue(System.Convert.ToString(roleID)), null)) + { + try + { + ddEventEmailRoles.Items.FindByValue(PortalSettings.RegisteredRoleId.ToString()).Selected = true; + } + catch + { + } + } + else + { + ddEventEmailRoles.Items.FindByValue(System.Convert.ToString(roleID)).Selected = true; + } + } + + public void LoadCategory(int category = default(int)) + { + EventCategoryController objCntCategories = new EventCategoryController(); + ArrayList tmpCategories = objCntCategories.EventsCategoryList(PortalId); + ArrayList objCategories = new ArrayList(); + if ((Settings.Enablecategories == EventModuleSettings.DisplayCategories.DoNotDisplay & Settings.ModuleCategoriesSelected == EventModuleSettings.CategoriesSelected.Some) + || Settings.Restrictcategories) + { + foreach (EventCategoryInfo objCategory in tmpCategories) + { + foreach (int moduleCategory in Settings.ModuleCategoryIDs) + { + if (moduleCategory == objCategory.Category) + { + objCategories.Add(objCategory); + } + } + } + } + else + { + objCategories = tmpCategories; + } + cmbCategory.DataSource = objCategories; + cmbCategory.DataTextField = "CategoryName"; + cmbCategory.DataValueField = "Category"; + cmbCategory.DataBind(); + + // Do we need to add None + if ((!(Settings.Enablecategories == EventModuleSettings.DisplayCategories.DoNotDisplay) | Settings.ModuleCategoriesSelected == EventModuleSettings.CategoriesSelected.All) + && Settings.Restrictcategories == false) + { + cmbCategory.Items.Insert(0, new ListItem(Localization.GetString("None", LocalResourceFile), "-1")); + } + + // Select the appropriate row + if (Settings.ModuleCategoriesSelected == EventModuleSettings.CategoriesSelected.All) + { + cmbCategory.ClearSelection(); + cmbCategory.Items[0].Selected = true; + } + + if ((category > 0) && !ReferenceEquals(category, null)) + { + cmbCategory.ClearSelection(); + cmbCategory.Items.FindByValue(System.Convert.ToString(category)).Selected = true; + } + else if (!(Settings.Enablecategories == EventModuleSettings.DisplayCategories.DoNotDisplay) & Settings.ModuleCategoriesSelected == EventModuleSettings.CategoriesSelected.Some) + { + cmbCategory.ClearSelection(); + cmbCategory.Items.FindByValue(System.Convert.ToString(Settings.ModuleCategoryIDs[0])).Selected = true; + } + + } + + public void LoadLocation(int location) + { + EventLocationController objCntLocation = new EventLocationController(); + cmbLocation.DataSource = objCntLocation.EventsLocationList(PortalId); + cmbLocation.DataTextField = "LocationName"; + cmbLocation.DataValueField = "Location"; + cmbLocation.DataBind(); + //"" + cmbLocation.Items.Insert(0, new ListItem(Localization.GetString("None", LocalResourceFile), "-1")); + if ((location > 0) && !ReferenceEquals(location, null)) + { + cmbLocation.Items.FindByValue(System.Convert.ToString(location)).Selected = true; + } + } + + private void LoadOwnerUsers(int ownerID) + { + ModulePermissionCollection objCollModulePermission = default(ModulePermissionCollection); + objCollModulePermission = ModulePermissionController.GetModulePermissions(ModuleId, TabId); + ModulePermissionInfo objModulePermission = default(ModulePermissionInfo); + + // To cope with host users or someone who is no longer an editor!! + EventUser objEventModuleEditor = new EventUser(); + objEventModuleEditor.UserID = ownerID; + LoadSingleUser(objEventModuleEditor, _lstOwnerUsers); + + if ((IsModerator() && Settings.Ownerchangeallowed) || + PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString())) + { + foreach (ModulePermissionInfo tempLoopVar_objModulePermission in objCollModulePermission) + { + objModulePermission = tempLoopVar_objModulePermission; + if (objModulePermission.PermissionKey == "EVENTSEDT") + { + if (objModulePermission.UserID < 0) + { + RoleController objCtlRole = new RoleController(); + ArrayList lstRoleUsers = objCtlRole.GetUsersByRoleName(PortalId, objModulePermission.RoleName); + foreach (UserInfo objUser in lstRoleUsers) + { + objEventModuleEditor = new EventUser(); + objEventModuleEditor.UserID = objUser.UserID; + objEventModuleEditor.DisplayName = objUser.DisplayName; + LoadSingleUser(objEventModuleEditor, _lstOwnerUsers); + } + } + else + { + objEventModuleEditor = new EventUser(); + objEventModuleEditor.UserID = objModulePermission.UserID; + objEventModuleEditor.DisplayName = objModulePermission.DisplayName; + LoadSingleUser(objEventModuleEditor, _lstOwnerUsers); + } + } + } + } + _lstOwnerUsers.Sort(new UserListSort()); + + cmbOwner.DataSource = _lstOwnerUsers; + cmbOwner.DataTextField = "DisplayName"; + cmbOwner.DataValueField = "UserID"; + cmbOwner.DataBind(); + cmbOwner.Items.FindByValue(System.Convert.ToString(ownerID)).Selected = true; + } + + private void LoadRegUsers() + { + grdAddUser.RefreshGrid(); + } + + private void LoadSingleUser(EventUser objEventUser, ArrayList lstUsers) + { + bool blAdd = true; + EventUser objEventUser2 = default(EventUser); + foreach (EventUser tempLoopVar_objEventUser2 in lstUsers) + { + objEventUser2 = tempLoopVar_objEventUser2; + if (objEventUser.UserID == objEventUser2.UserID) + { + blAdd = false; + } + } + if (blAdd) + { + if (objEventUser.DisplayName == null) + { + UserController objCtlUser = new UserController(); + UserInfo objUser = objCtlUser.GetUser(PortalId, objEventUser.UserID); + if (!ReferenceEquals(objUser, null)) + { + objEventUser.DisplayName = objUser.DisplayName; + } + else + { + objEventUser.DisplayName = Localization.GetString("OwnerDeleted", LocalResourceFile); + } + + } + lstUsers.Add(objEventUser); + } + } + + private void Email(bool selected) + { + DataGridItem item = default(DataGridItem); + EventSignupsInfo objEnroll = default(EventSignupsInfo); + EventInfo objEvent = default(EventInfo); + // Get Current Event, if <> 0 + if (_itemID > 0) + { + objEvent = _objCtlEvent.EventsGet(_itemID, ModuleId); + } + else + { + return; + } + + EventEmailInfo objEventEmailInfo = new EventEmailInfo(); + EventEmails objEventEmail = new EventEmails(PortalId, ModuleId, LocalResourceFile, ((PageBase)Page).PageCulture.Name); + objEventEmailInfo.TxtEmailSubject = txtEventEmailSubject.Text; + objEventEmailInfo.TxtEmailBody = txtEventEmailBody.Text; + objEventEmailInfo.TxtEmailFrom = txtEventEmailFrom.Text; + foreach (DataGridItem tempLoopVar_item in grdEnrollment.Items) + { + item = tempLoopVar_item; + if (((CheckBox)(item.FindControl("chkSelect"))).Checked || (selected == false)) + { + objEnroll = _objCtlEventSignups.EventsSignupsGet(System.Convert.ToInt32(grdEnrollment.DataKeys[item.ItemIndex]), ModuleId, false); + objEventEmailInfo.UserIDs.Clear(); + objEventEmailInfo.UserEmails.Clear(); + objEventEmailInfo.UserLocales.Clear(); + objEventEmailInfo.UserTimeZoneIds.Clear(); + if (objEnroll.UserID > -1) + { + objEventEmailInfo.UserIDs.Add(objEnroll.UserID); + } + else + { + objEventEmailInfo.UserEmails.Add(objEnroll.AnonEmail); + objEventEmailInfo.UserLocales.Add(objEnroll.AnonCulture); + objEventEmailInfo.UserTimeZoneIds.Add(objEnroll.AnonTimeZoneId); + } + objEventEmail.SendEmails(objEventEmailInfo, objEvent, objEnroll); + } + } + } + + private void UpdateProcessing(int processItem) + { + if (!Page.IsValid) + { + return; + } + + PortalSecurity objSecurity = new PortalSecurity(); + DateTime tStartTime = default(DateTime); + DateTime tEndTime = default(DateTime); + DateTime tRecurEndDate = default(DateTime); + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + + // Make EndDate = StartDate if no recurring dates + if (rblRepeatTypeN.Checked) + { + dpRecurEndDate.SelectedDate = ConvertDateStringstoDatetime(dpStartDate.SelectedDate.ToString(), "00:00").Date; + } + + valRequiredRecurEndDate.Validate(); + + // Make sure date formatted correctly + if (chkAllDayEvent.Checked) + { + tStartTime = ConvertDateStringstoDatetime(dpStartDate.SelectedDate.ToString(), "00:00"); + tEndTime = System.Convert.ToDateTime(ConvertDateStringstoDatetime(dpEndDate.SelectedDate.ToString(), "00:00").AddMinutes(1439)); + } + else + { + tStartTime = ConvertDateStringstoDatetime(dpStartDate.SelectedDate.ToString(), System.Convert.ToString((System.Convert.ToDateTime(tpStartTime.SelectedDate)).ToString("HH:mm", CultureInfo.InvariantCulture))); + tEndTime = ConvertDateStringstoDatetime(dpEndDate.SelectedDate.ToString(), System.Convert.ToString((System.Convert.ToDateTime(tpEndTime.SelectedDate)).ToString("HH:mm", CultureInfo.InvariantCulture))); + } + + if (tEndTime < tStartTime && !chkAllDayEvent.Checked) + { + valValidEndTime.ErrorMessage = Localization.GetString("valValidEndTime", LocalResourceFile); + valValidEndTime.IsValid = false; + valValidEndTime.Visible = true; + return; + } + + tRecurEndDate = System.Convert.ToDateTime(dpRecurEndDate.SelectedDate); + + if (rblRepeatTypeP1.Checked) + { + valP1Every.Validate(); + valP1Every2.Validate(); + if (valP1Every.IsValid == false || valP1Every2.IsValid == false) + { + return; + } + } + + if (rblRepeatTypeW1.Checked) + { + valW1Day.Validate(); + valW1Day2.Validate(); + if (chkW1Sun.Checked == false && + chkW1Sun2.Checked == false && + chkW1Mon.Checked == false && + chkW1Tue.Checked == false && + chkW1Wed.Checked == false && + chkW1Thu.Checked == false && + chkW1Fri.Checked == false && + chkW1Sat.Checked == false) + { + valW1Day3.ErrorMessage = Localization.GetString("valW1Day3", LocalResourceFile); + valW1Day3.Text = Localization.GetString("valW1Day3", LocalResourceFile); + valW1Day3.IsValid = false; + valW1Day3.Visible = true; + return; + } + if (valW1Day.IsValid == false || valW1Day2.IsValid == false) + { + return; + } + } + + if (rblRepeatTypeM.Checked && rblRepeatTypeM2.Checked) + { + valM2Every.Validate(); + valM2Every2.Validate(); + if (valM2Every.IsValid == false || valM2Every2.IsValid == false) + { + return; + } + + } + // If Annual Recurrence, Check date + if (rblRepeatTypeY1.Checked) + { + valRequiredYearEventDate.Validate(); + valValidYearEventDate.Validate(); + if (valRequiredYearEventDate.IsValid == false || valValidYearEventDate.IsValid == false) + { + return; + } + } + + if (Settings.Expireevents != "" + && !_editRecur) + { + if (tStartTime < DateTime.Now.AddDays(-System.Convert.ToInt32(Settings.Expireevents))) + { + valValidStartDate2.IsValid = false; + valValidStartDate2.Visible = true; + valValidStartDate2.Text = string.Format(Localization.GetString("valValidStartDate2", LocalResourceFile), System.Convert.ToInt32(Settings.Expireevents)); + valValidStartDate2.ErrorMessage = string.Format(Localization.GetString("valValidStartDate2", LocalResourceFile), System.Convert.ToInt32(Settings.Expireevents)); + return; + } + } + + double duration = 0; + duration = tEndTime.Subtract(tStartTime).TotalMinutes; + + if (rblPaid.Checked) + { + if (Information.IsNumeric(txtEnrollFee.Text)) + { + // ReSharper disable CompareOfFloatsByEqualityOperator + if (System.Convert.ToDouble(txtEnrollFee.Text) == 0.0) + { + // ReSharper restore CompareOfFloatsByEqualityOperator + valBadFee.IsValid = false; + valBadFee.Visible = true; + return; + } + } + else + { + valBadFee.IsValid = false; + valBadFee.Visible = true; + return; + } + if (txtPayPalAccount.Text.Trim() == "") + { + valPayPalAccount.IsValid = false; + valPayPalAccount.Visible = true; + return; + } + } + + //Check valid Reminder Time + if (chkReminder.Checked) + { + int remtime = System.Convert.ToInt32(txtReminderTime.Text); + switch (ddlReminderTimeMeasurement.SelectedValue) + { + case "m": + if (remtime < 15 | remtime > 60) + { + valReminderTime2.IsValid = false; + valReminderTime2.Visible = true; + return; + } + break; + case "h": + if (remtime < 1 | remtime > 24) + { + valReminderTime2.IsValid = false; + valReminderTime2.Visible = true; + return; + } + break; + case "d": + if (remtime < 1 | remtime > 30) + { + valReminderTime2.IsValid = false; + valReminderTime2.Visible = true; + return; + } + break; + } + } + + if (chkSignups.Checked) + { + valMaxEnrollment.Validate(); + if (!valMaxEnrollment.IsValid) + { + return; + } + } + + valW1Day.Visible = false; + valW1Day2.Visible = false; + valW1Day3.Visible = false; + valConflict.Visible = false; + valLocationConflict.Visible = false; + valPayPalAccount.Visible = false; + valBadFee.Visible = false; + valValidRecurStartDate.Visible = false; + valNoEnrolees.Visible = false; + valMaxEnrollment.Visible = false; + + // Everythings Cool, Update Database + EventInfo objEvent = default(EventInfo); + EventRecurMasterInfo objEventRecurMaster = new EventRecurMasterInfo(); + EventRecurMasterInfo objEventRMSave = new EventRecurMasterInfo(); + + // Get Current Event, if <> 0 + if (processItem > 0) + { + objEvent = _objCtlEvent.EventsGet(processItem, ModuleId); + objEventRecurMaster = _objCtlEventRecurMaster.EventsRecurMasterGet(objEvent.RecurMasterID, objEvent.ModuleID); + objEventRMSave = _objCtlEventRecurMaster.EventsRecurMasterGet(objEvent.RecurMasterID, objEvent.ModuleID); + if (_editRecur) + { + _lstEvents = _objCtlEvent.EventsGetRecurrences(objEventRecurMaster.RecurMasterID, objEventRecurMaster.ModuleID); + } + else + { + _lstEvents.Add(objEvent); + } + } + int intDuration = 0; + objEventRecurMaster.Dtstart = tStartTime; + objEventRecurMaster.Duration = System.Convert.ToString(System.Convert.ToString(duration) + "M"); + intDuration = System.Convert.ToInt32(duration); + objEventRecurMaster.Until = tRecurEndDate; + objEventRecurMaster.UpdatedByID = UserId; + objEventRecurMaster.OwnerID = int.Parse(cmbOwner.SelectedValue); + if (processItem < 0) + { + objEventRecurMaster.RecurMasterID = -1; + objEventRecurMaster.CreatedByID = UserId; + objEventRecurMaster.ModuleID = ModuleId; + objEventRecurMaster.PortalID = PortalId; + objEventRecurMaster.CultureName = System.Threading.Thread.CurrentThread.CurrentCulture.Name; + objEventRecurMaster.JournalItem = false; + } + // Filter text for non-admins and moderators + if (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString()) == true) + { + objEventRecurMaster.EventName = txtTitle.Text; + objEventRecurMaster.EventDesc = System.Convert.ToString(ftbDesktopText.Text); + objEventRecurMaster.CustomField1 = txtCustomField1.Text; + objEventRecurMaster.CustomField2 = txtCustomField2.Text; + objEventRecurMaster.Notify = txtSubject.Text; + objEventRecurMaster.Reminder = txtReminder.Text; + objEventRecurMaster.Summary = System.Convert.ToString(ftbSummary.Text); + } + else if (IsModerator()) + { + objEventRecurMaster.EventName = objSecurity.InputFilter(txtTitle.Text, PortalSecurity.FilterFlag.NoScripting); + objEventRecurMaster.EventDesc = System.Convert.ToString(ftbDesktopText.Text); + objEventRecurMaster.CustomField1 = objSecurity.InputFilter(txtCustomField1.Text, PortalSecurity.FilterFlag.NoScripting); + objEventRecurMaster.CustomField2 = objSecurity.InputFilter(txtCustomField2.Text, PortalSecurity.FilterFlag.NoScripting); + objEventRecurMaster.Notify = objSecurity.InputFilter(txtSubject.Text, PortalSecurity.FilterFlag.NoScripting); + objEventRecurMaster.Reminder = objSecurity.InputFilter(txtReminder.Text, PortalSecurity.FilterFlag.NoScripting); + objEventRecurMaster.Summary = System.Convert.ToString(ftbSummary.Text); + } + else + { + objEventRecurMaster.EventName = objSecurity.InputFilter(txtTitle.Text, PortalSecurity.FilterFlag.NoScripting); + objEventRecurMaster.EventDesc = objSecurity.InputFilter(System.Convert.ToString(ftbDesktopText.Text), PortalSecurity.FilterFlag.NoScripting); + objEventRecurMaster.CustomField1 = objSecurity.InputFilter(txtCustomField1.Text, PortalSecurity.FilterFlag.NoScripting); + objEventRecurMaster.CustomField2 = objSecurity.InputFilter(txtCustomField2.Text, PortalSecurity.FilterFlag.NoScripting); + objEventRecurMaster.Notify = objSecurity.InputFilter(txtSubject.Text, PortalSecurity.FilterFlag.NoScripting); + objEventRecurMaster.Reminder = objSecurity.InputFilter(txtReminder.Text, PortalSecurity.FilterFlag.NoScripting); + objEventRecurMaster.Summary = objSecurity.InputFilter(System.Convert.ToString(ftbSummary.Text), PortalSecurity.FilterFlag.NoScripting); + } + + // If New Event + if (processItem < 0) + { + // If Moderator turned on, set approve=false + if (Settings.Moderateall) + { + objEventRecurMaster.Approved = false; + } + else + { + objEventRecurMaster.Approved = true; + } + } + + // Reset Approved, if Moderate All option is on + if (Settings.Moderateall && + objEventRecurMaster.Approved == true) + { + objEventRecurMaster.Approved = false; + } + + // If Admin or Moderator, automatically approve event + if (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString()) || + IsModerator()) + { + objEventRecurMaster.Approved = true; + } + + objEventRecurMaster.Importance = (EventRecurMasterInfo.Priority)int.Parse(cmbImportance.SelectedItem.Value); + + objEventRecurMaster.Signups = chkSignups.Checked; + objEventRecurMaster.AllowAnonEnroll = chkAllowAnonEnroll.Checked; + if (rblFree.Checked) + { + objEventRecurMaster.EnrollType = "FREE"; + } + else if (rblPaid.Checked) + { + objEventRecurMaster.EnrollType = "PAID"; + } + + objEventRecurMaster.PayPalAccount = txtPayPalAccount.Text; + objEventRecurMaster.EnrollFee = decimal.Parse(txtEnrollFee.Text); + objEventRecurMaster.MaxEnrollment = System.Convert.ToInt32(txtMaxEnrollment.Text); + + if (int.Parse(ddEnrollRoles.SelectedValue) != -1) + { + objEventRecurMaster.EnrollRoleID = int.Parse(ddEnrollRoles.SelectedItem.Value); + } + else + { + objEventRecurMaster.EnrollRoleID = -1; + } + + // Update Detail Page setting in the database + if (chkDetailPage.Checked && URLDetail.Url != "") + { + objEventRecurMaster.DetailPage = true; + objEventRecurMaster.DetailURL = System.Convert.ToString(URLDetail.Url); + objEventRecurMaster.DetailNewWin = System.Convert.ToBoolean(URLDetail.NewWindow); + } + else + { + objEventRecurMaster.DetailPage = false; + } + + // Update Image settings in the database + if (chkDisplayImage.Checked) + { + objEventRecurMaster.ImageDisplay = true; + if (ctlURL.UrlType == "F") + { + if (ctlURL.Url.StartsWith("FileID=")) + { + int fileId = int.Parse(System.Convert.ToString(ctlURL.Url.Substring(7))); + Services.FileSystem.IFileInfo objFileInfo = Services.FileSystem.FileManager.Instance.GetFile(fileId); + if (txtWidth.Text == "" || txtWidth.Text == 0.ToString()) + { + txtWidth.Text = System.Convert.ToString(objFileInfo.Width.ToString()); + } + if (txtHeight.Text == "" || txtHeight.Text == 0.ToString()) + { + txtHeight.Text = System.Convert.ToString(objFileInfo.Height.ToString()); + } + } + } + objEventRecurMaster.ImageURL = System.Convert.ToString(ctlURL.Url); + objEventRecurMaster.ImageType = System.Convert.ToString(ctlURL.UrlType); + } + else + { + objEventRecurMaster.ImageDisplay = false; + } + + if (txtWidth.Text == "") + { + objEventRecurMaster.ImageWidth = 0; + } + else + { + objEventRecurMaster.ImageWidth = int.Parse(txtWidth.Text); + } + if (txtHeight.Text == "") + { + objEventRecurMaster.ImageHeight = 0; + } + else + { + objEventRecurMaster.ImageHeight = int.Parse(txtHeight.Text); + } + + objEventRecurMaster.Category = int.Parse(cmbCategory.SelectedValue); + objEventRecurMaster.Location = int.Parse(cmbLocation.SelectedValue); + + objEventRecurMaster.SendReminder = chkReminder.Checked; + objEventRecurMaster.ReminderTime = int.Parse(txtReminderTime.Text); + objEventRecurMaster.ReminderTimeMeasurement = ddlReminderTimeMeasurement.SelectedValue; + objEventRecurMaster.ReminderFrom = txtReminderFrom.Text; + + objEventRecurMaster.EnrollListView = chkEnrollListView.Checked; + objEventRecurMaster.DisplayEndDate = chkDisplayEndDate.Checked; + objEventRecurMaster.AllDayEvent = chkAllDayEvent.Checked; + objEventRecurMaster.EventTimeZoneId = cboTimeZone.SelectedValue; + objEventRecurMaster.SocialGroupID = GetUrlGroupId(); + objEventRecurMaster.SocialUserID = GetUrlUserId(); + + + + // If it is possible we are edititng a recurring event create RRULE + if (processItem == 0 || _editRecur || (!_editRecur && objEventRMSave.RRULE == "")) + { + objEventRecurMaster = CreateEventRRULE(objEventRecurMaster); + if (rblRepeatTypeN.Checked) + { + objEventRecurMaster.Until = objEventRecurMaster.Dtstart.Date; + } + } + + // If editing single occurence of recurring event & start date > last date, error + if (processItem > 0 && objEventRMSave.RRULE != "" && !_editRecur) + { + if (tStartTime.Date > objEventRMSave.Until.Date) + { + valValidRecurStartDate.IsValid = false; + valValidRecurStartDate.Visible = true; + return; + } + if (tStartTime.Date < objEventRMSave.Dtstart.Date) + { + valValidRecurStartDate2.IsValid = false; + valValidRecurStartDate2.Visible = true; + return; + } + } + + // If new Event or Recurring event then check for new instances + if (processItem < 0 || + (objEventRMSave.RRULE == "" && objEventRecurMaster.RRULE != "" && !_editRecur) || + _editRecur) + { + ArrayList lstEventsNew = default(ArrayList); + lstEventsNew = _objCtlEventRecurMaster.CreateEventRecurrences(objEventRecurMaster, intDuration, Settings.Maxrecurrences); + _lstEvents = CompareOldNewEvents(_lstEvents, lstEventsNew); + + if (lstEventsNew.Count == 0) + { + // Last error!! + valValidRecurEndDate2.IsValid = false; + valValidRecurEndDate2.Visible = true; + return; + } + } + + foreach (EventInfo tempLoopVar_objEvent in _lstEvents) + { + objEvent = tempLoopVar_objEvent; + if (objEvent.EventID > 0 && objEvent.UpdateStatus != "Delete") + { + objEvent.UpdateStatus = "Match"; + EventInfo objEventSave = objEvent.Clone(); + if (_editRecur && objEvent.EventTimeBegin.ToShortTimeString() == objEventRMSave.Dtstart.ToShortTimeString()) + { + objEvent.EventTimeBegin = ConvertDateStringstoDatetime(objEvent.EventTimeBegin.ToShortDateString(), Strings.Format(objEventRecurMaster.Dtstart, "HH:mm")); + if (tRecurEndDate.Date < objEvent.EventTimeBegin.Date) + { + tRecurEndDate = objEvent.EventTimeBegin.Date.AddDays(30); + } + } + + if ((_editRecur && System.Convert.ToString(objEvent.Duration) + "M" == objEventRMSave.Duration) || !_editRecur) + { + objEvent.Duration = intDuration; + } + + if (!_editRecur) + { + objEvent.EventTimeBegin = objEventRecurMaster.Dtstart; + if (tRecurEndDate.Date < objEvent.EventTimeBegin.Date) + { + tRecurEndDate = objEvent.EventTimeBegin.Date.AddDays(30); + } + objEvent.Duration = intDuration; + } + + if ((_editRecur && objEvent.EventName == objEventRMSave.EventName) || !_editRecur) + { + objEvent.EventName = objEventRecurMaster.EventName; + } + if ((_editRecur && objEvent.EventDesc == objEventRMSave.EventDesc) || !_editRecur) + { + objEvent.EventDesc = objEventRecurMaster.EventDesc; + } + + if ((_editRecur && (int)objEvent.Importance == (int)objEventRMSave.Importance) || !_editRecur) + { + objEvent.Importance = (EventInfo.Priority)objEventRecurMaster.Importance; + } + if ((_editRecur && objEvent.Signups == objEventRMSave.Signups) || !_editRecur) + { + objEvent.Signups = objEventRecurMaster.Signups; + } + if ((_editRecur && objEvent.JournalItem == objEventRMSave.JournalItem) || !_editRecur) + { + objEvent.JournalItem = objEventRecurMaster.JournalItem; + } + if ((_editRecur && objEvent.AllowAnonEnroll == objEventRMSave.AllowAnonEnroll) || !_editRecur) + { + objEvent.AllowAnonEnroll = objEventRecurMaster.AllowAnonEnroll; + } + if ((_editRecur && objEvent.EnrollType == objEventRMSave.EnrollType) || !_editRecur) + { + objEvent.EnrollType = objEventRecurMaster.EnrollType; + } + if ((_editRecur && objEvent.PayPalAccount == objEventRMSave.PayPalAccount) || !_editRecur) + { + objEvent.PayPalAccount = objEventRecurMaster.PayPalAccount; + } + if ((_editRecur && objEvent.EnrollFee == objEventRMSave.EnrollFee) || !_editRecur) + { + objEvent.EnrollFee = objEventRecurMaster.EnrollFee; + } + if ((_editRecur && objEvent.MaxEnrollment == objEventRMSave.MaxEnrollment) || !_editRecur) + { + objEvent.MaxEnrollment = objEventRecurMaster.MaxEnrollment; + } + if ((_editRecur && objEvent.EnrollRoleID == objEventRMSave.EnrollRoleID) || !_editRecur) + { + objEvent.EnrollRoleID = objEventRecurMaster.EnrollRoleID; + } + if ((_editRecur && objEvent.DetailPage == objEventRMSave.DetailPage) || !_editRecur) + { + objEvent.DetailPage = objEventRecurMaster.DetailPage; + } + if ((_editRecur && objEvent.DetailNewWin == objEventRMSave.DetailNewWin) || !_editRecur) + { + objEvent.DetailNewWin = objEventRecurMaster.DetailNewWin; + } + + if ((_editRecur && objEvent.DetailURL == objEventRMSave.DetailURL) || !_editRecur) + { + objEvent.DetailURL = objEventRecurMaster.DetailURL; + } + + if ((_editRecur && objEvent.ImageDisplay == objEventRMSave.ImageDisplay) || !_editRecur) + { + objEvent.ImageDisplay = objEventRecurMaster.ImageDisplay; + } + if ((_editRecur && objEvent.ImageType == objEventRMSave.ImageType) || !_editRecur) + { + objEvent.ImageType = objEventRecurMaster.ImageType; + } + + if ((_editRecur && objEvent.ImageURL == objEventRMSave.ImageURL) || !_editRecur) + { + objEvent.ImageURL = objEventRecurMaster.ImageURL; + } + if ((_editRecur && objEvent.ImageWidth == objEventRMSave.ImageWidth) || !_editRecur) + { + objEvent.ImageWidth = objEventRecurMaster.ImageWidth; + } + if ((_editRecur && objEvent.ImageHeight == objEventRMSave.ImageHeight) || !_editRecur) + { + objEvent.ImageHeight = objEventRecurMaster.ImageHeight; + } + if ((_editRecur && objEvent.Category == objEventRMSave.Category) || !_editRecur) + { + objEvent.Category = objEventRecurMaster.Category; + } + if ((_editRecur && objEvent.Location == objEventRMSave.Location) || !_editRecur) + { + objEvent.Location = objEventRecurMaster.Location; + } + + // Save Event Notification Info + if ((_editRecur && objEvent.SendReminder == objEventRMSave.SendReminder) || !_editRecur) + { + objEvent.SendReminder = objEventRecurMaster.SendReminder; + } + if ((_editRecur && objEvent.Reminder == objEventRMSave.Reminder) || !_editRecur) + { + objEvent.Reminder = objEventRecurMaster.Reminder; + } + if ((_editRecur && objEvent.Notify == objEventRMSave.Notify) || !_editRecur) + { + objEvent.Notify = objEventRecurMaster.Notify; + } + if ((_editRecur && objEvent.ReminderTime == objEventRMSave.ReminderTime) || !_editRecur) + { + objEvent.ReminderTime = objEventRecurMaster.ReminderTime; + } + if ((_editRecur && objEvent.ReminderTimeMeasurement == objEventRMSave.ReminderTimeMeasurement) || !_editRecur) + { + objEvent.ReminderTimeMeasurement = objEventRecurMaster.ReminderTimeMeasurement; + } + if ((_editRecur && objEvent.ReminderFrom == objEventRMSave.ReminderFrom) || !_editRecur) + { + objEvent.ReminderFrom = objEventRecurMaster.ReminderFrom; + } + if ((_editRecur && objEvent.OwnerID == objEventRMSave.OwnerID) || !_editRecur) + { + objEvent.OwnerID = objEventRecurMaster.OwnerID; + } + + // Set for re-submit to Search Engine + objEvent.SearchSubmitted = false; + + if ((_editRecur && objEvent.CustomField1 == objEventRMSave.CustomField1) || !_editRecur) + { + objEvent.CustomField1 = objEventRecurMaster.CustomField1; + } + if ((_editRecur && objEvent.CustomField2 == objEventRMSave.CustomField2) || !_editRecur) + { + objEvent.CustomField2 = objEventRecurMaster.CustomField2; + } + if ((_editRecur && objEvent.EnrollListView == objEventRMSave.EnrollListView) || !_editRecur) + { + objEvent.EnrollListView = objEventRecurMaster.EnrollListView; + } + if ((_editRecur && objEvent.DisplayEndDate == objEventRMSave.DisplayEndDate) || !_editRecur) + { + objEvent.DisplayEndDate = objEventRecurMaster.DisplayEndDate; + } + if ((_editRecur && objEvent.AllDayEvent == objEventRMSave.AllDayEvent) || !_editRecur) + { + objEvent.AllDayEvent = objEventRecurMaster.AllDayEvent; + } + if ((_editRecur && objEvent.Summary == objEventRMSave.Summary) || !_editRecur) + { + objEvent.Summary = objEventRecurMaster.Summary; + } + + if (objEvent.EventTimeBegin != objEventSave.EventTimeBegin || + objEvent.Duration != objEventSave.Duration || + objEvent.EventName != objEventSave.EventName || + objEvent.EventDesc != objEventSave.EventDesc || + objEvent.Importance != objEventSave.Importance || + objEvent.Notify != objEventSave.Notify || + objEvent.Signups != objEventSave.Signups || + objEvent.AllowAnonEnroll != objEventSave.AllowAnonEnroll || + objEvent.MaxEnrollment != objEventSave.MaxEnrollment | + objEvent.EnrollRoleID != objEventSave.EnrollRoleID | + objEvent.EnrollFee != objEventSave.EnrollFee || + objEvent.EnrollType != objEventSave.EnrollType || + objEvent.PayPalAccount != objEventSave.PayPalAccount || + objEvent.DetailPage != objEventSave.DetailPage || + objEvent.DetailNewWin != objEventSave.DetailNewWin || + objEvent.DetailURL != objEventSave.DetailURL || + objEvent.ImageURL != objEventSave.ImageURL || + objEvent.ImageType != objEventSave.ImageType || + objEvent.ImageWidth != objEventSave.ImageWidth | + objEvent.ImageHeight != objEventSave.ImageHeight || + objEvent.ImageDisplay != objEventSave.ImageDisplay || + objEvent.Location != objEventSave.Location | + objEvent.Category != objEventSave.Category || + objEvent.Reminder != objEventSave.Reminder || + objEvent.SendReminder != objEventSave.SendReminder || + objEvent.ReminderTime != objEventSave.ReminderTime || + objEvent.ReminderTimeMeasurement != objEventSave.ReminderTimeMeasurement || + objEvent.ReminderFrom != objEventSave.ReminderFrom || + objEvent.CustomField1 != objEventSave.CustomField1 || + objEvent.CustomField2 != objEventSave.CustomField2 || + objEvent.EnrollListView != objEventSave.EnrollListView || + objEvent.DisplayEndDate != objEventSave.DisplayEndDate || + objEvent.AllDayEvent != objEventSave.AllDayEvent || + objEvent.Summary != objEventSave.Summary || + objEvent.OwnerID != objEventSave.OwnerID) + { + objEvent.LastUpdatedID = UserId; + objEvent.Approved = objEventRecurMaster.Approved; + objEvent.UpdateStatus = "Update"; + } + + } + + // Do we need to check for schedule conflict + if (Settings.Preventconflicts && objEvent.UpdateStatus != "Delete") + { + bool getSubEvents = Settings.MasterEvent; + ArrayList categoryIDs = new ArrayList(); + categoryIDs.Add("-1"); + ArrayList locationIDs = new ArrayList(); + locationIDs.Add("-1"); + ArrayList selectedEvents = objEventInfoHelper.GetEvents(objEvent.EventTimeBegin.Date, objEvent.EventTimeBegin.AddMinutes(objEvent.Duration).Date, getSubEvents, categoryIDs, locationIDs, objEventRecurMaster.SocialGroupID, objEventRecurMaster.SocialUserID); + DateTime conflictDateChk = DateTime.Now; + DateTime conflictDate = objEventInfoHelper.IsConflict(objEvent, selectedEvents, conflictDateChk); + if (conflictDate != conflictDateChk) + { + //Conflict Error + if (Settings.Locationconflict) + { + valLocationConflict.IsValid = false; + valLocationConflict.Visible = true; + valLocationConflict.ErrorMessage = Localization.GetString("valLocationConflict", LocalResourceFile) + " - " + string.Format("{0:g}", conflictDate); + valLocationConflict.Text = Localization.GetString("valLocationConflict", LocalResourceFile) + " - " + string.Format("{0:g}", conflictDate); + } + else + { + valConflict.IsValid = false; + valConflict.Visible = true; + valConflict.ErrorMessage = Localization.GetString("valConflict", LocalResourceFile) + " - " + string.Format("{0:g}", conflictDate); + valConflict.Text = Localization.GetString("valConflict", LocalResourceFile) + " - " + string.Format("{0:g}", conflictDate); + } + return; + } + } + + } + + if (objEventRecurMaster.RecurMasterID == -1 || + (objEventRMSave.RRULE == "" && !_editRecur) || + _editRecur) + { + objEventRecurMaster = _objCtlEventRecurMaster.EventsRecurMasterSave(objEventRecurMaster, TabId, true); + } + + if (objEventRecurMaster.RecurMasterID == -1) + { + SelectedDate = objEventRecurMaster.Dtstart.Date; + } + + // url tracking + UrlController objUrls = new UrlController(); + objUrls.UpdateUrl(PortalId, System.Convert.ToString(ctlURL.Url), System.Convert.ToString(ctlURL.UrlType), System.Convert.ToBoolean(ctlURL.Log), System.Convert.ToBoolean(ctlURL.Track), ModuleId, System.Convert.ToBoolean(ctlURL.NewWindow)); + objUrls.UpdateUrl(PortalId, System.Convert.ToString(URLDetail.Url), System.Convert.ToString(URLDetail.UrlType), System.Convert.ToBoolean(URLDetail.Log), System.Convert.ToBoolean(URLDetail.Track), ModuleId, System.Convert.ToBoolean(URLDetail.NewWindow)); + + bool blEmailSend = false; + bool blModeratorEmailSent = false; + EventInfo objEventEmail = new EventInfo(); + foreach (EventInfo tempLoopVar_objEvent in _lstEvents) + { + objEvent = tempLoopVar_objEvent; + objEvent.RecurMasterID = objEventRecurMaster.RecurMasterID; + switch (objEvent.UpdateStatus) + { + case "Match": + break; + case "Delete": + _objCtlEvent.EventsDelete(objEvent.EventID, objEvent.ModuleID, objEvent.ContentItemID); + break; + default: + if (!objEvent.Cancelled) + { + EventInfo oEvent = objEvent; + objEvent = _objCtlEvent.EventsSave(objEvent, false, TabId, true); + if (!oEvent.Approved && !blModeratorEmailSent) + { + oEvent.RRULE = objEventRecurMaster.RRULE; + SendModeratorEmail(oEvent); + blModeratorEmailSent = true; + } + if (oEvent.EventID != -1) + { + UpdateExistingNotificationRecords(oEvent); + } + else + { + if (!blEmailSend) + { + objEventEmail = objEvent; + blEmailSend = true; + } + } + } + break; + } + } + if (blEmailSend) + { + SendNewEventEmails(objEventEmail); + CreateNewEventJournal(objEventEmail); + } + if (chkEventEmailChk.Checked) + { + SendEventEmail((EventInfo)(_lstEvents[0])); + } + + } + + private EventRecurMasterInfo CreateEventRRULE(EventRecurMasterInfo objEventRecurMaster) + { + string strWkst = ""; + CultureInfo culture = new CultureInfo(objEventRecurMaster.CultureName, false); + strWkst = "SU"; + if (culture.DateTimeFormat.FirstDayOfWeek != DayOfWeek.Sunday) + { + strWkst = "MO"; + } + + if (rblRepeatTypeN.Checked) + { + objEventRecurMaster.RRULE = ""; + } + else if (rblRepeatTypeP1.Checked) + { + switch (cmbP1Period.SelectedItem.Value.Trim()) + { + case "D": + objEventRecurMaster.RRULE = "FREQ=DAILY"; + break; + case "W": + objEventRecurMaster.RRULE = "FREQ=WEEKLY;WKST=" + strWkst; + break; + case "M": + objEventRecurMaster.RRULE = "FREQ=MONTHLY"; + break; + case "Y": + objEventRecurMaster.RRULE = "FREQ=YEARLY"; + break; + } + + objEventRecurMaster.RRULE = objEventRecurMaster.RRULE + ";INTERVAL=" + txtP1Every.Text; + } + else if (rblRepeatTypeW1.Checked) + { + objEventRecurMaster.RRULE = "FREQ=WEEKLY;WKST=" + strWkst + ";INTERVAL=" + txtW1Every.Text + ";BYDAY="; + if (chkW1Sun.Checked || chkW1Sun2.Checked) + { + objEventRecurMaster.RRULE = objEventRecurMaster.RRULE + "SU,"; + } + if (chkW1Mon.Checked) + { + objEventRecurMaster.RRULE = objEventRecurMaster.RRULE + "MO,"; + } + if (chkW1Tue.Checked) + { + objEventRecurMaster.RRULE = objEventRecurMaster.RRULE + "TU,"; + } + if (chkW1Wed.Checked) + { + objEventRecurMaster.RRULE = objEventRecurMaster.RRULE + "WE,"; + } + if (chkW1Thu.Checked) + { + objEventRecurMaster.RRULE = objEventRecurMaster.RRULE + "TH,"; + } + if (chkW1Fri.Checked) + { + objEventRecurMaster.RRULE = objEventRecurMaster.RRULE + "FR,"; + } + if (chkW1Sat.Checked) + { + objEventRecurMaster.RRULE = objEventRecurMaster.RRULE + "SA,"; + } + objEventRecurMaster.RRULE = objEventRecurMaster.RRULE.Substring(0, objEventRecurMaster.RRULE.Length - 1); + } + else if (rblRepeatTypeM1.Checked && rblRepeatTypeM.Checked) + { + objEventRecurMaster.RRULE = "FREQ=MONTHLY;INTERVAL=" + txtMEvery.Text + ";BYDAY="; + int intWeek = 0; + string strWeek = ""; + if (cmbM1Every.SelectedIndex < 4) + { + intWeek = cmbM1Every.SelectedIndex + 1; + strWeek = "+" + Convert.ToString(intWeek); + } + else + { + intWeek = -1; + strWeek = Convert.ToString(intWeek); + } + objEventRecurMaster.RRULE = objEventRecurMaster.RRULE + strWeek; + + string strDay = ""; + switch (cmbM1Period.SelectedValue) + { + case "0": + strDay = "SU"; + break; + case "1": + strDay = "MO"; + break; + case "2": + strDay = "TU"; + break; + case "3": + strDay = "WE"; + break; + case "4": + strDay = "TH"; + break; + case "5": + strDay = "FR"; + break; + case "6": + strDay = "SA"; + break; + } + objEventRecurMaster.RRULE = objEventRecurMaster.RRULE + strDay; + } + else if (rblRepeatTypeM2.Checked && rblRepeatTypeM.Checked) + { + objEventRecurMaster.RRULE = "FREQ=MONTHLY;INTERVAL=" + txtMEvery.Text + ";BYMONTHDAY=+" + cmbM2Period.SelectedValue; + } + else if (rblRepeatTypeY1.Checked) + { + DateTime yearDate = System.Convert.ToDateTime(dpY1Period.SelectedDate); + objEventRecurMaster.RRULE = "FREQ=YEARLY;INTERVAL=1;BYMONTH=" + Convert.ToString(yearDate.Month) + ";BYMONTHDAY=+" + Convert.ToString(yearDate.Day); + } + return objEventRecurMaster; + } + + private ArrayList CompareOldNewEvents(ArrayList lstEventsOld, ArrayList lstEventsNew) + { + EventInfo objEventOld = default(EventInfo); + EventInfo objEventNew = default(EventInfo); + foreach (EventInfo tempLoopVar_objEventOld in lstEventsOld) + { + objEventOld = tempLoopVar_objEventOld; + objEventOld.UpdateStatus = "Delete"; + foreach (EventInfo tempLoopVar_objEventNew in lstEventsNew) + { + objEventNew = tempLoopVar_objEventNew; + if (objEventOld.OriginalDateBegin == objEventNew.OriginalDateBegin) + { + objEventOld.UpdateStatus = "Match"; + } + } + } + foreach (EventInfo tempLoopVar_objEventNew in lstEventsNew) + { + objEventNew = tempLoopVar_objEventNew; + objEventNew.UpdateStatus = "Add"; + foreach (EventInfo tempLoopVar_objEventOld in lstEventsOld) + { + objEventOld = tempLoopVar_objEventOld; + if (objEventOld.OriginalDateBegin == objEventNew.OriginalDateBegin) + { + objEventNew.UpdateStatus = "Match"; + } + } + } + foreach (EventInfo tempLoopVar_objEventNew in lstEventsNew) + { + objEventNew = tempLoopVar_objEventNew; + if (objEventNew.UpdateStatus == "Add") + { + lstEventsOld.Add(objEventNew); + } + } + return lstEventsOld; + } + + private void UpdateExistingNotificationRecords(EventInfo objEvent) + { + try + { + // Add Notification Records to Database, if required + if (chkReminder.Checked == true) + { + DateTime eventTimeBegin = default(DateTime); + //Adjust Begin Time to UTC + eventTimeBegin = objEvent.EventTimeBegin; + eventTimeBegin = eventTimeBegin.AddMinutes(0); //only to pass to EventsNotificationTimeChange in correct format... + // Update Time for any existing Notifications for the Event + EventNotificationController objEventNotificationController = new EventNotificationController(); + objEventNotificationController.EventsNotificationTimeChange(objEvent.EventID, eventTimeBegin, ModuleId); + } + } + catch (Exception exc) + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + + private void SendModeratorEmail(EventInfo objEvent) + { + try + { + // Send Moderator email + if (Settings.Moderateall) + { + EventEmailInfo objEventEmailInfo = new EventEmailInfo(); + EventEmails objEventEmail = new EventEmails(PortalId, ModuleId, LocalResourceFile, ((PageBase)Page).PageCulture.Name); + objEventEmailInfo.TxtEmailSubject = Settings.Templates.moderateemailsubject; + objEventEmailInfo.TxtEmailBody = Settings.Templates.moderateemailmessage; + objEventEmailInfo.TxtEmailFrom = Settings.StandardEmail; + ArrayList moderators = GetModerators(); + foreach (UserInfo moderator in moderators) + { + objEventEmailInfo.UserEmails.Add(moderator.Email); + objEventEmailInfo.UserLocales.Add(moderator.Profile.PreferredLocale); + objEventEmailInfo.UserTimeZoneIds.Add(moderator.Profile.PreferredTimeZone.Id); + } + objEventEmail.SendEmails(objEventEmailInfo, objEvent); + } + + } + catch (Exception exc) + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + + private void SendEventEmail(EventInfo objEventEmailIn) + { + EventEmailInfo objEventEmailInfo = new EventEmailInfo(); + EventEmails objEventEmail = new EventEmails(PortalId, ModuleId, LocalResourceFile, ((PageBase)Page).PageCulture.Name); + objEventEmailInfo.TxtEmailSubject = txtEventEmailSubject.Text; + objEventEmailInfo.TxtEmailBody = txtEventEmailBody.Text; + objEventEmailInfo.TxtEmailFrom = txtEventEmailFrom.Text; + EventEmailAddRoleUsers(int.Parse(ddEventEmailRoles.SelectedValue), objEventEmailInfo); + objEventEmail.SendEmails(objEventEmailInfo, objEventEmailIn); + + } + + private DateTime ConvertDateStringstoDatetime(string strDate, string strTime) + { + + CultureInfo invCulture = CultureInfo.InvariantCulture; + + DateTime tDate = default(DateTime); + tDate = Convert.ToDateTime(strDate).Date; + + // Since dates may not be in a form directly combinable with time, convert back to string to enable combination + strDate = tDate.ToString("yyyy/MM/dd", invCulture); + tDate = DateTime.ParseExact(strDate + " " + strTime, "yyyy/MM/dd HH:mm", invCulture); + return tDate; + } + + private void BuildEnrolleeGrid(EventInfo objEvent) + { + ArrayList objSignups = default(ArrayList); + // Refresh Enrollment Grid + if (_editRecur) + { + objSignups = _objCtlEventSignups.EventsSignupsGetEventRecurMaster(objEvent.RecurMasterID, objEvent.ModuleID); + } + else + { + objSignups = _objCtlEventSignups.EventsSignupsGetEvent(objEvent.EventID, objEvent.ModuleID); + } + + ArrayList eventEnrollment = new ArrayList(); + EventSignupsInfo objSignup = default(EventSignupsInfo); + UserController objCtlUser = new UserController(); + int noEnrolees = 0; + foreach (EventSignupsInfo tempLoopVar_objSignup in objSignups) + { + objSignup = tempLoopVar_objSignup; + EventEnrollList objEnrollListItem = new EventEnrollList(); + noEnrolees += objSignup.NoEnrolees; + if (objSignup.UserID != -1) + { + UserInfo objUser = default(UserInfo); + objUser = objCtlUser.GetUser(PortalId, objSignup.UserID); + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + objEnrollListItem.EnrollDisplayName = objEventInfoHelper.UserDisplayNameProfile(objSignup.UserID, objSignup.UserName, LocalResourceFile).DisplayNameURL; + if (!ReferenceEquals(objUser, null)) + { + objEnrollListItem.EnrollUserName = objUser.Username; + objEnrollListItem.EnrollEmail = string.Format("{0}", objSignup.Email, objEvent.EventName); + objEnrollListItem.EnrollPhone = objUser.Profile.Telephone; + } + } + else + { + objEnrollListItem.EnrollDisplayName = objSignup.AnonName; + objEnrollListItem.EnrollUserName = Localization.GetString("AnonUser", LocalResourceFile); + objEnrollListItem.EnrollEmail = string.Format("{0}", objSignup.AnonEmail, objEvent.EventName); + objEnrollListItem.EnrollPhone = objSignup.AnonTelephone; + } + objEnrollListItem.SignupID = objSignup.SignupID; + objEnrollListItem.EnrollApproved = objSignup.Approved; + objEnrollListItem.EnrollNo = objSignup.NoEnrolees; + objEnrollListItem.EnrollTimeBegin = objSignup.EventTimeBegin; + eventEnrollment.Add(objEnrollListItem); + } + + if (eventEnrollment.Count > 0) + { + grdEnrollment.DataSource = eventEnrollment; + grdEnrollment.DataBind(); + tblEventEmail.Attributes.Add("style", "display:block; width:100%"); + lblEnrolledUsers.Visible = true; + grdEnrollment.Visible = true; + lnkSelectedDelete.Visible = true; + lnkSelectedEmail.Visible = true; + } + else + { + lblEnrolledUsers.Visible = false; + grdEnrollment.Visible = false; + if (!Settings.Newpereventemail) + { + tblEventEmail.Attributes.Add("style", "display:none; width:100%"); + } + lnkSelectedDelete.Visible = false; + lnkSelectedEmail.Visible = false; + } + + objEvent.Enrolled = eventEnrollment.Count; + objEvent.Signups = true; + ShowHideEnrolleeColumns(objEvent); + + txtEnrolled.Text = noEnrolees.ToString(); + valNoEnrolees.MaximumValue = Convert.ToString(objEvent.MaxEnrollment - noEnrolees); + if (int.Parse(valNoEnrolees.MaximumValue) > Settings.Maxnoenrolees | objEvent.MaxEnrollment == 0) + { + valNoEnrolees.MaximumValue = Settings.Maxnoenrolees.ToString(); + } + else if (int.Parse(valNoEnrolees.MaximumValue) < 1) + { + valNoEnrolees.MaximumValue = "1"; + } + lblMaxNoEnrolees.Text = string.Format(Localization.GetString("lblMaxNoEnrolees", LocalResourceFile), valNoEnrolees.MaximumValue); + } + + private void ShowHideEnrolleeColumns(EventInfo objEvent) + { + string txtColumns = EnrolmentColumns(objEvent, true); + GridView gvUsersToEnroll = (GridView)(grdAddUser.FindControl("gvUsersToEnroll")); + if (txtColumns.LastIndexOf("UserName", StringComparison.Ordinal) < 0) + { + grdEnrollment.Columns[1].Visible = false; + gvUsersToEnroll.Columns[1].Visible = false; + } + else + { + grdEnrollment.Columns[1].Visible = true; + gvUsersToEnroll.Columns[1].Visible = true; + } + if (txtColumns.LastIndexOf("DisplayName", StringComparison.Ordinal) < 0) + { + grdEnrollment.Columns[2].Visible = false; + gvUsersToEnroll.Columns[2].Visible = false; + } + else + { + grdEnrollment.Columns[2].Visible = true; + gvUsersToEnroll.Columns[2].Visible = true; + } + if (txtColumns.LastIndexOf("Email", StringComparison.Ordinal) < 0) + { + grdEnrollment.Columns[3].Visible = false; + gvUsersToEnroll.Columns[3].Visible = false; + } + else + { + grdEnrollment.Columns[3].Visible = true; + gvUsersToEnroll.Columns[3].Visible = true; + } + if (txtColumns.LastIndexOf("Phone", StringComparison.Ordinal) < 0) + { + grdEnrollment.Columns[4].Visible = false; + } + else + { + grdEnrollment.Columns[4].Visible = true; + } + if (txtColumns.LastIndexOf("Approved", StringComparison.Ordinal) < 0) + { + grdEnrollment.Columns[5].Visible = false; + } + else + { + grdEnrollment.Columns[5].Visible = true; + } + if (txtColumns.LastIndexOf("Qty", StringComparison.Ordinal) < 0) + { + grdEnrollment.Columns[6].Visible = false; + } + else + { + grdEnrollment.Columns[6].Visible = true; + } + if (_editRecur) + { + grdEnrollment.Columns[7].Visible = true; + } + else + { + grdEnrollment.Columns[7].Visible = false; + } + + } + + private void AddRegUser(int inUserID, EventInfo objEvent) + { + // Check if signup already exists since due to partial rendering it may be possible + // to click the enroll user link twice + int intUserID = inUserID; + _objEventSignups = _objCtlEventSignups.EventsSignupsGetUser(objEvent.EventID, intUserID, objEvent.ModuleID); + + if (ReferenceEquals(_objEventSignups, null)) + { + // Get user info + UserInfo objUserInfo = UserController.GetUserById(PortalId, intUserID); + + _objEventSignups = new EventSignupsInfo(); + _objEventSignups.EventID = objEvent.EventID; + _objEventSignups.ModuleID = objEvent.ModuleID; + _objEventSignups.UserID = intUserID; + _objEventSignups.AnonEmail = null; + _objEventSignups.AnonName = null; + _objEventSignups.AnonTelephone = null; + _objEventSignups.AnonCulture = null; + _objEventSignups.AnonTimeZoneId = null; + _objEventSignups.PayPalPaymentDate = DateTime.UtcNow; + _objEventSignups.Approved = true; + _objEventSignups.NoEnrolees = int.Parse(txtNoEnrolees.Text); + _objEventSignups = CreateEnrollment(_objEventSignups, objEvent); + + // Mail users + if (Settings.SendEnrollMessageAdded) + { + EventEmailInfo objEventEmailInfo = new EventEmailInfo(); + EventEmails objEventEmail = new EventEmails(PortalId, ModuleId, LocalResourceFile, ((PageBase)Page).PageCulture.Name); + objEventEmailInfo.TxtEmailSubject = Settings.Templates.txtEnrollMessageSubject; + objEventEmailInfo.TxtEmailBody = Settings.Templates.txtEnrollMessageAdded; + objEventEmailInfo.TxtEmailFrom = Settings.StandardEmail; + objEventEmailInfo.UserIDs.Add(_objEventSignups.UserID); + objEventEmailInfo.UserIDs.Add(objEvent.OwnerID); + objEventEmail.SendEmails(objEventEmailInfo, objEvent, _objEventSignups); + } + } + } + + private bool ValidateTime(DateTime indate) + { + int inMinutes = indate.Minute; + int remainder = inMinutes % int.Parse(Settings.Timeinterval); + if (remainder > 0) + { + return false; + } + return true; + } + + #endregion + + #region Links and Buttons + protected void cancelButton_Click(object sender, EventArgs e) + { + try + { + Response.Redirect(GetStoredPrevPage(), true); + + } + catch (Exception) //Module failed to load + { + //ProcessModuleLoadException(Me, exc) + } + } + + protected void updateButton_Click(object sender, EventArgs e) + { + try + { + UpdateProcessing(_itemID); + if (Page.IsValid) + { + Response.Redirect(GetStoredPrevPage(), true); + } + + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + + protected void deleteButton_Click(System.Object sender, EventArgs e) + { + try + { + _objEvent = _objCtlEvent.EventsGet(_itemID, ModuleId); + if (_editRecur) + { + _objCtlEventRecurMaster.EventsRecurMasterDelete(_objEvent.RecurMasterID, _objEvent.ModuleID); + } + else + { + if (_objEvent.RRULE != "") + { + _objEvent.Cancelled = true; + _objEvent.LastUpdatedID = UserId; + _objEvent = _objCtlEvent.EventsSave(_objEvent, false, TabId, true); + } + else + { + _objCtlEventRecurMaster.EventsRecurMasterDelete(_objEvent.RecurMasterID, _objEvent.ModuleID); + } + } + Response.Redirect(GetSocialNavigateUrl(), true); + } + catch (Exception) //Module failed to load + { + //ProcessModuleLoadException(Me, exc) + } + } + + protected void lnkSelectedEmail_Click(System.Object sender, EventArgs e) + { + Email(true); + } + + protected void lnkSelectedDelete_Click(System.Object sender, EventArgs e) + { + DataGridItem item = default(DataGridItem); + EventSignupsInfo objEnroll = default(EventSignupsInfo); + int eventID = 0; + + foreach (DataGridItem tempLoopVar_item in grdEnrollment.Items) + { + item = tempLoopVar_item; + if (((CheckBox)(item.FindControl("chkSelect"))).Checked) + { + int intSignupID = System.Convert.ToInt32(grdEnrollment.DataKeys[item.ItemIndex]); + objEnroll = _objCtlEventSignups.EventsSignupsGet(intSignupID, ModuleId, false); + if (!ReferenceEquals(objEnroll, null)) + { + if (eventID != objEnroll.EventID) + { + _objEvent = _objCtlEvent.EventsGet(objEnroll.EventID, ModuleId); + } + eventID = objEnroll.EventID; + + // Delete Selected Enrollee + DeleteEnrollment(intSignupID, _objEvent.ModuleID, _objEvent.EventID); + + // Mail users + if (Settings.SendEnrollMessageDeleted) + { + EventEmailInfo objEventEmailInfo = new EventEmailInfo(); + EventEmails objEventEmail = new EventEmails(PortalId, ModuleId, LocalResourceFile, ((PageBase)Page).PageCulture.Name); + objEventEmailInfo.TxtEmailSubject = Settings.Templates.txtEnrollMessageSubject; + objEventEmailInfo.TxtEmailBody = Settings.Templates.txtEnrollMessageDeleted; + objEventEmailInfo.TxtEmailFrom = Settings.StandardEmail; + if (objEnroll.UserID > -1) + { + objEventEmailInfo.UserIDs.Add(objEnroll.UserID); + } + else + { + objEventEmailInfo.UserEmails.Add(objEnroll.AnonEmail); + objEventEmailInfo.UserLocales.Add(objEnroll.AnonCulture); + objEventEmailInfo.UserTimeZoneIds.Add(objEnroll.AnonTimeZoneId); + } + objEventEmailInfo.UserIDs.Add(_objEvent.OwnerID); + objEventEmail.SendEmails(objEventEmailInfo, _objEvent, objEnroll); + } + } + + } + } + + LoadRegUsers(); + BuildEnrolleeGrid(_objEvent); + } + + protected void copyButton_Click(object sender, EventArgs e) + { + try + { + UpdateProcessing(-1); + if (Page.IsValid) + { + Response.Redirect(GetStoredPrevPage(), true); + } + + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + + protected void ddEnrollRoles_SelectedIndexChanged(object sender, EventArgs e) + { + LoadRegUsers(); + } + + protected void chkSignups_CheckedChanged(object sender, EventArgs e) + { + tblEventEmail.Attributes.Add("style", "display:none; width:100%"); + if (chkSignups.Checked) + { + tblEnrollmentDetails.Attributes.Add("style", "display:block;"); + LoadRegUsers(); + if (txtEnrolled.Text != 0.ToString()) + { + tblEventEmail.Attributes.Add("style", "display:block; width:100%"); + } + } + else + { + tblEnrollmentDetails.Attributes.Add("style", "display:none;"); + if (Settings.Newpereventemail && chkEventEmailChk.Checked) + { + tblEventEmail.Attributes.Add("style", "display:block; width:100%"); + } + } + } + + protected void grdAddUser_AddSelectedUsers(object sender, EventArgs e, ArrayList arrUsers) + { + try + { + if (int.Parse(txtNoEnrolees.Text) > int.Parse(valNoEnrolees.MaximumValue) || int.Parse(txtNoEnrolees.Text) < int.Parse(valNoEnrolees.MinimumValue)) + { + valNoEnrolees.IsValid = false; + valNoEnrolees.Visible = true; + valNoEnrolees.ErrorMessage = string.Format(Localization.GetString("valNoEnrolees", LocalResourceFile), valNoEnrolees.MaximumValue); + return; + } + } + catch + { + valNoEnrolees.IsValid = false; + valNoEnrolees.Visible = true; + valNoEnrolees.ErrorMessage = string.Format(Localization.GetString("valNoEnrolees", LocalResourceFile), valNoEnrolees.MaximumValue); + return; + } + + EventInfo objEvent = _objCtlEvent.EventsGet(_itemID, ModuleId); + + foreach (int inUserid in arrUsers) + { + AddRegUser(inUserid, objEvent); + } + LoadRegUsers(); + BuildEnrolleeGrid(objEvent); + txtNoEnrolees.Text = System.Convert.ToString(1.ToString()); + } + + #endregion + + #region Web Form Designer Generated Code + + //This call is required by the Web Form Designer. + [DebuggerStepThrough()] + private void InitializeComponent() + { + + } + + private void Page_Init(System.Object sender, EventArgs e) + { + //CODEGEN: This method call is required by the Web Form Designer + //Do not modify it using the code editor. + InitializeComponent(); + } + + #endregion + + } + + #region Comparer Class + public class UserListSort : IComparer + { + + public int Compare(object x, object y) + { + string xdisplayname = ""; + string ydisplayname = ""; + + xdisplayname = ((EventUser)x).DisplayName; + ydisplayname = ((EventUser)y).DisplayName; + CaseInsensitiveComparer c = new CaseInsensitiveComparer(); + return c.Compare(xdisplayname, ydisplayname); + } + } + + #endregion + +} + + diff --git a/EditEvents.ascx.designer.cs b/EditEvents.ascx.designer.cs new file mode 100644 index 0000000..815ea5c --- /dev/null +++ b/EditEvents.ascx.designer.cs @@ -0,0 +1,1932 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DotNetNuke.Modules.Events { + + + public partial class EditEvents { + + /// + /// pnlEventsModuleEdit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlEventsModuleEdit; + + /// + /// valSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary valSummary; + + /// + /// lblTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblTitle; + + /// + /// txtTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtTitle; + + /// + /// valRequiredTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequiredTitle; + + /// + /// lblAllDayEvent control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblAllDayEvent; + + /// + /// chkAllDayEvent control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkAllDayEvent; + + /// + /// lblStartDateTime control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblStartDateTime; + + /// + /// dpStartDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Web.UI.WebControls.DnnDatePicker dpStartDate; + + /// + /// divStartTime control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divStartTime; + + /// + /// tpStartTime control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Web.UI.WebControls.DnnTimePicker tpStartTime; + + /// + /// btnCopyStartdate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton btnCopyStartdate; + + /// + /// valRequiredStartDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequiredStartDate; + + /// + /// valValidStartDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CustomValidator valValidStartDate; + + /// + /// valValidRecurStartDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CustomValidator valValidRecurStartDate; + + /// + /// valValidRecurStartDate2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CustomValidator valValidRecurStartDate2; + + /// + /// valValidStartDate2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CustomValidator valValidStartDate2; + + /// + /// valRequiredStartTime control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequiredStartTime; + + /// + /// valValidStartTime2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CustomValidator valValidStartTime2; + + /// + /// valConflict control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CustomValidator valConflict; + + /// + /// valLocationConflict control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CustomValidator valLocationConflict; + + /// + /// lblEndDateTime control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEndDateTime; + + /// + /// dpEndDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Web.UI.WebControls.DnnDatePicker dpEndDate; + + /// + /// divEndTime control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divEndTime; + + /// + /// tpEndTime control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Web.UI.WebControls.DnnTimePicker tpEndTime; + + /// + /// valRequiredEndDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequiredEndDate; + + /// + /// valValidEndDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CompareValidator valValidEndDate; + + /// + /// valValidEndTime control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CustomValidator valValidEndTime; + + /// + /// valRequiredEndTime control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequiredEndTime; + + /// + /// valValidEndTime2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CustomValidator valValidEndTime2; + + /// + /// lblDisplayEndDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblDisplayEndDate; + + /// + /// chkDisplayEndDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkDisplayEndDate; + + /// + /// trTimeZone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl trTimeZone; + + /// + /// lblTimeZone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblTimeZone; + + /// + /// cboTimeZone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Web.UI.WebControls.DnnTimeZoneComboBox cboTimeZone; + + /// + /// lblImportance control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblImportance; + + /// + /// cmbImportance control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList cmbImportance; + + /// + /// lblCategory control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblCategory; + + /// + /// cmbCategory control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList cmbCategory; + + /// + /// lblLocation control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblLocation; + + /// + /// cmbLocation control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList cmbLocation; + + /// + /// trCustomField1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl trCustomField1; + + /// + /// lblCustomField1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblCustomField1; + + /// + /// txtCustomField1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtCustomField1; + + /// + /// trCustomField2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl trCustomField2; + + /// + /// lblCustomField2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblCustomField2; + + /// + /// txtCustomField2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtCustomField2; + + /// + /// trOwner control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl trOwner; + + /// + /// lblOwner control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblOwner; + + /// + /// cmbOwner control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList cmbOwner; + + /// + /// lblNotes control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblNotes; + + /// + /// ftbDesktopText control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.TextEditor ftbDesktopText; + + /// + /// lblSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblSummary; + + /// + /// ftbSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.TextEditor ftbSummary; + + /// + /// pnlDetailPage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlDetailPage; + + /// + /// lblDetailPage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblDetailPage; + + /// + /// chkDetailPage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkDetailPage; + + /// + /// tblDetailPageDetail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl tblDetailPageDetail; + + /// + /// lblDetailURL control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblDetailURL; + + /// + /// URLDetail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.UrlControl URLDetail; + + /// + /// pnlReminder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlReminder; + + /// + /// lblSendReminder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblSendReminder; + + /// + /// chkReminder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkReminder; + + /// + /// tblReminderDetail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl tblReminderDetail; + + /// + /// lblTimeBefore control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblTimeBefore; + + /// + /// txtReminderTime control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtReminderTime; + + /// + /// ddlReminderTimeMeasurement control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlReminderTimeMeasurement; + + /// + /// valReminderTime2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valReminderTime2; + + /// + /// valReminderTime control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RangeValidator valReminderTime; + + /// + /// lblEmailFrom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEmailFrom; + + /// + /// txtReminderFrom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtReminderFrom; + + /// + /// valEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valEmail; + + /// + /// lblNotifyEmailSubject control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblNotifyEmailSubject; + + /// + /// txtSubject control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSubject; + + /// + /// lblNotifyEmailMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblNotifyEmailMessage; + + /// + /// txtReminder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtReminder; + + /// + /// pnlImage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlImage; + + /// + /// lblDisplayImage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblDisplayImage; + + /// + /// chkDisplayImage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkDisplayImage; + + /// + /// tblImageURL control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl tblImageURL; + + /// + /// lblImageURL control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblImageURL; + + /// + /// ctlURL control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.UrlControl ctlURL; + + /// + /// lblWidth control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblWidth; + + /// + /// txtWidth control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtWidth; + + /// + /// valWidth control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valWidth; + + /// + /// lblHeight control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblHeight; + + /// + /// txtHeight control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtHeight; + + /// + /// valHeight control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valHeight; + + /// + /// pnlRecurring control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlRecurring; + + /// + /// lblRecEvent control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblRecEvent; + + /// + /// chkReccuring control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkReccuring; + + /// + /// rblRepeatTypeN control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblRepeatTypeN; + + /// + /// tblRecurringDetails control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl tblRecurringDetails; + + /// + /// lblEndDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEndDate; + + /// + /// lblMaxRecurrences control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMaxRecurrences; + + /// + /// dpRecurEndDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Web.UI.WebControls.DnnDatePicker dpRecurEndDate; + + /// + /// valRequiredRecurEndDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequiredRecurEndDate; + + /// + /// valValidRecurEndDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CustomValidator valValidRecurEndDate; + + /// + /// valValidRecurEndDate2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CustomValidator valValidRecurEndDate2; + + /// + /// lblPeriodicEvent control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblPeriodicEvent; + + /// + /// rblRepeatTypeP1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblRepeatTypeP1; + + /// + /// tblDetailP1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl tblDetailP1; + + /// + /// lblEvery control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEvery; + + /// + /// txtP1Every control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtP1Every; + + /// + /// cmbP1Period control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList cmbP1Period; + + /// + /// valP1Every control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RangeValidator valP1Every; + + /// + /// valP1Every2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valP1Every2; + + /// + /// lblWeeklyEvent control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblWeeklyEvent; + + /// + /// rblRepeatTypeW1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblRepeatTypeW1; + + /// + /// tblDetailW1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl tblDetailW1; + + /// + /// lblRepetitionWeek control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblRepetitionWeek; + + /// + /// txtW1Every control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtW1Every; + + /// + /// valW1Day control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RangeValidator valW1Day; + + /// + /// valW1Day2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valW1Day2; + + /// + /// lblWeekDays control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblWeekDays; + + /// + /// chkW1Sun control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkW1Sun; + + /// + /// chkW1Mon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkW1Mon; + + /// + /// chkW1Tue control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkW1Tue; + + /// + /// chkW1Wed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkW1Wed; + + /// + /// chkW1Thu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkW1Thu; + + /// + /// chkW1Fri control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkW1Fri; + + /// + /// chkW1Sat control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkW1Sat; + + /// + /// chkW1Sun2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkW1Sun2; + + /// + /// valW1Day3 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CustomValidator valW1Day3; + + /// + /// lblMonthlyEvent control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblMonthlyEvent; + + /// + /// rblRepeatTypeM control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblRepeatTypeM; + + /// + /// tblDetailM1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl tblDetailM1; + + /// + /// rblRepeatTypeM1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblRepeatTypeM1; + + /// + /// lblRepeatedOn1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblRepeatedOn1; + + /// + /// cmbM1Every control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList cmbM1Every; + + /// + /// cmbM1Period control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList cmbM1Period; + + /// + /// rblRepeatTypeM2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblRepeatTypeM2; + + /// + /// lblRepeatedOn2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblRepeatedOn2; + + /// + /// cmbM2Period control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList cmbM2Period; + + /// + /// lblRepetitionMonth control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblRepetitionMonth; + + /// + /// txtMEvery control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtMEvery; + + /// + /// valM2Every control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RangeValidator valM2Every; + + /// + /// valM2Every2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valM2Every2; + + /// + /// lblYearlyEvent control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblYearlyEvent; + + /// + /// rblRepeatTypeY1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblRepeatTypeY1; + + /// + /// tblDetailY1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl tblDetailY1; + + /// + /// lblRepeatOnDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblRepeatOnDate; + + /// + /// dpY1Period control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Web.UI.WebControls.DnnDatePicker dpY1Period; + + /// + /// valRequiredYearEventDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequiredYearEventDate; + + /// + /// valValidYearEventDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CompareValidator valValidYearEventDate; + + /// + /// pnlEnroll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlEnroll; + + /// + /// lblAllowErollment control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblAllowErollment; + + /// + /// chkSignups control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkSignups; + + /// + /// tblEnrollmentDetails control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl tblEnrollmentDetails; + + /// + /// trAllowAnonEnroll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl trAllowAnonEnroll; + + /// + /// plAllowAnonEnroll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plAllowAnonEnroll; + + /// + /// chkAllowAnonEnroll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkAllowAnonEnroll; + + /// + /// trTypeOfEnrollment control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl trTypeOfEnrollment; + + /// + /// lblTypeOfEnrollment control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblTypeOfEnrollment; + + /// + /// rblFree control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblFree; + + /// + /// lblFree control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblFree; + + /// + /// lblModerated control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblModerated; + + /// + /// rblPaid control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblPaid; + + /// + /// lblPaidFee control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblPaidFee; + + /// + /// txtEnrollFee control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtEnrollFee; + + /// + /// lblTotalCurrency control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblTotalCurrency; + + /// + /// valBadFee control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valBadFee; + + /// + /// trPayPalAccount control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl trPayPalAccount; + + /// + /// lblPayPalAccount control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblPayPalAccount; + + /// + /// txtPayPalAccount control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPayPalAccount; + + /// + /// valPayPalAccount control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valPayPalAccount; + + /// + /// lblMaxEnrollment control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblMaxEnrollment; + + /// + /// txtMaxEnrollment control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtMaxEnrollment; + + /// + /// lblCurrentEnrolled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblCurrentEnrolled; + + /// + /// txtEnrolled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtEnrolled; + + /// + /// valMaxEnrollment2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valMaxEnrollment2; + + /// + /// valMaxEnrollment control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RangeValidator valMaxEnrollment; + + /// + /// lblEnrollListView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEnrollListView; + + /// + /// chkEnrollListView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnrollListView; + + /// + /// lblEnrollmentRole control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEnrollmentRole; + + /// + /// ddEnrollRoles control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddEnrollRoles; + + /// + /// lblEnrollRoleNote control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEnrollRoleNote; + + /// + /// divAddUser control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divAddUser; + + /// + /// lblRegUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblRegUsers; + + /// + /// grdAddUser control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.EventUserGrid grdAddUser; + + /// + /// divNoEnrolees control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divNoEnrolees; + + /// + /// lblNoEnrolee control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblNoEnrolee; + + /// + /// txtNoEnrolees control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtNoEnrolees; + + /// + /// lblMaxNoEnrolees control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMaxNoEnrolees; + + /// + /// valNoEnrolees control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RangeValidator valNoEnrolees; + + /// + /// lblEnrolledUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEnrolledUsers; + + /// + /// grdEnrollment control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DataGrid grdEnrollment; + + /// + /// lnkSelectedEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.WebControls.CommandButton lnkSelectedEmail; + + /// + /// lnkSelectedDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.WebControls.CommandButton lnkSelectedDelete; + + /// + /// pnlEventEmailRole control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlEventEmailRole; + + /// + /// lblEventEmailChk control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEventEmailChk; + + /// + /// chkEventEmailChk control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEventEmailChk; + + /// + /// tblEventEmailRoleDetail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl tblEventEmailRoleDetail; + + /// + /// lblEventEmailRole control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEventEmailRole; + + /// + /// ddEventEmailRoles control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddEventEmailRoles; + + /// + /// tblEventEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl tblEventEmail; + + /// + /// lblEventEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEventEmail; + + /// + /// lblEventEmailFrom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEventEmailFrom; + + /// + /// txtEventEmailFrom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtEventEmailFrom; + + /// + /// RegularExpressionValidator1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator RegularExpressionValidator1; + + /// + /// lblEventEmailSubject control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEventEmailSubject; + + /// + /// txtEventEmailSubject control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtEventEmailSubject; + + /// + /// lblEventEmailBody control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEventEmailBody; + + /// + /// txtEventEmailBody control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtEventEmailBody; + + /// + /// updateButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton updateButton; + + /// + /// cancelButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cancelButton; + + /// + /// deleteButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton deleteButton; + + /// + /// copyButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton copyButton; + + /// + /// pnlAudit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlAudit; + + /// + /// lblCreatedBy control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblCreatedBy; + + /// + /// CreatedBy control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label CreatedBy; + + /// + /// lblOn control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblOn; + + /// + /// CreatedDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label CreatedDate; + } +} diff --git a/EditEvents.ascx.designer.vb b/EditEvents.ascx.designer.vb deleted file mode 100644 index 77267f7..0000000 --- a/EditEvents.ascx.designer.vb +++ /dev/null @@ -1,1934 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Namespace DotNetNuke.Modules.Events - - Partial Public Class EditEvents - - ''' - '''pnlEventsModuleEdit control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlEventsModuleEdit As Global.System.Web.UI.WebControls.Panel - - ''' - '''valSummary control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valSummary As Global.System.Web.UI.WebControls.ValidationSummary - - ''' - '''lblTitle control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblTitle As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtTitle control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtTitle As Global.System.Web.UI.WebControls.TextBox - - ''' - '''valRequiredTitle control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valRequiredTitle As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''lblAllDayEvent control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblAllDayEvent As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkAllDayEvent control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkAllDayEvent As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblStartDateTime control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblStartDateTime As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''dpStartDate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents dpStartDate As Global.DotNetNuke.Web.UI.WebControls.DnnDatePicker - - ''' - '''divStartTime control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divStartTime As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''tpStartTime control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents tpStartTime As Global.DotNetNuke.Web.UI.WebControls.DnnTimePicker - - ''' - '''btnCopyStartdate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents btnCopyStartdate As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''valRequiredStartDate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valRequiredStartDate As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''valValidStartDate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valValidStartDate As Global.System.Web.UI.WebControls.CustomValidator - - ''' - '''valValidRecurStartDate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valValidRecurStartDate As Global.System.Web.UI.WebControls.CustomValidator - - ''' - '''valValidRecurStartDate2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valValidRecurStartDate2 As Global.System.Web.UI.WebControls.CustomValidator - - ''' - '''valValidStartDate2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valValidStartDate2 As Global.System.Web.UI.WebControls.CustomValidator - - ''' - '''valRequiredStartTime control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valRequiredStartTime As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''valValidStartTime2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valValidStartTime2 As Global.System.Web.UI.WebControls.CustomValidator - - ''' - '''valConflict control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valConflict As Global.System.Web.UI.WebControls.CustomValidator - - ''' - '''valLocationConflict control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valLocationConflict As Global.System.Web.UI.WebControls.CustomValidator - - ''' - '''lblEndDateTime control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEndDateTime As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''dpEndDate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents dpEndDate As Global.DotNetNuke.Web.UI.WebControls.DnnDatePicker - - ''' - '''divEndTime control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divEndTime As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''tpEndTime control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents tpEndTime As Global.DotNetNuke.Web.UI.WebControls.DnnTimePicker - - ''' - '''valRequiredEndDate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valRequiredEndDate As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''valValidEndDate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valValidEndDate As Global.System.Web.UI.WebControls.CompareValidator - - ''' - '''valValidEndTime control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valValidEndTime As Global.System.Web.UI.WebControls.CustomValidator - - ''' - '''valRequiredEndTime control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valRequiredEndTime As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''valValidEndTime2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valValidEndTime2 As Global.System.Web.UI.WebControls.CustomValidator - - ''' - '''lblDisplayEndDate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblDisplayEndDate As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkDisplayEndDate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkDisplayEndDate As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''trTimeZone control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents trTimeZone As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblTimeZone control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblTimeZone As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''cboTimeZone control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cboTimeZone As Global.DotNetNuke.Web.UI.WebControls.DnnTimeZoneComboBox - - ''' - '''lblImportance control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblImportance As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''cmbImportance control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmbImportance As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''lblCategory control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblCategory As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''cmbCategory control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmbCategory As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''lblLocation control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblLocation As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''cmbLocation control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmbLocation As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''trCustomField1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents trCustomField1 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblCustomField1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblCustomField1 As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtCustomField1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtCustomField1 As Global.System.Web.UI.WebControls.TextBox - - ''' - '''trCustomField2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents trCustomField2 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblCustomField2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblCustomField2 As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtCustomField2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtCustomField2 As Global.System.Web.UI.WebControls.TextBox - - ''' - '''trOwner control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents trOwner As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblOwner control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblOwner As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''cmbOwner control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmbOwner As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''lblNotes control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblNotes As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ftbDesktopText control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ftbDesktopText As Global.DotNetNuke.UI.UserControls.TextEditor - - ''' - '''lblSummary control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblSummary As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ftbSummary control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ftbSummary As Global.DotNetNuke.UI.UserControls.TextEditor - - ''' - '''pnlDetailPage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlDetailPage As Global.System.Web.UI.WebControls.Panel - - ''' - '''lblDetailPage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblDetailPage As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkDetailPage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkDetailPage As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''tblDetailPageDetail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents tblDetailPageDetail As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblDetailURL control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblDetailURL As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''URLDetail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents URLDetail As Global.DotNetNuke.UI.UserControls.UrlControl - - ''' - '''pnlReminder control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlReminder As Global.System.Web.UI.WebControls.Panel - - ''' - '''lblSendReminder control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblSendReminder As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkReminder control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkReminder As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''tblReminderDetail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents tblReminderDetail As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblTimeBefore control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblTimeBefore As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtReminderTime control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtReminderTime As Global.System.Web.UI.WebControls.TextBox - - ''' - '''ddlReminderTimeMeasurement control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlReminderTimeMeasurement As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''valReminderTime2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valReminderTime2 As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''valReminderTime control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valReminderTime As Global.System.Web.UI.WebControls.RangeValidator - - ''' - '''lblEmailFrom control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEmailFrom As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtReminderFrom control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtReminderFrom As Global.System.Web.UI.WebControls.TextBox - - ''' - '''valEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valEmail As Global.System.Web.UI.WebControls.RegularExpressionValidator - - ''' - '''lblNotifyEmailSubject control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblNotifyEmailSubject As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtSubject control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtSubject As Global.System.Web.UI.WebControls.TextBox - - ''' - '''lblNotifyEmailMessage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblNotifyEmailMessage As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtReminder control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtReminder As Global.System.Web.UI.WebControls.TextBox - - ''' - '''pnlImage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlImage As Global.System.Web.UI.WebControls.Panel - - ''' - '''lblDisplayImage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblDisplayImage As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkDisplayImage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkDisplayImage As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''tblImageURL control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents tblImageURL As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblImageURL control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblImageURL As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ctlURL control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ctlURL As Global.DotNetNuke.UI.UserControls.UrlControl - - ''' - '''lblWidth control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblWidth As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtWidth control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtWidth As Global.System.Web.UI.WebControls.TextBox - - ''' - '''valWidth control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valWidth As Global.System.Web.UI.WebControls.RegularExpressionValidator - - ''' - '''lblHeight control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblHeight As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtHeight control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtHeight As Global.System.Web.UI.WebControls.TextBox - - ''' - '''valHeight control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valHeight As Global.System.Web.UI.WebControls.RegularExpressionValidator - - ''' - '''pnlRecurring control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlRecurring As Global.System.Web.UI.WebControls.Panel - - ''' - '''lblRecEvent control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblRecEvent As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkReccuring control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkReccuring As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''rblRepeatTypeN control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblRepeatTypeN As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''tblRecurringDetails control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents tblRecurringDetails As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblEndDate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEndDate As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''lblMaxRecurrences control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblMaxRecurrences As Global.System.Web.UI.WebControls.Label - - ''' - '''dpRecurEndDate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents dpRecurEndDate As Global.DotNetNuke.Web.UI.WebControls.DnnDatePicker - - ''' - '''valRequiredRecurEndDate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valRequiredRecurEndDate As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''valValidRecurEndDate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valValidRecurEndDate As Global.System.Web.UI.WebControls.CustomValidator - - ''' - '''valValidRecurEndDate2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valValidRecurEndDate2 As Global.System.Web.UI.WebControls.CustomValidator - - ''' - '''lblPeriodicEvent control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblPeriodicEvent As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''rblRepeatTypeP1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblRepeatTypeP1 As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''tblDetailP1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents tblDetailP1 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblEvery control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEvery As Global.System.Web.UI.WebControls.Label - - ''' - '''txtP1Every control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtP1Every As Global.System.Web.UI.WebControls.TextBox - - ''' - '''cmbP1Period control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmbP1Period As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''valP1Every control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valP1Every As Global.System.Web.UI.WebControls.RangeValidator - - ''' - '''valP1Every2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valP1Every2 As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''lblWeeklyEvent control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblWeeklyEvent As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''rblRepeatTypeW1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblRepeatTypeW1 As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''tblDetailW1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents tblDetailW1 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblRepetitionWeek control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblRepetitionWeek As Global.System.Web.UI.WebControls.Label - - ''' - '''txtW1Every control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtW1Every As Global.System.Web.UI.WebControls.TextBox - - ''' - '''valW1Day control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valW1Day As Global.System.Web.UI.WebControls.RangeValidator - - ''' - '''valW1Day2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valW1Day2 As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''lblWeekDays control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblWeekDays As Global.System.Web.UI.WebControls.Label - - ''' - '''chkW1Sun control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkW1Sun As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''chkW1Mon control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkW1Mon As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''chkW1Tue control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkW1Tue As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''chkW1Wed control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkW1Wed As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''chkW1Thu control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkW1Thu As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''chkW1Fri control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkW1Fri As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''chkW1Sat control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkW1Sat As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''chkW1Sun2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkW1Sun2 As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''valW1Day3 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valW1Day3 As Global.System.Web.UI.WebControls.CustomValidator - - ''' - '''lblMonthlyEvent control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblMonthlyEvent As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''rblRepeatTypeM control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblRepeatTypeM As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''tblDetailM1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents tblDetailM1 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''rblRepeatTypeM1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblRepeatTypeM1 As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''lblRepeatedOn1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblRepeatedOn1 As Global.System.Web.UI.WebControls.Label - - ''' - '''cmbM1Every control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmbM1Every As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''cmbM1Period control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmbM1Period As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''rblRepeatTypeM2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblRepeatTypeM2 As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''lblRepeatedOn2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblRepeatedOn2 As Global.System.Web.UI.WebControls.Label - - ''' - '''cmbM2Period control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmbM2Period As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''lblRepetitionMonth control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblRepetitionMonth As Global.System.Web.UI.WebControls.Label - - ''' - '''txtMEvery control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtMEvery As Global.System.Web.UI.WebControls.TextBox - - ''' - '''valM2Every control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valM2Every As Global.System.Web.UI.WebControls.RangeValidator - - ''' - '''valM2Every2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valM2Every2 As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''lblYearlyEvent control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblYearlyEvent As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''rblRepeatTypeY1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblRepeatTypeY1 As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''tblDetailY1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents tblDetailY1 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblRepeatOnDate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblRepeatOnDate As Global.System.Web.UI.WebControls.Label - - ''' - '''dpY1Period control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents dpY1Period As Global.DotNetNuke.Web.UI.WebControls.DnnDatePicker - - ''' - '''valRequiredYearEventDate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valRequiredYearEventDate As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''valValidYearEventDate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valValidYearEventDate As Global.System.Web.UI.WebControls.CompareValidator - - ''' - '''pnlEnroll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlEnroll As Global.System.Web.UI.WebControls.Panel - - ''' - '''lblAllowErollment control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblAllowErollment As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkSignups control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkSignups As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''tblEnrollmentDetails control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents tblEnrollmentDetails As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''trAllowAnonEnroll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents trAllowAnonEnroll As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''plAllowAnonEnroll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plAllowAnonEnroll As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkAllowAnonEnroll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkAllowAnonEnroll As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''trTypeOfEnrollment control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents trTypeOfEnrollment As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblTypeOfEnrollment control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblTypeOfEnrollment As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''rblFree control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblFree As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''lblFree control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblFree As Global.System.Web.UI.WebControls.Label - - ''' - '''lblModerated control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblModerated As Global.System.Web.UI.WebControls.Label - - ''' - '''rblPaid control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblPaid As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''lblPaidFee control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblPaidFee As Global.System.Web.UI.WebControls.Label - - ''' - '''txtEnrollFee control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtEnrollFee As Global.System.Web.UI.WebControls.TextBox - - ''' - '''lblTotalCurrency control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblTotalCurrency As Global.System.Web.UI.WebControls.Label - - ''' - '''valBadFee control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valBadFee As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''trPayPalAccount control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents trPayPalAccount As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblPayPalAccount control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblPayPalAccount As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtPayPalAccount control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtPayPalAccount As Global.System.Web.UI.WebControls.TextBox - - ''' - '''valPayPalAccount control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valPayPalAccount As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''lblMaxEnrollment control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblMaxEnrollment As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtMaxEnrollment control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtMaxEnrollment As Global.System.Web.UI.WebControls.TextBox - - ''' - '''lblCurrentEnrolled control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblCurrentEnrolled As Global.System.Web.UI.WebControls.Label - - ''' - '''txtEnrolled control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtEnrolled As Global.System.Web.UI.WebControls.TextBox - - ''' - '''valMaxEnrollment2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valMaxEnrollment2 As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''valMaxEnrollment control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valMaxEnrollment As Global.System.Web.UI.WebControls.RangeValidator - - ''' - '''lblEnrollListView control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnrollListView As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkEnrollListView control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEnrollListView As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblEnrollmentRole control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnrollmentRole As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ddEnrollRoles control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddEnrollRoles As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''lblEnrollRoleNote control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnrollRoleNote As Global.System.Web.UI.WebControls.Label - - ''' - '''divAddUser control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divAddUser As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblRegUsers control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblRegUsers As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''grdAddUser control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents grdAddUser As Global.DotNetNuke.Modules.Events.EventUserGrid - - ''' - '''divNoEnrolees control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divNoEnrolees As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblNoEnrolee control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblNoEnrolee As Global.System.Web.UI.WebControls.Label - - ''' - '''txtNoEnrolees control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtNoEnrolees As Global.System.Web.UI.WebControls.TextBox - - ''' - '''lblMaxNoEnrolees control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblMaxNoEnrolees As Global.System.Web.UI.WebControls.Label - - ''' - '''valNoEnrolees control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valNoEnrolees As Global.System.Web.UI.WebControls.RangeValidator - - ''' - '''lblEnrolledUsers control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnrolledUsers As Global.System.Web.UI.WebControls.Label - - ''' - '''grdEnrollment control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents grdEnrollment As Global.System.Web.UI.WebControls.DataGrid - - ''' - '''lnkSelectedEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lnkSelectedEmail As Global.DotNetNuke.UI.WebControls.CommandButton - - ''' - '''lnkSelectedDelete control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lnkSelectedDelete As Global.DotNetNuke.UI.WebControls.CommandButton - - ''' - '''pnlEventEmailRole control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlEventEmailRole As Global.System.Web.UI.WebControls.Panel - - ''' - '''lblEventEmailChk control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEventEmailChk As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkEventEmailChk control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEventEmailChk As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''tblEventEmailRoleDetail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents tblEventEmailRoleDetail As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblEventEmailRole control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEventEmailRole As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ddEventEmailRoles control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddEventEmailRoles As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''tblEventEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents tblEventEmail As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblEventEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEventEmail As Global.System.Web.UI.WebControls.Label - - ''' - '''lblEventEmailFrom control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEventEmailFrom As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtEventEmailFrom control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtEventEmailFrom As Global.System.Web.UI.WebControls.TextBox - - ''' - '''RegularExpressionValidator1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents RegularExpressionValidator1 As Global.System.Web.UI.WebControls.RegularExpressionValidator - - ''' - '''lblEventEmailSubject control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEventEmailSubject As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtEventEmailSubject control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtEventEmailSubject As Global.System.Web.UI.WebControls.TextBox - - ''' - '''lblEventEmailBody control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEventEmailBody As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtEventEmailBody control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtEventEmailBody As Global.System.Web.UI.WebControls.TextBox - - ''' - '''updateButton control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents updateButton As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''cancelButton control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cancelButton As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''deleteButton control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents deleteButton As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''copyButton control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents copyButton As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''pnlAudit control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlAudit As Global.System.Web.UI.WebControls.Panel - - ''' - '''lblCreatedBy control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblCreatedBy As Global.System.Web.UI.WebControls.Label - - ''' - '''CreatedBy control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents CreatedBy As Global.System.Web.UI.WebControls.Label - - ''' - '''lblOn control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblOn As Global.System.Web.UI.WebControls.Label - - ''' - '''CreatedDate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents CreatedDate As Global.System.Web.UI.WebControls.Label - End Class -End Namespace diff --git a/EditEvents.ascx.vb b/EditEvents.ascx.vb deleted file mode 100644 index 440479c..0000000 --- a/EditEvents.ascx.vb +++ /dev/null @@ -1,2148 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - -Imports DotNetNuke.Security.Permissions -Imports DotNetNuke.Security.Roles -Imports System.Globalization -Imports System.Collections -Imports DotNetNuke.Security -Imports DotNetNuke.Web.UI.WebControls.Extensions - -Namespace DotNetNuke.Modules.Events - - _ - Partial Class EditEvents - Inherits EventBase - -#Region "Private Area" - Private _itemID As Integer = -1 - Private _editRecur As Boolean = True - Private ReadOnly _objCtlEvent As New EventController - Private ReadOnly _objCtlEventRecurMaster As New EventRecurMasterController - Private _objEvent As New EventInfo - Private _objEventSignups As New EventSignupsInfo - Private ReadOnly _objCtlEventSignups As New EventSignupsController - Private _lstEvents As New ArrayList - Private ReadOnly _lstOwnerUsers As New ArrayList - Private ReadOnly _culture As CultureInfo = Threading.Thread.CurrentThread.CurrentCulture - Private Const RecurTableDisplayType As String = "inline-block" - -#End Region - -#Region "Event Handlers" - Private Sub Page_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load - Try - ' Verify that the current user has edit access to this module - If PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) Or _ - IsModuleEditor() Then - Else - ' to stop errors when not authorised to edit - valReminderTime.MinimumValue = "15" - valReminderTime.MaximumValue = "60" - - Response.Redirect(GetSocialNavigateUrl(), True) - End If - - grdAddUser.ModuleConfiguration = ModuleConfiguration.Clone - - ' Add the external Validation.js to the Page - Const csname As String = "ExtValidationScriptFile" - Dim cstype As Type = System.Reflection.MethodBase.GetCurrentMethod().GetType() - Dim cstext As String = "" - If Not Page.ClientScript.IsClientScriptBlockRegistered(csname) Then - Page.ClientScript.RegisterClientScriptBlock(cstype, csname, cstext, False) - End If - - ' Determine ItemId of Event to Update - If Not (Request.Params("ItemId") Is Nothing) Then - _itemID = Int32.Parse(Request.Params("ItemId")) - End If - _editRecur = False - If Not (Request.Params("EditRecur") Is Nothing) Then - If Request.Params("EditRecur").ToLower = "all" Then - _editRecur = True - End If - End If - - ' Set the selected theme - SetTheme(pnlEventsModuleEdit) - - 'EPT: "Changed DotNetNuke.Security.PortalSecurity.HasEditPermissions(ModuleId)" into "IsEditable" - 'RWJS: Replaced with custom function IsModuleEditor which checks whether users has editor permissions - If (IsModuleEditor()) Or _ - (IsModerator()) Or _ - (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString)) Then - Else - Response.Redirect(GetSocialNavigateUrl(), True) - End If - - trOwner.Visible = False - If (IsModerator() And Settings.Ownerchangeallowed) Or _ - PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) Then - trOwner.Visible = True - End If - - pnlEnroll.Visible = False - divNoEnrolees.Visible = False - - If Settings.Eventsignup Then - pnlEnroll.Visible = True - chkSignups.Visible = True - If Settings.Maxnoenrolees > 1 And divAddUser.Visible Then - divNoEnrolees.Visible = True - End If - End If - - trTypeOfEnrollment.Visible = Settings.Eventsignupallowpaid - trPayPalAccount.Visible = Settings.Eventsignupallowpaid - - tblEventEmail.Attributes.Add("style", "display:none; width:100%") - If Not Settings.Newpereventemail Then - pnlEventEmailRole.Visible = False - ElseIf _itemID = -1 And Settings.Moderateall And Not IsModerator() Then - pnlEventEmailRole.Visible = False - End If - - pnlReminder.Visible = Settings.Eventnotify - pnlImage.Visible = Settings.Eventimage - pnlDetailPage.Visible = Settings.DetailPageAllowed - - ' Setup Popup Event - dpStartDate.ClientEvents.OnDateSelected = "function() {if (Page_ClientValidate('startdate')) CopyField('" + dpStartDate.ClientID + "','" + dpEndDate.ClientID + "');}" - tpStartTime.ClientEvents.OnDateSelected = "function() {SetComboIndex('" + tpStartTime.ClientID + "','" + tpEndTime.ClientID + "','" + dpStartDate.ClientID + "','" + dpEndDate.ClientID + "','" + Settings.Timeinterval + "');}" - ctlURL.FileFilter = glbImageFileTypes - If Not Page.IsPostBack Then - txtSubject.MaxLength = txtSubject.MaxLength + 1 - txtReminder.MaxLength = txtReminder.MaxLength + 1 - End If - Dim limitSubject As String = "javascript:limitText(this," + (txtSubject.MaxLength - 1).ToString + ",'" + Localization.GetString("LimitChars", LocalResourceFile) + "');" - Dim limitReminder As String = "javascript:limitText(this," + (txtReminder.MaxLength - 1).ToString + ",'" + Localization.GetString("LimitChars", LocalResourceFile) + "');" - txtSubject.Attributes.Add("onkeydown", limitSubject) - txtSubject.Attributes.Add("onkeyup", limitSubject) - txtReminder.Attributes.Add("onkeydown", limitReminder) - txtReminder.Attributes.Add("onkeyup", limitReminder) - - Page.ClientScript.RegisterExpandoAttribute(valValidStartTime2.ClientID, "TimeInterval", Settings.Timeinterval) - Page.ClientScript.RegisterExpandoAttribute(valValidStartTime2.ClientID, "ErrorMessage", String.Format(Localization.GetString("valValidStartTime2", LocalResourceFile), Settings.Timeinterval)) - Page.ClientScript.RegisterExpandoAttribute(valValidStartTime2.ClientID, "ClientID", tpStartTime.ClientID) - Page.ClientScript.RegisterExpandoAttribute(valValidEndTime2.ClientID, "TimeInterval", Settings.Timeinterval) - Page.ClientScript.RegisterExpandoAttribute(valValidEndTime2.ClientID, "ErrorMessage", String.Format(Localization.GetString("valValidEndTime2", LocalResourceFile), Settings.Timeinterval)) - Page.ClientScript.RegisterExpandoAttribute(valValidEndTime2.ClientID, "ClientID", tpEndTime.ClientID) - - ' If the page is being requested the first time, determine if an - ' contact itemId value is specified, and if so populate page - ' contents with the contact details - If Not Page.IsPostBack Then - LocalizeAll() - LoadEvent() - Else - Dim url As String = ctlURL.Url - Dim urlType As String = ctlURL.UrlType - ctlURL.Url = url - ctlURL.UrlType = urlType - End If - - If chkReminder.Checked Then - tblReminderDetail.Attributes.Add("style", "display:block;") - Else - tblReminderDetail.Attributes.Add("style", "display:none;") - End If - - If chkDetailPage.Checked Then - tblDetailPageDetail.Attributes.Add("style", "display:block;") - Else - tblDetailPageDetail.Attributes.Add("style", "display:none;") - End If - - If chkDisplayImage.Checked Then - tblImageURL.Attributes.Add("style", "display:block;") - Else - tblImageURL.Attributes.Add("style", "display:none;") - End If - - If chkSignups.Checked Then - tblEnrollmentDetails.Attributes.Add("style", "display:block;") - Else - tblEnrollmentDetails.Attributes.Add("style", "display:none;") - End If - - If chkReccuring.Checked Then - tblRecurringDetails.Attributes.Add("style", "display:block;") - Else - tblRecurringDetails.Attributes.Add("style", "display:none;") - End If - - If chkEventEmailChk.Checked Then - tblEventEmailRoleDetail.Attributes.Add("style", "display:block;") - Else - tblEventEmailRoleDetail.Attributes.Add("style", "display:none;") - End If - - If rblRepeatTypeP1.Checked Then - tblDetailP1.Attributes.Add("style", "display:" & RecurTableDisplayType & ";white-space:nowrap;") - Else - tblDetailP1.Attributes.Add("style", "display:none;white-space:nowrap;") - End If - - If rblRepeatTypeW1.Checked Then - tblDetailW1.Attributes.Add("style", "display:" & RecurTableDisplayType & ";") - Else - tblDetailW1.Attributes.Add("style", "display:none;") - End If - - If rblRepeatTypeM.Checked Then - tblDetailM1.Attributes.Add("style", "display:" & RecurTableDisplayType & ";") - Else - tblDetailM1.Attributes.Add("style", "display:none;") - End If - - If rblRepeatTypeY1.Checked Then - tblDetailY1.Attributes.Add("style", "display:" & RecurTableDisplayType & ";") - Else - tblDetailY1.Attributes.Add("style", "display:none;") - End If - - If dpY1Period.SelectedDate.ToString.Length = 0 Then - dpY1Period.SelectedDate = SelectedDate.Date - End If - If txtReminderFrom.Text.Length = 0 Then - txtReminderFrom.Text = Settings.Reminderfrom - End If - If txtEventEmailFrom.Text.Length = 0 Then - txtEventEmailFrom.Text = Settings.Reminderfrom - End If - - If chkAllDayEvent.Checked Then - divStartTime.Attributes.Add("style", "display:none;") - divEndTime.Attributes.Add("style", "display:none;") - End If - - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - - End Sub - - Private Sub valValidStartDate3_ServerValidate(source As Object, args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles valValidStartDate.ServerValidate - If dpStartDate.SelectedDate Is Nothing Then - args.IsValid = False - valValidStartDate.Visible = True - End If - End Sub - - Private Sub valValidStartTime2_ServerValidate(source As Object, args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles valValidStartTime2.ServerValidate - Dim inDate As DateTime = CType(tpStartTime.SelectedDate, DateTime) - valValidStartTime2.ErrorMessage = String.Format(Localization.GetString("valValidStartTime2", LocalResourceFile), Settings.Timeinterval) - args.IsValid = ValidateTime(inDate) - End Sub - - Private Sub valValidEndTime2_ServerValidate(source As Object, args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles valValidEndTime2.ServerValidate - Dim inDate As DateTime = CType(tpEndTime.SelectedDate, DateTime) - valValidEndTime2.ErrorMessage = String.Format(Localization.GetString("valValidEndTime2", LocalResourceFile), Settings.Timeinterval) - args.IsValid = ValidateTime(inDate) - End Sub - - Private Sub valValidRecurEndDate_ServerValidate(source As Object, args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles valValidRecurEndDate.ServerValidate - If dpStartDate.SelectedDate Is Nothing Then - Return - End If - Dim recurDate As DateTime = CType(dpRecurEndDate.SelectedDate, DateTime) - Dim startDate As DateTime = CType(dpStartDate.SelectedDate, DateTime) - If recurDate < startDate And Not rblRepeatTypeN.Checked Then - args.IsValid = False - valValidRecurEndDate.Visible = True - Else - args.IsValid = True - valValidRecurEndDate.Visible = False - End If - - End Sub - -#End Region - -#Region "Helper Methods and Functions" - - Private Sub LocalizeAll() - Dim culture As CultureInfo = Threading.Thread.CurrentThread.CurrentCulture - - txtSubject.Text = Settings.Templates.txtSubject - txtReminder.Text = Settings.Templates.txtMessage - - grdEnrollment.Columns(0).HeaderText = Localization.GetString("Select", LocalResourceFile) - grdEnrollment.Columns(1).HeaderText = Localization.GetString("EnrollUserName", LocalResourceFile) - grdEnrollment.Columns(2).HeaderText = Localization.GetString("EnrollDisplayName", LocalResourceFile) - grdEnrollment.Columns(3).HeaderText = Localization.GetString("EnrollEmail", LocalResourceFile) - grdEnrollment.Columns(4).HeaderText = Localization.GetString("EnrollPhone", LocalResourceFile) - grdEnrollment.Columns(5).HeaderText = Localization.GetString("EnrollApproved", LocalResourceFile) - grdEnrollment.Columns(6).HeaderText = Localization.GetString("EnrollNo", LocalResourceFile) - grdEnrollment.Columns(7).HeaderText = Localization.GetString("EventStart", LocalResourceFile) - - chkW1Sun.Text = culture.DateTimeFormat.AbbreviatedDayNames(DayOfWeek.Sunday) - chkW1Sun2.Text = culture.DateTimeFormat.AbbreviatedDayNames(DayOfWeek.Sunday) - chkW1Mon.Text = culture.DateTimeFormat.AbbreviatedDayNames(DayOfWeek.Monday) - chkW1Tue.Text = culture.DateTimeFormat.AbbreviatedDayNames(DayOfWeek.Tuesday) - chkW1Wed.Text = culture.DateTimeFormat.AbbreviatedDayNames(DayOfWeek.Wednesday) - chkW1Thu.Text = culture.DateTimeFormat.AbbreviatedDayNames(DayOfWeek.Thursday) - chkW1Fri.Text = culture.DateTimeFormat.AbbreviatedDayNames(DayOfWeek.Friday) - chkW1Sat.Text = culture.DateTimeFormat.AbbreviatedDayNames(DayOfWeek.Saturday) - - cmbM1Period.Items.Clear() - ' Corrected a problem w/Every nth Week on a specific day with the following - cmbM1Period.Items.Add(New ListItem(culture.DateTimeFormat.GetDayName(DayOfWeek.Sunday), "0")) - cmbM1Period.Items.Add(New ListItem(culture.DateTimeFormat.GetDayName(DayOfWeek.Monday), "1")) - cmbM1Period.Items.Add(New ListItem(culture.DateTimeFormat.GetDayName(DayOfWeek.Tuesday), "2")) - cmbM1Period.Items.Add(New ListItem(culture.DateTimeFormat.GetDayName(DayOfWeek.Wednesday), "3")) - cmbM1Period.Items.Add(New ListItem(culture.DateTimeFormat.GetDayName(DayOfWeek.Thursday), "4")) - cmbM1Period.Items.Add(New ListItem(culture.DateTimeFormat.GetDayName(DayOfWeek.Friday), "5")) - cmbM1Period.Items.Add(New ListItem(culture.DateTimeFormat.GetDayName(DayOfWeek.Saturday), "6")) - - cmbM2Period.Items.Clear() - For i As Integer = 1 To 31 - cmbM2Period.Items.Add(New ListItem(Localization.GetString(i.ToString(), LocalResourceFile), i.ToString())) - Next - - lblMaxRecurrences.Text = String.Format(Localization.GetString("lblMaxRecurrences", LocalResourceFile), Settings.Maxrecurrences) - - If culture.DateTimeFormat.FirstDayOfWeek = DayOfWeek.Sunday Then - chkW1Sun.Attributes.Add("style", "display:inline;") - chkW1Sun2.Attributes.Add("style", "display:none;") - Else - chkW1Sun2.Attributes.Add("style", "display:inline;") - chkW1Sun.Attributes.Add("style", "display:none;") - End If - - dpStartDate.DatePopupButton.ToolTip = Localization.GetString("DatePickerTooltip", LocalResourceFile) - dpEndDate.DatePopupButton.ToolTip = Localization.GetString("DatePickerTooltip", LocalResourceFile) - dpRecurEndDate.DatePopupButton.ToolTip = Localization.GetString("DatePickerTooltip", LocalResourceFile) - dpY1Period.DatePopupButton.ToolTip = Localization.GetString("DatePickerTooltip", LocalResourceFile) - - tpEndTime.TimePopupButton.ToolTip = Localization.GetString("TimePickerTooltip", LocalResourceFile) - - End Sub - - Public Sub LoadEvent() - StorePrevPageInViewState() - - pnlRecurring.Visible = True - lblMaxRecurrences.Visible = False - If Not Settings.Allowreoccurring Then - dpRecurEndDate.Enabled = False - cmbP1Period.Enabled = False - txtP1Every.Enabled = False - dpRecurEndDate.Visible = False - cmbP1Period.Visible = False - txtP1Every.Visible = False - pnlRecurring.Visible = False - Else - If Settings.Maxrecurrences <> "" Then - lblMaxRecurrences.Visible = True - End If - End If - - 'Populate the timezone combobox (look up timezone translations based on currently set culture) - cboTimeZone.DataBind(Settings.TimeZoneId) - If Not Settings.EnableEventTimeZones Then - cboTimeZone.Enabled = False - End If - - If _editRecur Then - deleteButton.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("ConfirmEventSeriesDelete", LocalResourceFile) + "');") - deleteButton.Text = Localization.GetString("deleteSeriesButton", LocalResourceFile) - updateButton.Text = Localization.GetString("updateSeriesButton", LocalResourceFile) - copyButton.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("ConfirmEventCopy", LocalResourceFile) + "');") - copyButton.Text = Localization.GetString("copySeriesButton", LocalResourceFile) - Else - deleteButton.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("ConfirmEventDelete", LocalResourceFile) + "');") - deleteButton.Text = Localization.GetString("deleteButton", LocalResourceFile) - updateButton.Text = Localization.GetString("updateButton", LocalResourceFile) - copyButton.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("ConfirmEventCopy", LocalResourceFile) + "');") - copyButton.Text = Localization.GetString("copyButton", LocalResourceFile) - End If - lnkSelectedEmail.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("ConfirmSendToAllSelected", LocalResourceFile) + "');") - lnkSelectedDelete.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("ConfirmDeleteSelected", LocalResourceFile) + "');") - - txtPayPalAccount.Text = Settings.Paypalaccount - - Dim iInterval As Integer = CInt(Settings.Timeinterval) - Dim currentDate As DateTime = ModuleNow() - Dim currentMinutes As Integer = currentDate.Minute - Dim remainder As Integer = currentMinutes Mod iInterval - If remainder > 0 Then - currentDate = currentDate.AddMinutes(iInterval - remainder) - End If - - tpStartTime.TimeView.Interval = New TimeSpan(0, iInterval, 0) - tpStartTime.SelectedDate = currentDate - tpEndTime.TimeView.Interval = New TimeSpan(0, iInterval, 0) - tpEndTime.SelectedDate = currentDate.AddMinutes(iInterval) - - - ' Can this event be moderated? - lblModerated.Visible = Settings.Moderateall - - ' Send Reminder Default - chkReminder.Checked = Settings.Sendreminderdefault - - ' Populate description - ftbDesktopText.Text = Settings.Templates.NewEventTemplate - - ' Set default validation value - valNoEnrolees.MaximumValue = "9999" - - ' Hide enrolment info by default - lblEnrolledUsers.Visible = False - grdEnrollment.Visible = False - lnkSelectedDelete.Visible = False - lnkSelectedEmail.Visible = False - - trAllowAnonEnroll.Visible = Settings.AllowAnonEnroll - - ' Populate enrollment email text boxes - txtEventEmailSubject.Text = Settings.Templates.txtEditViewEmailSubject - txtEventEmailBody.Text = Settings.Templates.txtEditViewEmailBody - - If _itemID <> -1 Then - ' Edit Item Mode - Dim objEvent As EventInfo - objEvent = _objCtlEvent.EventsGet(_itemID, ModuleId) - - Dim blEventSignup As Boolean - If Settings.Eventsignup Then - blEventSignup = objEvent.Signups - Else - blEventSignup = False - End If - If blEventSignup Then - pnlEnroll.Visible = True - chkSignups.Visible = True - lnkSelectedDelete.Visible = True - lnkSelectedEmail.Visible = True - If _itemID <> 0 Then - tblEventEmail.Attributes.Add("style", "display:block; width:100%") - End If - End If - - ' Check user has edit permissions to this event - If IsEventEditor(objEvent, False) Then - Else - Response.Redirect(GetSocialNavigateUrl(), True) - End If - - ' Create an object to consolidate master/single data into - use master object for common data - Dim objEventData As EventRecurMasterInfo - objEventData = _objCtlEventRecurMaster.EventsRecurMasterGet(objEvent.RecurMasterID, objEvent.ModuleID) - - ' Hide recurrences section, disable timezone change if it is a recurring event - ' and we aren't editing the series - If objEventData.RRULE <> "" And Not _editRecur Then - pnlRecurring.Visible = False - cboTimeZone.Enabled = False - End If - - ' If we are editing single item, populate with single event data - If Not _editRecur Then - With objEventData - .Dtstart = objEvent.EventTimeBegin - .Duration = CType(objEvent.Duration, String) + "M" - .Until = objEvent.EventTimeBegin - .RRULE = "" - .EventName = objEvent.EventName - .EventDesc = objEvent.EventDesc - .Importance = CType(objEvent.Importance, EventRecurMasterInfo.Priority) - .Notify = objEvent.Notify - .Approved = objEvent.Approved - .Signups = objEvent.Signups - .AllowAnonEnroll = objEvent.AllowAnonEnroll - .JournalItem = objEvent.JournalItem - .MaxEnrollment = objEvent.MaxEnrollment - .EnrollRoleID = objEvent.EnrollRoleID - .EnrollFee = objEvent.EnrollFee - .EnrollType = objEvent.EnrollType - .Enrolled = objEvent.Enrolled - .PayPalAccount = objEvent.PayPalAccount - .DetailPage = objEvent.DetailPage - .DetailNewWin = objEvent.DetailNewWin - .DetailURL = objEvent.DetailURL - .ImageURL = objEvent.ImageURL - .ImageType = objEvent.ImageType - .ImageWidth = objEvent.ImageWidth - .ImageHeight = objEvent.ImageHeight - .ImageDisplay = objEvent.ImageDisplay - .Location = objEvent.Location - .Category = objEvent.Category - .Reminder = objEvent.Reminder - .SendReminder = objEvent.SendReminder - .ReminderTime = objEvent.ReminderTime - .ReminderTimeMeasurement = objEvent.ReminderTimeMeasurement - .ReminderFrom = objEvent.ReminderFrom - .CustomField1 = objEvent.CustomField1 - .CustomField2 = objEvent.CustomField2 - .EnrollListView = objEvent.EnrollListView - .DisplayEndDate = objEvent.DisplayEndDate - .AllDayEvent = objEvent.AllDayEvent - .OwnerID = objEvent.OwnerID - .SocialGroupID = objEvent.SocialGroupId - .SocialUserID = objEvent.SocialUserId - .Summary = objEvent.Summary - End With - End If - Dim intDuration As Integer - intDuration = CInt(Left(objEventData.Duration, Len(objEventData.Duration) - 1)) - txtTitle.Text = objEventData.EventName - ftbDesktopText.Text = objEventData.EventDesc - - ' Set Dropdown to Original TimeZone w/ModuleID Settings TimeZone - cboTimeZone.DataBind(objEvent.EventTimeZoneId) - - ' Set dates/times - dpStartDate.SelectedDate = objEventData.Dtstart.Date() - dpEndDate.SelectedDate = objEventData.Dtstart.AddMinutes(intDuration).Date - dpRecurEndDate.SelectedDate = objEventData.Until - - ' Adjust Time not in DropDown Selection... - Dim starttime As DateTime = objEventData.Dtstart - If starttime.Minute Mod iInterval > 0 Then - starttime = objEventData.Dtstart.Date.AddMinutes((objEventData.Dtstart.Hour * 60) + (starttime.Minute) - (starttime.Minute Mod iInterval)) - End If - tpStartTime.SelectedDate = starttime - - Dim endtime As DateTime = objEventData.Dtstart.AddMinutes(intDuration) - If endtime.Minute Mod iInterval > 0 Then - endtime = objEventData.Dtstart.AddMinutes(intDuration).Date.AddMinutes((objEventData.Dtstart.AddMinutes(intDuration).Hour * 60) + (endtime.Minute) - (endtime.Minute Mod iInterval)) - End If - tpEndTime.SelectedDate = endtime - - chkSignups.Checked = objEventData.Signups - chkAllowAnonEnroll.Checked = objEventData.AllowAnonEnroll - txtMaxEnrollment.Text = objEventData.MaxEnrollment.ToString - txtEnrolled.Text = objEventData.Enrolled.ToString - txtPayPalAccount.Text = objEventData.PayPalAccount.ToString - If objEventData.EnrollType = "PAID" Then - rblFree.Checked = False - rblPaid.Checked = True - ElseIf objEventData.EnrollType = "FREE" Then - rblFree.Checked = True - rblPaid.Checked = False - End If - - txtEnrollFee.Text = String.Format("{0:F2}", objEventData.EnrollFee) - lblTotalCurrency.Text = PortalSettings.Currency - - If blEventSignup Then - ' Load Enrolled User Grid - BuildEnrolleeGrid(objEvent) - End If - - If IsNumeric(objEventData.EnrollRoleID) Then - LoadEnrollRoles(CInt(objEventData.EnrollRoleID)) - LoadNewEventEmailRoles(CInt(objEventData.EnrollRoleID)) - Else - LoadEnrollRoles(-1) - LoadNewEventEmailRoles(-1) - End If - - LoadCategory(objEventData.Category) - LoadLocation(objEventData.Location) - LoadOwnerUsers(objEventData.OwnerID) - - cmbImportance.SelectedIndex = CType(GetCmbStatus(objEventData.Importance, "cmbImportance"), Int16) - CreatedBy.Text = objEvent.CreatedBy - CreatedDate.Text = objEventData.CreatedDate.ToShortDateString - lblCreatedBy.Visible = True - CreatedBy.Visible = True - lblOn.Visible = True - CreatedDate.Visible = True - pnlAudit.Visible = True - - Dim objEventRRULE As EventRRULEInfo - objEventRRULE = _objCtlEventRecurMaster.DecomposeRRULE(objEventData.RRULE, objEventData.Dtstart) - Dim strRepeatType As String = _objCtlEventRecurMaster.RepeatType(objEventRRULE) - - Select Case strRepeatType - Case "N" - rblRepeatTypeN.Checked = True - cmbP1Period.SelectedIndex = 0 - 'txtP1Every.Text = "0" - Case "P1" - rblRepeatTypeP1.Checked = True - chkReccuring.Checked = True - cmbP1Period.SelectedIndex = CType(GetCmbStatus(Left(objEventRRULE.Freq, 1), "cmbP1Period"), Int16) - txtP1Every.Text = objEventRRULE.Interval.ToString() - Case "W1" - rblRepeatTypeW1.Checked = True - chkReccuring.Checked = True - If _culture.DateTimeFormat.FirstDayOfWeek = DayOfWeek.Sunday Then - chkW1Sun.Checked = objEventRRULE.Su - Else - chkW1Sun2.Checked = objEventRRULE.Su - End If - chkW1Mon.Checked = objEventRRULE.Mo - chkW1Tue.Checked = objEventRRULE.Tu - chkW1Wed.Checked = objEventRRULE.We - chkW1Thu.Checked = objEventRRULE.Th - chkW1Fri.Checked = objEventRRULE.Fr - chkW1Sat.Checked = objEventRRULE.Sa - txtW1Every.Text = objEventRRULE.Interval.ToString() - Case "M1" - rblRepeatTypeM1.Checked = True - rblRepeatTypeM.Checked = True - chkReccuring.Checked = True - txtMEvery.Text = objEventRRULE.Interval.ToString() - Dim intEvery, intPeriod As Integer - If objEventRRULE.Su Then - intPeriod = 0 - intEvery = objEventRRULE.SuNo - End If - If objEventRRULE.Mo Then - intPeriod = 1 - intEvery = objEventRRULE.MoNo() - End If - If objEventRRULE.Tu Then - intPeriod = 2 - intEvery = objEventRRULE.TuNo - End If - If objEventRRULE.We Then - intPeriod = 3 - intEvery = objEventRRULE.WeNo - End If - If objEventRRULE.Th Then - intPeriod = 4 - intEvery = objEventRRULE.ThNo - End If - If objEventRRULE.Fr Then - intPeriod = 5 - intEvery = objEventRRULE.FrNo - End If - If objEventRRULE.Sa Then - intPeriod = 6 - intEvery = objEventRRULE.SaNo - End If - cmbM1Period.SelectedIndex = intPeriod - If intEvery = -1 Then - cmbM1Every.SelectedIndex = 4 - Else - cmbM1Every.SelectedIndex = intEvery - 1 - End If - Case "M2" - rblRepeatTypeM2.Checked = True - rblRepeatTypeM.Checked = True - chkReccuring.Checked = True - cmbM2Period.SelectedIndex = objEventRRULE.ByMonthDay - 1 - txtMEvery.Text = objEventRRULE.Interval.ToString() - Case "Y1" - rblRepeatTypeY1.Checked = True - chkReccuring.Checked = True - Dim invCulture As CultureInfo = CultureInfo.InvariantCulture - Dim annualdate As Date = Date.ParseExact(Format(objEventData.Dtstart, "yyyy") & "/" & objEventRRULE.ByMonth.ToString & "/" & objEventRRULE.ByMonthDay.ToString, "yyyy/M/d", invCulture) - dpY1Period.SelectedDate = annualdate.Date - - End Select - - chkReminder.Checked = objEventData.SendReminder - txtReminder.Text = objEventData.Reminder - - If txtReminder.Text.Length = 0 Then - txtReminder.Text = Settings.Templates.txtMessage - End If - - txtSubject.Text = objEventData.Notify - If txtSubject.Text.Length = 0 Then - txtSubject.Text = Settings.Templates.txtSubject - End If - - txtReminderFrom.Text = objEventData.ReminderFrom - txtEventEmailFrom.Text = objEventData.ReminderFrom - If objEventData.ReminderTime < 0 Then - txtReminderTime.Text = 15.ToString() - Else - txtReminderTime.Text = objEventData.ReminderTime.ToString - End If - - If Not ddlReminderTimeMeasurement.Items.FindByValue(objEventData.ReminderTimeMeasurement.ToString) Is Nothing Then - ddlReminderTimeMeasurement.ClearSelection() - ddlReminderTimeMeasurement.Items.FindByValue(objEventData.ReminderTimeMeasurement.ToString).Selected = True - End If - - ' Set DetailURL - chkDetailPage.Checked = objEventData.DetailPage - URLDetail.Url = objEventData.DetailURL - - - ' Set Image Control - chkDisplayImage.Checked = objEventData.ImageDisplay - ctlURL.Url = objEventData.ImageURL - If objEventData.ImageURL.StartsWith("FileID=") Then - Dim fileId As Integer = Integer.Parse(objEventData.ImageURL.Substring(7)) - Dim objFileInfo As Services.FileSystem.IFileInfo = Services.FileSystem.FileManager.Instance.GetFile(fileId) - If Not objFileInfo Is Nothing Then - ctlURL.Url = objFileInfo.Folder & objFileInfo.FileName - Else - chkDisplayImage.Checked = False - End If - End If - - If objEventData.ImageWidth <> 0 And objEventData.ImageWidth <> -1 Then - txtWidth.Text = objEventData.ImageWidth.ToString() - End If - - If objEventData.ImageHeight <> 0 And objEventData.ImageHeight <> -1 Then - txtHeight.Text = objEventData.ImageHeight.ToString() - End If - txtCustomField1.Text = objEventData.CustomField1 - txtCustomField2.Text = objEventData.CustomField2 - chkEnrollListView.Checked = objEventData.EnrollListView - chkDisplayEndDate.Checked = objEventData.DisplayEndDate - chkAllDayEvent.Checked = objEventData.AllDayEvent - ftbSummary.Text = objEventData.Summary - - If blEventSignup Then - LoadRegUsers() - End If - - Else - dpStartDate.SelectedDate = SelectedDate.Date - dpEndDate.SelectedDate = SelectedDate.Date - txtEnrollFee.Text = String.Format("{0:F2}", 0.0) - lblTotalCurrency.Text = PortalSettings.Currency - dpRecurEndDate.SelectedDate = SelectedDate.AddDays(1) - dpY1Period.SelectedDate = SelectedDate.Date - chkEnrollListView.Checked = Settings.Eventdefaultenrollview - chkDisplayEndDate.Checked = True - chkAllDayEvent.Checked = False - - ' Do not default recurrance end date - ' Force user to key/select - LoadEnrollRoles(-1) - LoadNewEventEmailRoles(-1) - LoadCategory() - LoadLocation(-1) - LoadOwnerUsers(UserId) - pnlAudit.Visible = False - deleteButton.Visible = False - End If - - If _itemID = -1 Or _editRecur Then - divAddUser.Visible = False - divNoEnrolees.Visible = False - End If - - Dim errorminutes As String = Localization.GetString("invalidReminderMinutes", LocalResourceFile) - Dim errorhours As String = Localization.GetString("invalidReminderHours", LocalResourceFile) - Dim errordays As String = Localization.GetString("invalidReminderDays", LocalResourceFile) - ddlReminderTimeMeasurement.Attributes.Add("onchange", "valRemTime('" & valReminderTime.ClientID & "','" & valReminderTime2.ClientID & "','" & valReminderTime.ValidationGroup & "','" & ddlReminderTimeMeasurement.ClientID & "','" & errorminutes & "','" & errorhours & "','" & errordays & "');") - Select Case ddlReminderTimeMeasurement.SelectedValue - Case "m" - valReminderTime.ErrorMessage = errorminutes - valReminderTime.MinimumValue = "15" - valReminderTime.MaximumValue = "60" - Case "h" - valReminderTime.ErrorMessage = errorhours - valReminderTime.MinimumValue = "1" - valReminderTime.MaximumValue = "24" - Case "d" - valReminderTime.ErrorMessage = errordays - valReminderTime.MinimumValue = "1" - valReminderTime.MaximumValue = "30" - End Select - valReminderTime2.ErrorMessage = valReminderTime.ErrorMessage - - If txtPayPalAccount.Text.Length = 0 Then - txtPayPalAccount.Text = Settings.Paypalaccount - End If - - trCustomField1.Visible = Settings.EventsCustomField1 - trCustomField2.Visible = Settings.EventsCustomField2 - - trTimeZone.Visible = Settings.Tzdisplay - - chkDetailPage.Attributes.Add("onclick", "javascript:showTbl('" + chkDetailPage.ClientID + "','" + tblDetailPageDetail.ClientID + "');") - chkReminder.Attributes.Add("onclick", "javascript:showTbl('" + chkReminder.ClientID + "','" + tblReminderDetail.ClientID + "');") - chkDisplayImage.Attributes.Add("onclick", "javascript:showTbl('" + chkDisplayImage.ClientID + "','" + tblImageURL.ClientID + "');") - chkReccuring.Attributes.Add("onclick", "javascript:if (this.checked == true) dnn.dom.getById('" + rblRepeatTypeP1.ClientID + "').checked = true; else dnn.dom.getById('" + rblRepeatTypeN.ClientID + "').checked = true;showhideTbls('" + RecurTableDisplayType + "','" + chkReccuring.ClientID + "','" + tblRecurringDetails.ClientID + "','" + rblRepeatTypeP1.ClientID + "','" + tblDetailP1.ClientID + "','" + rblRepeatTypeW1.ClientID + "','" + tblDetailW1.ClientID + "','" + rblRepeatTypeM.ClientID + "','" + tblDetailM1.ClientID + "','" + rblRepeatTypeY1.ClientID + "','" + tblDetailY1.ClientID + "');") - If Settings.Eventsignup Then - chkEventEmailChk.Attributes.Add("onclick", "javascript:showhideChk2('" + chkEventEmailChk.ClientID + "','" + tblEventEmailRoleDetail.ClientID + "','" + chkSignups.ClientID + "','" + tblEventEmail.ClientID + "');") - Else - chkEventEmailChk.Attributes.Add("onclick", "javascript:showhideChk2('" + chkEventEmailChk.ClientID + "','" + tblEventEmailRoleDetail.ClientID + "','" + chkEventEmailChk.ClientID + "','" + tblEventEmail.ClientID + "');") - End If - rblRepeatTypeP1.Attributes.Add("onclick", "javascript:showhideTbls('" + RecurTableDisplayType + "','" + chkReccuring.ClientID + "','" + tblRecurringDetails.ClientID + "','" + rblRepeatTypeP1.ClientID + "','" + tblDetailP1.ClientID + "','" + rblRepeatTypeW1.ClientID + "','" + tblDetailW1.ClientID + "','" + rblRepeatTypeM.ClientID + "','" + tblDetailM1.ClientID + "','" + rblRepeatTypeY1.ClientID + "','" + tblDetailY1.ClientID + "');") - rblRepeatTypeW1.Attributes.Add("onclick", "javascript:showhideTbls('" + RecurTableDisplayType + "','" + chkReccuring.ClientID + "','" + tblRecurringDetails.ClientID + "','" + rblRepeatTypeP1.ClientID + "','" + tblDetailP1.ClientID + "','" + rblRepeatTypeW1.ClientID + "','" + tblDetailW1.ClientID + "','" + rblRepeatTypeM.ClientID + "','" + tblDetailM1.ClientID + "','" + rblRepeatTypeY1.ClientID + "','" + tblDetailY1.ClientID + "');") - rblRepeatTypeM.Attributes.Add("onclick", "javascript:showhideTbls('" + RecurTableDisplayType + "','" + chkReccuring.ClientID + "','" + tblRecurringDetails.ClientID + "','" + rblRepeatTypeP1.ClientID + "','" + tblDetailP1.ClientID + "','" + rblRepeatTypeW1.ClientID + "','" + tblDetailW1.ClientID + "','" + rblRepeatTypeM.ClientID + "','" + tblDetailM1.ClientID + "','" + rblRepeatTypeY1.ClientID + "','" + tblDetailY1.ClientID + "');if (this.checked == true) dnn.dom.getById('" + rblRepeatTypeM1.ClientID + "').checked = true;") - rblRepeatTypeY1.Attributes.Add("onclick", "javascript:showhideTbls('" + RecurTableDisplayType + "','" + chkReccuring.ClientID + "','" + tblRecurringDetails.ClientID + "','" + rblRepeatTypeP1.ClientID + "','" + tblDetailP1.ClientID + "','" + rblRepeatTypeW1.ClientID + "','" + tblDetailW1.ClientID + "','" + rblRepeatTypeM.ClientID + "','" + tblDetailM1.ClientID + "','" + rblRepeatTypeY1.ClientID + "','" + tblDetailY1.ClientID + "');") - btnCopyStartdate.Attributes.Add("onclick", String.Format("javascript:CopyStartDateToEnddate('{0}','{1}','{2}','{3}','{4}');", dpStartDate.ClientID, dpEndDate.ClientID, tpStartTime.ClientID, tpEndTime.ClientID, chkAllDayEvent.ClientID)) - chkAllDayEvent.Attributes.Add("onclick", "javascript:showTimes('" + chkAllDayEvent.ClientID + "','" + divStartTime.ClientID + "','" + divEndTime.ClientID + "');") - - End Sub - - Public Function GetCmbStatus(ByVal value As Object, ByVal cmbDropDown As String) As Long - Dim iIndex As Integer - Dim oDropDown As DropDownList - - oDropDown = CType(FindControl(cmbDropDown), DropDownList) - For iIndex = 0 To oDropDown.Items.Count - 1 - If oDropDown.Items(iIndex).Value = CType(value, String) Then - Return iIndex - End If - Next - End Function - - Public Sub LoadEnrollRoles(ByVal roleID As Integer) - Dim objRoles As New RoleController - ddEnrollRoles.DataSource = objRoles.GetPortalRoles(PortalId) - ddEnrollRoles.DataTextField = "RoleName" - ddEnrollRoles.DataValueField = "RoleID" - ddEnrollRoles.DataBind() - '"" - ddEnrollRoles.Items.Insert(0, New ListItem(Localization.GetString("None", LocalResourceFile), "-1")) - If roleID = 0 Then - ddEnrollRoles.Items.FindByValue("0").Selected() = True - ElseIf (roleID > 0) Then - If ddEnrollRoles.Items.FindByValue(CType(roleID, String)) Is Nothing Then - ddEnrollRoles.Items.Insert(0, New ListItem(Localization.GetString("EnrolleeRoleDeleted", LocalResourceFile), roleID.ToString)) - End If - ddEnrollRoles.Items.FindByValue(CType(roleID, String)).Selected = True - End If - End Sub - - Public Sub LoadNewEventEmailRoles(ByVal roleID As Integer) - Dim objRoles As New RoleController - ddEventEmailRoles.DataSource = objRoles.GetPortalRoles(PortalId) - ddEventEmailRoles.DataTextField = "RoleName" - ddEventEmailRoles.DataValueField = "RoleID" - ddEventEmailRoles.DataBind() - If roleID < 0 Or ddEventEmailRoles.Items.FindByValue(CType(roleID, String)) Is Nothing Then - Try - ddEventEmailRoles.Items.FindByValue(PortalSettings.RegisteredRoleId.ToString).Selected() = True - Catch - End Try - Else - ddEventEmailRoles.Items.FindByValue(CType(roleID, String)).Selected = True - End If - End Sub - - Public Sub LoadCategory(Optional ByVal category As Integer = Nothing) - Dim objCntCategories As New EventCategoryController - Dim tmpCategories As ArrayList = objCntCategories.EventsCategoryList(PortalId) - Dim objCategories As New ArrayList - If (Settings.Enablecategories = EventModuleSettings.DisplayCategories.DoNotDisplay And Settings.ModuleCategoriesSelected = EventModuleSettings.CategoriesSelected.Some) _ - Or Settings.Restrictcategories Then - For Each objCategory As EventCategoryInfo In tmpCategories - For Each moduleCategory As Integer In Settings.ModuleCategoryIDs - If moduleCategory = objCategory.Category Then - objCategories.Add(objCategory) - End If - Next - Next - Else - objCategories = tmpCategories - End If - cmbCategory.DataSource = objCategories - cmbCategory.DataTextField = "CategoryName" - cmbCategory.DataValueField = "Category" - cmbCategory.DataBind() - - ' Do we need to add None? - If (Not Settings.Enablecategories = EventModuleSettings.DisplayCategories.DoNotDisplay Or Settings.ModuleCategoriesSelected = EventModuleSettings.CategoriesSelected.All) _ - And Settings.Restrictcategories = False Then - cmbCategory.Items.Insert(0, New ListItem(Localization.GetString("None", LocalResourceFile), "-1")) - End If - - ' Select the appropriate row - If Settings.ModuleCategoriesSelected = EventModuleSettings.CategoriesSelected.All Then - cmbCategory.ClearSelection() - cmbCategory.Items(0).Selected = True - End If - - If (category > 0) And Not IsNothing(category) Then - cmbCategory.ClearSelection() - cmbCategory.Items.FindByValue(CType(category, String)).Selected = True - ElseIf Not Settings.Enablecategories = EventModuleSettings.DisplayCategories.DoNotDisplay And Settings.ModuleCategoriesSelected = EventModuleSettings.CategoriesSelected.Some Then - cmbCategory.ClearSelection() - cmbCategory.Items.FindByValue(CType(Settings.ModuleCategoryIDs.Item(0), String)).Selected = True - End If - - End Sub - - Public Sub LoadLocation(ByVal location As Integer) - Dim objCntLocation As New EventLocationController - cmbLocation.DataSource = objCntLocation.EventsLocationList(PortalId) - cmbLocation.DataTextField = "LocationName" - cmbLocation.DataValueField = "Location" - cmbLocation.DataBind() - '"" - cmbLocation.Items.Insert(0, New ListItem(Localization.GetString("None", LocalResourceFile), "-1")) - If (location > 0) And Not IsNothing(location) Then - cmbLocation.Items.FindByValue(CType(location, String)).Selected = True - End If - End Sub - - Private Sub LoadOwnerUsers(ByVal ownerID As Integer) - Dim objCollModulePermission As ModulePermissionCollection - objCollModulePermission = ModulePermissionController.GetModulePermissions(ModuleId, TabId) - Dim objModulePermission As ModulePermissionInfo - - ' To cope with host users or someone who is no longer an editor!! - Dim objEventModuleEditor As New EventUser - objEventModuleEditor.UserID = ownerID - LoadSingleUser(objEventModuleEditor, _lstOwnerUsers) - - If (IsModerator() And Settings.Ownerchangeallowed) Or _ - PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) Then - For Each objModulePermission In objCollModulePermission - If objModulePermission.PermissionKey = "EVENTSEDT" Then - If objModulePermission.UserID < 0 Then - Dim objCtlRole As New RoleController - Dim lstRoleUsers As ArrayList = objCtlRole.GetUsersByRoleName(PortalId, objModulePermission.RoleName) - For Each objUser As UserInfo In lstRoleUsers - objEventModuleEditor = New EventUser - objEventModuleEditor.UserID = objUser.UserID - objEventModuleEditor.DisplayName = objUser.DisplayName - LoadSingleUser(objEventModuleEditor, _lstOwnerUsers) - Next - Else - objEventModuleEditor = New EventUser - objEventModuleEditor.UserID = objModulePermission.UserID - objEventModuleEditor.DisplayName = objModulePermission.DisplayName - LoadSingleUser(objEventModuleEditor, _lstOwnerUsers) - End If - End If - Next - End If - _lstOwnerUsers.Sort(New UserListSort) - - cmbOwner.DataSource = _lstOwnerUsers - cmbOwner.DataTextField = "DisplayName" - cmbOwner.DataValueField = "UserID" - cmbOwner.DataBind() - cmbOwner.Items.FindByValue(CType(ownerID, String)).Selected = True - End Sub - - Private Sub LoadRegUsers() - grdAddUser.RefreshGrid() - End Sub - - Private Sub LoadSingleUser(ByVal objEventUser As EventUser, ByVal lstUsers As ArrayList) - Dim blAdd As Boolean = True - Dim objEventUser2 As EventUser - For Each objEventUser2 In lstUsers - If objEventUser.UserID = objEventUser2.UserID Then - blAdd = False - End If - Next - If blAdd Then - If objEventUser.DisplayName = Nothing Then - Dim objCtlUser As New UserController - Dim objUser As UserInfo = objCtlUser.GetUser(PortalId, objEventUser.UserID) - If Not objUser Is Nothing Then - objEventUser.DisplayName = objUser.DisplayName - Else - objEventUser.DisplayName = Localization.GetString("OwnerDeleted", LocalResourceFile) - End If - - End If - lstUsers.Add(objEventUser) - End If - End Sub - - Private Sub Email(ByVal selected As Boolean) - Dim item As DataGridItem - Dim objEnroll As EventSignupsInfo - Dim objEvent As EventInfo - ' Get Current Event, if <> 0 - If _itemID > 0 Then - objEvent = _objCtlEvent.EventsGet(_itemID, ModuleId) - Else - Exit Sub - End If - - Dim objEventEmailInfo As New EventEmailInfo - Dim objEventEmail As New EventEmails(PortalId, ModuleId, LocalResourceFile, CType(Page, PageBase).PageCulture.Name) - objEventEmailInfo.TxtEmailSubject = txtEventEmailSubject.Text - objEventEmailInfo.TxtEmailBody = txtEventEmailBody.Text - objEventEmailInfo.TxtEmailFrom() = txtEventEmailFrom.Text - For Each item In grdEnrollment.Items - If CType(item.FindControl("chkSelect"), CheckBox).Checked Or (selected = False) Then - objEnroll = _objCtlEventSignups.EventsSignupsGet(CType(grdEnrollment.DataKeys(item.ItemIndex), Integer), ModuleId, False) - objEventEmailInfo.UserIDs.Clear() - objEventEmailInfo.UserEmails.Clear() - objEventEmailInfo.UserLocales.Clear() - objEventEmailInfo.UserTimeZoneIds.Clear() - If objEnroll.UserID > -1 Then - objEventEmailInfo.UserIDs.Add(objEnroll.UserID) - Else - objEventEmailInfo.UserEmails.Add(objEnroll.AnonEmail) - objEventEmailInfo.UserLocales.Add(objEnroll.AnonCulture) - objEventEmailInfo.UserTimeZoneIds.Add(objEnroll.AnonTimeZoneId) - End If - objEventEmail.SendEmails(objEventEmailInfo, objEvent, objEnroll) - End If - Next - End Sub - - Private Sub UpdateProcessing(ByVal processItem As Integer) - If Not Page.IsValid Then - Return - End If - - Dim objSecurity As New PortalSecurity - Dim tStartTime As DateTime - Dim tEndTime As DateTime - Dim tRecurEndDate As DateTime - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - - ' Make EndDate = StartDate if no recurring dates - If rblRepeatTypeN.Checked Then - dpRecurEndDate.SelectedDate = ConvertDateStringstoDatetime(dpStartDate.SelectedDate.ToString, "00:00").Date - End If - - valRequiredRecurEndDate.Validate() - - ' Make sure date formatted correctly - If chkAllDayEvent.Checked Then - tStartTime = ConvertDateStringstoDatetime(dpStartDate.SelectedDate.ToString, "00:00") - tEndTime = ConvertDateStringstoDatetime(dpEndDate.SelectedDate.ToString, "00:00").AddMinutes(1439) - Else - tStartTime = ConvertDateStringstoDatetime(dpStartDate.SelectedDate.ToString, CDate(tpStartTime.SelectedDate).ToString("HH:mm", CultureInfo.InvariantCulture)) - tEndTime = ConvertDateStringstoDatetime(dpEndDate.SelectedDate.ToString, CDate(tpEndTime.SelectedDate).ToString("HH:mm", CultureInfo.InvariantCulture)) - End If - - If tEndTime < tStartTime And Not chkAllDayEvent.Checked Then - valValidEndTime.ErrorMessage = Localization.GetString("valValidEndTime", LocalResourceFile) - valValidEndTime.IsValid = False - valValidEndTime.Visible = True - Return - End If - - tRecurEndDate = CType(dpRecurEndDate.SelectedDate, Date) - - If rblRepeatTypeP1.Checked Then - valP1Every.Validate() - valP1Every2.Validate() - If valP1Every.IsValid = False Or valP1Every2.IsValid = False Then - Return - End If - End If - - If rblRepeatTypeW1.Checked Then - valW1Day.Validate() - valW1Day2.Validate() - If (chkW1Sun.Checked = False And _ - chkW1Sun2.Checked = False And _ - chkW1Mon.Checked = False And _ - chkW1Tue.Checked = False And _ - chkW1Wed.Checked = False And _ - chkW1Thu.Checked = False And _ - chkW1Fri.Checked = False And _ - chkW1Sat.Checked = False) Then - valW1Day3.ErrorMessage = Localization.GetString("valW1Day3", LocalResourceFile) - valW1Day3.Text = Localization.GetString("valW1Day3", LocalResourceFile) - valW1Day3.IsValid = False - valW1Day3.Visible = True - Return - End If - If valW1Day.IsValid = False Or valW1Day2.IsValid = False Then - Return - End If - End If - - If rblRepeatTypeM.Checked And rblRepeatTypeM2.Checked Then - valM2Every.Validate() - valM2Every2.Validate() - If valM2Every.IsValid = False Or valM2Every2.IsValid = False Then - Return - End If - - End If - ' If Annual Recurrence, Check date - If rblRepeatTypeY1.Checked Then - valRequiredYearEventDate.Validate() - valValidYearEventDate.Validate() - If valRequiredYearEventDate.IsValid = False Or valValidYearEventDate.IsValid = False Then - Return - End If - End If - - If Settings.Expireevents <> "" _ - And Not _editRecur Then - If tStartTime < Now.AddDays(-CType(Settings.Expireevents, Integer)) Then - valValidStartDate2.IsValid = False - valValidStartDate2.Visible = True - valValidStartDate2.Text = String.Format(Localization.GetString("valValidStartDate2", LocalResourceFile), CType(Settings.Expireevents, Integer)) - valValidStartDate2.ErrorMessage = String.Format(Localization.GetString("valValidStartDate2", LocalResourceFile), CType(Settings.Expireevents, Integer)) - Return - End If - End If - - Dim duration As Double - duration = tEndTime.Subtract(tStartTime).TotalMinutes - - If rblPaid.Checked Then - If IsNumeric(txtEnrollFee.Text) Then - ' ReSharper disable CompareOfFloatsByEqualityOperator - If CType(txtEnrollFee.Text, Double) = 0.0 Then - ' ReSharper restore CompareOfFloatsByEqualityOperator - valBadFee.IsValid = False - valBadFee.Visible = True - Return - End If - Else - valBadFee.IsValid = False - valBadFee.Visible = True - Return - End If - If Trim(txtPayPalAccount.Text) = "" Then - valPayPalAccount.IsValid = False - valPayPalAccount.Visible = True - Return - End If - End If - - 'Check valid Reminder Time - If chkReminder.Checked Then - Dim remtime As Integer = CType(txtReminderTime.Text, Integer) - Select Case ddlReminderTimeMeasurement.SelectedValue - Case "m" - If remtime < 15 Or remtime > 60 Then - valReminderTime2.IsValid = False - valReminderTime2.Visible = True - Return - End If - Case "h" - If remtime < 1 Or remtime > 24 Then - valReminderTime2.IsValid = False - valReminderTime2.Visible = True - Return - End If - Case "d" - If remtime < 1 Or remtime > 30 Then - valReminderTime2.IsValid = False - valReminderTime2.Visible = True - Return - End If - End Select - End If - - If chkSignups.Checked Then - valMaxEnrollment.Validate() - If Not valMaxEnrollment.IsValid Then - Return - End If - End If - - valW1Day.Visible = False - valW1Day2.Visible = False - valW1Day3.Visible = False - valConflict.Visible = False - valLocationConflict.Visible = False - valPayPalAccount.Visible = False - valBadFee.Visible = False - valValidRecurStartDate.Visible = False - valNoEnrolees.Visible = False - valMaxEnrollment.Visible = False - - ' Everythings Cool, Update Database - Dim objEvent As EventInfo - Dim objEventRecurMaster As New EventRecurMasterInfo - Dim objEventRMSave As New EventRecurMasterInfo - - ' Get Current Event, if <> 0 - If processItem > 0 Then - objEvent = _objCtlEvent.EventsGet(processItem, ModuleId) - objEventRecurMaster = _objCtlEventRecurMaster.EventsRecurMasterGet(objEvent.RecurMasterID, objEvent.ModuleID) - objEventRMSave = _objCtlEventRecurMaster.EventsRecurMasterGet(objEvent.RecurMasterID, objEvent.ModuleID) - If _editRecur Then - _lstEvents = _objCtlEvent.EventsGetRecurrences(objEventRecurMaster.RecurMasterID, objEventRecurMaster.ModuleID) - Else - _lstEvents.Add(objEvent) - End If - End If - Dim intDuration As Integer - With objEventRecurMaster - .Dtstart = tStartTime - .Duration = CType(duration, String) + "M" - intDuration = CInt(duration) - .Until = tRecurEndDate - .UpdatedByID = UserId - .OwnerID = CInt(cmbOwner.SelectedValue) - If processItem < 0 Then - .RecurMasterID = -1 - .CreatedByID = UserId - .ModuleID = ModuleId - .PortalID = PortalId - .CultureName = Threading.Thread.CurrentThread.CurrentCulture.Name - .JournalItem = False - End If - ' Filter text for non-admins and moderators - If (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) = True) Then - .EventName = txtTitle.Text - .EventDesc = ftbDesktopText.Text - .CustomField1 = txtCustomField1.Text - .CustomField2 = txtCustomField2.Text - .Notify = txtSubject.Text - .Reminder = txtReminder.Text - .Summary = ftbSummary.Text - ElseIf IsModerator() Then - .EventName = objSecurity.InputFilter(txtTitle.Text, PortalSecurity.FilterFlag.NoScripting) - .EventDesc = ftbDesktopText.Text - .CustomField1 = objSecurity.InputFilter(txtCustomField1.Text, PortalSecurity.FilterFlag.NoScripting) - .CustomField2 = objSecurity.InputFilter(txtCustomField2.Text, PortalSecurity.FilterFlag.NoScripting) - .Notify = objSecurity.InputFilter(txtSubject.Text, PortalSecurity.FilterFlag.NoScripting) - .Reminder = objSecurity.InputFilter(txtReminder.Text, PortalSecurity.FilterFlag.NoScripting) - .Summary = ftbSummary.Text - Else - .EventName = objSecurity.InputFilter(txtTitle.Text, PortalSecurity.FilterFlag.NoScripting) - .EventDesc = objSecurity.InputFilter(ftbDesktopText.Text, PortalSecurity.FilterFlag.NoScripting) - .CustomField1 = objSecurity.InputFilter(txtCustomField1.Text, PortalSecurity.FilterFlag.NoScripting) - .CustomField2 = objSecurity.InputFilter(txtCustomField2.Text, PortalSecurity.FilterFlag.NoScripting) - .Notify = objSecurity.InputFilter(txtSubject.Text, PortalSecurity.FilterFlag.NoScripting) - .Reminder = objSecurity.InputFilter(txtReminder.Text, PortalSecurity.FilterFlag.NoScripting) - .Summary = objSecurity.InputFilter(ftbSummary.Text, PortalSecurity.FilterFlag.NoScripting) - End If - - ' If New Event - If processItem < 0 Then - ' If Moderator turned on, set approve=false - If Settings.Moderateall Then - .Approved = False - Else - .Approved = True - End If - End If - - ' Reset Approved, if Moderate All option is on - If Settings.Moderateall And _ - .Approved = True Then - .Approved = False - End If - - ' If Admin or Moderator, automatically approve event - If PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) Or _ - IsModerator() Then - .Approved = True - End If - - .Importance = CType(cmbImportance.SelectedItem.Value, EventRecurMasterInfo.Priority) - - .Signups = chkSignups.Checked - .AllowAnonEnroll = chkAllowAnonEnroll.Checked - If rblFree.Checked Then - .EnrollType = "FREE" - ElseIf rblPaid.Checked Then - .EnrollType = "PAID" - End If - - .PayPalAccount = txtPayPalAccount.Text - .EnrollFee = CDec(txtEnrollFee.Text) - .MaxEnrollment = CType(txtMaxEnrollment.Text, Integer) - - If CInt(ddEnrollRoles.SelectedValue) <> -1 Then - .EnrollRoleID = CInt(ddEnrollRoles.SelectedItem.Value) - Else - .EnrollRoleID = -1 - End If - - ' Update Detail Page setting in the database - If chkDetailPage.Checked And URLDetail.Url <> "" Then - .DetailPage = True - .DetailURL = URLDetail.Url - .DetailNewWin = URLDetail.NewWindow - Else - .DetailPage = False - End If - - ' Update Image settings in the database - If chkDisplayImage.Checked Then - .ImageDisplay = True - If ctlURL.UrlType = "F" Then - If ctlURL.Url.StartsWith("FileID=") Then - Dim fileId As Integer = Integer.Parse(ctlURL.Url.Substring(7)) - Dim objFileInfo As Services.FileSystem.IFileInfo = Services.FileSystem.FileManager.Instance.GetFile(fileId) - If txtWidth.Text = "" Or txtWidth.Text = 0.ToString() Then - txtWidth.Text = objFileInfo.Width.ToString - End If - If txtHeight.Text = "" Or txtHeight.Text = 0.ToString() Then - txtHeight.Text = objFileInfo.Height.ToString - End If - End If - End If - .ImageURL = ctlURL.Url - .ImageType = ctlURL.UrlType - Else - .ImageDisplay = False - End If - - If txtWidth.Text = "" Then - .ImageWidth = 0 - Else - .ImageWidth = CInt(txtWidth.Text) - End If - If txtHeight.Text = "" Then - .ImageHeight = 0 - Else - .ImageHeight = CInt(txtHeight.Text) - End If - - .Category = CInt(cmbCategory.SelectedValue) - .Location = CInt(cmbLocation.SelectedValue) - - .SendReminder = chkReminder.Checked - .ReminderTime = CInt(txtReminderTime.Text) - .ReminderTimeMeasurement = ddlReminderTimeMeasurement.SelectedValue - .ReminderFrom = txtReminderFrom.Text - - .EnrollListView = chkEnrollListView.Checked - .DisplayEndDate = chkDisplayEndDate.Checked - .AllDayEvent = chkAllDayEvent.Checked - .EventTimeZoneId = cboTimeZone.SelectedValue - .SocialGroupID = GetUrlGroupId() - .SocialUserID = GetUrlUserId() - - - End With - - ' If it is possible we are edititng a recurring event create RRULE - If processItem = 0 Or _editRecur Or (Not _editRecur And objEventRMSave.RRULE = "") Then - objEventRecurMaster = CreateEventRRULE(objEventRecurMaster) - If rblRepeatTypeN.Checked Then - objEventRecurMaster.Until = objEventRecurMaster.Dtstart.Date - End If - End If - - ' If editing single occurence of recurring event & start date > last date, error - If processItem > 0 And objEventRMSave.RRULE <> "" And Not _editRecur Then - If tStartTime.Date > objEventRMSave.Until.Date Then - valValidRecurStartDate.IsValid = False - valValidRecurStartDate.Visible = True - Return - End If - If tStartTime.Date < objEventRMSave.Dtstart.Date Then - valValidRecurStartDate2.IsValid = False - valValidRecurStartDate2.Visible = True - Return - End If - End If - - ' If new Event or Recurring event then check for new instances - If processItem < 0 Or _ - (objEventRMSave.RRULE = "" And objEventRecurMaster.RRULE <> "" And Not _editRecur) Or _ - _editRecur Then - Dim lstEventsNew As ArrayList - lstEventsNew = _objCtlEventRecurMaster.CreateEventRecurrences(objEventRecurMaster, intDuration, Settings.Maxrecurrences) - _lstEvents = CompareOldNewEvents(_lstEvents, lstEventsNew) - - If lstEventsNew.Count = 0 Then - ' Last error!! - valValidRecurEndDate2.IsValid = False - valValidRecurEndDate2.Visible = True - Return - End If - End If - - For Each objEvent In _lstEvents - With objEvent - If objEvent.EventID > 0 And objEvent.UpdateStatus <> "Delete" Then - objEvent.UpdateStatus = "Match" - Dim objEventSave As EventInfo = objEvent.Clone - If (_editRecur And objEvent.EventTimeBegin.ToShortTimeString = objEventRMSave.Dtstart.ToShortTimeString) Then - .EventTimeBegin = ConvertDateStringstoDatetime(.EventTimeBegin.ToShortDateString, Format(objEventRecurMaster.Dtstart, "HH:mm")) - If tRecurEndDate.Date < .EventTimeBegin.Date Then - tRecurEndDate = .EventTimeBegin.Date.AddDays(30) - End If - End If - - If (_editRecur And CType(.Duration, String) & "M" = objEventRMSave.Duration) Or Not _editRecur Then - .Duration = intDuration - End If - - If Not _editRecur Then - .EventTimeBegin = objEventRecurMaster.Dtstart - If tRecurEndDate.Date < .EventTimeBegin.Date Then - tRecurEndDate = .EventTimeBegin.Date.AddDays(30) - End If - .Duration = intDuration - End If - - If (_editRecur And .EventName = objEventRMSave.EventName) Or Not _editRecur Then - .EventName = objEventRecurMaster.EventName - End If - If (_editRecur And .EventDesc = objEventRMSave.EventDesc) Or Not _editRecur Then - .EventDesc = objEventRecurMaster.EventDesc - End If - - If (_editRecur And .Importance = objEventRMSave.Importance) Or Not _editRecur Then - .Importance = CType(objEventRecurMaster.Importance, EventInfo.Priority) - End If - If (_editRecur And .Signups = objEventRMSave.Signups) Or Not _editRecur Then - .Signups = objEventRecurMaster.Signups - End If - If (_editRecur And .JournalItem = objEventRMSave.JournalItem) Or Not _editRecur Then - .JournalItem = objEventRecurMaster.JournalItem - End If - If (_editRecur And .AllowAnonEnroll = objEventRMSave.AllowAnonEnroll) Or Not _editRecur Then - .AllowAnonEnroll = objEventRecurMaster.AllowAnonEnroll - End If - If (_editRecur And .EnrollType = objEventRMSave.EnrollType) Or Not _editRecur Then - .EnrollType = objEventRecurMaster.EnrollType - End If - If (_editRecur And .PayPalAccount = objEventRMSave.PayPalAccount) Or Not _editRecur Then - .PayPalAccount = objEventRecurMaster.PayPalAccount - End If - If (_editRecur And .EnrollFee = objEventRMSave.EnrollFee) Or Not _editRecur Then - .EnrollFee = objEventRecurMaster.EnrollFee - End If - If (_editRecur And .MaxEnrollment = objEventRMSave.MaxEnrollment) Or Not _editRecur Then - .MaxEnrollment = objEventRecurMaster.MaxEnrollment - End If - If (_editRecur And .EnrollRoleID = objEventRMSave.EnrollRoleID) Or Not _editRecur Then - .EnrollRoleID = objEventRecurMaster.EnrollRoleID - End If - If (_editRecur And .DetailPage = objEventRMSave.DetailPage) Or Not _editRecur Then - .DetailPage = objEventRecurMaster.DetailPage - End If - If (_editRecur And .DetailNewWin = objEventRMSave.DetailNewWin) Or Not _editRecur Then - .DetailNewWin = objEventRecurMaster.DetailNewWin - End If - - If (_editRecur And .DetailURL = objEventRMSave.DetailURL) Or Not _editRecur Then - .DetailURL = objEventRecurMaster.DetailURL - End If - - If (_editRecur And .ImageDisplay = objEventRMSave.ImageDisplay) Or Not _editRecur Then - .ImageDisplay = objEventRecurMaster.ImageDisplay - End If - If (_editRecur And .ImageType = objEventRMSave.ImageType) Or Not _editRecur Then - .ImageType = objEventRecurMaster.ImageType - End If - - If (_editRecur And .ImageURL = objEventRMSave.ImageURL) Or Not _editRecur Then - .ImageURL = objEventRecurMaster.ImageURL - End If - If (_editRecur And .ImageWidth = objEventRMSave.ImageWidth) Or Not _editRecur Then - .ImageWidth = objEventRecurMaster.ImageWidth - End If - If (_editRecur And .ImageHeight = objEventRMSave.ImageHeight) Or Not _editRecur Then - .ImageHeight = objEventRecurMaster.ImageHeight - End If - If (_editRecur And .Category = objEventRMSave.Category) Or Not _editRecur Then - .Category = objEventRecurMaster.Category - End If - If (_editRecur And .Location = objEventRMSave.Location) Or Not _editRecur Then - .Location = objEventRecurMaster.Location - End If - - ' Save Event Notification Info - If (_editRecur And .SendReminder = objEventRMSave.SendReminder) Or Not _editRecur Then - .SendReminder = objEventRecurMaster.SendReminder - End If - If (_editRecur And .Reminder = objEventRMSave.Reminder) Or Not _editRecur Then - .Reminder = objEventRecurMaster.Reminder - End If - If (_editRecur And .Notify = objEventRMSave.Notify) Or Not _editRecur Then - .Notify = objEventRecurMaster.Notify - End If - If (_editRecur And .ReminderTime = objEventRMSave.ReminderTime) Or Not _editRecur Then - .ReminderTime = objEventRecurMaster.ReminderTime - End If - If (_editRecur And .ReminderTimeMeasurement = objEventRMSave.ReminderTimeMeasurement) Or Not _editRecur Then - .ReminderTimeMeasurement = objEventRecurMaster.ReminderTimeMeasurement - End If - If (_editRecur And .ReminderFrom = objEventRMSave.ReminderFrom) Or Not _editRecur Then - .ReminderFrom = objEventRecurMaster.ReminderFrom - End If - If (_editRecur And .OwnerID = objEventRMSave.OwnerID) Or Not _editRecur Then - .OwnerID = objEventRecurMaster.OwnerID - End If - - ' Set for re-submit to Search Engine - .SearchSubmitted = False - - If (_editRecur And .CustomField1 = objEventRMSave.CustomField1) Or Not _editRecur Then - .CustomField1 = objEventRecurMaster.CustomField1 - End If - If (_editRecur And .CustomField2 = objEventRMSave.CustomField2) Or Not _editRecur Then - .CustomField2 = objEventRecurMaster.CustomField2 - End If - If (_editRecur And .EnrollListView = objEventRMSave.EnrollListView) Or Not _editRecur Then - .EnrollListView = objEventRecurMaster.EnrollListView - End If - If (_editRecur And .DisplayEndDate = objEventRMSave.DisplayEndDate) Or Not _editRecur Then - .DisplayEndDate = objEventRecurMaster.DisplayEndDate - End If - If (_editRecur And .AllDayEvent = objEventRMSave.AllDayEvent) Or Not _editRecur Then - .AllDayEvent = objEventRecurMaster.AllDayEvent - End If - If (_editRecur And .Summary = objEventRMSave.Summary) Or Not _editRecur Then - .Summary = objEventRecurMaster.Summary - End If - - If .EventTimeBegin <> objEventSave.EventTimeBegin Or _ - .Duration <> objEventSave.Duration Or _ - .EventName <> objEventSave.EventName Or _ - .EventDesc <> objEventSave.EventDesc Or _ - .Importance <> objEventSave.Importance Or _ - .Notify <> objEventSave.Notify Or _ - .Signups <> objEventSave.Signups Or _ - .AllowAnonEnroll <> objEventSave.AllowAnonEnroll Or _ - .MaxEnrollment <> objEventSave.MaxEnrollment Or _ - .EnrollRoleID <> objEventSave.EnrollRoleID Or _ - .EnrollFee <> objEventSave.EnrollFee Or _ - .EnrollType <> objEventSave.EnrollType Or _ - .PayPalAccount <> objEventSave.PayPalAccount Or _ - .DetailPage <> objEventSave.DetailPage Or _ - .DetailNewWin <> objEventSave.DetailNewWin Or _ - .DetailURL <> objEventSave.DetailURL Or _ - .ImageURL <> objEventSave.ImageURL Or _ - .ImageType <> objEventSave.ImageType Or _ - .ImageWidth <> objEventSave.ImageWidth Or _ - .ImageHeight <> objEventSave.ImageHeight Or _ - .ImageDisplay <> objEventSave.ImageDisplay Or _ - .Location <> objEventSave.Location Or _ - .Category <> objEventSave.Category Or _ - .Reminder <> objEventSave.Reminder Or _ - .SendReminder <> objEventSave.SendReminder Or _ - .ReminderTime <> objEventSave.ReminderTime Or _ - .ReminderTimeMeasurement <> objEventSave.ReminderTimeMeasurement Or _ - .ReminderFrom <> objEventSave.ReminderFrom Or _ - .CustomField1 <> objEventSave.CustomField1 Or _ - .CustomField2 <> objEventSave.CustomField2 Or _ - .EnrollListView <> objEventSave.EnrollListView Or _ - .DisplayEndDate <> objEventSave.DisplayEndDate Or _ - .AllDayEvent <> objEventSave.AllDayEvent Or _ - .Summary <> objEventSave.Summary Or _ - .OwnerID <> objEventSave.OwnerID Then - .LastUpdatedID = UserId - .Approved = objEventRecurMaster.Approved - .UpdateStatus = "Update" - End If - - End If - - ' Do we need to check for schedule conflict? - If Settings.Preventconflicts And objEvent.UpdateStatus <> "Delete" Then - Dim getSubEvents As Boolean = Settings.MasterEvent - Dim categoryIDs As New ArrayList - categoryIDs.Add("-1") - Dim locationIDs As New ArrayList - locationIDs.Add("-1") - Dim selectedEvents As ArrayList = objEventInfoHelper.GetEvents(objEvent.EventTimeBegin.Date, objEvent.EventTimeBegin.AddMinutes(.Duration).Date, getSubEvents, categoryIDs, locationIDs, objEventRecurMaster.SocialGroupID, objEventRecurMaster.SocialUserID) - Dim conflictDateChk As DateTime = Now() - Dim conflictDate As DateTime = objEventInfoHelper.IsConflict(objEvent, selectedEvents, conflictDateChk) - If conflictDate <> conflictDateChk Then - 'Conflict Error - If Settings.Locationconflict Then - valLocationConflict.IsValid = False - valLocationConflict.Visible = True - valLocationConflict.ErrorMessage = Localization.GetString("valLocationConflict", LocalResourceFile) + " - " + String.Format("{0:g}", conflictDate) - valLocationConflict.Text = Localization.GetString("valLocationConflict", LocalResourceFile) + " - " + String.Format("{0:g}", conflictDate) - Else - valConflict.IsValid = False - valConflict.Visible = True - valConflict.ErrorMessage = Localization.GetString("valConflict", LocalResourceFile) + " - " + String.Format("{0:g}", conflictDate) - valConflict.Text = Localization.GetString("valConflict", LocalResourceFile) + " - " + String.Format("{0:g}", conflictDate) - End If - Return - End If - End If - - End With - Next - - If objEventRecurMaster.RecurMasterID = -1 Or _ - (objEventRMSave.RRULE = "" And Not _editRecur) Or _ - _editRecur Then - objEventRecurMaster = _objCtlEventRecurMaster.EventsRecurMasterSave(objEventRecurMaster, TabId, True) - End If - - If objEventRecurMaster.RecurMasterID = -1 Then - SelectedDate = objEventRecurMaster.Dtstart.Date - End If - - ' url tracking - Dim objUrls As New UrlController - objUrls.UpdateUrl(PortalId, ctlURL.Url, ctlURL.UrlType, ctlURL.Log, ctlURL.Track, ModuleId, ctlURL.NewWindow) - objUrls.UpdateUrl(PortalId, URLDetail.Url, URLDetail.UrlType, URLDetail.Log, URLDetail.Track, ModuleId, URLDetail.NewWindow) - - Dim blEmailSend As Boolean = False - Dim blModeratorEmailSent As Boolean = False - Dim objEventEmail As New EventInfo - For Each objEvent In _lstEvents - objEvent.RecurMasterID = objEventRecurMaster.RecurMasterID - Select Case objEvent.UpdateStatus - Case "Match" - Case "Delete" - _objCtlEvent.EventsDelete(objEvent.EventID, objEvent.ModuleID, objEvent.ContentItemID) - Case Else - If Not objEvent.Cancelled Then - Dim oEvent As EventInfo = objEvent - objEvent = _objCtlEvent.EventsSave(objEvent, False, TabId, True) - If Not oEvent.Approved And Not blModeratorEmailSent Then - oEvent.RRULE = objEventRecurMaster.RRULE - SendModeratorEmail(oEvent) - blModeratorEmailSent = True - End If - If oEvent.EventID <> -1 Then - UpdateExistingNotificationRecords(oEvent) - Else - If Not blEmailSend Then - objEventEmail = objEvent - blEmailSend = True - End If - End If - End If - End Select - Next - If blEmailSend Then - SendNewEventEmails(objEventEmail) - CreateNewEventJournal(objEventEmail) - End If - If chkEventEmailChk.Checked Then - SendEventEmail(CType(_lstEvents.Item(0), EventInfo)) - End If - - End Sub - - Private Function CreateEventRRULE(ByVal objEventRecurMaster As EventRecurMasterInfo) As EventRecurMasterInfo - Dim strWkst As String - Dim culture As New CultureInfo(objEventRecurMaster.CultureName, False) - strWkst = "SU" - If (culture.DateTimeFormat.FirstDayOfWeek <> DayOfWeek.Sunday) Then - strWkst = "MO" - End If - - If rblRepeatTypeN.Checked Then - objEventRecurMaster.RRULE = "" - ElseIf rblRepeatTypeP1.Checked Then - Select Case Trim(cmbP1Period.SelectedItem.Value) - Case "D" - objEventRecurMaster.RRULE = "FREQ=DAILY" - Case "W" - objEventRecurMaster.RRULE = "FREQ=WEEKLY;WKST=" + strWkst - Case "M" - objEventRecurMaster.RRULE = "FREQ=MONTHLY" - Case "Y" - objEventRecurMaster.RRULE = "FREQ=YEARLY" - End Select - - objEventRecurMaster.RRULE = objEventRecurMaster.RRULE + ";INTERVAL=" + txtP1Every.Text - ElseIf rblRepeatTypeW1.Checked Then - objEventRecurMaster.RRULE = "FREQ=WEEKLY;WKST=" + strWkst + ";INTERVAL=" + txtW1Every.Text + ";BYDAY=" - If chkW1Sun.Checked Or chkW1Sun2.Checked Then - objEventRecurMaster.RRULE = objEventRecurMaster.RRULE + "SU," - End If - If chkW1Mon.Checked Then - objEventRecurMaster.RRULE = objEventRecurMaster.RRULE + "MO," - End If - If chkW1Tue.Checked Then - objEventRecurMaster.RRULE = objEventRecurMaster.RRULE + "TU," - End If - If chkW1Wed.Checked Then - objEventRecurMaster.RRULE = objEventRecurMaster.RRULE + "WE," - End If - If chkW1Thu.Checked Then - objEventRecurMaster.RRULE = objEventRecurMaster.RRULE + "TH," - End If - If chkW1Fri.Checked Then - objEventRecurMaster.RRULE = objEventRecurMaster.RRULE + "FR," - End If - If chkW1Sat.Checked Then - objEventRecurMaster.RRULE = objEventRecurMaster.RRULE + "SA," - End If - objEventRecurMaster.RRULE = Left(objEventRecurMaster.RRULE, Len(objEventRecurMaster.RRULE) - 1) - ElseIf rblRepeatTypeM1.Checked And rblRepeatTypeM.Checked Then - objEventRecurMaster.RRULE = "FREQ=MONTHLY;INTERVAL=" + txtMEvery.Text + ";BYDAY=" - Dim intWeek As Integer - Dim strWeek As String - If cmbM1Every.SelectedIndex < 4 Then - intWeek = cmbM1Every.SelectedIndex + 1 - strWeek = "+" + Convert.ToString(intWeek) - Else - intWeek = -1 - strWeek = Convert.ToString(intWeek) - End If - objEventRecurMaster.RRULE = objEventRecurMaster.RRULE + strWeek - - Dim strDay As String = "" - Select Case cmbM1Period.SelectedValue - Case "0" - strDay = "SU" - Case "1" - strDay = "MO" - Case "2" - strDay = "TU" - Case "3" - strDay = "WE" - Case "4" - strDay = "TH" - Case "5" - strDay = "FR" - Case "6" - strDay = "SA" - End Select - objEventRecurMaster.RRULE = objEventRecurMaster.RRULE + strDay - ElseIf rblRepeatTypeM2.Checked And rblRepeatTypeM.Checked Then - objEventRecurMaster.RRULE = "FREQ=MONTHLY;INTERVAL=" + txtMEvery.Text + ";BYMONTHDAY=+" + cmbM2Period.SelectedValue - ElseIf rblRepeatTypeY1.Checked Then - Dim yearDate As DateTime = CType(dpY1Period.SelectedDate, Date) - objEventRecurMaster.RRULE = "FREQ=YEARLY;INTERVAL=1;BYMONTH=" + Convert.ToString(yearDate.Month) + ";BYMONTHDAY=+" + Convert.ToString(yearDate.Day) - End If - Return objEventRecurMaster - End Function - - Private Function CompareOldNewEvents(ByVal lstEventsOld As ArrayList, ByVal lstEventsNew As ArrayList) As ArrayList - Dim objEventOld, objEventNew As EventInfo - For Each objEventOld In lstEventsOld - objEventOld.UpdateStatus = "Delete" - For Each objEventNew In lstEventsNew - If objEventOld.OriginalDateBegin = objEventNew.OriginalDateBegin Then - objEventOld.UpdateStatus = "Match" - End If - Next - Next - For Each objEventNew In lstEventsNew - objEventNew.UpdateStatus = "Add" - For Each objEventOld In lstEventsOld - If objEventOld.OriginalDateBegin = objEventNew.OriginalDateBegin Then - objEventNew.UpdateStatus = "Match" - End If - Next - Next - For Each objEventNew In lstEventsNew - If objEventNew.UpdateStatus = "Add" Then - lstEventsOld.Add(objEventNew) - End If - Next - Return lstEventsOld - End Function - - Private Sub UpdateExistingNotificationRecords(ByVal objEvent As EventInfo) - Try - ' Add Notification Records to Database, if required - If chkReminder.Checked = True Then - Dim eventTimeBegin As DateTime - 'Adjust Begin Time to UTC - eventTimeBegin = objEvent.EventTimeBegin - eventTimeBegin = eventTimeBegin.AddMinutes(0) 'only to pass to EventsNotificationTimeChange in correct format... - ' Update Time for any existing Notifications for the Event - Dim objEventNotificationController As EventNotificationController = New EventNotificationController - objEventNotificationController.EventsNotificationTimeChange(objEvent.EventID, eventTimeBegin, ModuleId) - End If - Catch exc As Exception - ProcessModuleLoadException(Me, exc) - End Try - End Sub - - Private Sub SendModeratorEmail(ByVal objEvent As EventInfo) - Try - ' Send Moderator email - If Settings.Moderateall Then - Dim objEventEmailInfo As New EventEmailInfo - Dim objEventEmail As New EventEmails(PortalId, ModuleId, LocalResourceFile, CType(Page, PageBase).PageCulture.Name) - objEventEmailInfo.TxtEmailSubject = Settings.Templates.moderateemailsubject - objEventEmailInfo.TxtEmailBody = Settings.Templates.moderateemailmessage - objEventEmailInfo.TxtEmailFrom() = Settings.StandardEmail - Dim moderators As ArrayList = GetModerators() - For Each moderator As UserInfo In moderators - objEventEmailInfo.UserEmails.Add(moderator.Email) - objEventEmailInfo.UserLocales.Add(moderator.Profile.PreferredLocale) - objEventEmailInfo.UserTimeZoneIds.Add(moderator.Profile.PreferredTimeZone.Id) - Next - objEventEmail.SendEmails(objEventEmailInfo, objEvent) - End If - - Catch exc As Exception - ProcessModuleLoadException(Me, exc) - End Try - End Sub - - Private Sub SendEventEmail(ByVal objEventEmailIn As EventInfo) - Dim objEventEmailInfo As New EventEmailInfo - Dim objEventEmail As New EventEmails(PortalId, ModuleId, LocalResourceFile, CType(Page, PageBase).PageCulture.Name) - objEventEmailInfo.TxtEmailSubject = txtEventEmailSubject.Text - objEventEmailInfo.TxtEmailBody = txtEventEmailBody.Text - objEventEmailInfo.TxtEmailFrom() = txtEventEmailFrom.Text - EventEmailAddRoleUsers(CInt(ddEventEmailRoles.SelectedValue), objEventEmailInfo) - objEventEmail.SendEmails(objEventEmailInfo, objEventEmailIn) - - End Sub - - Private Function ConvertDateStringstoDatetime(ByVal strDate As String, ByVal strTime As String) As DateTime - - Dim invCulture As CultureInfo = CultureInfo.InvariantCulture - - Dim tDate As DateTime - tDate = Convert.ToDateTime(strDate).Date - - ' Since dates may not be in a form directly combinable with time, convert back to string to enable combination - strDate = tDate.ToString("yyyy/MM/dd", invCulture) - tDate = Date.ParseExact(strDate + " " + strTime, "yyyy/MM/dd HH:mm", invCulture) - Return tDate - End Function - - Private Sub BuildEnrolleeGrid(ByVal objEvent As EventInfo) - Dim objSignups As ArrayList - ' Refresh Enrollment Grid - If _editRecur Then - objSignups = _objCtlEventSignups.EventsSignupsGetEventRecurMaster(objEvent.RecurMasterID, objEvent.ModuleID) - Else - objSignups = _objCtlEventSignups.EventsSignupsGetEvent(objEvent.EventID, objEvent.ModuleID) - End If - - Dim eventEnrollment As New ArrayList - Dim objSignup As EventSignupsInfo - Dim objCtlUser As New UserController - Dim noEnrolees As Integer = 0 - For Each objSignup In objSignups - Dim objEnrollListItem As New EventEnrollList - noEnrolees += objSignup.NoEnrolees - If objSignup.UserID <> -1 Then - Dim objUser As UserInfo - objUser = objCtlUser.GetUser(PortalId, objSignup.UserID) - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - objEnrollListItem.EnrollDisplayName = objEventInfoHelper.UserDisplayNameProfile(objSignup.UserID, objSignup.UserName, LocalResourceFile).DisplayNameURL - If Not objUser Is Nothing Then - objEnrollListItem.EnrollUserName = objUser.Username - objEnrollListItem.EnrollEmail = String.Format("{0}", objSignup.Email, objEvent.EventName) - objEnrollListItem.EnrollPhone = objUser.Profile.Telephone - End If - Else - objEnrollListItem.EnrollDisplayName = objSignup.AnonName - objEnrollListItem.EnrollUserName = Localization.GetString("AnonUser", LocalResourceFile) - objEnrollListItem.EnrollEmail = String.Format("{0}", objSignup.AnonEmail, objEvent.EventName) - objEnrollListItem.EnrollPhone = objSignup.AnonTelephone - End If - objEnrollListItem.SignupID = objSignup.SignupID - objEnrollListItem.EnrollApproved = objSignup.Approved - objEnrollListItem.EnrollNo = objSignup.NoEnrolees - objEnrollListItem.EnrollTimeBegin = objSignup.EventTimeBegin - eventEnrollment.Add(objEnrollListItem) - Next - - If eventEnrollment.Count > 0 Then - grdEnrollment.DataSource = eventEnrollment - grdEnrollment.DataBind() - tblEventEmail.Attributes.Add("style", "display:block; width:100%") - lblEnrolledUsers.Visible = True - grdEnrollment.Visible = True - lnkSelectedDelete.Visible = True - lnkSelectedEmail.Visible = True - Else - lblEnrolledUsers.Visible = False - grdEnrollment.Visible = False - If Not Settings.Newpereventemail Then - tblEventEmail.Attributes.Add("style", "display:none; width:100%") - End If - lnkSelectedDelete.Visible = False - lnkSelectedEmail.Visible = False - End If - - objEvent.Enrolled = eventEnrollment.Count - objEvent.Signups = True - ShowHideEnrolleeColumns(objEvent) - - txtEnrolled.Text = noEnrolees.ToString - valNoEnrolees.MaximumValue = CStr(objEvent.MaxEnrollment - noEnrolees) - If CInt(valNoEnrolees.MaximumValue) > Settings.Maxnoenrolees Or objEvent.MaxEnrollment = 0 Then - valNoEnrolees.MaximumValue = Settings.Maxnoenrolees.ToString - ElseIf CInt(valNoEnrolees.MaximumValue) < 1 Then - valNoEnrolees.MaximumValue = "1" - End If - lblMaxNoEnrolees.Text = String.Format(Localization.GetString("lblMaxNoEnrolees", LocalResourceFile), valNoEnrolees.MaximumValue) - End Sub - - Private Sub ShowHideEnrolleeColumns(ByVal objEvent As EventInfo) - Dim txtColumns As String = EnrolmentColumns(objEvent, True) - Dim gvUsersToEnroll As GridView = CType(grdAddUser.FindControl("gvUsersToEnroll"), GridView) - If txtColumns.LastIndexOf("UserName", StringComparison.Ordinal) < 0 Then - grdEnrollment.Columns.Item(1).Visible = False - gvUsersToEnroll.Columns.Item(1).Visible = False - Else - grdEnrollment.Columns.Item(1).Visible = True - gvUsersToEnroll.Columns.Item(1).Visible = True - End If - If txtColumns.LastIndexOf("DisplayName", StringComparison.Ordinal) < 0 Then - grdEnrollment.Columns.Item(2).Visible = False - gvUsersToEnroll.Columns.Item(2).Visible = False - Else - grdEnrollment.Columns.Item(2).Visible = True - gvUsersToEnroll.Columns.Item(2).Visible = True - End If - If txtColumns.LastIndexOf("Email", StringComparison.Ordinal) < 0 Then - grdEnrollment.Columns.Item(3).Visible = False - gvUsersToEnroll.Columns.Item(3).Visible = False - Else - grdEnrollment.Columns.Item(3).Visible = True - gvUsersToEnroll.Columns.Item(3).Visible = True - End If - If txtColumns.LastIndexOf("Phone", StringComparison.Ordinal) < 0 Then - grdEnrollment.Columns.Item(4).Visible = False - Else - grdEnrollment.Columns.Item(4).Visible = True - End If - If txtColumns.LastIndexOf("Approved", StringComparison.Ordinal) < 0 Then - grdEnrollment.Columns.Item(5).Visible = False - Else - grdEnrollment.Columns.Item(5).Visible = True - End If - If txtColumns.LastIndexOf("Qty", StringComparison.Ordinal) < 0 Then - grdEnrollment.Columns.Item(6).Visible = False - Else - grdEnrollment.Columns.Item(6).Visible = True - End If - If _editRecur Then - grdEnrollment.Columns.Item(7).Visible = True - Else - grdEnrollment.Columns.Item(7).Visible = False - End If - - End Sub - - Private Sub AddRegUser(ByVal inUserID As Integer, ByVal objEvent As EventInfo) - ' Check if signup already exists since due to partial rendering it may be possible - ' to click the enroll user link twice - Dim intUserID As Integer = inUserID - _objEventSignups = _objCtlEventSignups.EventsSignupsGetUser(objEvent.EventID, intUserID, objEvent.ModuleID) - - If _objEventSignups Is Nothing Then - ' Get user info - Dim objUserInfo As UserInfo = UserController.GetUserById(PortalId, intUserID) - - _objEventSignups = New EventSignupsInfo - _objEventSignups.EventID = objEvent.EventID - _objEventSignups.ModuleID = objEvent.ModuleID - _objEventSignups.UserID = intUserID - _objEventSignups.AnonEmail = Nothing - _objEventSignups.AnonName = Nothing - _objEventSignups.AnonTelephone = Nothing - _objEventSignups.AnonCulture = Nothing - _objEventSignups.AnonTimeZoneId = Nothing - _objEventSignups.PayPalPaymentDate = DateTime.UtcNow - _objEventSignups.Approved = True - _objEventSignups.NoEnrolees = CInt(txtNoEnrolees.Text) - _objEventSignups = CreateEnrollment(_objEventSignups, objEvent) - - ' Mail users - If Settings.SendEnrollMessageAdded Then - Dim objEventEmailInfo As New EventEmailInfo - Dim objEventEmail As New EventEmails(PortalId, ModuleId, LocalResourceFile, CType(Page, PageBase).PageCulture.Name) - objEventEmailInfo.TxtEmailSubject = Settings.Templates.txtEnrollMessageSubject - objEventEmailInfo.TxtEmailBody = Settings.Templates.txtEnrollMessageAdded - objEventEmailInfo.TxtEmailFrom() = Settings.StandardEmail - objEventEmailInfo.UserIDs.Add(_objEventSignups.UserID) - objEventEmailInfo.UserIDs.Add(objEvent.OwnerID) - objEventEmail.SendEmails(objEventEmailInfo, objEvent, _objEventSignups) - End If - End If - End Sub - - Private Function ValidateTime(ByVal indate As DateTime) As Boolean - Dim inMinutes As Integer = indate.Minute - Dim remainder As Integer = inMinutes Mod CInt(Settings.Timeinterval) - If remainder > 0 Then - Return False - End If - Return True - End Function - -#End Region - -#Region "Links and Buttons" - Private Sub cancelButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cancelButton.Click - Try - Response.Redirect(GetStoredPrevPage(), True) - - Catch exc As Exception 'Module failed to load - 'ProcessModuleLoadException(Me, exc) - End Try - End Sub - - Private Sub updateButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles updateButton.Click - Try - UpdateProcessing(_itemID) - If Page.IsValid Then - Response.Redirect(GetStoredPrevPage(), True) - End If - - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub - - Private Sub deleteButton_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles deleteButton.Click - Try - _objEvent = _objCtlEvent.EventsGet(_itemID, ModuleId) - If _editRecur Then - _objCtlEventRecurMaster.EventsRecurMasterDelete(_objEvent.RecurMasterID, _objEvent.ModuleID) - Else - If _objEvent.RRULE <> "" Then - _objEvent.Cancelled = True - _objEvent.LastUpdatedID = UserId - _objEvent = _objCtlEvent.EventsSave(_objEvent, False, TabId, True) - Else - _objCtlEventRecurMaster.EventsRecurMasterDelete(_objEvent.RecurMasterID, _objEvent.ModuleID) - End If - End If - Response.Redirect(GetSocialNavigateUrl(), True) - Catch exc As Exception 'Module failed to load - 'ProcessModuleLoadException(Me, exc) - End Try - End Sub - - Private Sub lnkSelectedEmail_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles lnkSelectedEmail.Click - Email(True) - End Sub - - Private Sub lnkSelectedDelete_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles lnkSelectedDelete.Click - Dim item As DataGridItem - Dim objEnroll As EventSignupsInfo - Dim eventID As Integer = 0 - - For Each item In grdEnrollment.Items - If CType(item.FindControl("chkSelect"), CheckBox).Checked Then - Dim intSignupID As Integer = CInt(grdEnrollment.DataKeys(item.ItemIndex)) - objEnroll = _objCtlEventSignups.EventsSignupsGet(intSignupID, ModuleId, False) - If Not objEnroll Is Nothing Then - If eventID <> objEnroll.EventID Then - _objEvent = _objCtlEvent.EventsGet(objEnroll.EventID, ModuleId) - End If - eventID = objEnroll.EventID() - - ' Delete Selected Enrollee? - DeleteEnrollment(intSignupID, _objEvent.ModuleID, _objEvent.EventID) - - ' Mail users - If Settings.SendEnrollMessageDeleted Then - Dim objEventEmailInfo As New EventEmailInfo - Dim objEventEmail As New EventEmails(PortalId, ModuleId, LocalResourceFile, CType(Page, PageBase).PageCulture.Name) - objEventEmailInfo.TxtEmailSubject = Settings.Templates.txtEnrollMessageSubject - objEventEmailInfo.TxtEmailBody = Settings.Templates.txtEnrollMessageDeleted - objEventEmailInfo.TxtEmailFrom() = Settings.StandardEmail - If objEnroll.UserID > -1 Then - objEventEmailInfo.UserIDs.Add(objEnroll.UserID) - Else - objEventEmailInfo.UserEmails.Add(objEnroll.AnonEmail) - objEventEmailInfo.UserLocales.Add(objEnroll.AnonCulture) - objEventEmailInfo.UserTimeZoneIds.Add(objEnroll.AnonTimeZoneId) - End If - objEventEmailInfo.UserIDs.Add(_objEvent.OwnerID) - objEventEmail.SendEmails(objEventEmailInfo, _objEvent, objEnroll) - End If - End If - - End If - Next - - LoadRegUsers() - BuildEnrolleeGrid(_objEvent) - End Sub - - Private Sub copyButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles copyButton.Click - Try - UpdateProcessing(-1) - If Page.IsValid Then - Response.Redirect(GetStoredPrevPage(), True) - End If - - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub - - Private Sub ddEnrollRoles_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ddEnrollRoles.SelectedIndexChanged - LoadRegUsers() - End Sub - - Private Sub chkSignups_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles chkSignups.CheckedChanged - tblEventEmail.Attributes.Add("style", "display:none; width:100%") - If chkSignups.Checked Then - tblEnrollmentDetails.Attributes.Add("style", "display:block;") - LoadRegUsers() - If txtEnrolled.Text <> 0.ToString() Then - tblEventEmail.Attributes.Add("style", "display:block; width:100%") - End If - Else - tblEnrollmentDetails.Attributes.Add("style", "display:none;") - If Settings.Newpereventemail And chkEventEmailChk.Checked Then - tblEventEmail.Attributes.Add("style", "display:block; width:100%") - End If - End If - End Sub - - Private Sub grdAddUser_AddSelectedUsers(ByVal sender As Object, ByVal e As EventArgs, ByVal arrUsers As ArrayList) Handles grdAddUser.AddSelectedUsers - Try - If CInt(txtNoEnrolees.Text) > CInt(valNoEnrolees.MaximumValue) Or _ - CInt(txtNoEnrolees.Text) < CInt(valNoEnrolees.MinimumValue) Then - valNoEnrolees.IsValid = False - valNoEnrolees.Visible = True - valNoEnrolees.ErrorMessage = String.Format(Localization.GetString("valNoEnrolees", LocalResourceFile), valNoEnrolees.MaximumValue) - Return - End If - Catch - valNoEnrolees.IsValid = False - valNoEnrolees.Visible = True - valNoEnrolees.ErrorMessage = String.Format(Localization.GetString("valNoEnrolees", LocalResourceFile), valNoEnrolees.MaximumValue) - Return - End Try - - Dim objEvent As EventInfo = _objCtlEvent.EventsGet(_itemID, ModuleId) - - For Each inUserid As Integer In arrUsers - AddRegUser(inUserid, objEvent) - Next - LoadRegUsers() - BuildEnrolleeGrid(objEvent) - txtNoEnrolees.Text = 1.ToString() - End Sub - -#End Region - -#Region " Web Form Designer Generated Code " - - 'This call is required by the Web Form Designer. - Private Sub InitializeComponent() - - End Sub - - Private Sub Page_Init(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Init - 'CODEGEN: This method call is required by the Web Form Designer - 'Do not modify it using the code editor. - InitializeComponent() - End Sub - -#End Region - - End Class - -#Region "Comparer Class" - Public Class UserListSort - Implements IComparer - - Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer Implements IComparer.Compare - Dim xdisplayname As String - Dim ydisplayname As String - - xdisplayname = CType(x, EventUser).DisplayName - ydisplayname = CType(y, EventUser).DisplayName - Dim c As New CaseInsensitiveComparer - Return c.Compare(xdisplayname, ydisplayname) - End Function - End Class - -#End Region - -End Namespace diff --git a/EventDay.ascx b/EventDay.ascx index 8227154..47b087f 100644 --- a/EventDay.ascx +++ b/EventDay.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="EventDay.ascx.vb" Inherits="DotNetNuke.Modules.Events.EventDay" %> +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EventDay.ascx.cs" Inherits="DotNetNuke.Modules.Events.EventDay" %> <%@ Register TagPrefix="evt" TagName="Category" Src="~/DesktopModules/Events/SubControls/SelectCategory.ascx" %> <%@ Register TagPrefix="evt" TagName="Location" Src="~/DesktopModules/Events/SubControls/SelectLocation.ascx" %> <%@ Register TagPrefix="evt" TagName="Icons" Src="~/DesktopModules/Events/SubControls/EventIcons.ascx" %> @@ -11,15 +11,15 @@
- - + +
+ CssClass="ListDataGrid" DataKeyField="EventID" Width="100%" OnItemDataBound="lstEvents_ItemDataBound" OnItemCommand="lstEvents_ItemCommand"> @@ -50,7 +50,7 @@ - + @@ -140,7 +140,8 @@
    -
  • +
+ diff --git a/EventDay.ascx.cs b/EventDay.ascx.cs new file mode 100644 index 0000000..85103cf --- /dev/null +++ b/EventDay.ascx.cs @@ -0,0 +1,441 @@ +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using System.Web.UI; +using System.Drawing; +using Microsoft.VisualBasic; +using System.Web.UI.WebControls; +using System.Collections; +using System.Web; +using DotNetNuke.Services.Localization; +using System; +using System.Globalization; + + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events +{ + + [DNNtc.ModuleControlProperties("Day", "Events Day", DNNtc.ControlType.View, "https://dnnevents.codeplex.com/documentation", true, true)] + public partial class EventDay : EventBase + { + + #region Event Handlers + private ArrayList _selectedEvents; + + private void Page_Load(System.Object sender, EventArgs e) + { + try + { + SetupViewControls(EventIcons, EventIcons2, SelectCategory, SelectLocation); + + if (Settings.Eventdaynewpage) + { + SetTheme(pnlEventsModuleDay); + AddFacebookMetaTags(); + } + + //Show header - or not + if (Settings.EventsListShowHeader == "Yes") + { + lstEvents.ShowHeader = true; + } + else + { + lstEvents.ShowHeader = false; + } + + if (Page.IsPostBack == false) + { + if (Settings.EventsListShowHeader != "No") + { + lstEvents.ShowHeader = true; + Localization.LocalizeDataGrid(ref lstEvents, LocalResourceFile); + } + BindDataGrid(); + } + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + #endregion + + #region Helper Functions + private void BindDataGrid() + { + CultureInfo culture = System.Threading.Thread.CurrentThread.CurrentCulture; + DateTime startDate = default(DateTime); // Start View Date Events Range + DateTime endDate = default(DateTime); // End View Date Events Range + EventInfo objEvent = default(EventInfo); + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + bool editButtonVisible = false; + + // Set Date Range + DateTime dDate = SelectedDate.Date; + startDate = dDate.AddDays(-1); + endDate = dDate.AddDays(1); + + // Get Events/Sub-Calendar Events + bool getSubEvents = Settings.MasterEvent; + _selectedEvents = objEventInfoHelper.GetEvents(startDate, endDate, getSubEvents, SelectCategory.SelectedCategory, SelectLocation.SelectedLocation, GetUrlGroupId(), GetUrlUserId()); + + _selectedEvents = objEventInfoHelper.ConvertEventListToDisplayTimeZone(_selectedEvents, GetDisplayTimeZoneId()); + + if (_selectedEvents.Count == 0) + { + lstEvents.Visible = false; + divMessage.Visible = true; + return; + } + else + { + lstEvents.Visible = true; + divMessage.Visible = false; + } + + // Get Date Events (used for Multiday event) + ArrayList dayEvents = default(ArrayList); + dayEvents = objEventInfoHelper.GetDateEvents(_selectedEvents, dDate); + + string fmtEventTimeBegin = Settings.Templates.txtDayEventTimeBegin; + if (string.IsNullOrEmpty(fmtEventTimeBegin)) + { + fmtEventTimeBegin = "g"; + } + + string fmtEventTimeEnd = Settings.Templates.txtDayEventTimeEnd; + if (string.IsNullOrEmpty(fmtEventTimeEnd)) + { + fmtEventTimeEnd = "g"; + } + + string tmpDayDescription = Settings.Templates.txtDayEventDescription; + string tmpDayLocation = Settings.Templates.txtDayLocation; + + if (Settings.Eventtooltipday) + { + toolTipManager.TargetControls.Clear(); + } + + ArrayList colEvents = new ArrayList(); + EventListObject lstEvent = default(EventListObject); + foreach (EventInfo tempLoopVar_objEvent in dayEvents) + { + objEvent = tempLoopVar_objEvent; + // If full enrollments should be hidden, ignore + if (HideFullEvent(objEvent)) + { + continue; + } + + bool blAddEvent = true; + if (Settings.Collapserecurring) + { + foreach (EventListObject tempLoopVar_lstEvent in colEvents) + { + lstEvent = tempLoopVar_lstEvent; + if (lstEvent.RecurMasterID == objEvent.RecurMasterID) + { + blAddEvent = false; + } + } + } + if (blAddEvent) + { + EventRecurMasterController objCtlEventRecurMaster = new EventRecurMasterController(); + TokenReplaceControllerClass tcc = new TokenReplaceControllerClass(ModuleId, LocalResourceFile); + string fmtRowEnd = ""; + string fmtRowBegin = ""; + fmtRowEnd = tcc.TokenParameters(fmtEventTimeEnd, objEvent, Settings); + fmtRowBegin = tcc.TokenParameters(fmtEventTimeBegin, objEvent, Settings); + + lstEvent = new EventListObject(); + lstEvent.EventID = objEvent.EventID; + lstEvent.CreatedByID = objEvent.CreatedByID; + lstEvent.OwnerID = objEvent.OwnerID; + lstEvent.EventDateBegin = objEvent.EventTimeBegin; + lstEvent.EventDateEnd = objEvent.EventTimeEnd; + if (objEvent.DisplayEndDate) + { + lstEvent.TxtEventDateEnd = string.Format("{0:" + fmtRowEnd + "}", lstEvent.EventDateEnd); + } + else + { + lstEvent.TxtEventDateEnd = ""; + } + lstEvent.EventTimeBegin = objEvent.EventTimeBegin; + lstEvent.TxtEventTimeBegin = string.Format("{0:" + fmtRowBegin + "}", lstEvent.EventTimeBegin); + lstEvent.Duration = objEvent.Duration; + + bool isEvtEditor = IsEventEditor(objEvent, false); + + string templatedescr = ""; + string iconString = ""; + + if (!IsPrivateNotModerator || UserId == objEvent.OwnerID) + { + templatedescr = tcc.TokenReplaceEvent(objEvent, tmpDayDescription, null, false, isEvtEditor); + lstEvent.CategoryColor = GetColor(objEvent.Color); + lstEvent.CategoryFontColor = GetColor(objEvent.FontColor); + + iconString = CreateIconString(objEvent, Settings.IconListPrio, Settings.IconListRec, Settings.IconListReminder, Settings.IconListEnroll); + } + + lstEvent.EventName = CreateEventName(objEvent, "[event:title]"); + lstEvent.EventDesc = objEvent.EventDesc; + // RWJS - not sure why replace ' with \' - lstEvent.DecodedDesc = System.Web.HttpUtility.HtmlDecode(objEvent.EventDesc).Replace(Environment.NewLine, "").Trim.Replace("'", "\'") + lstEvent.DecodedDesc = System.Convert.ToString(HttpUtility.HtmlDecode(templatedescr).Replace(Environment.NewLine, "")); + lstEvent.EventID = objEvent.EventID; + lstEvent.ModuleID = objEvent.ModuleID; + + EventRRULEInfo objEventRRULE = default(EventRRULEInfo); + objEventRRULE = objCtlEventRecurMaster.DecomposeRRULE(objEvent.RRULE, objEvent.EventTimeBegin); + lstEvent.RecurText = objCtlEventRecurMaster.RecurrenceText(objEventRRULE, LocalResourceFile, culture, objEvent.EventTimeBegin); + if (objEvent.RRULE != "") + { + lstEvent.RecurUntil = objEvent.LastRecurrence.ToShortDateString(); + } + else + { + lstEvent.RecurUntil = ""; + } + lstEvent.EventID = objEvent.EventID; + lstEvent.ModuleID = objEvent.ModuleID; + + lstEvent.ImageURL = ""; + if (Settings.Eventimage && objEvent.ImageURL != null && objEvent.ImageDisplay == true) + { + lstEvent.ImageURL = ImageInfo(objEvent.ImageURL, objEvent.ImageHeight, objEvent.ImageWidth); + } + + // Get detail page url + lstEvent.URL = objEventInfoHelper.DetailPageURL(objEvent); + if (objEvent.DetailPage && objEvent.DetailNewWin) + { + lstEvent.Target = "_blank"; + } + + lstEvent.Icons = iconString; + lstEvent.DisplayDuration = System.Convert.ToInt32(Conversion.Int((double)objEvent.Duration / 1440 + 1)); + lstEvent.CategoryName = objEvent.CategoryName; + lstEvent.LocationName = tcc.TokenReplaceEvent(objEvent, tmpDayLocation); + lstEvent.CustomField1 = objEvent.CustomField1; + lstEvent.CustomField2 = objEvent.CustomField2; + lstEvent.RecurMasterID = objEvent.RecurMasterID; + + if (Settings.Eventtooltipday) + { + lstEvent.Tooltip = ToolTipCreate(objEvent, Settings.Templates.txtTooltipTemplateTitle, Settings.Templates.txtTooltipTemplateBody, isEvtEditor); + } + + lstEvent.EditVisibility = false; + if (isEvtEditor) + { + lstEvent.EditVisibility = true; + editButtonVisible = true; + } + + colEvents.Add(lstEvent); + } + } + + //Determine which fields get displayed + if (!IsPrivateNotModerator) + { + if (Settings.EventsListFields.LastIndexOf("EB", StringComparison.Ordinal) < 0 || editButtonVisible == false) + { + lstEvents.Columns[0].Visible = false; + } + else + { + lstEvents.Columns[0].Visible = true; + } + if (Settings.EventsListFields.LastIndexOf("BD", StringComparison.Ordinal) < 0) + { + lstEvents.Columns[1].Visible = false; + } + if (Settings.EventsListFields.LastIndexOf("ED", StringComparison.Ordinal) < 0) + { + lstEvents.Columns[2].Visible = false; + } + if (Settings.EventsListFields.LastIndexOf("EN", StringComparison.Ordinal) < 0) + { + lstEvents.Columns[3].Visible = false; + } + if (Settings.EventsListFields.LastIndexOf("IM", StringComparison.Ordinal) < 0) + { + lstEvents.Columns[4].Visible = false; + } + if (Settings.EventsListFields.LastIndexOf("DU", StringComparison.Ordinal) < 0) + { + lstEvents.Columns[5].Visible = false; + } + if (Settings.EventsListFields.LastIndexOf("CA", StringComparison.Ordinal) < 0) + { + lstEvents.Columns[6].Visible = false; + } + if (Settings.EventsListFields.LastIndexOf("LO", StringComparison.Ordinal) < 0) + { + lstEvents.Columns[7].Visible = false; + } + if (!Settings.EventsCustomField1 || Settings.EventsListFields.LastIndexOf("C1", StringComparison.Ordinal) < 0) + { + lstEvents.Columns[8].Visible = false; + } + if (!Settings.EventsCustomField2 || Settings.EventsListFields.LastIndexOf("C2", StringComparison.Ordinal) < 0) + { + lstEvents.Columns[9].Visible = false; + } + if (Settings.EventsListFields.LastIndexOf("DE", StringComparison.Ordinal) < 0) + { + lstEvents.Columns[10].Visible = false; + } + if (Settings.EventsListFields.LastIndexOf("RT", StringComparison.Ordinal) < 0) + { + lstEvents.Columns[11].Visible = false; + } + if (Settings.EventsListFields.LastIndexOf("RU", StringComparison.Ordinal) < 0) + { + lstEvents.Columns[12].Visible = false; + } + } + else + { + // Set Defaults + lstEvents.Columns[0].Visible = false; // Edit Buttom + lstEvents.Columns[1].Visible = true; // Begin Date + lstEvents.Columns[2].Visible = true; // End Date + lstEvents.Columns[3].Visible = true; // Title + lstEvents.Columns[4].Visible = false; // Image + lstEvents.Columns[5].Visible = false; // Duration + lstEvents.Columns[6].Visible = false; // Category + lstEvents.Columns[7].Visible = false; // Location + lstEvents.Columns[8].Visible = false; // Custom Field 1 + lstEvents.Columns[9].Visible = false; // Custom Field 2 + lstEvents.Columns[10].Visible = false; // Description + lstEvents.Columns[11].Visible = false; // Recurrence Pattern + lstEvents.Columns[12].Visible = false; // Recur Until + } + + lstEvents.DataSource = colEvents; + lstEvents.DataBind(); + } + #endregion + + #region Control Events + protected void lstEvents_ItemDataBound(object sender, DataGridItemEventArgs e) + { + if (e.Item.ItemType == ListItemType.Item | e.Item.ItemType == ListItemType.AlternatingItem) + { + HyperLink lnkevent = (HyperLink)(e.Item.FindControl("lnkEvent")); + if (Settings.Eventtooltipday) + { + string tooltip = System.Convert.ToString(DataBinder.Eval(e.Item.DataItem, "Tooltip")); + e.Item.Attributes.Add("title", tooltip); + toolTipManager.TargetControls.Add(e.Item.ClientID, true); + } + Color backColor = (Color)(DataBinder.Eval(e.Item.DataItem, "CategoryColor")); + if (backColor.Name != "0") + { + for (int i = 0; i <= e.Item.Cells.Count - 1; i++) + { + if (e.Item.Cells[i].Visible && !(lstEvents.Columns[i].SortExpression == "Description")) + { + e.Item.Cells[i].BackColor = backColor; + } + } + } + if (IsPrivateNotModerator && !(UserId == System.Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "OwnerID")))) + { + lnkevent.Style.Add("cursor", "text"); + lnkevent.Style.Add("text-decoration", "none"); + lnkevent.Attributes.Add("onclick", "javascript:return false;"); + } + } + } + + protected void lstEvents_ItemCommand(object source, DataGridCommandEventArgs e) + { + try + { + switch (e.CommandName) + { + case "Edit": + //set selected row editable + int iItemID = System.Convert.ToInt32(e.CommandArgument); + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + Response.Redirect(objEventInfoHelper.GetEditURL(iItemID, GetUrlGroupId(), GetUrlUserId())); + break; + } + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + + protected void SelectCategory_CategorySelected(object sender, CommandEventArgs e) + { + //Store the other selection(s) too. + SelectLocation.StoreLocations(); + BindDataGrid(); + } + protected void SelectLocation_LocationSelected(object sender, CommandEventArgs e) + { + //Store the other selection(s) too. + SelectCategory.StoreCategories(); + BindDataGrid(); + } + + protected void returnButton_Click(System.Object sender, EventArgs e) + { + Response.Redirect(GetSocialNavigateUrl(), true); + } + #endregion + + #region Web Form Designer Generated Code + + //This call is required by the Web Form Designer. + [DebuggerStepThrough()] + private void InitializeComponent() + { + + } + + private void Page_Init(System.Object sender, EventArgs e) + { + //CODEGEN: This method call is required by the Web Form Designer + //Do not modify it using the code editor. + InitializeComponent(); + } + + #endregion + + } + +} + + diff --git a/EventDay.ascx.designer.cs b/EventDay.ascx.designer.cs new file mode 100644 index 0000000..c4de9da --- /dev/null +++ b/EventDay.ascx.designer.cs @@ -0,0 +1,105 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DotNetNuke.Modules.Events { + + + public partial class EventDay { + + /// + /// toolTipManager control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Web.UI.WebControls.DnnToolTipManager toolTipManager; + + /// + /// pnlEventsModuleDay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlEventsModuleDay; + + /// + /// SelectCategory control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.SelectCategory SelectCategory; + + /// + /// SelectLocation control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.SelectLocation SelectLocation; + + /// + /// EventIcons control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.EventIcons EventIcons; + + /// + /// lstEvents control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DataGrid lstEvents; + + /// + /// divMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divMessage; + + /// + /// lblMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMessage; + + /// + /// EventIcons2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.EventIcons EventIcons2; + + /// + /// returnButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton returnButton; + } +} diff --git a/EventDay.ascx.designer.vb b/EventDay.ascx.designer.vb deleted file mode 100644 index a0fc20f..0000000 --- a/EventDay.ascx.designer.vb +++ /dev/null @@ -1,107 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Namespace DotNetNuke.Modules.Events - - Partial Public Class EventDay - - ''' - '''toolTipManager control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents toolTipManager As Global.DotNetNuke.Web.UI.WebControls.DnnToolTipManager - - ''' - '''pnlEventsModuleDay control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlEventsModuleDay As Global.System.Web.UI.WebControls.Panel - - ''' - '''SelectCategory control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents SelectCategory As Global.DotNetNuke.Modules.Events.SelectCategory - - ''' - '''SelectLocation control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents SelectLocation As Global.DotNetNuke.Modules.Events.SelectLocation - - ''' - '''EventIcons control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents EventIcons As Global.DotNetNuke.Modules.Events.EventIcons - - ''' - '''lstEvents control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lstEvents As Global.System.Web.UI.WebControls.DataGrid - - ''' - '''divMessage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divMessage As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblMessage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblMessage As Global.System.Web.UI.WebControls.Label - - ''' - '''EventIcons2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents EventIcons2 As Global.DotNetNuke.Modules.Events.EventIcons - - ''' - '''returnButton control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents returnButton As Global.System.Web.UI.WebControls.LinkButton - End Class -End Namespace diff --git a/EventDay.ascx.vb b/EventDay.ascx.vb deleted file mode 100644 index 5f8ef62..0000000 --- a/EventDay.ascx.vb +++ /dev/null @@ -1,348 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports System -Imports System.Web.UI -Imports System.Web.UI.WebControls -Imports System.Globalization - -Namespace DotNetNuke.Modules.Events - - _ - Partial Class EventDay - Inherits EventBase - -#Region "Event Handlers" - Private _selectedEvents As ArrayList - - Private Sub Page_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load - Try - SetupViewControls(EventIcons, EventIcons2, SelectCategory, SelectLocation) - - If Settings.Eventdaynewpage Then - SetTheme(pnlEventsModuleDay) - AddFacebookMetaTags() - End If - - 'Show header - or not - If Settings.EventsListShowHeader = "Yes" Then - lstEvents.ShowHeader = True - Else - lstEvents.ShowHeader = False - End If - - If Page.IsPostBack = False Then - If Settings.EventsListShowHeader <> "No" Then - lstEvents.ShowHeader = True - Localization.LocalizeDataGrid(lstEvents, LocalResourceFile) - End If - BindDataGrid() - End If - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub -#End Region - -#Region "Helper Functions" - Private Sub BindDataGrid() - Dim culture As CultureInfo = Threading.Thread.CurrentThread.CurrentCulture - Dim startDate As DateTime ' Start View Date Events Range - Dim endDate As DateTime ' End View Date Events Range - Dim objEvent As EventInfo - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - Dim editButtonVisible As Boolean = False - - ' Set Date Range - Dim dDate As Date = SelectedDate.Date - startDate = dDate.AddDays(-1) - endDate = dDate.AddDays(1) - - ' Get Events/Sub-Calendar Events - Dim getSubEvents As Boolean = Settings.MasterEvent - _selectedEvents = objEventInfoHelper.GetEvents(startDate, endDate, getSubEvents, SelectCategory.SelectedCategory, SelectLocation.SelectedLocation, GetUrlGroupId, GetUrlUserId) - - _selectedEvents = objEventInfoHelper.ConvertEventListToDisplayTimeZone(_selectedEvents, GetDisplayTimeZoneId()) - - If _selectedEvents.Count = 0 Then - lstEvents.Visible = False - divMessage.Visible = True - Exit Sub - Else - lstEvents.Visible = True - divMessage.Visible = False - End If - - ' Get Date Events (used for Multiday event) - Dim dayEvents As ArrayList - dayEvents = objEventInfoHelper.GetDateEvents(_selectedEvents, dDate) - - Dim fmtEventTimeBegin As String = Settings.Templates.txtDayEventTimeBegin - If fmtEventTimeBegin = "" Then fmtEventTimeBegin = "g" - - Dim fmtEventTimeEnd As String = Settings.Templates.txtDayEventTimeEnd - If fmtEventTimeEnd = "" Then fmtEventTimeEnd = "g" - - Dim tmpDayDescription As String = Settings.Templates.txtDayEventDescription - Dim tmpDayLocation As String = Settings.Templates.txtDayLocation - - If Settings.Eventtooltipday Then - toolTipManager.TargetControls.Clear() - End If - - Dim colEvents As New ArrayList - Dim lstEvent As EventListObject - For Each objEvent In dayEvents - ' If full enrollments should be hidden, ignore - If HideFullEvent(objEvent) Then - Continue For - End If - - Dim blAddEvent As Boolean = True - If Settings.Collapserecurring Then - For Each lstEvent In colEvents - If lstEvent.RecurMasterID = objEvent.RecurMasterID Then - blAddEvent = False - End If - Next - End If - If blAddEvent Then - Dim objCtlEventRecurMaster As New EventRecurMasterController - Dim tcc As New TokenReplaceControllerClass(ModuleId, LocalResourceFile) - Dim fmtRowEnd, fmtRowBegin As String - fmtRowEnd = tcc.TokenParameters(fmtEventTimeEnd, objEvent, Settings) - fmtRowBegin = tcc.TokenParameters(fmtEventTimeBegin, objEvent, Settings) - - lstEvent = New EventListObject - lstEvent.EventID = objEvent.EventID - lstEvent.CreatedByID = objEvent.CreatedByID - lstEvent.OwnerID = objEvent.OwnerID - lstEvent.EventDateBegin = objEvent.EventTimeBegin - lstEvent.EventDateEnd = objEvent.EventTimeEnd - If objEvent.DisplayEndDate Then - lstEvent.TxtEventDateEnd = String.Format("{0:" + fmtRowEnd + "}", lstEvent.EventDateEnd) - Else - lstEvent.TxtEventDateEnd = "" - End If - lstEvent.EventTimeBegin = objEvent.EventTimeBegin - lstEvent.TxtEventTimeBegin = String.Format("{0:" + fmtRowBegin + "}", lstEvent.EventTimeBegin) - lstEvent.Duration = objEvent.Duration - - Dim isEvtEditor As Boolean = IsEventEditor(objEvent, False) - - Dim templatedescr As String = "" - Dim iconString As String = "" - - If Not IsPrivateNotModerator Or UserId = objEvent.OwnerID Then - templatedescr = tcc.TokenReplaceEvent(objEvent, tmpDayDescription, Nothing, False, isEvtEditor) - lstEvent.CategoryColor = GetColor(objEvent.Color) - lstEvent.CategoryFontColor = GetColor(objEvent.FontColor) - - iconString = CreateIconString(objEvent, Settings.IconListPrio, Settings.IconListRec, Settings.IconListReminder, Settings.IconListEnroll) - End If - - lstEvent.EventName = CreateEventName(objEvent, "[event:title]") - lstEvent.EventDesc = objEvent.EventDesc - ' RWJS - not sure why replace ' with \' - lstEvent.DecodedDesc = System.Web.HttpUtility.HtmlDecode(objEvent.EventDesc).Replace(Environment.NewLine, "").Trim.Replace("'", "\'") - lstEvent.DecodedDesc = HttpUtility.HtmlDecode(templatedescr).Replace(Environment.NewLine, "") - lstEvent.EventID = objEvent.EventID - lstEvent.ModuleID = objEvent.ModuleID - - Dim objEventRRULE As EventRRULEInfo - objEventRRULE = objCtlEventRecurMaster.DecomposeRRULE(objEvent.RRULE, objEvent.EventTimeBegin) - lstEvent.RecurText = objCtlEventRecurMaster.RecurrenceText(objEventRRULE, LocalResourceFile, culture, objEvent.EventTimeBegin) - If objEvent.RRULE <> "" Then - lstEvent.RecurUntil = objEvent.LastRecurrence.ToShortDateString - Else - lstEvent.RecurUntil = "" - End If - lstEvent.EventID = objEvent.EventID - lstEvent.ModuleID = objEvent.ModuleID - - lstEvent.ImageURL = "" - If Settings.Eventimage And objEvent.ImageURL <> Nothing And objEvent.ImageDisplay = True Then - lstEvent.ImageURL = ImageInfo(objEvent.ImageURL, objEvent.ImageHeight, objEvent.ImageWidth) - End If - - ' Get detail page url - lstEvent.URL = objEventInfoHelper.DetailPageURL(objEvent) - If objEvent.DetailPage And objEvent.DetailNewWin Then - lstEvent.Target = "_blank" - End If - - lstEvent.Icons = iconString - lstEvent.DisplayDuration = CType(Int(objEvent.Duration / 1440 + 1), Integer) - lstEvent.CategoryName = objEvent.CategoryName - lstEvent.LocationName = tcc.TokenReplaceEvent(objEvent, tmpDayLocation) - lstEvent.CustomField1 = objEvent.CustomField1 - lstEvent.CustomField2 = objEvent.CustomField2 - lstEvent.RecurMasterID = objEvent.RecurMasterID - - If Settings.Eventtooltipday Then - lstEvent.Tooltip = ToolTipCreate(objEvent, Settings.Templates.txtTooltipTemplateTitle, Settings.Templates.txtTooltipTemplateBody, isEvtEditor) - End If - - lstEvent.EditVisibility = False - If isEvtEditor Then - lstEvent.EditVisibility = True - editButtonVisible = True - End If - - colEvents.Add(lstEvent) - End If - Next - - 'Determine which fields get displayed - If Not IsPrivateNotModerator Then - If Settings.EventsListFields.LastIndexOf("EB", StringComparison.Ordinal) < 0 Or editButtonVisible = False Then - lstEvents.Columns.Item(0).Visible = False - Else - lstEvents.Columns.Item(0).Visible = True - End If - If Settings.EventsListFields.LastIndexOf("BD", StringComparison.Ordinal) < 0 Then - lstEvents.Columns.Item(1).Visible = False - End If - If Settings.EventsListFields.LastIndexOf("ED", StringComparison.Ordinal) < 0 Then - lstEvents.Columns.Item(2).Visible = False - End If - If Settings.EventsListFields.LastIndexOf("EN", StringComparison.Ordinal) < 0 Then - lstEvents.Columns.Item(3).Visible = False - End If - If Settings.EventsListFields.LastIndexOf("IM", StringComparison.Ordinal) < 0 Then - lstEvents.Columns.Item(4).Visible = False - End If - If Settings.EventsListFields.LastIndexOf("DU", StringComparison.Ordinal) < 0 Then - lstEvents.Columns.Item(5).Visible = False - End If - If Settings.EventsListFields.LastIndexOf("CA", StringComparison.Ordinal) < 0 Then - lstEvents.Columns.Item(6).Visible = False - End If - If Settings.EventsListFields.LastIndexOf("LO", StringComparison.Ordinal) < 0 Then - lstEvents.Columns.Item(7).Visible = False - End If - If Not Settings.EventsCustomField1 Or Settings.EventsListFields.LastIndexOf("C1", StringComparison.Ordinal) < 0 Then - lstEvents.Columns.Item(8).Visible = False - End If - If Not Settings.EventsCustomField2 Or Settings.EventsListFields.LastIndexOf("C2", StringComparison.Ordinal) < 0 Then - lstEvents.Columns.Item(9).Visible = False - End If - If Settings.EventsListFields.LastIndexOf("DE", StringComparison.Ordinal) < 0 Then - lstEvents.Columns.Item(10).Visible = False - End If - If Settings.EventsListFields.LastIndexOf("RT", StringComparison.Ordinal) < 0 Then - lstEvents.Columns.Item(11).Visible = False - End If - If Settings.EventsListFields.LastIndexOf("RU", StringComparison.Ordinal) < 0 Then - lstEvents.Columns.Item(12).Visible = False - End If - Else - ' Set Defaults - lstEvents.Columns.Item(0).Visible = False ' Edit Buttom - lstEvents.Columns.Item(1).Visible = True ' Begin Date - lstEvents.Columns.Item(2).Visible = True ' End Date - lstEvents.Columns.Item(3).Visible = True ' Title - lstEvents.Columns.Item(4).Visible = False ' Image - lstEvents.Columns.Item(5).Visible = False ' Duration - lstEvents.Columns.Item(6).Visible = False ' Category - lstEvents.Columns.Item(7).Visible = False ' Location - lstEvents.Columns.Item(8).Visible = False ' Custom Field 1 - lstEvents.Columns.Item(9).Visible = False ' Custom Field 2 - lstEvents.Columns.Item(10).Visible = False ' Description - lstEvents.Columns.Item(11).Visible = False ' Recurrence Pattern - lstEvents.Columns.Item(12).Visible = False ' Recur Until - End If - - lstEvents.DataSource = colEvents - lstEvents.DataBind() - End Sub -#End Region - -#Region "Control Events" - Private Sub lstEvents_ItemDataBound(ByVal sender As Object, ByVal e As DataGridItemEventArgs) Handles lstEvents.ItemDataBound - If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then - Dim lnkevent As HyperLink = CType(e.Item.FindControl("lnkEvent"), HyperLink) - If Settings.Eventtooltipday Then - Dim tooltip As String = CType(DataBinder.Eval(e.Item.DataItem, "Tooltip"), String) - e.Item.Attributes.Add("title", tooltip) - toolTipManager.TargetControls.Add(e.Item.ClientID, True) - End If - Dim backColor As Color = CType(DataBinder.Eval(e.Item.DataItem, "CategoryColor"), Color) - If backColor.Name <> "0" Then - For i As Integer = 0 To e.Item.Cells.Count - 1 - If e.Item.Cells(i).Visible And Not lstEvents.Columns(i).SortExpression = "Description" Then - e.Item.Cells(i).BackColor = backColor - End If - Next - End If - If IsPrivateNotModerator And Not UserId = CType(DataBinder.Eval(e.Item.DataItem, "OwnerID"), Integer) Then - lnkevent.Style.Add("cursor", "text") - lnkevent.Style.Add("text-decoration", "none") - lnkevent.Attributes.Add("onclick", "javascript:return false;") - End If - End If - End Sub - - Private Sub lstEvents_ItemCommand(ByVal source As Object, ByVal e As DataGridCommandEventArgs) Handles lstEvents.ItemCommand - Try - Select Case e.CommandName - Case "Edit" - 'set selected row editable - Dim iItemID As Integer = CType(e.CommandArgument, Integer) - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - Response.Redirect(objEventInfoHelper.GetEditURL(iItemID, GetUrlGroupId, GetUrlUserId)) - End Select - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub - - Private Sub SelectCategory_CategorySelected(ByVal sender As Object, ByVal e As CommandEventArgs) Handles SelectCategory.CategorySelectedChanged - 'Store the other selection(s) too. - SelectLocation.StoreLocations() - BindDataGrid() - End Sub - Private Sub SelectLocation_LocationSelected(ByVal sender As Object, ByVal e As CommandEventArgs) Handles SelectLocation.LocationSelectedChanged - 'Store the other selection(s) too. - SelectCategory.StoreCategories() - BindDataGrid() - End Sub - - Private Sub returnButton_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles returnButton.Click - Response.Redirect(GetSocialNavigateUrl(), True) - End Sub -#End Region - -#Region " Web Form Designer Generated Code " - - 'This call is required by the Web Form Designer. - Private Sub InitializeComponent() - - End Sub - - Private Sub Page_Init(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Init - 'CODEGEN: This method call is required by the Web Form Designer - 'Do not modify it using the code editor. - InitializeComponent() - End Sub - -#End Region - - End Class - -End Namespace diff --git a/EventDetails.ascx b/EventDetails.ascx index 05c83b7..81a65ab 100644 --- a/EventDetails.ascx +++ b/EventDetails.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="EventDetails.ascx.vb" Inherits="DotNetNuke.Modules.Events.EventDetails" %> +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EventDetails.ascx.cs" Inherits="DotNetNuke.Modules.Events.EventDetails" %>
@@ -10,7 +10,7 @@
  Notify Me for this Event @
+ resourcekey="cmdNotify" ValidationGroup="EventEmail" OnClick="cmdNotify_Click">Notify Me for this Event @

@@ -43,7 +43,7 @@
  + resourcekey="cmdEmail" ValidationGroup="EventEmailiCal" OnClick="cmdEmail_Click">
@@ -61,7 +61,7 @@
  Enroll for this Event? + ValidationGroup="EventSignup" OnClick="cmdSignup_Click">Enroll for this Event?
  @@ -143,18 +143,19 @@
- +
    -
  • +
  • -
  • -
  • -
  • -
  • -
  • +
  • +
  • +
  • +
  • +
+ diff --git a/EventDetails.ascx.cs b/EventDetails.ascx.cs new file mode 100644 index 0000000..a37614e --- /dev/null +++ b/EventDetails.ascx.cs @@ -0,0 +1,1605 @@ +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using DotNetNuke.Entities.Users; +using DotNetNuke.Framework; +using System.Collections; +using DotNetNuke.Common.Utilities; +using System.Web; +using DotNetNuke.Services.Localization; +using System; +using DotNetNuke.Security; +using System.Xml; +using System.Xml.Linq; +using System.Collections.Generic; +using System.Text; +using System.Xml.XPath; +using System.Xml.Xsl; +using System.IO; +using DotNetNuke.Entities.Profile; +using System.Linq; + + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events +{ + [DNNtc.ModuleControlProperties("Details", "Events Details", DNNtc.ControlType.View, "https://dnnevents.codeplex.com/documentation", true, false)] + public partial class EventDetails : EventBase + { + + #region Web Form Designer Generated Code + //This call is required by the Web Form Designer. + [DebuggerStepThrough()] + private void InitializeComponent() + { + } + + private void Page_Init(System.Object sender, EventArgs e) + { + //CODEGEN: This method call is required by the Web Form Designer + //Do not modify it using the code editor. + InitializeComponent(); + } + #endregion + + #region Properties + /// + /// Stores the ItemId in the viewstate + /// + private int ItemId + { + get + { + return System.Convert.ToInt32(ViewState["EventItemID" + ModuleId.ToString()]); + } + set + { + ViewState["EventItemID" + ModuleId.ToString()] = value.ToString(); + } + } + private EventInfo _eventInfo = new EventInfo(); + + private enum MessageLevel : int + { + DNNSuccess = 1, + DNNInformation, + DNNWarning, + DNNError + } + + #endregion + + #region Event Handlers + private void Page_Load(System.Object sender, EventArgs e) + { + // Log exception whem status is filled + if (!(Request.Params["status"] == null)) + { + PortalSecurity objSecurity = new PortalSecurity(); + string status = objSecurity.InputFilter(Request.Params["status"], (DotNetNuke.Security.PortalSecurity.FilterFlag)((int)(PortalSecurity.FilterFlag.NoScripting) | (int)PortalSecurity.FilterFlag.NoMarkup)); + Exceptions.LogException(new ModuleLoadException("EventDetails Call...status: " + status)); + } + + // Add the external Validation.js to the Page + const string csname = "ExtValidationScriptFile"; + Type cstype = System.Reflection.MethodBase.GetCurrentMethod().GetType(); + string cstext = ""; + if (!Page.ClientScript.IsClientScriptBlockRegistered(csname)) + { + Page.ClientScript.RegisterClientScriptBlock(cstype, csname, cstext, false); + } + + // Force full PostBack since these pass off to aspx page + if (AJAX.IsInstalled()) + { + AJAX.RegisterPostBackControl(cmdvEvent); + AJAX.RegisterPostBackControl(cmdvEventSeries); + AJAX.RegisterPostBackControl(cmdvEventSignups); + } + + cmdvEvent.ToolTip = Localization.GetString("cmdvEventTooltip", LocalResourceFile); + cmdvEvent.Text = Localization.GetString("cmdvEventExport", LocalResourceFile); + cmdvEventSeries.ToolTip = Localization.GetString("cmdvEventSeriesTooltip", LocalResourceFile); + cmdvEventSeries.Text = Localization.GetString("cmdvEventExportSeries", LocalResourceFile); + cmdvEventSignups.ToolTip = Localization.GetString("cmdvEventSignupsTooltip", LocalResourceFile); + cmdvEventSignups.Text = Localization.GetString("cmdvEventSignupsDownload", LocalResourceFile); + + cmdPrint.ToolTip = Localization.GetString("Print", LocalResourceFile); + + try + { + //Get the item id of the selected event + if (!(ReferenceEquals(Request.Params["ItemId"], null))) + { + ItemId = int.Parse(Request.Params["ItemId"]); + } + else + { + Response.Redirect(GetSocialNavigateUrl(), true); + } + + // Set the selected theme + if (Settings.Eventdetailnewpage) + { + SetTheme(pnlEventsModuleDetails); + AddFacebookMetaTags(); + } + + // If the page is being requested the first time, determine if an + // contact itemId value is specified, and if so populate page + // contents with the contact details + if (Page.IsPostBack) + { + return; + } + + + EventController objCtlEvent = new EventController(); + _eventInfo = objCtlEvent.EventsGet(ItemId, ModuleId); + + //If somebody has sent a bad ItemID and eventinfo not retrieved, return 301 + if (ReferenceEquals(_eventInfo, null)) + { + Response.StatusCode = 301; + Response.AppendHeader("Location", GetSocialNavigateUrl()); + return; + } + + // Do they have permissions to the event + EventInfoHelper objCtlEventInfoHelper = new EventInfoHelper(ModuleId, Settings); + if (Settings.Enforcesubcalperms && !objCtlEventInfoHelper.IsModuleViewer(_eventInfo.ModuleID)) + { + Response.Redirect(GetSocialNavigateUrl(), true); + } + else if (IsPrivateNotModerator && UserId != _eventInfo.OwnerID) + { + Response.Redirect(GetSocialNavigateUrl(), true); + } + else if (Settings.SocialGroupModule == EventModuleSettings.SocialModule.UserProfile & !objCtlEventInfoHelper.IsSocialUserPublic(GetUrlUserId())) + { + Response.Redirect(GetSocialNavigateUrl(), true); + } + else if (Settings.SocialGroupModule == EventModuleSettings.SocialModule.SocialGroup & !objCtlEventInfoHelper.IsSocialGroupPublic(GetUrlGroupId())) + { + Response.Redirect(GetSocialNavigateUrl(), true); + } + + // Has the event been cancelled + if (_eventInfo.Cancelled) + { + Response.StatusCode = 301; + Response.AppendHeader("Location", GetSocialNavigateUrl()); + return; + } + + // So we have a valid item, but is it from a module that has been deleted + // but not removed from the recycle bin + if (_eventInfo.ModuleID != ModuleId) + { + Entities.Modules.ModuleController objCtlModule = new Entities.Modules.ModuleController(); + ArrayList objModules = (ArrayList)(objCtlModule.GetModuleTabs(_eventInfo.ModuleID)); + Entities.Modules.ModuleInfo objModule = default(Entities.Modules.ModuleInfo); + bool isDeleted = true; + foreach (Entities.Modules.ModuleInfo tempLoopVar_objModule in objModules) + { + objModule = tempLoopVar_objModule; + if (!objModule.IsDeleted) + { + isDeleted = false; + } + } + if (isDeleted) + { + Response.StatusCode = 301; + Response.AppendHeader("Location", GetSocialNavigateUrl()); + return; + } + } + + // Should all be OK to display now + string displayTimeZoneId = _eventInfo.EventTimeZoneId; + if (!Settings.EnableEventTimeZones) + { + displayTimeZoneId = GetDisplayTimeZoneId(); + } + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + _eventInfo = objEventInfoHelper.ConvertEventToDisplayTimeZone(_eventInfo, displayTimeZoneId); + + TokenReplaceControllerClass tcc = new TokenReplaceControllerClass(ModuleId, LocalResourceFile); + + //Set the page title + if (Settings.EnableSEO) + { + string txtPageText = string.Format(Settings.Templates.txtSEOPageTitle, BasePage.Title); + txtPageText = tcc.TokenReplaceEvent(_eventInfo, txtPageText, false); + txtPageText = HttpUtility.HtmlDecode(txtPageText); + txtPageText = HtmlUtils.StripTags(txtPageText, true); + txtPageText = txtPageText.Replace(Environment.NewLine, " "); + txtPageText = HtmlUtils.StripWhiteSpace(txtPageText, true); + BasePage.Title = txtPageText; + txtPageText = string.Format(Settings.Templates.txtSEOPageDescription, BasePage.Description); + txtPageText = tcc.TokenReplaceEvent(_eventInfo, txtPageText, false); + txtPageText = HttpUtility.HtmlDecode(txtPageText); + txtPageText = HtmlUtils.StripTags(txtPageText, true); + txtPageText = txtPageText.Replace(Environment.NewLine, " "); + txtPageText = HtmlUtils.StripWhiteSpace(txtPageText, true); + txtPageText = HtmlUtils.Shorten(txtPageText, Settings.SEODescriptionLength, "..."); + BasePage.Description = txtPageText; + txtPageText = BasePage.KeyWords; + if (!ReferenceEquals(_eventInfo.LocationName, null)) + { + if (!string.IsNullOrEmpty(txtPageText)) + { + txtPageText = txtPageText + ","; + } + txtPageText = txtPageText + _eventInfo.LocationName; + } + if (!ReferenceEquals(_eventInfo.CategoryName, null)) + { + if (!string.IsNullOrEmpty(txtPageText)) + { + txtPageText = txtPageText + ","; + } + txtPageText = txtPageText + _eventInfo.CategoryName; + } + BasePage.KeyWords = txtPageText; + } + + //Replace tokens + string txtTemplate = ""; + string txtTemplate1 = ""; + string txtTemplate2 = ""; + string txtTemplate3 = ""; + string txtTemplate4 = ""; + txtTemplate = Settings.Templates.EventDetailsTemplate; + txtTemplate1 = txtTemplate; + txtTemplate2 = ""; + txtTemplate3 = ""; + txtTemplate4 = ""; + int nTemplate = 0; + while (txtTemplate.IndexOf("[BREAK]") + 1 > 0) + { + nTemplate++; + string txtBefore = ""; + int nBreak = txtTemplate.IndexOf("[BREAK]") + 1; + if (nBreak > 1) + { + txtBefore = txtTemplate.Substring(0, nBreak - 1); + } + else + { + txtBefore = ""; + } + if (txtTemplate.Length > nBreak + 6) + { + txtTemplate = txtTemplate.Substring(nBreak + 7 - 1); + } + else + { + txtTemplate = ""; + } + switch (nTemplate) + { + case 1: + txtTemplate1 = txtBefore; + txtTemplate2 = txtTemplate; + break; + case 2: + txtTemplate2 = txtBefore; + txtTemplate3 = txtTemplate; + break; + case 3: + txtTemplate3 = txtBefore; + txtTemplate4 = txtTemplate; + break; + case 4: + txtTemplate4 = txtBefore; + break; + } + } + if (!string.IsNullOrEmpty(txtTemplate1) && txtTemplate1 != "\r\n") + { + divEventDetails1.InnerHtml = tcc.TokenReplaceEvent(_eventInfo, txtTemplate1); + divEventDetails1.Attributes.Add("style", "display:block;"); + } + else + { + divEventDetails1.Attributes.Add("style", "display:none;"); + } + if (!string.IsNullOrEmpty(txtTemplate2) && txtTemplate2 != "\r\n") + { + divEventDetails2.InnerHtml = tcc.TokenReplaceEvent(_eventInfo, txtTemplate2); + divEventDetails2.Attributes.Add("style", "display:block;"); + } + else + { + divEventDetails2.Attributes.Add("style", "display:none;"); + } + if (!string.IsNullOrEmpty(txtTemplate3) && txtTemplate3 != "\r\n") + { + divEventDetails3.InnerHtml = tcc.TokenReplaceEvent(_eventInfo, txtTemplate3); + divEventDetails3.Attributes.Add("style", "display:block;"); + } + else + { + divEventDetails3.Attributes.Add("style", "display:none;"); + } + if (!string.IsNullOrEmpty(txtTemplate4) && txtTemplate4 != "\r\n") + { + divEventDetails4.InnerHtml = tcc.TokenReplaceEvent(_eventInfo, txtTemplate4); + divEventDetails4.Attributes.Add("style", "display:block;"); + } + else + { + divEventDetails4.Attributes.Add("style", "display:none;"); + } + + editButton.Visible = false; + deleteButton.Visible = false; + cmdvEventSignups.Visible = false; + if (IsEventEditor(_eventInfo, false)) + { + editButton.Visible = true; + editButton.NavigateUrl = objEventInfoHelper.GetEditURL(_eventInfo.EventID, _eventInfo.SocialGroupId, _eventInfo.SocialUserId); + editButton.ToolTip = Localization.GetString("editButton", LocalResourceFile); + deleteButton.Visible = true; + deleteButton.Attributes.Add("onclick", "javascript:return confirm('" + Localization.GetString("ConfirmEventDelete", LocalResourceFile) + "');"); + cmdvEventSignups.Visible = true; + } + editSeriesButton.Visible = false; + deleteSeriesButton.Visible = false; + if (_eventInfo.RRULE != "") + { + // Note that IsEventEditor with 'True' is used here because this is for the + // series(buttons)and excludes single event owner. Must be recurrence master owner. + if (IsEventEditor(_eventInfo, true)) + { + editSeriesButton.Visible = true; + editSeriesButton.NavigateUrl = objEventInfoHelper.GetEditURL(_eventInfo.EventID, _eventInfo.SocialGroupId, _eventInfo.SocialUserId, "All"); + editSeriesButton.ToolTip = Localization.GetString("editSeriesButton", LocalResourceFile); + deleteSeriesButton.Visible = true; + deleteSeriesButton.Attributes.Add("onclick", "javascript:return confirm('" + Localization.GetString("ConfirmEventSeriesDelete", LocalResourceFile) + "');"); + } + } + if (_eventInfo.RRULE == "") + { + cmdvEventSeries.Visible = false; + } + + EventTimeZoneUtilities objEventTimeZoneUtilities = new EventTimeZoneUtilities(); + DateTime nowDisplay = objEventTimeZoneUtilities.ConvertFromUTCToDisplayTimeZone(DateTime.UtcNow, GetDisplayTimeZoneId()).EventDate; + + // Compute Dates/Times (for recurring) + DateTime startdate = _eventInfo.EventTimeBegin; + SelectedDate = startdate.Date; + + // See if user already are signed up + // And that Signup is Authorized + // And also that the Date/Time has not passed + divEnrollment.Attributes.Add("style", "display:none;"); + if (_eventInfo.Signups) + { + if (startdate > nowDisplay) + { + if (_eventInfo.EnrollRoleID == null || _eventInfo.EnrollRoleID == -1) + { + UserEnrollment(_eventInfo); + } + else + { + EventSignupsController objEventSignupsController = new EventSignupsController(); + if (objEventSignupsController.IsEnrollRole(_eventInfo.EnrollRoleID, PortalId)) + { + UserEnrollment(_eventInfo); + } + } + } + else + { + divEnrollment.Attributes.Add("style", "display:block;"); + lblEnrollTooLate.Text = Localization.GetString("EnrollTooLate", LocalResourceFile); + enroll4.Visible = true; + } + } + + //Are You Sure You Want To Enroll?' + if (Request.IsAuthenticated) + { + if (Settings.Enableenrollpopup) + { + cmdSignup.Attributes.Add("onclick", "javascript:return confirm('" + Localization.GetString("SureYouWantToEnroll", LocalResourceFile) + "');"); + } + valNoEnrolees.MaximumValue = Convert.ToString(_eventInfo.MaxEnrollment - _eventInfo.Enrolled); + if (int.Parse(valNoEnrolees.MaximumValue) > Settings.Maxnoenrolees | _eventInfo.MaxEnrollment == 0) + { + valNoEnrolees.MaximumValue = Settings.Maxnoenrolees.ToString(); + } + lblMaxNoEnrolees.Text = string.Format(Localization.GetString("lblMaxNoEnrolees", LocalResourceFile), valNoEnrolees.MaximumValue); + valNoEnrolees.ErrorMessage = string.Format(Localization.GetString("valNoEnrolees", LocalResourceFile), int.Parse(valNoEnrolees.MaximumValue)); + valNoEnrolees2.ErrorMessage = valNoEnrolees.ErrorMessage; + } + + divMessage.Attributes.Add("style", "display:none;"); + + if (Settings.IcalEmailEnable) + { + divIcalendar.Attributes.Add("style", "display:block;"); + txtUserEmailiCal.Text = UserInfo.Email; + if (Request.IsAuthenticated) + { + txtUserEmailiCal.Enabled = false; + } + else + { + txtUserEmailiCal.Enabled = true; + } + } + else + { + divIcalendar.Attributes.Add("style", "display:none;"); + } + + //Is notification enabled + divReminder.Attributes.Add("style", "display:none;"); + if (_eventInfo.SendReminder && startdate > nowDisplay) + { + //Is registered user + if (Request.IsAuthenticated) + { + divReminder.Attributes.Add("style", "display:block;"); + EventNotificationController objEventNotificationController = new EventNotificationController(); + string notificationInfo = objEventNotificationController.NotifyInfo(_eventInfo.EventID, UserInfo.Email, ModuleId, LocalResourceFile, GetDisplayTimeZoneId()); + if (!string.IsNullOrEmpty(notificationInfo)) + { + lblConfirmation.Text = notificationInfo; + rem3.Visible = true; + imgConfirmation.AlternateText = Localization.GetString("Reminder", LocalResourceFile); + } + else + { + txtUserEmail.Text = UserInfo.Email; + } + } + // is anonymous notification allowed or registered user not yet notified + if ((Settings.Notifyanon && !Request.IsAuthenticated) || txtUserEmail.Text.Length > 0) + { + if (Request.IsAuthenticated) + { + txtUserEmail.Enabled = false; + } + else + { + txtUserEmail.Enabled = true; + } + divReminder.Attributes.Add("style", "display:block;"); + string errorminutes = Localization.GetString("invalidReminderMinutes", LocalResourceFile); + string errorhours = Localization.GetString("invalidReminderHours", LocalResourceFile); + string errordays = Localization.GetString("invalidReminderDays", LocalResourceFile); + + txtReminderTime.Text = _eventInfo.ReminderTime.ToString(); //load default Reminder Time of event + txtReminderTime.Visible = true; + ddlReminderTimeMeasurement.Attributes.Add("onchange", "valRemTime('" + valReminderTime.ClientID + "','" + valReminderTime2.ClientID + "','" + valReminderTime.ValidationGroup + "','" + ddlReminderTimeMeasurement.ClientID + "','" + errorminutes + "','" + errorhours + "','" + errordays + "');"); + ddlReminderTimeMeasurement.Visible = true; + ddlReminderTimeMeasurement.SelectedValue = _eventInfo.ReminderTimeMeasurement; + + switch (_eventInfo.ReminderTimeMeasurement) + { + case "m": + valReminderTime.ErrorMessage = errorminutes; + valReminderTime.MinimumValue = "15"; + valReminderTime.MaximumValue = "60"; + break; + case "h": + valReminderTime.ErrorMessage = errorhours; + valReminderTime.MinimumValue = "1"; + valReminderTime.MaximumValue = "24"; + break; + case "d": + valReminderTime.ErrorMessage = errordays; + valReminderTime.MinimumValue = "1"; + valReminderTime.MaximumValue = "30"; + break; + } + valReminderTime2.ErrorMessage = valReminderTime.ErrorMessage; + + rem1.Visible = true; + imgNotify.AlternateText = Localization.GetString("Reminder", LocalResourceFile); + rem2.Visible = true; + if (_eventInfo.RRULE != "") + { + chkReminderRec.Visible = true; + } + } + } + grdEnrollment.Columns[0].HeaderText = Localization.GetString("EnrollUserName", LocalResourceFile); + grdEnrollment.Columns[1].HeaderText = Localization.GetString("EnrollDisplayName", LocalResourceFile); + grdEnrollment.Columns[2].HeaderText = Localization.GetString("EnrollEmail", LocalResourceFile); + grdEnrollment.Columns[3].HeaderText = Localization.GetString("EnrollPhone", LocalResourceFile); + grdEnrollment.Columns[4].HeaderText = Localization.GetString("EnrollApproved", LocalResourceFile); + grdEnrollment.Columns[5].HeaderText = Localization.GetString("EnrollNo", LocalResourceFile); + + BindEnrollList(_eventInfo); + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + #endregion + + #region Helper Methods + /// + /// Bind enrolled users to the enrollment grid + /// + private void BindEnrollList(EventInfo eventInfo) + { + divEnrollList.Attributes.Add("style", "display:none;"); + bool blEnrollList = false; + string txtColumns = ""; + if (eventInfo.Signups && eventInfo.Enrolled > 0) + { + txtColumns = EnrolmentColumns(eventInfo, eventInfo.EnrollListView); + } + if (!string.IsNullOrEmpty(txtColumns)) + { + blEnrollList = true; + } + + if (blEnrollList) + { + if (txtColumns.LastIndexOf("UserName", StringComparison.Ordinal) < 0) + { + grdEnrollment.Columns[0].Visible = false; + } + if (txtColumns.LastIndexOf("DisplayName", StringComparison.Ordinal) < 0) + { + grdEnrollment.Columns[1].Visible = false; + } + if (txtColumns.LastIndexOf("Email", StringComparison.Ordinal) < 0) + { + grdEnrollment.Columns[2].Visible = false; + } + if (txtColumns.LastIndexOf("Phone", StringComparison.Ordinal) < 0) + { + grdEnrollment.Columns[3].Visible = false; + } + if (txtColumns.LastIndexOf("Approved", StringComparison.Ordinal) < 0) + { + grdEnrollment.Columns[4].Visible = false; + } + if (txtColumns.LastIndexOf("Qty", StringComparison.Ordinal) < 0) + { + grdEnrollment.Columns[5].Visible = false; + } + + //Load enrol list + ArrayList eventEnrollment = new ArrayList(); + ArrayList objSignups = default(ArrayList); + EventSignupsInfo objSignup = default(EventSignupsInfo); + UserController objCtlUser = new UserController(); + EventSignupsController objCtlEventSignups = new EventSignupsController(); + objSignups = objCtlEventSignups.EventsSignupsGetEvent(eventInfo.EventID, ModuleId); + foreach (EventSignupsInfo tempLoopVar_objSignup in objSignups) + { + objSignup = tempLoopVar_objSignup; + EventEnrollList objEnrollListItem = new EventEnrollList(); + if (objSignup.UserID != -1) + { + UserInfo objUser = default(UserInfo); + objUser = objCtlUser.GetUser(PortalId, objSignup.UserID); + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + objEnrollListItem.EnrollDisplayName = objEventInfoHelper.UserDisplayNameProfile(objSignup.UserID, objSignup.UserName, LocalResourceFile).DisplayNameURL; + if (!ReferenceEquals(objUser, null)) + { + objEnrollListItem.EnrollUserName = objUser.Username; + objEnrollListItem.EnrollEmail = string.Format("{0}", objSignup.Email, eventInfo.EventName); + objEnrollListItem.EnrollPhone = objUser.Profile.Telephone; + } + } + else + { + objEnrollListItem.EnrollDisplayName = objSignup.AnonName; + objEnrollListItem.EnrollUserName = Localization.GetString("AnonUser", LocalResourceFile); + objEnrollListItem.EnrollEmail = string.Format("{0}", objSignup.AnonEmail, eventInfo.EventName); + objEnrollListItem.EnrollPhone = objSignup.AnonTelephone; + } + objEnrollListItem.SignupID = objSignup.SignupID; + objEnrollListItem.EnrollApproved = objSignup.Approved; + objEnrollListItem.EnrollNo = objSignup.NoEnrolees; + eventEnrollment.Add(objEnrollListItem); + } + if (eventEnrollment.Count > 0) + { + divEnrollList.Attributes.Add("style", "display:block;"); + grdEnrollment.DataSource = eventEnrollment; + grdEnrollment.DataBind(); + } + } + } + + /// + /// Display User Enrollment Info on Page + /// + private MessageLevel UserEnrollment(EventInfo eventInfo) + { + MessageLevel returnValue = default(MessageLevel); + returnValue = MessageLevel.DNNSuccess; + if (!Settings.Eventsignup) + { + divEnrollment.Attributes.Add("style", "display:none;"); + return returnValue; + } + + divEnrollment.Attributes.Add("style", "display:block;"); + enroll3.Visible = false; + enroll5.Visible = false; + if (!ReferenceEquals(Request.Params["Status"], null)) + { + if (Request.Params["Status"].ToLower() == "enrolled") + { + // User has been successfully enrolled for this event (paid enrollment) + lblSignup.Text = Localization.GetString("StatusPPSuccess", LocalResourceFile); + enroll2.Visible = true; + imgSignup.AlternateText = Localization.GetString("StatusPPSuccess", LocalResourceFile); + } + else if (Request.Params["Status"].ToLower() == "cancelled") + { + // User has been cancelled paid enrollment + lblSignup.Text = Localization.GetString("StatusPPCancelled", LocalResourceFile); + returnValue = MessageLevel.DNNInformation; + enroll2.Visible = true; + imgSignup.AlternateText = Localization.GetString("StatusPPCancelled", LocalResourceFile); + } + return returnValue; + } + + // If not authenticated and anonymous not allowed setup for logintoenroll + if (!Request.IsAuthenticated && !eventInfo.AllowAnonEnroll) + { + enroll1.Visible = true; + imgEnroll.AlternateText = Localization.GetString("LoginToEnroll", LocalResourceFile); + cmdSignup.Text = Localization.GetString("LoginToEnroll", LocalResourceFile); + return returnValue; + } + + // If not authenticated make email/name boxes visible, or find out if authenticated user has already enrolled + EventSignupsController objCtlEventSignups = new EventSignupsController(); + EventSignupsInfo objEventSignups = null; + if (!Request.IsAuthenticated) + { + if (!string.IsNullOrEmpty(txtAnonEmail.Text)) + { + objEventSignups = objCtlEventSignups.EventsSignupsGetAnonUser(eventInfo.EventID, txtAnonEmail.Text, ModuleId); + } + } + else + { + objEventSignups = objCtlEventSignups.EventsSignupsGetUser(eventInfo.EventID, UserId, ModuleId); + } + + if (ReferenceEquals(objEventSignups, null)) + { + if (!Request.IsAuthenticated && !Settings.EnrollmentPageAllowed) + { + enroll5.Visible = true; + } + if ((eventInfo.Enrolled < eventInfo.MaxEnrollment) || + (eventInfo.MaxEnrollment == 0)) + { + if (Settings.Maxnoenrolees > 1 && !Settings.EnrollmentPageAllowed) + { + enroll3.Visible = true; + } + // User is not enrolled for this event...press the link to enroll! + enroll1.Visible = true; + imgEnroll.AlternateText = Localization.GetString("EnrollForEvent", LocalResourceFile); + cmdSignup.Text = Localization.GetString("EnrollForEvent", LocalResourceFile); + } + } + else + { + enroll2.Visible = true; + if (objEventSignups.Approved) + { + // User is enrolled and approved for this event! + imgSignup.AlternateText = Localization.GetString("YouAreEnrolledForThisEvent", LocalResourceFile); + lblSignup.Text = Localization.GetString("YouAreEnrolledForThisEvent", LocalResourceFile); + returnValue = MessageLevel.DNNSuccess; + } + else + { + // User is enrolled for this event, but not yet approved! + imgSignup.AlternateText = Localization.GetString("EnrolledButNotApproved", LocalResourceFile); + lblSignup.Text = Localization.GetString("EnrolledButNotApproved", LocalResourceFile); + returnValue = MessageLevel.DNNWarning; + } + } + + return returnValue; + } + + /// + /// Redirect to EventVCal page which exports the event to a vCard + /// + private void ExportEvent(bool series) + { + try + { + Response.Redirect("~/DesktopModules/Events/EventVCal.aspx?ItemID=" + System.Convert.ToString(ItemId) + "&Mid=" + System.Convert.ToString(ModuleId) + "&tabid=" + System.Convert.ToString(TabId) + "&Series=" + System.Convert.ToString(series)); + } + catch (System.Threading.ThreadAbortException) + { + //Ignore + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + + /// + /// Download the enrollees for this event as a file. + /// + private void DownloadSignups() + { + //Get the event. + EventInfo theEvent = new EventController().EventsGet(ItemId, ModuleId); + if (theEvent != null) + { + //Dim xmlDoc As XmlDocument = DefineXmlFile(theEvent, True) + //If xmlDoc IsNot Nothing Then + // GenerateXmlFile(theEvent, xmlDoc) + //End If + + string csvDoc = DefineCsvFile(theEvent); + if (csvDoc != null) + { + GenerateCsvFile(theEvent, csvDoc); + } + } + } + + /// + /// Define the xml file for downloading the enrollees for this event. + /// + private XmlDocument DefineXmlFile(EventInfo theEvent, bool localizeTags) + { + XmlDocument returnValue = default(XmlDocument); + returnValue = null; + XmlDocument xmlDoc = new XmlDocument(); + + //Get the enrollees. + ArrayList eventSignups = new EventSignupsController().EventsSignupsGetEvent(ItemId, ModuleId); + //Anything to do + if (ReferenceEquals(eventSignups, null) || eventSignups.Count == 0) + { + return returnValue; + } + + try + { + //Initialization. + XNamespace xNamespace = XNamespace.Get(""); + XElement xRoot = + new XElement(xNamespace + "Document", new XAttribute(XNamespace.Xmlns + "xsi", "http://www.w3.org/2001/XMLSchema-instance")); + + //Tags should be localized for XML output. These will be converted to a header row in Excel. + //Tags should not be localized for CSV output. A separate localized header row is added. + XElement xElemHdr = default(XElement); + if (localizeTags) + { + xElemHdr = new XElement("Enrollee", + new XElement("EventName", Localization.GetString("Event Name.Header", LocalResourceFile)), + new XElement("EventStart", Localization.GetString("Event Start.Header", LocalResourceFile)), + new XElement("EventEnd", Localization.GetString("Event End.Header", LocalResourceFile)), + new XElement("Location", Localization.GetString("Location.Header", LocalResourceFile)), + new XElement("Category", Localization.GetString("Category.Header", LocalResourceFile)), + new XElement("ReferenceNumber", Localization.GetString("ReferenceNumber.Header", LocalResourceFile)), + new XElement("Company", Localization.GetString("Company.Header", LocalResourceFile)), + new XElement("JobTitle", Localization.GetString("JobTitle.Header", LocalResourceFile)), + new XElement("FullName", Localization.GetString("FullName.Header", LocalResourceFile)), + new XElement("FirstName", Localization.GetString("FirstName.Header", LocalResourceFile)), + new XElement("LastName", Localization.GetString("LastName.Header", LocalResourceFile)), + new XElement("Email", Localization.GetString("Email.Header", LocalResourceFile)), + new XElement("Phone", Localization.GetString("Phone.Header", LocalResourceFile)), + new XElement("Street", Localization.GetString("Street.Header", LocalResourceFile)), + new XElement("PostalCode", Localization.GetString("PostalCode.Header", LocalResourceFile)), + new XElement("City", Localization.GetString("City.Header", LocalResourceFile)), + new XElement("Region", Localization.GetString("Region.Header", LocalResourceFile)), + new XElement("Country", Localization.GetString("Country.Header", LocalResourceFile))); + } + else + { + xElemHdr = new XElement("Enrollee", + new XElement("EventName", string.Empty), + new XElement("EventStart", string.Empty), + new XElement("EventEnd", string.Empty), + new XElement("Location", string.Empty), + new XElement("Category", string.Empty), + new XElement("ReferenceNumber", string.Empty), + new XElement("Company", string.Empty), + new XElement("JobTitle", string.Empty), + new XElement("FullName", string.Empty), + new XElement("FirstName", string.Empty), + new XElement("LastName", string.Empty), + new XElement("Email", string.Empty), + new XElement("Phone", string.Empty), + new XElement("Street", string.Empty), + new XElement("PostalCode", string.Empty), + new XElement("City", string.Empty), + new XElement("Region", string.Empty), + new XElement("Country", string.Empty)); + } + + //Names cannot be empty nor contain spaces. + foreach (XElement xElem in xElemHdr.Elements()) + { + if (string.IsNullOrEmpty(xElem.Value)) + { + xElem.Value = xElem.Name.ToString(); + } + xElem.Value = System.Convert.ToString(xElem.Value.Trim().Replace(" ", "_")); + } + + //Gather the information. + List xElemList = new List(); + XElement xElemEvent = default(XElement); + + //Add a localized header row when tags are not localized. + if (!localizeTags) + { + xElemEvent = new XElement(xNamespace + "Enrollee", + new XElement(xNamespace + xElemHdr.Elements("EventName").First().Value, + Localization.GetString("Event Name.Header", LocalResourceFile)), + new XElement(xNamespace + xElemHdr.Elements("EventStart").First().Value, + Localization.GetString("Event Start.Header", LocalResourceFile)), + new XElement(xNamespace + xElemHdr.Elements("EventEnd").First().Value, + Localization.GetString("Event End.Header", LocalResourceFile)), + new XElement(xNamespace + xElemHdr.Elements("Location").First().Value, + Localization.GetString("Location.Header", LocalResourceFile)), + new XElement(xNamespace + xElemHdr.Elements("Category").First().Value, + Localization.GetString("Category.Header", LocalResourceFile)), + new XElement(xNamespace + xElemHdr.Elements("ReferenceNumber").First().Value, + Localization.GetString("ReferenceNumber.Header", LocalResourceFile)), + new XElement(xNamespace + xElemHdr.Elements("Company").First().Value, + Localization.GetString("Company.Header", LocalResourceFile)), + new XElement(xNamespace + xElemHdr.Elements("JobTitle").First().Value, + Localization.GetString("JobTitle.Header", LocalResourceFile)), + new XElement(xNamespace + xElemHdr.Elements("FullName").First().Value, + Localization.GetString("FullName.Header", LocalResourceFile)), + new XElement(xNamespace + xElemHdr.Elements("FirstName").First().Value, + Localization.GetString("FirstName.Header", LocalResourceFile)), + new XElement(xNamespace + xElemHdr.Elements("LastName").First().Value, + Localization.GetString("LastName.Header", LocalResourceFile)), + new XElement(xNamespace + xElemHdr.Elements("Email").First().Value, + Localization.GetString("Email.Header", LocalResourceFile)), + new XElement(xNamespace + xElemHdr.Elements("Phone").First().Value, + Localization.GetString("Phone.Header", LocalResourceFile)), + new XElement(xNamespace + xElemHdr.Elements("Street").First().Value, + Localization.GetString("Street.Header", LocalResourceFile)), + new XElement(xNamespace + xElemHdr.Elements("PostalCode").First().Value, + Localization.GetString("PostalCode.Header", LocalResourceFile)), + new XElement(xNamespace + xElemHdr.Elements("City").First().Value, + Localization.GetString("City.Header", LocalResourceFile)), + new XElement(xNamespace + xElemHdr.Elements("Region").First().Value, + Localization.GetString("Region.Header", LocalResourceFile)), + new XElement(xNamespace + xElemHdr.Elements("Country").First().Value, + Localization.GetString("Country.Header", LocalResourceFile)) + ); + xElemList.Add(xElemEvent); + } + + UserController objCtlUser = new UserController(); + foreach (EventSignupsInfo eventSignup in eventSignups) + { + if (eventSignup.UserID != -1) + { + //Known DNN/Evoq user. Get info from user profile. + UserInfo objUser = objCtlUser.GetUser(PortalId, eventSignup.UserID); + xElemEvent = new XElement(xNamespace + "Enrollee", + new XElement(xNamespace + xElemHdr.Elements("EventName").First().Value, theEvent.EventName), + new XElement(xNamespace + xElemHdr.Elements("EventStart").First().Value, theEvent.EventTimeBegin), + new XElement(xNamespace + xElemHdr.Elements("EventEnd").First().Value, theEvent.EventTimeEnd), + new XElement(xNamespace + xElemHdr.Elements("Location").First().Value, theEvent.LocationName), + new XElement(xNamespace + xElemHdr.Elements("Category").First().Value, theEvent.CategoryName), + new XElement(xNamespace + xElemHdr.Elements("ReferenceNumber").First().Value, eventSignup.ReferenceNumber), + new XElement(xNamespace + xElemHdr.Elements("Company").First().Value, GetPropertyForDownload(objUser, "Company")), + new XElement(xNamespace + xElemHdr.Elements("JobTitle").First().Value, GetPropertyForDownload(objUser, "JobTitle")), + new XElement(xNamespace + xElemHdr.Elements("FullName").First().Value, objUser.DisplayName), + new XElement(xNamespace + xElemHdr.Elements("FirstName").First().Value, objUser.FirstName), + new XElement(xNamespace + xElemHdr.Elements("LastName").First().Value, objUser.LastName), + new XElement(xNamespace + xElemHdr.Elements("Email").First().Value, objUser.Email), + new XElement(xNamespace + xElemHdr.Elements("Phone").First().Value, GetPropertyForDownload(objUser, "Telephone")), + new XElement(xNamespace + xElemHdr.Elements("Street").First().Value, GetPropertyForDownload(objUser, "Street")), + new XElement(xNamespace + xElemHdr.Elements("PostalCode").First().Value, GetPropertyForDownload(objUser, "PostalCode")), + new XElement(xNamespace + xElemHdr.Elements("City").First().Value, GetPropertyForDownload(objUser, "City")), + new XElement(xNamespace + xElemHdr.Elements("Region").First().Value, GetPropertyForDownload(objUser, "Region")), + new XElement(xNamespace + xElemHdr.Elements("Country").First().Value, GetPropertyForDownload(objUser, "Country"))); + } + else + { + //Anonymous user (site visitor). Get info from event signup. + xElemEvent = new XElement(xNamespace + "Enrollee", + new XElement(xNamespace + xElemHdr.Elements("EventName").First().Value, theEvent.EventName), + new XElement(xNamespace + xElemHdr.Elements("EventStart").First().Value, theEvent.EventTimeBegin), + new XElement(xNamespace + xElemHdr.Elements("EventEnd").First().Value, theEvent.EventTimeEnd), + new XElement(xNamespace + xElemHdr.Elements("Location").First().Value, theEvent.LocationName), + new XElement(xNamespace + xElemHdr.Elements("Category").First().Value, theEvent.CategoryName), + new XElement(xNamespace + xElemHdr.Elements("ReferenceNumber").First().Value, eventSignup.ReferenceNumber), + new XElement(xNamespace + xElemHdr.Elements("Company").First().Value, eventSignup.Company), + new XElement(xNamespace + xElemHdr.Elements("JobTitle").First().Value, eventSignup.JobTitle), + new XElement(xNamespace + xElemHdr.Elements("FullName").First().Value, eventSignup.AnonName), + new XElement(xNamespace + xElemHdr.Elements("FirstName").First().Value, eventSignup.FirstName), + new XElement(xNamespace + xElemHdr.Elements("LastName").First().Value, eventSignup.LastName), + new XElement(xNamespace + xElemHdr.Elements("Email").First().Value, eventSignup.AnonEmail), + new XElement(xNamespace + xElemHdr.Elements("Phone").First().Value, eventSignup.AnonTelephone), + new XElement(xNamespace + xElemHdr.Elements("Street").First().Value, eventSignup.Street), + new XElement(xNamespace + xElemHdr.Elements("PostalCode").First().Value, eventSignup.PostalCode), + new XElement(xNamespace + xElemHdr.Elements("City").First().Value, eventSignup.City), + new XElement(xNamespace + xElemHdr.Elements("Region").First().Value, eventSignup.Region), + new XElement(xNamespace + xElemHdr.Elements("Country").First().Value, eventSignup.Country)); + } + xElemList.Add(xElemEvent); + } + + //Aggregate into a document. + XElement xElemMain = xRoot; + xElemMain.Add(xElemList); //Everything ... + xmlDoc.Load(xElemMain.CreateReader()); + + //Add a declaration. + XmlDeclaration xmlDecla = xmlDoc.CreateXmlDeclaration("1.0", "UTF-8", null); + XmlElement xmlElemDoc = xmlDoc.DocumentElement; + xmlDoc.InsertBefore(xmlDecla, xmlElemDoc); + + //Return. + returnValue = xmlDoc; + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + return returnValue; + } + + /// + /// Define the csv file for downloading the enrollees for this event. + /// + private string DefineCsvFile(EventInfo theEvent) + { + string returnValue = ""; + returnValue = null; + StringBuilder csvDoc = new StringBuilder(); + + //From xml to csv by xslt. + XmlDocument xmlDoc = DefineXmlFile(theEvent, false); + if (xmlDoc != null) + { + XPathDocument xPathDoc = new XPathDocument(XmlReader.Create(new StringReader(xmlDoc.InnerXml.ToString()))); + XslCompiledTransform xslTrafo = new XslCompiledTransform(); + xslTrafo.Load(XmlReader.Create(new StringReader(File.ReadAllText(Path.Combine(Request.MapPath(ControlPath), "EventEnrollees.xslt"))))); + StringWriter xWriter = new StringWriter(csvDoc); + xslTrafo.Transform(xPathDoc, null, xWriter); + xWriter.Close(); + } + + return csvDoc.ToString(); + } + + /// + /// Generate the xml file for downloading the enrollees for this event. + /// + private bool GenerateXmlFile(EventInfo theEvent, XmlDocument xmlDoc) + { + bool returnValue = false; + returnValue = false; + + //Name the file with a timestamp. + string fileName = theEvent.EventName; + if (!string.IsNullOrEmpty(Localization.GetString("EnrollmentsFile.Text", LocalResourceFile))) + { + fileName += " - " + Localization.GetString("EnrollmentsFile.Text", LocalResourceFile); + } + fileName += DateTime.Now.ToString(" - yyyyMMdd_HHmmss"); + + //The contents of the file. + string fileContent = xmlDoc.InnerXml.ToString(); + + try + { + //Stream the file. + HttpContext myContext = HttpContext.Current; + HttpResponse myResponse = default(HttpResponse); + myResponse = myContext.Response; + myResponse.ContentEncoding = Encoding.UTF8; + myResponse.ContentType = "application/force-download"; + myResponse.AppendHeader("Content-Disposition", "filename=\"" + fileName + ".xml\""); + + myResponse.Write(fileContent); + myResponse.End(); + + returnValue = true; + } + catch (Exception) + { + returnValue = false; + } + return returnValue; + } + + /// + /// Generate the csv file for downloading the enrollees for this event. + /// + private bool GenerateCsvFile(EventInfo theEvent, string csvDoc) + { + bool returnValue = false; + returnValue = false; + + //Name the file with a timestamp. + string fileName = theEvent.EventName; + if (!string.IsNullOrEmpty(Localization.GetString("EnrollmentsFile.Text", LocalResourceFile))) + { + fileName += " - " + Localization.GetString("EnrollmentsFile.Text", LocalResourceFile); + } + fileName += DateTime.Now.ToString(" - yyyyMMdd_HHmmss"); + + //The contents of the file. + string fileContent = csvDoc; + + try + { + //Stream the file. + HttpContext myContext = HttpContext.Current; + HttpResponse myResponse = default(HttpResponse); + myResponse = myContext.Response; + myResponse.ContentEncoding = Encoding.UTF8; + myResponse.ContentType = "application/force-download"; + myResponse.AppendHeader("Content-Disposition", "filename=\"" + fileName + ".csv\""); + + myResponse.Write(fileContent); + myResponse.End(); + + returnValue = true; + } + catch (Exception) + { + returnValue = false; + } + return returnValue; + } + + private string GetPropertyForDownload(UserInfo objUser, string propertyName) + { + string returnValue = ""; + returnValue = null; + + if (!string.IsNullOrEmpty(propertyName)) + { + ProfilePropertyDefinition profileProperty = objUser.Profile.GetProperty(propertyName); + + if (profileProperty != null) + { + returnValue = profileProperty.PropertyValue; + } + } + return returnValue; + } + + private void ShowMessage(string msg, MessageLevel messageLevel) + { + lblMessage.Text = msg; + + //Hide the rest of the form fields. + divMessage.Attributes.Add("style", "display:block;"); + + switch (messageLevel) + { + case MessageLevel.DNNSuccess: + divMessage.Attributes.Add("class", "dnnFormMessage dnnFormSuccess"); + break; + case MessageLevel.DNNInformation: + divMessage.Attributes.Add("class", "dnnFormMessage dnnFormInfo"); + break; + case MessageLevel.DNNWarning: + divMessage.Attributes.Add("class", "dnnFormMessage dnnFormWarning"); + break; + case MessageLevel.DNNError: + divMessage.Attributes.Add("class", "dnnFormMessage dnnFormValidationSummary"); + break; + } + } + #endregion + + #region Links and Buttons + /// + /// When delete button is clicked the current event will be removed + /// + protected void deleteButton_Click(System.Object sender, EventArgs e) + { + try + { + int iItemID = ItemId; + EventController objCtlEvent = new EventController(); + EventInfo objEvent = objCtlEvent.EventsGet(iItemID, ModuleId); + if (objEvent.RRULE != "") + { + objEvent.Cancelled = true; + objEvent.LastUpdatedID = UserId; + objCtlEvent.EventsSave(objEvent, true, TabId, true); + } + else + { + EventRecurMasterController objCtlEventRecurMaster = new EventRecurMasterController(); + objCtlEventRecurMaster.EventsRecurMasterDelete(objEvent.RecurMasterID, objEvent.ModuleID); + } + Response.Redirect(GetSocialNavigateUrl(), true); + } + catch (System.Threading.ThreadAbortException) + { + //Ignore + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + + /// + /// When delete series button is clicked the current event series will be removed + /// + protected void deleteSeriesButton_Click(object sender, EventArgs e) + { + try + { + int iItemID = ItemId; + EventController objCtlEvent = new EventController(); + EventInfo objEvent = objCtlEvent.EventsGet(iItemID, ModuleId); + EventRecurMasterController objCtlEventRecurMaster = new EventRecurMasterController(); + objCtlEventRecurMaster.EventsRecurMasterDelete(objEvent.RecurMasterID, objEvent.ModuleID); + Response.Redirect(GetSocialNavigateUrl(), true); + } + catch (System.Threading.ThreadAbortException) + { + //Ignore + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + + /// + /// When Export simple button is clicked the current event will be exported to a vcard + /// + protected void cmdvEvent_Click(object sender, EventArgs e) + { + ExportEvent(false); + } + + /// + /// When Export event series button is clicked the current event will be exported to a vcard + /// + protected void cmdvEventSeries_Click(object sender, EventArgs e) + { + ExportEvent(true); + } + + /// + /// When Download event signups button is clicked the current event signups will be written to an XML file for download. + /// + protected void cmdvEventSignups_Click(object sender, EventArgs e) + { + DownloadSignups(); + } + + /// + /// When return button is clicked the user is redirected to the previous page + /// + /// + protected void returnButton_Click(System.Object sender, EventArgs e) + { + try + { + Response.Redirect(GetSocialNavigateUrl(), true); + } + catch (System.Threading.ThreadAbortException) + { + //Ignore + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + + /// + /// When signup button is clicked the user will be signed up for the event + /// + /// + /// + /// + protected void cmdSignup_Click(System.Object sender, EventArgs e) + { + if (!Request.IsAuthenticated && !Settings.AllowAnonEnroll) + { + RedirectToLogin(); + } + + try + { + EventInfo objEvent = default(EventInfo); + EventController objCtlEvent = new EventController(); + objEvent = objCtlEvent.EventsGet(ItemId, ModuleId); + if (!Request.IsAuthenticated && !objEvent.AllowAnonEnroll) + { + RedirectToLogin(); + } + + // In case of custom enrollment page. + if (Settings.EnrollmentPageAllowed) + { + if (!string.IsNullOrEmpty(Settings.EnrollmentPageDefaultUrl)) + { + Response.Redirect(Settings.EnrollmentPageDefaultUrl + "?mod=" + System.Convert.ToString(ModuleId) + "&event=" + System.Convert.ToString(ItemId)); + } + return; + } + + // In case of standard paid enrollment. + // Check to see if unauthenticated user has already enrolled + EventSignupsController objCtlEventSignups = new EventSignupsController(); + if (!Request.IsAuthenticated) + { + EventSignupsInfo objEventsSignups = default(EventSignupsInfo); + objEventsSignups = objCtlEventSignups.EventsSignupsGetAnonUser(objEvent.EventID, txtAnonEmail.Text, objEvent.ModuleID); + if (!ReferenceEquals(objEventsSignups, null)) + { + ShowMessage(Localization.GetString("YouAreAlreadyEnrolledForThisEvent", LocalResourceFile), MessageLevel.DNNWarning); + enroll1.Visible = false; + enroll3.Visible = false; + enroll5.Visible = false; + return; + } + } + + if (objEvent.EnrollType == "PAID") + { + // Paid Even Process + try + { + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + int socialGroupId = GetUrlGroupId(); + if (Request.IsAuthenticated) + { + if (socialGroupId > 0) + { + Response.Redirect(objEventInfoHelper.AddSkinContainerControls(DotNetNuke.Common.Globals.NavigateURL(TabId, "PPEnroll", "Mid=" + System.Convert.ToString(ModuleId), "ItemID=" + System.Convert.ToString(ItemId), "NoEnrol=" + txtNoEnrolees.Text, "groupid=" + socialGroupId.ToString()), "?")); + } + else + { + Response.Redirect(objEventInfoHelper.AddSkinContainerControls(DotNetNuke.Common.Globals.NavigateURL(TabId, "PPEnroll", "Mid=" + System.Convert.ToString(ModuleId), "ItemID=" + System.Convert.ToString(ItemId), "NoEnrol=" + txtNoEnrolees.Text), "?")); + } + } + else + { + string urlAnonTelephone = txtAnonTelephone.Text.Trim(); + if (string.IsNullOrEmpty(urlAnonTelephone)) + { + urlAnonTelephone = "0"; + } + if (socialGroupId > 0) + { + Response.Redirect(objEventInfoHelper.AddSkinContainerControls(DotNetNuke.Common.Globals.NavigateURL(TabId, "PPEnroll", "Mid=" + System.Convert.ToString(ModuleId), "ItemID=" + System.Convert.ToString(ItemId), "NoEnrol=" + txtNoEnrolees.Text, "groupid=" + socialGroupId.ToString(), "AnonEmail=" + HttpUtility.UrlEncode(txtAnonEmail.Text), "AnonName=" + HttpUtility.UrlEncode(txtAnonName.Text), "AnonPhone=" + HttpUtility.UrlEncode(urlAnonTelephone)), "&")); + } + else + { + Response.Redirect(objEventInfoHelper.AddSkinContainerControls(DotNetNuke.Common.Globals.NavigateURL(TabId, "PPEnroll", "Mid=" + System.Convert.ToString(ModuleId), "ItemID=" + System.Convert.ToString(ItemId), "NoEnrol=" + txtNoEnrolees.Text, "AnonEmail=" + HttpUtility.UrlEncode(txtAnonEmail.Text), "AnonName=" + HttpUtility.UrlEncode(txtAnonName.Text), "AnonPhone=" + HttpUtility.UrlEncode(urlAnonTelephone)), "&")); + } + } + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + else + { + // Non-Paid Event Process + // Got the Event, Now Add the User to the EventSignups + EventSignupsInfo objEventSignups = new EventSignupsInfo(); + objEventSignups.EventID = objEvent.EventID; + + DateTime startdate = objEvent.EventTimeBegin; + SelectedDate = startdate.Date; + + objEventSignups.ModuleID = objEvent.ModuleID; + if (Request.IsAuthenticated) + { + objEventSignups.UserID = UserId; + objEventSignups.AnonEmail = null; + objEventSignups.AnonName = null; + objEventSignups.AnonTelephone = null; + objEventSignups.AnonCulture = null; + objEventSignups.AnonTimeZoneId = null; + } + else + { + PortalSecurity objSecurity = new PortalSecurity(); + objEventSignups.UserID = -1; + objEventSignups.AnonEmail = txtAnonEmail.Text; + objEventSignups.AnonName = objSecurity.InputFilter(txtAnonName.Text, PortalSecurity.FilterFlag.NoScripting); + objEventSignups.AnonTelephone = objSecurity.InputFilter(txtAnonTelephone.Text, PortalSecurity.FilterFlag.NoScripting); + objEventSignups.AnonCulture = System.Threading.Thread.CurrentThread.CurrentCulture.Name; + objEventSignups.AnonTimeZoneId = GetDisplayTimeZoneId(); + } + objEventSignups.PayPalPaymentDate = DateTime.UtcNow; + objEventSignups.NoEnrolees = int.Parse(txtNoEnrolees.Text); + if (IsModerator() || + PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString())) + { + objEventSignups.Approved = true; + objEvent.Enrolled++; + } + else if (Settings.Moderateall) + { + objEventSignups.Approved = false; + } + else + { + objEventSignups.Approved = true; + objEvent.Enrolled++; + } + objEventSignups = CreateEnrollment(objEventSignups, objEvent); + enroll1.Visible = false; + MessageLevel msgLevel = UserEnrollment(objEvent); + ShowMessage(lblSignup.Text, msgLevel); + // Send Moderator email + EventEmailInfo objEventEmailInfo = new EventEmailInfo(); + EventEmails objEventEmail = new EventEmails(PortalId, ModuleId, LocalResourceFile, ((PageBase)Page).PageCulture.Name); + if (Settings.Moderateall && objEventSignups.Approved == false) + { + objEventEmailInfo.TxtEmailSubject = Settings.Templates.moderateemailsubject; + objEventEmailInfo.TxtEmailBody = Settings.Templates.moderateemailmessage; + objEventEmailInfo.TxtEmailFrom = Settings.StandardEmail; + ArrayList moderators = GetModerators(); + foreach (UserInfo moderator in moderators) + { + objEventEmailInfo.UserEmails.Add(moderator.Email); + objEventEmailInfo.UserLocales.Add(moderator.Profile.PreferredLocale); + objEventEmailInfo.UserTimeZoneIds.Add(moderator.Profile.PreferredTimeZone.Id); + } + objEventEmail.SendEmails(objEventEmailInfo, objEvent, objEventSignups); + } + + // Mail users + objEventEmailInfo = new EventEmailInfo(); + objEventEmailInfo.TxtEmailSubject = Settings.Templates.txtEnrollMessageSubject; + objEventEmailInfo.TxtEmailFrom = Settings.StandardEmail; + if (Request.IsAuthenticated) + { + objEventEmailInfo.UserEmails.Add(PortalSettings.UserInfo.Email); + objEventEmailInfo.UserLocales.Add(PortalSettings.UserInfo.Profile.PreferredLocale); + objEventEmailInfo.UserTimeZoneIds.Add(PortalSettings.UserInfo.Profile.PreferredTimeZone.Id); + } + else + { + objEventEmailInfo.UserEmails.Add(objEventSignups.AnonEmail); + objEventEmailInfo.UserLocales.Add(objEventSignups.AnonCulture); + objEventEmailInfo.UserTimeZoneIds.Add(objEventSignups.AnonTimeZoneId); + } + objEventEmailInfo.UserIDs.Add(objEvent.OwnerID); + if (objEventSignups.Approved) + { + if (Settings.SendEnrollMessageApproved) + { + objEventEmailInfo.TxtEmailBody = Settings.Templates.txtEmailMessage + Settings.Templates.txtEnrollMessageApproved; + objEventEmail.SendEmails(objEventEmailInfo, objEvent, objEventSignups); + } + } + else + { + if (Settings.SendEnrollMessageWaiting) + { + objEventEmailInfo.TxtEmailBody = Settings.Templates.txtEmailMessage + Settings.Templates.txtEnrollMessageWaiting; + objEventEmail.SendEmails(objEventEmailInfo, objEvent, objEventSignups); + } + } + + } + BindEnrollList(objEvent); + + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + + /// + /// When notify button is clicked the user will be added to the notification list + /// + /// + /// + /// + protected void cmdNotify_Click(System.Object sender, EventArgs e) + { + valEmail.Validate(); + valEmail2.Validate(); + if (!valEmail.IsValid || !valEmail2.IsValid) + { + return; + } + + ArrayList lstEvents = new ArrayList(); + EventNotificationInfo objEventNotification = default(EventNotificationInfo); + EventNotificationController objEventNotificationController = new EventNotificationController(); + DateTime eventDate = default(DateTime); + DateTime notifyTime = default(DateTime); + int currentEv; + EventTimeZoneUtilities objEventTimeZoneUtilities = new EventTimeZoneUtilities(); + try + { + EventInfo eventEvent = default(EventInfo); + EventController objCtlEvent = new EventController(); + eventEvent = objCtlEvent.EventsGet(ItemId, ModuleId); + currentEv = eventEvent.EventID; + + if (chkReminderRec.Checked) + { + lstEvents = objCtlEvent.EventsGetRecurrences(eventEvent.RecurMasterID, ModuleId); + } + else + { + lstEvents.Add(eventEvent); + } + + foreach (EventInfo tempLoopVar_eventEvent in lstEvents) + { + eventEvent = tempLoopVar_eventEvent; + if (eventEvent.SendReminder == true && eventEvent.EventTimeBegin > objEventTimeZoneUtilities.ConvertFromUTCToModuleTimeZone(DateTime.UtcNow, eventEvent.EventTimeZoneId)) + { + eventDate = objEventTimeZoneUtilities.ConvertToUTCTimeZone(eventEvent.EventTimeBegin, eventEvent.EventTimeZoneId); + objEventNotification = objEventNotificationController.EventsNotificationGet(eventEvent.EventID, txtUserEmail.Text, ModuleId); + + notifyTime = eventDate; + //*** Calculate notification time + switch (ddlReminderTimeMeasurement.SelectedValue) + { + case "m": + notifyTime = notifyTime.AddMinutes((int.Parse(txtReminderTime.Text)) * -1); + break; + case "h": + notifyTime = notifyTime.AddHours((int.Parse(txtReminderTime.Text)) * -1); + break; + case "d": + notifyTime = notifyTime.AddDays((int.Parse(txtReminderTime.Text)) * -1); + break; + } + // Registered users will overwrite existing notifications (in recurring events) + DateTime notifyDisplayTime = objEventTimeZoneUtilities.ConvertFromUTCToDisplayTimeZone(notifyTime, GetDisplayTimeZoneId()).EventDate; + if (!(ReferenceEquals(objEventNotification, null)) && Request.IsAuthenticated) + { + objEventNotification.NotifyByDateTime = notifyTime; + objEventNotificationController.EventsNotificationSave(objEventNotification); + if (currentEv == eventEvent.EventID) + { + lblConfirmation.Text = string.Format(Localization.GetString("lblReminderConfirmation", LocalResourceFile), notifyDisplayTime.ToString()); + ShowMessage(lblConfirmation.Text, MessageLevel.DNNSuccess); + } + // Anonymous users can never overwrite an existing notification + } + else if (!(ReferenceEquals(objEventNotification, null))) + { + if (currentEv == eventEvent.EventID) + { + lblConfirmation.Text = string.Format(Localization.GetString("ReminderAlreadyReg", LocalResourceFile), txtUserEmail.Text.ToString(), objEventNotification.NotifyByDateTime.ToString()); + ShowMessage(lblConfirmation.Text, MessageLevel.DNNWarning); + } + } + else + { + objEventNotification = new EventNotificationInfo(); + objEventNotification.NotificationID = -1; + objEventNotification.EventID = eventEvent.EventID; + objEventNotification.PortalAliasID = PortalAlias.PortalAliasID; + objEventNotification.NotificationSent = false; + objEventNotification.EventTimeBegin = eventDate; + objEventNotification.NotifyLanguage = System.Threading.Thread.CurrentThread.CurrentCulture.Name; + objEventNotification.ModuleID = ModuleId; + objEventNotification.TabID = TabId; + objEventNotification.NotifyByDateTime = notifyTime; + objEventNotification.UserEmail = txtUserEmail.Text; + objEventNotificationController.EventsNotificationSave(objEventNotification); + if (currentEv == eventEvent.EventID) + { + lblConfirmation.Text = string.Format(Localization.GetString("lblReminderConfirmation", LocalResourceFile), notifyDisplayTime.ToString()); + ShowMessage(lblConfirmation.Text, MessageLevel.DNNSuccess); + } + } + } + } + rem1.Visible = false; + rem2.Visible = false; + rem3.Visible = true; + imgConfirmation.AlternateText = Localization.GetString("Reminder", LocalResourceFile); + } + catch (Exception exc) + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + + protected void cmdPrint_PreRender(object sender, EventArgs e) + { + + cmdPrint.Target = " _blank"; + cmdPrint.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(TabId, PortalSettings, "", "mid=" + System.Convert.ToString(ModuleId), "itemid=" + System.Convert.ToString(ItemId), "ctl=Details", "ShowNav=False", "dnnprintmode=true", "SkinSrc=%5bG%5dSkins%2f_default%2fNo+Skin", "ContainerSrc=%5bG%5dContainers%2f_default%2fNo+Container"); + + } + protected void cmdEmail_Click(object sender, EventArgs e) + { + valEmailiCal.Validate(); + valEmailiCal2.Validate(); + if (!valEmailiCal.IsValid || !valEmailiCal2.IsValid) + { + return; + } + + EventController objCtlEvent = new EventController(); + EventInfo objEvent = objCtlEvent.EventsGet(ItemId, ModuleId); + if (ReferenceEquals(objEvent, null)) + { + return; + } + + VEvent iCalendar = new VEvent(false, HttpContext.Current); + string iCal = ""; + iCal = iCalendar.CreateiCal(TabId, ModuleId, ItemId, objEvent.SocialGroupId); + + System.Net.Mail.Attachment attachment = System.Net.Mail.Attachment.CreateAttachmentFromString(iCal, new System.Net.Mime.ContentType("text/calendar")); + attachment.TransferEncoding = System.Net.Mime.TransferEncoding.Base64; + attachment.Name = objEvent.EventName + ".ics"; + System.Collections.Generic.List attachments = new System.Collections.Generic.List(); + attachments.Add(attachment); + + EventEmailInfo objEventEmailInfo = new EventEmailInfo(); + EventEmails objEventEmail = new EventEmails(PortalId, ModuleId, LocalResourceFile, ((PageBase)Page).PageCulture.Name); + objEventEmailInfo.TxtEmailSubject = Settings.Templates.EventiCalSubject; + objEventEmailInfo.TxtEmailBody = Settings.Templates.EventiCalBody; + objEventEmailInfo.TxtEmailFrom = Settings.StandardEmail; + objEventEmailInfo.UserEmails.Add(txtUserEmailiCal.Text); + objEventEmailInfo.UserLocales.Add(""); + objEventEmailInfo.UserTimeZoneIds.Add(objEvent.EventTimeZoneId); + + objEventEmail.SendEmails(objEventEmailInfo, objEvent, attachments); + divMessage.Attributes.Add("style", "display:block;"); + ShowMessage(string.Format(Localization.GetString("ConfirmationiCal", LocalResourceFile), txtUserEmailiCal.Text), MessageLevel.DNNSuccess); + + } + + #endregion + + } +} + diff --git a/EventDetails.ascx.designer.cs b/EventDetails.ascx.designer.cs new file mode 100644 index 0000000..682e822 --- /dev/null +++ b/EventDetails.ascx.designer.cs @@ -0,0 +1,636 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DotNetNuke.Modules.Events { + + + public partial class EventDetails { + + /// + /// pnlEventsModuleDetails control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlEventsModuleDetails; + + /// + /// divMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divMessage; + + /// + /// lblMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMessage; + + /// + /// divEventDetails1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divEventDetails1; + + /// + /// divReminder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divReminder; + + /// + /// rem1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl rem1; + + /// + /// imgNotify control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgNotify; + + /// + /// cmdNotify control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdNotify; + + /// + /// chkReminderRec control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkReminderRec; + + /// + /// rem2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl rem2; + + /// + /// txtUserEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtUserEmail; + + /// + /// valEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valEmail; + + /// + /// valEmail2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valEmail2; + + /// + /// txtReminderTime control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtReminderTime; + + /// + /// ddlReminderTimeMeasurement control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlReminderTimeMeasurement; + + /// + /// lblTimeBefore control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblTimeBefore; + + /// + /// valReminderTime2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valReminderTime2; + + /// + /// valReminderTime control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RangeValidator valReminderTime; + + /// + /// rem3 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl rem3; + + /// + /// imgConfirmation control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgConfirmation; + + /// + /// lblConfirmation control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblConfirmation; + + /// + /// divIcalendar control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divIcalendar; + + /// + /// imgEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgEmail; + + /// + /// cmdEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdEmail; + + /// + /// iCal1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl iCal1; + + /// + /// txtUserEmailiCal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtUserEmailiCal; + + /// + /// valEmailiCal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valEmailiCal; + + /// + /// valEmailiCal2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valEmailiCal2; + + /// + /// divEventDetails2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divEventDetails2; + + /// + /// divEnrollment control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divEnrollment; + + /// + /// enroll1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl enroll1; + + /// + /// imgEnroll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgEnroll; + + /// + /// cmdSignup control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdSignup; + + /// + /// enroll4 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl enroll4; + + /// + /// imgEnrollTooLate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgEnrollTooLate; + + /// + /// lblEnrollTooLate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEnrollTooLate; + + /// + /// enroll3 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl enroll3; + + /// + /// lblNoEnrolee control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblNoEnrolee; + + /// + /// txtNoEnrolees control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtNoEnrolees; + + /// + /// lblMaxNoEnrolees control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMaxNoEnrolees; + + /// + /// valNoEnrolees control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RangeValidator valNoEnrolees; + + /// + /// valNoEnrolees2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valNoEnrolees2; + + /// + /// enroll5 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl enroll5; + + /// + /// lblAnonEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblAnonEmail; + + /// + /// txtAnonEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtAnonEmail; + + /// + /// valAnonEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valAnonEmail; + + /// + /// valAnonEmail2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valAnonEmail2; + + /// + /// lblAnonName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblAnonName; + + /// + /// txtAnonName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtAnonName; + + /// + /// valAnonName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valAnonName; + + /// + /// lblAnonTelephone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblAnonTelephone; + + /// + /// txtAnonTelephone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtAnonTelephone; + + /// + /// enroll2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl enroll2; + + /// + /// imgSignup control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgSignup; + + /// + /// lblSignup control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblSignup; + + /// + /// divEventDetails3 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divEventDetails3; + + /// + /// divEnrollList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divEnrollList; + + /// + /// lblEnrolledUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEnrolledUsers; + + /// + /// grdEnrollment control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DataGrid grdEnrollment; + + /// + /// cmdvEventSignups control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdvEventSignups; + + /// + /// divEventDetails4 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divEventDetails4; + + /// + /// returnButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton returnButton; + + /// + /// editButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink editButton; + + /// + /// editSeriesButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink editSeriesButton; + + /// + /// deleteButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton deleteButton; + + /// + /// deleteSeriesButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton deleteSeriesButton; + + /// + /// cmdPrint control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink cmdPrint; + + /// + /// cmdvEventSeries control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdvEventSeries; + + /// + /// cmdvEvent control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdvEvent; + } +} diff --git a/EventDetails.ascx.designer.vb b/EventDetails.ascx.designer.vb deleted file mode 100644 index 98bcddf..0000000 --- a/EventDetails.ascx.designer.vb +++ /dev/null @@ -1,638 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Namespace DotNetNuke.Modules.Events - - Partial Public Class EventDetails - - ''' - '''pnlEventsModuleDetails control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlEventsModuleDetails As Global.System.Web.UI.WebControls.Panel - - ''' - '''divMessage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divMessage As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblMessage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblMessage As Global.System.Web.UI.WebControls.Label - - ''' - '''divEventDetails1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divEventDetails1 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''divReminder control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divReminder As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''rem1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rem1 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''imgNotify control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgNotify As Global.System.Web.UI.WebControls.Image - - ''' - '''cmdNotify control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdNotify As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''chkReminderRec control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkReminderRec As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''rem2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rem2 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''txtUserEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtUserEmail As Global.System.Web.UI.WebControls.TextBox - - ''' - '''valEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valEmail As Global.System.Web.UI.WebControls.RegularExpressionValidator - - ''' - '''valEmail2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valEmail2 As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''txtReminderTime control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtReminderTime As Global.System.Web.UI.WebControls.TextBox - - ''' - '''ddlReminderTimeMeasurement control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlReminderTimeMeasurement As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''lblTimeBefore control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblTimeBefore As Global.System.Web.UI.WebControls.Label - - ''' - '''valReminderTime2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valReminderTime2 As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''valReminderTime control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valReminderTime As Global.System.Web.UI.WebControls.RangeValidator - - ''' - '''rem3 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rem3 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''imgConfirmation control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgConfirmation As Global.System.Web.UI.WebControls.Image - - ''' - '''lblConfirmation control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblConfirmation As Global.System.Web.UI.WebControls.Label - - ''' - '''divIcalendar control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divIcalendar As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''imgEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgEmail As Global.System.Web.UI.WebControls.Image - - ''' - '''cmdEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdEmail As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''iCal1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents iCal1 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''txtUserEmailiCal control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtUserEmailiCal As Global.System.Web.UI.WebControls.TextBox - - ''' - '''valEmailiCal control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valEmailiCal As Global.System.Web.UI.WebControls.RegularExpressionValidator - - ''' - '''valEmailiCal2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valEmailiCal2 As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''divEventDetails2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divEventDetails2 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''divEnrollment control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divEnrollment As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''enroll1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents enroll1 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''imgEnroll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgEnroll As Global.System.Web.UI.WebControls.Image - - ''' - '''cmdSignup control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdSignup As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''enroll4 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents enroll4 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''imgEnrollTooLate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgEnrollTooLate As Global.System.Web.UI.WebControls.Image - - ''' - '''lblEnrollTooLate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnrollTooLate As Global.System.Web.UI.WebControls.Label - - ''' - '''enroll3 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents enroll3 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblNoEnrolee control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblNoEnrolee As Global.System.Web.UI.WebControls.Label - - ''' - '''txtNoEnrolees control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtNoEnrolees As Global.System.Web.UI.WebControls.TextBox - - ''' - '''lblMaxNoEnrolees control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblMaxNoEnrolees As Global.System.Web.UI.WebControls.Label - - ''' - '''valNoEnrolees control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valNoEnrolees As Global.System.Web.UI.WebControls.RangeValidator - - ''' - '''valNoEnrolees2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valNoEnrolees2 As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''enroll5 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents enroll5 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblAnonEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblAnonEmail As Global.System.Web.UI.WebControls.Label - - ''' - '''txtAnonEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtAnonEmail As Global.System.Web.UI.WebControls.TextBox - - ''' - '''valAnonEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valAnonEmail As Global.System.Web.UI.WebControls.RegularExpressionValidator - - ''' - '''valAnonEmail2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valAnonEmail2 As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''lblAnonName control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblAnonName As Global.System.Web.UI.WebControls.Label - - ''' - '''txtAnonName control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtAnonName As Global.System.Web.UI.WebControls.TextBox - - ''' - '''valAnonName control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valAnonName As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''lblAnonTelephone control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblAnonTelephone As Global.System.Web.UI.WebControls.Label - - ''' - '''txtAnonTelephone control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtAnonTelephone As Global.System.Web.UI.WebControls.TextBox - - ''' - '''enroll2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents enroll2 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''imgSignup control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgSignup As Global.System.Web.UI.WebControls.Image - - ''' - '''lblSignup control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblSignup As Global.System.Web.UI.WebControls.Label - - ''' - '''divEventDetails3 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divEventDetails3 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''divEnrollList control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divEnrollList As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblEnrolledUsers control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnrolledUsers As Global.System.Web.UI.WebControls.Label - - ''' - '''grdEnrollment control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents grdEnrollment As Global.System.Web.UI.WebControls.DataGrid - - ''' - '''cmdvEventSignups control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdvEventSignups As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''divEventDetails4 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divEventDetails4 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''returnButton control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents returnButton As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''editButton control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents editButton As Global.System.Web.UI.WebControls.HyperLink - - ''' - '''editSeriesButton control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents editSeriesButton As Global.System.Web.UI.WebControls.HyperLink - - ''' - '''deleteButton control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents deleteButton As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''deleteSeriesButton control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents deleteSeriesButton As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''cmdPrint control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdPrint As Global.System.Web.UI.WebControls.HyperLink - - ''' - '''cmdvEventSeries control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdvEventSeries As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''cmdvEvent control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdvEvent As Global.System.Web.UI.WebControls.LinkButton - End Class -End Namespace diff --git a/EventDetails.ascx.vb b/EventDetails.ascx.vb deleted file mode 100644 index 15cc4f1..0000000 --- a/EventDetails.ascx.vb +++ /dev/null @@ -1,1309 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - -Imports System -Imports DotNetNuke.Security -Imports System.Xml -Imports System.Xml.Linq -Imports System.Collections.Generic -Imports System.Text -Imports System.Xml.XPath -Imports System.Xml.Xsl -Imports System.IO -Imports System.Windows.Forms -Imports DotNetNuke.Services.Tokens -Imports DotNetNuke.Entities.Profile - -Namespace DotNetNuke.Modules.Events - - _ - Partial Class EventDetails - Inherits EventBase - -#Region " Web Form Designer Generated Code " - 'This call is required by the Web Form Designer. - Private Sub InitializeComponent() - End Sub - - Private Sub Page_Init(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Init - 'CODEGEN: This method call is required by the Web Form Designer - 'Do not modify it using the code editor. - InitializeComponent() - End Sub -#End Region - -#Region "Properties" - ''' - ''' Stores the ItemId in the viewstate - ''' - Private Property ItemId() As Int32 - Get - Return CInt(ViewState("EventItemID" + ModuleId.ToString)) - End Get - Set(ByVal value As Int32) - ViewState("EventItemID" + ModuleId.ToString) = value.ToString - End Set - End Property - Private _eventInfo As New EventInfo - - Private Enum MessageLevel As Integer - DNNSuccess = 1 - DNNInformation - DNNWarning - DNNError - End Enum - -#End Region - -#Region "Event Handlers" - Private Sub Page_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load - ' Log exception whem status is filled - If Not Request.Params("status") = Nothing Then - Dim objSecurity As New PortalSecurity - Dim status As String = objSecurity.InputFilter(Request.Params("status"), PortalSecurity.FilterFlag.NoScripting Or PortalSecurity.FilterFlag.NoMarkup) - LogException(New ModuleLoadException("EventDetails Call...status: " & status)) - End If - - ' Add the external Validation.js to the Page - Const csname As String = "ExtValidationScriptFile" - Dim cstype As Type = Reflection.MethodBase.GetCurrentMethod().GetType() - Dim cstext As String = "" - If Not Page.ClientScript.IsClientScriptBlockRegistered(csname) Then - Page.ClientScript.RegisterClientScriptBlock(cstype, csname, cstext, False) - End If - - ' Force full PostBack since these pass off to aspx page - If AJAX.IsInstalled Then - AJAX.RegisterPostBackControl(cmdvEvent) - AJAX.RegisterPostBackControl(cmdvEventSeries) - AJAX.RegisterPostBackControl(cmdvEventSignups) - End If - - cmdvEvent.ToolTip = Localization.GetString("cmdvEventTooltip", LocalResourceFile) - cmdvEvent.Text = Localization.GetString("cmdvEventExport", LocalResourceFile) - cmdvEventSeries.ToolTip = Localization.GetString("cmdvEventSeriesTooltip", LocalResourceFile) - cmdvEventSeries.Text = Localization.GetString("cmdvEventExportSeries", LocalResourceFile) - cmdvEventSignups.ToolTip = Localization.GetString("cmdvEventSignupsTooltip", LocalResourceFile) - cmdvEventSignups.Text = Localization.GetString("cmdvEventSignupsDownload", LocalResourceFile) - - cmdPrint.ToolTip = Localization.GetString("Print", LocalResourceFile) - - Try - 'Get the item id of the selected event - If Not (Request.Params("ItemId") Is Nothing) Then - ItemId = Int32.Parse(Request.Params("ItemId")) - Else - Response.Redirect(GetSocialNavigateUrl(), True) - End If - - ' Set the selected theme - If Settings.Eventdetailnewpage Then - SetTheme(pnlEventsModuleDetails) - AddFacebookMetaTags() - End If - - ' If the page is being requested the first time, determine if an - ' contact itemId value is specified, and if so populate page - ' contents with the contact details - If Page.IsPostBack Then - Return - End If - - - Dim objCtlEvent As New EventController - _eventInfo = objCtlEvent.EventsGet(ItemId, ModuleId) - - 'If somebody has sent a bad ItemID and eventinfo not retrieved, return 301 - If IsNothing(_eventInfo) Then - Response.StatusCode = 301 - Response.AppendHeader("Location", GetSocialNavigateUrl()) - Return - End If - - ' Do they have permissions to the event? - Dim objCtlEventInfoHelper As New EventInfoHelper(ModuleId, Settings) - If Settings.Enforcesubcalperms And Not objCtlEventInfoHelper.IsModuleViewer(_eventInfo.ModuleID) Then - Response.Redirect(GetSocialNavigateUrl(), True) - ElseIf IsPrivateNotModerator And UserId <> _eventInfo.OwnerID Then - Response.Redirect(GetSocialNavigateUrl(), True) - ElseIf Settings.SocialGroupModule = EventModuleSettings.SocialModule.UserProfile And Not objCtlEventInfoHelper.IsSocialUserPublic(GetUrlUserId()) Then - Response.Redirect(GetSocialNavigateUrl(), True) - ElseIf Settings.SocialGroupModule = EventModuleSettings.SocialModule.SocialGroup And Not objCtlEventInfoHelper.IsSocialGroupPublic(GetUrlGroupId()) Then - Response.Redirect(GetSocialNavigateUrl(), True) - End If - - ' Has the event been cancelled? - If _eventInfo.Cancelled Then - Response.StatusCode = 301 - Response.AppendHeader("Location", GetSocialNavigateUrl()) - Return - End If - - ' So we have a valid item, but is it from a module that has been deleted - ' but not removed from the recycle bin - If _eventInfo.ModuleID <> ModuleId Then - Dim objCtlModule As New Entities.Modules.ModuleController - Dim objModules As ArrayList = objCtlModule.GetModuleTabs(_eventInfo.ModuleID) - Dim objModule As Entities.Modules.ModuleInfo - Dim isDeleted As Boolean = True - For Each objModule In objModules - If Not objModule.IsDeleted Then - isDeleted = False - End If - Next - If isDeleted Then - Response.StatusCode = 301 - Response.AppendHeader("Location", GetSocialNavigateUrl()) - Return - End If - End If - - ' Should all be OK to display now - Dim displayTimeZoneId As String = _eventInfo.EventTimeZoneId - If Not Settings.EnableEventTimeZones Then - displayTimeZoneId = GetDisplayTimeZoneId() - End If - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - _eventInfo = objEventInfoHelper.ConvertEventToDisplayTimeZone(_eventInfo, displayTimeZoneId) - - Dim tcc As New TokenReplaceControllerClass(ModuleId, LocalResourceFile) - - 'Set the page title - If Settings.EnableSEO Then - Dim txtPageText As String = String.Format(Settings.Templates.txtSEOPageTitle, BasePage.Title) - txtPageText = tcc.TokenReplaceEvent(_eventInfo, txtPageText, False) - txtPageText = HttpUtility.HtmlDecode(txtPageText) - txtPageText = HtmlUtils.StripTags(txtPageText, True) - txtPageText = txtPageText.Replace(Environment.NewLine, " ") - txtPageText = HtmlUtils.StripWhiteSpace(txtPageText, True) - BasePage.Title = txtPageText - txtPageText = String.Format(Settings.Templates.txtSEOPageDescription, BasePage.Description) - txtPageText = tcc.TokenReplaceEvent(_eventInfo, txtPageText, False) - txtPageText = HttpUtility.HtmlDecode(txtPageText) - txtPageText = HtmlUtils.StripTags(txtPageText, True) - txtPageText = txtPageText.Replace(Environment.NewLine, " ") - txtPageText = HtmlUtils.StripWhiteSpace(txtPageText, True) - txtPageText = HtmlUtils.Shorten(txtPageText, Settings.SEODescriptionLength, "...") - BasePage.Description = txtPageText - txtPageText = BasePage.KeyWords - If Not _eventInfo.LocationName Is Nothing Then - If txtPageText <> "" Then - txtPageText = txtPageText + "," - End If - txtPageText = txtPageText + _eventInfo.LocationName - End If - If Not _eventInfo.CategoryName Is Nothing Then - If txtPageText <> "" Then - txtPageText = txtPageText + "," - End If - txtPageText = txtPageText + _eventInfo.CategoryName - End If - BasePage.KeyWords = txtPageText - End If - - 'Replace tokens - Dim txtTemplate, txtTemplate1, txtTemplate2, txtTemplate3, txtTemplate4 As String - txtTemplate = Settings.Templates.EventDetailsTemplate - txtTemplate1 = txtTemplate - txtTemplate2 = "" - txtTemplate3 = "" - txtTemplate4 = "" - Dim nTemplate As Integer = 0 - Do While InStr(txtTemplate, "[BREAK]") > 0 - nTemplate = nTemplate + 1 - Dim txtBefore As String - Dim nBreak As Integer = InStr(txtTemplate, "[BREAK]") - If nBreak > 1 Then - txtBefore = Left(txtTemplate, nBreak - 1) - Else - txtBefore = "" - End If - If Len(txtTemplate) > nBreak + 6 Then - txtTemplate = Mid(txtTemplate, nBreak + 7) - Else - txtTemplate = "" - End If - Select Case nTemplate - Case 1 - txtTemplate1 = txtBefore - txtTemplate2 = txtTemplate - Case 2 - txtTemplate2 = txtBefore - txtTemplate3 = txtTemplate - Case 3 - txtTemplate3 = txtBefore - txtTemplate4 = txtTemplate - Case 4 - txtTemplate4 = txtBefore - End Select - Loop - If txtTemplate1 <> "" And txtTemplate1 <> vbCrLf Then - divEventDetails1.InnerHtml = tcc.TokenReplaceEvent(_eventInfo, txtTemplate1) - divEventDetails1.Attributes.Add("style", "display:block;") - Else - divEventDetails1.Attributes.Add("style", "display:none;") - End If - If txtTemplate2 <> "" And txtTemplate2 <> vbCrLf Then - divEventDetails2.InnerHtml = tcc.TokenReplaceEvent(_eventInfo, txtTemplate2) - divEventDetails2.Attributes.Add("style", "display:block;") - Else - divEventDetails2.Attributes.Add("style", "display:none;") - End If - If txtTemplate3 <> "" And txtTemplate3 <> vbCrLf Then - divEventDetails3.InnerHtml = tcc.TokenReplaceEvent(_eventInfo, txtTemplate3) - divEventDetails3.Attributes.Add("style", "display:block;") - Else - divEventDetails3.Attributes.Add("style", "display:none;") - End If - If txtTemplate4 <> "" And txtTemplate4 <> vbCrLf Then - divEventDetails4.InnerHtml = tcc.TokenReplaceEvent(_eventInfo, txtTemplate4) - divEventDetails4.Attributes.Add("style", "display:block;") - Else - divEventDetails4.Attributes.Add("style", "display:none;") - End If - - editButton.Visible = False - deleteButton.Visible = False - cmdvEventSignups.Visible = False - If IsEventEditor(_eventInfo, False) Then - editButton.Visible = True - editButton.NavigateUrl = objEventInfoHelper.GetEditURL(_eventInfo.EventID, _eventInfo.SocialGroupId, _eventInfo.SocialUserId) - editButton.ToolTip = Localization.GetString("editButton", LocalResourceFile) - deleteButton.Visible = True - deleteButton.Attributes.Add("onclick", "javascript:return confirm('" + Localization.GetString("ConfirmEventDelete", LocalResourceFile) + "');") - cmdvEventSignups.Visible = True - End If - editSeriesButton.Visible = False - deleteSeriesButton.Visible = False - If _eventInfo.RRULE <> "" Then - ' Note that IsEventEditor with 'True' is used here because this is for the - ' series(buttons)and excludes single event owner. Must be recurrence master owner. - If IsEventEditor(_eventInfo, True) Then - editSeriesButton.Visible = True - editSeriesButton.NavigateUrl = objEventInfoHelper.GetEditURL(_eventInfo.EventID, _eventInfo.SocialGroupId, _eventInfo.SocialUserId, "All") - editSeriesButton.ToolTip = Localization.GetString("editSeriesButton", LocalResourceFile) - deleteSeriesButton.Visible = True - deleteSeriesButton.Attributes.Add("onclick", "javascript:return confirm('" + Localization.GetString("ConfirmEventSeriesDelete", LocalResourceFile) + "');") - End If - End If - If _eventInfo.RRULE = "" Then - cmdvEventSeries.Visible = False - End If - - Dim objEventTimeZoneUtilities As New EventTimeZoneUtilities - Dim nowDisplay As DateTime = objEventTimeZoneUtilities.ConvertFromUTCToDisplayTimeZone(Date.UtcNow, GetDisplayTimeZoneId()).EventDate - - ' Compute Dates/Times (for recurring) - Dim startdate As DateTime = _eventInfo.EventTimeBegin - SelectedDate = startdate.Date - - ' See if user already are signed up - ' And that Signup is Authorized - ' And also that the Date/Time has not passed - divEnrollment.Attributes.Add("style", "display:none;") - If _eventInfo.Signups Then - If startdate > nowDisplay Then - If _eventInfo.EnrollRoleID = Nothing Or _eventInfo.EnrollRoleID = -1 Then - UserEnrollment(_eventInfo) - Else - Dim objEventSignupsController As New EventSignupsController - If objEventSignupsController.IsEnrollRole(_eventInfo.EnrollRoleID, PortalId) Then - UserEnrollment(_eventInfo) - End If - End If - Else - divEnrollment.Attributes.Add("style", "display:block;") - lblEnrollTooLate.Text = Localization.GetString("EnrollTooLate", LocalResourceFile) - enroll4.Visible = True - End If - End If - - 'Are You Sure You Want To Enroll?' - If Request.IsAuthenticated Then - If Settings.Enableenrollpopup Then - cmdSignup.Attributes.Add("onclick", "javascript:return confirm('" + Localization.GetString("SureYouWantToEnroll", LocalResourceFile) + "');") - End If - valNoEnrolees.MaximumValue = CStr(_eventInfo.MaxEnrollment - _eventInfo.Enrolled) - If CInt(valNoEnrolees.MaximumValue) > Settings.Maxnoenrolees Or _eventInfo.MaxEnrollment = 0 Then - valNoEnrolees.MaximumValue = Settings.Maxnoenrolees.ToString - End If - lblMaxNoEnrolees.Text = String.Format(Localization.GetString("lblMaxNoEnrolees", LocalResourceFile), valNoEnrolees.MaximumValue) - valNoEnrolees.ErrorMessage = String.Format(Localization.GetString("valNoEnrolees", LocalResourceFile), CInt(valNoEnrolees.MaximumValue)) - valNoEnrolees2.ErrorMessage = valNoEnrolees.ErrorMessage - End If - - divMessage.Attributes.Add("style", "display:none;") - - If Settings.IcalEmailEnable Then - divIcalendar.Attributes.Add("style", "display:block;") - txtUserEmailiCal.Text = UserInfo.Email - If Request.IsAuthenticated Then - txtUserEmailiCal.Enabled = False - Else - txtUserEmailiCal.Enabled = True - End If - Else - divIcalendar.Attributes.Add("style", "display:none;") - End If - - 'Is notification enabled - divReminder.Attributes.Add("style", "display:none;") - If _eventInfo.SendReminder And startdate > nowDisplay Then - 'Is registered user - If Request.IsAuthenticated() Then - divReminder.Attributes.Add("style", "display:block;") - Dim objEventNotificationController As EventNotificationController = New EventNotificationController - Dim notificationInfo As String = objEventNotificationController.NotifyInfo(_eventInfo.EventID, UserInfo.Email, ModuleId, LocalResourceFile, GetDisplayTimeZoneId()) - If notificationInfo <> "" Then - lblConfirmation.Text = notificationInfo - rem3.Visible = True - imgConfirmation.AlternateText = Localization.GetString("Reminder", LocalResourceFile) - Else - txtUserEmail.Text = UserInfo.Email - End If - End If - ' is anonymous notification allowed or registered user not yet notified - If (Settings.Notifyanon And Not Request.IsAuthenticated()) Or txtUserEmail.Text.Length > 0 Then - If Request.IsAuthenticated Then - txtUserEmail.Enabled = False - Else - txtUserEmail.Enabled = True - End If - divReminder.Attributes.Add("style", "display:block;") - Dim errorminutes As String = Localization.GetString("invalidReminderMinutes", LocalResourceFile) - Dim errorhours As String = Localization.GetString("invalidReminderHours", LocalResourceFile) - Dim errordays As String = Localization.GetString("invalidReminderDays", LocalResourceFile) - - txtReminderTime.Text = _eventInfo.ReminderTime.ToString 'load default Reminder Time of event - txtReminderTime.Visible = True - ddlReminderTimeMeasurement.Attributes.Add("onchange", "valRemTime('" & valReminderTime.ClientID & "','" & valReminderTime2.ClientID & "','" & valReminderTime.ValidationGroup & "','" & ddlReminderTimeMeasurement.ClientID & "','" & errorminutes & "','" & errorhours & "','" & errordays & "');") - ddlReminderTimeMeasurement.Visible = True - ddlReminderTimeMeasurement.SelectedValue = _eventInfo.ReminderTimeMeasurement - - Select Case _eventInfo.ReminderTimeMeasurement - Case "m" - valReminderTime.ErrorMessage = errorminutes - valReminderTime.MinimumValue = "15" - valReminderTime.MaximumValue = "60" - Case "h" - valReminderTime.ErrorMessage = errorhours - valReminderTime.MinimumValue = "1" - valReminderTime.MaximumValue = "24" - Case "d" - valReminderTime.ErrorMessage = errordays - valReminderTime.MinimumValue = "1" - valReminderTime.MaximumValue = "30" - End Select - valReminderTime2.ErrorMessage = valReminderTime.ErrorMessage - - rem1.Visible = True - imgNotify.AlternateText = Localization.GetString("Reminder", LocalResourceFile) - rem2.Visible = True - If _eventInfo.RRULE <> "" Then - chkReminderRec.Visible = True - End If - End If - End If - With grdEnrollment - .Columns(0).HeaderText = Localization.GetString("EnrollUserName", LocalResourceFile) - .Columns(1).HeaderText = Localization.GetString("EnrollDisplayName", LocalResourceFile) - .Columns(2).HeaderText = Localization.GetString("EnrollEmail", LocalResourceFile) - .Columns(3).HeaderText = Localization.GetString("EnrollPhone", LocalResourceFile) - .Columns(4).HeaderText = Localization.GetString("EnrollApproved", LocalResourceFile) - .Columns(5).HeaderText = Localization.GetString("EnrollNo", LocalResourceFile) - End With - - BindEnrollList(_eventInfo) - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub -#End Region - -#Region "Helper Methods" - ''' - ''' Bind enrolled users to the enrollment grid - ''' - Private Sub BindEnrollList(ByVal eventInfo As EventInfo) - divEnrollList.Attributes.Add("style", "display:none;") - Dim blEnrollList As Boolean = False - Dim txtColumns As String = "" - If eventInfo.Signups And eventInfo.Enrolled > 0 Then - txtColumns = EnrolmentColumns(eventInfo, eventInfo.EnrollListView) - End If - If txtColumns <> "" Then - blEnrollList = True - End If - - If blEnrollList Then - If txtColumns.LastIndexOf("UserName", StringComparison.Ordinal) < 0 Then - grdEnrollment.Columns.Item(0).Visible = False - End If - If txtColumns.LastIndexOf("DisplayName", StringComparison.Ordinal) < 0 Then - grdEnrollment.Columns.Item(1).Visible = False - End If - If txtColumns.LastIndexOf("Email", StringComparison.Ordinal) < 0 Then - grdEnrollment.Columns.Item(2).Visible = False - End If - If txtColumns.LastIndexOf("Phone", StringComparison.Ordinal) < 0 Then - grdEnrollment.Columns.Item(3).Visible = False - End If - If txtColumns.LastIndexOf("Approved", StringComparison.Ordinal) < 0 Then - grdEnrollment.Columns.Item(4).Visible = False - End If - If txtColumns.LastIndexOf("Qty", StringComparison.Ordinal) < 0 Then - grdEnrollment.Columns.Item(5).Visible = False - End If - - 'Load enrol list - Dim eventEnrollment As New ArrayList - Dim objSignups As ArrayList - Dim objSignup As EventSignupsInfo - Dim objCtlUser As New UserController - Dim objCtlEventSignups As New EventSignupsController - objSignups = objCtlEventSignups.EventsSignupsGetEvent(eventInfo.EventID, ModuleId) - For Each objSignup In objSignups - Dim objEnrollListItem As New EventEnrollList - If objSignup.UserID <> -1 Then - Dim objUser As UserInfo - objUser = objCtlUser.GetUser(PortalId, objSignup.UserID) - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - objEnrollListItem.EnrollDisplayName = objEventInfoHelper.UserDisplayNameProfile(objSignup.UserID, objSignup.UserName, LocalResourceFile).DisplayNameURL - If Not objUser Is Nothing Then - objEnrollListItem.EnrollUserName = objUser.Username - objEnrollListItem.EnrollEmail = String.Format("{0}", objSignup.Email, eventInfo.EventName) - objEnrollListItem.EnrollPhone = objUser.Profile.Telephone - End If - Else - objEnrollListItem.EnrollDisplayName = objSignup.AnonName - objEnrollListItem.EnrollUserName = Localization.GetString("AnonUser", LocalResourceFile) - objEnrollListItem.EnrollEmail = String.Format("{0}", objSignup.AnonEmail, eventInfo.EventName) - objEnrollListItem.EnrollPhone = objSignup.AnonTelephone - End If - objEnrollListItem.SignupID = objSignup.SignupID - objEnrollListItem.EnrollApproved = objSignup.Approved - objEnrollListItem.EnrollNo = objSignup.NoEnrolees - eventEnrollment.Add(objEnrollListItem) - Next - If eventEnrollment.Count > 0 Then - divEnrollList.Attributes.Add("style", "display:block;") - grdEnrollment.DataSource = eventEnrollment - grdEnrollment.DataBind() - End If - End If - End Sub - - ''' - ''' Display User Enrollment Info on Page - ''' - Private Function UserEnrollment(ByVal eventInfo As EventInfo) As MessageLevel - UserEnrollment = MessageLevel.DNNSuccess - If Not Settings.Eventsignup Then - divEnrollment.Attributes.Add("style", "display:none;") - Exit Function - End If - - divEnrollment.Attributes.Add("style", "display:block;") - enroll3.Visible = False - enroll5.Visible = False - If Not Request.Params("Status") Is Nothing Then - If Request.Params("Status").ToLower = "enrolled" Then - ' User has been successfully enrolled for this event (paid enrollment) - lblSignup.Text = Localization.GetString("StatusPPSuccess", LocalResourceFile) - enroll2.Visible = True - imgSignup.AlternateText = Localization.GetString("StatusPPSuccess", LocalResourceFile) - ElseIf Request.Params("Status").ToLower = "cancelled" Then - ' User has been cancelled paid enrollment - lblSignup.Text = Localization.GetString("StatusPPCancelled", LocalResourceFile) - UserEnrollment = MessageLevel.DNNInformation - enroll2.Visible = True - imgSignup.AlternateText = Localization.GetString("StatusPPCancelled", LocalResourceFile) - End If - Exit Function - End If - - ' If not authenticated and anonymous not allowed setup for logintoenroll - If Not Request.IsAuthenticated And Not eventInfo.AllowAnonEnroll Then - enroll1.Visible = True - imgEnroll.AlternateText = Localization.GetString("LoginToEnroll", LocalResourceFile) - cmdSignup.Text = Localization.GetString("LoginToEnroll", LocalResourceFile) - Exit Function - End If - - ' If not authenticated make email/name boxes visible, or find out if authenticated user has already enrolled - Dim objCtlEventSignups As New EventSignupsController - Dim objEventSignups As EventSignupsInfo = Nothing - If Not Request.IsAuthenticated Then - If Not String.IsNullOrEmpty(txtAnonEmail.Text) Then - objEventSignups = objCtlEventSignups.EventsSignupsGetAnonUser(eventInfo.EventID, txtAnonEmail.Text, ModuleId) - End If - Else - objEventSignups = objCtlEventSignups.EventsSignupsGetUser(eventInfo.EventID, UserId, ModuleId) - End If - - If objEventSignups Is Nothing Then - If Not Request.IsAuthenticated And Not Settings.EnrollmentPageAllowed Then - enroll5.Visible = True - End If - If (eventInfo.Enrolled < eventInfo.MaxEnrollment) Or _ - (eventInfo.MaxEnrollment = 0) Then - If Settings.Maxnoenrolees > 1 And Not Settings.EnrollmentPageAllowed Then - enroll3.Visible = True - End If - ' User is not enrolled for this event...press the link to enroll! - enroll1.Visible = True - imgEnroll.AlternateText = Localization.GetString("EnrollForEvent", LocalResourceFile) - cmdSignup.Text = Localization.GetString("EnrollForEvent", LocalResourceFile) - End If - Else - enroll2.Visible = True - If objEventSignups.Approved Then - ' User is enrolled and approved for this event! - imgSignup.AlternateText = Localization.GetString("YouAreEnrolledForThisEvent", LocalResourceFile) - lblSignup.Text = Localization.GetString("YouAreEnrolledForThisEvent", LocalResourceFile) - UserEnrollment = MessageLevel.DNNSuccess - Else - ' User is enrolled for this event, but not yet approved! - imgSignup.AlternateText = Localization.GetString("EnrolledButNotApproved", LocalResourceFile) - lblSignup.Text = Localization.GetString("EnrolledButNotApproved", LocalResourceFile) - UserEnrollment = MessageLevel.DNNWarning - End If - End If - - End Function - - ''' - ''' Redirect to EventVCal page which exports the event to a vCard - ''' - Private Sub ExportEvent(ByVal series As Boolean) - Try - Response.Redirect("~/DesktopModules/Events/EventVCal.aspx?ItemID=" & ItemId & "&Mid=" & ModuleId & "&tabid=" & TabId & "&Series=" & CType(series, String)) - Catch ex As Threading.ThreadAbortException - 'Ignore - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub - - ''' - ''' Download the enrollees for this event as a file. - ''' - Private Sub DownloadSignups() - 'Get the event. - Dim theEvent As EventInfo = New EventController().EventsGet(ItemId, ModuleId) - If theEvent IsNot Nothing Then - 'Dim xmlDoc As XmlDocument = DefineXmlFile(theEvent, True) - 'If xmlDoc IsNot Nothing Then - ' GenerateXmlFile(theEvent, xmlDoc) - 'End If - - Dim csvDoc As String = DefineCsvFile(theEvent) - If csvDoc IsNot Nothing Then - GenerateCsvFile(theEvent, csvDoc) - End If - End If - End Sub - - ''' - ''' Define the xml file for downloading the enrollees for this event. - ''' - Private Function DefineXmlFile(ByVal theEvent As EventInfo, ByVal localizeTags As Boolean) As XmlDocument - DefineXmlFile = Nothing - Dim xmlDoc As XmlDocument = New XmlDocument() - - 'Get the enrollees. - Dim eventSignups As ArrayList = New EventSignupsController().EventsSignupsGetEvent(ItemId, ModuleId) - 'Anything to do? - If eventSignups Is Nothing Or eventSignups.Count = 0 Then - Exit Function - End If - - Try - 'Initialization. - Dim xNamespace As XNamespace = xNamespace.Get("") - Dim xRoot As XElement = _ - New XElement(xNamespace + "Document", New XAttribute(xNamespace.Xmlns + "xsi", "http://www.w3.org/2001/XMLSchema-instance")) - - 'Tags should be localized for XML output. These will be converted to a header row in Excel. - 'Tags should not be localized for CSV output. A separate localized header row is added. - Dim xElemHdr As XElement - If localizeTags Then - xElemHdr = New XElement("Enrollee", _ - New XElement("EventName", Localization.GetString("Event Name.Header", LocalResourceFile)), _ - New XElement("EventStart", Localization.GetString("Event Start.Header", LocalResourceFile)), _ - New XElement("EventEnd", Localization.GetString("Event End.Header", LocalResourceFile)), _ - New XElement("Location", Localization.GetString("Location.Header", LocalResourceFile)), _ - New XElement("Category", Localization.GetString("Category.Header", LocalResourceFile)), _ - New XElement("ReferenceNumber", Localization.GetString("ReferenceNumber.Header", LocalResourceFile)), _ - New XElement("Company", Localization.GetString("Company.Header", LocalResourceFile)), _ - New XElement("JobTitle", Localization.GetString("JobTitle.Header", LocalResourceFile)), _ - New XElement("FullName", Localization.GetString("FullName.Header", LocalResourceFile)), _ - New XElement("FirstName", Localization.GetString("FirstName.Header", LocalResourceFile)), _ - New XElement("LastName", Localization.GetString("LastName.Header", LocalResourceFile)), _ - New XElement("Email", Localization.GetString("Email.Header", LocalResourceFile)), _ - New XElement("Phone", Localization.GetString("Phone.Header", LocalResourceFile)), _ - New XElement("Street", Localization.GetString("Street.Header", LocalResourceFile)), _ - New XElement("PostalCode", Localization.GetString("PostalCode.Header", LocalResourceFile)), _ - New XElement("City", Localization.GetString("City.Header", LocalResourceFile)), _ - New XElement("Region", Localization.GetString("Region.Header", LocalResourceFile)), _ - New XElement("Country", Localization.GetString("Country.Header", LocalResourceFile)) _ - ) - Else - xElemHdr = New XElement("Enrollee", _ - New XElement("EventName", String.Empty), _ - New XElement("EventStart", String.Empty), _ - New XElement("EventEnd", String.Empty), _ - New XElement("Location", String.Empty), _ - New XElement("Category", String.Empty), _ - New XElement("ReferenceNumber", String.Empty), _ - New XElement("Company", String.Empty), _ - New XElement("JobTitle", String.Empty), _ - New XElement("FullName", String.Empty), _ - New XElement("FirstName", String.Empty), _ - New XElement("LastName", String.Empty), _ - New XElement("Email", String.Empty), _ - New XElement("Phone", String.Empty), _ - New XElement("Street", String.Empty), _ - New XElement("PostalCode", String.Empty), _ - New XElement("City", String.Empty), _ - New XElement("Region", String.Empty), _ - New XElement("Country", String.Empty) _ - ) - End If - - 'Names cannot be empty nor contain spaces. - For Each xElem As XElement In xElemHdr.Elements() - If String.IsNullOrEmpty(xElem.Value) Then - xElem.Value = xElem.Name.ToString() - End If - xElem.Value = xElem.Value.Trim().Replace(" ", "_") - Next - - 'Gather the information. - Dim xElemList As List(Of XElement) = New List(Of XElement) - Dim xElemEvent As XElement - - 'Add a localized header row when tags are not localized. - If Not localizeTags Then - xElemEvent = New XElement(xNamespace + "Enrollee", _ - New XElement(xNamespace + xElemHdr.Elements("EventName").First().Value, _ - Localization.GetString("Event Name.Header", LocalResourceFile)), _ - New XElement(xNamespace + xElemHdr.Elements("EventStart").First().Value, _ - Localization.GetString("Event Start.Header", LocalResourceFile)), _ - New XElement(xNamespace + xElemHdr.Elements("EventEnd").First().Value, _ - Localization.GetString("Event End.Header", LocalResourceFile)), _ - New XElement(xNamespace + xElemHdr.Elements("Location").First().Value, _ - Localization.GetString("Location.Header", LocalResourceFile)), _ - New XElement(xNamespace + xElemHdr.Elements("Category").First().Value, _ - Localization.GetString("Category.Header", LocalResourceFile)), _ - New XElement(xNamespace + xElemHdr.Elements("ReferenceNumber").First().Value, _ - Localization.GetString("ReferenceNumber.Header", LocalResourceFile)), _ - New XElement(xNamespace + xElemHdr.Elements("Company").First().Value, _ - Localization.GetString("Company.Header", LocalResourceFile)), _ - New XElement(xNamespace + xElemHdr.Elements("JobTitle").First().Value, _ - Localization.GetString("JobTitle.Header", LocalResourceFile)), _ - New XElement(xNamespace + xElemHdr.Elements("FullName").First().Value, _ - Localization.GetString("FullName.Header", LocalResourceFile)), _ - New XElement(xNamespace + xElemHdr.Elements("FirstName").First().Value, _ - Localization.GetString("FirstName.Header", LocalResourceFile)), _ - New XElement(xNamespace + xElemHdr.Elements("LastName").First().Value, _ - Localization.GetString("LastName.Header", LocalResourceFile)), _ - New XElement(xNamespace + xElemHdr.Elements("Email").First().Value, _ - Localization.GetString("Email.Header", LocalResourceFile)), _ - New XElement(xNamespace + xElemHdr.Elements("Phone").First().Value, _ - Localization.GetString("Phone.Header", LocalResourceFile)), _ - New XElement(xNamespace + xElemHdr.Elements("Street").First().Value, _ - Localization.GetString("Street.Header", LocalResourceFile)), _ - New XElement(xNamespace + xElemHdr.Elements("PostalCode").First().Value, _ - Localization.GetString("PostalCode.Header", LocalResourceFile)), _ - New XElement(xNamespace + xElemHdr.Elements("City").First().Value, _ - Localization.GetString("City.Header", LocalResourceFile)), _ - New XElement(xNamespace + xElemHdr.Elements("Region").First().Value, _ - Localization.GetString("Region.Header", LocalResourceFile)), _ - New XElement(xNamespace + xElemHdr.Elements("Country").First().Value, _ - Localization.GetString("Country.Header", LocalResourceFile)) _ - ) - xElemList.Add(xElemEvent) - End If - - Dim objCtlUser As New UserController - For Each eventSignup As EventSignupsInfo In eventSignups - If eventSignup.UserID <> -1 Then - 'Known DNN/Evoq user. Get info from user profile. - Dim objUser As UserInfo = objCtlUser.GetUser(PortalId, eventSignup.UserID) - xElemEvent = New XElement(xNamespace + "Enrollee", _ - New XElement(xNamespace + xElemHdr.Elements("EventName").First().Value, theEvent.EventName), _ - New XElement(xNamespace + xElemHdr.Elements("EventStart").First().Value, theEvent.EventTimeBegin), _ - New XElement(xNamespace + xElemHdr.Elements("EventEnd").First().Value, theEvent.EventTimeEnd), _ - New XElement(xNamespace + xElemHdr.Elements("Location").First().Value, theEvent.LocationName), _ - New XElement(xNamespace + xElemHdr.Elements("Category").First().Value, theEvent.CategoryName), _ - New XElement(xNamespace + xElemHdr.Elements("ReferenceNumber").First().Value, eventSignup.ReferenceNumber), _ - New XElement(xNamespace + xElemHdr.Elements("Company").First().Value, GetPropertyForDownload(objUser, "Company")), _ - New XElement(xNamespace + xElemHdr.Elements("JobTitle").First().Value, GetPropertyForDownload(objUser, "JobTitle")), _ - New XElement(xNamespace + xElemHdr.Elements("FullName").First().Value, objUser.DisplayName), _ - New XElement(xNamespace + xElemHdr.Elements("FirstName").First().Value, objUser.FirstName), _ - New XElement(xNamespace + xElemHdr.Elements("LastName").First().Value, objUser.LastName), _ - New XElement(xNamespace + xElemHdr.Elements("Email").First().Value, objUser.Email), _ - New XElement(xNamespace + xElemHdr.Elements("Phone").First().Value, GetPropertyForDownload(objUser, "Telephone")), _ - New XElement(xNamespace + xElemHdr.Elements("Street").First().Value, GetPropertyForDownload(objUser, "Street")), _ - New XElement(xNamespace + xElemHdr.Elements("PostalCode").First().Value, GetPropertyForDownload(objUser, "PostalCode")), _ - New XElement(xNamespace + xElemHdr.Elements("City").First().Value, GetPropertyForDownload(objUser, "City")), _ - New XElement(xNamespace + xElemHdr.Elements("Region").First().Value, GetPropertyForDownload(objUser, "Region")), _ - New XElement(xNamespace + xElemHdr.Elements("Country").First().Value, GetPropertyForDownload(objUser, "Country")) _ - ) - Else - 'Anonymous user (site visitor). Get info from event signup. - xElemEvent = New XElement(xNamespace + "Enrollee", _ - New XElement(xNamespace + xElemHdr.Elements("EventName").First().Value, theEvent.EventName), _ - New XElement(xNamespace + xElemHdr.Elements("EventStart").First().Value, theEvent.EventTimeBegin), _ - New XElement(xNamespace + xElemHdr.Elements("EventEnd").First().Value, theEvent.EventTimeEnd), _ - New XElement(xNamespace + xElemHdr.Elements("Location").First().Value, theEvent.LocationName), _ - New XElement(xNamespace + xElemHdr.Elements("Category").First().Value, theEvent.CategoryName), _ - New XElement(xNamespace + xElemHdr.Elements("ReferenceNumber").First().Value, eventSignup.ReferenceNumber), _ - New XElement(xNamespace + xElemHdr.Elements("Company").First().Value, eventSignup.Company), _ - New XElement(xNamespace + xElemHdr.Elements("JobTitle").First().Value, eventSignup.JobTitle), _ - New XElement(xNamespace + xElemHdr.Elements("FullName").First().Value, eventSignup.AnonName), _ - New XElement(xNamespace + xElemHdr.Elements("FirstName").First().Value, eventSignup.FirstName), _ - New XElement(xNamespace + xElemHdr.Elements("LastName").First().Value, eventSignup.LastName), _ - New XElement(xNamespace + xElemHdr.Elements("Email").First().Value, eventSignup.AnonEmail), _ - New XElement(xNamespace + xElemHdr.Elements("Phone").First().Value, eventSignup.AnonTelephone), _ - New XElement(xNamespace + xElemHdr.Elements("Street").First().Value, eventSignup.Street), _ - New XElement(xNamespace + xElemHdr.Elements("PostalCode").First().Value, eventSignup.PostalCode), _ - New XElement(xNamespace + xElemHdr.Elements("City").First().Value, eventSignup.City), _ - New XElement(xNamespace + xElemHdr.Elements("Region").First().Value, eventSignup.Region), _ - New XElement(xNamespace + xElemHdr.Elements("Country").First().Value, eventSignup.Country) _ - ) - End If - xElemList.Add(xElemEvent) - Next - - 'Aggregate into a document. - Dim xElemMain As XElement = xRoot - xElemMain.Add(xElemList) 'Everything ... - xmlDoc.Load(xElemMain.CreateReader()) - - 'Add a declaration. - Dim xmlDecla As XmlDeclaration = xmlDoc.CreateXmlDeclaration("1.0", "UTF-8", Nothing) - Dim xmlElemDoc As XmlElement = xmlDoc.DocumentElement - xmlDoc.InsertBefore(xmlDecla, xmlElemDoc) - - 'Return. - DefineXmlFile = xmlDoc - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Function - - ''' - ''' Define the csv file for downloading the enrollees for this event. - ''' - Private Function DefineCsvFile(ByVal theEvent As EventInfo) As String - DefineCsvFile = Nothing - Dim csvDoc As StringBuilder = New StringBuilder() - - 'From xml to csv by xslt. - Dim xmlDoc As XmlDocument = DefineXmlFile(theEvent, False) - If xmlDoc IsNot Nothing Then - Dim xPathDoc As XPathDocument = New XPathDocument(XmlReader.Create(New StringReader(xmlDoc.InnerXml.ToString()))) - Dim xslTrafo As XslCompiledTransform = New XslCompiledTransform() - xslTrafo.Load(XmlReader.Create(New StringReader(File.ReadAllText(Path.Combine(Request.MapPath(ControlPath), "EventEnrollees.xslt"))))) - Dim xWriter As StringWriter = New StringWriter(csvDoc) - xslTrafo.Transform(xPathDoc, Nothing, xWriter) - xWriter.Close() - End If - - Return csvDoc.ToString() - End Function - - ''' - ''' Generate the xml file for downloading the enrollees for this event. - ''' - Private Function GenerateXmlFile(ByVal theEvent As EventInfo, ByVal xmlDoc As XmlDocument) As Boolean - GenerateXmlFile = False - - 'Name the file with a timestamp. - Dim fileName As String = theEvent.EventName - If Not String.IsNullOrEmpty(Localization.GetString("EnrollmentsFile.Text", LocalResourceFile)) Then - fileName &= " - " & Localization.GetString("EnrollmentsFile.Text", LocalResourceFile) - End If - fileName &= DateTime.Now.ToString(" - yyyyMMdd_HHmmss") - - 'The contents of the file. - Dim fileContent As String = xmlDoc.InnerXml.ToString() - - Try - 'Stream the file. - Dim myContext As HttpContext = HttpContext.Current - Dim myResponse As HttpResponse - myResponse = myContext.Response - myResponse.ContentEncoding = Encoding.UTF8 - myResponse.ContentType = "application/force-download" - myResponse.AppendHeader("Content-Disposition", "filename=""" & fileName & ".xml""") - - myResponse.Write(fileContent) - myResponse.End() - - GenerateXmlFile = True - Catch exc As Exception - GenerateXmlFile = False - End Try - End Function - - ''' - ''' Generate the csv file for downloading the enrollees for this event. - ''' - Private Function GenerateCsvFile(ByVal theEvent As EventInfo, ByVal csvDoc As String) As Boolean - GenerateCsvFile = False - - 'Name the file with a timestamp. - Dim fileName As String = theEvent.EventName - If Not String.IsNullOrEmpty(Localization.GetString("EnrollmentsFile.Text", LocalResourceFile)) Then - fileName &= " - " & Localization.GetString("EnrollmentsFile.Text", LocalResourceFile) - End If - fileName &= DateTime.Now.ToString(" - yyyyMMdd_HHmmss") - - 'The contents of the file. - Dim fileContent As String = csvDoc - - Try - 'Stream the file. - Dim myContext As HttpContext = HttpContext.Current - Dim myResponse As HttpResponse - myResponse = myContext.Response - myResponse.ContentEncoding = Encoding.UTF8 - myResponse.ContentType = "application/force-download" - myResponse.AppendHeader("Content-Disposition", "filename=""" & fileName & ".csv""") - - myResponse.Write(fileContent) - myResponse.End() - - GenerateCsvFile = True - Catch exc As Exception - GenerateCsvFile = False - End Try - End Function - - Private Function GetPropertyForDownload(ByRef objUser As UserInfo, ByVal propertyName As String) As String - GetPropertyForDownload = Nothing - - If Not String.IsNullOrEmpty(propertyName) Then - Dim profileProperty As ProfilePropertyDefinition = objUser.Profile.GetProperty(propertyName) - - If profileProperty IsNot Nothing Then - GetPropertyForDownload = profileProperty.PropertyValue - End If - End If - End Function - - Private Sub ShowMessage(ByVal msg As String, ByVal messageLevel As MessageLevel) - lblMessage.Text = msg - - 'Hide the rest of the form fields. - divMessage.Attributes.Add("style", "display:block;") - - Select Case messageLevel - Case messageLevel.DNNSuccess - divMessage.Attributes.Add("class", "dnnFormMessage dnnFormSuccess") - Case messageLevel.DNNInformation - divMessage.Attributes.Add("class", "dnnFormMessage dnnFormInfo") - Case messageLevel.DNNWarning - divMessage.Attributes.Add("class", "dnnFormMessage dnnFormWarning") - Case messageLevel.DNNError - divMessage.Attributes.Add("class", "dnnFormMessage dnnFormValidationSummary") - End Select - End Sub -#End Region - -#Region "Links and Buttons" - ''' - ''' When delete button is clicked the current event will be removed - ''' - Private Sub deleteButton_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles deleteButton.Click - Try - Dim iItemID As Integer = ItemId - Dim objCtlEvent As New EventController - Dim objEvent As EventInfo = objCtlEvent.EventsGet(iItemID, ModuleId) - If objEvent.RRULE <> "" Then - objEvent.Cancelled = True - objEvent.LastUpdatedID = UserId - objCtlEvent.EventsSave(objEvent, True, TabId, True) - Else - Dim objCtlEventRecurMaster As New EventRecurMasterController - objCtlEventRecurMaster.EventsRecurMasterDelete(objEvent.RecurMasterID, objEvent.ModuleID) - End If - Response.Redirect(GetSocialNavigateUrl(), True) - Catch ex As Threading.ThreadAbortException - 'Ignore - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub - - ''' - ''' When delete series button is clicked the current event series will be removed - ''' - Private Sub deleteSeriesButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles deleteSeriesButton.Click - Try - Dim iItemID As Integer = ItemId - Dim objCtlEvent As New EventController - Dim objEvent As EventInfo = objCtlEvent.EventsGet(iItemID, ModuleId) - Dim objCtlEventRecurMaster As New EventRecurMasterController - objCtlEventRecurMaster.EventsRecurMasterDelete(objEvent.RecurMasterID, objEvent.ModuleID) - Response.Redirect(GetSocialNavigateUrl(), True) - Catch ex As Threading.ThreadAbortException - 'Ignore - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub - - ''' - ''' When Export simple button is clicked the current event will be exported to a vcard - ''' - Private Sub cmdvEvent_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdvEvent.Click - ExportEvent(False) - End Sub - - ''' - ''' When Export event series button is clicked the current event will be exported to a vcard - ''' - Private Sub cmdvEventSeries_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdvEventSeries.Click - ExportEvent(True) - End Sub - - ''' - ''' When Download event signups button is clicked the current event signups will be written to an XML file for download. - ''' - Private Sub cmdvEventSignups_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdvEventSignups.Click - DownloadSignups() - End Sub - - ''' - ''' When return button is clicked the user is redirected to the previous page - ''' - ''' - Private Sub returnButton_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles returnButton.Click - Try - Response.Redirect(GetSocialNavigateUrl(), True) - Catch ex As Threading.ThreadAbortException - 'Ignore - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub - - ''' - ''' When signup button is clicked the user will be signed up for the event - ''' - ''' - ''' - ''' - Private Sub cmdSignup_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles cmdSignup.Click - If Not Request.IsAuthenticated And Not Settings.AllowAnonEnroll Then - RedirectToLogin() - End If - - Try - Dim objEvent As EventInfo - Dim objCtlEvent As New EventController - objEvent = objCtlEvent.EventsGet(ItemId, ModuleId) - If Not Request.IsAuthenticated And Not objEvent.AllowAnonEnroll Then - RedirectToLogin() - End If - - ' In case of custom enrollment page. - If Settings.EnrollmentPageAllowed Then - If Not String.IsNullOrEmpty(Settings.EnrollmentPageDefaultUrl) Then - Response.Redirect(Settings.EnrollmentPageDefaultUrl & "?mod=" & ModuleId & "&event=" & ItemId) - End If - Exit Sub - End If - - ' In case of standard paid enrollment. - ' Check to see if unauthenticated user has already enrolled - Dim objCtlEventSignups As New EventSignupsController - If Not Request.IsAuthenticated Then - Dim objEventsSignups As EventSignupsInfo - objEventsSignups = objCtlEventSignups.EventsSignupsGetAnonUser(objEvent.EventID, txtAnonEmail.Text, objEvent.ModuleID) - If Not objEventsSignups Is Nothing Then - ShowMessage(Localization.GetString("YouAreAlreadyEnrolledForThisEvent", LocalResourceFile), MessageLevel.DNNWarning) - enroll1.Visible = False - enroll3.Visible = False - enroll5.Visible = False - Exit Sub - End If - End If - - If objEvent.EnrollType = "PAID" Then - ' Paid Even Process - Try - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - Dim socialGroupId As Integer = GetUrlGroupId() - If Request.IsAuthenticated Then - If socialGroupId > 0 Then - Response.Redirect(objEventInfoHelper.AddSkinContainerControls(NavigateURL(TabId, "PPEnroll", "Mid=" & ModuleId, "ItemID=" & ItemId, "NoEnrol=" & txtNoEnrolees.Text, "groupid=" & socialGroupId.ToString), "?")) - Else - Response.Redirect(objEventInfoHelper.AddSkinContainerControls(NavigateURL(TabId, "PPEnroll", "Mid=" & ModuleId, "ItemID=" & ItemId, "NoEnrol=" & txtNoEnrolees.Text), "?")) - End If - Else - Dim urlAnonTelephone As String = Trim(txtAnonTelephone.Text) - If urlAnonTelephone = "" Then - urlAnonTelephone = "0" - End If - If socialGroupId > 0 Then - Response.Redirect(objEventInfoHelper.AddSkinContainerControls(NavigateURL(TabId, "PPEnroll", "Mid=" & ModuleId, "ItemID=" & ItemId, "NoEnrol=" & txtNoEnrolees.Text, "groupid=" & socialGroupId.ToString, "AnonEmail=" & HttpUtility.UrlEncode(txtAnonEmail.Text), "AnonName=" & HttpUtility.UrlEncode(txtAnonName.Text), "AnonPhone=" & HttpUtility.UrlEncode(urlAnonTelephone)), "&")) - Else - Response.Redirect(objEventInfoHelper.AddSkinContainerControls(NavigateURL(TabId, "PPEnroll", "Mid=" & ModuleId, "ItemID=" & ItemId, "NoEnrol=" & txtNoEnrolees.Text, "AnonEmail=" & HttpUtility.UrlEncode(txtAnonEmail.Text), "AnonName=" & HttpUtility.UrlEncode(txtAnonName.Text), "AnonPhone=" & HttpUtility.UrlEncode(urlAnonTelephone)), "&")) - End If - End If - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - Else - ' Non-Paid Event Process - ' Got the Event, Now Add the User to the EventSignups - Dim objEventSignups As New EventSignupsInfo - objEventSignups.EventID = objEvent.EventID - - Dim startdate As DateTime = objEvent.EventTimeBegin - SelectedDate = startdate.Date - - objEventSignups.ModuleID = objEvent.ModuleID - If Request.IsAuthenticated Then - objEventSignups.UserID = UserId - objEventSignups.AnonEmail = Nothing - objEventSignups.AnonName = Nothing - objEventSignups.AnonTelephone = Nothing - objEventSignups.AnonCulture = Nothing - objEventSignups.AnonTimeZoneId = Nothing - Else - Dim objSecurity As New PortalSecurity - objEventSignups.UserID = -1 - objEventSignups.AnonEmail = txtAnonEmail.Text - objEventSignups.AnonName = objSecurity.InputFilter(txtAnonName.Text, PortalSecurity.FilterFlag.NoScripting) - objEventSignups.AnonTelephone = objSecurity.InputFilter(txtAnonTelephone.Text, PortalSecurity.FilterFlag.NoScripting) - objEventSignups.AnonCulture = Threading.Thread.CurrentThread.CurrentCulture.Name - objEventSignups.AnonTimeZoneId = GetDisplayTimeZoneId() - End If - objEventSignups.PayPalPaymentDate = DateTime.UtcNow - objEventSignups.NoEnrolees = CInt(txtNoEnrolees.Text) - If IsModerator() Or _ - PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) Then - objEventSignups.Approved = True - objEvent.Enrolled += 1 - ElseIf Settings.Moderateall Then - objEventSignups.Approved = False - Else - objEventSignups.Approved = True - objEvent.Enrolled += 1 - End If - objEventSignups = CreateEnrollment(objEventSignups, objEvent) - enroll1.Visible = False - Dim msgLevel As MessageLevel = UserEnrollment(objEvent) - ShowMessage(lblSignup.Text, msgLevel) - ' Send Moderator email - Dim objEventEmailInfo As New EventEmailInfo - Dim objEventEmail As New EventEmails(PortalId, ModuleId, LocalResourceFile, CType(Page, PageBase).PageCulture.Name) - If Settings.Moderateall And objEventSignups.Approved = False Then - objEventEmailInfo.TxtEmailSubject = Settings.Templates.moderateemailsubject - objEventEmailInfo.TxtEmailBody = Settings.Templates.moderateemailmessage - objEventEmailInfo.TxtEmailFrom() = Settings.StandardEmail - Dim moderators As ArrayList = GetModerators() - For Each moderator As UserInfo In moderators - objEventEmailInfo.UserEmails.Add(moderator.Email) - objEventEmailInfo.UserLocales.Add(moderator.Profile.PreferredLocale) - objEventEmailInfo.UserTimeZoneIds.Add(moderator.Profile.PreferredTimeZone.Id) - Next - objEventEmail.SendEmails(objEventEmailInfo, objEvent, objEventSignups) - End If - - ' Mail users - objEventEmailInfo = New EventEmailInfo - objEventEmailInfo.TxtEmailSubject = Settings.Templates.txtEnrollMessageSubject - objEventEmailInfo.TxtEmailFrom() = Settings.StandardEmail - If Request.IsAuthenticated Then - objEventEmailInfo.UserEmails.Add(PortalSettings.UserInfo.Email) - objEventEmailInfo.UserLocales.Add(PortalSettings.UserInfo.Profile.PreferredLocale) - objEventEmailInfo.UserTimeZoneIds.Add(PortalSettings.UserInfo.Profile.PreferredTimeZone.Id) - Else - objEventEmailInfo.UserEmails.Add(objEventSignups.AnonEmail) - objEventEmailInfo.UserLocales.Add(objEventSignups.AnonCulture) - objEventEmailInfo.UserTimeZoneIds.Add(objEventSignups.AnonTimeZoneId) - End If - objEventEmailInfo.UserIDs.Add(objEvent.OwnerID) - If objEventSignups.Approved Then - If Settings.SendEnrollMessageApproved Then - objEventEmailInfo.TxtEmailBody = Settings.Templates.txtEmailMessage & Settings.Templates.txtEnrollMessageApproved - objEventEmail.SendEmails(objEventEmailInfo, objEvent, objEventSignups) - End If - Else - If Settings.SendEnrollMessageWaiting Then - objEventEmailInfo.TxtEmailBody = Settings.Templates.txtEmailMessage & Settings.Templates.txtEnrollMessageWaiting - objEventEmail.SendEmails(objEventEmailInfo, objEvent, objEventSignups) - End If - End If - - End If - BindEnrollList(objEvent) - - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub - - ''' - ''' When notify button is clicked the user will be added to the notification list - ''' - ''' - ''' - ''' - Private Sub cmdNotify_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles cmdNotify.Click - valEmail.Validate() - valEmail2.Validate() - If Not valEmail.IsValid Or Not valEmail2.IsValid Then - Return - End If - - Dim lstEvents As New ArrayList - Dim objEventNotification As EventNotificationInfo - Dim objEventNotificationController As EventNotificationController = New EventNotificationController - Dim eventDate As DateTime - Dim notifyTime As DateTime - Dim currentEv As Integer - Dim objEventTimeZoneUtilities As New EventTimeZoneUtilities - Try - Dim eventEvent As EventInfo - Dim objCtlEvent As New EventController - eventEvent = objCtlEvent.EventsGet(ItemId, ModuleId) - currentEv = eventEvent.EventID - - If chkReminderRec.Checked Then - lstEvents = objCtlEvent.EventsGetRecurrences(eventEvent.RecurMasterID, ModuleId) - Else - lstEvents.Add(eventEvent) - End If - - For Each eventEvent In lstEvents - If eventEvent.SendReminder = True And eventEvent.EventTimeBegin > objEventTimeZoneUtilities.ConvertFromUTCToModuleTimeZone(Date.UtcNow, eventEvent.EventTimeZoneId) Then - eventDate = objEventTimeZoneUtilities.ConvertToUTCTimeZone(eventEvent.EventTimeBegin, eventEvent.EventTimeZoneId) - objEventNotification = objEventNotificationController.EventsNotificationGet(eventEvent.EventID, txtUserEmail.Text, ModuleId) - - notifyTime = eventDate - '*** Calculate notification time - Select Case ddlReminderTimeMeasurement.SelectedValue - Case "m" - notifyTime = notifyTime.AddMinutes(CInt(txtReminderTime.Text) * -1) - Case "h" - notifyTime = notifyTime.AddHours(CInt(txtReminderTime.Text) * -1) - Case "d" - notifyTime = notifyTime.AddDays(CInt(txtReminderTime.Text) * -1) - End Select - ' Registered users will overwrite existing notifications (in recurring events) - Dim notifyDisplayTime As DateTime = objEventTimeZoneUtilities.ConvertFromUTCToDisplayTimeZone(notifyTime, GetDisplayTimeZoneId()).EventDate - If Not (objEventNotification Is Nothing) And Request.IsAuthenticated() Then - objEventNotification.NotifyByDateTime = notifyTime - objEventNotificationController.EventsNotificationSave(objEventNotification) - If currentEv = eventEvent.EventID Then - lblConfirmation.Text = String.Format(Localization.GetString("lblReminderConfirmation", LocalResourceFile), notifyDisplayTime.ToString) - ShowMessage(lblConfirmation.Text, MessageLevel.DNNSuccess) - End If - ' Anonymous users can never overwrite an existing notification - ElseIf Not (objEventNotification Is Nothing) Then - If currentEv = eventEvent.EventID Then - lblConfirmation.Text = String.Format(Localization.GetString("ReminderAlreadyReg", LocalResourceFile), txtUserEmail.Text.ToString, objEventNotification.NotifyByDateTime.ToString) - ShowMessage(lblConfirmation.Text, MessageLevel.DNNWarning) - End If - Else - objEventNotification = New EventNotificationInfo - objEventNotification.NotificationID = -1 - objEventNotification.EventID = eventEvent.EventID - objEventNotification.PortalAliasID = PortalAlias.PortalAliasID - objEventNotification.NotificationSent = False - objEventNotification.EventTimeBegin = eventDate - objEventNotification.NotifyLanguage = Threading.Thread.CurrentThread.CurrentCulture.Name - objEventNotification.ModuleID = ModuleId - objEventNotification.TabID = TabId - objEventNotification.NotifyByDateTime = notifyTime - objEventNotification.UserEmail = txtUserEmail.Text - objEventNotificationController.EventsNotificationSave(objEventNotification) - If currentEv = eventEvent.EventID Then - lblConfirmation.Text = String.Format(Localization.GetString("lblReminderConfirmation", LocalResourceFile), notifyDisplayTime.ToString) - ShowMessage(lblConfirmation.Text, MessageLevel.DNNSuccess) - End If - End If - End If - Next - rem1.Visible = False - rem2.Visible = False - rem3.Visible = True - imgConfirmation.AlternateText = Localization.GetString("Reminder", LocalResourceFile) - Catch exc As Exception - ProcessModuleLoadException(Me, exc) - End Try - End Sub - - Private Sub cmdPrint_PreRender(ByVal sender As Object, ByVal e As EventArgs) Handles cmdPrint.PreRender - - cmdPrint.Target = " _blank" - cmdPrint.NavigateUrl = NavigateURL(TabId, PortalSettings, "", "mid=" & ModuleId, "itemid=" & ItemId, "ctl=Details", "ShowNav=False", "dnnprintmode=true", "SkinSrc=%5bG%5dSkins%2f_default%2fNo+Skin", "ContainerSrc=%5bG%5dContainers%2f_default%2fNo+Container") - - End Sub - Private Sub cmdEmail_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdEmail.Click - valEmailiCal.Validate() - valEmailiCal2.Validate() - If Not valEmailiCal.IsValid Or Not valEmailiCal2.IsValid Then - Return - End If - - Dim objCtlEvent As New EventController - Dim objEvent As EventInfo = objCtlEvent.EventsGet(ItemId, ModuleId) - If objEvent Is Nothing Then - Exit Sub - End If - - Dim iCalendar As New VEvent(False, HttpContext.Current) - Dim iCal As String - iCal = iCalendar.CreateiCal(TabId, ModuleId, ItemId, objEvent.SocialGroupId) - - Dim attachment As Net.Mail.Attachment = Net.Mail.Attachment.CreateAttachmentFromString(iCal, New Net.Mime.ContentType("text/calendar")) - attachment.TransferEncoding = Net.Mime.TransferEncoding.Base64 - attachment.Name = objEvent.EventName + ".ics" - Dim attachments As New Generic.List(Of Net.Mail.Attachment) - attachments.Add(attachment) - - Dim objEventEmailInfo As New EventEmailInfo - Dim objEventEmail As New EventEmails(PortalId, ModuleId, LocalResourceFile, CType(Page, PageBase).PageCulture.Name) - objEventEmailInfo.TxtEmailSubject = Settings.Templates.EventiCalSubject - objEventEmailInfo.TxtEmailBody = Settings.Templates.EventiCalBody - objEventEmailInfo.TxtEmailFrom() = Settings.StandardEmail - objEventEmailInfo.UserEmails.Add(txtUserEmailiCal.Text) - objEventEmailInfo.UserLocales.Add("") - objEventEmailInfo.UserTimeZoneIds.Add(objEvent.EventTimeZoneId) - - objEventEmail.SendEmails(objEventEmailInfo, objEvent, attachments) - divMessage.Attributes.Add("style", "display:block;") - ShowMessage(String.Format(Localization.GetString("ConfirmationiCal", LocalResourceFile), txtUserEmailiCal.Text), MessageLevel.DNNSuccess) - - End Sub - -#End Region - - End Class -End Namespace \ No newline at end of file diff --git a/EventEditCategories.ascx b/EventEditCategories.ascx index 8cefa64..d045c04 100644 --- a/EventEditCategories.ascx +++ b/EventEditCategories.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="vb" AutoEventWireup="false" Codebehind="EventEditCategories.ascx.vb" Inherits="DotNetNuke.Modules.Events.EventEditCategories" %> +<%@ Control Language="C#" AutoEventWireup="true" Codebehind="EventEditCategories.ascx.cs" Inherits="DotNetNuke.Modules.Events.EventEditCategories" %> <%@ Register Src="~/controls/LabelControl.ascx" TagName="Label" TagPrefix="dnn" %> <%@ Register TagPrefix="dnn" Assembly="DotNetNuke.Web" Namespace="DotNetNuke.Web.UI.WebControls" %> <%@ Register TagPrefix="dnn" Assembly="DotNetNuke.Web.Deprecated" Namespace="DotNetNuke.Web.UI.WebControls" %> @@ -60,9 +60,9 @@
    -
  • -
  • -
  • +
  • +
  • +
@@ -83,21 +83,21 @@ - + - + - - + + @@ -109,3 +109,4 @@
+ diff --git a/EventEditCategories.ascx.cs b/EventEditCategories.ascx.cs new file mode 100644 index 0000000..4909cda --- /dev/null +++ b/EventEditCategories.ascx.cs @@ -0,0 +1,361 @@ +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using System.Drawing; +using System.Web.UI.WebControls; +using System.Collections; +using DotNetNuke.Services.Localization; +using System; +using DotNetNuke.Security; + + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events +{ + + [DNNtc.ModuleControlProperties("Categories", "Edit Event Categories", DNNtc.ControlType.View, "https://dnnevents.codeplex.com/documentation", false, true)] + public partial class EventEditCategories : EventBase + { + + #region Web Form Designer Generated Code + + //This call is required by the Web Form Designer. + [DebuggerStepThrough()] + private void InitializeComponent() + { + + } + + private void Page_Init(System.Object sender, EventArgs e) + { + //CODEGEN: This method call is required by the Web Form Designer + //Do not modify it using the code editor. + InitializeComponent(); + + //Add the external Validation.js to the Page + const string csname = "ExtValidationScriptFile"; + Type cstype = System.Reflection.MethodBase.GetCurrentMethod().GetType(); + string cstext = ""; + if (!Page.ClientScript.IsClientScriptBlockRegistered(csname)) + { + Page.ClientScript.RegisterClientScriptBlock(cstype, csname, cstext, false); + } + + const string csname2 = "LoadPreview"; + Type cstype2 = System.Reflection.MethodBase.GetCurrentMethod().GetType(); + string cstext2 = ""; + Page.ClientScript.RegisterStartupScript(cstype2, csname2, cstext2, false); + + string previewScript = ""; + previewScript = "CategoryPreviewPane('" + cpBackColor.ClientID + "','" + cpForeColor.ClientID + "','" + previewpane.ClientID + "','" + lblPreviewCat.ClientID + "','" + txtCategoryFontColor.ClientID + "','" + txtCategoryColor.ClientID + "','" + txtCategoryName.ClientID + ("','" + Localization.GetString("InvalidColor", LocalResourceFile) + "');"); + + const string csname3 = "ColorPicker"; + Type cstype3 = System.Reflection.MethodBase.GetCurrentMethod().GetType(); + string cstext3 = ""; + if (!Page.ClientScript.IsClientScriptBlockRegistered(csname3)) + { + Page.ClientScript.RegisterClientScriptBlock(cstype3, csname3, cstext3, false); + } + + txtCategoryName.Attributes.Add("onchange", "byid('" + lblPreviewCat.ClientID + "').innerHTML = this.value;"); + + txtCategoryFontColor.Attributes.Add("onchange", previewScript); + txtCategoryColor.Attributes.Add("onchange", previewScript); + + + //ColorPicker Icons + + } + + #endregion + + #region Private Area + + //Private itemId As Integer + private EventCategoryController _objCtlCategory = new EventCategoryController(); + private EventCategoryInfo _objCategory = new EventCategoryInfo(); + private ArrayList _colCategories; + private const string DefaultBackColor = "#ffffff"; + private const string DefaultFontColor = "#000000"; + + #endregion + + #region Event Handler + + private void Page_Load(System.Object sender, EventArgs e) + { + + LocalizeAll(); + + if (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString()) || + IsCategoryEditor()) + { + } + else + { + Response.Redirect(GetSocialNavigateUrl(), true); + } + + // Set the selected theme + SetTheme(pnlEventsModuleCategories); + + if (!Page.IsPostBack) + { + SetDefaultValues(); + BindData(); + } + } + + #endregion + + #region Helper Routines + + private void LocalizeAll() + { + GrdCategories.Columns[3].HeaderText = Localization.GetString("plCategoryName", LocalResourceFile); + } + + private void BindData() + { + int i = 0; + + _colCategories = _objCtlCategory.EventsCategoryList(PortalId); + GrdCategories.DataSource = _colCategories; + GrdCategories.DataBind(); + if (GrdCategories.Items.Count > 0) + { + GrdCategories.Visible = true; + for (i = 0; i <= GrdCategories.Items.Count - 1; i++) + { + ((ImageButton)(GrdCategories.Items[i].FindControl("DeleteButton"))).Attributes.Add("onclick", "javascript:return confirm('" + Localization.GetString("AreYouSureYouWishToDelete.Text", LocalResourceFile) + "');"); + } + } + + } + + #endregion + + #region Control Events + + protected void GrdCategories_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) + { + switch (e.CommandName) + { + case "Select": + int category = System.Convert.ToInt16(GrdCategories.DataKeys[e.Item.ItemIndex]); + _objCategory = _objCtlCategory.EventCategoryGet(category, PortalId); + txtCategoryName.Text = _objCategory.CategoryName; + if (_objCategory.Color != "") + { + txtCategoryColor.Text = _objCategory.Color; + cpBackColor.SelectedColor = ColorTranslator.FromHtml(txtCategoryColor.Text); + } + else + { + txtCategoryColor.Text = ""; + cpBackColor.SelectedColor = ColorTranslator.FromHtml(DefaultBackColor); + } + if (_objCategory.FontColor != "") + { + txtCategoryFontColor.Text = _objCategory.FontColor; + cpForeColor.SelectedColor = ColorTranslator.FromHtml(txtCategoryFontColor.Text); + } + else + { + txtCategoryFontColor.Text = ""; + cpForeColor.SelectedColor = ColorTranslator.FromHtml(DefaultFontColor); + } + + //Remember that we might use update + ViewState.Add("Category", _objCategory.Category.ToString()); + cmdUpdate.Visible = true; + + BindData(); + break; + } + } + + protected void GrdCategories_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) + { + int category = 0; + category = System.Convert.ToInt32(GrdCategories.DataKeys[e.Item.ItemIndex]); + divDeleteError.Visible = false; + + Entities.Modules.DesktopModuleInfo objDesktopModule = default(Entities.Modules.DesktopModuleInfo); + Entities.Modules.ModuleController objModules = new Entities.Modules.ModuleController(); + objDesktopModule = Entities.Modules.DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", PortalId); + ArrayList lstModules = objModules.GetModulesByDefinition(PortalId, objDesktopModule.FriendlyName); + foreach (Entities.Modules.ModuleInfo objModule in lstModules) + { + EventModuleSettings ems = new EventModuleSettings(); + ArrayList categories = ems.GetEventModuleSettings(objModule.ModuleID, null).ModuleCategoryIDs; + if (categories.Contains(category)) + { + lblDeleteError.Text = string.Format(Localization.GetString("lblDeleteError", LocalResourceFile), objModule.ModuleTitle); + divDeleteError.Visible = true; + return; + } + } + + + _objCtlCategory.EventsCategoryDelete(category, PortalId); + BindData(); + + //Be sure we cannot update any more + txtCategoryName.Text = ""; + txtCategoryColor.Text = ""; + txtCategoryFontColor.Text = ""; + ViewState.Remove("Category"); + cmdUpdate.Visible = false; + cpBackColor.SelectedColor = ColorTranslator.FromHtml(DefaultBackColor); + cpForeColor.SelectedColor = ColorTranslator.FromHtml(DefaultFontColor); + + } + + protected void cmdUpdate_Click(object sender, EventArgs e) + { + try + { + + // Only Update if the Entered Data is Valid + if (Page.IsValid && !string.IsNullOrEmpty(txtCategoryName.Text)) + { + EventCategoryInfo objCategory = new EventCategoryInfo(); + PortalSecurity objSecurity = new PortalSecurity(); + string categoryName = ""; + + // Filter text for non-admins + if (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString()) == true) + { + categoryName = txtCategoryName.Text; + } + else + { + categoryName = objSecurity.InputFilter(txtCategoryName.Text, PortalSecurity.FilterFlag.NoScripting); + } + + //bind text values to object + + objCategory.Category = System.Convert.ToInt32(ViewState["Category"]); + objCategory.PortalID = PortalId; + objCategory.CategoryName = categoryName; + objCategory.Color = txtCategoryColor.Text; + objCategory.FontColor = txtCategoryFontColor.Text; + _objCtlCategory.EventsCategorySave(objCategory); + + SetDefaultValues(); + } + + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + + BindData(); + + } + + protected void cmdAdd_Click(object sender, EventArgs e) + { + try + { + // Only Update if the Entered Data is Valid + if (Page.IsValid == true && !string.IsNullOrEmpty(txtCategoryName.Text)) + { + EventCategoryInfo objCategory = new EventCategoryInfo(); + PortalSecurity objSecurity = new PortalSecurity(); + string categoryName = ""; + + // Filter text for non-admins + if (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString()) == true) + { + categoryName = txtCategoryName.Text; + } + else + { + categoryName = objSecurity.InputFilter(txtCategoryName.Text, PortalSecurity.FilterFlag.NoScripting); + } + + //bind text values to object + + objCategory.Category = 0; + objCategory.PortalID = PortalId; + objCategory.CategoryName = categoryName; + objCategory.Color = txtCategoryColor.Text; + objCategory.FontColor = txtCategoryFontColor.Text; + _objCtlCategory.EventsCategorySave(objCategory); + + SetDefaultValues(); + } + + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + + BindData(); + + } + + protected void returnButton_Click(System.Object sender, EventArgs e) + { + try + { + Response.Redirect(GetSocialNavigateUrl(), true); + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + + #endregion + + #region Private Functions + private void SetDefaultValues() + { + //Back to normal (add) mode + txtCategoryName.Text = ""; + txtCategoryColor.Text = ""; + txtCategoryFontColor.Text = ""; + ViewState.Remove("Category"); + cmdUpdate.Visible = false; + cpBackColor.SelectedColor = ColorTranslator.FromHtml(DefaultBackColor); + cpForeColor.SelectedColor = ColorTranslator.FromHtml(DefaultFontColor); + } + + #endregion + + } + +} + diff --git a/EventEditCategories.ascx.designer.cs b/EventEditCategories.ascx.designer.cs new file mode 100644 index 0000000..8d3724f --- /dev/null +++ b/EventEditCategories.ascx.designer.cs @@ -0,0 +1,213 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DotNetNuke.Modules.Events { + + + public partial class EventEditCategories { + + /// + /// pnlEventsModuleCategories control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlEventsModuleCategories; + + /// + /// divDeleteError control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divDeleteError; + + /// + /// lblDeleteError control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblDeleteError; + + /// + /// lblCategoryCap control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblCategoryCap; + + /// + /// txtCategoryName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtCategoryName; + + /// + /// valRequiredName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequiredName; + + /// + /// lblColorCap control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblColorCap; + + /// + /// txtCategoryColor control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtCategoryColor; + + /// + /// cpBackColor control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Web.UI.WebControls.DnnColorPicker cpBackColor; + + /// + /// ValColor control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CustomValidator ValColor; + + /// + /// lblFontColorCap control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblFontColorCap; + + /// + /// txtCategoryFontColor control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtCategoryFontColor; + + /// + /// cpForeColor control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Web.UI.WebControls.DnnColorPicker cpForeColor; + + /// + /// CalFontColor control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CustomValidator CalFontColor; + + /// + /// lblPreview control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblPreview; + + /// + /// previewpane control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable previewpane; + + /// + /// lblPreviewCat control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl lblPreviewCat; + + /// + /// cmdAdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdAdd; + + /// + /// cmdUpdate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdUpdate; + + /// + /// returnButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton returnButton; + + /// + /// GrdCategories control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DataGrid GrdCategories; + + /// + /// lblEditMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEditMessage; + } +} diff --git a/EventEditCategories.ascx.designer.vb b/EventEditCategories.ascx.designer.vb deleted file mode 100644 index e90d86e..0000000 --- a/EventEditCategories.ascx.designer.vb +++ /dev/null @@ -1,215 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Namespace DotNetNuke.Modules.Events - - Partial Public Class EventEditCategories - - ''' - '''pnlEventsModuleCategories control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlEventsModuleCategories As Global.System.Web.UI.WebControls.Panel - - ''' - '''divDeleteError control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divDeleteError As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblDeleteError control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblDeleteError As Global.System.Web.UI.WebControls.Label - - ''' - '''lblCategoryCap control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblCategoryCap As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtCategoryName control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtCategoryName As Global.System.Web.UI.WebControls.TextBox - - ''' - '''valRequiredName control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valRequiredName As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''lblColorCap control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblColorCap As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtCategoryColor control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtCategoryColor As Global.System.Web.UI.WebControls.TextBox - - ''' - '''cpBackColor control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cpBackColor As Global.DotNetNuke.Web.UI.WebControls.DnnColorPicker - - ''' - '''ValColor control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ValColor As Global.System.Web.UI.WebControls.CustomValidator - - ''' - '''lblFontColorCap control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblFontColorCap As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtCategoryFontColor control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtCategoryFontColor As Global.System.Web.UI.WebControls.TextBox - - ''' - '''cpForeColor control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cpForeColor As Global.DotNetNuke.Web.UI.WebControls.DnnColorPicker - - ''' - '''CalFontColor control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents CalFontColor As Global.System.Web.UI.WebControls.CustomValidator - - ''' - '''lblPreview control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblPreview As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''previewpane control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents previewpane As Global.System.Web.UI.HtmlControls.HtmlTable - - ''' - '''lblPreviewCat control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblPreviewCat As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''cmdAdd control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdAdd As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''cmdUpdate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdUpdate As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''returnButton control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents returnButton As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''GrdCategories control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents GrdCategories As Global.System.Web.UI.WebControls.DataGrid - - ''' - '''lblEditMessage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEditMessage As Global.System.Web.UI.WebControls.Label - End Class -End Namespace diff --git a/EventEditCategories.ascx.vb b/EventEditCategories.ascx.vb deleted file mode 100644 index 1d0ea70..0000000 --- a/EventEditCategories.ascx.vb +++ /dev/null @@ -1,301 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - -Imports DotNetNuke.Security - -Namespace DotNetNuke.Modules.Events - - _ - Partial Class EventEditCategories - Inherits EventBase - -#Region " Web Form Designer Generated Code " - - 'This call is required by the Web Form Designer. - Private Sub InitializeComponent() - - End Sub - - Private Sub Page_Init(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Init - 'CODEGEN: This method call is required by the Web Form Designer - 'Do not modify it using the code editor. - InitializeComponent() - - 'Add the external Validation.js to the Page - Const csname As String = "ExtValidationScriptFile" - Dim cstype As Type = System.Reflection.MethodBase.GetCurrentMethod().GetType() - Dim cstext As String = "" - If Not Page.ClientScript.IsClientScriptBlockRegistered(csname) Then - Page.ClientScript.RegisterClientScriptBlock(cstype, csname, cstext, False) - End If - - Const csname2 As String = "LoadPreview" - Dim cstype2 As Type = System.Reflection.MethodBase.GetCurrentMethod().GetType() - Dim cstext2 As String = "" - Page.ClientScript.RegisterStartupScript(cstype2, csname2, cstext2, False) - - Dim previewScript As String - previewScript = "CategoryPreviewPane('" & cpBackColor.ClientID & "','" & cpForeColor.ClientID & "','" & previewpane.ClientID & "','" & lblPreviewCat.ClientID & "','" & txtCategoryFontColor.ClientID & "','" & txtCategoryColor.ClientID & "','" & txtCategoryName.ClientID & "','" + Localization.GetString("InvalidColor", LocalResourceFile) + "');" - - Const csname3 As String = "ColorPicker" - Dim cstype3 As Type = System.Reflection.MethodBase.GetCurrentMethod().GetType() - Dim cstext3 As String = "" - If Not Page.ClientScript.IsClientScriptBlockRegistered(csname3) Then - Page.ClientScript.RegisterClientScriptBlock(cstype3, csname3, cstext3, False) - End If - - txtCategoryName.Attributes.Add("onchange", "byid('" & lblPreviewCat.ClientID & "').innerHTML = this.value;") - - txtCategoryFontColor.Attributes.Add("onchange", previewScript) - txtCategoryColor.Attributes.Add("onchange", previewScript) - - - 'ColorPicker Icons - - End Sub - -#End Region - -#Region "Private Area" - - 'Private itemId As Integer - Private ReadOnly _objCtlCategory As New EventCategoryController - Private _objCategory As New EventCategoryInfo - Private _colCategories As ArrayList - Private Const DefaultBackColor As String = "#ffffff" - Private Const DefaultFontColor As String = "#000000" - -#End Region - -#Region "Event Handler" - - Private Sub Page_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load - - LocalizeAll() - - If PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) Or _ - IsCategoryEditor() Then - Else - Response.Redirect(GetSocialNavigateUrl(), True) - End If - - ' Set the selected theme - SetTheme(pnlEventsModuleCategories) - - If Not Page.IsPostBack Then - SetDefaultValues() - BindData() - End If - End Sub - -#End Region - -#Region "Helper Routines" - - Private Sub LocalizeAll() - GrdCategories.Columns(3).HeaderText = Localization.GetString("plCategoryName", LocalResourceFile) - End Sub - - Private Sub BindData() - Dim i As Integer - - _colCategories = _objCtlCategory.EventsCategoryList(PortalId) - GrdCategories.DataSource = _colCategories - GrdCategories.DataBind() - If GrdCategories.Items.Count > 0 Then - GrdCategories.Visible = True - For i = 0 To GrdCategories.Items.Count - 1 - CType(GrdCategories.Items(i).FindControl("DeleteButton"), ImageButton).Attributes.Add("onclick", "javascript:return confirm('" + Localization.GetString("AreYouSureYouWishToDelete.Text", LocalResourceFile) + "');") - Next - End If - - End Sub - -#End Region - -#Region "Control Events" - - Public Sub GrdCategories_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles GrdCategories.ItemCommand - Select Case e.CommandName - Case "Select" - Dim category As Integer = CType(GrdCategories.DataKeys(e.Item.ItemIndex), Int16) - _objCategory = _objCtlCategory.EventCategoryGet(category, PortalId) - txtCategoryName.Text = _objCategory.CategoryName - If _objCategory.Color <> "" Then - txtCategoryColor.Text = _objCategory.Color - cpBackColor.SelectedColor = ColorTranslator.FromHtml(txtCategoryColor.Text) - Else - txtCategoryColor.Text = "" - cpBackColor.SelectedColor = ColorTranslator.FromHtml(DefaultBackColor) - End If - If _objCategory.FontColor <> "" Then - txtCategoryFontColor.Text = _objCategory.FontColor - cpForeColor.SelectedColor = ColorTranslator.FromHtml(txtCategoryFontColor.Text) - Else - txtCategoryFontColor.Text = "" - cpForeColor.SelectedColor = ColorTranslator.FromHtml(DefaultFontColor) - End If - - 'Remember that we might use update - ViewState.Add("Category", _objCategory.Category.ToString()) - cmdUpdate.Visible = True - - BindData() - End Select - End Sub - - Public Sub GrdCategories_DeleteCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles GrdCategories.DeleteCommand - Dim category As Integer - category = CType(GrdCategories.DataKeys(e.Item.ItemIndex), Integer) - divDeleteError.Visible = False - - Dim objDesktopModule As Entities.Modules.DesktopModuleInfo - Dim objModules As New Entities.Modules.ModuleController - objDesktopModule = Entities.Modules.DesktopModuleController.GetDesktopModuleByModuleName("DNN_Events", PortalId) - Dim lstModules As ArrayList = objModules.GetModulesByDefinition(PortalId, objDesktopModule.FriendlyName) - For Each objModule As Entities.Modules.ModuleInfo In lstModules - Dim ems As New EventModuleSettings - Dim categories As ArrayList = ems.GetEventModuleSettings(objModule.ModuleID, Nothing).ModuleCategoryIDs - If categories.Contains(category) Then - lblDeleteError.Text = String.Format(Localization.GetString("lblDeleteError", LocalResourceFile), objModule.ModuleTitle) - divDeleteError.Visible = True - Return - End If - Next - - - _objCtlCategory.EventsCategoryDelete(category, PortalId) - BindData() - - 'Be sure we cannot update any more - txtCategoryName.Text = "" - txtCategoryColor.Text = "" - txtCategoryFontColor.Text = "" - ViewState.Remove("Category") - cmdUpdate.Visible = False - cpBackColor.SelectedColor = ColorTranslator.FromHtml(DefaultBackColor) - cpForeColor.SelectedColor = ColorTranslator.FromHtml(DefaultFontColor) - - End Sub - - Private Sub cmdUpdate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdUpdate.Click - Try - - ' Only Update if the Entered Data is Valid - If Page.IsValid And Not String.IsNullOrEmpty(txtCategoryName.Text) Then - Dim objCategory As New EventCategoryInfo - Dim objSecurity As New PortalSecurity - Dim categoryName As String - - ' Filter text for non-admins - If (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) = True) Then - categoryName = txtCategoryName.Text - Else - categoryName = objSecurity.InputFilter(txtCategoryName.Text, PortalSecurity.FilterFlag.NoScripting) - End If - - 'bind text values to object - - objCategory.Category = CInt(ViewState("Category")) - objCategory.PortalID = PortalId - objCategory.CategoryName = categoryName - objCategory.Color = txtCategoryColor.Text - objCategory.FontColor = txtCategoryFontColor.Text - _objCtlCategory.EventsCategorySave(objCategory) - - SetDefaultValues() - End If - - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - - BindData() - - End Sub - - Private Sub cmdAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdAdd.Click - Try - ' Only Update if the Entered Data is Valid - If Page.IsValid = True And Not String.IsNullOrEmpty(txtCategoryName.Text) Then - Dim objCategory As New EventCategoryInfo - Dim objSecurity As New PortalSecurity - Dim categoryName As String - - ' Filter text for non-admins - If (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) = True) Then - categoryName = txtCategoryName.Text - Else - categoryName = objSecurity.InputFilter(txtCategoryName.Text, PortalSecurity.FilterFlag.NoScripting) - End If - - 'bind text values to object - - objCategory.Category = 0 - objCategory.PortalID = PortalId - objCategory.CategoryName = categoryName - objCategory.Color = txtCategoryColor.Text - objCategory.FontColor = txtCategoryFontColor.Text - _objCtlCategory.EventsCategorySave(objCategory) - - SetDefaultValues() - End If - - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - - BindData() - - End Sub - - Private Sub returnButton_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles returnButton.Click - Try - Response.Redirect(GetSocialNavigateUrl(), True) - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub - -#End Region - -#Region "Private Functions" - Private Sub SetDefaultValues() - 'Back to normal (add) mode - txtCategoryName.Text = "" - txtCategoryColor.Text = "" - txtCategoryFontColor.Text = "" - ViewState.Remove("Category") - cmdUpdate.Visible = False - cpBackColor.SelectedColor = ColorTranslator.FromHtml(DefaultBackColor) - cpForeColor.SelectedColor = ColorTranslator.FromHtml(DefaultFontColor) - End Sub - -#End Region - - End Class - -End Namespace diff --git a/EventEditLocations.ascx b/EventEditLocations.ascx index 168e363..58b7d91 100644 --- a/EventEditLocations.ascx +++ b/EventEditLocations.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="vb" AutoEventWireup="false" Codebehind="EventEditLocations.ascx.vb" Inherits="DotNetNuke.Modules.Events.EventEditLocations" %> +<%@ Control Language="C#" AutoEventWireup="true" Codebehind="EventEditLocations.ascx.cs" Inherits="DotNetNuke.Modules.Events.EventEditLocations" %> <%@ Register Src="~/controls/LabelControl.ascx" TagName="Label" TagPrefix="dnn" %> <%@ Register Assembly="CountryListBox" Namespace="DotNetNuke.UI.WebControls" TagPrefix="dnn2" %> <%@ Register TagPrefix="dnn" TagName="Address" Src="~/controls/Address.ascx"%> @@ -42,9 +42,9 @@
    -
  • -
  • -
  • +
  • +
  • +
@@ -65,27 +65,27 @@ - + - + - - - <%# Container.DataItem.MapURL.ToString() %> + + <%# DataBinder.Eval(Container.DataItem, "MapURL") %> @@ -94,4 +94,4 @@ (Select Item Link to Edit)
- \ No newline at end of file + diff --git a/EventEditLocations.ascx.cs b/EventEditLocations.ascx.cs new file mode 100644 index 0000000..16b6d5e --- /dev/null +++ b/EventEditLocations.ascx.cs @@ -0,0 +1,410 @@ +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using System.Web.UI.WebControls; +using System.Collections; +using DotNetNuke.Services.Localization; +using System; +using DotNetNuke.Security; +using DotNetNuke.Common.Lists; +using System.Collections.Generic; +using System.Linq; + + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events +{ + + [DNNtc.ModuleControlProperties("Locations", "Edit Event Locations", DNNtc.ControlType.View, "https://dnnevents.codeplex.com/documentation", true, true)] + public partial class EventEditLocations : EventBase + { + + #region Web Form Designer Generated Code + + //This call is required by the Web Form Designer. + [DebuggerStepThrough()] + private void InitializeComponent() + { + + } + + private void Page_Init(System.Object sender, EventArgs e) + { + //CODEGEN: This method call is required by the Web Form Designer + //Do not modify it using the code editor. + InitializeComponent(); + + //Add the external Validation.js to the Page + const string csname = "ExtValidationScriptFile"; + Type cstype = System.Reflection.MethodBase.GetCurrentMethod().GetType(); + string cstext = ""; + if (!Page.ClientScript.IsClientScriptBlockRegistered(csname)) + { + Page.ClientScript.RegisterClientScriptBlock(cstype, csname, cstext, false); + } + + } + + #endregion + + #region Private Area + + private EventLocationController _objCtlLocation = new EventLocationController(); + private EventLocationInfo _objLocation = new EventLocationInfo(); + private ArrayList _colLocations; + #endregion + + #region Event Handlers + private void Page_Load(System.Object sender, EventArgs e) + { + LocalizeAll(); + + if (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString()) || + IsLocationEditor()) + { + } + else + { + Response.Redirect(GetSocialNavigateUrl(), true); + } + + // Set the selected theme + SetTheme(pnlEventsModuleLocations); + + if (!Page.IsPostBack) + { + BindData(); + BindCountry(); + BindRegion(); + } + } + #endregion + + #region Helper Routines + private void LocalizeAll() + { + GrdLocations.Columns[3].HeaderText = Localization.GetString("plLocationName", LocalResourceFile); + GrdLocations.Columns[4].HeaderText = Localization.GetString("plMapURL", LocalResourceFile); + } + + private void BindData() + { + //Grid + int i = 0; + _colLocations = _objCtlLocation.EventsLocationList(PortalId); + GrdLocations.DataSource = _colLocations; + GrdLocations.DataBind(); + if (GrdLocations.Items.Count > 0) + { + GrdLocations.Visible = true; + for (i = 0; i <= GrdLocations.Items.Count - 1; i++) + { + ((ImageButton)(GrdLocations.Items[i].FindControl("DeleteButton"))).Attributes.Add("onclick", "javascript:return confirm('" + Localization.GetString("AreYouSureYouWishToDelete.Text", LocalResourceFile) + "');"); + } + } + } + + private void BindCountry() + { + ListController ctlEntry = new ListController(); + IEnumerable entryCollection = ctlEntry.GetListEntryInfoItems("Country"); + + cboCountry.DataSource = entryCollection; + cboCountry.DataBind(); + cboCountry.Items.Insert(0, new ListItem("<" + Localization.GetString("Not_Specified", Localization.SharedResourceFile) + ">", "")); + if (!Page.IsPostBack) + { + cboCountry.SelectedIndex = 0; + } + } + + private void BindRegion() + { + ListController ctlEntry = new ListController(); + string countryCode = System.Convert.ToString(cboCountry.SelectedItem.Value); + string listKey = "Country." + countryCode; // listKey in format "Country.US:Region" + System.Collections.Generic.IEnumerable entryCollection = ctlEntry.GetListEntryInfoItems("Region", listKey); + + if (entryCollection.Any()) + { + txtRegion.Visible = false; + cboRegion.Visible = true; + + cboRegion.Items.Clear(); + cboRegion.DataSource = entryCollection; + cboRegion.DataBind(); + cboRegion.Items.Insert(0, new ListItem("<" + Localization.GetString("Not_Specified", Localization.SharedResourceFile) + ">", "")); + + if (countryCode.ToLower() == "us") + { + lblRegionCap.Text = Localization.GetString("plState.Text", LocalResourceFile); + lblRegionCap.HelpText = Localization.GetString("plState.Help", LocalResourceFile); + lblPostalCodeCap.Text = Localization.GetString("plZipCode.Text", LocalResourceFile); + lblPostalCodeCap.HelpText = Localization.GetString("plZipCode.Help", LocalResourceFile); + } + else + { + lblRegionCap.Text = Localization.GetString("plRegion.Text", LocalResourceFile); + lblRegionCap.HelpText = Localization.GetString("plRegion.Help", LocalResourceFile); + lblPostalCodeCap.Text = Localization.GetString("plPostalCode.Text", LocalResourceFile); + lblPostalCodeCap.HelpText = Localization.GetString("plPostalCode.Help", LocalResourceFile); + } + } + else + { + txtRegion.Visible = true; + cboRegion.Visible = false; + + lblRegionCap.Text = Localization.GetString("plRegion.Text", LocalResourceFile); + lblRegionCap.HelpText = Localization.GetString("plRegion.Help", LocalResourceFile); + lblPostalCodeCap.Text = Localization.GetString("plPostalCode.Text", LocalResourceFile); + lblPostalCodeCap.HelpText = Localization.GetString("plPostalCode.Help", LocalResourceFile); + } + } + + private string PutHTTPInFront(string myURL) + { + if (myURL.ToLower().StartsWith("http://") || myURL.ToLower().StartsWith("https://")) + { + return myURL; + } + else if (myURL.Trim() == "") + { + return ""; + } + else + { + return DotNetNuke.Common.Globals.AddHTTP(myURL); + } + } + + protected void cmdUpdate_Click(object sender, EventArgs e) + { + try + { + SaveLocation(System.Convert.ToInt32(ViewState["Location"])); + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + BindData(); + } + + public void cmdAdd_Click(object sender, EventArgs e) + { + try + { + SaveLocation(0); + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + BindData(); + } + + private void SaveLocation(int locationID) + { + // Only Update if the Entered Data is Valid + if (Page.IsValid && !string.IsNullOrEmpty(txtLocationName.Text)) + { + + EventLocationInfo objLocation = new EventLocationInfo(); + PortalSecurity objSecurity = new PortalSecurity(); + string locationName = ""; + string mapURL = ""; + string street = ""; + string postalCode = ""; + string city = ""; + string region = null; + string country = null; + + // Filter text for non-admins + if (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString()) == true) + { + locationName = txtLocationName.Text; + mapURL = PutHTTPInFront(txtMapURL.Text); + street = txtStreet.Text; + postalCode = txtPostalCode.Text; + city = txtCity.Text; + if (cboRegion.SelectedIndex > 0) + { + region = cboRegion.SelectedItem.Text; + } + else + { + region = txtRegion.Text; + } + if (cboCountry.SelectedIndex > 0) + { + country = System.Convert.ToString(cboCountry.SelectedItem.Text); + } + } + else + { + locationName = objSecurity.InputFilter(txtLocationName.Text, PortalSecurity.FilterFlag.NoScripting); + mapURL = objSecurity.InputFilter(PutHTTPInFront(txtMapURL.Text), PortalSecurity.FilterFlag.NoScripting); + street = objSecurity.InputFilter(txtStreet.Text, PortalSecurity.FilterFlag.NoScripting); + postalCode = objSecurity.InputFilter(txtPostalCode.Text, PortalSecurity.FilterFlag.NoScripting); + city = objSecurity.InputFilter(txtCity.Text, PortalSecurity.FilterFlag.NoScripting); + if (cboRegion.SelectedIndex > 0) + { + region = objSecurity.InputFilter(cboRegion.SelectedItem.Text, PortalSecurity.FilterFlag.NoScripting); + } + else + { + region = objSecurity.InputFilter(txtRegion.Text, PortalSecurity.FilterFlag.NoScripting); + } + if (cboCountry.SelectedIndex > 0) + { + country = objSecurity.InputFilter(System.Convert.ToString(cboCountry.SelectedItem.Text), PortalSecurity.FilterFlag.NoScripting); + } + } + + //bind text values to object + objLocation.Location = locationID; + objLocation.PortalID = PortalId; + objLocation.LocationName = locationName; + objLocation.MapURL = mapURL; + objLocation.Street = street; + objLocation.PostalCode = postalCode; + objLocation.City = city; + objLocation.Region = region; + objLocation.Country = country; + _objCtlLocation.EventsLocationSave(objLocation); + + //Back to normal (add) mode + txtLocationName.Text = ""; + txtMapURL.Text = ""; + txtStreet.Text = ""; + txtPostalCode.Text = ""; + txtCity.Text = ""; + txtRegion.Text = ""; + cboRegion.ClearSelection(); + cboCountry.ClearSelection(); + + ViewState.Remove("Location"); + cmdUpdate.Visible = false; + } + } + + protected void OnCountryIndexChanged(object sender, EventArgs e) + { + try + { + BindRegion(); + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + #endregion + + #region Control Events + public void GrdLocations_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) + { + int location = 0; + location = System.Convert.ToInt32(GrdLocations.DataKeys[e.Item.ItemIndex]); + _objCtlLocation.EventsLocationDelete(location, PortalId); + BindData(); + + //Back to normal (add) mode + txtLocationName.Text = ""; + txtMapURL.Text = ""; + txtStreet.Text = ""; + txtPostalCode.Text = ""; + txtCity.Text = ""; + txtRegion.Text = ""; + cboRegion.ClearSelection(); + cboCountry.ClearSelection(); + + ViewState.Remove("Location"); + cmdUpdate.Visible = false; + } + + public void GrdLocations_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) + { + switch (e.CommandName) + { + case "Select": + int location = System.Convert.ToInt16(GrdLocations.DataKeys[e.Item.ItemIndex]); + _objLocation = _objCtlLocation.EventsLocationGet(location, PortalId); + + // Clear selections. + cboCountry.ClearSelection(); + cboRegion.ClearSelection(); + txtRegion.Text = string.Empty; + + // Fill fields. + txtLocationName.Text = _objLocation.LocationName; + txtMapURL.Text = _objLocation.MapURL; + txtStreet.Text = _objLocation.Street; + txtPostalCode.Text = _objLocation.PostalCode; + txtCity.Text = _objLocation.City; + + if (cboCountry.Items.FindByText(_objLocation.Country) != null) + { + cboCountry.Items.FindByText(_objLocation.Country).Selected = true; + } + BindRegion(); + if (cboRegion.Items.FindByText(_objLocation.Region) != null) + { + cboRegion.Items.FindByText(_objLocation.Region).Selected = true; + } + else + { + txtRegion.Text = _objLocation.Region; + } + + ViewState.Add("Location", _objLocation.Location.ToString()); + BindData(); + + //We can update + cmdUpdate.Visible = true; + break; + } + } + + protected void returnButton_Click(System.Object sender, EventArgs e) + { + try + { + Response.Redirect(GetSocialNavigateUrl(), true); + + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + + #endregion + + } + +} + + diff --git a/EventEditLocations.ascx.designer.cs b/EventEditLocations.ascx.designer.cs new file mode 100644 index 0000000..11aea6d --- /dev/null +++ b/EventEditLocations.ascx.designer.cs @@ -0,0 +1,213 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DotNetNuke.Modules.Events { + + + public partial class EventEditLocations { + + /// + /// pnlEventsModuleLocations control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlEventsModuleLocations; + + /// + /// lblLocationCap control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblLocationCap; + + /// + /// txtLocationName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtLocationName; + + /// + /// valRequiredName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequiredName; + + /// + /// lblMapURLCap control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblMapURLCap; + + /// + /// txtMapURL control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtMapURL; + + /// + /// lblStreetCap control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblStreetCap; + + /// + /// txtStreet control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtStreet; + + /// + /// lblPostalCodeCap control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.LabelControl lblPostalCodeCap; + + /// + /// txtPostalCode control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPostalCode; + + /// + /// lblCityCap control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblCityCap; + + /// + /// txtCity control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtCity; + + /// + /// lblCountryCap control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblCountryCap; + + /// + /// cboCountry control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.WebControls.CountryListBox cboCountry; + + /// + /// lblRegionCap control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.LabelControl lblRegionCap; + + /// + /// cboRegion control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList cboRegion; + + /// + /// txtRegion control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtRegion; + + /// + /// cmdAdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdAdd; + + /// + /// cmdUpdate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdUpdate; + + /// + /// returnButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton returnButton; + + /// + /// GrdLocations control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DataGrid GrdLocations; + + /// + /// lblEditMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEditMessage; + } +} diff --git a/EventEditLocations.ascx.designer.vb b/EventEditLocations.ascx.designer.vb deleted file mode 100644 index 611e667..0000000 --- a/EventEditLocations.ascx.designer.vb +++ /dev/null @@ -1,215 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Namespace DotNetNuke.Modules.Events - - Partial Public Class EventEditLocations - - ''' - '''pnlEventsModuleLocations control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlEventsModuleLocations As Global.System.Web.UI.WebControls.Panel - - ''' - '''lblLocationCap control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblLocationCap As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtLocationName control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtLocationName As Global.System.Web.UI.WebControls.TextBox - - ''' - '''valRequiredName control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valRequiredName As Global.System.Web.UI.WebControls.RequiredFieldValidator - - ''' - '''lblMapURLCap control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblMapURLCap As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtMapURL control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtMapURL As Global.System.Web.UI.WebControls.TextBox - - ''' - '''lblStreetCap control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblStreetCap As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtStreet control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtStreet As Global.System.Web.UI.WebControls.TextBox - - ''' - '''lblPostalCodeCap control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblPostalCodeCap As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtPostalCode control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtPostalCode As Global.System.Web.UI.WebControls.TextBox - - ''' - '''lblCityCap control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblCityCap As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtCity control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtCity As Global.System.Web.UI.WebControls.TextBox - - ''' - '''lblCountryCap control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblCountryCap As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''cboCountry control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cboCountry As Global.DotNetNuke.UI.WebControls.CountryListBox - - ''' - '''lblRegionCap control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblRegionCap As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''cboRegion control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cboRegion As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''txtRegion control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtRegion As Global.System.Web.UI.WebControls.TextBox - - ''' - '''cmdAdd control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdAdd As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''cmdUpdate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdUpdate As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''returnButton control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents returnButton As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''GrdLocations control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents GrdLocations As Global.System.Web.UI.WebControls.DataGrid - - ''' - '''lblEditMessage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEditMessage As Global.System.Web.UI.WebControls.Label - End Class -End Namespace diff --git a/EventEditLocations.ascx.vb b/EventEditLocations.ascx.vb deleted file mode 100644 index 94ba8c9..0000000 --- a/EventEditLocations.ascx.vb +++ /dev/null @@ -1,321 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - -Imports DotNetNuke.Security -Imports DotNetNuke.UI.WebControls -Imports DotNetNuke.Common.Lists -Imports System.Collections.Generic -Imports DotNetNuke.UI.UserControls - -Namespace DotNetNuke.Modules.Events - - _ - Partial Class EventEditLocations - Inherits EventBase - -#Region " Web Form Designer Generated Code " - - 'This call is required by the Web Form Designer. - Private Sub InitializeComponent() - - End Sub - - Private Sub Page_Init(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Init - 'CODEGEN: This method call is required by the Web Form Designer - 'Do not modify it using the code editor. - InitializeComponent() - - 'Add the external Validation.js to the Page - Const csname As String = "ExtValidationScriptFile" - Dim cstype As Type = System.Reflection.MethodBase.GetCurrentMethod().GetType() - Dim cstext As String = "" - If Not Page.ClientScript.IsClientScriptBlockRegistered(csname) Then - Page.ClientScript.RegisterClientScriptBlock(cstype, csname, cstext, False) - End If - - End Sub - -#End Region - -#Region "Private Area" - - Private ReadOnly _objCtlLocation As New EventLocationController - Private _objLocation As New EventLocationInfo - Private _colLocations As ArrayList -#End Region - -#Region "Event Handlers" - Private Sub Page_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load - LocalizeAll() - - If PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) Or _ - IsLocationEditor() Then - Else - Response.Redirect(GetSocialNavigateUrl(), True) - End If - - ' Set the selected theme - SetTheme(pnlEventsModuleLocations) - - If Not Page.IsPostBack Then - BindData() - BindCountry() - BindRegion() - End If - End Sub -#End Region - -#Region "Helper Routines" - Private Sub LocalizeAll() - GrdLocations.Columns(3).HeaderText = Localization.GetString("plLocationName", LocalResourceFile) - GrdLocations.Columns(4).HeaderText = Localization.GetString("plMapURL", LocalResourceFile) - End Sub - - Private Sub BindData() - 'Grid - Dim i As Integer - _colLocations = _objCtlLocation.EventsLocationList(PortalId) - GrdLocations.DataSource = _colLocations - GrdLocations.DataBind() - If GrdLocations.Items.Count > 0 Then - GrdLocations.Visible = True - For i = 0 To GrdLocations.Items.Count - 1 - CType(GrdLocations.Items(i).FindControl("DeleteButton"), ImageButton).Attributes.Add("onclick", "javascript:return confirm('" + Localization.GetString("AreYouSureYouWishToDelete.Text", LocalResourceFile) + "');") - Next - End If - End Sub - - Private Sub BindCountry() - Dim ctlEntry As New ListController() - Dim entryCollection As IEnumerable(Of ListEntryInfo) = ctlEntry.GetListEntryInfoItems("Country") - - cboCountry.DataSource = entryCollection - cboCountry.DataBind() - cboCountry.Items.Insert(0, New ListItem("<" + Localization.GetString("Not_Specified", Localization.SharedResourceFile) + ">", "")) - If Not Page.IsPostBack Then cboCountry.SelectedIndex = 0 - End Sub - - Private Sub BindRegion() - Dim ctlEntry As New ListController() - Dim countryCode As String = cboCountry.SelectedItem.Value - Dim listKey As String = "Country." + countryCode ' listKey in format "Country.US:Region" - Dim entryCollection As IEnumerable(Of ListEntryInfo) = ctlEntry.GetListEntryInfoItems("Region", listKey) - - If entryCollection.Any() Then - txtRegion.Visible = False - cboRegion.Visible = True - - cboRegion.Items.Clear() - cboRegion.DataSource = entryCollection - cboRegion.DataBind() - cboRegion.Items.Insert(0, New ListItem("<" + Localization.GetString("Not_Specified", Localization.SharedResourceFile) + ">", "")) - - If countryCode.ToLower() = "us" Then - lblRegionCap.Text = Localization.GetString("plState.Text", LocalResourceFile) - lblRegionCap.HelpText = Localization.GetString("plState.Help", LocalResourceFile) - lblPostalCodeCap.Text = Localization.GetString("plZipCode.Text", LocalResourceFile) - lblPostalCodeCap.HelpText = Localization.GetString("plZipCode.Help", LocalResourceFile) - Else - lblRegionCap.Text = Localization.GetString("plRegion.Text", LocalResourceFile) - lblRegionCap.HelpText = Localization.GetString("plRegion.Help", LocalResourceFile) - lblPostalCodeCap.Text = Localization.GetString("plPostalCode.Text", LocalResourceFile) - lblPostalCodeCap.HelpText = Localization.GetString("plPostalCode.Help", LocalResourceFile) - End If - Else - txtRegion.Visible = True - cboRegion.Visible = False - - lblRegionCap.Text = Localization.GetString("plRegion.Text", LocalResourceFile) - lblRegionCap.HelpText = Localization.GetString("plRegion.Help", LocalResourceFile) - lblPostalCodeCap.Text = Localization.GetString("plPostalCode.Text", LocalResourceFile) - lblPostalCodeCap.HelpText = Localization.GetString("plPostalCode.Help", LocalResourceFile) - End If - End Sub - - Private Function PutHTTPInFront(ByVal myURL As String) As String - If myURL.ToLower.StartsWith("http://") Or myURL.ToLower.StartsWith("https://") Then - Return myURL - ElseIf Trim(myURL) = "" Then - Return "" - Else - Return AddHTTP(myURL) - End If - End Function - - Private Sub cmdUpdate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdUpdate.Click - Try - SaveLocation(CInt(ViewState("Location"))) - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - BindData() - End Sub - - Private Sub cmdAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdAdd.Click - Try - SaveLocation(0) - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - BindData() - End Sub - - Private Sub SaveLocation(ByVal locationID As Integer) - ' Only Update if the Entered Data is Valid - If Page.IsValid And Not String.IsNullOrEmpty(txtLocationName.Text) Then - - Dim objLocation As New EventLocationInfo - Dim objSecurity As New PortalSecurity - Dim locationName, mapURL, street, postalCode, city As String - Dim region As String = Nothing - Dim country As String = Nothing - - ' Filter text for non-admins - If (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) = True) Then - locationName = txtLocationName.Text - mapURL = PutHTTPInFront(txtMapURL.Text) - street = txtStreet.Text - postalCode = txtPostalCode.Text - city = txtCity.Text - If cboRegion.SelectedIndex > 0 Then region = cboRegion.SelectedItem.Text Else region = txtRegion.Text - If cboCountry.SelectedIndex > 0 Then country = cboCountry.SelectedItem.Text - Else - locationName = objSecurity.InputFilter(txtLocationName.Text, PortalSecurity.FilterFlag.NoScripting) - mapURL = objSecurity.InputFilter(PutHTTPInFront(txtMapURL.Text), PortalSecurity.FilterFlag.NoScripting) - street = objSecurity.InputFilter(txtStreet.Text, PortalSecurity.FilterFlag.NoScripting) - postalCode = objSecurity.InputFilter(txtPostalCode.Text, PortalSecurity.FilterFlag.NoScripting) - city = objSecurity.InputFilter(txtCity.Text, PortalSecurity.FilterFlag.NoScripting) - If cboRegion.SelectedIndex > 0 Then - region = objSecurity.InputFilter(cboRegion.SelectedItem.Text, PortalSecurity.FilterFlag.NoScripting) - Else - region = objSecurity.InputFilter(txtRegion.Text, PortalSecurity.FilterFlag.NoScripting) - End If - If cboCountry.SelectedIndex > 0 Then - country = objSecurity.InputFilter(cboCountry.SelectedItem.Text, PortalSecurity.FilterFlag.NoScripting) - End If - End If - - 'bind text values to object - objLocation.Location = locationID - objLocation.PortalID = PortalId - objLocation.LocationName = locationName - objLocation.MapURL = mapURL - objLocation.Street = street - objLocation.PostalCode = postalCode - objLocation.City = city - objLocation.Region = region - objLocation.Country = country - _objCtlLocation.EventsLocationSave(objLocation) - - 'Back to normal (add) mode - txtLocationName.Text = "" - txtMapURL.Text = "" - txtStreet.Text = "" - txtPostalCode.Text = "" - txtCity.Text = "" - txtRegion.Text = "" - cboRegion.ClearSelection() - cboCountry.ClearSelection() - - ViewState.Remove("Location") - cmdUpdate.Visible = False - End If - End Sub - - Protected Sub OnCountryIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles cboCountry.SelectedIndexChanged - Try - BindRegion() - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub -#End Region - -#Region "Control Events" - Public Sub GrdLocations_DeleteCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles GrdLocations.DeleteCommand - Dim location As Integer - location = CType(GrdLocations.DataKeys(e.Item.ItemIndex), Integer) - _objCtlLocation.EventsLocationDelete(location, PortalId) - BindData() - - 'Back to normal (add) mode - txtLocationName.Text = "" - txtMapURL.Text = "" - txtStreet.Text = "" - txtPostalCode.Text = "" - txtCity.Text = "" - txtRegion.Text = "" - cboRegion.ClearSelection() - cboCountry.ClearSelection() - - ViewState.Remove("Location") - cmdUpdate.Visible = False - End Sub - - Public Sub GrdLocations_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles GrdLocations.ItemCommand - Select Case e.CommandName - Case "Select" - Dim location As Integer = CType(GrdLocations.DataKeys(e.Item.ItemIndex), Int16) - _objLocation = _objCtlLocation.EventsLocationGet(location, PortalId) - - ' Clear selections. - cboCountry.ClearSelection() - cboRegion.ClearSelection() - txtRegion.Text = String.Empty - - ' Fill fields. - txtLocationName.Text = _objLocation.LocationName - txtMapURL.Text = _objLocation.MapURL - txtStreet.Text = _objLocation.Street - txtPostalCode.Text = _objLocation.PostalCode - txtCity.Text = _objLocation.City - - If cboCountry.Items.FindByText(_objLocation.Country) IsNot Nothing Then - cboCountry.Items.FindByText(_objLocation.Country).Selected = True - End If - BindRegion() - If cboRegion.Items.FindByText(_objLocation.Region) IsNot Nothing Then - cboRegion.Items.FindByText(_objLocation.Region).Selected = True - Else - txtRegion.Text = _objLocation.Region - End If - - ViewState.Add("Location", _objLocation.Location.ToString()) - BindData() - - 'We can update - cmdUpdate.Visible = True - End Select - End Sub - - Private Sub returnButton_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles returnButton.Click - Try - Response.Redirect(GetSocialNavigateUrl(), True) - - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub - -#End Region - - End Class - -End Namespace diff --git a/EventIPN.aspx b/EventIPN.aspx index 684a0ec..b1419ce 100644 --- a/EventIPN.aspx +++ b/EventIPN.aspx @@ -1,4 +1,4 @@ -<%@ Page Language="vb" AutoEventWireup="false" Codebehind="EventIPN.aspx.vb" Inherits="DotNetNuke.Modules.Events.EventIPN" %> +<%@ Page Language="C#" AutoEventWireup="true" Codebehind="EventIPN.aspx.cs" Inherits="DotNetNuke.Modules.Events.EventIPN" %> @@ -14,3 +14,4 @@ + diff --git a/EventIPN.aspx.cs b/EventIPN.aspx.cs new file mode 100644 index 0000000..d90f834 --- /dev/null +++ b/EventIPN.aspx.cs @@ -0,0 +1,540 @@ +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using System.Web.UI; +using System.Web; +using DotNetNuke.Services.Localization; +using System; +using System.Net; +using System.IO; +using System.Text; + + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events + { + public partial class EventIPN : Page + { + +#region Private Area + private int _moduleID = -1; + private EventModuleSettings _settings; + private EventSignupsInfo _objEventSignups = new EventSignupsInfo(); + private EventSignupsController _objCtlEventSignups = new EventSignupsController(); + private EventPpErrorLogInfo _objEventPpErrorLog = new EventPpErrorLogInfo(); + private EventPpErrorLogController _objCtlEventPpErrorLog = new EventPpErrorLogController(); + private EventInfo _objEvent = new EventInfo(); + private EventController _objCtlEventEvent = new EventController(); + private string _strToSend; + private string _txnID; + private string _paymentStatus; + private string _receiverEmail; + private string _itemName; + private string _itemNumber; + private string _quantity; + private string _invoice; + private string _custom; + private string _paymentGross; + private string _payerEmail; + private string _pendingReason; + private string _paymentDate; + private string _paymentFee; + private string _txnType; + private string _firstName; + private string _lastName; + private string _addressStreet; + private string _addressCity; + private string _addressState; + private string _addressZip; + private string _addressCountry; + private string _addressStatus; + private string _payerStatus; + private string _paymentType; + private string _notifyVersion; + private string _verifySign; + private string _subscrDate; + private string _period1; + private string _period2; + private string _period3; + private string _amount1; + private string _amount2; + private string _amount3; + private string _recurring; + private string _reattempt; + private string _retryAt; + private string _recurTimes; + private string _username; + private string _password; + private string _subscrID; + private string _currency; + private string _localResourceFile; +#endregion + +#region Web Form Designer Generated Code + + //This call is required by the Web Form Designer. + [DebuggerStepThrough()]private void InitializeComponent() + { + + } + + private void Page_Init(System.Object sender, EventArgs e) + { + //CODEGEN: This method call is required by the Web Form Designer + //Do not modify it using the code editor. + InitializeComponent(); + } + +#endregion + +#region Event Handlers + private void Page_Load(System.Object sender, EventArgs e) + { + try + { + _localResourceFile = TemplateSourceDirectory + "/" + Localization.LocalResourceDirectory + "/EventIPN.resx"; + + string sPpnMessages = ""; // Payment message + // assign posted variables to local variables + _receiverEmail = Request.Params["receiver_email"]; + _itemName = Request.Params["item_name"]; + _itemNumber = Request.Params["item_number"]; + _quantity = Request.Params["quantity"]; + _invoice = Request.Params["invoice"]; + _custom = Request.Params["custom"]; + _paymentStatus = Request.Params["payment_status"]; + _currency = Request.Params["mc_currency"]; + _pendingReason = Request.Params["pending_reason"]; + _paymentDate = Request.Params["payment_date"]; + _paymentFee = Request.Params["mc_fee"]; + _paymentGross = Request.Params["mc_gross"]; + _txnID = Request.Params["txn_id"]; + _txnType = Request.Params["txn_type"]; + _firstName = Request.Params["first_name"]; + _lastName = Request.Params["last_name"]; + _addressStreet = Request.Params["address_street"]; + _addressCity = Request.Params["address_city"]; + _addressState = Request.Params["address_state"]; + _addressZip = Request.Params["address_zip"]; + _addressCountry = Request.Params["address_country"]; + _addressStatus = Request.Params["address_status"]; + _payerEmail = Request.Params["payer_email"]; + _payerStatus = Request.Params["payer_status"]; + _paymentType = Request.Params["payment_type"]; + _notifyVersion = Request.Params["notify_version"]; + _verifySign = Request.Params["verify_sign"]; + _subscrDate = Request.Params["subscr_date"]; //Start date or cancellation date depending on whether transaction is "subscr_signup" or "subscr_cancel" + _period1 = Request.Params["period1"]; //(optional) Trial subscription interval in days, weeks, months, years (example: a 4 day interval is "period1: 4 d") + _period2 = Request.Params["period2"]; //(optional) Trial subscription interval in days, weeks, months, years + _period3 = Request.Params["period3"]; //Regular subscription interval in days, weeks, months, years + _amount1 = Request.Params["amount1"]; //(optional) Amount of payment for trial period1 + _amount2 = Request.Params["amount2"]; //(optional) Amount of payment for trial period2 + _amount3 = Request.Params["amount3"]; //Amount of payment for regular period3 + _recurring = Request.Params["recurring"]; //Indicates whether regular rate recurs (1 is yes, 0 is no) + _reattempt = Request.Params["reattempt"]; //Indicates whether reattempts should occur upon payment failures (1 is yes, 0 is no) + _retryAt = Request.Params["retry_at"]; //Date we will retry failed subscription payment + _recurTimes = Request.Params["recur_times"]; //How many payment installments will occur at the regular rate + _username = Request.Params["username"]; //(optional) Username generated by PayPal and given to subscriber to access the subscription + _password = Request.Params["password"]; //(optional) Password generated by PayPal and given to subscriber to access the subscription (password will be hashed). + _subscrID = Request.Params["subscr_id"]; //(optional) ID generated by PayPal for the subscriber + _strToSend = Request.Form.ToString(); + + // Create the string to post back to PayPal system to validate + _strToSend += "&cmd=_notify-validate"; + + // Get the Event Signup + _objEventSignups = _objCtlEventSignups.EventsSignupsGet(System.Convert.ToInt32(_itemNumber), 0, true); + + // Get Module Settings + _moduleID = _objEventSignups.ModuleID; + EventModuleSettings ems = new EventModuleSettings(); + _settings = ems.GetEventModuleSettings(_moduleID, _localResourceFile); + + //Initialize the WebRequest. + string webURL = ""; + webURL = _settings.Paypalurl + "/cgi-bin/webscr"; + + //Send PayPal Verification Response + HttpWebRequest myRequest = (HttpWebRequest) (HttpWebRequest.Create(webURL)); + myRequest.AllowAutoRedirect = false; + myRequest.Method = "POST"; + myRequest.ContentType = "application/x-www-form-urlencoded"; + + //Create post stream + Stream requestStream = myRequest.GetRequestStream(); + byte[] someBytes = Encoding.UTF8.GetBytes(_strToSend); + requestStream.Write(someBytes, 0, someBytes.Length); + requestStream.Close(); + + //Send request and get response + HttpWebResponse myResponse = (HttpWebResponse) (myRequest.GetResponse()); + if (myResponse.StatusCode == HttpStatusCode.OK) + { + + //Obtain a 'Stream' object associated with the response object. + Stream receiveStream = myResponse.GetResponseStream(); + Encoding encode = System.Text.Encoding.GetEncoding("utf-8"); + + //Pipe the stream to a higher level stream reader with the required encoding format. + StreamReader readStream = new StreamReader(receiveStream, encode); + + //Read result + string result = readStream.ReadLine(); + if (result == "INVALID") + { + MailUsTheOrder("PPIPN: Status came back as INVALID!", false); + } + else if (result == "VERIFIED") + { + + switch (_paymentStatus) + { + case "Completed": //The payment has been completed and the funds are successfully in your account balance + switch (_txnType) + { + case "web_accept": + case "cart": + //"web_accept": The payment was sent by your customer via the Web Accept feature. + //"cart": This payment was sent by your customer via the Shopping Cart feature + sPpnMessages = sPpnMessages + "PPIPN: This payment was sent by your customer via the Shopping Cart feature" + Environment.NewLine; + break; + case "send_money": //This payment was sent by your customer from the PayPal website, imports the "Send Money" tab + sPpnMessages = sPpnMessages + "PPIPN: This payment was sent by your customer from the PayPal website" + Environment.NewLine; + break; + case "subscr_signup": //This IPN is for a subscription sign-up + sPpnMessages = sPpnMessages + "PPIPN: This IPN is for a subscription sign-up" + Environment.NewLine; + break; + case "subscr_cancel": //This IPN is for a subscription cancellation + sPpnMessages = sPpnMessages + "PPIPN: Subscription cancellation." + Environment.NewLine; + break; + case "subscr_failed": //This IPN is for a subscription payment failure + sPpnMessages = sPpnMessages + "PPIPN: Subscription failed." + Environment.NewLine; + break; + case "subscr_payment": //This IPN is for a subscription payment + sPpnMessages = sPpnMessages + "PPIPN: This IPN is for a subscription payment" + Environment.NewLine; + break; + case "subscr_eot": //This IPN is for a subscription's end of term + sPpnMessages = sPpnMessages + "PPIPN: Subscription end of term." + Environment.NewLine; + break; + } + switch (_addressStatus) + { + case "confirmed": //Customer provided a Confirmed Address + break; + case "unconfirmed": //Customer provided an Unconfirmed Address + break; + } + switch (_payerStatus) + { + case "verified": //Customer has a Verified U.S. PayPal account + break; + case "unverified": //Customer has an Unverified U.S. PayPal account + break; + case "intl_verified": //Customer has a Verified International PayPal account + break; + case "intl_unverified": //Customer has an Unverified International PayPal account + break; + } + switch (_paymentType) + { + case "echeck": //This payment was funded with an eCheck + sPpnMessages = sPpnMessages + "PPIPN: Payment was funded with an eCheck." + Environment.NewLine; + break; + case "instant": //This payment was funded with PayPal balance, credit card, or Instant Transfer + sPpnMessages = sPpnMessages + "PPIPN: This payment was funded with PayPal balance, credit card, or Instant Transfer" + Environment.NewLine; + break; + } + MailUsTheOrder(sPpnMessages, true); + break; + case "Pending": //The payment is pending - see the "pending reason" variable below for more information. Watch: You will receive another instant payment notification when the payment becomes "completed", "failed", or "denied" + switch (_pendingReason) + { + case "echeck": //The payment is pending because it was made by an eCheck, which has not yet cleared + break; + case "intl": //The payment is pending because you, the merchant, hold an international account and do not have a withdrawal mechanism. You must manually accept or deny this payment from your Account Overview + break; + case "verify": //The payment is pending because you, the merchant, are not yet verified. You must verify your account before you can accept this payment + break; + case "address": //The payment is pending because your customer did not include a confirmed shipping address and you, the merchant, have your Payment Receiving Preferences set such that you want to manually accept or deny each of these payments. To change your preference, go to the "Preferences" section of your "Profile" + break; + case "upgrade": //The payment is pending because it was made via credit card and you, the merchant, must upgrade your account to Business or Premier status in order to receive the funds + break; + case "unilateral": //The payment is pending because it was made to an email address that is not yet registered or confirmed + break; + case "other": //The payment is pending for an "other" reason. For more information, contact customer service + break; + } + MailUsTheOrder("PPIPN: Order is waiting to be processed."); + break; + case "Failed": //The payment has failed. This will only happen if the payment was made from your customer's bank account + MailUsTheOrder("PPIPN: This only happens if the payment was made from our customer's bank account."); + break; + case "Denied": //You, the merchant, denied the payment. This will only happen if the payment was previously pending due to one of the "pending reasons" + MailUsTheOrder("PPIPN: We denied this payment."); + break; + } + } + } + //Close the response to free resources. + myResponse.Close(); //If it is "OK" + } + catch (Exception exc) + { + Exceptions.LogException(new ModuleLoadException("EventIPN, Paypal Exception: " + exc.Message + " at: " + exc.Source)); + Exceptions.ProcessModuleLoadException(this, exc); + } + } +#endregion + +#region Helper Routines + private void MailUsTheOrder(string tagMsg, bool sendToUser = true) + { + // ********* RWJS - Seems to add no value, and would have always returned nothing ********* + // InitializeSettings(Item_number) + + string sMessage = ""; + string sEmail = ""; + string strNewLine = Environment.NewLine; + if (_settings.HTMLEmail == "html") + { + strNewLine = "
"; + } + sMessage = tagMsg + strNewLine + + "Transaction ID: " + _txnID + strNewLine + + "Transaction Type: " + _txnType + strNewLine + + "Payment Type: " + _paymentType + strNewLine + + "Payment Status: " + _paymentStatus + strNewLine + + "Pending Reason: " + _pendingReason + strNewLine + + "Payment Date: " + _paymentDate + strNewLine + + "Receiver Email: " + _receiverEmail + strNewLine + + "Invoice: " + _invoice + strNewLine + + "Item Number: " + _itemNumber + strNewLine + + "Item Name: " + _itemName + strNewLine + + "Quantity: " + _quantity + strNewLine + + "Custom: " + _custom + strNewLine + + "Payment Currency: " + _currency + strNewLine + + "Payment Gross: " + _paymentGross + strNewLine + + "Payment Fee: " + _paymentFee + strNewLine + + "Payer Email: " + _payerEmail + strNewLine + + "First Name: " + _firstName + strNewLine + + "Last Name: " + _lastName + strNewLine + + "Street Address: " + _addressStreet + strNewLine + + "City: " + _addressCity + strNewLine + + "State: " + _addressState + strNewLine + + "Zip Code: " + _addressZip + strNewLine + + "Country: " + _addressCountry + strNewLine + + "Address Status: " + _addressStatus + strNewLine + + "Payer Status: " + _payerStatus + strNewLine + + "Verify Sign: " + _verifySign + strNewLine + + "Subscriber Date: " + _subscrDate + strNewLine + + "Period 1: " + _period1 + strNewLine + + "Period 2: " + _period2 + strNewLine + + "Period 3: " + _period3 + strNewLine + + "Amount 1: " + _amount1 + strNewLine + + "Amount 2: " + _amount2 + strNewLine + + "Amount 3: " + _amount3 + strNewLine + + "Recurring: " + _recurring + strNewLine + + "Reattempt: " + _reattempt + strNewLine + + "Retry At: " + _retryAt + strNewLine + + "Recur Times: " + _recurTimes + strNewLine + + "UserName: " + _username + strNewLine + + "Password: " + _password + strNewLine + + "Subscriber ID: " + _subscrID + strNewLine + + "Notify Version: " + + _notifyVersion + strNewLine; + + + Entities.Portals.PortalSettings portalSettings = (Entities.Portals.PortalSettings) (HttpContext.Current.Items["PortalSettings"]); + sEmail = _settings.StandardEmail.Trim(); + sMessage = sMessage; + try + { + decimal sSystemPrice = System.Convert.ToDecimal(_paymentGross); + + // Also verify that Gross Payment is what we logged as the Fee ("payment_gross" field ) + _objEventSignups = _objCtlEventSignups.EventsSignupsGet(System.Convert.ToInt32(_itemNumber), 0, true); + _objEvent = _objCtlEventEvent.EventsGet(_objEventSignups.EventID, _objEventSignups.ModuleID); + decimal sPPPrice = _objEvent.EnrollFee * _objEventSignups.NoEnrolees; + + + EventEmailInfo objEventEmailInfo = new EventEmailInfo(); + EventEmails objEventEmail = new EventEmails(_objEvent.PortalID, _objEventSignups.ModuleID, _localResourceFile); + objEventEmailInfo.TxtEmailSubject = _settings.Templates.txtEnrollMessageSubject; + objEventEmailInfo.TxtEmailFrom = sEmail; + if (sendToUser) + { + if (_objEventSignups.UserID > -1) + { + objEventEmailInfo.UserIDs.Add(_objEventSignups.UserID); + } + else + { + objEventEmailInfo.UserEmails.Add(_objEventSignups.AnonEmail); + objEventEmailInfo.UserLocales.Add(_objEventSignups.AnonCulture); + objEventEmailInfo.UserTimeZoneIds.Add(_objEventSignups.AnonTimeZoneId); + } + } + objEventEmailInfo.UserIDs.Add(_objEvent.OwnerID); + EventEmailInfo objEventEmailInfo2 = new EventEmailInfo(); + objEventEmailInfo2.TxtEmailFrom = sEmail; + objEventEmailInfo2.UserEmails.Add(_objEvent.PayPalAccount); + objEventEmailInfo2.UserLocales.Add(""); + objEventEmailInfo2.UserTimeZoneIds.Add(""); + + if (sPPPrice == sSystemPrice) + { + //we're ok + objEventEmailInfo2.TxtEmailSubject = "Sale of: " + _itemName + " from " + portalSettings.PortalName; + objEventEmailInfo2.TxtEmailBody = sMessage; + if (_paymentStatus.ToUpper() == "COMPLETED") + { + SavePayPalInfo(true, _objEvent); + + // Mail users + if (_settings.SendEnrollMessagePaid) + { + objEventEmailInfo.TxtEmailBody = _settings.Templates.txtEnrollMessagePaid; + objEventEmail.SendEmails(objEventEmailInfo, _objEvent, _objEventSignups, true); + } + } + else + { + SavePayPalInfo(false, _objEvent); + + // Mail users + if (_settings.SendEnrollMessagePending) + { + objEventEmailInfo.TxtEmailBody = _settings.Templates.txtEnrollMessagePending; + objEventEmail.SendEmails(objEventEmailInfo, _objEvent, _objEventSignups, true); + } + } + } + else + { + //someone is trying to rip us off. + objEventEmailInfo2.TxtEmailSubject = "Failed Price Matchup Check: " + _itemName + " from " + portalSettings.PortalName; + objEventEmailInfo2.TxtEmailBody = "There was an incorrect match between actual price and price paid. The following transaction information is provided below:" + strNewLine + + strNewLine + "The purchasing email is: " + _payerEmail + strNewLine + + "User ID: " + _custom + strNewLine + + "Transaction Type: " + _txnType + strNewLine + + "Transaction ID: " + _txnID + strNewLine + + "Item Number: " + _itemNumber + strNewLine + + "PayPal Paid: " + sSystemPrice.ToString() + strNewLine + + "Actual Price: " + sPPPrice.ToString() + strNewLine + + strNewLine + "TRANSACTION DETAILS: " + strNewLine + strNewLine + sMessage; + + SavePayPalErrorLogInfo(); + + // Mail users + if (_settings.SendEnrollMessageIncorrect) + { + objEventEmailInfo.TxtEmailBody = _settings.Templates.txtEnrollMessageIncorrect; + objEventEmail.SendEmails(objEventEmailInfo, _objEvent, _objEventSignups, true); + } + } + objEventEmail.SendEmails(objEventEmailInfo2, _objEvent, _objEventSignups, true); + } + catch (Exception exc) + { + Exceptions.LogException(new ModuleLoadException("EventIPN, Paypal Exception: " + exc.Message + " at: " + exc.Source)); + Exceptions.ProcessModuleLoadException(this, exc); + string localResourceFile = TemplateSourceDirectory + "/" + Localization.LocalResourceDirectory + "/EventIPN.resx"; + EventEmailInfo objEventEmailInfo = new EventEmailInfo(); + EventEmails objEventEmail = new EventEmails(_objEvent.PortalID, _objEventSignups.ModuleID, localResourceFile); + objEventEmailInfo.TxtEmailSubject = "Sale of: " + _itemName + " from " + portalSettings.PortalName; + objEventEmailInfo.TxtEmailFrom = _settings.StandardEmail.Trim(); + objEventEmailInfo.UserEmails.Add(_objEvent.PayPalAccount); + objEventEmailInfo.UserLocales.Add(""); + objEventEmailInfo.UserTimeZoneIds.Add(""); + + objEventEmailInfo.TxtEmailBody = "There was a failure of the item purchase module. The following transaction information is provided below:" + strNewLine + + strNewLine + "The purchasing email is: " + _payerEmail + strNewLine + + strNewLine + "User ID: " + _custom + strNewLine + + strNewLine + "Transaction Type: " + _txnType + strNewLine + + strNewLine + "Transaction ID: " + _txnID + strNewLine + + strNewLine + "Error Code: " + exc.Message + strNewLine + exc.Source; + + objEventEmail.SendEmails(objEventEmailInfo, _objEvent, _objEventSignups, true); + } + } + + private void SavePayPalInfo(bool approved, EventInfo objEvent) + { + _objEventSignups = _objCtlEventSignups.EventsSignupsGet(int.Parse(_itemNumber), 0, true); + _objEventSignups.Approved = approved; + _objEventSignups.PayPalAddress = _addressStreet; + _objEventSignups.PayPalCity = _addressCity; + _objEventSignups.PayPalCountry = _addressCountry; + _objEventSignups.PayPalAmount = System.Convert.ToDecimal(_paymentGross); + _objEventSignups.PayPalCurrency = _currency; + _objEventSignups.PayPalFee = System.Convert.ToDecimal(_paymentFee); + _objEventSignups.PayPalFirstName = _firstName; + _objEventSignups.PayPalLastName = _lastName; + _objEventSignups.PayPalPayerEmail = _payerEmail; + _objEventSignups.PayPalPayerID = _subscrID; + _objEventSignups.PayPalPayerStatus = _payerStatus; + _objEventSignups.PayPalPaymentDate = DateTime.UtcNow; + _objEventSignups.PayPalReason = _pendingReason; + _objEventSignups.PayPalRecieverEmail = _receiverEmail; + _objEventSignups.PayPalState = _addressState; + _objEventSignups.PayPalStatus = _paymentStatus.ToLower(); + _objEventSignups.PayPalTransID = _txnID; + //objEventSignups.PayPalUserEmail = pay.IPNUserEmail + _objEventSignups.PayPalZip = _addressZip; + EventBase eventsBase = new EventBase(); + eventsBase.CreateEnrollment(_objEventSignups, objEvent, _settings); + } + + private void SavePayPalErrorLogInfo() + { + _objEventPpErrorLog = new EventPpErrorLogInfo(); + _objEventPpErrorLog.SignupID = System.Convert.ToInt32(_itemNumber); + //objEventPPErrorLog.Approved = False + _objEventPpErrorLog.PayPalAddress = _addressStreet; + _objEventPpErrorLog.PayPalCity = _addressCity; + _objEventPpErrorLog.PayPalCountry = _addressCountry; + _objEventPpErrorLog.PayPalAmount = System.Convert.ToDouble(_paymentGross); + _objEventPpErrorLog.PayPalCurrency = _currency; + _objEventPpErrorLog.PayPalFee = System.Convert.ToDouble(_paymentFee); + _objEventPpErrorLog.PayPalFirstName = _firstName; + _objEventPpErrorLog.PayPalLastName = _lastName; + _objEventPpErrorLog.PayPalPayerEmail = _payerEmail; + _objEventPpErrorLog.PayPalPayerID = _subscrID; + _objEventPpErrorLog.PayPalPayerStatus = _payerStatus; + //objEventPPErrorLog.PayPalPaymentDate = CType(Payment_date, Date) + _objEventPpErrorLog.PayPalPaymentDate = DateTime.Now; + _objEventPpErrorLog.PayPalReason = _pendingReason; + _objEventPpErrorLog.PayPalRecieverEmail = _receiverEmail; + _objEventPpErrorLog.PayPalState = _addressState; + _objEventPpErrorLog.PayPalStatus = _paymentStatus.ToLower(); + _objEventPpErrorLog.PayPalTransID = _txnID; + //objEventPPErrorLog.PayPalUserEmail = pay.IPNUserEmail + _objEventPpErrorLog.PayPalZip = _addressZip; + _objEventPpErrorLog = _objCtlEventPpErrorLog.EventsPpErrorLogAdd(_objEventPpErrorLog); + } +#endregion + + } + } + diff --git a/EventIPN.aspx.designer.cs b/EventIPN.aspx.designer.cs new file mode 100644 index 0000000..c36a7ab --- /dev/null +++ b/EventIPN.aspx.designer.cs @@ -0,0 +1,55 @@ +// VBConversions Note: VB project level imports +using DotNetNuke.UI; +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using DotNetNuke.Entities.Users; +using System.Web.UI; +using System.Drawing; +using DotNetNuke.Framework; +using Microsoft.VisualBasic; +using System.Configuration; +using System.Web.UI.WebControls; +using System.Collections; +using DotNetNuke.Common.Utilities; +//using System.Linq; + using System.Web; +using DotNetNuke.Common; +using System.Web.UI.HtmlControls; +using DotNetNuke.Services.Localization; +using System.Data; +using System; +using DotNetNuke.Data; +using DotNetNuke; +// End of VB project level imports + + + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + + + namespace DotNetNuke.Modules.Events + { + + public partial class EventIPN + { + + /// + ///Form1 control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm Form1; + } + } + + diff --git a/EventIPN.aspx.designer.vb b/EventIPN.aspx.designer.vb deleted file mode 100644 index c40ec45..0000000 --- a/EventIPN.aspx.designer.vb +++ /dev/null @@ -1,26 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Namespace DotNetNuke.Modules.Events - - Partial Public Class EventIPN - - ''' - '''Form1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents Form1 As Global.System.Web.UI.HtmlControls.HtmlForm - End Class -End Namespace diff --git a/EventIPN.aspx.vb b/EventIPN.aspx.vb deleted file mode 100644 index 093e898..0000000 --- a/EventIPN.aspx.vb +++ /dev/null @@ -1,429 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports System.Net -Imports System.IO -Imports System.Text - -Namespace DotNetNuke.Modules.Events - Partial Class EventIPN - Inherits Page - -#Region "Private Area" - Private _moduleID As Integer = -1 - Private _settings As EventModuleSettings - Private _objEventSignups As New EventSignupsInfo - Private ReadOnly _objCtlEventSignups As New EventSignupsController - Private _objEventPpErrorLog As New EventPpErrorLogInfo - Private ReadOnly _objCtlEventPpErrorLog As New EventPpErrorLogController - Private _objEvent As New EventInfo - Private ReadOnly _objCtlEventEvent As New EventController - Private _strToSend, _txnID, _paymentStatus, _receiverEmail, _itemName, _ - _itemNumber, _quantity, _invoice, _custom, _ - _paymentGross, _payerEmail, _pendingReason, _paymentDate, _paymentFee, _ - _txnType, _firstName, _lastName, _addressStreet, _addressCity, _addressState, _ - _addressZip, _addressCountry, _addressStatus, _payerStatus, _paymentType, _ - _notifyVersion, _verifySign, _subscrDate, _period1, _period2, _period3, _ - _amount1, _amount2, _amount3, _recurring, _reattempt, _retryAt, _recurTimes, _ - _username, _password, _subscrID, _currency As String - Private _localResourceFile As String -#End Region - -#Region " Web Form Designer Generated Code " - - 'This call is required by the Web Form Designer. - Private Sub InitializeComponent() - - End Sub - - Private Sub Page_Init(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Init - 'CODEGEN: This method call is required by the Web Form Designer - 'Do not modify it using the code editor. - InitializeComponent() - End Sub - -#End Region - -#Region "Event Handlers" - Private Sub Page_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load - Try - _localResourceFile = TemplateSourceDirectory & "/" & Localization.LocalResourceDirectory & "/EventIPN.resx" - - Dim sPpnMessages As String = "" ' Payment message - ' assign posted variables to local variables - _receiverEmail = Request.Params("receiver_email") - _itemName = Request.Params("item_name") - _itemNumber = Request.Params("item_number") - _quantity = Request.Params("quantity") - _invoice = Request.Params("invoice") - _custom = Request.Params("custom") - _paymentStatus = Request.Params("payment_status") - _currency = Request.Params("mc_currency") - _pendingReason = Request.Params("pending_reason") - _paymentDate = Request.Params("payment_date") - _paymentFee = Request.Params("mc_fee") - _paymentGross = Request.Params("mc_gross") - _txnID = Request.Params("txn_id") - _txnType = Request.Params("txn_type") - _firstName = Request.Params("first_name") - _lastName = Request.Params("last_name") - _addressStreet = Request.Params("address_street") - _addressCity = Request.Params("address_city") - _addressState = Request.Params("address_state") - _addressZip = Request.Params("address_zip") - _addressCountry = Request.Params("address_country") - _addressStatus = Request.Params("address_status") - _payerEmail = Request.Params("payer_email") - _payerStatus = Request.Params("payer_status") - _paymentType = Request.Params("payment_type") - _notifyVersion = Request.Params("notify_version") - _verifySign = Request.Params("verify_sign") - _subscrDate = Request.Params("subscr_date") 'Start date or cancellation date depending on whether transaction is "subscr_signup" or "subscr_cancel" - _period1 = Request.Params("period1") '(optional) Trial subscription interval in days, weeks, months, years (example: a 4 day interval is "period1: 4 d") - _period2 = Request.Params("period2") '(optional) Trial subscription interval in days, weeks, months, years - _period3 = Request.Params("period3") 'Regular subscription interval in days, weeks, months, years - _amount1 = Request.Params("amount1") '(optional) Amount of payment for trial period1 - _amount2 = Request.Params("amount2") '(optional) Amount of payment for trial period2 - _amount3 = Request.Params("amount3") 'Amount of payment for regular period3 - _recurring = Request.Params("recurring") 'Indicates whether regular rate recurs (1 is yes, 0 is no) - _reattempt = Request.Params("reattempt") 'Indicates whether reattempts should occur upon payment failures (1 is yes, 0 is no) - _retryAt = Request.Params("retry_at") 'Date we will retry failed subscription payment - _recurTimes = Request.Params("recur_times") 'How many payment installments will occur at the regular rate - _username = Request.Params("username") '(optional) Username generated by PayPal and given to subscriber to access the subscription - _password = Request.Params("password") '(optional) Password generated by PayPal and given to subscriber to access the subscription (password will be hashed). - _subscrID = Request.Params("subscr_id") '(optional) ID generated by PayPal for the subscriber - _strToSend = Request.Form.ToString() - - ' Create the string to post back to PayPal system to validate - _strToSend &= "&cmd=_notify-validate" - - ' Get the Event Signup - _objEventSignups = _objCtlEventSignups.EventsSignupsGet(CType(_itemNumber, Integer), 0, True) - - ' Get Module Settings - _moduleID = _objEventSignups.ModuleID - Dim ems As New EventModuleSettings - _settings = ems.GetEventModuleSettings(_moduleID, _localResourceFile) - - 'Initialize the WebRequest. - Dim webURL As String - webURL = _settings.Paypalurl & "/cgi-bin/webscr" - - 'Send PayPal Verification Response - Dim myRequest As HttpWebRequest = CType(HttpWebRequest.Create(webURL), HttpWebRequest) - myRequest.AllowAutoRedirect = False - myRequest.Method = "POST" - myRequest.ContentType = "application/x-www-form-urlencoded" - - 'Create post stream - Dim requestStream As Stream = myRequest.GetRequestStream() - Dim someBytes() As Byte = Encoding.UTF8.GetBytes(_strToSend) - requestStream.Write(someBytes, 0, someBytes.Length) - requestStream.Close() - - 'Send request and get response - Dim myResponse As HttpWebResponse = CType(myRequest.GetResponse(), HttpWebResponse) - If myResponse.StatusCode = HttpStatusCode.OK Then - - 'Obtain a 'Stream' object associated with the response object. - Dim receiveStream As Stream = myResponse.GetResponseStream() - Dim encode As Encoding = System.Text.Encoding.GetEncoding("utf-8") - - 'Pipe the stream to a higher level stream reader with the required encoding format. - Dim readStream As StreamReader = New StreamReader(receiveStream, encode) - - 'Read result - Dim result As String = readStream.ReadLine() - If result = "INVALID" Then - MailUsTheOrder("PPIPN: Status came back as INVALID!", False) - ElseIf result = "VERIFIED" Then - - Select Case (_paymentStatus) - Case "Completed" 'The payment has been completed and the funds are successfully in your account balance - Select Case (_txnType) - Case "web_accept", "cart" - '"web_accept": The payment was sent by your customer via the Web Accept feature. - '"cart": This payment was sent by your customer via the Shopping Cart feature - sPpnMessages = sPpnMessages & "PPIPN: This payment was sent by your customer via the Shopping Cart feature" & Environment.NewLine - Case "send_money" 'This payment was sent by your customer from the PayPal website, imports the "Send Money" tab - sPpnMessages = sPpnMessages & "PPIPN: This payment was sent by your customer from the PayPal website" & Environment.NewLine - Case "subscr_signup" 'This IPN is for a subscription sign-up - sPpnMessages = sPpnMessages & "PPIPN: This IPN is for a subscription sign-up" & Environment.NewLine - Case "subscr_cancel" 'This IPN is for a subscription cancellation - sPpnMessages = sPpnMessages & "PPIPN: Subscription cancellation." & Environment.NewLine - Case "subscr_failed" 'This IPN is for a subscription payment failure - sPpnMessages = sPpnMessages & "PPIPN: Subscription failed." & Environment.NewLine - Case "subscr_payment" 'This IPN is for a subscription payment - sPpnMessages = sPpnMessages & "PPIPN: This IPN is for a subscription payment" & Environment.NewLine - Case "subscr_eot" 'This IPN is for a subscription's end of term - sPpnMessages = sPpnMessages & "PPIPN: Subscription end of term." & Environment.NewLine - End Select - Select Case (_addressStatus) - Case "confirmed" 'Customer provided a Confirmed Address - Case "unconfirmed" 'Customer provided an Unconfirmed Address - End Select - Select Case (_payerStatus) - Case "verified" 'Customer has a Verified U.S. PayPal account - Case "unverified" 'Customer has an Unverified U.S. PayPal account - Case "intl_verified" 'Customer has a Verified International PayPal account - Case "intl_unverified" 'Customer has an Unverified International PayPal account - End Select - Select Case (_paymentType) - Case "echeck" 'This payment was funded with an eCheck - sPpnMessages = sPpnMessages & "PPIPN: Payment was funded with an eCheck." & Environment.NewLine - Case "instant" 'This payment was funded with PayPal balance, credit card, or Instant Transfer - sPpnMessages = sPpnMessages & "PPIPN: This payment was funded with PayPal balance, credit card, or Instant Transfer" & Environment.NewLine - End Select - MailUsTheOrder(sPpnMessages, True) - Case "Pending" 'The payment is pending - see the "pending reason" variable below for more information. Watch: You will receive another instant payment notification when the payment becomes "completed", "failed", or "denied" - Select Case (_pendingReason) - Case "echeck" 'The payment is pending because it was made by an eCheck, which has not yet cleared - Case "intl" 'The payment is pending because you, the merchant, hold an international account and do not have a withdrawal mechanism. You must manually accept or deny this payment from your Account Overview - Case "verify" 'The payment is pending because you, the merchant, are not yet verified. You must verify your account before you can accept this payment - Case "address" 'The payment is pending because your customer did not include a confirmed shipping address and you, the merchant, have your Payment Receiving Preferences set such that you want to manually accept or deny each of these payments. To change your preference, go to the "Preferences" section of your "Profile" - Case "upgrade" 'The payment is pending because it was made via credit card and you, the merchant, must upgrade your account to Business or Premier status in order to receive the funds - Case "unilateral" 'The payment is pending because it was made to an email address that is not yet registered or confirmed - Case "other" 'The payment is pending for an "other" reason. For more information, contact customer service - End Select - MailUsTheOrder("PPIPN: Order is waiting to be processed.") - Case "Failed" 'The payment has failed. This will only happen if the payment was made from your customer's bank account - MailUsTheOrder("PPIPN: This only happens if the payment was made from our customer's bank account.") - Case "Denied" 'You, the merchant, denied the payment. This will only happen if the payment was previously pending due to one of the "pending reasons" - MailUsTheOrder("PPIPN: We denied this payment.") - End Select - End If - End If - 'Close the response to free resources. - myResponse.Close() 'If it is "OK" - Catch exc As Exception - LogException(New ModuleLoadException("EventIPN, Paypal Exception: " & exc.Message & " at: " & exc.Source)) - ProcessModuleLoadException(Me, exc) - End Try - End Sub -#End Region - -#Region "Helper Routines" - Private Sub MailUsTheOrder(ByVal tagMsg As String, Optional ByVal sendToUser As Boolean = True) - ' ********* RWJS - Seems to add no value, and would have always returned nothing ********* - ' InitializeSettings(Item_number) - - Dim sMessage As String - Dim sEmail As String - Dim strNewLine As String = Environment.NewLine - If _settings.HTMLEmail = "html" Then - strNewLine = "
" - End If - sMessage = tagMsg & strNewLine _ - & "Transaction ID: " & _txnID & strNewLine _ - & "Transaction Type: " & _txnType & strNewLine _ - & "Payment Type: " & _paymentType & strNewLine _ - & "Payment Status: " & _paymentStatus & strNewLine _ - & "Pending Reason: " & _pendingReason & strNewLine _ - & "Payment Date: " & _paymentDate & strNewLine _ - & "Receiver Email: " & _receiverEmail & strNewLine _ - & "Invoice: " & _invoice & strNewLine _ - & "Item Number: " & _itemNumber & strNewLine _ - & "Item Name: " & _itemName & strNewLine _ - & "Quantity: " & _quantity & strNewLine _ - & "Custom: " & _custom & strNewLine _ - & "Payment Currency: " & _currency & strNewLine _ - & "Payment Gross: " & _paymentGross & strNewLine _ - & "Payment Fee: " & _paymentFee & strNewLine _ - & "Payer Email: " & _payerEmail & strNewLine _ - & "First Name: " & _firstName & strNewLine _ - & "Last Name: " & _lastName & strNewLine _ - & "Street Address: " & _addressStreet & strNewLine _ - & "City: " & _addressCity & strNewLine _ - & "State: " & _addressState & strNewLine _ - & "Zip Code: " & _addressZip & strNewLine _ - & "Country: " & _addressCountry & strNewLine _ - & "Address Status: " & _addressStatus & strNewLine _ - & "Payer Status: " & _payerStatus & strNewLine _ - & "Verify Sign: " & _verifySign & strNewLine _ - & "Subscriber Date: " & _subscrDate & strNewLine _ - & "Period 1: " & _period1 & strNewLine _ - & "Period 2: " & _period2 & strNewLine _ - & "Period 3: " & _period3 & strNewLine _ - & "Amount 1: " & _amount1 & strNewLine _ - & "Amount 2: " & _amount2 & strNewLine _ - & "Amount 3: " & _amount3 & strNewLine _ - & "Recurring: " & _recurring & strNewLine _ - & "Reattempt: " & _reattempt & strNewLine _ - & "Retry At: " & _retryAt & strNewLine _ - & "Recur Times: " & _recurTimes & strNewLine _ - & "UserName: " & _username & strNewLine _ - & "Password: " & _password & strNewLine _ - & "Subscriber ID: " & _subscrID & strNewLine _ - & "Notify Version: " & _notifyVersion & strNewLine - - - Dim portalSettings As Entities.Portals.PortalSettings = CType(HttpContext.Current.Items("PortalSettings"), Entities.Portals.PortalSettings) - sEmail = _settings.StandardEmail.Trim - sMessage = sMessage - Try - Dim sSystemPrice As Decimal = CType(_paymentGross, Decimal) - - ' Also verify that Gross Payment is what we logged as the Fee ("payment_gross" field ) - _objEventSignups = _objCtlEventSignups.EventsSignupsGet(CType(_itemNumber, Integer), 0, True) - _objEvent = _objCtlEventEvent.EventsGet(_objEventSignups.EventID, _objEventSignups.ModuleID) - Dim sPPPrice As Decimal = _objEvent.EnrollFee * _objEventSignups.NoEnrolees - - - Dim objEventEmailInfo As New EventEmailInfo - Dim objEventEmail As New EventEmails(_objEvent.PortalID, _objEventSignups.ModuleID, _localResourceFile) - objEventEmailInfo.TxtEmailSubject = _settings.Templates.txtEnrollMessageSubject - objEventEmailInfo.TxtEmailFrom() = sEmail - If sendToUser Then - If _objEventSignups.UserID > -1 Then - objEventEmailInfo.UserIDs.Add(_objEventSignups.UserID) - Else - objEventEmailInfo.UserEmails.Add(_objEventSignups.AnonEmail) - objEventEmailInfo.UserLocales.Add(_objEventSignups.AnonCulture) - objEventEmailInfo.UserTimeZoneIds.Add(_objEventSignups.AnonTimeZoneId) - End If - End If - objEventEmailInfo.UserIDs.Add(_objEvent.OwnerID) - Dim objEventEmailInfo2 As New EventEmailInfo - objEventEmailInfo2.TxtEmailFrom() = sEmail - objEventEmailInfo2.UserEmails.Add(_objEvent.PayPalAccount) - objEventEmailInfo2.UserLocales.Add("") - objEventEmailInfo2.UserTimeZoneIds.Add("") - - If sPPPrice = sSystemPrice Then - 'we're ok - objEventEmailInfo2.TxtEmailSubject = "Sale of: " & _itemName & " from " & portalSettings.PortalName - objEventEmailInfo2.TxtEmailBody = sMessage - If _paymentStatus.ToUpper = "COMPLETED" Then - SavePayPalInfo(True, _objEvent) - - ' Mail users - If _settings.SendEnrollMessagePaid Then - objEventEmailInfo.TxtEmailBody = _settings.Templates.txtEnrollMessagePaid - objEventEmail.SendEmails(objEventEmailInfo, _objEvent, _objEventSignups, True) - End If - Else - SavePayPalInfo(False, _objEvent) - - ' Mail users - If _settings.SendEnrollMessagePending Then - objEventEmailInfo.TxtEmailBody = _settings.Templates.txtEnrollMessagePending - objEventEmail.SendEmails(objEventEmailInfo, _objEvent, _objEventSignups, True) - End If - End If - Else - 'someone is trying to rip us off. - objEventEmailInfo2.TxtEmailSubject = "Failed Price Matchup Check: " & _itemName & " from " & portalSettings.PortalName - objEventEmailInfo2.TxtEmailBody = "There was an incorrect match between actual price and price paid. The following transaction information is provided below:" & strNewLine & _ - strNewLine & "The purchasing email is: " & _payerEmail & strNewLine & _ - "User ID: " & _custom & strNewLine & _ - "Transaction Type: " & _txnType & strNewLine & _ - "Transaction ID: " & _txnID & strNewLine & _ - "Item Number: " & _itemNumber & strNewLine & _ - "PayPal Paid: " & sSystemPrice.ToString & strNewLine & _ - "Actual Price: " & sPPPrice.ToString & strNewLine & _ - strNewLine & "TRANSACTION DETAILS: " & strNewLine & strNewLine & sMessage - - SavePayPalErrorLogInfo() - - ' Mail users - If _settings.SendEnrollMessageIncorrect Then - objEventEmailInfo.TxtEmailBody = _settings.Templates.txtEnrollMessageIncorrect - objEventEmail.SendEmails(objEventEmailInfo, _objEvent, _objEventSignups, True) - End If - End If - objEventEmail.SendEmails(objEventEmailInfo2, _objEvent, _objEventSignups, True) - Catch exc As Exception - LogException(New ModuleLoadException("EventIPN, Paypal Exception: " & exc.Message & " at: " & exc.Source)) - ProcessModuleLoadException(Me, exc) - Dim localResourceFile As String = TemplateSourceDirectory & "/" & Localization.LocalResourceDirectory & "/EventIPN.resx" - Dim objEventEmailInfo As New EventEmailInfo - Dim objEventEmail As New EventEmails(_objEvent.PortalID, _objEventSignups.ModuleID, localResourceFile) - objEventEmailInfo.TxtEmailSubject = "Sale of: " & _itemName & " from " & portalSettings.PortalName - objEventEmailInfo.TxtEmailFrom() = _settings.StandardEmail.Trim - objEventEmailInfo.UserEmails.Add(_objEvent.PayPalAccount) - objEventEmailInfo.UserLocales.Add("") - objEventEmailInfo.UserTimeZoneIds.Add("") - - objEventEmailInfo.TxtEmailBody = "There was a failure of the item purchase module. The following transaction information is provided below:" & strNewLine & _ - strNewLine & "The purchasing email is: " & _payerEmail & strNewLine & _ - strNewLine & "User ID: " & _custom & strNewLine & _ - strNewLine & "Transaction Type: " & _txnType & strNewLine & _ - strNewLine & "Transaction ID: " & _txnID & strNewLine & _ - strNewLine & "Error Code: " & exc.Message & strNewLine & exc.Source - - objEventEmail.SendEmails(objEventEmailInfo, _objEvent, _objEventSignups, True) - End Try - End Sub - - Private Sub SavePayPalInfo(ByVal approved As Boolean, ByVal objEvent As EventInfo) - _objEventSignups = _objCtlEventSignups.EventsSignupsGet(CInt(_itemNumber), 0, True) - _objEventSignups.Approved = approved - _objEventSignups.PayPalAddress = _addressStreet - _objEventSignups.PayPalCity = _addressCity - _objEventSignups.PayPalCountry = _addressCountry - _objEventSignups.PayPalAmount = CType(_paymentGross, Decimal) - _objEventSignups.PayPalCurrency = _currency - _objEventSignups.PayPalFee = CType(_paymentFee, Decimal) - _objEventSignups.PayPalFirstName = _firstName - _objEventSignups.PayPalLastName = _lastName - _objEventSignups.PayPalPayerEmail = _payerEmail - _objEventSignups.PayPalPayerID = _subscrID - _objEventSignups.PayPalPayerStatus = _payerStatus - _objEventSignups.PayPalPaymentDate = DateTime.UtcNow - _objEventSignups.PayPalReason = _pendingReason - _objEventSignups.PayPalRecieverEmail = _receiverEmail - _objEventSignups.PayPalState = _addressState - _objEventSignups.PayPalStatus = _paymentStatus.ToLower() - _objEventSignups.PayPalTransID = _txnID - 'objEventSignups.PayPalUserEmail = pay.IPNUserEmail - _objEventSignups.PayPalZip = _addressZip - Dim eventsBase As New EventBase - eventsBase.CreateEnrollment(_objEventSignups, objEvent, _settings) - End Sub - - Private Sub SavePayPalErrorLogInfo() - _objEventPpErrorLog = New EventPpErrorLogInfo - _objEventPpErrorLog.SignupID = CType(_itemNumber, Integer) - 'objEventPPErrorLog.Approved = False - _objEventPpErrorLog.PayPalAddress = _addressStreet - _objEventPpErrorLog.PayPalCity = _addressCity - _objEventPpErrorLog.PayPalCountry = _addressCountry - _objEventPpErrorLog.PayPalAmount = CType(_paymentGross, Double) - _objEventPpErrorLog.PayPalCurrency = _currency - _objEventPpErrorLog.PayPalFee = CType(_paymentFee, Double) - _objEventPpErrorLog.PayPalFirstName = _firstName - _objEventPpErrorLog.PayPalLastName = _lastName - _objEventPpErrorLog.PayPalPayerEmail = _payerEmail - _objEventPpErrorLog.PayPalPayerID = _subscrID - _objEventPpErrorLog.PayPalPayerStatus = _payerStatus - 'objEventPPErrorLog.PayPalPaymentDate = CType(Payment_date, Date) - _objEventPpErrorLog.PayPalPaymentDate = DateTime.Now - _objEventPpErrorLog.PayPalReason = _pendingReason - _objEventPpErrorLog.PayPalRecieverEmail = _receiverEmail - _objEventPpErrorLog.PayPalState = _addressState - _objEventPpErrorLog.PayPalStatus = _paymentStatus.ToLower() - _objEventPpErrorLog.PayPalTransID = _txnID - 'objEventPPErrorLog.PayPalUserEmail = pay.IPNUserEmail - _objEventPpErrorLog.PayPalZip = _addressZip - _objEventPpErrorLog = _objCtlEventPpErrorLog.EventsPpErrorLogAdd(_objEventPpErrorLog) - End Sub -#End Region - - End Class -End Namespace \ No newline at end of file diff --git a/EventList.ascx b/EventList.ascx index 41fad85..6c16392 100644 --- a/EventList.ascx +++ b/EventList.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="EventList.ascx.vb" Inherits="DotNetNuke.Modules.Events.EventList" %> +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EventList.ascx.cs" Inherits="DotNetNuke.Modules.Events.EventList" %> <%@ Register TagPrefix="evt" TagName="Category" Src="~/DesktopModules/Events/SubControls/SelectCategory.ascx" %> <%@ Register TagPrefix="evt" TagName="Location" Src="~/DesktopModules/Events/SubControls/SelectLocation.ascx" %> <%@ Register TagPrefix="evt" TagName="Icons" Src="~/DesktopModules/Events/SubControls/EventIcons.ascx" %> @@ -9,16 +9,16 @@ ID="toolTipManager" runat="server" HideEvent="LeaveTargetAndToolTip" Modal="False" EnableShadow="True" CssClass="Eventtooltip" ShowCallout="False" />
- +
- +
- + @@ -140,4 +140,4 @@
-
\ No newline at end of file +
diff --git a/EventList.ascx.cs b/EventList.ascx.cs new file mode 100644 index 0000000..8e37486 --- /dev/null +++ b/EventList.ascx.cs @@ -0,0 +1,468 @@ +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using System.Web.UI; +using System.Drawing; +using Microsoft.VisualBasic; +using System.Web.UI.WebControls; +using System.Collections; +using System.Web; +using DotNetNuke.Services.Localization; +using System; +using System.Globalization; + + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events + { + + public partial class EventList : EventBase + { + +#region Event Handlers + private ArrayList _selectedEvents; + + + private void Page_Load(System.Object sender, EventArgs e) + { + try + { + SetupViewControls(EventIcons, EventIcons2, SelectCategory, SelectLocation); + + gvEvents.PageSize = Settings.EventsListPageSize; + + if (Page.IsPostBack == false) + { + if (Settings.EventsListShowHeader != "No") + { + gvEvents.ShowHeader = true; + Localization.LocalizeGridView(ref gvEvents, LocalResourceFile); + } + BindDataGrid(); + } + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } +#endregion + +#region Helper Functions + private void BindDataGrid() + { + //Default sort from settings + SortDirection sortDirection = default(SortDirection); + if (Settings.EventsListSortDirection == "ASC") + { + sortDirection = System.Web.UI.WebControls.SortDirection.Ascending; + } + else + { + sortDirection = System.Web.UI.WebControls.SortDirection.Descending; + } + + EventListObject.SortFilter sortExpression = GetListSortExpression(Settings.EventsListSortColumn); + + //Show header - or not + if (Settings.EventsListShowHeader == "Yes") + { + gvEvents.ShowHeader = true; + } + else + { + gvEvents.ShowHeader = false; + } + + //Get cached sort settings + if (!ReferenceEquals(ViewState["SortExpression"], null) && (ViewState["SortExpression"]) is EventListObject.SortFilter) + { + sortExpression = (EventListObject.SortFilter) (ViewState["SortExpression"]); + } + if (!ReferenceEquals(ViewState["SortDirection"], null) && (ViewState["SortDirection"]) is SortDirection) + { + sortDirection = (SortDirection) (ViewState["SortDirection"]); + } + + BindDataGrid(sortExpression, sortDirection); + } + + private void BindDataGrid(EventListObject.SortFilter sortExpression, SortDirection sortDirection) + { + CultureInfo culture = System.Threading.Thread.CurrentThread.CurrentCulture; + EventInfo objEvent = default(EventInfo); + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + bool editColumnVisible = false; + + // Get Events/Sub-Calendar Events + _selectedEvents = Get_ListView_Events(SelectCategory.SelectedCategory, SelectLocation.SelectedLocation); + + string fmtEventTimeBegin = Settings.Templates.txtListEventTimeBegin; + if (string.IsNullOrEmpty(fmtEventTimeBegin)) + { + fmtEventTimeBegin = "g"; + } + + string fmtEventTimeEnd = Settings.Templates.txtListEventTimeEnd; + if (string.IsNullOrEmpty(fmtEventTimeEnd)) + { + fmtEventTimeEnd = "g"; + } + + string tmpListDescription = Settings.Templates.txtListEventDescription; + string tmpListLocation = Settings.Templates.txtListLocation; + + if (_selectedEvents.Count == 0) + { + gvEvents.Visible = false; + divNoEvents.Visible = true; + return; + } + else + { + gvEvents.Visible = true; + divNoEvents.Visible = false; + } + + if (Settings.Eventtooltiplist) + { + toolTipManager.TargetControls.Clear(); + } + + // if Events Selection Type only get the 1st N Events + ArrayList colEvents = new ArrayList(); + EventListObject lstEvent = default(EventListObject); + int indexID = 0; + foreach (EventInfo tempLoopVar_objEvent in _selectedEvents) + { + objEvent = tempLoopVar_objEvent; + TokenReplaceControllerClass tcc = new TokenReplaceControllerClass(ModuleId, LocalResourceFile); + EventRecurMasterController objCtlEventRecurMaster = new EventRecurMasterController(); + string fmtRowEnd = ""; + string fmtRowBegin = ""; + fmtRowEnd = tcc.TokenParameters(fmtEventTimeEnd, objEvent, Settings); + fmtRowBegin = tcc.TokenParameters(fmtEventTimeBegin, objEvent, Settings); + + lstEvent = new EventListObject(); + lstEvent.EventID = objEvent.EventID; + lstEvent.CreatedByID = objEvent.CreatedByID; + lstEvent.OwnerID = objEvent.OwnerID; + lstEvent.IndexId = indexID; + // Get Dates (automatically converted to User's Timezone) + lstEvent.EventDateBegin = objEvent.EventTimeBegin; + lstEvent.EventDateEnd = objEvent.EventTimeEnd; + if (objEvent.DisplayEndDate) + { + lstEvent.TxtEventDateEnd = string.Format("{0:" + fmtRowEnd + "}", lstEvent.EventDateEnd); + } + else + { + lstEvent.TxtEventDateEnd = ""; + } + lstEvent.EventTimeBegin = objEvent.EventTimeBegin; + lstEvent.TxtEventTimeBegin = string.Format("{0:" + fmtRowBegin + "}", lstEvent.EventTimeBegin); + lstEvent.Duration = objEvent.Duration; + + bool isEvtEditor = IsEventEditor(objEvent, false); + + string templatedescr = ""; + string iconString = ""; + + if (!IsPrivateNotModerator || UserId == objEvent.OwnerID) + { + templatedescr = tcc.TokenReplaceEvent(objEvent, tmpListDescription, null, false, isEvtEditor); + lstEvent.CategoryColor = GetColor(objEvent.Color); + lstEvent.CategoryFontColor = GetColor(objEvent.FontColor); + + iconString = CreateIconString(objEvent, Settings.IconListPrio, Settings.IconListRec, Settings.IconListReminder, Settings.IconListEnroll); + } + + lstEvent.EventName = CreateEventName(objEvent, "[event:title]"); + lstEvent.EventDesc = objEvent.EventDesc; + // RWJS - not sure why replace ' with \' - lstEvent.DecodedDesc = System.Web.HttpUtility.HtmlDecode(objEvent.EventDesc).Replace(Environment.NewLine, "").Trim.Replace("'", "\'") + lstEvent.DecodedDesc = System.Convert.ToString(HttpUtility.HtmlDecode(templatedescr).Replace(Environment.NewLine, "")); + + EventRRULEInfo objEventRRULE = default(EventRRULEInfo); + objEventRRULE = objCtlEventRecurMaster.DecomposeRRULE(objEvent.RRULE, objEvent.EventTimeBegin); + lstEvent.RecurText = objCtlEventRecurMaster.RecurrenceText(objEventRRULE, LocalResourceFile, culture, objEvent.EventTimeBegin); + if (objEvent.RRULE != "") + { + lstEvent.RecurUntil = objEvent.LastRecurrence.ToShortDateString(); + } + else + { + lstEvent.RecurUntil = ""; + } + lstEvent.EventID = objEvent.EventID; + lstEvent.ModuleID = objEvent.ModuleID; + + lstEvent.ImageURL = ""; + if (Settings.Eventimage && objEvent.ImageURL != null && objEvent.ImageDisplay == true) + { + lstEvent.ImageURL = ImageInfo(objEvent.ImageURL, objEvent.ImageHeight, objEvent.ImageWidth); + } + + + // Get detail page url + lstEvent.URL = objEventInfoHelper.DetailPageURL(objEvent); + if (objEvent.DetailPage && objEvent.DetailNewWin) + { + lstEvent.Target = "_blank"; + } + + lstEvent.Icons = iconString; + lstEvent.DisplayDuration = System.Convert.ToInt32(Conversion.Int((double) objEvent.Duration / 1440 + 1)); + lstEvent.CategoryName = objEvent.CategoryName; + lstEvent.LocationName = tcc.TokenReplaceEvent(objEvent, tmpListLocation); + lstEvent.CustomField1 = objEvent.CustomField1; + lstEvent.CustomField2 = objEvent.CustomField2; + lstEvent.RecurMasterID = objEvent.RecurMasterID; + + if (Settings.Eventtooltiplist) + { + lstEvent.Tooltip = ToolTipCreate(objEvent, Settings.Templates.txtTooltipTemplateTitle, Settings.Templates.txtTooltipTemplateBody, isEvtEditor); + } + + lstEvent.EditVisibility = false; + if (isEvtEditor) + { + lstEvent.EditVisibility = true; + editColumnVisible = true; + } + + colEvents.Add(lstEvent); + indexID++; + } + + //Determine which fields get displayed + if (!IsPrivateNotModerator) + { + if (Settings.EventsListFields.LastIndexOf("EB", StringComparison.Ordinal) < 0 || editColumnVisible == false) + { + gvEvents.Columns[0].Visible = false; + } + else + { + gvEvents.Columns[0].Visible = true; + } + if (Settings.EventsListFields.LastIndexOf("BD", StringComparison.Ordinal) < 0) + { + gvEvents.Columns[1].Visible = false; + } + if (Settings.EventsListFields.LastIndexOf("ED", StringComparison.Ordinal) < 0) + { + gvEvents.Columns[2].Visible = false; + } + if (Settings.EventsListFields.LastIndexOf("EN", StringComparison.Ordinal) < 0) + { + gvEvents.Columns[3].Visible = false; + } + if (Settings.EventsListFields.LastIndexOf("IM", StringComparison.Ordinal) < 0) + { + gvEvents.Columns[4].Visible = false; + } + if (Settings.EventsListFields.LastIndexOf("DU", StringComparison.Ordinal) < 0) + { + gvEvents.Columns[5].Visible = false; + } + if (Settings.EventsListFields.LastIndexOf("CA", StringComparison.Ordinal) < 0) + { + gvEvents.Columns[6].Visible = false; + } + if (Settings.EventsListFields.LastIndexOf("LO", StringComparison.Ordinal) < 0) + { + gvEvents.Columns[7].Visible = false; + } + if (!Settings.EventsCustomField1 || Settings.EventsListFields.LastIndexOf("C1", StringComparison.Ordinal) < 0) + { + gvEvents.Columns[8].Visible = false; + } + if (!Settings.EventsCustomField2 || Settings.EventsListFields.LastIndexOf("C2", StringComparison.Ordinal) < 0) + { + gvEvents.Columns[9].Visible = false; + } + if (Settings.EventsListFields.LastIndexOf("DE", StringComparison.Ordinal) < 0) + { + gvEvents.Columns[10].Visible = false; + } + if (Settings.EventsListFields.LastIndexOf("RT", StringComparison.Ordinal) < 0) + { + gvEvents.Columns[11].Visible = false; + } + if (Settings.EventsListFields.LastIndexOf("RU", StringComparison.Ordinal) < 0) + { + gvEvents.Columns[12].Visible = false; + } + } + else + { + // Set Defaults + gvEvents.Columns[0].Visible = false; // Edit Buttom + gvEvents.Columns[1].Visible = true; // Begin Date + gvEvents.Columns[2].Visible = true; // End Date + gvEvents.Columns[3].Visible = true; // Title + gvEvents.Columns[4].Visible = false; // Image + gvEvents.Columns[5].Visible = false; // Duration + gvEvents.Columns[6].Visible = false; // Category + gvEvents.Columns[7].Visible = false; // Location + gvEvents.Columns[8].Visible = false; // Custom Field 1 + gvEvents.Columns[9].Visible = false; // Custom Field 2 + gvEvents.Columns[10].Visible = false; // Description + gvEvents.Columns[11].Visible = false; // Recurrence Pattern + gvEvents.Columns[12].Visible = false; // Recur Until + } + + EventListObject.SortExpression = sortExpression; + EventListObject.SortDirection = sortDirection; + colEvents.Sort(); + + gvEvents.DataKeyNames = new string[] {"IndexId", "EventID", "EventDateBegin"}; + gvEvents.DataSource = colEvents; + gvEvents.DataBind(); + } + +#endregion + +#region Control Events + public void gvEvents_RowCreated(object sender, GridViewRowEventArgs e) + { + + if (e.Row.RowType == DataControlRowType.DataRow) + { + if (Settings.Eventtooltiplist) + { + string tooltip = System.Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Tooltip")); + e.Row.Attributes.Add("title", tooltip); + } + Color backColor = (Color) (DataBinder.Eval(e.Row.DataItem, "CategoryColor")); + if (backColor.Name != "0") + { + for (int i = 0; i <= e.Row.Cells.Count - 1; i++) + { + if (e.Row.Cells[i].Visible && !(gvEvents.Columns[i].SortExpression == "Description")) + { + e.Row.Cells[i].BackColor = backColor; + } + } + } + if (IsPrivateNotModerator && !(UserId == System.Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "OwnerID")))) + { + HyperLink lnkevent = (HyperLink) (e.Row.FindControl("lnkEvent")); + lnkevent.Style.Add("cursor", "text"); + lnkevent.Style.Add("text-decoration", "none"); + lnkevent.Attributes.Add("onclick", "javascript:return false;"); + } + } + } + + protected void gvEvents_RowDataBound(object sender, GridViewRowEventArgs e) + { + if (e.Row.RowType == DataControlRowType.DataRow & Settings.Eventtooltiplist) + { + toolTipManager.TargetControls.Add(e.Row.ClientID, true); + } + } + + protected void SelectCategory_CategorySelected(object sender, CommandEventArgs e) + { + //Store the other selection(s) too. + SelectLocation.StoreLocations(); + BindDataGrid(); + } + protected void SelectLocation_LocationSelected(object sender, CommandEventArgs e) + { + //Store the other selection(s) too. + SelectCategory.StoreCategories(); + BindDataGrid(); + } + + protected void gvEvents_PageIndexChanging(object sender, GridViewPageEventArgs e) + { + //Set page index + gvEvents.PageIndex = e.NewPageIndex; + + //Binddata + BindDataGrid(); + } + + protected void gvEvents_RowCommand(object sender, GridViewCommandEventArgs e) + { + switch (e.CommandName) + { + case "Edit": + int iItemID = System.Convert.ToInt32(e.CommandArgument); + //set selected row editable + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + Response.Redirect(objEventInfoHelper.GetEditURL(iItemID, GetUrlGroupId(), GetUrlUserId())); + break; + } + } + + protected void gvEvents_Sorting(object sender, GridViewSortEventArgs e) + { + //Get the sort expression + EventListObject.SortFilter sortExpression = GetListSortExpression(e.SortExpression); + + //HACK Change sortdirection + SortDirection sortDirection = e.SortDirection; + if (!ReferenceEquals(ViewState["SortExpression"], null) && sortExpression == ((EventListObject.SortFilter) (ViewState["SortExpression"]))) + { + if (((SortDirection) (ViewState["SortDirection"])) == System.Web.UI.WebControls.SortDirection.Ascending) + { + sortDirection = System.Web.UI.WebControls.SortDirection.Descending; + } + else + { + sortDirection = System.Web.UI.WebControls.SortDirection.Ascending; + } + } + + //Cache direction en expression + ViewState["SortExpression"] = sortExpression; + ViewState["SortDirection"] = sortDirection; + + //Binddata + BindDataGrid(sortExpression, sortDirection); + } + +#endregion + +#region Web Form Designer Generated Code + //This call is required by the Web Form Designer. + [DebuggerStepThrough()]private void InitializeComponent() + { + + } + + private void Page_Init(System.Object sender, EventArgs e) + { + //CODEGEN: This method call is required by the Web Form Designer + //Do not modify it using the code editor. + InitializeComponent(); + } +#endregion + + } + } + diff --git a/EventList.ascx.designer.cs b/EventList.ascx.designer.cs new file mode 100644 index 0000000..7dc208c --- /dev/null +++ b/EventList.ascx.designer.cs @@ -0,0 +1,117 @@ +// VBConversions Note: VB project level imports +using DotNetNuke.UI; +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using DotNetNuke.Entities.Users; +using System.Web.UI; +using System.Drawing; +using DotNetNuke.Framework; +using Microsoft.VisualBasic; +using System.Configuration; +using System.Web.UI.WebControls; +using System.Collections; +using DotNetNuke.Common.Utilities; +//using System.Linq; + using System.Web; +using DotNetNuke.Common; +using System.Web.UI.HtmlControls; +using DotNetNuke.Services.Localization; +using System.Data; +using System; +using DotNetNuke.Data; +using DotNetNuke; +// End of VB project level imports + + + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + + + namespace DotNetNuke.Modules.Events + { + + public partial class EventList + { + + /// + ///toolTipManager control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Web.UI.WebControls.DnnToolTipManager toolTipManager; + + /// + ///SelectCategory control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.SelectCategory SelectCategory; + + /// + ///SelectLocation control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.SelectLocation SelectLocation; + + /// + ///EventIcons control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.EventIcons EventIcons; + + /// + ///gvEvents control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvEvents; + + /// + ///divNoEvents control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divNoEvents; + + /// + ///lblNoEvents control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblNoEvents; + + /// + ///EventIcons2 control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.EventIcons EventIcons2; + } + } + diff --git a/EventList.ascx.designer.vb b/EventList.ascx.designer.vb deleted file mode 100644 index 02ae9d0..0000000 --- a/EventList.ascx.designer.vb +++ /dev/null @@ -1,89 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Namespace DotNetNuke.Modules.Events - - Partial Public Class EventList - - ''' - '''toolTipManager control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents toolTipManager As Global.DotNetNuke.Web.UI.WebControls.DnnToolTipManager - - ''' - '''SelectCategory control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents SelectCategory As Global.DotNetNuke.Modules.Events.SelectCategory - - ''' - '''SelectLocation control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents SelectLocation As Global.DotNetNuke.Modules.Events.SelectLocation - - ''' - '''EventIcons control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents EventIcons As Global.DotNetNuke.Modules.Events.EventIcons - - ''' - '''gvEvents control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents gvEvents As Global.System.Web.UI.WebControls.GridView - - ''' - '''divNoEvents control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divNoEvents As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblNoEvents control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblNoEvents As Global.System.Web.UI.WebControls.Label - - ''' - '''EventIcons2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents EventIcons2 As Global.DotNetNuke.Modules.Events.EventIcons - End Class -End Namespace diff --git a/EventList.ascx.vb b/EventList.ascx.vb deleted file mode 100644 index 50d80c0..0000000 --- a/EventList.ascx.vb +++ /dev/null @@ -1,374 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports System -Imports System.Web.UI -Imports System.Web.UI.WebControls -Imports System.Globalization - -Namespace DotNetNuke.Modules.Events - - Partial Class EventList - Inherits EventBase - -#Region "Event Handlers" - Private _selectedEvents As ArrayList - - - Private Sub Page_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load - Try - SetupViewControls(EventIcons, EventIcons2, SelectCategory, SelectLocation) - - gvEvents.PageSize = Settings.EventsListPageSize - - If Page.IsPostBack = False Then - If Settings.EventsListShowHeader <> "No" Then - gvEvents.ShowHeader = True - Localization.LocalizeGridView(gvEvents, LocalResourceFile) - End If - BindDataGrid() - End If - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub -#End Region - -#Region "Helper Functions" - Private Sub BindDataGrid() - 'Default sort from settings - Dim sortDirection As SortDirection - If Settings.EventsListSortDirection = "ASC" Then - sortDirection = sortDirection.Ascending - Else - sortDirection = sortDirection.Descending - End If - - Dim sortExpression As EventListObject.SortFilter = GetListSortExpression(Settings.EventsListSortColumn) - - 'Show header - or not - If Settings.EventsListShowHeader = "Yes" Then - gvEvents.ShowHeader = True - Else - gvEvents.ShowHeader = False - End If - - 'Get cached sort settings - If Not ViewState("SortExpression") Is Nothing AndAlso TypeOf (ViewState("SortExpression")) Is EventListObject.SortFilter Then - sortExpression = CType(ViewState("SortExpression"), EventListObject.SortFilter) - End If - If Not ViewState("SortDirection") Is Nothing AndAlso TypeOf (ViewState("SortDirection")) Is SortDirection Then - sortDirection = CType(ViewState("SortDirection"), SortDirection) - End If - - BindDataGrid(sortExpression, sortDirection) - End Sub - - Private Sub BindDataGrid(ByVal sortExpression As EventListObject.SortFilter, ByVal sortDirection As SortDirection) - Dim culture As CultureInfo = Threading.Thread.CurrentThread.CurrentCulture - Dim objEvent As EventInfo - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - Dim editColumnVisible As Boolean = False - - ' Get Events/Sub-Calendar Events - _selectedEvents = Get_ListView_Events(SelectCategory.SelectedCategory, SelectLocation.SelectedLocation) - - Dim fmtEventTimeBegin As String = Settings.Templates.txtListEventTimeBegin - If fmtEventTimeBegin = "" Then fmtEventTimeBegin = "g" - - Dim fmtEventTimeEnd As String = Settings.Templates.txtListEventTimeEnd - If fmtEventTimeEnd = "" Then fmtEventTimeEnd = "g" - - Dim tmpListDescription As String = Settings.Templates.txtListEventDescription - Dim tmpListLocation As String = Settings.Templates.txtListLocation - - If _selectedEvents.Count = 0 Then - gvEvents.Visible = False - divNoEvents.Visible = True - Exit Sub - Else - gvEvents.Visible = True - divNoEvents.Visible = False - End If - - If Settings.Eventtooltiplist Then - toolTipManager.TargetControls.Clear() - End If - - ' if Events Selection Type only get the 1st N Events - Dim colEvents As New ArrayList - Dim lstEvent As EventListObject - Dim indexID As Integer = 0 - For Each objEvent In _selectedEvents - Dim tcc As New TokenReplaceControllerClass(ModuleId, LocalResourceFile) - Dim objCtlEventRecurMaster As New EventRecurMasterController - Dim fmtRowEnd, fmtRowBegin As String - fmtRowEnd = tcc.TokenParameters(fmtEventTimeEnd, objEvent, Settings) - fmtRowBegin = tcc.TokenParameters(fmtEventTimeBegin, objEvent, Settings) - - lstEvent = New EventListObject - lstEvent.EventID = objEvent.EventID - lstEvent.CreatedByID = objEvent.CreatedByID - lstEvent.OwnerID = objEvent.OwnerID - lstEvent.IndexId = indexID - ' Get Dates (automatically converted to User's Timezone) - lstEvent.EventDateBegin = objEvent.EventTimeBegin - lstEvent.EventDateEnd = objEvent.EventTimeEnd - If objEvent.DisplayEndDate Then - lstEvent.TxtEventDateEnd = String.Format("{0:" + fmtRowEnd + "}", lstEvent.EventDateEnd) - Else - lstEvent.TxtEventDateEnd = "" - End If - lstEvent.EventTimeBegin = objEvent.EventTimeBegin - lstEvent.TxtEventTimeBegin = String.Format("{0:" + fmtRowBegin + "}", lstEvent.EventTimeBegin) - lstEvent.Duration = objEvent.Duration - - Dim isEvtEditor As Boolean = IsEventEditor(objEvent, False) - - Dim templatedescr As String = "" - Dim iconString As String = "" - - If Not IsPrivateNotModerator Or UserId = objEvent.OwnerID Then - templatedescr = tcc.TokenReplaceEvent(objEvent, tmpListDescription, Nothing, False, isEvtEditor) - lstEvent.CategoryColor = GetColor(objEvent.Color) - lstEvent.CategoryFontColor = GetColor(objEvent.FontColor) - - iconString = CreateIconString(objEvent, Settings.IconListPrio, Settings.IconListRec, Settings.IconListReminder, Settings.IconListEnroll) - End If - - lstEvent.EventName = CreateEventName(objEvent, "[event:title]") - lstEvent.EventDesc = objEvent.EventDesc - ' RWJS - not sure why replace ' with \' - lstEvent.DecodedDesc = System.Web.HttpUtility.HtmlDecode(objEvent.EventDesc).Replace(Environment.NewLine, "").Trim.Replace("'", "\'") - lstEvent.DecodedDesc = HttpUtility.HtmlDecode(templatedescr).Replace(Environment.NewLine, "") - - Dim objEventRRULE As EventRRULEInfo - objEventRRULE = objCtlEventRecurMaster.DecomposeRRULE(objEvent.RRULE, objEvent.EventTimeBegin) - lstEvent.RecurText = objCtlEventRecurMaster.RecurrenceText(objEventRRULE, LocalResourceFile, culture, objEvent.EventTimeBegin) - If objEvent.RRULE <> "" Then - lstEvent.RecurUntil = objEvent.LastRecurrence.ToShortDateString - Else - lstEvent.RecurUntil = "" - End If - lstEvent.EventID = objEvent.EventID - lstEvent.ModuleID = objEvent.ModuleID - - lstEvent.ImageURL = "" - If Settings.Eventimage And objEvent.ImageURL <> Nothing And objEvent.ImageDisplay = True Then - lstEvent.ImageURL = ImageInfo(objEvent.ImageURL, objEvent.ImageHeight, objEvent.ImageWidth) - End If - - - ' Get detail page url - lstEvent.URL = objEventInfoHelper.DetailPageURL(objEvent) - If objEvent.DetailPage And objEvent.DetailNewWin Then - lstEvent.Target = "_blank" - End If - - lstEvent.Icons = iconString - lstEvent.DisplayDuration = CType(Int(objEvent.Duration / 1440 + 1), Integer) - lstEvent.CategoryName = objEvent.CategoryName - lstEvent.LocationName = tcc.TokenReplaceEvent(objEvent, tmpListLocation) - lstEvent.CustomField1 = objEvent.CustomField1 - lstEvent.CustomField2 = objEvent.CustomField2 - lstEvent.RecurMasterID = objEvent.RecurMasterID - - If Settings.Eventtooltiplist Then - lstEvent.Tooltip = ToolTipCreate(objEvent, Settings.Templates.txtTooltipTemplateTitle, Settings.Templates.txtTooltipTemplateBody, isEvtEditor) - End If - - lstEvent.EditVisibility = False - If isEvtEditor Then - lstEvent.EditVisibility = True - editColumnVisible = True - End If - - colEvents.Add(lstEvent) - indexID += 1 - Next - - 'Determine which fields get displayed - If (Not IsPrivateNotModerator) Then - If Settings.EventsListFields.LastIndexOf("EB", StringComparison.Ordinal) < 0 Or editColumnVisible = False Then - gvEvents.Columns.Item(0).Visible = False - Else - gvEvents.Columns.Item(0).Visible = True - End If - If Settings.EventsListFields.LastIndexOf("BD", StringComparison.Ordinal) < 0 Then - gvEvents.Columns.Item(1).Visible = False - End If - If Settings.EventsListFields.LastIndexOf("ED", StringComparison.Ordinal) < 0 Then - gvEvents.Columns.Item(2).Visible = False - End If - If Settings.EventsListFields.LastIndexOf("EN", StringComparison.Ordinal) < 0 Then - gvEvents.Columns.Item(3).Visible = False - End If - If Settings.EventsListFields.LastIndexOf("IM", StringComparison.Ordinal) < 0 Then - gvEvents.Columns.Item(4).Visible = False - End If - If Settings.EventsListFields.LastIndexOf("DU", StringComparison.Ordinal) < 0 Then - gvEvents.Columns.Item(5).Visible = False - End If - If Settings.EventsListFields.LastIndexOf("CA", StringComparison.Ordinal) < 0 Then - gvEvents.Columns.Item(6).Visible = False - End If - If Settings.EventsListFields.LastIndexOf("LO", StringComparison.Ordinal) < 0 Then - gvEvents.Columns.Item(7).Visible = False - End If - If Not Settings.EventsCustomField1 Or Settings.EventsListFields.LastIndexOf("C1", StringComparison.Ordinal) < 0 Then - gvEvents.Columns.Item(8).Visible = False - End If - If Not Settings.EventsCustomField2 Or Settings.EventsListFields.LastIndexOf("C2", StringComparison.Ordinal) < 0 Then - gvEvents.Columns.Item(9).Visible = False - End If - If Settings.EventsListFields.LastIndexOf("DE", StringComparison.Ordinal) < 0 Then - gvEvents.Columns.Item(10).Visible = False - End If - If Settings.EventsListFields.LastIndexOf("RT", StringComparison.Ordinal) < 0 Then - gvEvents.Columns.Item(11).Visible = False - End If - If Settings.EventsListFields.LastIndexOf("RU", StringComparison.Ordinal) < 0 Then - gvEvents.Columns.Item(12).Visible = False - End If - Else - ' Set Defaults - gvEvents.Columns.Item(0).Visible = False ' Edit Buttom - gvEvents.Columns.Item(1).Visible = True ' Begin Date - gvEvents.Columns.Item(2).Visible = True ' End Date - gvEvents.Columns.Item(3).Visible = True ' Title - gvEvents.Columns.Item(4).Visible = False ' Image - gvEvents.Columns.Item(5).Visible = False ' Duration - gvEvents.Columns.Item(6).Visible = False ' Category - gvEvents.Columns.Item(7).Visible = False ' Location - gvEvents.Columns.Item(8).Visible = False ' Custom Field 1 - gvEvents.Columns.Item(9).Visible = False ' Custom Field 2 - gvEvents.Columns.Item(10).Visible = False ' Description - gvEvents.Columns.Item(11).Visible = False ' Recurrence Pattern - gvEvents.Columns.Item(12).Visible = False ' Recur Until - End If - - EventListObject.SortExpression = sortExpression - EventListObject.SortDirection = sortDirection - colEvents.Sort() - - gvEvents.DataKeyNames = New String() {"IndexId", "EventID", "EventDateBegin"} - gvEvents.DataSource = colEvents - gvEvents.DataBind() - End Sub - -#End Region - -#Region "Control Events" - Sub gvEvents_RowCreated(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles gvEvents.RowCreated - - If e.Row.RowType = DataControlRowType.DataRow Then - If Settings.Eventtooltiplist Then - Dim tooltip As String = CType(DataBinder.Eval(e.Row.DataItem, "Tooltip"), String) - e.Row.Attributes.Add("title", tooltip) - End If - Dim backColor As Color = CType(DataBinder.Eval(e.Row.DataItem, "CategoryColor"), Color) - If backColor.Name <> "0" Then - For i As Integer = 0 To e.Row.Cells.Count - 1 - If e.Row.Cells(i).Visible And Not gvEvents.Columns(i).SortExpression = "Description" Then - e.Row.Cells(i).BackColor = backColor - End If - Next - End If - If IsPrivateNotModerator And Not UserId = CType(DataBinder.Eval(e.Row.DataItem, "OwnerID"), Integer) Then - Dim lnkevent As HyperLink = CType(e.Row.FindControl("lnkEvent"), HyperLink) - lnkevent.Style.Add("cursor", "text") - lnkevent.Style.Add("text-decoration", "none") - lnkevent.Attributes.Add("onclick", "javascript:return false;") - End If - End If - End Sub - - Private Sub gvEvents_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles gvEvents.RowDataBound - If e.Row.RowType = DataControlRowType.DataRow And Settings.Eventtooltiplist Then - toolTipManager.TargetControls.Add(e.Row.ClientID, True) - End If - End Sub - - Private Sub SelectCategory_CategorySelected(ByVal sender As Object, ByVal e As CommandEventArgs) Handles SelectCategory.CategorySelectedChanged - 'Store the other selection(s) too. - SelectLocation.StoreLocations() - BindDataGrid() - End Sub - Private Sub SelectLocation_LocationSelected(ByVal sender As Object, ByVal e As CommandEventArgs) Handles SelectLocation.LocationSelectedChanged - 'Store the other selection(s) too. - SelectCategory.StoreCategories() - BindDataGrid() - End Sub - - Private Sub gvEvents_PageIndexChanging(ByVal sender As Object, ByVal e As GridViewPageEventArgs) Handles gvEvents.PageIndexChanging - 'Set page index - gvEvents.PageIndex = e.NewPageIndex - - 'Binddata - BindDataGrid() - End Sub - - Private Sub gvEvents_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles gvEvents.RowCommand - Select Case e.CommandName - Case "Edit" - Dim iItemID As Integer = CType(e.CommandArgument, Integer) - 'set selected row editable - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - Response.Redirect(objEventInfoHelper.GetEditURL(iItemID, GetUrlGroupId, GetUrlUserId)) - End Select - End Sub - - Private Sub gvEvents_Sorting(ByVal sender As Object, ByVal e As GridViewSortEventArgs) Handles gvEvents.Sorting - 'Get the sort expression - Dim sortExpression As EventListObject.SortFilter = GetListSortExpression(e.SortExpression) - - 'HACK Change sortdirection - Dim sortDirection As SortDirection = e.SortDirection - If Not ViewState("SortExpression") Is Nothing AndAlso sortExpression = CType(ViewState("SortExpression"), EventListObject.SortFilter) Then - If CType(ViewState("SortDirection"), SortDirection) = sortDirection.Ascending Then - sortDirection = sortDirection.Descending - Else - sortDirection = sortDirection.Ascending - End If - End If - - 'Cache direction en expression - ViewState("SortExpression") = sortExpression - ViewState("SortDirection") = sortDirection - - 'Binddata - BindDataGrid(sortExpression, sortDirection) - End Sub - -#End Region - -#Region " Web Form Designer Generated Code " - 'This call is required by the Web Form Designer. - Private Sub InitializeComponent() - - End Sub - - Private Sub Page_Init(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Init - 'CODEGEN: This method call is required by the Web Form Designer - 'Do not modify it using the code editor. - InitializeComponent() - End Sub -#End Region - - End Class -End Namespace \ No newline at end of file diff --git a/EventModerate.ascx b/EventModerate.ascx index f0e2e57..ad49e09 100644 --- a/EventModerate.ascx +++ b/EventModerate.ascx @@ -1,10 +1,10 @@ -<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="EventModerate.ascx.vb" Inherits="DotNetNuke.Modules.Events.EventModerate" Explicit="True" %> +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EventModerate.ascx.cs" Inherits="DotNetNuke.Modules.Events.EventModerate" Explicit="True" %> <%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
- + Events Enrollment @@ -119,11 +119,12 @@ Note: Deny will delete Event/Signup Entries from the Database!
    -
  • -
  • -
  • -
  • -
  • +
  • +
  • +
  • +
  • +
+ diff --git a/EventModerate.ascx.cs b/EventModerate.ascx.cs new file mode 100644 index 0000000..bbfae6e --- /dev/null +++ b/EventModerate.ascx.cs @@ -0,0 +1,614 @@ +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using DotNetNuke.Framework; +using System.Web.UI.WebControls; +using System.Collections; +using DotNetNuke.Services.Localization; +using System; + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events +{ + + [DNNtc.ModuleControlProperties("Moderate", "Moderate Events and Enrollment", DNNtc.ControlType.View, "https://dnnevents.codeplex.com/documentation", true, true)] + public partial class EventModerate : EventBase + { + + #region Web Form Designer Generated Code + + //This call is required by the Web Form Designer. + [DebuggerStepThrough()] + private void InitializeComponent() + { + + } + + private void Page_Init(System.Object sender, EventArgs e) + { + //CODEGEN: This method call is required by the Web Form Designer + //Do not modify it using the code editor. + InitializeComponent(); + } + + #endregion + + #region Private Area + private EventController _objCtlEvent = new EventController(); + private EventRecurMasterController _objCtlEventRecurMaster = new EventRecurMasterController(); + private EventSignupsController _objCtlEventSignups = new EventSignupsController(); + private ArrayList _eventModeration = new ArrayList(); + private ArrayList _eventRecurModeration = new ArrayList(); + #endregion + + #region Event Handlers + private void Page_Load(System.Object sender, EventArgs e) + { + try + { + // Verify that the current user has moderator access to this module + if (Security.PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString()) || + IsModerator()) + { + } + else + { + Response.Redirect(GetSocialNavigateUrl(), true); + } + + // Set the selected theme + SetTheme(pnlEventsModuleModerate); + + if (Page.IsPostBack == false) + { + txtEmailFrom.Text = UserInfo.Email.ToString(); + LocalizeAll(); + //Are You Sure You Wish To Update/Delete Item(s) (and send Email) ?' + cmdUpdateSelected.Attributes.Add("onclick", "javascript:return confirm('" + Localization.GetString("ConfirmUpdateDeleteModerate", LocalResourceFile) + "');"); + BindData(); + } + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + #endregion + + #region Helper Methods + private void BindData() + { + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + EventTimeZoneUtilities objEventTimeZoneUtilities = new EventTimeZoneUtilities(); + _eventModeration = new ArrayList(); + switch (rbModerate.SelectedValue) + { + case "Events": + _eventModeration = objEventInfoHelper.ConvertEventListToDisplayTimeZone(_objCtlEvent.EventsModerateEvents(ModuleId, GetUrlGroupId()), GetDisplayTimeZoneId()); + + _eventRecurModeration = new ArrayList(); + _eventRecurModeration = _objCtlEventRecurMaster.EventsRecurMasterModerate(ModuleId, GetUrlGroupId()); + foreach (EventRecurMasterInfo objRecurMaster in _eventRecurModeration) + { + objRecurMaster.Dtstart = objEventTimeZoneUtilities.ConvertToDisplayTimeZone(objRecurMaster.Dtstart, objRecurMaster.EventTimeZoneId, PortalId, GetDisplayTimeZoneId()).EventDate; + } + + //Get data for selected date and fill grid + grdEvents.DataSource = _eventModeration; + grdEvents.DataBind(); + + if (_eventRecurModeration.Count > 0) + { + grdRecurEvents.DataSource = _eventRecurModeration; + grdRecurEvents.DataBind(); + grdRecurEvents.Visible = true; + } + + grdEvents.Visible = true; + grdEnrollment.Visible = false; + break; + case "Enrollment": + _eventModeration = _objCtlEventSignups.EventsModerateSignups(ModuleId, GetUrlGroupId()); + + EventSignupsInfo objSignup = default(EventSignupsInfo); + foreach (EventSignupsInfo tempLoopVar_objSignup in _eventModeration) + { + objSignup = tempLoopVar_objSignup; + if (objSignup.UserID != -1) + { + objSignup.UserName = objEventInfoHelper.UserDisplayNameProfile(objSignup.UserID, objSignup.UserName, LocalResourceFile).DisplayNameURL; + } + else + { + objSignup.UserName = objSignup.AnonName; + objSignup.Email = objSignup.AnonEmail; + } + if (objSignup.Email == "") + { + objSignup.EmailVisible = false; + } + else + { + objSignup.EmailVisible = true; + } + objSignup.EventTimeBegin = objEventTimeZoneUtilities.ConvertToDisplayTimeZone(objSignup.EventTimeBegin, objSignup.EventTimeZoneId, PortalId, GetDisplayTimeZoneId()).EventDate; + } + + //Get data for selected date and fill grid + grdEnrollment.DataSource = _eventModeration; + grdEnrollment.DataBind(); + //Add Remove Popup to grid + int i = 0; + if (grdEnrollment.Items.Count > 0) + { + for (i = 0; i <= grdEnrollment.Items.Count - 1; i++) + { + //Are You Sure You Wish To Email the User?' + ((ImageButton)(grdEnrollment.Items[i].FindControl("btnUserEmail"))).Attributes.Add("onclick", "javascript:return confirm('" + Localization.GetString("ConfirmModerateSendMailToUser", LocalResourceFile) + "');"); + ((ImageButton)(grdEnrollment.Items[i].FindControl("btnUserEmail"))).AlternateText = Localization.GetString("EmailUser", LocalResourceFile); + ((ImageButton)(grdEnrollment.Items[i].FindControl("btnUserEmail"))).ToolTip = Localization.GetString("EmailUser", LocalResourceFile); + } + grdEvents.Visible = false; + grdRecurEvents.Visible = false; + grdEnrollment.Visible = true; + } + break; + } + if (_eventModeration.Count < 1) + { + //"No New Events/Enrollments to Moderate..." + lblMessage.Text = Localization.GetString("MsgModerateNothingToModerate", LocalResourceFile); + ShowButtonsGrid(false); + } + else + { + //Deny option will delete Event/Enrollment Entries from the Database!" + lblMessage.Text = Localization.GetString("MsgModerateNoteDenyOption", LocalResourceFile); + ShowButtonsGrid(true); + } + } + + private void LocalizeAll() + { + txtEmailSubject.Text = Settings.Templates.txtEmailSubject; + txtEmailMessage.Text = Settings.Templates.txtEmailMessage; + + grdEvents.Columns[0].HeaderText = Localization.GetString("SingleAction", LocalResourceFile); + grdEvents.Columns[1].HeaderText = Localization.GetString("Date", LocalResourceFile); + grdEvents.Columns[2].HeaderText = Localization.GetString("Time", LocalResourceFile); + grdEvents.Columns[3].HeaderText = Localization.GetString("Event", LocalResourceFile); + + grdRecurEvents.Columns[0].HeaderText = Localization.GetString("RecurAction", LocalResourceFile); + grdRecurEvents.Columns[1].HeaderText = Localization.GetString("Date", LocalResourceFile); + grdRecurEvents.Columns[2].HeaderText = Localization.GetString("Time", LocalResourceFile); + grdRecurEvents.Columns[3].HeaderText = Localization.GetString("Event", LocalResourceFile); + + grdEnrollment.Columns[0].HeaderText = Localization.GetString("Action", LocalResourceFile); + grdEnrollment.Columns[1].HeaderText = Localization.GetString("Date", LocalResourceFile); + grdEnrollment.Columns[2].HeaderText = Localization.GetString("Time", LocalResourceFile); + grdEnrollment.Columns[3].HeaderText = Localization.GetString("Event", LocalResourceFile); + grdEnrollment.Columns[4].HeaderText = ""; + grdEnrollment.Columns[5].HeaderText = Localization.GetString("User", LocalResourceFile); + grdEnrollment.Columns[6].HeaderText = Localization.GetString("NoEnrolees", LocalResourceFile); + + } + + private void ShowButtonsGrid(bool blShow) + { + pnlEmail.Visible = blShow; + pnlGrid.Visible = blShow; + cmdUpdateSelected.Visible = blShow; + cmdSelectApproveAll.Visible = blShow; + cmdSelectDenyAll.Visible = blShow; + cmdUnmarkAll.Visible = blShow; + } + #endregion + + #region Links and Buttons + protected void cmdUpdateSelected_Click(System.Object sender, EventArgs e) + { + DataGridItem item = default(DataGridItem); + EventEmails objEventEmail = new EventEmails(PortalId, ModuleId, LocalResourceFile, ((PageBase)Page).PageCulture.Name); + + try + { + switch (rbModerate.SelectedValue) + { + case "Events": + EventEmailInfo objEventEmailInfo_1 = new EventEmailInfo(); + objEventEmailInfo_1.TxtEmailSubject = txtEmailSubject.Text; + objEventEmailInfo_1.TxtEmailBody = txtEmailMessage.Text; + objEventEmailInfo_1.TxtEmailFrom = txtEmailFrom.Text; + EventInfo objCal = new EventInfo(); + EventRecurMasterInfo objEventRecurMaster = default(EventRecurMasterInfo); + foreach (DataGridItem tempLoopVar_item in grdEvents.Items) + { + item = tempLoopVar_item; + switch (((RadioButtonList)(item.FindControl("rbEventAction"))).SelectedValue) + { + case "Approve": + objCal = _objCtlEvent.EventsGet(System.Convert.ToInt32(grdEvents.DataKeys[item.ItemIndex]), ModuleId); + objCal.Approved = true; + bool newEventEmailSent = objCal.NewEventEmailSent; + objCal.NewEventEmailSent = true; + _objCtlEvent.EventsSave(objCal, true, TabId, false); + // Only send event emails when event approved for first time + if (!newEventEmailSent) + { + objCal.RRULE = ""; + SendNewEventEmails(objCal); + CreateNewEventJournal(objCal); + } + // Email Requesting/Moderated User + if (chkEmail.Checked) + { + objCal.RRULE = ""; + objEventEmailInfo_1.UserIDs.Clear(); + objEventEmailInfo_1.UserIDs.Add(objCal.OwnerID); + objEventEmail.SendEmails(objEventEmailInfo_1, objCal); + } + break; + case "Deny": + objCal = _objCtlEvent.EventsGet(System.Convert.ToInt32(grdEvents.DataKeys[item.ItemIndex]), ModuleId); + //Don't Allow Delete on Enrolled Event - Only Cancel + objEventRecurMaster = _objCtlEventRecurMaster.EventsRecurMasterGet(objCal.RecurMasterID, objCal.ModuleID); + if (objEventRecurMaster.RRULE != "") + { + objCal.Cancelled = true; + objCal.LastUpdatedID = UserId; + objCal = _objCtlEvent.EventsSave(objCal, false, TabId, true); + } + else + { + _objCtlEventRecurMaster.EventsRecurMasterDelete(objCal.RecurMasterID, objCal.ModuleID); + } + // Email Requesting/Moderated User + if (chkEmail.Checked) + { + objCal.RRULE = ""; + objEventEmailInfo_1.UserIDs.Clear(); + objEventEmailInfo_1.UserIDs.Add(objCal.OwnerID); + objEventEmail.SendEmails(objEventEmailInfo_1, objCal); + } + break; + } + } + foreach (DataGridItem tempLoopVar_item in grdRecurEvents.Items) + { + item = tempLoopVar_item; + switch (((RadioButtonList)(item.FindControl("rbEventRecurAction"))).SelectedValue) + { + case "Approve": + objEventRecurMaster = _objCtlEventRecurMaster.EventsRecurMasterGet(System.Convert.ToInt32(grdRecurEvents.DataKeys[item.ItemIndex]), ModuleId); + objEventRecurMaster.Approved = true; + _objCtlEventRecurMaster.EventsRecurMasterSave(objEventRecurMaster, TabId, false); + ArrayList lstEvents = default(ArrayList); + lstEvents = _objCtlEvent.EventsGetRecurrences(objEventRecurMaster.RecurMasterID, objEventRecurMaster.ModuleID); + bool blEmailSent = false; + foreach (EventInfo tempLoopVar_objCal in lstEvents) + { + objCal = tempLoopVar_objCal; + if (!objCal.Cancelled) + { + objCal.Approved = true; + bool newEventEmailSent = objCal.NewEventEmailSent; + objCal.NewEventEmailSent = true; + _objCtlEvent.EventsSave(objCal, true, TabId, false); + // Only send event emails when event approved for first time + if (!newEventEmailSent && !blEmailSent) + { + objCal.RRULE = objEventRecurMaster.RRULE; + SendNewEventEmails(objCal); + CreateNewEventJournal(objCal); + blEmailSent = true; + } + } + } + // Email Requesting/Moderated User + if (chkEmail.Checked) + { + objCal.RRULE = objEventRecurMaster.RRULE; + objEventEmailInfo_1.UserIDs.Clear(); + objEventEmailInfo_1.UserIDs.Add(objEventRecurMaster.CreatedByID); + objEventEmail.SendEmails(objEventEmailInfo_1, objCal); + } + break; + case "Deny": + objEventRecurMaster = _objCtlEventRecurMaster.EventsRecurMasterGet(System.Convert.ToInt32(grdRecurEvents.DataKeys[item.ItemIndex]), ModuleId); + //Don't Allow Delete on Enrolled Event - Only Cancel + _objCtlEventRecurMaster.EventsRecurMasterDelete(System.Convert.ToInt32(grdRecurEvents.DataKeys[item.ItemIndex]), ModuleId); + // Email Requesting/Moderated User + if (chkEmail.Checked) + { + objCal.RRULE = objEventRecurMaster.RRULE; + objEventEmailInfo_1.UserIDs.Clear(); + objEventEmailInfo_1.UserIDs.Add(objEventRecurMaster.CreatedByID); + objEventEmail.SendEmails(objEventEmailInfo_1, objCal); + } + break; + } + } + break; + case "Enrollment": + // Not moderated + EventSignupsInfo objEnroll = default(EventSignupsInfo); + foreach (DataGridItem tempLoopVar_item in grdEnrollment.Items) + { + item = tempLoopVar_item; + if (((RadioButtonList)(item.FindControl("rbEnrollAction"))).SelectedValue != "") + { + objEnroll = _objCtlEventSignups.EventsSignupsGet(System.Convert.ToInt32(grdEnrollment.DataKeys[item.ItemIndex]), ModuleId, false); + EventController objCtlEvent = new EventController(); + EventInfo objEvent = objCtlEvent.EventsGet(objEnroll.EventID, objEnroll.ModuleID); + EventEmailInfo objEventEmailInfo = new EventEmailInfo(); + objEventEmailInfo.TxtEmailSubject = txtEmailSubject.Text; + objEventEmailInfo.TxtEmailFrom = txtEmailFrom.Text; + if (chkEmail.Checked) + { + if (objEnroll.UserID > -1) + { + objEventEmailInfo.UserIDs.Add(objEnroll.UserID); + } + else + { + objEventEmailInfo.UserEmails.Add(objEnroll.AnonEmail); + objEventEmailInfo.UserLocales.Add(objEnroll.AnonCulture); + objEventEmailInfo.UserTimeZoneIds.Add(objEnroll.AnonTimeZoneId); + } + } + switch (((RadioButtonList)(item.FindControl("rbEnrollAction"))).SelectedValue) + { + case "Approve": + objEnroll.Approved = true; + CreateEnrollment(objEnroll, objEvent); + + // Email Requesting/Moderated User + if (Settings.SendEnrollMessageApproved) + { + objEventEmailInfo.UserIDs.Add(objEvent.OwnerID); + } + objEventEmailInfo.TxtEmailBody = txtEmailMessage.Text + Settings.Templates.txtEnrollMessageApproved; + objEventEmail.SendEmails(objEventEmailInfo, objEvent, objEnroll); + break; + case "Deny": + DeleteEnrollment(System.Convert.ToInt32(grdEnrollment.DataKeys[item.ItemIndex]), objEvent.ModuleID, objEvent.EventID); + + // Email Requesting/Moderated User + if (Settings.SendEnrollMessageDenied) + { + objEventEmailInfo.UserIDs.Add(objEvent.OwnerID); + } + objEventEmailInfo.TxtEmailBody = txtEmailMessage.Text + Settings.Templates.txtEnrollMessageDenied; + objEventEmail.SendEmails(objEventEmailInfo, objEvent, objEnroll); + break; + } + } + } + break; + } + + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + BindData(); + } + + protected void cmdSelectApproveAll_Click(System.Object sender, EventArgs e) + { + BindData(); + DataGridItem item = default(DataGridItem); + if (rbModerate.SelectedValue == "Events") + { + foreach (DataGridItem tempLoopVar_item in grdEvents.Items) + { + item = tempLoopVar_item; + ((RadioButtonList)(item.FindControl("rbEventAction"))).SelectedValue = "Approve"; + } + foreach (DataGridItem tempLoopVar_item in grdRecurEvents.Items) + { + item = tempLoopVar_item; + ((RadioButtonList)(item.FindControl("rbEventRecurAction"))).SelectedValue = "Approve"; + } + } + else + { + foreach (DataGridItem tempLoopVar_item in grdEnrollment.Items) + { + item = tempLoopVar_item; + ((RadioButtonList)(item.FindControl("rbEnrollAction"))).SelectedValue = "Approve"; + } + } + cmdUpdateSelected_Click(sender, e); + } + + protected void cmdSelectDenyAll_Click(System.Object sender, EventArgs e) + { + BindData(); + DataGridItem item = default(DataGridItem); + if (rbModerate.SelectedValue == "Events") + { + foreach (DataGridItem tempLoopVar_item in grdEvents.Items) + { + item = tempLoopVar_item; + ((RadioButtonList)(item.FindControl("rbEventAction"))).SelectedValue = "Deny"; + } + foreach (DataGridItem tempLoopVar_item in grdRecurEvents.Items) + { + item = tempLoopVar_item; + ((RadioButtonList)(item.FindControl("rbEventRecurAction"))).SelectedValue = "Deny"; + } + } + else + { + foreach (DataGridItem tempLoopVar_item in grdEnrollment.Items) + { + item = tempLoopVar_item; + ((RadioButtonList)(item.FindControl("rbEnrollAction"))).SelectedValue = "Deny"; + } + } + cmdUpdateSelected_Click(sender, e); + } + + protected void cmdUnmarkAll_Click(System.Object sender, EventArgs e) + { + BindData(); + DataGridItem item = default(DataGridItem); + if (rbModerate.SelectedValue == "Events") + { + foreach (DataGridItem tempLoopVar_item in grdEvents.Items) + { + item = tempLoopVar_item; + ((RadioButtonList)(item.FindControl("rbEventAction"))).SelectedValue = null; + } + foreach (DataGridItem tempLoopVar_item in grdRecurEvents.Items) + { + item = tempLoopVar_item; + ((RadioButtonList)(item.FindControl("rbEventRecurAction"))).SelectedValue = null; + } + } + else + { + foreach (DataGridItem tempLoopVar_item in grdEnrollment.Items) + { + item = tempLoopVar_item; + ((RadioButtonList)(item.FindControl("rbEnrollAction"))).SelectedValue = null; + } + } + } + + #endregion + + #region Grid and Other Events + private void rbModerate_SelectedIndexChanged(System.Object sender, EventArgs e) + { + if (rbModerate.SelectedValue == "Events") + { + grdEnrollment.Visible = false; + grdEvents.Visible = true; + grdRecurEvents.Visible = true; + } + else + { + grdEnrollment.Visible = true; + grdEvents.Visible = false; + } + BindData(); + } + + public void grdEvents_ItemCommand(System.Object sender, System.Web.UI.WebControls.DataGridCommandEventArgs e) + { + switch (e.CommandName) + { + case "Select": + int itemID = System.Convert.ToInt32(grdEvents.DataKeys[e.Item.ItemIndex]); + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + Response.Redirect(objEventInfoHelper.AddSkinContainerControls(DotNetNuke.Common.Globals.NavigateURL(TabId, "Edit", "Mid=" + ModuleId.ToString(), "ItemID=" + itemID.ToString(), "EditRecur=Single"), "?")); + break; + } + } + + public void grdRecurEvents_ItemCommand(System.Object sender, System.Web.UI.WebControls.DataGridCommandEventArgs e) + { + switch (e.CommandName) + { + case "Select": + int itemID = System.Convert.ToInt32(e.Item.Cells[4].Text); + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + Response.Redirect(objEventInfoHelper.AddSkinContainerControls(DotNetNuke.Common.Globals.NavigateURL(TabId, "Edit", "Mid=" + ModuleId.ToString(), "ItemID=" + itemID.ToString(), "EditRecur=All"), "?")); + break; + } + } + + + public void grdEnrollment_ItemCommand(System.Object sender, System.Web.UI.WebControls.DataGridCommandEventArgs e) + { + EventSignupsInfo objEnroll = default(EventSignupsInfo); + objEnroll = _objCtlEventSignups.EventsSignupsGet(System.Convert.ToInt32(grdEnrollment.DataKeys[e.Item.ItemIndex]), ModuleId, false); + + try + { + switch (e.CommandName) + { + case "Select": + try + { + int itemID = objEnroll.EventID; + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + Response.Redirect(objEventInfoHelper.AddSkinContainerControls(EditUrl("ItemID", itemID.ToString(), "Edit"), "?")); + } + catch (Exception) + { + } + break; + case "User": + EventController objCtlEvent = new EventController(); + EventInfo objEvent = objCtlEvent.EventsGet(objEnroll.EventID, objEnroll.ModuleID); + + EventEmailInfo objEventEmailInfo = new EventEmailInfo(); + EventEmails objEventEmail = new EventEmails(PortalId, ModuleId, LocalResourceFile, ((PageBase)Page).PageCulture.Name); + objEventEmailInfo.TxtEmailSubject = txtEmailSubject.Text; + objEventEmailInfo.TxtEmailBody = txtEmailMessage.Text; + objEventEmailInfo.TxtEmailFrom = txtEmailFrom.Text; + if (objEnroll.UserID > -1) + { + objEventEmailInfo.UserIDs.Add(objEnroll.UserID); + } + else + { + objEventEmailInfo.UserEmails.Add(objEnroll.AnonEmail); + objEventEmailInfo.UserLocales.Add(objEnroll.AnonCulture); + objEventEmailInfo.UserTimeZoneIds.Add(objEnroll.AnonTimeZoneId); + } + objEventEmail.SendEmails(objEventEmailInfo, objEvent, objEnroll); + break; + + } + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + BindData(); + } + + protected void returnButton_Click(System.Object sender, EventArgs e) + { + try + { + Response.Redirect(GetSocialNavigateUrl(), true); + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + + #endregion + + } + +} + diff --git a/EventModerate.ascx.designer.cs b/EventModerate.ascx.designer.cs new file mode 100644 index 0000000..ac03f65 --- /dev/null +++ b/EventModerate.ascx.designer.cs @@ -0,0 +1,204 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DotNetNuke.Modules.Events { + + + public partial class EventModerate { + + /// + /// pnlEventsModuleModerate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlEventsModuleModerate; + + /// + /// lblModerateView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblModerateView; + + /// + /// rbModerate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButtonList rbModerate; + + /// + /// pnlEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlEmail; + + /// + /// chkEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEmail; + + /// + /// lblEmailFrom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEmailFrom; + + /// + /// txtEmailFrom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtEmailFrom; + + /// + /// lblNotifyEmailSubject control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblNotifyEmailSubject; + + /// + /// txtEmailSubject control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtEmailSubject; + + /// + /// lblNotifyEmailMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblNotifyEmailMessage; + + /// + /// txtEmailMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtEmailMessage; + + /// + /// pnlGrid control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlGrid; + + /// + /// grdRecurEvents control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DataGrid grdRecurEvents; + + /// + /// grdEvents control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DataGrid grdEvents; + + /// + /// grdEnrollment control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DataGrid grdEnrollment; + + /// + /// lblMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMessage; + + /// + /// returnButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton returnButton; + + /// + /// cmdUpdateSelected control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdUpdateSelected; + + /// + /// cmdSelectApproveAll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdSelectApproveAll; + + /// + /// cmdSelectDenyAll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdSelectDenyAll; + + /// + /// cmdUnmarkAll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdUnmarkAll; + } +} diff --git a/EventModerate.ascx.designer.vb b/EventModerate.ascx.designer.vb deleted file mode 100644 index 90790fe..0000000 --- a/EventModerate.ascx.designer.vb +++ /dev/null @@ -1,206 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Namespace DotNetNuke.Modules.Events - - Partial Public Class EventModerate - - ''' - '''pnlEventsModuleModerate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlEventsModuleModerate As Global.System.Web.UI.WebControls.Panel - - ''' - '''lblModerateView control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblModerateView As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''rbModerate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rbModerate As Global.System.Web.UI.WebControls.RadioButtonList - - ''' - '''pnlEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlEmail As Global.System.Web.UI.WebControls.Panel - - ''' - '''chkEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEmail As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblEmailFrom control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEmailFrom As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtEmailFrom control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtEmailFrom As Global.System.Web.UI.WebControls.TextBox - - ''' - '''lblNotifyEmailSubject control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblNotifyEmailSubject As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtEmailSubject control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtEmailSubject As Global.System.Web.UI.WebControls.TextBox - - ''' - '''lblNotifyEmailMessage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblNotifyEmailMessage As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtEmailMessage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtEmailMessage As Global.System.Web.UI.WebControls.TextBox - - ''' - '''pnlGrid control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlGrid As Global.System.Web.UI.WebControls.Panel - - ''' - '''grdRecurEvents control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents grdRecurEvents As Global.System.Web.UI.WebControls.DataGrid - - ''' - '''grdEvents control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents grdEvents As Global.System.Web.UI.WebControls.DataGrid - - ''' - '''grdEnrollment control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents grdEnrollment As Global.System.Web.UI.WebControls.DataGrid - - ''' - '''lblMessage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblMessage As Global.System.Web.UI.WebControls.Label - - ''' - '''returnButton control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents returnButton As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''cmdUpdateSelected control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdUpdateSelected As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''cmdSelectApproveAll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdSelectApproveAll As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''cmdSelectDenyAll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdSelectDenyAll As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''cmdUnmarkAll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdUnmarkAll As Global.System.Web.UI.WebControls.LinkButton - End Class -End Namespace diff --git a/EventModerate.ascx.vb b/EventModerate.ascx.vb deleted file mode 100644 index 711b123..0000000 --- a/EventModerate.ascx.vb +++ /dev/null @@ -1,472 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - -Imports System.Collections - -Namespace DotNetNuke.Modules.Events - - _ - Partial Class EventModerate - Inherits EventBase - -#Region " Web Form Designer Generated Code " - - 'This call is required by the Web Form Designer. - Private Sub InitializeComponent() - - End Sub - - Private Sub Page_Init(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Init - 'CODEGEN: This method call is required by the Web Form Designer - 'Do not modify it using the code editor. - InitializeComponent() - End Sub - -#End Region - -#Region "Private Area" - Private ReadOnly _objCtlEvent As New EventController - Private ReadOnly _objCtlEventRecurMaster As New EventRecurMasterController - Private ReadOnly _objCtlEventSignups As New EventSignupsController - Private _eventModeration, _eventRecurModeration As New ArrayList -#End Region - -#Region "Event Handlers" - Private Sub Page_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load - Try - ' Verify that the current user has moderator access to this module - If Security.PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) Or _ - IsModerator() Then - Else - Response.Redirect(GetSocialNavigateUrl(), True) - End If - - ' Set the selected theme - SetTheme(pnlEventsModuleModerate) - - If Page.IsPostBack = False Then - txtEmailFrom.Text = UserInfo.Email.ToString - LocalizeAll() - 'Are You Sure You Wish To Update/Delete Item(s) (and send Email) ?' - cmdUpdateSelected.Attributes.Add("onclick", "javascript:return confirm('" + Localization.GetString("ConfirmUpdateDeleteModerate", LocalResourceFile) + "');") - BindData() - End If - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub -#End Region - -#Region "Helper Methods" - Private Sub BindData() - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - Dim objEventTimeZoneUtilities As New EventTimeZoneUtilities - _eventModeration = New ArrayList - Select Case rbModerate.SelectedValue - Case "Events" - _eventModeration = objEventInfoHelper.ConvertEventListToDisplayTimeZone(_objCtlEvent.EventsModerateEvents(ModuleId, GetUrlGroupId), GetDisplayTimeZoneId()) - - _eventRecurModeration = New ArrayList - _eventRecurModeration = _objCtlEventRecurMaster.EventsRecurMasterModerate(ModuleId, GetUrlGroupId) - For Each objRecurMaster As EventRecurMasterInfo In _eventRecurModeration - objRecurMaster.Dtstart = objEventTimeZoneUtilities.ConvertToDisplayTimeZone(objRecurMaster.Dtstart, objRecurMaster.EventTimeZoneId, PortalId, GetDisplayTimeZoneId()).EventDate - Next - - 'Get data for selected date and fill grid - grdEvents.DataSource = _eventModeration - grdEvents.DataBind() - - If _eventRecurModeration.Count > 0 Then - grdRecurEvents.DataSource = _eventRecurModeration - grdRecurEvents.DataBind() - grdRecurEvents.Visible = True - End If - - grdEvents.Visible = True - grdEnrollment.Visible = False - Case "Enrollment" - _eventModeration = _objCtlEventSignups.EventsModerateSignups(ModuleId, GetUrlGroupId) - - Dim objSignup As EventSignupsInfo - For Each objSignup In _eventModeration - If objSignup.UserID <> -1 Then - objSignup.UserName = objEventInfoHelper.UserDisplayNameProfile(objSignup.UserID, objSignup.UserName, LocalResourceFile).DisplayNameURL - Else - objSignup.UserName = objSignup.AnonName - objSignup.Email = objSignup.AnonEmail - End If - If objSignup.Email = "" Then - objSignup.EmailVisible = False - Else - objSignup.EmailVisible = True - End If - objSignup.EventTimeBegin = objEventTimeZoneUtilities.ConvertToDisplayTimeZone(objSignup.EventTimeBegin, objSignup.EventTimeZoneId, PortalId, GetDisplayTimeZoneId()).EventDate - Next - - 'Get data for selected date and fill grid - grdEnrollment.DataSource = _eventModeration - grdEnrollment.DataBind() - 'Add Remove Popup to grid - Dim i As Integer - If grdEnrollment.Items.Count > 0 Then - For i = 0 To grdEnrollment.Items.Count - 1 - 'Are You Sure You Wish To Email the User?' - CType(grdEnrollment.Items(i).FindControl("btnUserEmail"), ImageButton).Attributes.Add("onclick", "javascript:return confirm('" + Localization.GetString("ConfirmModerateSendMailToUser", LocalResourceFile) + "');") - CType(grdEnrollment.Items(i).FindControl("btnUserEmail"), ImageButton).AlternateText = Localization.GetString("EmailUser", LocalResourceFile) - CType(grdEnrollment.Items(i).FindControl("btnUserEmail"), ImageButton).ToolTip = Localization.GetString("EmailUser", LocalResourceFile) - Next - grdEvents.Visible = False - grdRecurEvents.Visible = False - grdEnrollment.Visible = True - End If - End Select - If _eventModeration.Count < 1 Then - '"No New Events/Enrollments to Moderate..." - lblMessage.Text = Localization.GetString("MsgModerateNothingToModerate", LocalResourceFile) - ShowButtonsGrid(False) - Else - 'Deny option will delete Event/Enrollment Entries from the Database!" - lblMessage.Text = Localization.GetString("MsgModerateNoteDenyOption", LocalResourceFile) - ShowButtonsGrid(True) - End If - End Sub - - Private Sub LocalizeAll() - txtEmailSubject.Text = Settings.Templates.txtEmailSubject - txtEmailMessage.Text = Settings.Templates.txtEmailMessage - - grdEvents.Columns(0).HeaderText = Localization.GetString("SingleAction", LocalResourceFile) - grdEvents.Columns(1).HeaderText = Localization.GetString("Date", LocalResourceFile) - grdEvents.Columns(2).HeaderText = Localization.GetString("Time", LocalResourceFile) - grdEvents.Columns(3).HeaderText = Localization.GetString("Event", LocalResourceFile) - - grdRecurEvents.Columns(0).HeaderText = Localization.GetString("RecurAction", LocalResourceFile) - grdRecurEvents.Columns(1).HeaderText = Localization.GetString("Date", LocalResourceFile) - grdRecurEvents.Columns(2).HeaderText = Localization.GetString("Time", LocalResourceFile) - grdRecurEvents.Columns(3).HeaderText = Localization.GetString("Event", LocalResourceFile) - - grdEnrollment.Columns(0).HeaderText = Localization.GetString("Action", LocalResourceFile) - grdEnrollment.Columns(1).HeaderText = Localization.GetString("Date", LocalResourceFile) - grdEnrollment.Columns(2).HeaderText = Localization.GetString("Time", LocalResourceFile) - grdEnrollment.Columns(3).HeaderText = Localization.GetString("Event", LocalResourceFile) - grdEnrollment.Columns(4).HeaderText = "" - grdEnrollment.Columns(5).HeaderText = Localization.GetString("User", LocalResourceFile) - grdEnrollment.Columns(6).HeaderText = Localization.GetString("NoEnrolees", LocalResourceFile) - - End Sub - - Private Sub ShowButtonsGrid(ByVal blShow As Boolean) - pnlEmail.Visible = blShow - pnlGrid.Visible = blShow - cmdUpdateSelected.Visible = blShow - cmdSelectApproveAll.Visible = blShow - cmdSelectDenyAll.Visible = blShow - cmdUnmarkAll.Visible = blShow - End Sub -#End Region - -#Region "Links and Buttons" - Private Sub cmdUpdateSelected_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles cmdUpdateSelected.Click - Dim item As DataGridItem - Dim objEventEmail As New EventEmails(PortalId, ModuleId, LocalResourceFile, CType(Page, PageBase).PageCulture.Name) - - Try - Select Case rbModerate.SelectedValue - Case "Events" - Dim objEventEmailInfo As New EventEmailInfo - objEventEmailInfo.TxtEmailSubject = txtEmailSubject.Text - objEventEmailInfo.TxtEmailBody = txtEmailMessage.Text - objEventEmailInfo.TxtEmailFrom() = txtEmailFrom.Text - Dim objCal As New EventInfo - Dim objEventRecurMaster As EventRecurMasterInfo - For Each item In grdEvents.Items - Select Case CType(item.FindControl("rbEventAction"), RadioButtonList).SelectedValue - Case "Approve" - objCal = _objCtlEvent.EventsGet(CType(grdEvents.DataKeys(item.ItemIndex), Integer), ModuleId) - objCal.Approved = True - Dim newEventEmailSent As Boolean = objCal.NewEventEmailSent - objCal.NewEventEmailSent = True - _objCtlEvent.EventsSave(objCal, True, TabId, False) - ' Only send event emails when event approved for first time - If Not newEventEmailSent Then - objCal.RRULE = "" - SendNewEventEmails(objCal) - CreateNewEventJournal(objCal) - End If - ' Email Requesting/Moderated User - If chkEmail.Checked Then - objCal.RRULE = "" - objEventEmailInfo.UserIDs.Clear() - objEventEmailInfo.UserIDs.Add(objCal.OwnerID) - objEventEmail.SendEmails(objEventEmailInfo, objCal) - End If - Case "Deny" - objCal = _objCtlEvent.EventsGet(CType(grdEvents.DataKeys(item.ItemIndex), Integer), ModuleId) - 'Don't Allow Delete on Enrolled Event - Only Cancel - objEventRecurMaster = _objCtlEventRecurMaster.EventsRecurMasterGet(objCal.RecurMasterID, objCal.ModuleID) - If objEventRecurMaster.RRULE <> "" Then - objCal.Cancelled = True - objCal.LastUpdatedID = UserId - objCal = _objCtlEvent.EventsSave(objCal, False, TabId, True) - Else - _objCtlEventRecurMaster.EventsRecurMasterDelete(objCal.RecurMasterID, objCal.ModuleID) - End If - ' Email Requesting/Moderated User - If chkEmail.Checked Then - objCal.RRULE = "" - objEventEmailInfo.UserIDs.Clear() - objEventEmailInfo.UserIDs.Add(objCal.OwnerID) - objEventEmail.SendEmails(objEventEmailInfo, objCal) - End If - End Select - Next - For Each item In grdRecurEvents.Items - Select Case CType(item.FindControl("rbEventRecurAction"), RadioButtonList).SelectedValue - Case "Approve" - objEventRecurMaster = _objCtlEventRecurMaster.EventsRecurMasterGet(CType(grdRecurEvents.DataKeys(item.ItemIndex), Integer), ModuleId) - objEventRecurMaster.Approved = True - _objCtlEventRecurMaster.EventsRecurMasterSave(objEventRecurMaster, TabId, False) - Dim lstEvents As ArrayList - lstEvents = _objCtlEvent.EventsGetRecurrences(objEventRecurMaster.RecurMasterID, objEventRecurMaster.ModuleID) - Dim blEmailSent As Boolean = False - For Each objCal In lstEvents - If Not objCal.Cancelled Then - objCal.Approved = True - Dim newEventEmailSent As Boolean = objCal.NewEventEmailSent - objCal.NewEventEmailSent = True - _objCtlEvent.EventsSave(objCal, True, TabId, False) - ' Only send event emails when event approved for first time - If Not newEventEmailSent And Not blEmailSent Then - objCal.RRULE = objEventRecurMaster.RRULE - SendNewEventEmails(objCal) - CreateNewEventJournal(objCal) - blEmailSent = True - End If - End If - Next - ' Email Requesting/Moderated User - If chkEmail.Checked Then - objCal.RRULE = objEventRecurMaster.RRULE - objEventEmailInfo.UserIDs.Clear() - objEventEmailInfo.UserIDs.Add(objEventRecurMaster.CreatedByID) - objEventEmail.SendEmails(objEventEmailInfo, objCal) - End If - Case "Deny" - objEventRecurMaster = _objCtlEventRecurMaster.EventsRecurMasterGet(CType(grdRecurEvents.DataKeys(item.ItemIndex), Integer), ModuleId) - 'Don't Allow Delete on Enrolled Event - Only Cancel - _objCtlEventRecurMaster.EventsRecurMasterDelete(CType(grdRecurEvents.DataKeys(item.ItemIndex), Integer), ModuleId) - ' Email Requesting/Moderated User - If chkEmail.Checked Then - objCal.RRULE = objEventRecurMaster.RRULE - objEventEmailInfo.UserIDs.Clear() - objEventEmailInfo.UserIDs.Add(objEventRecurMaster.CreatedByID) - objEventEmail.SendEmails(objEventEmailInfo, objCal) - End If - End Select - Next - Case "Enrollment" - ' Not moderated - Dim objEnroll As EventSignupsInfo - For Each item In grdEnrollment.Items - If CType(item.FindControl("rbEnrollAction"), RadioButtonList).SelectedValue <> "" Then - objEnroll = _objCtlEventSignups.EventsSignupsGet(CType(grdEnrollment.DataKeys(item.ItemIndex), Integer), ModuleId, False) - Dim objCtlEvent As New EventController - Dim objEvent As EventInfo = objCtlEvent.EventsGet(objEnroll.EventID, objEnroll.ModuleID) - Dim objEventEmailInfo As New EventEmailInfo - objEventEmailInfo.TxtEmailSubject = txtEmailSubject.Text - objEventEmailInfo.TxtEmailFrom() = txtEmailFrom.Text - If chkEmail.Checked Then - If objEnroll.UserID > -1 Then - objEventEmailInfo.UserIDs.Add(objEnroll.UserID) - Else - objEventEmailInfo.UserEmails.Add(objEnroll.AnonEmail) - objEventEmailInfo.UserLocales.Add(objEnroll.AnonCulture) - objEventEmailInfo.UserTimeZoneIds.Add(objEnroll.AnonTimeZoneId) - End If - End If - Select Case CType(item.FindControl("rbEnrollAction"), RadioButtonList).SelectedValue - Case "Approve" - objEnroll.Approved = True - CreateEnrollment(objEnroll, objEvent) - - ' Email Requesting/Moderated User - If Settings.SendEnrollMessageApproved Then - objEventEmailInfo.UserIDs.Add(objEvent.OwnerID) - End If - objEventEmailInfo.TxtEmailBody = txtEmailMessage.Text & Settings.Templates.txtEnrollMessageApproved - objEventEmail.SendEmails(objEventEmailInfo, objEvent, objEnroll) - Case "Deny" - DeleteEnrollment(CType(grdEnrollment.DataKeys(item.ItemIndex), Integer), objEvent.ModuleID, objEvent.EventID) - - ' Email Requesting/Moderated User - If Settings.SendEnrollMessageDenied Then - objEventEmailInfo.UserIDs.Add(objEvent.OwnerID) - End If - objEventEmailInfo.TxtEmailBody = txtEmailMessage.Text & Settings.Templates.txtEnrollMessageDenied - objEventEmail.SendEmails(objEventEmailInfo, objEvent, objEnroll) - End Select - End If - Next - End Select - - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - BindData() - End Sub - - Private Sub cmdSelectApproveAll_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles cmdSelectApproveAll.Click - BindData() - Dim item As DataGridItem - If rbModerate.SelectedValue = "Events" Then - For Each item In grdEvents.Items - CType(item.FindControl("rbEventAction"), RadioButtonList).SelectedValue = "Approve" - Next - For Each item In grdRecurEvents.Items - CType(item.FindControl("rbEventRecurAction"), RadioButtonList).SelectedValue = "Approve" - Next - Else - For Each item In grdEnrollment.Items - CType(item.FindControl("rbEnrollAction"), RadioButtonList).SelectedValue = "Approve" - Next - End If - cmdUpdateSelected_Click(sender, e) - End Sub - - Private Sub cmdSelectDenyAll_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles cmdSelectDenyAll.Click - BindData() - Dim item As DataGridItem - If rbModerate.SelectedValue = "Events" Then - For Each item In grdEvents.Items - CType(item.FindControl("rbEventAction"), RadioButtonList).SelectedValue = "Deny" - Next - For Each item In grdRecurEvents.Items - CType(item.FindControl("rbEventRecurAction"), RadioButtonList).SelectedValue = "Deny" - Next - Else - For Each item In grdEnrollment.Items - CType(item.FindControl("rbEnrollAction"), RadioButtonList).SelectedValue = "Deny" - Next - End If - cmdUpdateSelected_Click(sender, e) - End Sub - - Private Sub cmdUnmarkAll_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles cmdUnmarkAll.Click - BindData() - Dim item As DataGridItem - If rbModerate.SelectedValue = "Events" Then - For Each item In grdEvents.Items - CType(item.FindControl("rbEventAction"), RadioButtonList).SelectedValue = Nothing - Next - For Each item In grdRecurEvents.Items - CType(item.FindControl("rbEventRecurAction"), RadioButtonList).SelectedValue = Nothing - Next - Else - For Each item In grdEnrollment.Items - CType(item.FindControl("rbEnrollAction"), RadioButtonList).SelectedValue = Nothing - Next - End If - End Sub - -#End Region - -#Region "Grid and Other Events" - Private Sub rbModerate_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As EventArgs) Handles rbModerate.SelectedIndexChanged - If rbModerate.SelectedValue = "Events" Then - grdEnrollment.Visible = False - grdEvents.Visible = True - grdRecurEvents.Visible = True - Else - grdEnrollment.Visible = True - grdEvents.Visible = False - End If - BindData() - End Sub - - Public Sub grdEvents_ItemCommand(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) - Select Case e.CommandName - Case "Select" - Dim itemID As Integer = CType(grdEvents.DataKeys(e.Item.ItemIndex), Integer) - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - Response.Redirect(objEventInfoHelper.AddSkinContainerControls(NavigateURL(TabId, "Edit", "Mid=" & ModuleId.ToString, "ItemID=" & itemID.ToString(), "EditRecur=Single"), "?")) - End Select - End Sub - - Public Sub grdRecurEvents_ItemCommand(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) - Select Case e.CommandName - Case "Select" - Dim itemID As Integer = CType(e.Item.Cells(4).Text, Integer) - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - Response.Redirect(objEventInfoHelper.AddSkinContainerControls(NavigateURL(TabId, "Edit", "Mid=" & ModuleId.ToString, "ItemID=" & itemID.ToString(), "EditRecur=All"), "?")) - End Select - End Sub - - - Public Sub grdEnrollment_ItemCommand(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) - Dim objEnroll As EventSignupsInfo - objEnroll = _objCtlEventSignups.EventsSignupsGet(CType(grdEnrollment.DataKeys(e.Item.ItemIndex), Integer), ModuleId, False) - - Try - Select Case e.CommandName - Case "Select" - Try - Dim itemID As Integer = objEnroll.EventID - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - Response.Redirect(objEventInfoHelper.AddSkinContainerControls(EditUrl("ItemID", itemID.ToString(), "Edit"), "?")) - Catch ex As Exception - End Try - Case "User" - Dim objCtlEvent As New EventController - Dim objEvent As EventInfo = objCtlEvent.EventsGet(objEnroll.EventID, objEnroll.ModuleID) - - Dim objEventEmailInfo As New EventEmailInfo - Dim objEventEmail As New EventEmails(PortalId, ModuleId, LocalResourceFile, CType(Page, PageBase).PageCulture.Name) - objEventEmailInfo.TxtEmailSubject = txtEmailSubject.Text - objEventEmailInfo.TxtEmailBody = txtEmailMessage.Text - objEventEmailInfo.TxtEmailFrom() = txtEmailFrom.Text - If objEnroll.UserID > -1 Then - objEventEmailInfo.UserIDs.Add(objEnroll.UserID) - Else - objEventEmailInfo.UserEmails.Add(objEnroll.AnonEmail) - objEventEmailInfo.UserLocales.Add(objEnroll.AnonCulture) - objEventEmailInfo.UserTimeZoneIds.Add(objEnroll.AnonTimeZoneId) - End If - objEventEmail.SendEmails(objEventEmailInfo, objEvent, objEnroll) - - End Select - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - BindData() - End Sub - - Private Sub returnButton_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles returnButton.Click - Try - Response.Redirect(GetSocialNavigateUrl(), True) - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub - -#End Region - - End Class - -End Namespace diff --git a/EventMonth.ascx b/EventMonth.ascx index 9ac9034..38bc88e 100644 --- a/EventMonth.ascx +++ b/EventMonth.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="EventMonth.ascx.vb" Inherits="DotNetNuke.Modules.Events.EventMonth" %> +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EventMonth.ascx.cs" Inherits="DotNetNuke.Modules.Events.EventMonth" %> <%@ Register TagPrefix="evt" Namespace="DotNetNuke.Modules.Events.ScheduleControl.MonthControl" Assembly="DotNetNuke.Modules.Events.ScheduleControl" %> <%@ Register TagPrefix="evt" TagName="Category" Src="~/DesktopModules/Events/SubControls/SelectCategory.ascx" %> <%@ Register TagPrefix="evt" TagName="Location" Src="~/DesktopModules/Events/SubControls/SelectLocation.ascx" %> @@ -6,20 +6,23 @@ <%@ Register TagPrefix="dnn" Assembly="DotNetNuke.Web" Namespace="DotNetNuke.Web.UI.WebControls" %> <%@ Register TagPrefix="dnn" Assembly="DotNetNuke.Web.Deprecated" Namespace="DotNetNuke.Web.UI.WebControls" %> +<%--"/>--%> +
+ <%--

Date:

--%> - Today  + Today 
- - + +
@@ -27,7 +30,7 @@
+ PrevMonthText=" " NextMonthText=" " ShowGridLines="False" SelectMonthText=" " SelectWeekText=" " OnDayRender="EventCalendar_DayRender" OnSelectionChanged="EventCalendar_SelectionChanged" OnVisibleMonthChanged="EventCalendar_VisibleMonthChanged"> @@ -43,3 +46,8 @@
+<%----%> diff --git a/EventMonth.ascx.cs b/EventMonth.ascx.cs new file mode 100644 index 0000000..6219f3e --- /dev/null +++ b/EventMonth.ascx.cs @@ -0,0 +1,525 @@ +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using System.Web.UI; +using Microsoft.VisualBasic; +using System.Web.UI.WebControls; +using System.Collections; +using System.Web; +using DotNetNuke.Services.Localization; +using System; +using System.Globalization; +using DotNetNuke.Modules.Events.ScheduleControl.MonthControl; +using DotNetNuke.Framework.JavaScriptLibraries; + + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events + { + public partial class EventMonth : EventBase + { + +#region Private Variables + + private bool _pageBound = false; + private ArrayList _selectedEvents; + private CultureInfo _culture = System.Threading.Thread.CurrentThread.CurrentCulture; + private EventInfoHelper _objEventInfoHelper; + +#endregion + +#region Event Handlers + + private void Page_PreRender(object sender, EventArgs e) + { + // This handles the case where the same cell date is selected twice + if (!_pageBound) + { + BindDataGrid(); + } + } + + private void Page_Load(System.Object sender, EventArgs e) + { + try + { + + // Be sure to load the required scripts always + JavaScript.RequestRegistration(CommonJs.DnnPlugins); + + LocalizeAll(); + + SetupViewControls(EventIcons, EventIcons2, SelectCategory, SelectLocation, pnlDateControls); + + dpGoToDate.SelectedDate = SelectedDate.Date; + dpGoToDate.Calendar.FirstDayOfWeek = Settings.WeekStart; + + // Set Weekend Display + if (Settings.Fridayweekend) + { + EventCalendar.WeekEndDays = MyDayOfWeek.Friday | MyDayOfWeek.Saturday; + } + + // Set 1st Day of Week + EventCalendar.FirstDayOfWeek = (System.Web.UI.WebControls.FirstDayOfWeek) _culture.DateTimeFormat.FirstDayOfWeek; + + if (Settings.WeekStart != System.Web.UI.WebControls.FirstDayOfWeek.Default) + { + EventCalendar.FirstDayOfWeek = Settings.WeekStart; + } + + // if 1st time on page... + if (!Page.IsPostBack) + { + EventCalendar.VisibleDate = System.Convert.ToDateTime(dpGoToDate.SelectedDate); + if (!Settings.Monthcellnoevents) + { + EventCalendar.SelectedDate = EventCalendar.VisibleDate; + } + BindDataGrid(); + } + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + +#endregion + +#region Web Form Designer Generated Code + + //This call is required by the Web Form Designer. + [DebuggerStepThrough()]private void InitializeComponent() + { + + } + + private void Page_Init(System.Object sender, EventArgs e) + { + //CODEGEN: This method call is required by the Web Form Designer + //Do not modify it using the code editor. + InitializeComponent(); + } + +#endregion + +#region Helper Methods & Functions + + private void LocalizeAll() + { + + lnkToday.Text = Localization.GetString("lnkToday", LocalResourceFile); + dpGoToDate.DatePopupButton.ToolTip = Localization.GetString("DatePickerTooltip", LocalResourceFile); + + } + + private void BindDataGrid() + { + + DateTime startDate = default(DateTime); // Start View Date Events Range + DateTime endDate = default(DateTime); // End View Date Events Range + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + + _pageBound = true; + //****DO NOT CHANGE THE NEXT SECTION FOR ML CODING **** + // Used Only to select view dates on Event Month View... + DateTime useDate = System.Convert.ToDateTime(dpGoToDate.SelectedDate); + DateTime initDate = new DateTime(useDate.Year, useDate.Month, 1); + startDate = initDate.AddDays(-10); // Allow for Prev Month days in View + // Load 2 months of events. This used to load only the events for the current month, + // but was changed so that events for multiple events can be displayed in the case when + // the Event displays some days for the next month. + endDate = System.Convert.ToDateTime(initDate.AddMonths(1).AddDays(10)); + + bool getSubEvents = Settings.MasterEvent; + _selectedEvents = objEventInfoHelper.GetEvents(startDate, endDate, getSubEvents, SelectCategory.SelectedCategory, SelectLocation.SelectedLocation, GetUrlGroupId(), GetUrlUserId()); + + _selectedEvents = objEventInfoHelper.ConvertEventListToDisplayTimeZone(_selectedEvents, GetDisplayTimeZoneId()); + + //Write current date to UI + SelectedDate = System.Convert.ToDateTime(EventCalendar.VisibleDate); + + // Setup the Tooltip TargetControls because it doesn't work in DayRender! + if (Settings.Eventtooltipmonth) + { + toolTipManager.TargetControls.Clear(); + if (Settings.Monthcellnoevents) + { + DateTime calcDate = startDate; + while (calcDate <= endDate) + { + toolTipManager.TargetControls.Add("ctlEvents_Mod_" + ModuleId.ToString() + "_EventDate_" + calcDate.Date.ToString("yyyyMMMdd"), true); + calcDate = calcDate.AddDays(1); + } + } + else + { + foreach (EventInfo objEvent in _selectedEvents) + { + DateTime calcDate = objEvent.EventTimeBegin.Date; + while (calcDate <= objEvent.EventTimeEnd.Date) + { + toolTipManager.TargetControls.Add("ctlEvents_Mod_" + ModuleId.ToString() + "_EventID_" + objEvent.EventID.ToString() + "_EventDate_" + calcDate.Date.ToString("yyyyMMMdd"), true); + calcDate = calcDate.AddDays(1); + } + } + } + + } + } + + #endregion + + #region Event Event Grid Methods and Functions + + /// + /// Render each day in the event (i.e. Cells) + /// + protected void EventCalendar_DayRender(System.Object sender, System.Web.UI.WebControls.DayRenderEventArgs e) + { + EventInfo objEvent = default(EventInfo); + LiteralControl cellcontrol = new LiteralControl(); + _objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + + // Get Events/Sub-Calendar Events + ArrayList dayEvents = new ArrayList(); + ArrayList allDayEvents = default(ArrayList); + allDayEvents = _objEventInfoHelper.GetDateEvents(_selectedEvents, e.Day.Date); + allDayEvents.Sort(new EventInfoHelper.EventDateSort()); + + foreach (EventInfo tempLoopVar_objEvent in allDayEvents) + { + objEvent = tempLoopVar_objEvent; + //if day not in current (selected) Event month OR full enrollments should be hidden, ignore + if ((Settings.ShowEventsAlways || e.Day.Date.Month == SelectedDate.Month) + && !HideFullEvent(objEvent)) + { + dayEvents.Add(objEvent); + } + } + + // If No Cell Event Display... + if (Settings.Monthcellnoevents) + { + if (Settings.ShowEventsAlways == false && e.Day.IsOtherMonth) + { + e.Cell.Text = ""; + return; + } + + if (dayEvents.Count > 0) + { + e.Day.IsSelectable = true; + + if (e.Day.Date == SelectedDate) + { + e.Cell.CssClass = "EventSelectedDay"; + } + else + { + if (e.Day.IsWeekend) + { + e.Cell.CssClass = "EventWeekendDayEvents"; + } + else + { + e.Cell.CssClass = "EventDayEvents"; + } + } + + if (Settings.Eventtooltipmonth) + { + string themeCss = GetThemeSettings().CssClass; + + string tmpToolTipTitle = Settings.Templates.txtTooltipTemplateTitleNT; + if (tmpToolTipTitle.IndexOf("{0}") + 1 > 0) + { + tmpToolTipTitle = tmpToolTipTitle.Replace("{0}", "{0:d}"); + } + string tooltipTitle = System.Convert.ToString(HttpUtility.HtmlDecode(string.Format(tmpToolTipTitle, e.Day.Date)).Replace(Environment.NewLine, "")); + string cellToolTip = ""; //Holds control generated tooltip + + foreach (EventInfo tempLoopVar_objEvent in dayEvents) + { + objEvent = tempLoopVar_objEvent; + //Add horizontal row to seperate the eventdescriptions + if (!string.IsNullOrEmpty(cellToolTip)) + { + cellToolTip = cellToolTip + "
"; + } + + cellToolTip += CreateEventName(objEvent, System.Convert.ToString(Settings.Templates.txtTooltipTemplateBodyNT.Replace(Constants.vbLf, "").Replace(Constants.vbCr, ""))); + } + e.Cell.Attributes.Add("title", "
" + tooltipTitle + "
" + cellToolTip + "
")); + e.Cell.ID = "ctlEvents_Mod_" + ModuleId.ToString() + "_EventDate_" + e.Day.Date.ToString("yyyyMMMdd"); + } + + HyperLink dailyLink = new HyperLink(); + dailyLink.Text = string.Format(Settings.Templates.txtMonthDayEventCount, dayEvents.Count.ToString()); + int socialGroupId = GetUrlGroupId(); + int socialUserId = GetUrlUserId(); + if (dayEvents.Count > 1) + { + if (Settings.Eventdaynewpage) + { + if (socialGroupId > 0) + { + dailyLink.NavigateUrl = _objEventInfoHelper.AddSkinContainerControls(DotNetNuke.Common.Globals.NavigateURL(TabId, "Day", "Mid=" + ModuleId.ToString(), "selecteddate=" + Strings.Format(e.Day.Date, "yyyyMMdd"), "groupid=" + socialGroupId.ToString()), "?"); + } + else if (socialUserId > 0) + { + dailyLink.NavigateUrl = _objEventInfoHelper.AddSkinContainerControls(DotNetNuke.Common.Globals.NavigateURL(TabId, "Day", "Mid=" + ModuleId.ToString(), "selecteddate=" + Strings.Format(e.Day.Date, "yyyyMMdd"), "userid=" + socialUserId.ToString()), "?"); + } + else + { + dailyLink.NavigateUrl = _objEventInfoHelper.AddSkinContainerControls(DotNetNuke.Common.Globals.NavigateURL(TabId, "Day", "Mid=" + ModuleId.ToString(), "selecteddate=" + Strings.Format(e.Day.Date, "yyyyMMdd")), "?"); + } + } + else + { + if (socialGroupId > 0) + { + dailyLink.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(TabId, "", "ModuleID=" + ModuleId.ToString(), "mctl=EventDay", "selecteddate=" + Strings.Format(e.Day.Date, "yyyyMMdd"), "groupid=" + socialGroupId.ToString()); + } + else if (socialUserId > 0) + { + dailyLink.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(TabId, "", "ModuleID=" + ModuleId.ToString(), "mctl=EventDay", "selecteddate=" + Strings.Format(e.Day.Date, "yyyyMMdd"), "userid=" + socialUserId.ToString()); + } + else + { + dailyLink.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(TabId, "", "ModuleID=" + ModuleId.ToString(), "mctl=EventDay", "selecteddate=" + Strings.Format(e.Day.Date, "yyyyMMdd")); + } + } + } + else + { + // Get detail page url + dailyLink = GetDetailPageUrl((EventInfo) (dayEvents[0]), dailyLink); + } + using (System.IO.StringWriter stringWrite = new System.IO.StringWriter()) + { + using (HtmlTextWriter eventoutput = new HtmlTextWriter(stringWrite)) + { + dailyLink.RenderControl(eventoutput); + cellcontrol.Text = "
" + stringWrite.ToString() + "
"; + e.Cell.Controls.Add(cellcontrol); + } + + } + + } + else + { + e.Day.IsSelectable = false; + } + return; + } + + //Make day unselectable + if (!Settings.Monthdayselect) + { + e.Day.IsSelectable = false; + } + + //loop through records and render if startDate = current day and is not null + string celldata = ""; // Holds Control Generated HTML + + foreach (EventInfo tempLoopVar_objEvent in dayEvents) + { + objEvent = tempLoopVar_objEvent; + HyperLink dailyLink = new HyperLink(); + string iconString = ""; + + // See if an Image is to be displayed for the Event + if (Settings.Eventimage && Settings.EventImageMonth && objEvent.ImageURL != null && objEvent.ImageDisplay == true) + { + dailyLink.Text = ImageInfo(objEvent.ImageURL, objEvent.ImageHeight, objEvent.ImageWidth); + } + + if (Settings.Timeintitle) + { + dailyLink.Text = dailyLink.Text + objEvent.EventTimeBegin.ToString("t") + " - "; + } + + string eventtext = CreateEventName(objEvent, Settings.Templates.txtMonthEventText); + dailyLink.Text = dailyLink.Text + eventtext.Trim(); + + if (!IsPrivateNotModerator || UserId == objEvent.OwnerID) + { + dailyLink.ForeColor = GetColor(objEvent.FontColor); + iconString = CreateIconString(objEvent, Settings.IconMonthPrio, Settings.IconMonthRec, Settings.IconMonthReminder, Settings.IconMonthEnroll); + + // Get detail page url + dailyLink = GetDetailPageUrl(objEvent, dailyLink); + } + else + { + dailyLink.Style.Add("cursor", "text"); + dailyLink.Style.Add("text-decoration", "none"); + dailyLink.Attributes.Add("onclick", "javascript:return false;"); + } + + // See If Description Tooltip to be added + if (Settings.Eventtooltipmonth) + { + bool isEvtEditor = IsEventEditor(objEvent, false); + dailyLink.Attributes.Add("title", ToolTipCreate(objEvent, Settings.Templates.txtTooltipTemplateTitle, Settings.Templates.txtTooltipTemplateBody, isEvtEditor)); + } + + // Capture Control Info & save + using (System.IO.StringWriter stringWrite = new System.IO.StringWriter()) + { + using (HtmlTextWriter eventoutput = new HtmlTextWriter(stringWrite)) + { + dailyLink.ID = "ctlEvents_Mod_" + ModuleId.ToString() + "_EventID_" + objEvent.EventID.ToString() + "_EventDate_" + e.Day.Date.ToString("yyyyMMMdd"); + dailyLink.RenderControl(eventoutput); + if (objEvent.Color != null && (!IsPrivateNotModerator || UserId == objEvent.OwnerID)) + { + celldata = celldata + "
" + iconString + stringWrite.ToString() + "
"; + } + else + { + celldata = celldata + "
" + iconString + stringWrite.ToString() + "
"; + } + } + + } + + } + + // Add Literal Control Data to Cell w/DIV tag (in order to support scrolling in cell) + cellcontrol.Text = "
" + celldata + "
"; + e.Cell.Controls.Add(cellcontrol); + } + + + protected void EventCalendar_SelectionChanged(System.Object sender, EventArgs e) + { + EventCalendar.VisibleDate = EventCalendar.SelectedDate; + SelectedDate = System.Convert.ToDateTime(EventCalendar.SelectedDate.Date); + string urlDate = System.Convert.ToString(EventCalendar.SelectedDate.Date.ToShortDateString()); + dpGoToDate.SelectedDate = SelectedDate.Date; + if (Settings.Monthcellnoevents) + { + try + { + EventCalendar.SelectedDate = new DateTime(); + if (Settings.Eventdaynewpage) + { + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + Response.Redirect(objEventInfoHelper.AddSkinContainerControls(DotNetNuke.Common.Globals.NavigateURL(TabId, "Day", "Mid=" + ModuleId.ToString(), "selecteddate=" + urlDate), "&")); + } + else + { + Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", "ModuleID=" + ModuleId.ToString(), "mctl=EventDay", "selecteddate=" + urlDate)); + } + } + catch (Exception) + { + } + } + else + { + //fill grid with current selection's data + BindDataGrid(); + } + } + + protected void EventCalendar_VisibleMonthChanged(object sender, MonthChangedEventArgs e) + { + //set selected date to first of month + SelectedDate = e.NewDate; + dpGoToDate.SelectedDate = e.NewDate.Date; + if (!Settings.Monthcellnoevents) + { + EventCalendar.SelectedDate = e.NewDate; + } + SelectCategory.StoreCategories(); + SelectLocation.StoreLocations(); + //bind datagrid + BindDataGrid(); + } + + private HyperLink GetDetailPageUrl(EventInfo objevent, HyperLink dailyLink) + { + // Get detail page url + dailyLink.NavigateUrl = _objEventInfoHelper.DetailPageURL(objevent); + if (objevent.DetailPage && objevent.DetailNewWin) + { + dailyLink.Attributes.Add("target", "_blank"); + } + return dailyLink; + } + #endregion + + #region Links and Buttons + protected void lnkToday_Click(System.Object sender, EventArgs e) + { + //set grid uneditable + SelectedDate = DateTime.Now.Date; + EventCalendar.VisibleDate = SelectedDate; + dpGoToDate.SelectedDate = SelectedDate.Date; + if (!Settings.Monthcellnoevents) + { + EventCalendar.SelectedDate = SelectedDate; + } + SelectCategory.StoreCategories(); + SelectLocation.StoreLocations(); + //fill grid with current selection's data + BindDataGrid(); + } + + protected void SelectCategoryChanged(object sender, System.Web.UI.WebControls.CommandEventArgs e) + { + //Store the other selection(s) too. + SelectLocation.StoreLocations(); + BindDataGrid(); + } + protected void SelectLocationChanged(object sender, System.Web.UI.WebControls.CommandEventArgs e) + { + //Store the other selection(s) too. + SelectCategory.StoreCategories(); + BindDataGrid(); + } + protected void dpGoToDate_SelectedDateChanged(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e) + { + DateTime dDate = System.Convert.ToDateTime(dpGoToDate.SelectedDate); + SelectedDate = dDate; + EventCalendar.VisibleDate = dDate; + if (!Settings.Monthcellnoevents) + { + EventCalendar.SelectedDate = dDate; + } + //fill grid with current selection's data + BindDataGrid(); + } + +#endregion + + } + + } + + diff --git a/EventMonth.ascx.designer.cs b/EventMonth.ascx.designer.cs new file mode 100644 index 0000000..388aa95 --- /dev/null +++ b/EventMonth.ascx.designer.cs @@ -0,0 +1,96 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DotNetNuke.Modules.Events { + + + public partial class EventMonth { + + /// + /// toolTipManager control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Web.UI.WebControls.DnnToolTipManager toolTipManager; + + /// + /// pnlDateControls control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlDateControls; + + /// + /// lnkToday control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton lnkToday; + + /// + /// dpGoToDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Web.UI.WebControls.DnnDatePicker dpGoToDate; + + /// + /// SelectCategory control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.SelectCategory SelectCategory; + + /// + /// SelectLocation control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.SelectLocation SelectLocation; + + /// + /// EventIcons control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.EventIcons EventIcons; + + /// + /// EventCalendar control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.ScheduleControl.MonthControl.DNNCalendar EventCalendar; + + /// + /// EventIcons2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.EventIcons EventIcons2; + } +} diff --git a/EventMonth.ascx.designer.vb b/EventMonth.ascx.designer.vb deleted file mode 100644 index 7e50c1f..0000000 --- a/EventMonth.ascx.designer.vb +++ /dev/null @@ -1,98 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Namespace DotNetNuke.Modules.Events - - Partial Public Class EventMonth - - ''' - '''toolTipManager control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents toolTipManager As Global.DotNetNuke.Web.UI.WebControls.DnnToolTipManager - - ''' - '''pnlDateControls control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlDateControls As Global.System.Web.UI.WebControls.Panel - - ''' - '''lnkToday control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lnkToday As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''dpGoToDate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents dpGoToDate As Global.DotNetNuke.Web.UI.WebControls.DnnDatePicker - - ''' - '''SelectCategory control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents SelectCategory As Global.DotNetNuke.Modules.Events.SelectCategory - - ''' - '''SelectLocation control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents SelectLocation As Global.DotNetNuke.Modules.Events.SelectLocation - - ''' - '''EventIcons control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents EventIcons As Global.DotNetNuke.Modules.Events.EventIcons - - ''' - '''EventCalendar control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents EventCalendar As Global.DotNetNuke.Modules.Events.ScheduleControl.MonthControl.DNNCalendar - - ''' - '''EventIcons2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents EventIcons2 As Global.DotNetNuke.Modules.Events.EventIcons - End Class -End Namespace diff --git a/EventMonth.ascx.vb b/EventMonth.ascx.vb deleted file mode 100644 index b260544..0000000 --- a/EventMonth.ascx.vb +++ /dev/null @@ -1,411 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports DotNetNuke.Services.Localization -Imports System.Globalization -Imports DotNetNuke.Modules.Events.ScheduleControl.MonthControl -Imports DotNetNuke.Framework.JavaScriptLibraries - -Namespace DotNetNuke.Modules.Events - Partial Class EventMonth - Inherits EventBase - -#Region "Private Variables" - - Private _pageBound As Boolean = False - Private _selectedEvents As ArrayList - Private ReadOnly _culture As CultureInfo = Threading.Thread.CurrentThread.CurrentCulture - Private _objEventInfoHelper As EventInfoHelper - -#End Region - -#Region "Event Handlers" - - Private Sub Page_PreRender(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.PreRender - ' This handles the case where the same cell date is selected twice - If Not _pageBound Then - BindDataGrid() - End If - End Sub - - Private Sub Page_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load - Try - - ' Be sure to load the required scripts always - JavaScript.RequestRegistration(CommonJs.DnnPlugins) - - LocalizeAll() - - SetupViewControls(EventIcons, EventIcons2, SelectCategory, SelectLocation, pnlDateControls) - - dpGoToDate.SelectedDate = SelectedDate.Date() - dpGoToDate.Calendar.FirstDayOfWeek = Settings.WeekStart - - ' Set Weekend Display - If Settings.Fridayweekend Then - EventCalendar.WeekEndDays = MyDayOfWeek.Friday Or MyDayOfWeek.Saturday - End If - - ' Set 1st Day of Week - EventCalendar.FirstDayOfWeek = CType(_culture.DateTimeFormat.FirstDayOfWeek, System.Web.UI.WebControls.FirstDayOfWeek) - - If Settings.WeekStart <> System.Web.UI.WebControls.FirstDayOfWeek.Default Then - EventCalendar.FirstDayOfWeek = Settings.WeekStart - End If - - ' if 1st time on page... - If Not Page.IsPostBack Then - EventCalendar.VisibleDate = CType(dpGoToDate.SelectedDate, Date) - If Not Settings.Monthcellnoevents Then - EventCalendar.SelectedDate = EventCalendar.VisibleDate - End If - BindDataGrid() - End If - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub - -#End Region - -#Region " Web Form Designer Generated Code " - - 'This call is required by the Web Form Designer. - Private Sub InitializeComponent() - - End Sub - - Private Sub Page_Init(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Init - 'CODEGEN: This method call is required by the Web Form Designer - 'Do not modify it using the code editor. - InitializeComponent() - End Sub - -#End Region - -#Region "Helper Methods & Functions" - - Private Sub LocalizeAll() - - lnkToday.Text = Localization.GetString("lnkToday", LocalResourceFile) - dpGoToDate.DatePopupButton.ToolTip = Localization.GetString("DatePickerTooltip", LocalResourceFile) - - End Sub - - Private Sub BindDataGrid() - - Dim startDate As DateTime ' Start View Date Events Range - Dim endDate As DateTime ' End View Date Events Range - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - - _pageBound = True - '****DO NOT CHANGE THE NEXT SECTION FOR ML CODING **** - ' Used Only to select view dates on Event Month View... - Dim useDate As Date = CType(dpGoToDate.SelectedDate, Date) - Dim initDate As Date = New Date(useDate.Year, useDate.Month, 1) - startDate = initDate.AddDays(-10) ' Allow for Prev Month days in View - ' Load 2 months of events. This used to load only the events for the current month, - ' but was changed so that events for multiple events can be displayed in the case when - ' the Event displays some days for the next month. - endDate = initDate.AddMonths(1).AddDays(10) - - Dim getSubEvents As Boolean = Settings.MasterEvent - _selectedEvents = objEventInfoHelper.GetEvents(startDate, endDate, getSubEvents, SelectCategory.SelectedCategory, SelectLocation.SelectedLocation, GetUrlGroupId, GetUrlUserId) - - _selectedEvents = objEventInfoHelper.ConvertEventListToDisplayTimeZone(_selectedEvents, GetDisplayTimeZoneId()) - - 'Write current date to UI - SelectedDate = EventCalendar.VisibleDate - - ' Setup the Tooltip TargetControls because it doesn't work in DayRender! - If Settings.Eventtooltipmonth Then - toolTipManager.TargetControls.Clear() - If Settings.Monthcellnoevents Then - Dim calcDate As DateTime = startDate - Do While calcDate <= endDate - toolTipManager.TargetControls.Add("ctlEvents_Mod_" & ModuleId.ToString & "_EventDate_" & calcDate.Date.ToString("yyyyMMMdd"), True) - calcDate = calcDate.AddDays(1) - Loop - Else - For Each objEvent As EventInfo In _selectedEvents - Dim calcDate As DateTime = objEvent.EventTimeBegin.Date - Do While calcDate <= objEvent.EventTimeEnd.Date - toolTipManager.TargetControls.Add("ctlEvents_Mod_" & ModuleId.ToString & "_EventID_" & objEvent.EventID.ToString & "_EventDate_" & calcDate.Date.ToString("yyyyMMMdd"), True) - calcDate = calcDate.AddDays(1) - Loop - Next - End If - - End If - End Sub - -#End Region - -#Region "Event Event Grid Methods and Functions" - - ''' - ''' Render each day in the event (i.e. Cells) - ''' - Private Sub EventCalendar_DayRender(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles EventCalendar.DayRender - Dim objEvent As EventInfo - Dim cellcontrol As New LiteralControl - _objEventInfoHelper = New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - - ' Get Events/Sub-Calendar Events - Dim dayEvents As New ArrayList - Dim allDayEvents As ArrayList - allDayEvents = _objEventInfoHelper.GetDateEvents(_selectedEvents, e.Day.Date) - allDayEvents.Sort(New EventInfoHelper.EventDateSort) - - For Each objEvent In allDayEvents - 'if day not in current (selected) Event month OR full enrollments should be hidden, ignore - If (Settings.ShowEventsAlways Or e.Day.Date.Month = SelectedDate.Month) _ - And Not HideFullEvent(objEvent) Then - dayEvents.Add(objEvent) - End If - Next - - ' If No Cell Event Display... - If Settings.Monthcellnoevents Then - If (Settings.ShowEventsAlways = False And e.Day.IsOtherMonth) Then - e.Cell.Text = "" - Exit Sub - End If - - If dayEvents.Count > 0 Then - e.Day.IsSelectable = True - - If e.Day.Date = SelectedDate Then - e.Cell.CssClass = "EventSelectedDay" - Else - If e.Day.IsWeekend Then - e.Cell.CssClass = "EventWeekendDayEvents" - Else - e.Cell.CssClass = "EventDayEvents" - End If - End If - - If Settings.Eventtooltipmonth Then - Dim themeCss As String = GetThemeSettings().CssClass - - Dim tmpToolTipTitle As String = Settings.Templates.txtTooltipTemplateTitleNT - If InStr(tmpToolTipTitle, "{0}") > 0 Then - tmpToolTipTitle = Replace(tmpToolTipTitle, "{0}", "{0:d}") - End If - Dim tooltipTitle As String = HttpUtility.HtmlDecode(String.Format(tmpToolTipTitle, e.Day.Date)).Replace(Environment.NewLine, "") - Dim cellToolTip As String = "" 'Holds control generated tooltip - - For Each objEvent In dayEvents - 'Add horizontal row to seperate the eventdescriptions - If cellToolTip <> "" Then cellToolTip = cellToolTip + "
" - - cellToolTip &= CreateEventName(objEvent, Settings.Templates.txtTooltipTemplateBodyNT.Replace(vbLf, "").Replace(vbCr, "")) - Next - e.Cell.Attributes.Add("title", "
" + tooltipTitle + "
" + cellToolTip + "
") - e.Cell.ID = "ctlEvents_Mod_" & ModuleId.ToString & "_EventDate_" & e.Day.Date.ToString("yyyyMMMdd") - End If - - Dim dailyLink As New HyperLink - dailyLink.Text = String.Format(Settings.Templates.txtMonthDayEventCount, dayEvents.Count.ToString) - Dim socialGroupId As Integer = GetUrlGroupId() - Dim socialUserId As Integer = GetUrlUserId() - If dayEvents.Count > 1 Then - If Settings.Eventdaynewpage Then - If socialGroupId > 0 Then - dailyLink.NavigateUrl = _objEventInfoHelper.AddSkinContainerControls(NavigateURL(TabId, "Day", "Mid=" & ModuleId.ToString, "selecteddate=" & Format(e.Day.Date, "yyyyMMdd"), "groupid=" & socialGroupId.ToString), "?") - ElseIf socialUserId > 0 Then - dailyLink.NavigateUrl = _objEventInfoHelper.AddSkinContainerControls(NavigateURL(TabId, "Day", "Mid=" & ModuleId.ToString, "selecteddate=" & Format(e.Day.Date, "yyyyMMdd"), "userid=" & socialUserId.ToString), "?") - Else - dailyLink.NavigateUrl = _objEventInfoHelper.AddSkinContainerControls(NavigateURL(TabId, "Day", "Mid=" & ModuleId.ToString, "selecteddate=" & Format(e.Day.Date, "yyyyMMdd")), "?") - End If - Else - If socialGroupId > 0 Then - dailyLink.NavigateUrl = NavigateURL(TabId, "", "ModuleID=" & ModuleId.ToString, "mctl=EventDay", "selecteddate=" & Format(e.Day.Date, "yyyyMMdd"), "groupid=" & socialGroupId.ToString) - ElseIf socialUserId > 0 Then - dailyLink.NavigateUrl = NavigateURL(TabId, "", "ModuleID=" & ModuleId.ToString, "mctl=EventDay", "selecteddate=" & Format(e.Day.Date, "yyyyMMdd"), "userid=" & socialUserId.ToString) - Else - dailyLink.NavigateUrl = NavigateURL(TabId, "", "ModuleID=" & ModuleId.ToString, "mctl=EventDay", "selecteddate=" & Format(e.Day.Date, "yyyyMMdd")) - End If - End If - Else - ' Get detail page url - dailyLink = GetDetailPageUrl(CType(dayEvents.Item(0), EventInfo), dailyLink) - End If - Using stringWrite As New IO.StringWriter - Using eventoutput As New HtmlTextWriter(stringWrite) - dailyLink.RenderControl(eventoutput) - cellcontrol.Text = "
" + stringWrite.ToString + "
" - e.Cell.Controls.Add(cellcontrol) - End Using - End Using - Else - e.Day.IsSelectable = False - End If - Exit Sub - End If - - 'Make day unselectable - If Not Settings.Monthdayselect Then - e.Day.IsSelectable = False - End If - - 'loop through records and render if startDate = current day and is not null - Dim celldata As String = "" ' Holds Control Generated HTML - - For Each objEvent In dayEvents - Dim dailyLink As New HyperLink - Dim iconString As String = "" - - ' See if an Image is to be displayed for the Event - If Settings.Eventimage And Settings.EventImageMonth _ - And objEvent.ImageURL <> Nothing And objEvent.ImageDisplay = True Then - dailyLink.Text = ImageInfo(objEvent.ImageURL, objEvent.ImageHeight, objEvent.ImageWidth) - End If - - If Settings.Timeintitle Then - dailyLink.Text = dailyLink.Text + objEvent.EventTimeBegin.ToString("t") + " - " - End If - - Dim eventtext As String = CreateEventName(objEvent, Settings.Templates.txtMonthEventText) - dailyLink.Text = dailyLink.Text + eventtext.Trim - - If Not IsPrivateNotModerator Or UserId = objEvent.OwnerID Then - dailyLink.ForeColor = GetColor(objEvent.FontColor) - iconString = CreateIconString(objEvent, Settings.IconMonthPrio, Settings.IconMonthRec, Settings.IconMonthReminder, Settings.IconMonthEnroll) - - ' Get detail page url - dailyLink = GetDetailPageUrl(objEvent, dailyLink) - Else - dailyLink.Style.Add("cursor", "text") - dailyLink.Style.Add("text-decoration", "none") - dailyLink.Attributes.Add("onclick", "javascript:return false;") - End If - - ' See If Description Tooltip to be added - If Settings.Eventtooltipmonth Then - Dim isEvtEditor As Boolean = IsEventEditor(objEvent, False) - dailyLink.Attributes.Add("title", ToolTipCreate(objEvent, Settings.Templates.txtTooltipTemplateTitle, Settings.Templates.txtTooltipTemplateBody, isEvtEditor)) - End If - - ' Capture Control Info & save - Using stringWrite As New IO.StringWriter - Using eventoutput As New HtmlTextWriter(stringWrite) - dailyLink.ID = "ctlEvents_Mod_" & ModuleId.ToString & "_EventID_" & objEvent.EventID.ToString & "_EventDate_" & e.Day.Date.ToString("yyyyMMMdd") - dailyLink.RenderControl(eventoutput) - If objEvent.Color <> Nothing And (Not IsPrivateNotModerator Or UserId = objEvent.OwnerID) Then - celldata = celldata + "
" + iconString + stringWrite.ToString + "
" - Else - celldata = celldata + "
" + iconString + stringWrite.ToString + "
" - End If - End Using - End Using - Next - - ' Add Literal Control Data to Cell w/DIV tag (in order to support scrolling in cell) - cellcontrol.Text = "
" + celldata + "
" - e.Cell.Controls.Add(cellcontrol) - End Sub - - - Private Sub EventCalendar_SelectionChanged(ByVal sender As System.Object, ByVal e As EventArgs) Handles EventCalendar.SelectionChanged - EventCalendar.VisibleDate = EventCalendar.SelectedDate - SelectedDate = EventCalendar.SelectedDate.Date - Dim urlDate As String = EventCalendar.SelectedDate.Date.ToShortDateString - dpGoToDate.SelectedDate = SelectedDate().Date - If Settings.Monthcellnoevents Then - Try - EventCalendar.SelectedDate = New DateTime - If Settings.Eventdaynewpage Then - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - Response.Redirect(objEventInfoHelper.AddSkinContainerControls(NavigateURL(TabId, "Day", "Mid=" & ModuleId.ToString, "selecteddate=" & urlDate), "&")) - Else - Response.Redirect(NavigateURL(TabId, "", "ModuleID=" & ModuleId.ToString, "mctl=EventDay", "selecteddate=" & urlDate)) - End If - Catch ex As Exception - End Try - Else - 'fill grid with current selection's data - BindDataGrid() - End If - End Sub - - Private Sub EventCalendar_VisibleMonthChanged(ByVal sender As Object, ByVal e As MonthChangedEventArgs) Handles EventCalendar.VisibleMonthChanged - 'set selected date to first of month - SelectedDate = e.NewDate - dpGoToDate.SelectedDate = e.NewDate.Date() - If Not Settings.Monthcellnoevents Then - EventCalendar.SelectedDate = e.NewDate - End If - SelectCategory.StoreCategories() - SelectLocation.StoreLocations() - 'bind datagrid - BindDataGrid() - End Sub - - Private Function GetDetailPageUrl(ByVal objevent As EventInfo, ByVal dailyLink As HyperLink) As HyperLink - ' Get detail page url - dailyLink.NavigateUrl = _objEventInfoHelper.DetailPageURL(objevent) - If objevent.DetailPage And objevent.DetailNewWin Then - dailyLink.Attributes.Add("target", "_blank") - End If - Return dailyLink - End Function -#End Region - -#Region "Links and Buttons" - Private Sub lnkToday_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles lnkToday.Click - 'set grid uneditable - SelectedDate = DateTime.Now.Date - EventCalendar.VisibleDate = SelectedDate - dpGoToDate.SelectedDate = SelectedDate.Date() - If Not Settings.Monthcellnoevents Then - EventCalendar.SelectedDate = SelectedDate - End If - SelectCategory.StoreCategories() - SelectLocation.StoreLocations() - 'fill grid with current selection's data - BindDataGrid() - End Sub - - Private Sub SelectCategoryChanged(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs) Handles SelectCategory.CategorySelectedChanged - 'Store the other selection(s) too. - SelectLocation.StoreLocations() - BindDataGrid() - End Sub - Private Sub SelectLocationChanged(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs) Handles SelectLocation.LocationSelectedChanged - 'Store the other selection(s) too. - SelectCategory.StoreCategories() - BindDataGrid() - End Sub - Private Sub dpGoToDate_SelectedDateChanged(sender As Object, e As Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs) Handles dpGoToDate.SelectedDateChanged - Dim dDate As Date = CType(dpGoToDate.SelectedDate, Date) - SelectedDate = dDate - EventCalendar.VisibleDate = dDate - If Not Settings.Monthcellnoevents Then - EventCalendar.SelectedDate = dDate - End If - 'fill grid with current selection's data - BindDataGrid() - End Sub - -#End Region - - End Class - -End Namespace diff --git a/EventMyEnrollments.ascx b/EventMyEnrollments.ascx index 6fa7540..7d9900d 100644 --- a/EventMyEnrollments.ascx +++ b/EventMyEnrollments.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="vb" AutoEventWireup="false" Codebehind="EventMyEnrollments.ascx.vb" Inherits="DotNetNuke.Modules.Events.EventMyEnrollments" %> +<%@ Control Language="C#" AutoEventWireup="true" Codebehind="EventMyEnrollments.ascx.cs" Inherits="DotNetNuke.Modules.Events.EventMyEnrollments" %> <%@ Register TagPrefix="evt" TagName="Icons" Src="~/DesktopModules/Events/SubControls/EventIcons.ascx" %>
@@ -12,7 +12,7 @@
+ DataKeyField="SignupID" GridLines="None" OnItemCommand="grdEnrollment_ItemCommand" Width="100%" OnItemCommand="grdEnrollment_ItemCommand"> @@ -73,10 +73,10 @@
    -
  • -
  • +
  • +
- \ No newline at end of file + diff --git a/EventMyEnrollments.ascx.cs b/EventMyEnrollments.ascx.cs new file mode 100644 index 0000000..63b116a --- /dev/null +++ b/EventMyEnrollments.ascx.cs @@ -0,0 +1,269 @@ +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using DotNetNuke.Framework; +using Microsoft.VisualBasic; +using System.Web.UI.WebControls; +using System.Collections; +using DotNetNuke.Services.Localization; +using System; + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events + { + + public partial class EventMyEnrollments : EventBase + { + +#region Web Form Designer Generated Code + + //This call is required by the Web Form Designer. + [DebuggerStepThrough()]private void InitializeComponent() + { + + } + + private void Page_Init(System.Object sender, EventArgs e) + { + //CODEGEN: This method call is required by the Web Form Designer + //Do not modify it using the code editor. + InitializeComponent(); + } + +#endregion + +#region Private Area +#endregion + +#region Event Handlers + private void Page_Load(System.Object sender, EventArgs e) + { + try + { + //EVT-4499 if not login, redirect user to login page + if (!Request.IsAuthenticated) + { + RedirectToLogin(); + } + + LocalizeAll(); + + // Setup Icon Bar for use + SetUpIconBar(EventIcons, EventIcons2); + + lnkSelectedDelete.Attributes.Add("onclick", "javascript:return confirm('" + Localization.GetString("ConfirmDeleteSelected", LocalResourceFile) + "');"); + + if (Page.IsPostBack == false) + { + BindData(); + } + + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } +#endregion + +#region Helper Methods + private void BindData() + { + try + { + DateTime moduleStartDate = DateAndTime.DateAdd(DateInterval.Day, System.Convert.ToDouble(- Settings.EnrolListDaysBefore), ModuleNow()); + DateTime moduleEndDate = DateAndTime.DateAdd(DateInterval.Day, Settings.EnrolListDaysAfter, ModuleNow()); + DateTime displayStartDate = DateAndTime.DateAdd(DateInterval.Day, System.Convert.ToDouble(- Settings.EnrolListDaysBefore), DisplayNow()); + DateTime displayEndDate = DateAndTime.DateAdd(DateInterval.Day, Settings.EnrolListDaysAfter, DisplayNow()); + + //Default sort from settings + SortDirection sortDirection = Settings.EnrolListSortDirection; + EventSignupsInfo.SortFilter sortExpression = GetSignupsSortExpression("EventTimeBegin"); + + ArrayList inCategoryIDs = new ArrayList(); + inCategoryIDs.Add("-1"); + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + string categoryIDs = objEventInfoHelper.CreateCategoryFilter(inCategoryIDs); + + ArrayList eventSignups = default(ArrayList); + EventSignupsController objCtlEventSignups = new EventSignupsController(); + + eventSignups = objCtlEventSignups.EventsSignupsMyEnrollments(ModuleId, UserId, GetUrlGroupId(), categoryIDs, moduleStartDate, moduleEndDate); + + EventTimeZoneUtilities objEventTimeZoneUtilities = new EventTimeZoneUtilities(); + ArrayList displayEventSignups = new ArrayList(); + foreach (EventSignupsInfo eventSignup in eventSignups) + { + string displayTimeZoneId = GetDisplayTimeZoneId(); + eventSignup.EventTimeBegin = objEventTimeZoneUtilities.ConvertToDisplayTimeZone(eventSignup.EventTimeBegin, eventSignup.EventTimeZoneId, PortalId, displayTimeZoneId).EventDate; + eventSignup.EventTimeEnd = objEventTimeZoneUtilities.ConvertToDisplayTimeZone(eventSignup.EventTimeEnd, eventSignup.EventTimeZoneId, PortalId, displayTimeZoneId).EventDate; + if (eventSignup.EventTimeBegin > displayEndDate || eventSignup.EventTimeEnd < displayStartDate) + { + continue; + } + displayEventSignups.Add(eventSignup); + } + + EventSignupsInfo.SortExpression = sortExpression; + EventSignupsInfo.SortDirection = sortDirection; + displayEventSignups.Sort(); + + //Get data for selected date and fill grid + grdEnrollment.DataSource = displayEventSignups; + grdEnrollment.DataBind(); + if (eventSignups.Count < 1) + { + divMessage.Visible = true; + grdEnrollment.Visible = false; + //"No Events/Enrollments found..." + lblMessage.Text = Localization.GetString("MsgNoMyEventsOrEnrollment", LocalResourceFile); + } + else + { + for (int i = 0; i <= eventSignups.Count - 1; i++) + { + decimal decTotal = (decimal) (System.Convert.ToDecimal(grdEnrollment.Items[i].Cells[7].Text) / System.Convert.ToDecimal(grdEnrollment.Items[i].Cells[8].Text)); + DateTime dtStartTime = System.Convert.ToDateTime(grdEnrollment.Items[i].Cells[1].Text); + // ReSharper disable LocalizableElement + ((Label) (grdEnrollment.Items[i].FindControl("lblAmount"))).Text = string.Format("{0:F2}", decTotal) + " " + PortalSettings.Currency; + ((Label) (grdEnrollment.Items[i].FindControl("lblTotal"))).Text = string.Format("{0:F2}", System.Convert.ToDecimal(grdEnrollment.Items[i].Cells[7].Text)) + " " + PortalSettings.Currency; + // ReSharper restore LocalizableElement + if (decTotal > 0 || dtStartTime < ModuleNow().AddDays(Settings.Enrolcanceldays)) + { + ((CheckBox) (grdEnrollment.Items[i].FindControl("chkSelect"))).Enabled = false; + } + } + } + } + catch (Exception exc) + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + + private void LocalizeAll() + { + grdEnrollment.Columns[0].HeaderText = Localization.GetString("plSelect", LocalResourceFile); + grdEnrollment.Columns[1].HeaderText = Localization.GetString("plDate", LocalResourceFile); + grdEnrollment.Columns[2].HeaderText = Localization.GetString("plTime", LocalResourceFile); + grdEnrollment.Columns[3].HeaderText = Localization.GetString("plEvent", LocalResourceFile); + grdEnrollment.Columns[4].HeaderText = Localization.GetString("plApproved", LocalResourceFile); + grdEnrollment.Columns[6].HeaderText = Localization.GetString("plAmount", LocalResourceFile); + grdEnrollment.Columns[8].HeaderText = Localization.GetString("plNoEnrolees", LocalResourceFile); + grdEnrollment.Columns[9].HeaderText = Localization.GetString("plTotal", LocalResourceFile); + lnkSelectedDelete.ToolTip = string.Format(Localization.GetString("CancelEnrolments", LocalResourceFile), Settings.Enrolcanceldays); + } +#endregion + +#region Grid and Other Events + + public void grdEnrollment_ItemCommand(System.Object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) + { + try + { + switch (e.CommandName) + { + case "Select": + EventSignupsInfo objEnroll = default(EventSignupsInfo); + EventSignupsController objCtlEventSignups = new EventSignupsController(); + objEnroll = objCtlEventSignups.EventsSignupsGet(System.Convert.ToInt32(grdEnrollment.DataKeys[e.Item.ItemIndex]), ModuleId, false); + int iItemID = objEnroll.EventID; + + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + Response.Redirect(objEventInfoHelper.GetDetailPageRealURL(iItemID, GetUrlGroupId(), GetUrlUserId())); + break; + } + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + BindData(); + } + + protected void lnkSelectedDelete_Click(object sender, EventArgs e) + { + DataGridItem item = default(DataGridItem); + EventSignupsInfo objEnroll = default(EventSignupsInfo); + EventSignupsController objCtlEventSignups = new EventSignupsController(); + EventInfo objEvent = new EventInfo(); + EventController objCtlEvent = new EventController(); + int eventID = 0; + + foreach (DataGridItem tempLoopVar_item in grdEnrollment.Items) + { + item = tempLoopVar_item; + if (((CheckBox) (item.FindControl("chkSelect"))).Checked) + { + objEnroll = objCtlEventSignups.EventsSignupsGet(System.Convert.ToInt32(grdEnrollment.DataKeys[item.ItemIndex]), ModuleId, false); + if (eventID != objEnroll.EventID) + { + objEvent = objCtlEvent.EventsGet(objEnroll.EventID, ModuleId); + } + eventID = objEnroll.EventID; + + // Delete Selected Enrollee + DeleteEnrollment(System.Convert.ToInt32(grdEnrollment.DataKeys[item.ItemIndex]), objEvent.ModuleID, objEvent.EventID); + + // Mail users + if (Settings.SendEnrollMessageDeleted) + { + EventEmailInfo objEventEmailInfo = new EventEmailInfo(); + EventEmails objEventEmail = new EventEmails(PortalId, ModuleId, LocalResourceFile, ((PageBase) Page).PageCulture.Name); + objEventEmailInfo.TxtEmailSubject = Settings.Templates.txtEnrollMessageSubject; + objEventEmailInfo.TxtEmailBody = Settings.Templates.txtEnrollMessageDeleted; + objEventEmailInfo.TxtEmailFrom = Settings.StandardEmail; + objEventEmailInfo.UserEmails.Add(PortalSettings.UserInfo.Email); + objEventEmailInfo.UserLocales.Add(PortalSettings.UserInfo.Profile.PreferredLocale); + objEventEmailInfo.UserTimeZoneIds.Add(PortalSettings.UserInfo.Profile.PreferredTimeZone.Id); + objEventEmailInfo.UserIDs.Add(objEvent.OwnerID); + objEventEmail.SendEmails(objEventEmailInfo, objEvent, objEnroll); + } + + } + } + + BindData(); + + } + + protected void returnButton_Click(System.Object sender, EventArgs e) + { + string[] cntrl = Settings.DefaultView.Split('.'); + int socialGroupId = GetUrlGroupId(); + if (socialGroupId > 0) + { + Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", "mctl=" + cntrl[0], "ModuleID=" + ModuleId.ToString(), "groupid=" + socialGroupId.ToString())); + } + else + { + Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", "mctl=" + cntrl[0], "ModuleID=" + ModuleId.ToString())); + } + } + +#endregion + + } + } + diff --git a/EventMyEnrollments.ascx.designer.cs b/EventMyEnrollments.ascx.designer.cs new file mode 100644 index 0000000..5f1d35f --- /dev/null +++ b/EventMyEnrollments.ascx.designer.cs @@ -0,0 +1,108 @@ +// VBConversions Note: VB project level imports +using DotNetNuke.UI; +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using DotNetNuke.Entities.Users; +using System.Web.UI; +using System.Drawing; +using DotNetNuke.Framework; +using Microsoft.VisualBasic; +using System.Configuration; +using System.Web.UI.WebControls; +using System.Collections; +using DotNetNuke.Common.Utilities; +//using System.Linq; + using System.Web; +using DotNetNuke.Common; +using System.Web.UI.HtmlControls; +using DotNetNuke.Services.Localization; +using System.Data; +using System; +using DotNetNuke.Data; +using DotNetNuke; +// End of VB project level imports + + + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + + + namespace DotNetNuke.Modules.Events + { + + public partial class EventMyEnrollments + { + + /// + ///divMessage control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divMessage; + + /// + ///lblMessage control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMessage; + + /// + ///EventIcons control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.EventIcons EventIcons; + + /// + ///grdEnrollment control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DataGrid grdEnrollment; + + /// + ///returnButton control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton returnButton; + + /// + ///lnkSelectedDelete control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton lnkSelectedDelete; + + /// + ///EventIcons2 control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.EventIcons EventIcons2; + } + } + diff --git a/EventMyEnrollments.ascx.designer.vb b/EventMyEnrollments.ascx.designer.vb deleted file mode 100644 index ea43654..0000000 --- a/EventMyEnrollments.ascx.designer.vb +++ /dev/null @@ -1,80 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Namespace DotNetNuke.Modules.Events - - Partial Public Class EventMyEnrollments - - ''' - '''divMessage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divMessage As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblMessage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblMessage As Global.System.Web.UI.WebControls.Label - - ''' - '''EventIcons control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents EventIcons As Global.DotNetNuke.Modules.Events.EventIcons - - ''' - '''grdEnrollment control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents grdEnrollment As Global.System.Web.UI.WebControls.DataGrid - - ''' - '''returnButton control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents returnButton As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''lnkSelectedDelete control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lnkSelectedDelete As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''EventIcons2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents EventIcons2 As Global.DotNetNuke.Modules.Events.EventIcons - End Class -End Namespace diff --git a/EventMyEnrollments.ascx.vb b/EventMyEnrollments.ascx.vb deleted file mode 100644 index ec8264d..0000000 --- a/EventMyEnrollments.ascx.vb +++ /dev/null @@ -1,220 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - - -Namespace DotNetNuke.Modules.Events - - Partial Class EventMyEnrollments - Inherits EventBase - -#Region " Web Form Designer Generated Code " - - 'This call is required by the Web Form Designer. - Private Sub InitializeComponent() - - End Sub - - Private Sub Page_Init(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Init - 'CODEGEN: This method call is required by the Web Form Designer - 'Do not modify it using the code editor. - InitializeComponent() - End Sub - -#End Region - -#Region "Private Area" -#End Region - -#Region "Event Handlers" - Private Sub Page_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load - Try - 'EVT-4499 if not login, redirect user to login page - If Not Request.IsAuthenticated Then - RedirectToLogin() - End If - - LocalizeAll() - - ' Setup Icon Bar for use - SetUpIconBar(EventIcons, EventIcons2) - - lnkSelectedDelete.Attributes.Add("onclick", "javascript:return confirm('" + Localization.GetString("ConfirmDeleteSelected", LocalResourceFile) + "');") - - If Page.IsPostBack = False Then - BindData() - End If - - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub -#End Region - -#Region "Helper Methods" - Private Sub BindData() - Try - Dim moduleStartDate As DateTime = DateAdd(DateInterval.Day, -Settings.EnrolListDaysBefore, ModuleNow) - Dim moduleEndDate As DateTime = DateAdd(DateInterval.Day, Settings.EnrolListDaysAfter, ModuleNow) - Dim displayStartDate As DateTime = DateAdd(DateInterval.Day, -Settings.EnrolListDaysBefore, DisplayNow) - Dim displayEndDate As DateTime = DateAdd(DateInterval.Day, Settings.EnrolListDaysAfter, DisplayNow) - - 'Default sort from settings - Dim sortDirection As SortDirection = Settings.EnrolListSortDirection - Dim sortExpression As EventSignupsInfo.SortFilter = GetSignupsSortExpression("EventTimeBegin") - - Dim inCategoryIDs As New ArrayList - inCategoryIDs.Add("-1") - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - Dim categoryIDs As String = objEventInfoHelper.CreateCategoryFilter(inCategoryIDs) - - Dim eventSignups As ArrayList - Dim objCtlEventSignups As New EventSignupsController - - eventSignups = objCtlEventSignups.EventsSignupsMyEnrollments(ModuleId, UserId, GetUrlGroupId, categoryIDs, moduleStartDate, moduleEndDate) - - Dim objEventTimeZoneUtilities As New EventTimeZoneUtilities - Dim displayEventSignups As New ArrayList - For Each eventSignup As EventSignupsInfo In eventSignups - Dim displayTimeZoneId As String = GetDisplayTimeZoneId() - eventSignup.EventTimeBegin = objEventTimeZoneUtilities.ConvertToDisplayTimeZone(eventSignup.EventTimeBegin, eventSignup.EventTimeZoneId, PortalId, displayTimeZoneId).EventDate - eventSignup.EventTimeEnd = objEventTimeZoneUtilities.ConvertToDisplayTimeZone(eventSignup.EventTimeEnd, eventSignup.EventTimeZoneId, PortalId, displayTimeZoneId).EventDate - If eventSignup.EventTimeBegin > displayEndDate Or eventSignup.EventTimeEnd < displayStartDate Then - Continue For - End If - displayEventSignups.Add(eventSignup) - Next - - EventSignupsInfo.SortExpression = sortExpression - EventSignupsInfo.SortDirection = sortDirection - displayEventSignups.Sort() - - 'Get data for selected date and fill grid - grdEnrollment.DataSource = displayEventSignups - grdEnrollment.DataBind() - If eventSignups.Count < 1 Then - divMessage.Visible = True - grdEnrollment.Visible = False - '"No Events/Enrollments found..." - lblMessage.Text = Localization.GetString("MsgNoMyEventsOrEnrollment", LocalResourceFile) - Else - For i As Integer = 0 To eventSignups.Count - 1 - Dim decTotal As Decimal = CType(grdEnrollment.Items(i).Cells(7).Text, Decimal) / CType(grdEnrollment.Items(i).Cells(8).Text, Decimal) - Dim dtStartTime As DateTime = CType(grdEnrollment.Items(i).Cells(1).Text, DateTime) - ' ReSharper disable LocalizableElement - CType(grdEnrollment.Items(i).FindControl("lblAmount"), Label).Text = String.Format("{0:F2}", decTotal) & " " & PortalSettings.Currency - CType(grdEnrollment.Items(i).FindControl("lblTotal"), Label).Text = String.Format("{0:F2}", CType(grdEnrollment.Items(i).Cells(7).Text, Decimal)) & " " & PortalSettings.Currency - ' ReSharper restore LocalizableElement - If decTotal > 0 Or dtStartTime < ModuleNow.AddDays(Settings.Enrolcanceldays) Then - CType(grdEnrollment.Items(i).FindControl("chkSelect"), CheckBox).Enabled = False - End If - Next - End If - Catch exc As Exception - ProcessModuleLoadException(Me, exc) - End Try - End Sub - - Private Sub LocalizeAll() - grdEnrollment.Columns(0).HeaderText = Localization.GetString("plSelect", LocalResourceFile) - grdEnrollment.Columns(1).HeaderText = Localization.GetString("plDate", LocalResourceFile) - grdEnrollment.Columns(2).HeaderText = Localization.GetString("plTime", LocalResourceFile) - grdEnrollment.Columns(3).HeaderText = Localization.GetString("plEvent", LocalResourceFile) - grdEnrollment.Columns(4).HeaderText = Localization.GetString("plApproved", LocalResourceFile) - grdEnrollment.Columns(6).HeaderText = Localization.GetString("plAmount", LocalResourceFile) - grdEnrollment.Columns(8).HeaderText = Localization.GetString("plNoEnrolees", LocalResourceFile) - grdEnrollment.Columns(9).HeaderText = Localization.GetString("plTotal", LocalResourceFile) - lnkSelectedDelete.ToolTip = String.Format(Localization.GetString("CancelEnrolments", LocalResourceFile), Settings.Enrolcanceldays) - End Sub -#End Region - -#Region "Grid and Other Events" - - Public Sub grdEnrollment_ItemCommand(ByVal source As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles grdEnrollment.ItemCommand - Try - Select Case e.CommandName - Case "Select" - Dim objEnroll As EventSignupsInfo - Dim objCtlEventSignups As New EventSignupsController - objEnroll = objCtlEventSignups.EventsSignupsGet(CType(grdEnrollment.DataKeys(e.Item.ItemIndex), Integer), ModuleId, False) - Dim iItemID As Integer = objEnroll.EventID - - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - Response.Redirect(objEventInfoHelper.GetDetailPageRealURL(iItemID, GetUrlGroupId, GetUrlUserId)) - End Select - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - BindData() - End Sub - - Private Sub lnkSelectedDelete_Click(ByVal sender As Object, ByVal e As EventArgs) Handles lnkSelectedDelete.Click - Dim item As DataGridItem - Dim objEnroll As EventSignupsInfo - Dim objCtlEventSignups As New EventSignupsController - Dim objEvent As New EventInfo - Dim objCtlEvent As New EventController - Dim eventID As Integer = 0 - - For Each item In grdEnrollment.Items - If CType(item.FindControl("chkSelect"), CheckBox).Checked Then - objEnroll = objCtlEventSignups.EventsSignupsGet(CType(grdEnrollment.DataKeys(item.ItemIndex), Integer), ModuleId, False) - If eventID <> objEnroll.EventID Then - objEvent = objCtlEvent.EventsGet(objEnroll.EventID, ModuleId) - End If - eventID = objEnroll.EventID() - - ' Delete Selected Enrollee? - DeleteEnrollment(CType(grdEnrollment.DataKeys(item.ItemIndex), Integer), objEvent.ModuleID, objEvent.EventID) - - ' Mail users - If Settings.SendEnrollMessageDeleted Then - Dim objEventEmailInfo As New EventEmailInfo - Dim objEventEmail As New EventEmails(PortalId, ModuleId, LocalResourceFile, CType(Page, PageBase).PageCulture.Name) - objEventEmailInfo.TxtEmailSubject = Settings.Templates.txtEnrollMessageSubject - objEventEmailInfo.TxtEmailBody = Settings.Templates.txtEnrollMessageDeleted - objEventEmailInfo.TxtEmailFrom() = Settings.StandardEmail - objEventEmailInfo.UserEmails.Add(PortalSettings.UserInfo.Email) - objEventEmailInfo.UserLocales.Add(PortalSettings.UserInfo.Profile.PreferredLocale) - objEventEmailInfo.UserTimeZoneIds.Add(PortalSettings.UserInfo.Profile.PreferredTimeZone.Id) - objEventEmailInfo.UserIDs.Add(objEvent.OwnerID) - objEventEmail.SendEmails(objEventEmailInfo, objEvent, objEnroll) - End If - - End If - Next - - BindData() - - End Sub - - Private Sub returnButton_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles returnButton.Click - Dim cntrl As String() = Settings.DefaultView.Split("."c) - Dim socialGroupId As Integer = GetUrlGroupId() - If socialGroupId > 0 Then - Response.Redirect(NavigateURL(TabId, "", "mctl=" & cntrl(0), "ModuleID=" & ModuleId.ToString, "groupid=" & socialGroupId.ToString)) - Else - Response.Redirect(NavigateURL(TabId, "", "mctl=" & cntrl(0), "ModuleID=" & ModuleId.ToString)) - End If - End Sub - -#End Region - - End Class -End Namespace diff --git a/EventPPEnroll.ascx b/EventPPEnroll.ascx index 0f7630e..5f48725 100644 --- a/EventPPEnroll.ascx +++ b/EventPPEnroll.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="vb" AutoEventWireup="false" Codebehind="EventPPEnroll.ascx.vb" Inherits="DotNetNuke.Modules.Events.EventPPEnroll" %> +<%@ Control Language="C#" AutoEventWireup="true" Codebehind="EventPPEnroll.ascx.cs" Inherits="DotNetNuke.Modules.Events.EventPPEnroll" %> <%@ Register Src="~/controls/LabelControl.ascx" TagName="Label" TagPrefix="dnn" %> <%@ Register Assembly="DotNetNuke" Namespace="DotNetNuke.UI.WebControls" TagPrefix="dnn" %> @@ -40,9 +40,10 @@
    -
  • -
  • -
  • +
  • +
  • +
+ diff --git a/EventPPEnroll.ascx.cs b/EventPPEnroll.ascx.cs new file mode 100644 index 0000000..37897e6 --- /dev/null +++ b/EventPPEnroll.ascx.cs @@ -0,0 +1,417 @@ +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using DotNetNuke.Framework; +using Microsoft.VisualBasic; +using System.Web; +using DotNetNuke.Services.Localization; +using System; +using System.Globalization; + + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events +{ + [DNNtc.ModuleControlProperties("PPEnroll", "Event PayPal Enrollment", DNNtc.ControlType.View, "https://dnnevents.codeplex.com/documentation", false, true)] + public partial class EventPPEnroll : EventBase + { + + #region Web Form Designer Generated Code + + //This call is required by the Web Form Designer. + [DebuggerStepThrough()] + private void InitializeComponent() + { + + } + + private void Page_Init(System.Object sender, EventArgs e) + { + //CODEGEN: This method call is required by the Web Form Designer + //Do not modify it using the code editor. + InitializeComponent(); + } + + #endregion + + #region Private Area + private int _itemID = -1; + private int _noEnrol = 1; + private EventController _objCtlEvent = new EventController(); + private EventSignupsInfo _objEventSignups = new EventSignupsInfo(); + private EventSignupsController _objCtlEventSignups = new EventSignupsController(); + private string _anonEmail = null; + private string _anonName = null; + private string _anonTelephone = null; + + private enum MessageLevel : int + { + DNNSuccess = 1, + DNNInformation, + DNNWarning, + DNNError + } + + #endregion + + #region Event Handlers + private void Page_Load(System.Object sender, EventArgs e) + { + try + { + double dblTotal = 0; + string strCurrency = ""; + + if (!(ReferenceEquals(Request.Params["ItemID"], null))) + { + _itemID = int.Parse(Request.Params["ItemID"]); + } + if (!(ReferenceEquals(Request.Params["AnonEmail"], null))) + { + _anonEmail = HttpUtility.UrlDecode(Request.Params["AnonEmail"]); + } + if (!(ReferenceEquals(Request.Params["AnonName"], null))) + { + _anonName = HttpUtility.UrlDecode(Request.Params["AnonName"]); + } + if (!(ReferenceEquals(Request.Params["AnonPhone"], null))) + { + _anonTelephone = HttpUtility.UrlDecode(Request.Params["AnonPhone"]); + if (_anonTelephone == "0") + { + _anonTelephone = ""; + } + } + + // Set the selected theme + SetTheme(pnlEventsModulePayPal); + + divMessage.Attributes.Add("style", "display:none;"); + + if (!(Page.IsPostBack)) + { + if (_itemID != -1) + { + if (!(ReferenceEquals(Request.Params["NoEnrol"], null))) + { + _noEnrol = int.Parse(Request.Params["NoEnrol"]); + } + + EventInfo objEvent = default(EventInfo); + objEvent = _objCtlEvent.EventsGet(_itemID, ModuleId); + + // Compute Dates/Times (for recurring) + DateTime startdate = objEvent.EventTimeBegin; + SelectedDate = startdate.Date; + DateTime d = default(DateTime); + d = startdate.Date.AddMinutes(objEvent.EventTimeBegin.TimeOfDay.TotalMinutes); + lblStartDate.Text = d.ToLongDateString() + " " + d.ToShortTimeString(); + lblEventName.Text = objEvent.EventName; + lblDescription.Text = Server.HtmlDecode(objEvent.EventDesc); + lblFee.Text = string.Format("{0:#0.00}", objEvent.EnrollFee); + lblNoEnrolees.Text = Convert.ToString(_noEnrol); + lblPurchase.Text = Localization.GetString("lblPurchase", LocalResourceFile); + lblPurchase.Visible = true; + } + else if (!(ReferenceEquals(Request.Params["signupid"], null))) + { + // Get EventSignup + _objEventSignups = new EventSignupsInfo(); + int signupID = System.Convert.ToInt32(Request.Params["signupid"]); + _objEventSignups = _objCtlEventSignups.EventsSignupsGet(signupID, ModuleId, false); + lblStartDate.Text = _objEventSignups.EventTimeBegin.ToLongDateString() + " " + _objEventSignups.EventTimeBegin.ToShortTimeString(); + lblEventName.Text = _objEventSignups.EventName; + // Get Related Event + EventInfo objEvent = default(EventInfo); + objEvent = _objCtlEvent.EventsGet(_objEventSignups.EventID, _objEventSignups.ModuleID); + lblDescription.Text = Server.HtmlDecode(objEvent.EventDesc); + lblFee.Text = string.Format("{0:#0.00}", objEvent.EnrollFee); + lblNoEnrolees.Text = Convert.ToString(_objEventSignups.NoEnrolees); + if (Request.Params["status"].ToLower() == "enrolled") + { + // User has been successfully enrolled for this event (paid enrollment) + ShowMessage(Localization.GetString("lblComplete", LocalResourceFile), MessageLevel.DNNSuccess); + lblPurchase.Visible = false; + cmdPurchase.Visible = false; + cancelButton.Visible = false; + cmdReturn.Visible = true; + } + else if (Request.Params["status"].ToLower() == "cancelled") + { + // User has been cancelled paid enrollment + ShowMessage(Localization.GetString("lblCancel", LocalResourceFile), MessageLevel.DNNWarning); + lblPurchase.Visible = false; + cmdPurchase.Visible = false; + cancelButton.Visible = false; + cmdReturn.Visible = true; + // Make sure we delete the signup + DeleteEnrollment(signupID, objEvent.ModuleID, objEvent.EventID); + + // Mail users + if (Settings.SendEnrollMessageCancelled) + { + EventEmailInfo objEventEmailInfo = new EventEmailInfo(); + EventEmails objEventEmail = new EventEmails(PortalId, ModuleId, LocalResourceFile, ((PageBase)Page).PageCulture.Name); + objEventEmailInfo.TxtEmailSubject = Settings.Templates.txtEnrollMessageSubject; + objEventEmailInfo.TxtEmailBody = Settings.Templates.txtEnrollMessageCancelled; + objEventEmailInfo.TxtEmailFrom = Settings.StandardEmail; + if (_objEventSignups.UserID > -1) + { + objEventEmailInfo.UserIDs.Add(_objEventSignups.UserID); + } + else + { + objEventEmailInfo.UserEmails.Add(_objEventSignups.AnonEmail); + objEventEmailInfo.UserLocales.Add(_objEventSignups.AnonCulture); + objEventEmailInfo.UserTimeZoneIds.Add(_objEventSignups.AnonTimeZoneId); + } + objEventEmailInfo.UserIDs.Add(objEvent.OwnerID); + objEventEmail.SendEmails(objEventEmailInfo, objEvent, _objEventSignups); + } + } + } + else // security violation attempt to access item not related to this Module + { + Response.Redirect(GetSocialNavigateUrl(), true); + } + } + + dblTotal = Conversion.Val(lblFee.Text) * Conversion.Val(lblNoEnrolees.Text); + lblTotal.Text = Strings.Format(dblTotal, "#,##0.00"); + strCurrency = PortalSettings.Currency; + lblFeeCurrency.Text = strCurrency; + lblTotalCurrency.Text = strCurrency; + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + + #endregion + + #region Control Events + protected void cmdPurchase_Click(System.Object sender, EventArgs e) + { + EventInfo objEvent = default(EventInfo); + + try + { + if (Page.IsValid) + { + objEvent = _objCtlEvent.EventsGet(_itemID, ModuleId); + // User wants to purchase event, create Event Signup Record + _objEventSignups = new EventSignupsInfo(); + + //Just in case the user has clicked back and has now clicked Purchase again!! + EventSignupsInfo objEventSignupsChk = default(EventSignupsInfo); + if (ReferenceEquals(_anonEmail, null)) + { + objEventSignupsChk = _objCtlEventSignups.EventsSignupsGetUser(objEvent.EventID, UserId, objEvent.ModuleID); + } + else + { + objEventSignupsChk = _objCtlEventSignups.EventsSignupsGetAnonUser(objEvent.EventID, _anonEmail, objEvent.ModuleID); + } + if (!ReferenceEquals(objEventSignupsChk, null)) + { + _objEventSignups.SignupID = objEventSignupsChk.SignupID; + } + _objEventSignups.EventID = objEvent.EventID; + _objEventSignups.ModuleID = objEvent.ModuleID; + if (ReferenceEquals(_anonEmail, null)) + { + _objEventSignups.UserID = UserId; + _objEventSignups.AnonEmail = null; + _objEventSignups.AnonName = null; + _objEventSignups.AnonTelephone = null; + _objEventSignups.AnonCulture = null; + _objEventSignups.AnonTimeZoneId = null; + } + else + { + Security.PortalSecurity objSecurity = new Security.PortalSecurity(); + _objEventSignups.UserID = -1; + _objEventSignups.AnonEmail = objSecurity.InputFilter(_anonEmail, Security.PortalSecurity.FilterFlag.NoScripting); + _objEventSignups.AnonName = objSecurity.InputFilter(_anonName, Security.PortalSecurity.FilterFlag.NoScripting); + _objEventSignups.AnonTelephone = objSecurity.InputFilter(_anonTelephone, Security.PortalSecurity.FilterFlag.NoScripting); + _objEventSignups.AnonCulture = System.Threading.Thread.CurrentThread.CurrentCulture.Name; + _objEventSignups.AnonTimeZoneId = GetDisplayTimeZoneId(); + } + _objEventSignups.PayPalStatus = "none"; + _objEventSignups.PayPalReason = "PayPal call initiated..."; + _objEventSignups.PayPalPaymentDate = DateTime.UtcNow; + _objEventSignups.Approved = false; + _objEventSignups.NoEnrolees = int.Parse(lblNoEnrolees.Text); + + _objEventSignups = CreateEnrollment(_objEventSignups, objEvent); + + if (!ReferenceEquals(objEventSignupsChk, null)) + { + _objEventSignups = _objCtlEventSignups.EventsSignupsGet(objEventSignupsChk.SignupID, objEventSignupsChk.ModuleID, false); + } + + // Mail users + if (Settings.SendEnrollMessagePaying) + { + EventEmailInfo objEventEmailInfo = new EventEmailInfo(); + EventEmails objEventEmail = new EventEmails(PortalId, ModuleId, LocalResourceFile, ((PageBase)Page).PageCulture.Name); + objEventEmailInfo.TxtEmailSubject = Settings.Templates.txtEnrollMessageSubject; + objEventEmailInfo.TxtEmailBody = Settings.Templates.txtEnrollMessagePaying; + objEventEmailInfo.TxtEmailFrom = Settings.StandardEmail; + if (ReferenceEquals(_anonEmail, null)) + { + objEventEmailInfo.UserEmails.Add(PortalSettings.UserInfo.Email); + objEventEmailInfo.UserLocales.Add(PortalSettings.UserInfo.Profile.PreferredLocale); + objEventEmailInfo.UserTimeZoneIds.Add(PortalSettings.UserInfo.Profile.PreferredTimeZone.Id); + } + else + { + objEventEmailInfo.UserEmails.Add(_objEventSignups.AnonEmail); + objEventEmailInfo.UserLocales.Add(_objEventSignups.AnonCulture); + objEventEmailInfo.UserTimeZoneIds.Add(_objEventSignups.AnonTimeZoneId); + } + objEventEmailInfo.UserIDs.Add(objEvent.OwnerID); + objEventEmail.SendEmails(objEventEmailInfo, objEvent, _objEventSignups); + } + + // build PayPal URL + string ppurl = Settings.Paypalurl + "/cgi-bin/webscr?cmd=_xclick&business="; + + int socialGroupId = GetUrlGroupId(); + + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + string returnURL = ""; + if (socialGroupId > 0) + { + returnURL = objEventInfoHelper.AddSkinContainerControls(DotNetNuke.Common.Globals.NavigateURL(TabId, "PPEnroll", "Mid=" + System.Convert.ToString(ModuleId), "signupid=" + System.Convert.ToString(_objEventSignups.SignupID), "status=enrolled", "groupid=" + socialGroupId.ToString()), "?"); + } + else + { + returnURL = objEventInfoHelper.AddSkinContainerControls(DotNetNuke.Common.Globals.NavigateURL(TabId, "PPEnroll", "Mid=" + System.Convert.ToString(ModuleId), "signupid=" + System.Convert.ToString(_objEventSignups.SignupID), "status=enrolled"), "?"); + } + if (returnURL.IndexOf("://") + 1 == 0) + { + returnURL = DotNetNuke.Common.Globals.AddHTTP(DotNetNuke.Common.Globals.GetDomainName(Request)) + returnURL; + } + string cancelURL = ""; + if (socialGroupId > 0) + { + cancelURL = objEventInfoHelper.AddSkinContainerControls(DotNetNuke.Common.Globals.NavigateURL(TabId, "PPEnroll", "Mid=" + System.Convert.ToString(ModuleId), "signupid=" + System.Convert.ToString(_objEventSignups.SignupID), "status=cancelled", "groupid=" + socialGroupId.ToString()), "?"); + } + else + { + cancelURL = objEventInfoHelper.AddSkinContainerControls(DotNetNuke.Common.Globals.NavigateURL(TabId, "PPEnroll", "Mid=" + System.Convert.ToString(ModuleId), "signupid=" + System.Convert.ToString(_objEventSignups.SignupID), "status=cancelled"), "?"); + } + if (cancelURL.IndexOf("://") + 1 == 0) + { + cancelURL = DotNetNuke.Common.Globals.AddHTTP(DotNetNuke.Common.Globals.GetDomainName(Request)) + cancelURL; + } + string strPayPalURL = ""; + strPayPalURL = ppurl + DotNetNuke.Common.Globals.HTTPPOSTEncode(objEvent.PayPalAccount); + strPayPalURL = strPayPalURL + "&item_name=" + DotNetNuke.Common.Globals.HTTPPOSTEncode(objEvent.ModuleTitle + " - " + lblEventName.Text + " ( " + lblFee.Text + " " + lblFeeCurrency.Text + " )"); + strPayPalURL = strPayPalURL + "&item_number=" + DotNetNuke.Common.Globals.HTTPPOSTEncode(System.Convert.ToString(_objEventSignups.SignupID)); + strPayPalURL = strPayPalURL + "&quantity=" + DotNetNuke.Common.Globals.HTTPPOSTEncode(Convert.ToString(_objEventSignups.NoEnrolees)); + strPayPalURL = strPayPalURL + "&custom=" + DotNetNuke.Common.Globals.HTTPPOSTEncode(System.Convert.ToDateTime(lblStartDate.Text).ToShortDateString()); + + // Make sure currency is in correct format + double dblFee = double.Parse(lblFee.Text); + CultureInfo uiculture = System.Threading.Thread.CurrentThread.CurrentCulture; + System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; + strPayPalURL = strPayPalURL + "&amount=" + DotNetNuke.Common.Globals.HTTPPOSTEncode(Strings.Format(dblFee, "#,##0.00")); + System.Threading.Thread.CurrentThread.CurrentCulture = uiculture; + + strPayPalURL = strPayPalURL + "¤cy_code=" + DotNetNuke.Common.Globals.HTTPPOSTEncode(lblTotalCurrency.Text); + strPayPalURL = strPayPalURL + "&return=" + returnURL; + strPayPalURL = strPayPalURL + "&cancel_return=" + cancelURL; + strPayPalURL = strPayPalURL + "¬ify_url=" + DotNetNuke.Common.Globals.HTTPPOSTEncode(DotNetNuke.Common.Globals.AddHTTP(DotNetNuke.Common.Globals.GetDomainName(Request)) + "/DesktopModules/Events/EventIPN.aspx"); + strPayPalURL = strPayPalURL + "&undefined_quantity=&no_note=1&no_shipping=1"; + //strPayPalURL = strPayPalURL & "&undefined_quantity=&no_note=1&no_shipping=1&rm=2" + + // redirect to PayPal + Response.Redirect(strPayPalURL, true); + } + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + + protected void cancelButton_Click(System.Object sender, EventArgs e) + { + try + { + Response.Redirect(GetSocialNavigateUrl(), true); + } + catch (Exception) //Module failed to load + { + //ProcessModuleLoadException(Me, exc) + } + } + + protected void cmdReturn_Click(System.Object sender, EventArgs e) + { + try + { + Response.Redirect(GetSocialNavigateUrl(), true); + } + catch (Exception) //Module failed to load + { + //ProcessModuleLoadException(Me, exc) + } + } + + #endregion + #region Support Functions + private void ShowMessage(string msg, MessageLevel messageLevel) + { + lblMessage.Text = msg; + + //Hide the rest of the form fields. + divMessage.Attributes.Add("style", "display:block;"); + + switch (messageLevel) + { + case MessageLevel.DNNSuccess: + divMessage.Attributes.Add("class", "dnnFormMessage dnnFormSuccess"); + break; + case MessageLevel.DNNInformation: + divMessage.Attributes.Add("class", "dnnFormMessage dnnFormInfo"); + break; + case MessageLevel.DNNWarning: + divMessage.Attributes.Add("class", "dnnFormMessage dnnFormWarning"); + break; + case MessageLevel.DNNError: + divMessage.Attributes.Add("class", "dnnFormMessage dnnFormValidationSummary"); + break; + } + } + + #endregion + + + } + +} diff --git a/EventPPEnroll.ascx.designer.cs b/EventPPEnroll.ascx.designer.cs new file mode 100644 index 0000000..a168f97 --- /dev/null +++ b/EventPPEnroll.ascx.designer.cs @@ -0,0 +1,222 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DotNetNuke.Modules.Events { + + + public partial class EventPPEnroll { + + /// + /// pnlEventsModulePayPal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlEventsModulePayPal; + + /// + /// PPEnroll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl PPEnroll; + + /// + /// divMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divMessage; + + /// + /// lblMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMessage; + + /// + /// lblEventNameCap control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEventNameCap; + + /// + /// lblEventName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEventName; + + /// + /// lblEventStart control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEventStart; + + /// + /// lblStartDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblStartDate; + + /// + /// lblDescriptionCap control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblDescriptionCap; + + /// + /// lblDescription control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblDescription; + + /// + /// lblFeeCap control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblFeeCap; + + /// + /// lblFee control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblFee; + + /// + /// lblFeeCurrency control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblFeeCurrency; + + /// + /// lblNoEnroled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblNoEnroled; + + /// + /// lblNoEnrolees control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblNoEnrolees; + + /// + /// lblTotalCharges control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblTotalCharges; + + /// + /// lblTotal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblTotal; + + /// + /// lblTotalCurrency control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblTotalCurrency; + + /// + /// Panel1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel Panel1; + + /// + /// lblPurchase control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblPurchase; + + /// + /// cmdReturn control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdReturn; + + /// + /// cmdPurchase control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdPurchase; + + /// + /// cancelButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cancelButton; + } +} diff --git a/EventPPEnroll.ascx.designer.vb b/EventPPEnroll.ascx.designer.vb deleted file mode 100644 index a034357..0000000 --- a/EventPPEnroll.ascx.designer.vb +++ /dev/null @@ -1,224 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Namespace DotNetNuke.Modules.Events - - Partial Public Class EventPPEnroll - - ''' - '''pnlEventsModulePayPal control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlEventsModulePayPal As Global.System.Web.UI.WebControls.Panel - - ''' - '''PPEnroll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents PPEnroll As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''divMessage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divMessage As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblMessage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblMessage As Global.System.Web.UI.WebControls.Label - - ''' - '''lblEventNameCap control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEventNameCap As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''lblEventName control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEventName As Global.System.Web.UI.WebControls.Label - - ''' - '''lblEventStart control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEventStart As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''lblStartDate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblStartDate As Global.System.Web.UI.WebControls.Label - - ''' - '''lblDescriptionCap control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblDescriptionCap As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''lblDescription control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblDescription As Global.System.Web.UI.WebControls.Label - - ''' - '''lblFeeCap control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblFeeCap As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''lblFee control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblFee As Global.System.Web.UI.WebControls.Label - - ''' - '''lblFeeCurrency control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblFeeCurrency As Global.System.Web.UI.WebControls.Label - - ''' - '''lblNoEnroled control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblNoEnroled As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''lblNoEnrolees control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblNoEnrolees As Global.System.Web.UI.WebControls.Label - - ''' - '''lblTotalCharges control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblTotalCharges As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''lblTotal control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblTotal As Global.System.Web.UI.WebControls.Label - - ''' - '''lblTotalCurrency control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblTotalCurrency As Global.System.Web.UI.WebControls.Label - - ''' - '''Panel1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents Panel1 As Global.System.Web.UI.WebControls.Panel - - ''' - '''lblPurchase control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblPurchase As Global.System.Web.UI.WebControls.Label - - ''' - '''cmdReturn control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdReturn As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''cmdPurchase control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdPurchase As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''cancelButton control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cancelButton As Global.System.Web.UI.WebControls.LinkButton - End Class -End Namespace diff --git a/EventPPEnroll.ascx.vb b/EventPPEnroll.ascx.vb deleted file mode 100644 index 940fd0b..0000000 --- a/EventPPEnroll.ascx.vb +++ /dev/null @@ -1,340 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - -Imports System.Globalization - -Namespace DotNetNuke.Modules.Events - - _ - Partial Class EventPPEnroll - Inherits EventBase - -#Region " Web Form Designer Generated Code " - - 'This call is required by the Web Form Designer. - Private Sub InitializeComponent() - - End Sub - - Private Sub Page_Init(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Init - 'CODEGEN: This method call is required by the Web Form Designer - 'Do not modify it using the code editor. - InitializeComponent() - End Sub - -#End Region - -#Region "Private Area" - Private _itemID As Integer = -1 - Private _noEnrol As Integer = 1 - Private ReadOnly _objCtlEvent As New EventController - Private _objEventSignups As New EventSignupsInfo - Private ReadOnly _objCtlEventSignups As New EventSignupsController - Private _anonEmail As String = Nothing - Private _anonName As String = Nothing - Private _anonTelephone As String = Nothing - - Private Enum MessageLevel As Integer - DNNSuccess = 1 - DNNInformation - DNNWarning - DNNError - End Enum - -#End Region - -#Region "Event Handlers" - Private Sub Page_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load - Try - Dim dblTotal As Double - Dim strCurrency As String - - If Not (Request.Params("ItemID") Is Nothing) Then - _itemID = Int32.Parse(Request.Params("ItemID")) - End If - If Not (Request.Params("AnonEmail") Is Nothing) Then - _anonEmail = HttpUtility.UrlDecode(Request.Params("AnonEmail")) - End If - If Not (Request.Params("AnonName") Is Nothing) Then - _anonName = HttpUtility.UrlDecode(Request.Params("AnonName")) - End If - If Not (Request.Params("AnonPhone") Is Nothing) Then - _anonTelephone = HttpUtility.UrlDecode(Request.Params("AnonPhone")) - If _anonTelephone = "0" Then - _anonTelephone = "" - End If - End If - - ' Set the selected theme - SetTheme(pnlEventsModulePayPal) - - divMessage.Attributes.Add("style", "display:none;") - - If Not (Page.IsPostBack) Then - If _itemID <> -1 Then - If Not (Request.Params("NoEnrol") Is Nothing) Then - _noEnrol = Int32.Parse(Request.Params("NoEnrol")) - End If - - Dim objEvent As EventInfo - objEvent = _objCtlEvent.EventsGet(_itemID, ModuleId) - - ' Compute Dates/Times (for recurring) - Dim startdate As DateTime = objEvent.EventTimeBegin - SelectedDate = startdate.Date - Dim d As DateTime - d = startdate.Date.AddMinutes(objEvent.EventTimeBegin.TimeOfDay.TotalMinutes) - lblStartDate.Text = d.ToLongDateString + " " + d.ToShortTimeString - lblEventName.Text = objEvent.EventName - lblDescription.Text = Server.HtmlDecode(objEvent.EventDesc) - lblFee.Text = String.Format("{0:#0.00}", objEvent.EnrollFee) - lblNoEnrolees.Text = CStr(_noEnrol) - lblPurchase.Text = Localization.GetString("lblPurchase", LocalResourceFile) - lblPurchase.Visible = True - ElseIf Not (Request.Params("signupid") Is Nothing) Then - ' Get EventSignup - _objEventSignups = New EventSignupsInfo - Dim signupID As Integer = CType(Request.Params("signupid"), Integer) - _objEventSignups = _objCtlEventSignups.EventsSignupsGet(signupID, ModuleId, False) - lblStartDate.Text = _objEventSignups.EventTimeBegin.ToLongDateString + " " + _objEventSignups.EventTimeBegin.ToShortTimeString - lblEventName.Text = _objEventSignups.EventName - ' Get Related Event - Dim objEvent As EventInfo - objEvent = _objCtlEvent.EventsGet(_objEventSignups.EventID, _objEventSignups.ModuleID) - lblDescription.Text = Server.HtmlDecode(objEvent.EventDesc) - lblFee.Text = String.Format("{0:#0.00}", objEvent.EnrollFee) - lblNoEnrolees.Text = CStr(_objEventSignups.NoEnrolees) - If Request.Params("status").ToLower = "enrolled" Then - ' User has been successfully enrolled for this event (paid enrollment) - ShowMessage(Localization.GetString("lblComplete", LocalResourceFile), MessageLevel.DNNSuccess) - lblPurchase.Visible = False - cmdPurchase.Visible = False - cancelButton.Visible = False - cmdReturn.Visible = True - ElseIf Request.Params("status").ToLower = "cancelled" Then - ' User has been cancelled paid enrollment - ShowMessage(Localization.GetString("lblCancel", LocalResourceFile), MessageLevel.DNNWarning) - lblPurchase.Visible = False - cmdPurchase.Visible = False - cancelButton.Visible = False - cmdReturn.Visible = True - ' Make sure we delete the signup - DeleteEnrollment(signupID, objEvent.ModuleID, objEvent.EventID) - - ' Mail users - If Settings.SendEnrollMessageCancelled Then - Dim objEventEmailInfo As New EventEmailInfo - Dim objEventEmail As New EventEmails(PortalId, ModuleId, LocalResourceFile, CType(Page, PageBase).PageCulture.Name) - objEventEmailInfo.TxtEmailSubject = Settings.Templates.txtEnrollMessageSubject - objEventEmailInfo.TxtEmailBody = Settings.Templates.txtEnrollMessageCancelled - objEventEmailInfo.TxtEmailFrom() = Settings.StandardEmail - If _objEventSignups.UserID > -1 Then - objEventEmailInfo.UserIDs.Add(_objEventSignups.UserID) - Else - objEventEmailInfo.UserEmails.Add(_objEventSignups.AnonEmail) - objEventEmailInfo.UserLocales.Add(_objEventSignups.AnonCulture) - objEventEmailInfo.UserTimeZoneIds.Add(_objEventSignups.AnonTimeZoneId) - End If - objEventEmailInfo.UserIDs.Add(objEvent.OwnerID) - objEventEmail.SendEmails(objEventEmailInfo, objEvent, _objEventSignups) - End If - End If - Else ' security violation attempt to access item not related to this Module - Response.Redirect(GetSocialNavigateUrl(), True) - End If - End If - - dblTotal = Val(lblFee.Text) * Val(lblNoEnrolees.Text) - lblTotal.Text = Format(dblTotal, "#,##0.00") - strCurrency = PortalSettings.Currency - lblFeeCurrency.Text = strCurrency - lblTotalCurrency.Text = strCurrency - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub - -#End Region - -#Region "Control Events" - Private Sub cmdPurchase_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles cmdPurchase.Click - Dim objEvent As EventInfo - - Try - If Page.IsValid Then - objEvent = _objCtlEvent.EventsGet(_itemID, ModuleId) - ' User wants to purchase event, create Event Signup Record - _objEventSignups = New EventSignupsInfo - - 'Just in case the user has clicked back and has now clicked Purchase again!! - Dim objEventSignupsChk As EventSignupsInfo - If _anonEmail Is Nothing Then - objEventSignupsChk = _objCtlEventSignups.EventsSignupsGetUser(objEvent.EventID, UserId, objEvent.ModuleID) - Else - objEventSignupsChk = _objCtlEventSignups.EventsSignupsGetAnonUser(objEvent.EventID, _anonEmail, objEvent.ModuleID) - End If - If Not objEventSignupsChk Is Nothing Then - _objEventSignups.SignupID = objEventSignupsChk.SignupID - End If - _objEventSignups.EventID = objEvent.EventID - _objEventSignups.ModuleID = objEvent.ModuleID - If _anonEmail Is Nothing Then - _objEventSignups.UserID = UserId - _objEventSignups.AnonEmail = Nothing - _objEventSignups.AnonName = Nothing - _objEventSignups.AnonTelephone = Nothing - _objEventSignups.AnonCulture = Nothing - _objEventSignups.AnonTimeZoneId = Nothing - Else - Dim objSecurity As New Security.PortalSecurity - _objEventSignups.UserID = -1 - _objEventSignups.AnonEmail = objSecurity.InputFilter(_anonEmail, Security.PortalSecurity.FilterFlag.NoScripting) - _objEventSignups.AnonName = objSecurity.InputFilter(_anonName, Security.PortalSecurity.FilterFlag.NoScripting) - _objEventSignups.AnonTelephone = objSecurity.InputFilter(_anonTelephone, Security.PortalSecurity.FilterFlag.NoScripting) - _objEventSignups.AnonCulture = Threading.Thread.CurrentThread.CurrentCulture.Name - _objEventSignups.AnonTimeZoneId = GetDisplayTimeZoneId() - End If - _objEventSignups.PayPalStatus = "none" - _objEventSignups.PayPalReason = "PayPal call initiated..." - _objEventSignups.PayPalPaymentDate = DateTime.UtcNow - _objEventSignups.Approved = False - _objEventSignups.NoEnrolees = CInt(lblNoEnrolees.Text) - - _objEventSignups = CreateEnrollment(_objEventSignups, objEvent) - - If Not objEventSignupsChk Is Nothing Then - _objEventSignups = _objCtlEventSignups.EventsSignupsGet(objEventSignupsChk.SignupID, objEventSignupsChk.ModuleID, False) - End If - - ' Mail users - If Settings.SendEnrollMessagePaying Then - Dim objEventEmailInfo As New EventEmailInfo - Dim objEventEmail As New EventEmails(PortalId, ModuleId, LocalResourceFile, CType(Page, PageBase).PageCulture.Name) - objEventEmailInfo.TxtEmailSubject = Settings.Templates.txtEnrollMessageSubject - objEventEmailInfo.TxtEmailBody = Settings.Templates.txtEnrollMessagePaying - objEventEmailInfo.TxtEmailFrom() = Settings.StandardEmail - If _anonEmail Is Nothing Then - objEventEmailInfo.UserEmails.Add(PortalSettings.UserInfo.Email) - objEventEmailInfo.UserLocales.Add(PortalSettings.UserInfo.Profile.PreferredLocale) - objEventEmailInfo.UserTimeZoneIds.Add(PortalSettings.UserInfo.Profile.PreferredTimeZone.Id) - Else - objEventEmailInfo.UserEmails.Add(_objEventSignups.AnonEmail) - objEventEmailInfo.UserLocales.Add(_objEventSignups.AnonCulture) - objEventEmailInfo.UserTimeZoneIds.Add(_objEventSignups.AnonTimeZoneId) - End If - objEventEmailInfo.UserIDs.Add(objEvent.OwnerID) - objEventEmail.SendEmails(objEventEmailInfo, objEvent, _objEventSignups) - End If - - ' build PayPal URL - Dim ppurl As String = Settings.Paypalurl & "/cgi-bin/webscr?cmd=_xclick&business=" - - Dim socialGroupId As Integer = GetUrlGroupId() - - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - Dim returnURL As String - If socialGroupId > 0 Then - returnURL = objEventInfoHelper.AddSkinContainerControls(NavigateURL(TabId, "PPEnroll", "Mid=" & ModuleId, "signupid=" & CType(_objEventSignups.SignupID, String), "status=enrolled", "groupid=" & socialGroupId.ToString), "?") - Else - returnURL = objEventInfoHelper.AddSkinContainerControls(NavigateURL(TabId, "PPEnroll", "Mid=" & ModuleId, "signupid=" & CType(_objEventSignups.SignupID, String), "status=enrolled"), "?") - End If - If InStr(1, returnURL, "://") = 0 Then - returnURL = AddHTTP(GetDomainName(Request)) & returnURL - End If - Dim cancelURL As String - If socialGroupId > 0 Then - cancelURL = objEventInfoHelper.AddSkinContainerControls(NavigateURL(TabId, "PPEnroll", "Mid=" & ModuleId, "signupid=" & CType(_objEventSignups.SignupID, String), "status=cancelled", "groupid=" & socialGroupId.ToString), "?") - Else - cancelURL = objEventInfoHelper.AddSkinContainerControls(NavigateURL(TabId, "PPEnroll", "Mid=" & ModuleId, "signupid=" & CType(_objEventSignups.SignupID, String), "status=cancelled"), "?") - End If - If InStr(1, cancelURL, "://") = 0 Then - cancelURL = AddHTTP(GetDomainName(Request)) & cancelURL - End If - Dim strPayPalURL As String - strPayPalURL = ppurl & HTTPPOSTEncode(objEvent.PayPalAccount) - strPayPalURL = strPayPalURL & "&item_name=" & HTTPPOSTEncode(objEvent.ModuleTitle & " - " & lblEventName.Text & " ( " & lblFee.Text & " " & lblFeeCurrency.Text & " )") - strPayPalURL = strPayPalURL & "&item_number=" & HTTPPOSTEncode(CType(_objEventSignups.SignupID, String)) - strPayPalURL = strPayPalURL & "&quantity=" & HTTPPOSTEncode(CStr(_objEventSignups.NoEnrolees)) - strPayPalURL = strPayPalURL & "&custom=" & HTTPPOSTEncode(CType(lblStartDate.Text, DateTime).ToShortDateString) - - ' Make sure currency is in correct format - Dim dblFee As Double = CDbl(lblFee.Text) - Dim uiculture As CultureInfo = Threading.Thread.CurrentThread.CurrentCulture - Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture - strPayPalURL = strPayPalURL & "&amount=" & HTTPPOSTEncode(Format(dblFee, "#,##0.00")) - Threading.Thread.CurrentThread.CurrentCulture = uiculture - - strPayPalURL = strPayPalURL & "¤cy_code=" & HTTPPOSTEncode(lblTotalCurrency.Text) - strPayPalURL = strPayPalURL & "&return=" & returnURL - strPayPalURL = strPayPalURL & "&cancel_return=" & cancelURL - strPayPalURL = strPayPalURL & "¬ify_url=" & HTTPPOSTEncode(AddHTTP(GetDomainName(Request)) & "/DesktopModules/Events/EventIPN.aspx") - strPayPalURL = strPayPalURL & "&undefined_quantity=&no_note=1&no_shipping=1" - 'strPayPalURL = strPayPalURL & "&undefined_quantity=&no_note=1&no_shipping=1&rm=2" - - ' redirect to PayPal - Response.Redirect(strPayPalURL, True) - End If - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub - - Private Sub cancelButton_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles cancelButton.Click - Try - Response.Redirect(GetSocialNavigateUrl(), True) - Catch exc As Exception 'Module failed to load - 'ProcessModuleLoadException(Me, exc) - End Try - End Sub - - Private Sub cmdReturn_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles cmdReturn.Click - Try - Response.Redirect(GetSocialNavigateUrl(), True) - Catch exc As Exception 'Module failed to load - 'ProcessModuleLoadException(Me, exc) - End Try - End Sub - -#End Region -#Region "Support Functions" - Private Sub ShowMessage(ByVal msg As String, ByVal messageLevel As MessageLevel) - lblMessage.Text = msg - - 'Hide the rest of the form fields. - divMessage.Attributes.Add("style", "display:block;") - - Select Case MessageLevel - Case MessageLevel.DNNSuccess - divMessage.Attributes.Add("class", "dnnFormMessage dnnFormSuccess") - Case MessageLevel.DNNInformation - divMessage.Attributes.Add("class", "dnnFormMessage dnnFormInfo") - Case MessageLevel.DNNWarning - divMessage.Attributes.Add("class", "dnnFormMessage dnnFormWarning") - Case MessageLevel.DNNError - divMessage.Attributes.Add("class", "dnnFormMessage dnnFormValidationSummary") - End Select - End Sub - -#End Region - - - End Class - -End Namespace diff --git a/EventRSS.aspx b/EventRSS.aspx index bbbc957..b3e3629 100644 --- a/EventRSS.aspx +++ b/EventRSS.aspx @@ -1 +1,2 @@ -<%@ Page Language="vb" AutoEventWireup="false" Codebehind="EventRSS.aspx.vb" Inherits="DotNetNuke.Modules.Events.EventRSS" Explicit="True" %> +<%@ Page Language="C#" AutoEventWireup="true" Codebehind="EventRSS.aspx.cs" Inherits="DotNetNuke.Modules.Events.EventRSS" Explicit="True" %> + diff --git a/EventRSS.aspx.cs b/EventRSS.aspx.cs new file mode 100644 index 0000000..74ec1c3 --- /dev/null +++ b/EventRSS.aspx.cs @@ -0,0 +1,504 @@ +using System.Diagnostics; +using DotNetNuke.Entities.Users; +using System.Web.UI; +using Microsoft.VisualBasic; +using System.Collections; +using System.Web; +using DotNetNuke.Services.Localization; +using System; +using System.IO; +using System.Xml; +using System.Text; +using System.Globalization; +using DotNetNuke.Entities.Portals; +using DotNetNuke.Security; + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events + { + public partial class EventRSS : Page + { + +#region Private Variables + private int _moduleID; + private int _tabID; + private int _portalID; + private EventModuleSettings _settings; + private UserInfo _userinfo; + private const string NsPre = "e"; + private const string NsFull = "http://www.dnnsoftware.com/dnnevents"; +#endregion +#region Web Form Designer Generated Code + + //This call is required by the Web Form Designer. + [DebuggerStepThrough()]private void InitializeComponent() + { + + } + + private void Page_Init(System.Object sender, EventArgs e) + { + //CODEGEN: This method call is required by the Web Form Designer + //Do not modify it using the code editor. + InitializeComponent(); + } + +#endregion + +#region Event Handlers + private void Page_Load(System.Object sender, EventArgs e) + { + int iDaysBefore = 0; + int iDaysAfter = 0; + int iMax = 0; + int iOwnerID = 0; + int iLocationID = 0; + int iImportance = 0; + ArrayList categoryIDs = new ArrayList(); + ArrayList locationIDs = new ArrayList(); + int iGroupId = -1; + int iUserId = -1; + string iCategoryName = ""; + string iLocationName = ""; + string iOwnerName = ""; + string txtPriority = ""; + if (!(HttpContext.Current.Request.QueryString["Mid"] == "")) + { + _moduleID = System.Convert.ToInt32(HttpContext.Current.Request.QueryString["mid"]); + } + else + { + Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(), true); + } + if (!(HttpContext.Current.Request.QueryString["tabid"] == "")) + { + _tabID = System.Convert.ToInt32(HttpContext.Current.Request.QueryString["tabid"]); + } + else + { + Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(), true); + } + + string localResourceFile = TemplateSourceDirectory + "/" + Localization.LocalResourceDirectory + "/EventRSS.aspx.resx"; + + if (!(HttpContext.Current.Request.QueryString["CategoryName"] == "")) + { + iCategoryName = HttpContext.Current.Request.QueryString["CategoryName"]; + PortalSecurity objSecurity = new PortalSecurity(); + iCategoryName = objSecurity.InputFilter(iCategoryName, PortalSecurity.FilterFlag.NoSQL); + } + if (!(HttpContext.Current.Request.QueryString["CategoryID"] == "")) + { + categoryIDs.Add(System.Convert.ToInt32(HttpContext.Current.Request.QueryString["CategoryID"])); + } + if (!(HttpContext.Current.Request.QueryString["LocationName"] == "")) + { + iLocationName = HttpContext.Current.Request.QueryString["LocationName"]; + PortalSecurity objSecurity = new PortalSecurity(); + iLocationName = objSecurity.InputFilter(iLocationName, PortalSecurity.FilterFlag.NoSQL); + } + if (!(HttpContext.Current.Request.QueryString["LocationID"] == "")) + { + locationIDs.Add(System.Convert.ToInt32(HttpContext.Current.Request.QueryString["LocationID"])); + } + if (!(HttpContext.Current.Request.QueryString["groupid"] == "")) + { + iGroupId = System.Convert.ToInt32(HttpContext.Current.Request.QueryString["groupid"]); + } + if (!(HttpContext.Current.Request.QueryString["DaysBefore"] == "")) + { + iDaysBefore = System.Convert.ToInt32(HttpContext.Current.Request.QueryString["DaysBefore"]); + } + if (!(HttpContext.Current.Request.QueryString["DaysAfter"] == "")) + { + iDaysAfter = System.Convert.ToInt32(HttpContext.Current.Request.QueryString["DaysAfter"]); + } + if (!(HttpContext.Current.Request.QueryString["MaxNumber"] == "")) + { + iMax = System.Convert.ToInt32(HttpContext.Current.Request.QueryString["MaxNumber"]); + } + if (!(HttpContext.Current.Request.QueryString["OwnerName"] == "")) + { + iOwnerName = HttpContext.Current.Request.QueryString["OwnerName"]; + } + if (!(HttpContext.Current.Request.QueryString["OwnerID"] == "")) + { + iOwnerID = System.Convert.ToInt32(HttpContext.Current.Request.QueryString["OwnerID"]); + } + if (!(HttpContext.Current.Request.QueryString["LocationName"] == "")) + { + iLocationName = HttpContext.Current.Request.QueryString["LocationName"]; + } + if (!(HttpContext.Current.Request.QueryString["LocationID"] == "")) + { + iLocationID = System.Convert.ToInt32(HttpContext.Current.Request.QueryString["LocationID"]); + } + if (!(HttpContext.Current.Request.QueryString["Priority"] == "")) + { + string iPriority = ""; + iPriority = HttpContext.Current.Request.QueryString["Priority"]; + string lHigh = ""; + string lMedium = ""; + string lLow = ""; + lHigh = Localization.GetString("High", localResourceFile); + lMedium = Localization.GetString("Normal", localResourceFile); + lLow = Localization.GetString("Low", localResourceFile); + + txtPriority = "Medium"; + if (iPriority == lHigh) + { + txtPriority = "High"; + } + else if (iPriority == lMedium) + { + txtPriority = "Medium"; + } + else if (iPriority == lLow) + { + txtPriority = "Low"; + } + else if (iPriority == "High") + { + txtPriority = "High"; + } + else if (iPriority == "Normal") + { + txtPriority = "Medium"; + } + else if (iPriority == "Low") + { + txtPriority = "Low"; + } + } + if (!(HttpContext.Current.Request.QueryString["Importance"] == "")) + { + iImportance = System.Convert.ToInt32(HttpContext.Current.Request.QueryString["Importance"]); + } + + PortalSettings portalSettings = (PortalSettings) (HttpContext.Current.Items["PortalSettings"]); + _portalID = portalSettings.PortalId; + _userinfo = (UserInfo) (HttpContext.Current.Items["UserInfo"]); + if (!ReferenceEquals(portalSettings, null)) + { + if (portalSettings.DefaultLanguage != "") + { + CultureInfo userculture = new CultureInfo(portalSettings.DefaultLanguage, false); + System.Threading.Thread.CurrentThread.CurrentCulture = userculture; + } + } + if (_userinfo.UserID > 0) + { + if (_userinfo.Profile.PreferredLocale != "") + { + CultureInfo userculture = new CultureInfo(_userinfo.Profile.PreferredLocale, false); + System.Threading.Thread.CurrentThread.CurrentCulture = userculture; + } + } + + EventModuleSettings ems = new EventModuleSettings(); + _settings = ems.GetEventModuleSettings(_moduleID, localResourceFile); + + if (_settings.Enablecategories == EventModuleSettings.DisplayCategories.DoNotDisplay) + { + categoryIDs = _settings.ModuleCategoryIDs; + iCategoryName = ""; + } + if (!string.IsNullOrEmpty(iCategoryName)) + { + EventCategoryController oCntrlEventCategory = new EventCategoryController(); + EventCategoryInfo oEventCategory = oCntrlEventCategory.EventCategoryGetByName(iCategoryName, _portalID); + if (!ReferenceEquals(oEventCategory, null)) + { + categoryIDs.Add(oEventCategory.Category); + } + } + if (_settings.Enablelocations == EventModuleSettings.DisplayLocations.DoNotDisplay) + { + locationIDs = _settings.ModuleLocationIDs; + iLocationName = ""; + } + if (!string.IsNullOrEmpty(iLocationName)) + { + EventLocationController oCntrlEventLocation = new EventLocationController(); + EventLocationInfo oEventLocation = oCntrlEventLocation.EventsLocationGetByName(iLocationName, _portalID); + if (!ReferenceEquals(oEventLocation, null)) + { + locationIDs.Add(oEventLocation.Location); + } + } + + if (!_settings.RSSEnable) + { + Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(), true); + } + + if (_settings.SocialGroupModule == EventModuleSettings.SocialModule.UserProfile) + { + iUserId = _userinfo.UserID; + } + bool getSubEvents = _settings.MasterEvent; + + DateTime dtEndDate = default(DateTime); + if (HttpContext.Current.Request.QueryString["DaysAfter"] == "" && + HttpContext.Current.Request.QueryString["DaysBefore"] == "") + { + iDaysAfter = _settings.RSSDays; + } + EventTimeZoneUtilities objEventTimeZoneUtilities = new EventTimeZoneUtilities(); + DateTime currDate = objEventTimeZoneUtilities.ConvertFromUTCToModuleTimeZone(DateTime.UtcNow, _settings.TimeZoneId); + + dtEndDate = DateAndTime.DateAdd(DateInterval.Day, iDaysAfter, currDate).Date; + + DateTime dtStartDate = default(DateTime); + dtStartDate = DateAndTime.DateAdd(DateInterval.Day, System.Convert.ToDouble(- iDaysBefore), currDate).Date; + + string txtFeedRootTitle = ""; + string txtFeedRootDescription = ""; + string txtRSSDateField = ""; + txtFeedRootTitle = _settings.RSSTitle; + txtFeedRootDescription = _settings.RSSDesc; + txtRSSDateField = _settings.RSSDateField; + + Response.ContentType = "text/xml"; + Response.ContentEncoding = Encoding.UTF8; + + + using (StringWriter sw = new StringWriter()) + { + using (XmlTextWriter writer = new XmlTextWriter(sw)) + { + // Dim writer As XmlTextWriter = New XmlTextWriter(sw) + writer.Formatting = Formatting.Indented; + writer.Indentation = 4; + + writer.WriteStartElement("rss"); + writer.WriteAttributeString("version", "2.0"); + writer.WriteAttributeString("xmlns:wfw", "http://wellformedweb.org/CommentAPI/"); + writer.WriteAttributeString("xmlns:slash", "http://purl.org/rss/1.0/modules/slash/"); + writer.WriteAttributeString("xmlns:dc", "http://purl.org/dc/elements/1.1/"); + writer.WriteAttributeString("xmlns:trackback", "http://madskills.com/public/xml/rss/module/trackback/"); + writer.WriteAttributeString("xmlns:atom", "http://www.w3.org/2005/Atom"); + writer.WriteAttributeString("xmlns", NsPre, null, NsFull); + + writer.WriteStartElement("channel"); + + writer.WriteStartElement("atom:link"); + writer.WriteAttributeString("href", HttpContext.Current.Request.Url.AbsoluteUri); + writer.WriteAttributeString("rel", "self"); + writer.WriteAttributeString("type", "application/rss+xml"); + writer.WriteEndElement(); + + writer.WriteElementString("title", portalSettings.PortalName + " - " + txtFeedRootTitle); + + if ((portalSettings.PortalAlias.HTTPAlias.IndexOf("http://", StringComparison.Ordinal) == -1) && (portalSettings.PortalAlias.HTTPAlias.IndexOf("https://", StringComparison.Ordinal) == -1)) + { + writer.WriteElementString("link", DotNetNuke.Common.Globals.AddHTTP(portalSettings.PortalAlias.HTTPAlias)); + } + else + { + writer.WriteElementString("link", portalSettings.PortalAlias.HTTPAlias); + } + + writer.WriteElementString("description", txtFeedRootDescription); + writer.WriteElementString("ttl", "60"); + + EventInfoHelper objEventInfoHelper = new EventInfoHelper(_moduleID, _tabID, _portalID, _settings); + ArrayList lstEvents = default(ArrayList); + TokenReplaceControllerClass tcc = new TokenReplaceControllerClass(_moduleID, localResourceFile); + string tmpTitle = _settings.Templates.txtRSSTitle; + string tmpDescription = _settings.Templates.txtRSSDescription; + if (categoryIDs.Count == 0) + { + categoryIDs.Add("-1"); + } + if (locationIDs.Count == 0) + { + locationIDs.Add("-1"); + } + + lstEvents = objEventInfoHelper.GetEvents(dtStartDate, dtEndDate, getSubEvents, categoryIDs, locationIDs, iGroupId, iUserId); + + EventBase objEventBase = new EventBase(); + string displayTimeZoneId = objEventBase.GetDisplayTimeZoneId(_settings, _portalID); + + int rssCount = 0; + foreach (EventInfo eventInfo in lstEvents) + { + var objEvent = eventInfo; + + if (System.Convert.ToInt32(categoryIDs[0]) == 0 & objEvent.Category != System.Convert.ToInt32(categoryIDs[0])) + { + continue; + } + if (System.Convert.ToInt32(locationIDs[0]) == 0 & objEvent.Location != System.Convert.ToInt32(locationIDs[0])) + { + continue; + } + if (iOwnerID > 0 & objEvent.OwnerID != iOwnerID) + { + continue; + } + if (!string.IsNullOrEmpty(iOwnerName)&& objEvent.OwnerName != iOwnerName) + { + continue; + } + if (iLocationID > 0 & objEvent.Location != iLocationID) + { + continue; + } + if (!string.IsNullOrEmpty(iLocationName)&& objEvent.LocationName != iLocationName) + { + continue; + } + if (iImportance > 0 && (int)objEvent.Importance != iImportance) + { + continue; + } + if (!string.IsNullOrEmpty(txtPriority)&& objEvent.Importance.ToString() != txtPriority) + { + continue; + } + + // If full enrollments should be hidden, ignore + if (HideFullEvent(objEvent)) + { + continue; + } + + DateTime pubDate = default(DateTime); + string pubTimeZoneId = ""; + switch (txtRSSDateField) + { + case "UPDATEDDATE": + pubDate = objEvent.LastUpdatedAt; + pubTimeZoneId = objEvent.OtherTimeZoneId; + break; + case "CREATIONDATE": + pubDate = objEvent.CreatedDate; + pubTimeZoneId = objEvent.OtherTimeZoneId; + break; + case "EVENTDATE": + pubDate = objEvent.EventTimeBegin; + pubTimeZoneId = objEvent.EventTimeZoneId; + break; + } + + objEvent = objEventInfoHelper.ConvertEventToDisplayTimeZone(objEvent, displayTimeZoneId); + + writer.WriteStartElement("item"); + string eventTitle = tcc.TokenReplaceEvent(objEvent, tmpTitle); + writer.WriteElementString("title", eventTitle); + + string eventDescription = tcc.TokenReplaceEvent(objEvent, tmpDescription); + string txtDescription = HttpUtility.HtmlDecode(eventDescription); + writer.WriteElementString("description", txtDescription); + + string txtURL = objEventInfoHelper.DetailPageURL(objEvent); + writer.WriteElementString("link", txtURL); + writer.WriteElementString("guid", txtURL); + + writer.WriteElementString("pubDate", GetRFC822Date(pubDate, pubTimeZoneId)); + + writer.WriteElementString("dc:creator", objEvent.OwnerName); + + if (objEvent.Category > 0 && !ReferenceEquals(objEvent.Category, null)) + { + writer.WriteElementString("category", objEvent.CategoryName); + } + if (objEvent.Location > 0 && !ReferenceEquals(objEvent.Location, null)) + { + writer.WriteElementString("category", objEvent.LocationName); + } + if ((int)objEvent.Importance != 2) + { + string strImportance = Localization.GetString(objEvent.Importance.ToString() + "Prio", localResourceFile); + writer.WriteElementString("category", strImportance); + } + + // specific event data + writer.WriteElementString(NsPre, "AllDayEvent", null, objEvent.AllDayEvent.ToString()); + writer.WriteElementString(NsPre, "Approved", null, objEvent.Approved.ToString()); + writer.WriteElementString(NsPre, "Cancelled", null, objEvent.Cancelled.ToString()); + writer.WriteElementString(NsPre, "Category", null, objEvent.CategoryName); + //writer.WriteElementString(NsPre, "Location", Nothing, objEvent.LocationName) + writer.WriteElementString(NsPre, "DetailURL", null, objEvent.DetailURL); + writer.WriteElementString(NsPre, "EventTimeBegin", null, objEvent.EventTimeBegin.ToString("yyyy-MM-dd HH:mm:ss")); + writer.WriteElementString(NsPre, "EventTimeZoneId", null, objEvent.EventTimeZoneId); + writer.WriteElementString(NsPre, "Duration", null, objEvent.Duration.ToString()); + writer.WriteElementString(NsPre, "ImageURL", null, objEvent.ImageURL); + writer.WriteElementString(NsPre, "LocationName", null, objEvent.LocationName); + writer.WriteElementString(NsPre, "OriginalDateBegin", null, objEvent.OriginalDateBegin.ToString("yyyy-MM-dd HH:mm:ss")); + writer.WriteElementString(NsPre, "Signups", null, objEvent.Signups.ToString()); + writer.WriteElementString(NsPre, "OtherTimeZoneId", null, objEvent.OtherTimeZoneId); + + writer.WriteEndElement(); + + rssCount++; + if (iMax > 0 & rssCount == iMax) + { + break; + } + } + + writer.WriteEndElement(); + writer.WriteEndElement(); + + Response.Write(sw.ToString()); + } + + } + + + } + + private bool HideFullEvent(EventInfo objevent) + { + EventInfoHelper objEventInfoHelper = new EventInfoHelper(_moduleID, _tabID, _portalID, _settings); + return objEventInfoHelper.HideFullEvent(objevent, _settings.Eventhidefullenroll, _userinfo.UserID, Request.IsAuthenticated); + } + + private static string GetRFC822Date(DateTime date, string inTimeZoneId) + { + TimeZoneInfo inTimeZone = TimeZoneInfo.FindSystemTimeZoneById(inTimeZoneId); + TimeSpan offset = inTimeZone.GetUtcOffset(date); + string timeZone1 = ""; + if (offset.Hours >= 0) + { + timeZone1 = "+"; + } + else + { + timeZone1 = ""; + } + timeZone1 += offset.Hours.ToString("00") + offset.Minutes.ToString("00"); + return date.ToString("ddd, dd MMM yyyy HH:mm:ss " + timeZone1, CultureInfo.InvariantCulture); + } + +#endregion + + } + } + + diff --git a/EventRSS.aspx.designer.cs b/EventRSS.aspx.designer.cs new file mode 100644 index 0000000..4fdc77c --- /dev/null +++ b/EventRSS.aspx.designer.cs @@ -0,0 +1,46 @@ +// VBConversions Note: VB project level imports +using DotNetNuke.UI; +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using DotNetNuke.Entities.Users; +using System.Web.UI; +using System.Drawing; +using DotNetNuke.Framework; +using Microsoft.VisualBasic; +using System.Configuration; +using System.Web.UI.WebControls; +using System.Collections; +using DotNetNuke.Common.Utilities; +//using System.Linq; + using System.Web; +using DotNetNuke.Common; +using System.Web.UI.HtmlControls; +using DotNetNuke.Services.Localization; +using System.Data; +using System; +using DotNetNuke.Data; +using DotNetNuke; +// End of VB project level imports + + + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.1433 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + + + + namespace DotNetNuke.Modules.Events + { + + public partial class EventRSS + { + } + } diff --git a/EventRSS.aspx.designer.vb b/EventRSS.aspx.designer.vb deleted file mode 100644 index 034d9f5..0000000 --- a/EventRSS.aspx.designer.vb +++ /dev/null @@ -1,19 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:2.0.50727.1433 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Namespace DotNetNuke.Modules.Events - - Partial Public Class EventRSS - End Class -End Namespace diff --git a/EventRSS.aspx.vb b/EventRSS.aspx.vb deleted file mode 100644 index 30b7448..0000000 --- a/EventRSS.aspx.vb +++ /dev/null @@ -1,400 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports System.IO -Imports System.Xml -Imports System.Text -Imports System.Globalization -Imports DotNetNuke.Entities.Portals -Imports DotNetNuke.Security - -Namespace DotNetNuke.Modules.Events - Partial Class EventRSS - Inherits Page - -#Region "Private Variables" - Private _moduleID As Integer - Private _tabID As Integer - Private _portalID As Integer - Private _settings As EventModuleSettings - Private _userinfo As UserInfo - Private Const NsPre As String = "e" - Private Const NsFull As String = "http://www.dnnsoftware.com/dnnevents" -#End Region -#Region " Web Form Designer Generated Code " - - 'This call is required by the Web Form Designer. - Private Sub InitializeComponent() - - End Sub - - Private Sub Page_Init(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Init - 'CODEGEN: This method call is required by the Web Form Designer - 'Do not modify it using the code editor. - InitializeComponent() - End Sub - -#End Region - -#Region "Event Handlers" - Private Sub Page_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load - Dim iDaysBefore, iDaysAfter, iMax, iOwnerID, iLocationID, iImportance As Integer - Dim categoryIDs As New ArrayList - Dim locationIDs As New ArrayList - Dim iGroupId As Integer = -1 - Dim iUserId As Integer = -1 - Dim iCategoryName As String = "" - Dim iLocationName As String = "" - Dim iOwnerName As String = "" - Dim txtPriority As String = "" - If Not HttpContext.Current.Request.QueryString("Mid") = "" Then - _moduleID = CType(HttpContext.Current.Request.QueryString("mid"), Integer) - Else - Response.Redirect(NavigateURL(), True) - End If - If Not HttpContext.Current.Request.QueryString("tabid") = "" Then - _tabID = CType(HttpContext.Current.Request.QueryString("tabid"), Integer) - Else - Response.Redirect(NavigateURL(), True) - End If - - Dim localResourceFile As String = TemplateSourceDirectory & "/" & Localization.LocalResourceDirectory & "/EventRSS.aspx.resx" - - If Not HttpContext.Current.Request.QueryString("CategoryName") = "" Then - iCategoryName = HttpContext.Current.Request.QueryString("CategoryName") - Dim objSecurity As New PortalSecurity - iCategoryName = objSecurity.InputFilter(iCategoryName, PortalSecurity.FilterFlag.NoSQL) - End If - If Not HttpContext.Current.Request.QueryString("CategoryID") = "" Then - categoryIDs.Add(CType(HttpContext.Current.Request.QueryString("CategoryID"), Integer)) - End If - If Not HttpContext.Current.Request.QueryString("LocationName") = "" Then - iLocationName = HttpContext.Current.Request.QueryString("LocationName") - Dim objSecurity As New PortalSecurity - iLocationName = objSecurity.InputFilter(iLocationName, PortalSecurity.FilterFlag.NoSQL) - End If - If Not HttpContext.Current.Request.QueryString("LocationID") = "" Then - locationIDs.Add(CType(HttpContext.Current.Request.QueryString("LocationID"), Integer)) - End If - If Not HttpContext.Current.Request.QueryString("groupid") = "" Then - iGroupId = CType(HttpContext.Current.Request.QueryString("groupid"), Integer) - End If - If Not HttpContext.Current.Request.QueryString("DaysBefore") = "" Then - iDaysBefore = CType(HttpContext.Current.Request.QueryString("DaysBefore"), Integer) - End If - If Not HttpContext.Current.Request.QueryString("DaysAfter") = "" Then - iDaysAfter = CType(HttpContext.Current.Request.QueryString("DaysAfter"), Integer) - End If - If Not HttpContext.Current.Request.QueryString("MaxNumber") = "" Then - iMax = CType(HttpContext.Current.Request.QueryString("MaxNumber"), Integer) - End If - If Not HttpContext.Current.Request.QueryString("OwnerName") = "" Then - iOwnerName = HttpContext.Current.Request.QueryString("OwnerName") - End If - If Not HttpContext.Current.Request.QueryString("OwnerID") = "" Then - iOwnerID = CType(HttpContext.Current.Request.QueryString("OwnerID"), Integer) - End If - If Not HttpContext.Current.Request.QueryString("LocationName") = "" Then - iLocationName = HttpContext.Current.Request.QueryString("LocationName") - End If - If Not HttpContext.Current.Request.QueryString("LocationID") = "" Then - iLocationID = CType(HttpContext.Current.Request.QueryString("LocationID"), Integer) - End If - If Not HttpContext.Current.Request.QueryString("Priority") = "" Then - Dim iPriority As String - iPriority = HttpContext.Current.Request.QueryString("Priority") - Dim lHigh, lMedium, lLow As String - lHigh = Localization.GetString("High", localResourceFile) - lMedium = Localization.GetString("Normal", localResourceFile) - lLow = Localization.GetString("Low", localResourceFile) - - txtPriority = "Medium" - Select Case iPriority - Case lHigh - txtPriority = "High" - Case lMedium - txtPriority = "Medium" - Case lLow - txtPriority = "Low" - Case "High" - txtPriority = "High" - Case "Normal" - txtPriority = "Medium" - Case "Low" - txtPriority = "Low" - End Select - End If - If Not HttpContext.Current.Request.QueryString("Importance") = "" Then - iImportance = CType(HttpContext.Current.Request.QueryString("Importance"), Integer) - End If - - Dim portalSettings As PortalSettings = CType(HttpContext.Current.Items("PortalSettings"), PortalSettings) - _portalID = portalSettings.PortalId - _userinfo = CType(HttpContext.Current.Items("UserInfo"), UserInfo) - If Not portalSettings Is Nothing Then - If portalSettings.DefaultLanguage <> "" Then - Dim userculture As New CultureInfo(portalSettings.DefaultLanguage, False) - Threading.Thread.CurrentThread.CurrentCulture = userculture - End If - End If - If _userinfo.UserID > 0 Then - If _userinfo.Profile.PreferredLocale <> "" Then - Dim userculture As New CultureInfo(_userinfo.Profile.PreferredLocale, False) - Threading.Thread.CurrentThread.CurrentCulture = userculture - End If - End If - - Dim ems As New EventModuleSettings - _settings = ems.GetEventModuleSettings(_moduleID, localResourceFile) - - If _settings.Enablecategories = EventModuleSettings.DisplayCategories.DoNotDisplay Then - categoryIDs = _settings.ModuleCategoryIDs - iCategoryName = "" - End If - If iCategoryName <> "" Then - Dim oCntrlEventCategory As New EventCategoryController - Dim oEventCategory As EventCategoryInfo = oCntrlEventCategory.EventCategoryGetByName(iCategoryName, _portalID) - If Not oEventCategory Is Nothing Then - categoryIDs.Add(oEventCategory.Category) - End If - End If - If _settings.Enablelocations = EventModuleSettings.DisplayLocations.DoNotDisplay Then - locationIDs = _settings.ModuleLocationIDs - iLocationName = "" - End If - If iLocationName <> "" Then - Dim oCntrlEventLocation As New EventLocationController - Dim oEventLocation As EventLocationInfo = oCntrlEventLocation.EventsLocationGetByName(iLocationName, _portalID) - If Not oEventLocation Is Nothing Then - locationIDs.Add(oEventLocation.Location) - End If - End If - - If Not _settings.RSSEnable Then - Response.Redirect(NavigateURL(), True) - End If - - If _settings.SocialGroupModule = EventModuleSettings.SocialModule.UserProfile Then - iUserId = _userinfo.UserID - End If - Dim getSubEvents As Boolean = _settings.MasterEvent - - Dim dtEndDate As DateTime - If HttpContext.Current.Request.QueryString("DaysAfter") = "" And _ - HttpContext.Current.Request.QueryString("DaysBefore") = "" Then - iDaysAfter = _settings.RSSDays - End If - Dim objEventTimeZoneUtilities As New EventTimeZoneUtilities - Dim currDate As DateTime = objEventTimeZoneUtilities.ConvertFromUTCToModuleTimeZone(Date.UtcNow, _settings.TimeZoneId) - - dtEndDate = DateAdd(DateInterval.Day, iDaysAfter, currDate).Date - - Dim dtStartDate As DateTime - dtStartDate = DateAdd(DateInterval.Day, -iDaysBefore, currDate).Date - - Dim txtFeedRootTitle, txtFeedRootDescription, txtRSSDateField As String - txtFeedRootTitle = _settings.RSSTitle - txtFeedRootDescription = _settings.RSSDesc - txtRSSDateField = _settings.RSSDateField - - Response.ContentType = "text/xml" - Response.ContentEncoding = Encoding.UTF8 - - - Using sw As New StringWriter - Using writer As New XmlTextWriter(sw) - ' Dim writer As XmlTextWriter = New XmlTextWriter(sw) - writer.Formatting = Formatting.Indented - writer.Indentation = 4 - - writer.WriteStartElement("rss") - writer.WriteAttributeString("version", "2.0") - writer.WriteAttributeString("xmlns:wfw", "http://wellformedweb.org/CommentAPI/") - writer.WriteAttributeString("xmlns:slash", "http://purl.org/rss/1.0/modules/slash/") - writer.WriteAttributeString("xmlns:dc", "http://purl.org/dc/elements/1.1/") - writer.WriteAttributeString("xmlns:trackback", "http://madskills.com/public/xml/rss/module/trackback/") - writer.WriteAttributeString("xmlns:atom", "http://www.w3.org/2005/Atom") - writer.WriteAttributeString("xmlns", NsPre, Nothing, NsFull) - - writer.WriteStartElement("channel") - - writer.WriteStartElement("atom:link") - writer.WriteAttributeString("href", HttpContext.Current.Request.Url.AbsoluteUri) - writer.WriteAttributeString("rel", "self") - writer.WriteAttributeString("type", "application/rss+xml") - writer.WriteEndElement() - - writer.WriteElementString("title", portalSettings.PortalName & " - " & txtFeedRootTitle) - - If (portalSettings.PortalAlias.HTTPAlias.IndexOf("http://", StringComparison.Ordinal) = -1) And (portalSettings.PortalAlias.HTTPAlias.IndexOf("https://", StringComparison.Ordinal) = -1) Then - writer.WriteElementString("link", AddHTTP(portalSettings.PortalAlias.HTTPAlias)) - Else - writer.WriteElementString("link", portalSettings.PortalAlias.HTTPAlias) - End If - - writer.WriteElementString("description", txtFeedRootDescription) - writer.WriteElementString("ttl", "60") - - Dim objEventInfoHelper As New EventInfoHelper(_moduleID, _tabID, _portalID, _settings) - Dim lstEvents As ArrayList - Dim tcc As New TokenReplaceControllerClass(_moduleID, localResourceFile) - Dim tmpTitle As String = _settings.Templates.txtRSSTitle - Dim tmpDescription As String = _settings.Templates.txtRSSDescription - If categoryIDs.Count = 0 Then - categoryIDs.Add("-1") - End If - If locationIDs.Count = 0 Then - locationIDs.Add("-1") - End If - - lstEvents = objEventInfoHelper.GetEvents(dtStartDate, dtEndDate, getSubEvents, categoryIDs, locationIDs, iGroupId, iUserId) - - Dim objEventBase As New EventBase - Dim displayTimeZoneId As String = objEventBase.GetDisplayTimeZoneId(_settings, _portalID) - - Dim rssCount As Integer = 0 - For Each objEvent As EventInfo In lstEvents - If CInt(categoryIDs.Item(0)) = 0 And objEvent.Category <> CInt(categoryIDs.Item(0)) Then - Continue For - End If - If CInt(locationIDs.Item(0)) = 0 And objEvent.Location <> CInt(locationIDs.Item(0)) Then - Continue For - End If - If iOwnerID > 0 And objEvent.OwnerID <> iOwnerID Then - Continue For - End If - If iOwnerName <> "" And objEvent.OwnerName <> iOwnerName Then - Continue For - End If - If iLocationID > 0 And objEvent.Location <> iLocationID Then - Continue For - End If - If iLocationName <> "" And objEvent.LocationName <> iLocationName Then - Continue For - End If - If iImportance > 0 And objEvent.Importance <> iImportance Then - Continue For - End If - If txtPriority <> "" And objEvent.Importance.ToString <> txtPriority Then - Continue For - End If - - ' If full enrollments should be hidden, ignore - If HideFullEvent(objEvent) Then - Continue For - End If - - Dim pubDate As DateTime - Dim pubTimeZoneId As String = "" - Select Case txtRSSDateField - Case "UPDATEDDATE" - pubDate = objEvent.LastUpdatedAt - pubTimeZoneId = objEvent.OtherTimeZoneId - Case "CREATIONDATE" - pubDate = objEvent.CreatedDate - pubTimeZoneId = objEvent.OtherTimeZoneId - Case "EVENTDATE" - pubDate = objEvent.EventTimeBegin - pubTimeZoneId = objEvent.EventTimeZoneId - End Select - - objEvent = objEventInfoHelper.ConvertEventToDisplayTimeZone(objEvent, displayTimeZoneId) - - writer.WriteStartElement("item") - Dim eventTitle As String = tcc.TokenReplaceEvent(objEvent, tmpTitle) - writer.WriteElementString("title", eventTitle) - - Dim eventDescription As String = tcc.TokenReplaceEvent(objEvent, tmpDescription) - Dim txtDescription As String = HttpUtility.HtmlDecode(eventDescription) - writer.WriteElementString("description", txtDescription) - - Dim txtURL As String = objEventInfoHelper.DetailPageURL(objEvent) - writer.WriteElementString("link", txtURL) - writer.WriteElementString("guid", txtURL) - - writer.WriteElementString("pubDate", GetRFC822Date(pubDate, pubTimeZoneId)) - - writer.WriteElementString("dc:creator", objEvent.OwnerName) - - If objEvent.Category > 0 And Not IsNothing(objEvent.Category) Then - writer.WriteElementString("category", objEvent.CategoryName) - End If - If objEvent.Location > 0 And Not IsNothing(objEvent.Location) Then - writer.WriteElementString("category", objEvent.LocationName) - End If - If objEvent.Importance <> 2 Then - Dim strImportance As String = Localization.GetString(objEvent.Importance.ToString & "Prio", localResourceFile) - writer.WriteElementString("category", strImportance) - End If - - ' specific event data - writer.WriteElementString(NsPre, "AllDayEvent", Nothing, objEvent.AllDayEvent.ToString) - writer.WriteElementString(NsPre, "Approved", Nothing, objEvent.Approved.ToString) - writer.WriteElementString(NsPre, "Cancelled", Nothing, objEvent.Cancelled.ToString) - writer.WriteElementString(NsPre, "Category", Nothing, objEvent.CategoryName) - 'writer.WriteElementString(NsPre, "Location", Nothing, objEvent.LocationName) - writer.WriteElementString(NsPre, "DetailURL", Nothing, objEvent.DetailURL) - writer.WriteElementString(NsPre, "EventTimeBegin", Nothing, objEvent.EventTimeBegin.ToString("yyyy-MM-dd HH:mm:ss")) - writer.WriteElementString(NsPre, "EventTimeZoneId", Nothing, objEvent.EventTimeZoneId) - writer.WriteElementString(NsPre, "Duration", Nothing, objEvent.Duration.ToString) - writer.WriteElementString(NsPre, "ImageURL", Nothing, objEvent.ImageURL) - writer.WriteElementString(NsPre, "LocationName", Nothing, objEvent.LocationName) - writer.WriteElementString(NsPre, "OriginalDateBegin", Nothing, objEvent.OriginalDateBegin.ToString("yyyy-MM-dd HH:mm:ss")) - writer.WriteElementString(NsPre, "Signups", Nothing, objEvent.Signups.ToString) - writer.WriteElementString(NsPre, "OtherTimeZoneId", Nothing, objEvent.OtherTimeZoneId) - - writer.WriteEndElement() - - rssCount += 1 - If iMax > 0 And rssCount = iMax Then - Exit For - End If - Next - - writer.WriteEndElement() - writer.WriteEndElement() - - Response.Write(sw.ToString) - End Using - End Using - - End Sub - - Private Function HideFullEvent(ByVal objevent As EventInfo) As Boolean - Dim objEventInfoHelper As New EventInfoHelper(_moduleID, _tabID, _portalID, _settings) - Return objEventInfoHelper.HideFullEvent(objevent, _settings.Eventhidefullenroll(), _userinfo.UserID, Request.IsAuthenticated) - End Function - - Private Shared Function GetRFC822Date([date] As DateTime, inTimeZoneId As String) As String - Dim inTimeZone As TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(inTimeZoneId) - Dim offset As TimeSpan = inTimeZone.GetUtcOffset([date]) - Dim timeZone1 As String - If offset.Hours >= 0 Then - timeZone1 = "+" - Else - timeZone1 = "" - End If - timeZone1 += offset.Hours.ToString("00") & offset.Minutes.ToString("00") - Return [date].ToString("ddd, dd MMM yyyy HH:mm:ss " & timeZone1, CultureInfo.InvariantCulture) - End Function - -#End Region - - End Class -End Namespace diff --git a/EventRpt.ascx b/EventRpt.ascx index 7df9951..559170a 100644 --- a/EventRpt.ascx +++ b/EventRpt.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="EventRpt.ascx.vb" Inherits="DotNetNuke.Modules.Events.EventRpt" %> +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EventRpt.ascx.cs" Inherits="DotNetNuke.Modules.Events.EventRpt" %> <%@ Register TagPrefix="evt" TagName="Category" Src="~/DesktopModules/Events/SubControls/SelectCategory.ascx" %> <%@ Register TagPrefix="evt" TagName="Location" Src="~/DesktopModules/Events/SubControls/SelectLocation.ascx" %> <%@ Register TagPrefix="evt" TagName="Icons" Src="~/DesktopModules/Events/SubControls/EventIcons.ascx" %> @@ -9,10 +9,10 @@ ID="toolTipManager" runat="server" HideEvent="LeaveTargetAndToolTip" Modal="False" EnableShadow="True" CssClass="Eventtooltip" ShowCallout="False" />
- +
- +
@@ -20,7 +20,7 @@
- + @@ -33,7 +33,7 @@
- + @@ -54,4 +54,4 @@
- \ No newline at end of file + diff --git a/EventRpt.ascx.cs b/EventRpt.ascx.cs new file mode 100644 index 0000000..cc7f17e --- /dev/null +++ b/EventRpt.ascx.cs @@ -0,0 +1,372 @@ +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Collections; +using System.Web; +using DotNetNuke.Services.Localization; +using System.Data; +using System; + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + + namespace DotNetNuke.Modules.Events + { + + public partial class EventRpt : EventBase + { + +#region Event Handlers + private ArrayList _selectedEvents; + + + private void Page_Load(System.Object sender, EventArgs e) + { + try + { + SetupViewControls(EventIcons, EventIcons2, SelectCategory, SelectLocation); + + if (Page.IsPostBack == false) + { + BindDataGrid(); + } + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } +#endregion + +#region Helper Functions + private int _rptItemCount = 0; + public int PageNumber + { + get + { + if (!ReferenceEquals((ViewState["PageNumber"]), null)) + { + return System.Convert.ToInt32(ViewState["PageNumber"]); + } + else + { + return 0; + } + } + set + { + ViewState["PageNumber"] = value; + } + } + + private void BindDataGrid() + { + //Default sort from settings + SortDirection sortDirection = default(SortDirection); + if (Settings.EventsListSortDirection == "ASC") + { + sortDirection = System.Web.UI.WebControls.SortDirection.Ascending; + } + else + { + sortDirection = System.Web.UI.WebControls.SortDirection.Descending; + } + + EventInfo.SortFilter sortExpression = (EventInfo.SortFilter) (GetListSortExpression(Settings.EventsListSortColumn)); + + // Get Events/Sub-Calendar Events + _selectedEvents = Get_ListView_Events(SelectCategory.SelectedCategory, SelectLocation.SelectedLocation); + + EventInfo.SortExpression = sortExpression; + EventInfo.SortDirection = sortDirection; + _selectedEvents.Sort(); + + TokenReplaceControllerClass tcc = new TokenReplaceControllerClass(ModuleId, LocalResourceFile); + DataTable eventTable = new DataTable("Events"); + eventTable.Columns.Add("EventText", Type.GetType("System.String")); + eventTable.Columns.Add("Tooltip", Type.GetType("System.String")); + + if (Settings.Eventtooltiplist) + { + toolTipManager.TargetControls.Clear(); + } + + DataRow dgRow = default(DataRow); + int clientIdCount = 1; + foreach (EventInfo objEvent in _selectedEvents) + { + dgRow = eventTable.NewRow(); + bool blAddSubModuleName = false; + if (objEvent.ModuleID != ModuleId && objEvent.ModuleTitle != null && Settings.Addsubmodulename) + { + blAddSubModuleName = true; + } + bool isEvtEditor = IsEventEditor(objEvent, false); + string tmpText = Settings.Templates.txtListRptBody; + string tmpTooltip = ""; + if (Settings.Eventtooltiplist) + { + tmpTooltip = ToolTipCreate(objEvent, Settings.Templates.txtTooltipTemplateTitle, Settings.Templates.txtTooltipTemplateBody, isEvtEditor); + dgRow["Tooltip"] = tmpTooltip; + } + if (!Settings.ListViewTable) + { + string tooltip = HttpUtility.HtmlEncode(tmpTooltip); + tmpText = AddTooltip(clientIdCount, tooltip, tmpText); + clientIdCount++; + } + + dgRow["EventText"] = tcc.TokenReplaceEvent(objEvent, tmpText, null, blAddSubModuleName, isEvtEditor); + + eventTable.Rows.Add(dgRow); + } + + PagedDataSource pgEvents = new PagedDataSource(); + DataView dvEvents = new DataView(eventTable); + pgEvents.DataSource = dvEvents; + pgEvents.AllowPaging = true; + pgEvents.PageSize = Settings.RptColumns * Settings.RptRows; + pgEvents.CurrentPageIndex = PageNumber; + if (pgEvents.PageCount > 1) + { + rptTRPager.Visible = true; + ArrayList pages = new ArrayList(); + for (int i = 0; i <= pgEvents.PageCount - 1; i++) + { + pages.Add(i + 1); + } + rptPager.DataSource = pages; + rptPager.DataBind(); + } + else + { + rptTRPager.Visible = false; + } + + if (pgEvents.CurrentPageIndex + 1 < pgEvents.PageCount) + { + _rptItemCount = pgEvents.PageSize; + } + else + { + _rptItemCount = eventTable.Rows.Count - (pgEvents.CurrentPageIndex * pgEvents.PageSize); + } + + rptEvents.DataSource = pgEvents; + rptEvents.DataBind(); + } + +#endregion + +#region Control Events + private void SelectCategory_CategorySelected(object sender, CommandEventArgs e) + { + //Store the other selection(s) too. + SelectLocation.StoreLocations(); + BindDataGrid(); + } + private void SelectLocation_LocationSelected(object sender, CommandEventArgs e) + { + //Store the other selection(s) too. + SelectCategory.StoreCategories(); + BindDataGrid(); + } + + private int _rptCurrentItemCount = 0; + private bool _rptAlternate = true; + + private void rptEvents_ItemDataBound(object sender, RepeaterItemEventArgs e) + { + int rptColumns = Settings.RptColumns; + string columnWidth = "\"" + (System.Convert.ToInt32((double) 100 / Settings.RptColumns)).ToString() + "%\""; + switch (e.Item.ItemType) + { + case ListItemType.Header: + const string rptHeaderTable = "
"; + string rptHeaderStart = ""; + + string rptHeaderBody = Settings.Templates.txtListRptHeader.Replace("[event:repeaterheadertext]", Localization.GetString("TokenListRptHeader", LocalResourceFile)); + rptHeaderBody = rptHeaderBody.Replace("[event:repeaterzeroeventstext]", Localization.GetString("TokenListRptHeaderZeroEvents", LocalResourceFile)); + TokenReplaceControllerClass tcc = new TokenReplaceControllerClass(ModuleId, LocalResourceFile); + if (_rptItemCount == 0) + { + rptHeaderBody = tcc.TokenOneParameter(rptHeaderBody, "IFZEROEVENTS", true); + } + else + { + rptHeaderBody = tcc.TokenOneParameter(rptHeaderBody, "IFZEROEVENTS", false); + } + + Literal rptHeader = (Literal) (e.Item.FindControl("rptHeader")); + if (Settings.ListViewTable) + { + rptHeader.Text = rptHeaderTable; + if (!string.IsNullOrEmpty(rptHeaderBody)) + { + rptHeader.Text = rptHeader.Text + rptHeaderStart + rptHeaderBody + rptHeaderEnd; + } + } + else + { + rptHeader.Text = rptHeaderBody; + } + break; + case ListItemType.Footer: + string rptFooterStart = ""; + const string rptFooterTable = "
"; + const string rptHeaderEnd = "
"; + const string rptFooterEnd = "
"; + string rptFooterBody = Settings.Templates.txtListRptFooter.Replace("[event:repeaterfootertext]", Localization.GetString("TokenListRptFooter", LocalResourceFile)); + Literal rptFooter = (Literal) (e.Item.FindControl("rptFooter")); + if (Settings.ListViewTable) + { + if (!string.IsNullOrEmpty(rptFooterBody)) + { + rptFooter.Text = rptFooterStart + rptFooterBody + rptFooterEnd; + } + rptFooter.Text = rptFooter.Text + rptFooterTable; + } + else + { + rptFooter.Text = rptFooterBody; + } + break; + default: + Literal rptBody = (Literal) (e.Item.FindControl("rptBody")); + string rptRowBody = System.Convert.ToString(DataBinder.Eval(e.Item.DataItem, "EventText")); + _rptCurrentItemCount++; + if (Settings.ListViewTable) + { + string rptBodyStart = ""; + + const string rptBodyEnd = ""; + string rptRowStart = ""; + if ((_rptCurrentItemCount - 1) % rptColumns == 0) + { + _rptAlternate = !_rptAlternate; + string rptCellClass = "RptNormal"; + if (_rptAlternate) + { + rptCellClass = "RptAlternate"; + } + rptRowStart = "" + rptBodyStart; + } + else + { + rptRowStart = rptBodyStart; + } + + string rptRowEnd = ""; + if ((_rptCurrentItemCount) % rptColumns == 0) + { + rptRowEnd = rptBodyEnd + ""; + } + else if (_rptItemCount == _rptCurrentItemCount) + { + // ReSharper disable RedundantAssignment + for (int i = 1; i <= rptColumns - (_rptCurrentItemCount % rptColumns); i++) + { + // ReSharper restore RedundantAssignment + rptRowEnd += ""; + } + rptRowEnd += ""; + } + else + { + rptRowEnd = rptBodyEnd; + } + string tooltip = ""; + if (Settings.Eventtooltiplist) + { + tooltip = HttpUtility.HtmlEncode(System.Convert.ToString(DataBinder.Eval(e.Item.DataItem, "Tooltip"))); + } + rptBody.Text = AddTooltip(_rptCurrentItemCount, tooltip, rptRowStart) + rptRowBody + rptRowEnd; + } + else + { + rptBody.Text = rptRowBody; + } + break; + } + } + + private string AddTooltip(int itemCount, string toolTip, string body) + { + string fullTooltip = ""; + if (Settings.Eventtooltiplist) + { + string ttClientId = "ctlEvents_Mod_" + ModuleId.ToString() + "_RptRowBody_" + itemCount.ToString(); + fullTooltip = "ID=\"" + ttClientId + "\" title=\"" + toolTip + "\""; + toolTipManager.TargetControls.Add(ClientID, true); + } + return body.Replace("[event:repeatertooltip]", fullTooltip); + } + + private void rptPages_ItemDataBound(object sender, RepeaterItemEventArgs e) + { + switch (e.Item.ItemType) + { + case ListItemType.Header: + break; + case ListItemType.Footer: + break; + default: + LinkButton lnkPage = (LinkButton) (e.Item.FindControl("cmdPage")); + if (int.Parse(lnkPage.CommandArgument) == PageNumber + 1) + { + lnkPage.Style.Add("cursor", "text"); + lnkPage.Style.Add("text-decoration", "none"); + lnkPage.Attributes.Add("onclick", "javascript:return false;"); + lnkPage.CssClass = "RptPagerCurrentPage"; + } + break; + } + + } + + private void rptPages_ItemCommand(object source, RepeaterCommandEventArgs e) + { + PageNumber = (System.Convert.ToInt32(e.CommandArgument)) - 1; + BindDataGrid(); + } +#endregion + +#region Web Form Designer Generated Code + //This call is required by the Web Form Designer. + [DebuggerStepThrough()]private void InitializeComponent() + { + + } + + private void Page_Init(System.Object sender, EventArgs e) + { + //CODEGEN: This method call is required by the Web Form Designer + //Do not modify it using the code editor. + InitializeComponent(); + } +#endregion + + } + } + diff --git a/EventRpt.ascx.designer.cs b/EventRpt.ascx.designer.cs new file mode 100644 index 0000000..918c4d7 --- /dev/null +++ b/EventRpt.ascx.designer.cs @@ -0,0 +1,117 @@ +// VBConversions Note: VB project level imports +using DotNetNuke.UI; +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using DotNetNuke.Entities.Users; +using System.Web.UI; +using System.Drawing; +using DotNetNuke.Framework; +using Microsoft.VisualBasic; +using System.Configuration; +using System.Web.UI.WebControls; +using System.Collections; +using DotNetNuke.Common.Utilities; +//using System.Linq; + using System.Web; +using DotNetNuke.Common; +using System.Web.UI.HtmlControls; +using DotNetNuke.Services.Localization; +using System.Data; +using System; +using DotNetNuke.Data; +using DotNetNuke; +// End of VB project level imports + + + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + + + namespace DotNetNuke.Modules.Events + { + + public partial class EventRpt + { + + /// + ///toolTipManager control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Web.UI.WebControls.DnnToolTipManager toolTipManager; + + /// + ///SelectCategory control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.SelectCategory SelectCategory; + + /// + ///SelectLocation control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.SelectLocation SelectLocation; + + /// + ///EventIcons control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.EventIcons EventIcons; + + /// + ///rptEvents control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Repeater rptEvents; + + /// + ///rptTRPager control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl rptTRPager; + + /// + ///rptPager control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Repeater rptPager; + + /// + ///EventIcons2 control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.EventIcons EventIcons2; + } + } + diff --git a/EventRpt.ascx.designer.vb b/EventRpt.ascx.designer.vb deleted file mode 100644 index 5a7e43b..0000000 --- a/EventRpt.ascx.designer.vb +++ /dev/null @@ -1,89 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Namespace DotNetNuke.Modules.Events - - Partial Public Class EventRpt - - ''' - '''toolTipManager control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents toolTipManager As Global.DotNetNuke.Web.UI.WebControls.DnnToolTipManager - - ''' - '''SelectCategory control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents SelectCategory As Global.DotNetNuke.Modules.Events.SelectCategory - - ''' - '''SelectLocation control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents SelectLocation As Global.DotNetNuke.Modules.Events.SelectLocation - - ''' - '''EventIcons control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents EventIcons As Global.DotNetNuke.Modules.Events.EventIcons - - ''' - '''rptEvents control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rptEvents As Global.System.Web.UI.WebControls.Repeater - - ''' - '''rptTRPager control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rptTRPager As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''rptPager control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rptPager As Global.System.Web.UI.WebControls.Repeater - - ''' - '''EventIcons2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents EventIcons2 As Global.DotNetNuke.Modules.Events.EventIcons - End Class -End Namespace diff --git a/EventRpt.ascx.vb b/EventRpt.ascx.vb deleted file mode 100644 index 72cdea0..0000000 --- a/EventRpt.ascx.vb +++ /dev/null @@ -1,292 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports System -Imports System.Web.UI -Imports System.Web.UI.WebControls - -Namespace DotNetNuke.Modules.Events - - Partial Class EventRpt - Inherits EventBase - -#Region "Event Handlers" - Private _selectedEvents As ArrayList - - - Private Sub Page_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load - Try - SetupViewControls(EventIcons, EventIcons2, SelectCategory, SelectLocation) - - If Page.IsPostBack = False Then - BindDataGrid() - End If - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub -#End Region - -#Region "Helper Functions" - Private _rptItemCount As Integer = 0 - Public Property PageNumber() As Integer - Get - If Not (ViewState("PageNumber")) Is Nothing Then - Return CInt(ViewState("PageNumber")) - Else - Return 0 - End If - End Get - Set(ByVal value As Integer) - ViewState("PageNumber") = value - End Set - End Property - - Private Sub BindDataGrid() - 'Default sort from settings - Dim sortDirection As SortDirection - If Settings.EventsListSortDirection = "ASC" Then - sortDirection = sortDirection.Ascending - Else - sortDirection = sortDirection.Descending - End If - - Dim sortExpression As EventInfo.SortFilter = CType(GetListSortExpression(Settings.EventsListSortColumn), EventInfo.SortFilter) - - ' Get Events/Sub-Calendar Events - _selectedEvents = Get_ListView_Events(SelectCategory.SelectedCategory, SelectLocation.SelectedLocation) - - EventInfo.SortExpression = sortExpression - EventInfo.SortDirection = sortDirection - _selectedEvents.Sort() - - Dim tcc As New TokenReplaceControllerClass(ModuleId, LocalResourceFile) - Dim eventTable As DataTable = New DataTable("Events") - With eventTable.Columns - .Add("EventText", Type.GetType("System.String")) - .Add("Tooltip", Type.GetType("System.String")) - End With - - If Settings.Eventtooltiplist Then - toolTipManager.TargetControls.Clear() - End If - - Dim dgRow As DataRow - Dim clientIdCount As Integer = 1 - For Each objEvent As EventInfo In _selectedEvents - dgRow = eventTable.NewRow() - Dim blAddSubModuleName As Boolean = False - If objEvent.ModuleID <> ModuleId And objEvent.ModuleTitle <> Nothing And Settings.Addsubmodulename Then - blAddSubModuleName = True - End If - Dim isEvtEditor As Boolean = IsEventEditor(objEvent, False) - Dim tmpText As String = Settings.Templates.txtListRptBody - Dim tmpTooltip As String = "" - If Settings.Eventtooltiplist Then - tmpTooltip = ToolTipCreate(objEvent, Settings.Templates.txtTooltipTemplateTitle, Settings.Templates.txtTooltipTemplateBody, isEvtEditor) - dgRow("Tooltip") = tmpTooltip - End If - If Not Settings.ListViewTable Then - Dim tooltip As String = HttpUtility.HtmlEncode(tmpTooltip) - tmpText = AddTooltip(clientIdCount, tooltip, tmpText) - clientIdCount += 1 - End If - - dgRow("EventText") = tcc.TokenReplaceEvent(objEvent, tmpText, Nothing, blAddSubModuleName, isEvtEditor) - - eventTable.Rows.Add(dgRow) - Next - - Dim pgEvents As New PagedDataSource - Dim dvEvents As New DataView(eventTable) - pgEvents.DataSource = dvEvents - pgEvents.AllowPaging = True - pgEvents.PageSize = Settings.RptColumns * Settings.RptRows - pgEvents.CurrentPageIndex = PageNumber - If pgEvents.PageCount > 1 Then - rptTRPager.Visible = True - Dim pages As New ArrayList - For i As Integer = 0 To pgEvents.PageCount - 1 - pages.Add(i + 1) - Next - rptPager.DataSource = pages - rptPager.DataBind() - Else - rptTRPager.Visible = False - End If - - If pgEvents.CurrentPageIndex + 1 < pgEvents.PageCount Then - _rptItemCount = pgEvents.PageSize - Else - _rptItemCount = eventTable.Rows.Count - (pgEvents.CurrentPageIndex * pgEvents.PageSize) - End If - - rptEvents.DataSource = pgEvents - rptEvents.DataBind() - End Sub - -#End Region - -#Region "Control Events" - Private Sub SelectCategory_CategorySelected(ByVal sender As Object, ByVal e As CommandEventArgs) Handles SelectCategory.CategorySelectedChanged - 'Store the other selection(s) too. - SelectLocation.StoreLocations() - BindDataGrid() - End Sub - Private Sub SelectLocation_LocationSelected(ByVal sender As Object, ByVal e As CommandEventArgs) Handles SelectLocation.LocationSelectedChanged - 'Store the other selection(s) too. - SelectCategory.StoreCategories() - BindDataGrid() - End Sub - - Private _rptCurrentItemCount As Integer = 0 - Private _rptAlternate As Boolean = True - - Private Sub rptEvents_ItemDataBound(ByVal sender As Object, ByVal e As RepeaterItemEventArgs) Handles rptEvents.ItemDataBound - Dim rptColumns As Integer = Settings.RptColumns - Dim columnWidth As String = """" & CInt(100 / Settings.RptColumns).ToString & "%""" - Select Case e.Item.ItemType - Case ListItemType.Header - Const rptHeaderTable As String = "" - Dim rptHeaderStart As String = "" - - Dim rptHeaderBody As String = Settings.Templates.txtListRptHeader.Replace("[event:repeaterheadertext]", Localization.GetString("TokenListRptHeader", LocalResourceFile)) - rptHeaderBody = rptHeaderBody.Replace("[event:repeaterzeroeventstext]", Localization.GetString("TokenListRptHeaderZeroEvents", LocalResourceFile)) - Dim tcc As New TokenReplaceControllerClass(ModuleId, LocalResourceFile) - If _rptItemCount = 0 Then - rptHeaderBody = tcc.TokenOneParameter(rptHeaderBody, "IFZEROEVENTS", True) - Else - rptHeaderBody = tcc.TokenOneParameter(rptHeaderBody, "IFZEROEVENTS", False) - End If - - Dim rptHeader As Literal = CType(e.Item.FindControl("rptHeader"), Literal) - If Settings.ListViewTable Then - rptHeader.Text = rptHeaderTable - If rptHeaderBody <> "" Then - rptHeader.Text = rptHeader.Text & rptHeaderStart & rptHeaderBody & rptHeaderEnd - End If - Else - rptHeader.Text = rptHeaderBody - End If - Case ListItemType.Footer - Dim rptFooterStart As String = "" - Const rptFooterTable As String = "
" - Const rptHeaderEnd As String = "
" - Const rptFooterEnd As String = "
" - Dim rptFooterBody As String = Settings.Templates.txtListRptFooter.Replace("[event:repeaterfootertext]", Localization.GetString("TokenListRptFooter", LocalResourceFile)) - Dim rptFooter As Literal = CType(e.Item.FindControl("rptFooter"), Literal) - If Settings.ListViewTable Then - If rptFooterBody <> "" Then - rptFooter.Text = rptFooterStart & rptFooterBody & rptFooterEnd - End If - rptFooter.Text = rptFooter.Text & rptFooterTable - Else - rptFooter.Text = rptFooterBody - End If - Case Else - Dim rptBody As Literal = CType(e.Item.FindControl("rptBody"), Literal) - Dim rptRowBody As String = CType(DataBinder.Eval(e.Item.DataItem, "EventText"), String) - _rptCurrentItemCount += 1 - If Settings.ListViewTable Then - Dim rptBodyStart As String = "" - - Const rptBodyEnd As String = "" - Dim rptRowStart As String - If (_rptCurrentItemCount - 1) Mod rptColumns = 0 Then - _rptAlternate = Not _rptAlternate - Dim rptCellClass As String = "RptNormal" - If _rptAlternate Then - rptCellClass = "RptAlternate" - End If - rptRowStart = "" & rptBodyStart - Else - rptRowStart = rptBodyStart - End If - - Dim rptRowEnd As String = "" - If (_rptCurrentItemCount) Mod rptColumns = 0 Then - rptRowEnd = rptBodyEnd & "" - ElseIf _rptItemCount = _rptCurrentItemCount Then - ' ReSharper disable RedundantAssignment - For i As Integer = 1 To rptColumns - (_rptCurrentItemCount Mod rptColumns) - ' ReSharper restore RedundantAssignment - rptRowEnd += "" - Next - rptRowEnd += "" - Else - rptRowEnd = rptBodyEnd - End If - Dim tooltip As String = "" - If Settings.Eventtooltiplist Then - tooltip = HttpUtility.HtmlEncode(CType(DataBinder.Eval(e.Item.DataItem, "Tooltip"), String)) - End If - rptBody.Text = AddTooltip(_rptCurrentItemCount, tooltip, rptRowStart) & rptRowBody & rptRowEnd - Else - rptBody.Text = rptRowBody - End If - End Select - End Sub - - Private Function AddTooltip(ByVal itemCount As Integer, ByVal toolTip As String, ByVal body As String) As String - Dim fullTooltip As String = "" - If Settings.Eventtooltiplist Then - Dim ttClientId As String = "ctlEvents_Mod_" & ModuleId.ToString & "_RptRowBody_" & itemCount.ToString - fullTooltip = "ID=""" & ttClientId & """ title=""" & toolTip & """" - toolTipManager.TargetControls.Add(clientId, True) - End If - Return Replace(Body, "[event:repeatertooltip]", fullTooltip) - End Function - - Private Sub rptPages_ItemDataBound(ByVal sender As Object, ByVal e As RepeaterItemEventArgs) Handles rptPager.ItemDataBound - Select Case e.Item.ItemType - Case ListItemType.Header - Case ListItemType.Footer - Case Else - Dim lnkPage As LinkButton = CType(e.Item.FindControl("cmdPage"), LinkButton) - If CInt(lnkPage.CommandArgument) = PageNumber + 1 Then - lnkPage.Style.Add("cursor", "text") - lnkPage.Style.Add("text-decoration", "none") - lnkPage.Attributes.Add("onclick", "javascript:return false;") - lnkPage.CssClass = "RptPagerCurrentPage" - End If - End Select - - End Sub - - Private Sub rptPages_ItemCommand(ByVal source As Object, ByVal e As RepeaterCommandEventArgs) Handles rptPager.ItemCommand - PageNumber = CInt(e.CommandArgument) - 1 - BindDataGrid() - End Sub -#End Region - -#Region " Web Form Designer Generated Code " - 'This call is required by the Web Form Designer. - Private Sub InitializeComponent() - - End Sub - - Private Sub Page_Init(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Init - 'CODEGEN: This method call is required by the Web Form Designer - 'Do not modify it using the code editor. - InitializeComponent() - End Sub -#End Region - - End Class -End Namespace \ No newline at end of file diff --git a/EventSettings.ascx b/EventSettings.ascx index 24a72b3..ba735f1 100644 --- a/EventSettings.ascx +++ b/EventSettings.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="EventSettings.ascx.vb" Inherits="DotNetNuke.Modules.Events.EventSettings" %> +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EventSettings.ascx.cs" Inherits="DotNetNuke.Modules.Events.EventSettings" %> <%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %> <%@ Register TagPrefix="dnn" TagName="URL" Src="~/controls/URLControl.ascx" %> <%@ Register TagPrefix="dnn" Assembly="DotNetNuke" Namespace="DotNetNuke.UI.WebControls" %> @@ -12,9 +12,30 @@
  • <%=LocalizeString("GeneralSettings")%>
  • <%=LocalizeString("DisplaySettings")%>
  • <%=LocalizeString("EmailandReminderSettings")%>
  • - <% If ddlSocialGroupModule.SelectedValue <> 3 Then%>
  • <%=LocalizeString("EnrollandModSettings")%>
  • <% End If%> - <% If ddlSocialGroupModule.SelectedValue = 1 Then%>
  • <%=LocalizeString("SubcalendarSettings")%>
  • <% End If%> - <% If ddlSocialGroupModule.SelectedValue <> 3 Then%>
  • <%=LocalizeString("SEOandSitemapSettings")%>
  • <% End If%> + <% +if (int.Parse(ddlSocialGroupModule.SelectedValue) != 3) +{ + +%>
  • <%=LocalizeString("EnrollandModSettings")%>
  • <% +} + +%> + <% +if (int.Parse(ddlSocialGroupModule.SelectedValue) == 1) +{ + +%>
  • <%=LocalizeString("SubcalendarSettings")%>
  • <% +} + +%> + <% +if (int.Parse(ddlSocialGroupModule.SelectedValue) != 3) +{ + +%>
  • <%=LocalizeString("SEOandSitemapSettings")%>
  • <% +} + +%>
  • <%=LocalizeString("IntegrationSettings")%>
  • <%=LocalizeString("TemplateSettings")%>
  • @@ -48,12 +69,19 @@
    - <% If ddlSocialGroupModule.SelectedValue = 1 Then%> + <% +if (int.Parse(ddlSocialGroupModule.SelectedValue) == 1) +{ + +%>
    - <% End If%> + <% +} + +%>
      @@ -404,12 +432,12 @@ @@ -419,12 +447,12 @@
    - +
    - +
    - +
    - +
    @@ -570,7 +598,11 @@

    <%=LocalizeString("EventEmailSettings")%>

    - <% If ddlSocialGroupModule.SelectedValue = 1 Then%> + <% +if (int.Parse(ddlSocialGroupModule.SelectedValue) == 1) +{ + +%>
    @@ -589,7 +621,10 @@
    - <% End If%> + <% +} + +%>
    @@ -623,7 +658,11 @@
    - <% If ddlSocialGroupModule.SelectedValue <> 3 Then%> + <% +if (int.Parse(ddlSocialGroupModule.SelectedValue) != 3) +{ + +%>
    - <% End If%> - <% If ddlSocialGroupModule.SelectedValue = 1 Then%> + <% +} + +%> + <% +if (int.Parse(ddlSocialGroupModule.SelectedValue) == 1) +{ + +%>
    - +
    @@ -941,12 +987,12 @@ @@ -956,12 +1002,12 @@
    - +
    - +
    - +
    - +
    @@ -976,8 +1022,15 @@
    - <% End If%> - <% If Not ddlSocialGroupModule.SelectedValue = 3 Then%> + <% +} + +%> + <% +if (!(int.Parse(ddlSocialGroupModule.SelectedValue) == 3)) +{ + +%>

    <%=LocalizeString("SEOSettings")%>

    @@ -1018,7 +1071,10 @@
    - <% End If%> + <% +} + +%>

    <%=LocalizeString("RSSSettings")%>

    @@ -1147,7 +1203,7 @@
    Help - +
    @@ -1155,8 +1211,8 @@
    -   -   +   +        Template Updated
    @@ -1164,8 +1220,8 @@
      -
    • -
    • +
    • +
    @@ -1186,3 +1242,4 @@ }); } (jQuery, window.Sys)); + diff --git a/EventSettings.ascx.cs b/EventSettings.ascx.cs new file mode 100644 index 0000000..0064b58 --- /dev/null +++ b/EventSettings.ascx.cs @@ -0,0 +1,1874 @@ +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using Microsoft.VisualBasic; +using System.Web.UI.WebControls; +using System.Collections; +using System.Web; +using DotNetNuke.Services.Localization; +using System; +using DotNetNuke.Entities.Tabs; +using DotNetNuke.Entities.Modules; +using DotNetNuke.Web.UI.WebControls.Extensions; + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events +{ + + [DNNtc.ModuleControlProperties("EventSettings", "Event Settings", DNNtc.ControlType.View, "https://github.com/DNNCommunity/DNN.Events/wiki", true, true)] + public partial class EventSettings : EventBase + { + + #region Web Form Designer Generated Code + //This call is required by the Web Form Designer. + [DebuggerStepThrough()] + private void InitializeComponent() + { + } + + private void Page_Init(System.Object sender, EventArgs e) + { + //CODEGEN: This method call is required by the Web Form Designer + //Do not modify it using the code editor. + InitializeComponent(); + } + #endregion + + #region Private Data + private EventMasterController _objCtlMasterEvent = new EventMasterController(); + #endregion + + #region Help Methods + // If adding new Setting also see 'SetDefaultModuleSettings' method in EventInfoHelper Class + + /// + /// Load current settings into the controls from the modulesettings + /// + /// + private void Page_Load(System.Object sender, EventArgs e) + { + if (Security.PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString()) || + IsSettingsEditor()) + { + } + else + { + Response.Redirect(GetSocialNavigateUrl(), true); + } + + // Set the selected theme + SetTheme(pnlEventsModuleSettings); + + // Do we have to load the settings + if (!Page.IsPostBack) + { + LoadSettings(); + } + + // Add the javascript to the page + AddJavaScript(); + + } + + private void LoadSettings() + { + + ArrayList availableFields = new ArrayList(); + ArrayList selectedFields = new ArrayList(); + + // Create Lists and Schedule - they should always exist + EventController objEventController = new EventController(); + objEventController.CreateListsAndSchedule(); + + //Set text and tooltip from resourcefile + chkMonthAllowed.Text = Localization.GetString("Month", LocalResourceFile); + chkWeekAllowed.Text = Localization.GetString("Week", LocalResourceFile); + chkListAllowed.Text = Localization.GetString("List", LocalResourceFile); + cmdAdd.ToolTip = Localization.GetString("Add", LocalResourceFile); + cmdAddAll.ToolTip = Localization.GetString("AddAll", LocalResourceFile); + cmdRemove.ToolTip = Localization.GetString("Remove", LocalResourceFile); + cmdRemoveAll.ToolTip = Localization.GetString("RemoveAll", LocalResourceFile); + cmdAddCals.ToolTip = Localization.GetString("AddCals", LocalResourceFile); + cmdAddAllCals.ToolTip = Localization.GetString("AddAllCals", LocalResourceFile); + cmdRemoveCals.ToolTip = Localization.GetString("RemoveCals", LocalResourceFile); + cmdRemoveAllCals.ToolTip = Localization.GetString("RemoveAllCals", LocalResourceFile); + chkIconMonthPrio.Text = Localization.GetString("Priority", LocalResourceFile); + imgIconMonthPrioHigh.AlternateText = Localization.GetString("HighPrio", LocalResourceFile); + imgIconMonthPrioLow.AlternateText = Localization.GetString("LowPrio", LocalResourceFile); + chkIconMonthRec.Text = Localization.GetString("Recurring", LocalResourceFile); + imgIconMonthRec.AlternateText = Localization.GetString("RecurringEvent", LocalResourceFile); + chkIconMonthReminder.Text = Localization.GetString("Reminder", LocalResourceFile); + imgIconMonthReminder.AlternateText = Localization.GetString("ReminderEnabled", LocalResourceFile); + chkIconMonthEnroll.Text = Localization.GetString("Enroll", LocalResourceFile); + imgIconMonthEnroll.AlternateText = Localization.GetString("EnrollEnabled", LocalResourceFile); + chkIconWeekPrio.Text = Localization.GetString("Priority", LocalResourceFile); + imgIconWEEKPrioHigh.AlternateText = Localization.GetString("HighPrio", LocalResourceFile); + imgIconWeekPrioLow.AlternateText = Localization.GetString("LowPrio", LocalResourceFile); + chkIconWeekRec.Text = Localization.GetString("Recurring", LocalResourceFile); + imgIconWeekRec.AlternateText = Localization.GetString("RecurringEvent", LocalResourceFile); + chkIconWeekReminder.Text = Localization.GetString("Reminder", LocalResourceFile); + imgIconWeekReminder.AlternateText = Localization.GetString("ReminderEnabled", LocalResourceFile); + chkIconWeekEnroll.Text = Localization.GetString("Enroll", LocalResourceFile); + imgIconWeekEnroll.AlternateText = Localization.GetString("EnrollEnabled", LocalResourceFile); + chkIconListPrio.Text = Localization.GetString("Priority", LocalResourceFile); + imgIconListPrioHigh.AlternateText = Localization.GetString("HighPrio", LocalResourceFile); + imgIconListPrioLow.AlternateText = Localization.GetString("LowPrio", LocalResourceFile); + chkIconListRec.Text = Localization.GetString("Recurring", LocalResourceFile); + imgIconListRec.AlternateText = Localization.GetString("RecurringEvent", LocalResourceFile); + chkIconListReminder.Text = Localization.GetString("Reminder", LocalResourceFile); + imgIconListReminder.AlternateText = Localization.GetString("ReminderEnabled", LocalResourceFile); + chkIconListEnroll.Text = Localization.GetString("Enroll", LocalResourceFile); + imgIconListEnroll.AlternateText = Localization.GetString("EnrollEnabled", LocalResourceFile); + cmdUpdateTemplate.Text = Localization.GetString("cmdUpdateTemplate", LocalResourceFile); + rbThemeStandard.Text = Localization.GetString("rbThemeStandard", LocalResourceFile); + rbThemeCustom.Text = Localization.GetString("rbThemeCustom", LocalResourceFile); + ddlModuleCategories.EmptyMessage = Localization.GetString("NoCategories", LocalResourceFile); + ddlModuleCategories.Localization.AllItemsCheckedString = Localization.GetString("AllCategories", LocalResourceFile); + ddlModuleCategories.Localization.CheckAllString = Localization.GetString("SelectAllCategories", LocalResourceFile); + ddlModuleLocations.EmptyMessage = Localization.GetString("NoLocations", LocalResourceFile); + ddlModuleLocations.Localization.AllItemsCheckedString = Localization.GetString("AllLocations", LocalResourceFile); + ddlModuleLocations.Localization.CheckAllString = Localization.GetString("SelectAllLocations", LocalResourceFile); + + + //Add templates link + // lnkTemplatesHelp.HRef = AddSkinContainerControls(EditUrl("", "", "TemplateHelp", "dnnprintmode=true"), "?") + lnkTemplatesHelp.HRef = AddSkinContainerControls(DotNetNuke.Common.Globals.NavigateURL(TabId, PortalSettings, "", "mid=" + System.Convert.ToString(ModuleId), "ctl=TemplateHelp", "ShowNav=False", "dnnprintmode=true"), "?"); + lnkTemplatesHelp.InnerText = Localization.GetString("TemplatesHelp", LocalResourceFile); + + //Support for Time Interval Dropdown + DotNetNuke.Common.Lists.ListController ctlLists = new DotNetNuke.Common.Lists.ListController(); + System.Collections.Generic.IEnumerable colThreadStatus = ctlLists.GetListEntryInfoItems("Timeinterval"); + ddlTimeInterval.Items.Clear(); + + foreach (DotNetNuke.Common.Lists.ListEntryInfo entry in colThreadStatus) + { + ddlTimeInterval.Items.Add(entry.Value); + } + ddlTimeInterval.Items.FindByValue(Settings.Timeinterval).Selected = true; + + // Set Dropdown TimeZone + cboTimeZone.DataBind(Settings.TimeZoneId); + + chkEnableEventTimeZones.Checked = Settings.EnableEventTimeZones; + + BindToEnum(typeof(EventModuleSettings.TimeZones), ddlPrimaryTimeZone); + ddlPrimaryTimeZone.Items.FindByValue(System.Convert.ToString((int)Settings.PrimaryTimeZone)).Selected = true; + BindToEnum(typeof(EventModuleSettings.TimeZones), ddlSecondaryTimeZone); + ddlSecondaryTimeZone.Items.FindByValue(System.Convert.ToString((int)Settings.SecondaryTimeZone)).Selected = true; + + chkToolTipMonth.Checked = Settings.Eventtooltipmonth; + chkToolTipWeek.Checked = Settings.Eventtooltipweek; + chkToolTipDay.Checked = Settings.Eventtooltipday; + chkToolTipList.Checked = Settings.Eventtooltiplist; + txtTooltipLength.Text = Settings.Eventtooltiplength.ToString(); + chkImageEnabled.Checked = Settings.Eventimage; + txtMaxThumbHeight.Text = Settings.MaxThumbHeight.ToString(); + txtMaxThumbWidth.Text = Settings.MaxThumbWidth.ToString(); + + chkMonthCellEvents.Checked = true; + if (Settings.Monthcellnoevents) + { + chkMonthCellEvents.Checked = false; + } + + chkAddSubModuleName.Checked = Settings.Addsubmodulename; + chkEnforceSubCalPerms.Checked = Settings.Enforcesubcalperms; + + BindToEnum(typeof(EventModuleSettings.DisplayCategories), ddlEnableCategories); + ddlEnableCategories.Items.FindByValue(System.Convert.ToString((int)Settings.Enablecategories)).Selected = true; + chkRestrictCategories.Checked = Settings.Restrictcategories; + BindToEnum(typeof(EventModuleSettings.DisplayLocations), ddlEnableLocations); + ddlEnableLocations.Items.FindByValue(System.Convert.ToString((int)Settings.Enablelocations)).Selected = true; + chkRestrictLocations.Checked = Settings.Restrictlocations; + + chkEnableContainerSkin.Checked = Settings.Enablecontainerskin; + chkEventDetailNewPage.Checked = Settings.Eventdetailnewpage; + chkEnableEnrollPopup.Checked = Settings.Enableenrollpopup; + chkEventImageMonth.Checked = Settings.EventImageMonth; + chkEventImageWeek.Checked = Settings.EventImageWeek; + chkEventDayNewPage.Checked = Settings.Eventdaynewpage; + chkFullTimeScale.Checked = Settings.Fulltimescale; + chkCollapseRecurring.Checked = Settings.Collapserecurring; + chkIncludeEndValue.Checked = Settings.Includeendvalue; + chkShowValueMarks.Checked = Settings.Showvaluemarks; + + chkEnableSEO.Checked = Settings.EnableSEO; + txtSEODescriptionLength.Text = Settings.SEODescriptionLength.ToString(); + + chkEnableSitemap.Checked = Settings.EnableSitemap; + txtSitemapPriority.Text = Settings.SiteMapPriority.ToString(); + txtSitemapDaysBefore.Text = Settings.SiteMapDaysBefore.ToString(); + txtSitemapDaysAfter.Text = Settings.SiteMapDaysAfter.ToString(); + + chkiCalOnIconBar.Checked = Settings.IcalOnIconBar; + chkiCalEmailEnable.Checked = Settings.IcalEmailEnable; + chkiCalURLinLocation.Checked = Settings.IcalURLInLocation; + chkiCalIncludeCalname.Checked = Settings.IcalIncludeCalname; + txtiCalDaysBefore.Text = Settings.IcalDaysBefore.ToString(); + txtiCalDaysAfter.Text = Settings.IcalDaysAfter.ToString(); + txtiCalURLAppend.Text = Settings.IcalURLAppend; + ctliCalDefaultImage.FileFilter = DotNetNuke.Common.Globals.glbImageFileTypes; + ctliCalDefaultImage.Url = ""; + chkiCalDisplayImage.Checked = false; + if (Settings.IcalDefaultImage != "") + { + ctliCalDefaultImage.Url = Settings.IcalDefaultImage.Substring(6); + chkiCalDisplayImage.Checked = true; + } + if (ctliCalDefaultImage.Url.StartsWith("FileID=")) + { + int fileId = int.Parse(System.Convert.ToString(ctliCalDefaultImage.Url.Substring(7))); + Services.FileSystem.IFileInfo objFileInfo = Services.FileSystem.FileManager.Instance.GetFile(fileId); + if (!ReferenceEquals(objFileInfo, null)) + { + ctliCalDefaultImage.Url = objFileInfo.Folder + objFileInfo.FileName; + } + else + { + ctliCalDefaultImage.Url = ""; + } + } + int socialGroupId = GetUrlGroupId(); + string socialGroupStr = ""; + if (socialGroupId > 0) + { + socialGroupStr = "&groupid=" + socialGroupId.ToString(); + } + lbliCalURL.Text = DotNetNuke.Common.Globals.AddHTTP(PortalSettings.PortalAlias.HTTPAlias + "/DesktopModules/Events/EventVCal.aspx?ItemID=0&Mid=" + System.Convert.ToString(ModuleId) + "&tabid=" + System.Convert.ToString(TabId) + socialGroupStr); + + // Set Up Themes + LoadThemes(); + + txtPayPalURL.Text = Settings.Paypalurl; + + chkEnableEventNav.Checked = true; + if (Settings.DisableEventnav) + { + chkEnableEventNav.Checked = false; + } + + chkAllowRecurring.Checked = Settings.Allowreoccurring; + txtMaxRecurrences.Text = Settings.Maxrecurrences.ToString(); + chkEventNotify.Checked = Settings.Eventnotify; + chkDetailPageAllowed.Checked = Settings.DetailPageAllowed; + chkEnrollmentPageAllowed.Checked = Settings.EnrollmentPageAllowed; + txtEnrollmentPageDefaultURL.Text = Settings.EnrollmentPageDefaultUrl; + chkNotifyAnon.Checked = Settings.Notifyanon; + chkSendReminderDefault.Checked = Settings.Sendreminderdefault; + + rblNewEventEmail.Items[0].Selected = true; + switch (Settings.Neweventemails) + { + case "Subscribe": + rblNewEventEmail.Items[1].Selected = true; + break; + case "Role": + rblNewEventEmail.Items[2].Selected = true; + break; + } + + LoadNewEventEmailRoles(Settings.Neweventemailrole); + chkNewPerEventEmail.Checked = Settings.Newpereventemail; + + ddlDefaultView.Items.Clear(); + ddlDefaultView.Items.Add(new ListItem(Localization.GetString("Month", LocalResourceFile), "EventMonth.ascx")); + ddlDefaultView.Items.Add(new ListItem(Localization.GetString("Week", LocalResourceFile), "EventWeek.ascx")); + ddlDefaultView.Items.Add(new ListItem(Localization.GetString("List", LocalResourceFile), "EventList.ascx")); + + ddlDefaultView.Items.FindByValue(Settings.DefaultView).Selected = true; + + chkMonthAllowed.Checked = Settings.MonthAllowed; + chkWeekAllowed.Checked = Settings.WeekAllowed; + chkListAllowed.Checked = Settings.ListAllowed; + chkEnableSearch.Checked = Settings.Eventsearch; + chkPreventConflicts.Checked = Settings.Preventconflicts; + chkLocationConflict.Checked = Settings.Locationconflict; + chkShowEventsAlways.Checked = Settings.ShowEventsAlways; + chkTimeInTitle.Checked = Settings.Timeintitle; + chkMonthDaySelect.Checked = Settings.Monthdayselect; + chkEventSignup.Checked = Settings.Eventsignup; + chkEventSignupAllowPaid.Checked = Settings.Eventsignupallowpaid; + chkDefaultEnrollView.Checked = Settings.Eventdefaultenrollview; + chkHideFullEnroll.Checked = Settings.Eventhidefullenroll; + txtMaxNoEnrolees.Text = Settings.Maxnoenrolees.ToString(); + txtCancelDays.Text = Settings.Enrolcanceldays.ToString(); + chkFridayWeekend.Checked = Settings.Fridayweekend; + chkModerateAll.Checked = Settings.Moderateall; + chkTZDisplay.Checked = Settings.Tzdisplay; + chkListViewUseTime.Checked = Settings.ListViewUseTime; + + txtPayPalAccount.Text = Settings.Paypalaccount; + if (txtPayPalAccount.Text.Length == 0) + { + txtPayPalAccount.Text = PortalSettings.Email; + } + + txtReminderFrom.Text = Settings.Reminderfrom; + if (txtReminderFrom.Text.Length == 0) + { + txtReminderFrom.Text = PortalSettings.Email; + } + + txtStandardEmail.Text = Settings.StandardEmail; + if (txtStandardEmail.Text.Length == 0) + { + txtStandardEmail.Text = PortalSettings.Email; + } + + BindSubEvents(); + BindAvailableEvents(); + + chkMasterEvent.Checked = Settings.MasterEvent; + + Enable_Disable_Cals(); + + chkIconMonthPrio.Checked = Settings.IconMonthPrio; + chkIconWeekPrio.Checked = Settings.IconWeekPrio; + chkIconListPrio.Checked = Settings.IconListPrio; + chkIconMonthRec.Checked = Settings.IconMonthRec; + chkIconWeekRec.Checked = Settings.IconMonthRec; + chkIconListRec.Checked = Settings.IconListRec; + chkIconMonthReminder.Checked = Settings.IconMonthReminder; + chkIconWeekReminder.Checked = Settings.IconWeekReminder; + chkIconListReminder.Checked = Settings.IconListReminder; + chkIconMonthEnroll.Checked = Settings.IconMonthEnroll; + chkIconWeekEnroll.Checked = Settings.IconWeekEnroll; + chkIconListEnroll.Checked = Settings.IconListEnroll; + txtPrivateMessage.Text = Settings.PrivateMessage; + + int columnNo = 0; + for (columnNo = 1; columnNo <= 13; columnNo++) + { + string columnAcronym = GetListColumnAcronym(columnNo); + string columnName = GetListColumnName(columnAcronym); + if (Settings.EventsListFields.LastIndexOf(columnAcronym, StringComparison.Ordinal) > -1) + { + selectedFields.Add(columnName); + } + else + { + availableFields.Add(columnName); + } + } + + lstAvailable.DataSource = availableFields; + lstAvailable.DataBind(); + Sort(lstAvailable); + + lstAssigned.DataSource = selectedFields; + lstAssigned.DataBind(); + Sort(lstAssigned); + + if (Settings.EventsListSelectType == rblSelectionTypeDays.Value) + { + rblSelectionTypeDays.Checked = true; + rblSelectionTypeEvents.Checked = false; + } + else + { + rblSelectionTypeDays.Checked = false; + rblSelectionTypeEvents.Checked = true; + } + + if (Settings.ListViewGrid) + { + rblListViewGrid.Items[0].Selected = true; + } + else + { + rblListViewGrid.Items[1].Selected = true; + } + chkListViewTable.Checked = Settings.ListViewTable; + txtRptColumns.Text = Settings.RptColumns.ToString(); + txtRptRows.Text = Settings.RptRows.ToString(); + + // Do we have to display the EventsList header + if (Settings.EventsListShowHeader != "No") + { + rblShowHeader.Items[0].Selected = true; + } + else + { + rblShowHeader.Items[1].Selected = true; + } + + txtDaysBefore.Text = Settings.EventsListBeforeDays.ToString(); + txtDaysAfter.Text = Settings.EventsListAfterDays.ToString(); + txtNumEvents.Text = Settings.EventsListNumEvents.ToString(); + txtEventDays.Text = Settings.EventsListEventDays.ToString(); + chkRestrictCategoriesToTimeFrame.Checked = Settings.RestrictCategoriesToTimeFrame; + chkRestrictLocationsToTimeFrame.Checked = Settings.RestrictLocationsToTimeFrame; + + chkCustomField1.Checked = Settings.EventsCustomField1; + chkCustomField2.Checked = Settings.EventsCustomField2; + + ddlPageSize.Items.FindByValue(Convert.ToString(Settings.EventsListPageSize)).Selected = true; + ddlListSortedFieldDirection.Items.Clear(); + ddlListSortedFieldDirection.Items.Add(new ListItem(Localization.GetString("Asc", LocalResourceFile), "ASC")); + ddlListSortedFieldDirection.Items.Add(new ListItem(Localization.GetString("Desc", LocalResourceFile), "DESC")); + ddlListSortedFieldDirection.Items.FindByValue(Settings.EventsListSortDirection).Selected = true; + + ddlListDefaultColumn.Items.Clear(); + ddlListDefaultColumn.Items.Add(new ListItem(Localization.GetString("SortEventID", LocalResourceFile), "EventID")); + ddlListDefaultColumn.Items.Add(new ListItem(Localization.GetString("SortEventDateBegin", LocalResourceFile), "EventDateBegin")); + ddlListDefaultColumn.Items.Add(new ListItem(Localization.GetString("SortEventDateEnd", LocalResourceFile), "EventDateEnd")); + ddlListDefaultColumn.Items.Add(new ListItem(Localization.GetString("SortEventName", LocalResourceFile), "EventName")); + ddlListDefaultColumn.Items.Add(new ListItem(Localization.GetString("SortDuration", LocalResourceFile), "Duration")); + ddlListDefaultColumn.Items.Add(new ListItem(Localization.GetString("SortCategoryName", LocalResourceFile), "CategoryName")); + ddlListDefaultColumn.Items.Add(new ListItem(Localization.GetString("SortCustomField1", LocalResourceFile), "CustomField1")); + ddlListDefaultColumn.Items.Add(new ListItem(Localization.GetString("SortCustomField2", LocalResourceFile), "CustomField2")); + ddlListDefaultColumn.Items.Add(new ListItem(Localization.GetString("SortDescription", LocalResourceFile), "Description")); + ddlListDefaultColumn.Items.Add(new ListItem(Localization.GetString("SortLocationName", LocalResourceFile), "LocationName")); + ddlListDefaultColumn.Items.FindByValue(Settings.EventsListSortColumn).Selected = true; + + ddlWeekStart.Items.Clear(); + ddlWeekStart.Items.Add(new ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Default.ToString(), (System.Convert.ToInt32(System.Web.UI.WebControls.FirstDayOfWeek.Default)).ToString())); + ddlWeekStart.Items.Add(new ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Monday.ToString(), (System.Convert.ToInt32(System.Web.UI.WebControls.FirstDayOfWeek.Monday)).ToString())); + ddlWeekStart.Items.Add(new ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Tuesday.ToString(), (System.Convert.ToInt32(System.Web.UI.WebControls.FirstDayOfWeek.Tuesday)).ToString())); + ddlWeekStart.Items.Add(new ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Wednesday.ToString(), (System.Convert.ToInt32(System.Web.UI.WebControls.FirstDayOfWeek.Wednesday)).ToString())); + ddlWeekStart.Items.Add(new ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Thursday.ToString(), (System.Convert.ToInt32(System.Web.UI.WebControls.FirstDayOfWeek.Thursday)).ToString())); + ddlWeekStart.Items.Add(new ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Friday.ToString(), (System.Convert.ToInt32(System.Web.UI.WebControls.FirstDayOfWeek.Friday)).ToString())); + ddlWeekStart.Items.Add(new ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Saturday.ToString(), (System.Convert.ToInt32(System.Web.UI.WebControls.FirstDayOfWeek.Saturday)).ToString())); + ddlWeekStart.Items.Add(new ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Sunday.ToString(), (System.Convert.ToInt32(System.Web.UI.WebControls.FirstDayOfWeek.Sunday)).ToString())); + ddlWeekStart.Items.FindByValue((System.Convert.ToInt32(Settings.WeekStart)).ToString()).Selected = true; + + if (Settings.EnrollEditFields.LastIndexOf("01", StringComparison.Ordinal) > -1) + { + rblEnUserEdit.Checked = true; + } + else if (Settings.EnrollViewFields.LastIndexOf("01", StringComparison.Ordinal) > -1) + { + rblEnUserView.Checked = true; + } + else if (Settings.EnrollAnonFields.LastIndexOf("01", StringComparison.Ordinal) > -1) + { + rblEnUserAnon.Checked = true; + } + else + { + rblEnUserNone.Checked = true; + } + + if (Settings.EnrollEditFields.LastIndexOf("02", StringComparison.Ordinal) > -1) + { + rblEnDispEdit.Checked = true; + } + else if (Settings.EnrollViewFields.LastIndexOf("02", StringComparison.Ordinal) > -1) + { + rblEnDispView.Checked = true; + } + else if (Settings.EnrollAnonFields.LastIndexOf("02", StringComparison.Ordinal) > -1) + { + rblEnDispAnon.Checked = true; + } + else + { + rblEnDispNone.Checked = true; + } + + if (Settings.EnrollEditFields.LastIndexOf("03", StringComparison.Ordinal) > -1) + { + rblEnEmailEdit.Checked = true; + } + else if (Settings.EnrollViewFields.LastIndexOf("03", StringComparison.Ordinal) > -1) + { + rblEnEmailView.Checked = true; + } + else if (Settings.EnrollAnonFields.LastIndexOf("03", StringComparison.Ordinal) > -1) + { + rblEnEmailAnon.Checked = true; + } + else + { + rblEnEmailNone.Checked = true; + } + + if (Settings.EnrollEditFields.LastIndexOf("04", StringComparison.Ordinal) > -1) + { + rblEnPhoneEdit.Checked = true; + } + else if (Settings.EnrollViewFields.LastIndexOf("04", StringComparison.Ordinal) > -1) + { + rblEnPhoneView.Checked = true; + } + else if (Settings.EnrollAnonFields.LastIndexOf("04", StringComparison.Ordinal) > -1) + { + rblEnPhoneAnon.Checked = true; + } + else + { + rblEnPhoneNone.Checked = true; + } + + if (Settings.EnrollEditFields.LastIndexOf("05", StringComparison.Ordinal) > -1) + { + rblEnApproveEdit.Checked = true; + } + else if (Settings.EnrollViewFields.LastIndexOf("05", StringComparison.Ordinal) > -1) + { + rblEnApproveView.Checked = true; + } + else if (Settings.EnrollAnonFields.LastIndexOf("05", StringComparison.Ordinal) > -1) + { + rblEnApproveAnon.Checked = true; + } + else + { + rblEnApproveNone.Checked = true; + } + + if (Settings.EnrollEditFields.LastIndexOf("06", StringComparison.Ordinal) > -1) + { + rblEnNoEdit.Checked = true; + } + else if (Settings.EnrollViewFields.LastIndexOf("06", StringComparison.Ordinal) > -1) + { + rblEnNoView.Checked = true; + } + else if (Settings.EnrollAnonFields.LastIndexOf("06", StringComparison.Ordinal) > -1) + { + rblEnNoAnon.Checked = true; + } + else + { + rblEnNoNone.Checked = true; + } + + + chkRSSEnable.Checked = Settings.RSSEnable; + ddlRSSDateField.Items.Clear(); + ddlRSSDateField.Items.Add(new ListItem(Localization.GetString("UpdatedDate", LocalResourceFile), "UPDATEDDATE")); + ddlRSSDateField.Items.Add(new ListItem(Localization.GetString("CreationDate", LocalResourceFile), "CREATIONDATE")); + ddlRSSDateField.Items.Add(new ListItem(Localization.GetString("EventDate", LocalResourceFile), "EVENTDATE")); + ddlRSSDateField.Items.FindByValue(Settings.RSSDateField).Selected = true; + txtRSSDays.Text = Settings.RSSDays.ToString(); + txtRSSTitle.Text = Settings.RSSTitle; + txtRSSDesc.Text = Settings.RSSDesc; + txtExpireEvents.Text = Settings.Expireevents; + chkExportOwnerEmail.Checked = Settings.Exportowneremail; + chkExportAnonOwnerEmail.Checked = Settings.Exportanonowneremail; + chkOwnerChangeAllowed.Checked = Settings.Ownerchangeallowed; + + txtFBAdmins.Text = Settings.FBAdmins; + txtFBAppID.Text = Settings.FBAppID; + + switch (Settings.IconBar) + { + case "BOTTOM": + rblIconBar.Items[1].Selected = true; + break; + case "NONE": + rblIconBar.Items[2].Selected = true; + break; + default: + rblIconBar.Items[0].Selected = true; + break; + } + + switch (Settings.HTMLEmail) + { + case "auto": + rblHTMLEmail.Items[1].Selected = true; + break; + case "text": + rblHTMLEmail.Items[2].Selected = true; + break; + default: + rblHTMLEmail.Items[0].Selected = true; + break; + } + + + chkEnrollMessageApproved.Checked = Settings.SendEnrollMessageApproved; + chkEnrollMessageWaiting.Checked = Settings.SendEnrollMessageWaiting; + chkEnrollMessageDenied.Checked = Settings.SendEnrollMessageDenied; + chkEnrollMessageAdded.Checked = Settings.SendEnrollMessageAdded; + chkEnrollMessageDeleted.Checked = Settings.SendEnrollMessageDeleted; + chkEnrollMessagePaying.Checked = Settings.SendEnrollMessagePaying; + chkEnrollMessagePending.Checked = Settings.SendEnrollMessagePending; + chkEnrollMessagePaid.Checked = Settings.SendEnrollMessagePaid; + chkEnrollMessageIncorrect.Checked = Settings.SendEnrollMessageIncorrect; + chkEnrollMessageCancelled.Checked = Settings.SendEnrollMessageCancelled; + + chkAllowAnonEnroll.Checked = Settings.AllowAnonEnroll; + BindToEnum(typeof(EventModuleSettings.SocialModule), ddlSocialGroupModule); + ddlSocialGroupModule.Items.FindByValue(System.Convert.ToString((int)Settings.SocialGroupModule)).Selected = true; + chkSocialUserPrivate.Checked = Settings.SocialUserPrivate; + BindToEnum(typeof(EventModuleSettings.SocialGroupPrivacy), ddlSocialGroupSecurity); + ddlSocialGroupSecurity.Items.FindByValue(System.Convert.ToString((int)Settings.SocialGroupSecurity)).Selected = true; + + ddlEnrolListSortDirection.Items.Clear(); + ddlEnrolListSortDirection.Items.Add(new ListItem(Localization.GetString("Asc", LocalResourceFile), "0")); + ddlEnrolListSortDirection.Items.Add(new ListItem(Localization.GetString("Desc", LocalResourceFile), "1")); + ddlEnrolListSortDirection.Items.FindByValue((System.Convert.ToInt32(Settings.EnrolListSortDirection)).ToString()).Selected = true; + + txtEnrolListDaysBefore.Text = Settings.EnrolListDaysBefore.ToString(); + txtEnrolListDaysAfter.Text = Settings.EnrolListDaysAfter.ToString(); + + chkJournalIntegration.Checked = Settings.JournalIntegration; + + LoadCategories(); + LoadLocations(); + + LoadTemplates(); + + } + + private void AddJavaScript() + { + //Add the external Validation.js to the Page + const string csname = "ExtValidationScriptFile"; + Type cstype = System.Reflection.MethodBase.GetCurrentMethod().GetType(); + string cstext = ""; + if (!Page.ClientScript.IsClientScriptBlockRegistered(csname)) + { + Page.ClientScript.RegisterClientScriptBlock(cstype, csname, cstext, false); + } + + + // Add javascript actions where required and build startup script + string script = ""; + string cstext2 = ""; + cstext2 += ""; + + // Register the startup script + const string csname2 = "EventSettingsStartupScript"; + Type cstype2 = System.Reflection.MethodBase.GetCurrentMethod().GetType(); + if (!Page.ClientScript.IsStartupScriptRegistered(csname2)) + { + Page.ClientScript.RegisterStartupScript(cstype2, csname2, cstext2, false); + } + + } + + private void BindToEnum(Type enumType, System.Web.UI.WebControls.DropDownList ddl) + { + // get the names from the enumeration + string[] names = Enum.GetNames(enumType); + // get the values from the enumeration + Array values = Enum.GetValues(enumType); + // turn it into a hash table + ddl.Items.Clear(); + for (int i = 0; i <= names.Length - 1; i++) + { + // note the cast to integer here is important + // otherwise we'll just get the enum string back again + ddl.Items.Add(new ListItem(Localization.GetString(names[i], LocalResourceFile), Convert.ToString(System.Convert.ToInt32(values.GetValue(i))))); + } + // return the dictionary to be bound to + } + + + private string GetListColumnName(string columnAcronym) + { + switch (columnAcronym) + { + case "EB": + return "01 - " + Localization.GetString("EditButton", LocalResourceFile); + case "BD": + return "02 - " + Localization.GetString("BeginDateTime", LocalResourceFile); + case "ED": + return "03 - " + Localization.GetString("EndDateTime", LocalResourceFile); + case "EN": + return "04 - " + Localization.GetString("EventName", LocalResourceFile); + case "IM": + return "05 - " + Localization.GetString("Image", LocalResourceFile); + case "DU": + return "06 - " + Localization.GetString("Duration", LocalResourceFile); + case "CA": + return "07 - " + Localization.GetString("Category", LocalResourceFile); + case "LO": + return "08 - " + Localization.GetString("Location", LocalResourceFile); + case "C1": + return "09 - " + Localization.GetString("CustomField1", LocalResourceFile); + case "C2": + return "10 - " + Localization.GetString("CustomField2", LocalResourceFile); + case "DE": + return "11 - " + Localization.GetString("Description", LocalResourceFile); + case "RT": + return "12 - " + Localization.GetString("RecurText", LocalResourceFile); + case "RU": + return "13 - " + Localization.GetString("RecurUntil", LocalResourceFile); + default: + return ""; + } + } + + private string GetListColumnAcronym(int columnNo) + { + switch (columnNo) + { + case 1: + return "EB"; + case 2: + return "BD"; + case 3: + return "ED"; + case 4: + return "EN"; + case 5: + return "IM"; + case 6: + return "DU"; + case 7: + return "CA"; + case 8: + return "LO"; + case 9: + return "C1"; + case 10: + return "C2"; + case 11: + return "DE"; + case 12: + return "RT"; + case 13: + return "RU"; + default: + return ""; + } + } + + /// + /// Fill the themelist based on selection for default or custom skins + /// + /// + private void LoadThemes() + { + try + { + const string moduleThemesDirectoryPath = "/DesktopModules/Events/Themes"; + + //Clear list + ddlThemeStandard.Items.Clear(); + ddlThemeCustom.Items.Clear(); + + //Add javascript to enable/disable ddl's + rbThemeCustom.Attributes.Add("onclick", string.Format("{0}.disabled='disabled';{1}.disabled=''", ddlThemeStandard.ClientID, ddlThemeCustom.ClientID)); + rbThemeStandard.Attributes.Add("onclick", string.Format("{0}.disabled='disabled';{1}.disabled=''", ddlThemeCustom.ClientID, ddlThemeStandard.ClientID)); + + //Get the settings + ThemeSetting themeSettings = new ThemeSetting(); + if (themeSettings.ValidateSetting(Settings.EventTheme) == false) + { + themeSettings.ReadSetting(Settings.EventThemeDefault, PortalId); + } + else if (Settings.EventTheme != "") + { + themeSettings.ReadSetting(Settings.EventTheme, PortalId); + } + switch (themeSettings.SettingType) + { + case ThemeSetting.ThemeSettingTypeEnum.CustomTheme: + rbThemeCustom.Checked = true; + break; + case ThemeSetting.ThemeSettingTypeEnum.DefaultTheme: + rbThemeStandard.Checked = true; + break; + } + + //Is default or custom selected + string moduleThemesDirectory = DotNetNuke.Common.Globals.ApplicationPath + moduleThemesDirectoryPath; + string serverThemesDirectory = Server.MapPath(moduleThemesDirectory); + string[] themeDirectories = System.IO.Directory.GetDirectories(serverThemesDirectory); + string themeDirectory = ""; + foreach (string tempLoopVar_themeDirectory in themeDirectories) + { + themeDirectory = tempLoopVar_themeDirectory; + string[] dirparts = themeDirectory.Split('\\'); + ddlThemeStandard.Items.Add(new ListItem(dirparts[dirparts.Length - 1], dirparts[dirparts.Length - 1])); + } + if (themeSettings.SettingType == ThemeSetting.ThemeSettingTypeEnum.DefaultTheme) + { + if (!ReferenceEquals(ddlThemeStandard.Items.FindByText(themeSettings.ThemeName), null)) + { + ddlThemeStandard.Items.FindByText(themeSettings.ThemeName).Selected = true; + } + } + else + { + ddlThemeStandard.Attributes.Add("disabled", "disabled"); + } + + //Add custom event theme's + Entities.Portals.PortalController pc = new Entities.Portals.PortalController(); + var with_1 = pc.GetPortal(PortalId); + string eventSkinPath = string.Format("{0}\\DNNEvents\\Themes", with_1.HomeDirectoryMapPath); + if (!System.IO.Directory.Exists(eventSkinPath)) + { + System.IO.Directory.CreateDirectory(eventSkinPath); + } + + foreach (string d in System.IO.Directory.GetDirectories(eventSkinPath)) + { + ddlThemeCustom.Items.Add(new ListItem(new System.IO.DirectoryInfo(d).Name, new System.IO.DirectoryInfo(d).Name)); + } + if (ddlThemeCustom.Items.Count == 0) + { + rbThemeCustom.Enabled = false; + } + + if (themeSettings.SettingType == ThemeSetting.ThemeSettingTypeEnum.CustomTheme) + { + if (!ReferenceEquals(ddlThemeCustom.Items.FindByText(themeSettings.ThemeName), null)) + { + ddlThemeCustom.Items.FindByText(themeSettings.ThemeName).Selected = true; + } + } + else + { + ddlThemeCustom.Attributes.Add("disabled", "disabled"); + } + + } + catch (Exception ex) + { + Debug.Write(ex.ToString()); + } + } + + private void LoadTemplates() + { + ddlTemplates.Items.Clear(); + + Type t = Settings.Templates.GetType(); + System.Reflection.PropertyInfo p = default(System.Reflection.PropertyInfo); + foreach (System.Reflection.PropertyInfo tempLoopVar_p in t.GetProperties()) + { + p = tempLoopVar_p; + ddlTemplates.Items.Add(new ListItem(Localization.GetString(p.Name + "Name", LocalResourceFile), p.Name)); + } + + ddlTemplates.Items.FindByValue("EventDetailsTemplate").Selected = true; + txtEventTemplate.Text = Settings.Templates.GetTemplate(ddlTemplates.SelectedValue); + lblTemplateUpdated.Visible = false; + + } + + private void LoadNewEventEmailRoles(int roleID) + { + Security.Roles.RoleController objRoles = new Security.Roles.RoleController(); + ddNewEventEmailRoles.DataSource = objRoles.GetPortalRoles(PortalId); + ddNewEventEmailRoles.DataTextField = "RoleName"; + ddNewEventEmailRoles.DataValueField = "RoleID"; + ddNewEventEmailRoles.DataBind(); + if (roleID < 0 || ReferenceEquals(ddNewEventEmailRoles.Items.FindByValue(System.Convert.ToString(roleID)), null)) + { + try + { + ddNewEventEmailRoles.Items.FindByValue(PortalSettings.RegisteredRoleId.ToString()).Selected = true; + } + catch + { + } + } + else + { + ddNewEventEmailRoles.Items.FindByValue(System.Convert.ToString(roleID)).Selected = true; + } + } + + private void LoadCategories() + { + ddlModuleCategories.Items.Clear(); + EventCategoryController ctrlEventCategories = new EventCategoryController(); + ArrayList lstCategories = ctrlEventCategories.EventsCategoryList(PortalId); + ddlModuleCategories.DataSource = lstCategories; + ddlModuleCategories.DataBind(); + + if (Settings.ModuleCategoriesSelected == EventModuleSettings.CategoriesSelected.Some) + { + foreach (string moduleCategory in Settings.ModuleCategoryIDs) + { + foreach (Telerik.Web.UI.RadComboBoxItem item in ddlModuleCategories.Items) + { + if (item.Value == moduleCategory) + { + item.Checked = true; + } + } + } + } + else if (Settings.ModuleCategoriesSelected == EventModuleSettings.CategoriesSelected.All) + { + foreach (Telerik.Web.UI.RadComboBoxItem item in ddlModuleCategories.Items) + { + item.Checked = true; + } + } + } + + private void LoadLocations() + { + ddlModuleLocations.Items.Clear(); + EventLocationController ctrlEventLocations = new EventLocationController(); + ArrayList lstLocations = ctrlEventLocations.EventsLocationList(PortalId); + ddlModuleLocations.DataSource = lstLocations; + ddlModuleLocations.DataBind(); + + if (Settings.ModuleLocationsSelected == EventModuleSettings.LocationsSelected.Some) + { + foreach (string moduleLocation in Settings.ModuleLocationIDs) + { + foreach (Telerik.Web.UI.RadComboBoxItem item in ddlModuleLocations.Items) + { + if (item.Value == moduleLocation) + { + item.Checked = true; + } + } + } + } + else if (Settings.ModuleLocationsSelected == EventModuleSettings.LocationsSelected.All) + { + foreach (Telerik.Web.UI.RadComboBoxItem item in ddlModuleLocations.Items) + { + item.Checked = true; + } + } + } + + /// + /// Take all settings and write them back to the database + /// + /// + private void UpdateSettings() + { + + EventModuleSettings emSettings = new EventModuleSettings(ModuleId, LocalResourceFile); + + try + { + emSettings.Timeinterval = ddlTimeInterval.SelectedValue.Trim().ToString(); + emSettings.TimeZoneId = cboTimeZone.SelectedValue; + emSettings.EnableEventTimeZones = chkEnableEventTimeZones.Checked; + emSettings.PrimaryTimeZone = (EventModuleSettings.TimeZones)(int.Parse(ddlPrimaryTimeZone.SelectedValue)); + emSettings.SecondaryTimeZone = (EventModuleSettings.TimeZones)(int.Parse(ddlSecondaryTimeZone.SelectedValue)); + emSettings.Eventtooltipmonth = chkToolTipMonth.Checked; + emSettings.Eventtooltipweek = chkToolTipWeek.Checked; + emSettings.Eventtooltipday = chkToolTipDay.Checked; + emSettings.Eventtooltiplist = chkToolTipList.Checked; + emSettings.Eventtooltiplength = int.Parse(txtTooltipLength.Text); + if (chkMonthCellEvents.Checked) + { + emSettings.Monthcellnoevents = false; + } + else + { + emSettings.Monthcellnoevents = true; + } + emSettings.Enablecategories = (EventModuleSettings.DisplayCategories)(int.Parse(ddlEnableCategories.SelectedValue)); + emSettings.Restrictcategories = chkRestrictCategories.Checked; + emSettings.Enablelocations = (EventModuleSettings.DisplayLocations)(int.Parse(ddlEnableLocations.SelectedValue)); + emSettings.Restrictlocations = chkRestrictLocations.Checked; + emSettings.Enablecontainerskin = chkEnableContainerSkin.Checked; + emSettings.Eventdetailnewpage = chkEventDetailNewPage.Checked; + emSettings.Enableenrollpopup = chkEnableEnrollPopup.Checked; + emSettings.Eventdaynewpage = chkEventDayNewPage.Checked; + emSettings.EventImageMonth = chkEventImageMonth.Checked; + emSettings.EventImageWeek = chkEventImageWeek.Checked; + emSettings.Eventnotify = chkEventNotify.Checked; + emSettings.DetailPageAllowed = chkDetailPageAllowed.Checked; + emSettings.EnrollmentPageAllowed = chkEnrollmentPageAllowed.Checked; + emSettings.EnrollmentPageDefaultUrl = txtEnrollmentPageDefaultURL.Text; + emSettings.Notifyanon = chkNotifyAnon.Checked; + emSettings.Sendreminderdefault = chkSendReminderDefault.Checked; + emSettings.Neweventemails = rblNewEventEmail.SelectedValue; + emSettings.Neweventemailrole = int.Parse(ddNewEventEmailRoles.SelectedValue); + emSettings.Newpereventemail = chkNewPerEventEmail.Checked; + emSettings.Tzdisplay = chkTZDisplay.Checked; + emSettings.Paypalurl = txtPayPalURL.Text; + if (chkEnableEventNav.Checked) + { + emSettings.DisableEventnav = false; + } + else + { + emSettings.DisableEventnav = true; + } + emSettings.Fulltimescale = chkFullTimeScale.Checked; + emSettings.Collapserecurring = chkCollapseRecurring.Checked; + emSettings.Includeendvalue = chkIncludeEndValue.Checked; + emSettings.Showvaluemarks = chkShowValueMarks.Checked; + emSettings.Eventimage = chkImageEnabled.Checked; + emSettings.MaxThumbHeight = int.Parse(txtMaxThumbHeight.Text); + emSettings.MaxThumbWidth = int.Parse(txtMaxThumbWidth.Text); + emSettings.Allowreoccurring = chkAllowRecurring.Checked; + emSettings.Maxrecurrences = txtMaxRecurrences.Text; + emSettings.Eventsearch = chkEnableSearch.Checked; + emSettings.Addsubmodulename = chkAddSubModuleName.Checked; + emSettings.Enforcesubcalperms = chkEnforceSubCalPerms.Checked; + emSettings.Preventconflicts = chkPreventConflicts.Checked; + emSettings.Locationconflict = chkLocationConflict.Checked; + emSettings.ShowEventsAlways = chkShowEventsAlways.Checked; + emSettings.Timeintitle = chkTimeInTitle.Checked; + emSettings.Monthdayselect = chkMonthDaySelect.Checked; + emSettings.MasterEvent = chkMasterEvent.Checked; + emSettings.Eventsignup = chkEventSignup.Checked; + emSettings.Eventsignupallowpaid = chkEventSignupAllowPaid.Checked; + emSettings.Eventdefaultenrollview = chkDefaultEnrollView.Checked; + emSettings.Eventhidefullenroll = chkHideFullEnroll.Checked; + emSettings.Maxnoenrolees = int.Parse(txtMaxNoEnrolees.Text); + emSettings.Enrolcanceldays = int.Parse(txtCancelDays.Text); + emSettings.Fridayweekend = chkFridayWeekend.Checked; + emSettings.Moderateall = chkModerateAll.Checked; + emSettings.Paypalaccount = txtPayPalAccount.Text; + emSettings.Reminderfrom = txtReminderFrom.Text; + emSettings.StandardEmail = txtStandardEmail.Text; + emSettings.EventsCustomField1 = chkCustomField1.Checked; + emSettings.EventsCustomField2 = chkCustomField2.Checked; + emSettings.DefaultView = ddlDefaultView.SelectedItem.Value; + emSettings.EventsListPageSize = int.Parse(ddlPageSize.SelectedItem.Value); + emSettings.EventsListSortDirection = ddlListSortedFieldDirection.SelectedItem.Value; + emSettings.EventsListSortColumn = ddlListDefaultColumn.SelectedItem.Value; + emSettings.RSSEnable = chkRSSEnable.Checked; + emSettings.RSSDateField = ddlRSSDateField.SelectedItem.Value; + emSettings.RSSDays = int.Parse(txtRSSDays.Text); + emSettings.RSSTitle = txtRSSTitle.Text; + emSettings.RSSDesc = txtRSSDesc.Text; + emSettings.Expireevents = txtExpireEvents.Text; + emSettings.Exportowneremail = chkExportOwnerEmail.Checked; + emSettings.Exportanonowneremail = chkExportAnonOwnerEmail.Checked; + emSettings.Ownerchangeallowed = chkOwnerChangeAllowed.Checked; + emSettings.IconMonthPrio = chkIconMonthPrio.Checked; + emSettings.IconMonthRec = chkIconMonthRec.Checked; + emSettings.IconMonthReminder = chkIconMonthReminder.Checked; + emSettings.IconMonthEnroll = chkIconMonthEnroll.Checked; + emSettings.IconWeekPrio = chkIconWeekPrio.Checked; + emSettings.IconWeekRec = chkIconWeekRec.Checked; + emSettings.IconWeekReminder = chkIconWeekReminder.Checked; + emSettings.IconWeekEnroll = chkIconWeekEnroll.Checked; + emSettings.IconListPrio = chkIconListPrio.Checked; + emSettings.IconListRec = chkIconListRec.Checked; + emSettings.IconListReminder = chkIconListReminder.Checked; + emSettings.IconListEnroll = chkIconListEnroll.Checked; + emSettings.PrivateMessage = txtPrivateMessage.Text.Trim(); + emSettings.EnableSEO = chkEnableSEO.Checked; + emSettings.SEODescriptionLength = int.Parse(txtSEODescriptionLength.Text); + emSettings.EnableSitemap = chkEnableSitemap.Checked; + emSettings.SiteMapPriority = System.Convert.ToSingle(System.Convert.ToSingle(txtSitemapPriority.Text)); + emSettings.SiteMapDaysBefore = int.Parse(txtSitemapDaysBefore.Text); + emSettings.SiteMapDaysAfter = int.Parse(txtSitemapDaysAfter.Text); + emSettings.WeekStart = (System.Web.UI.WebControls.FirstDayOfWeek)(int.Parse(ddlWeekStart.SelectedValue)); + emSettings.ListViewUseTime = chkListViewUseTime.Checked; + + emSettings.IcalOnIconBar = chkiCalOnIconBar.Checked; + emSettings.IcalEmailEnable = chkiCalEmailEnable.Checked; + emSettings.IcalURLInLocation = chkiCalURLinLocation.Checked; + emSettings.IcalIncludeCalname = chkiCalIncludeCalname.Checked; + emSettings.IcalDaysBefore = int.Parse(txtiCalDaysBefore.Text); + emSettings.IcalDaysAfter = int.Parse(txtiCalDaysAfter.Text); + emSettings.IcalURLAppend = txtiCalURLAppend.Text; + if (chkiCalDisplayImage.Checked) + { + emSettings.IcalDefaultImage = "Image=" + ctliCalDefaultImage.Url; + } + else + { + emSettings.IcalDefaultImage = ""; + } + //objModules.UpdateModuleSetting(ModuleId, "EventDetailsTemplate", txtEventDetailsTemplate.Text.Trim) + + ArrayList moduleCategories = new ArrayList(); + if (ddlModuleCategories.CheckedItems.Count != ddlModuleCategories.Items.Count) + { + foreach (Telerik.Web.UI.RadComboBoxItem item in ddlModuleCategories.CheckedItems) + { + moduleCategories.Add(item.Value); + } + } + else + { + moduleCategories.Add("-1"); + } + emSettings.ModuleCategoryIDs = moduleCategories; + + ArrayList moduleLocations = new ArrayList(); + if (ddlModuleLocations.CheckedItems.Count != ddlModuleLocations.Items.Count) + { + foreach (Telerik.Web.UI.RadComboBoxItem item in ddlModuleLocations.CheckedItems) + { + moduleLocations.Add(item.Value); + } + } + else + { + moduleLocations.Add("-1"); + } + emSettings.ModuleLocationIDs = moduleLocations; + + // ReSharper disable LocalizableElement + if (chkMonthAllowed.Checked || ddlDefaultView.SelectedItem.Value == "EventMonth.ascx") + { + emSettings.MonthAllowed = true; + } + else + { + emSettings.MonthAllowed = false; + } + if (chkWeekAllowed.Checked || ddlDefaultView.SelectedItem.Value == "EventWeek.ascx") + { + emSettings.WeekAllowed = true; + } + else + { + emSettings.WeekAllowed = false; + } + if (chkListAllowed.Checked || ddlDefaultView.SelectedItem.Value == "EventList.ascx") + { + emSettings.ListAllowed = true; + } + else + { + emSettings.ListAllowed = false; + } + // ReSharper restore LocalizableElement + + switch (rblIconBar.SelectedIndex) + { + case 0: + emSettings.IconBar = "TOP"; + break; + case 1: + emSettings.IconBar = "BOTTOM"; + break; + case 2: + emSettings.IconBar = "NONE"; + break; + } + + switch (rblHTMLEmail.SelectedIndex) + { + case 0: + emSettings.HTMLEmail = "html"; + break; + case 1: + emSettings.HTMLEmail = "auto"; + break; + case 2: + emSettings.HTMLEmail = "text"; + break; + } + + //EPT: Be sure we start next display time in the correct view + // Update the cookie so the appropriate view is shown when settings page is exited + + HttpCookie objCookie = new HttpCookie("DNNEvents" + System.Convert.ToString(ModuleId)); + objCookie.Value = ddlDefaultView.SelectedItem.Value; + if (ReferenceEquals(Request.Cookies.Get("DNNEvents" + System.Convert.ToString(ModuleId)), null)) + { + Response.Cookies.Add(objCookie); + } + else + { + Response.Cookies.Set(objCookie); + } + + //Set eventtheme data + ThemeSetting themeSettings = new ThemeSetting(); + if (rbThemeStandard.Checked) + { + themeSettings.SettingType = ThemeSetting.ThemeSettingTypeEnum.DefaultTheme; + themeSettings.ThemeName = ddlThemeStandard.SelectedItem.Text; + themeSettings.ThemeFile = ""; + } + else if (rbThemeCustom.Checked) + { + themeSettings.SettingType = ThemeSetting.ThemeSettingTypeEnum.CustomTheme; + themeSettings.ThemeName = ddlThemeCustom.SelectedItem.Text; + themeSettings.ThemeFile = ""; + } + emSettings.EventTheme = themeSettings.ToString(); + + //List Events Mode Stuff + //Update Fields to Display + ListItem objListItem = default(ListItem); + string listFields = ""; + foreach (ListItem tempLoopVar_objListItem in lstAssigned.Items) + { + objListItem = tempLoopVar_objListItem; + int columnNo = int.Parse(objListItem.Text.Substring(0, 2)); + string columnAcronym = GetListColumnAcronym(columnNo); + if (listFields.Length > 0) + { + listFields = listFields + ";" + columnAcronym; + } + else + { + listFields = columnAcronym; + } + } + emSettings.EventsListFields = listFields; + + listFields = EnrollListFields(rblEnUserAnon.Checked, rblEnDispAnon.Checked, rblEnEmailAnon.Checked, rblEnPhoneAnon.Checked, rblEnApproveAnon.Checked, rblEnNoAnon.Checked); + emSettings.EnrollAnonFields = listFields; + + listFields = EnrollListFields(rblEnUserView.Checked, rblEnDispView.Checked, rblEnEmailView.Checked, rblEnPhoneView.Checked, rblEnApproveView.Checked, rblEnNoView.Checked); + emSettings.EnrollViewFields = listFields; + + listFields = EnrollListFields(rblEnUserEdit.Checked, rblEnDispEdit.Checked, rblEnEmailEdit.Checked, rblEnPhoneEdit.Checked, rblEnApproveEdit.Checked, rblEnNoEdit.Checked); + emSettings.EnrollEditFields = listFields; + + if (rblSelectionTypeDays.Checked) + { + emSettings.EventsListSelectType = rblSelectionTypeDays.Value; + } + else + { + emSettings.EventsListSelectType = rblSelectionTypeEvents.Value; + } + if (rblListViewGrid.Items[0].Selected == true) + { + emSettings.ListViewGrid = true; + } + else + { + emSettings.ListViewGrid = false; + } + emSettings.ListViewTable = chkListViewTable.Checked; + emSettings.RptColumns = int.Parse(txtRptColumns.Text.Trim().ToString()); + emSettings.RptRows = int.Parse(txtRptRows.Text.Trim().ToString()); + + if (rblShowHeader.Items[0].Selected == true) + { + emSettings.EventsListShowHeader = rblShowHeader.Items[0].Value; + } + else + { + emSettings.EventsListShowHeader = rblShowHeader.Items[1].Value; + } + emSettings.EventsListBeforeDays = int.Parse(txtDaysBefore.Text.Trim().ToString()); + emSettings.EventsListAfterDays = int.Parse(txtDaysAfter.Text.Trim().ToString()); + emSettings.EventsListNumEvents = int.Parse(txtNumEvents.Text.Trim().ToString()); + emSettings.EventsListEventDays = int.Parse(txtEventDays.Text.Trim().ToString()); + emSettings.RestrictCategoriesToTimeFrame = chkRestrictCategoriesToTimeFrame.Checked; + emSettings.RestrictLocationsToTimeFrame = chkRestrictLocationsToTimeFrame.Checked; + + emSettings.FBAdmins = txtFBAdmins.Text; + emSettings.FBAppID = txtFBAppID.Text; + + emSettings.SendEnrollMessageApproved = chkEnrollMessageApproved.Checked; + emSettings.SendEnrollMessageWaiting = chkEnrollMessageWaiting.Checked; + emSettings.SendEnrollMessageDenied = chkEnrollMessageDenied.Checked; + emSettings.SendEnrollMessageAdded = chkEnrollMessageAdded.Checked; + emSettings.SendEnrollMessageDeleted = chkEnrollMessageDeleted.Checked; + emSettings.SendEnrollMessagePaying = chkEnrollMessagePaying.Checked; + emSettings.SendEnrollMessagePending = chkEnrollMessagePending.Checked; + emSettings.SendEnrollMessagePaid = chkEnrollMessagePaid.Checked; + emSettings.SendEnrollMessageIncorrect = chkEnrollMessageIncorrect.Checked; + emSettings.SendEnrollMessageCancelled = chkEnrollMessageCancelled.Checked; + + emSettings.AllowAnonEnroll = chkAllowAnonEnroll.Checked; + emSettings.SocialGroupModule = (EventModuleSettings.SocialModule)int.Parse(ddlSocialGroupModule.SelectedValue); + if (emSettings.SocialGroupModule != EventModuleSettings.SocialModule.No) + { + emSettings.Ownerchangeallowed = false; + emSettings.Neweventemails = "Never"; + emSettings.MasterEvent = false; + } + if (emSettings.SocialGroupModule == EventModuleSettings.SocialModule.UserProfile) + { + emSettings.EnableSitemap = false; + emSettings.Eventsearch = false; + emSettings.Eventsignup = false; + emSettings.Moderateall = false; + } + emSettings.SocialUserPrivate = chkSocialUserPrivate.Checked; + emSettings.SocialGroupSecurity = (EventModuleSettings.SocialGroupPrivacy)int.Parse(ddlSocialGroupSecurity.SelectedValue); + + emSettings.EnrolListSortDirection = (SortDirection)int.Parse(ddlEnrolListSortDirection.SelectedValue); + emSettings.EnrolListDaysBefore = int.Parse(txtEnrolListDaysBefore.Text); + emSettings.EnrolListDaysAfter = int.Parse(txtEnrolListDaysAfter.Text); + + emSettings.JournalIntegration = chkJournalIntegration.Checked; + + emSettings.SaveSettings(ModuleId); + CreateThemeDirectory(); + + + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + + } + + /// + /// Get Assigned Sub Events and Bind to Grid + /// + /// + private void BindSubEvents() + { + lstAssignedCals.DataTextField = "SubEventTitle"; + lstAssignedCals.DataValueField = "MasterID"; + lstAssignedCals.DataSource = null; + lstAssignedCals.DataBind(); + lstAssignedCals.DataSource = _objCtlMasterEvent.EventsMasterAssignedModules(ModuleId); + lstAssignedCals.DataBind(); + } + + /// + /// Get Avaiable Sub Events for Portal and Bind to DropDown + /// + /// + private void BindAvailableEvents() + { + lstAvailableCals.DataTextField = "SubEventTitle"; + lstAvailableCals.DataValueField = "SubEventID"; + lstAvailableCals.DataSource = null; + lstAvailableCals.DataBind(); + lstAvailableCals.DataSource = _objCtlMasterEvent.EventsMasterAvailableModules(PortalId, ModuleId); + lstAvailableCals.DataBind(); + } + + private void Enable_Disable_Cals() + { + divMasterEvent.Visible = chkMasterEvent.Checked; + } + + private string EnrollListFields(bool blUser, bool blDisp, bool blEmail, bool blPhone, bool blApprove, bool blNo) + { + string listFields = ""; + if (blUser) + { + listFields = listFields + "01;"; + } + if (blDisp) + { + listFields = listFields + "02;"; + } + if (blEmail) + { + listFields = listFields + "03;"; + } + if (blPhone) + { + listFields = listFields + "04;"; + } + if (blApprove) + { + listFields = listFields + "05;"; + } + if (blNo) + { + listFields = listFields + "06;"; + } + return listFields; + } + + public string AddSkinContainerControls(string url, string addchar) + { + TabController objCtlTab = new TabController(); + Entities.Tabs.TabInfo objTabInfo = objCtlTab.GetTab(TabId, PortalId, false); + string skinSrc = null; + if (!(objTabInfo.SkinSrc == "")) + { + skinSrc = objTabInfo.SkinSrc; + if (skinSrc.Substring(skinSrc.Length - 5, 5) == ".ascx") + { + skinSrc = skinSrc.Substring(0, skinSrc.Length - 5); + } + } + ModuleController objCtlModule = new ModuleController(); + ModuleInfo objModuleInfo = objCtlModule.GetModule(ModuleId, TabId, false); + string containerSrc = null; + if (objModuleInfo.DisplayTitle) + { + if (!(objModuleInfo.ContainerSrc == "")) + { + containerSrc = objModuleInfo.ContainerSrc; + } + else if (!(objTabInfo.ContainerSrc == "")) + { + containerSrc = objTabInfo.ContainerSrc; + } + if (!ReferenceEquals(containerSrc, null)) + { + if (containerSrc.Substring(containerSrc.Length - 5, 5) == ".ascx") + { + containerSrc = containerSrc.Substring(0, containerSrc.Length - 5); + } + } + } + else + { + containerSrc = "[G]Containers/_default/No+Container"; + } + if (!ReferenceEquals(containerSrc, null)) + { + url += addchar + "ContainerSrc=" + HttpUtility.HtmlEncode(containerSrc); + addchar = "&"; + } + if (!ReferenceEquals(skinSrc, null)) + { + url += addchar + "SkinSrc=" + HttpUtility.HtmlEncode(skinSrc); + } + return url; + } + + #endregion + + #region Links, Buttons and Events + protected void chkMasterEvent_CheckedChanged(System.Object sender, EventArgs e) + { + cmdRemoveAllCals_Click(sender, e); + Enable_Disable_Cals(); + } + + protected void cmdAdd_Click(object sender, EventArgs e) + { + + ListItem objListItem = default(ListItem); + + ArrayList objList = new ArrayList(); + + foreach (ListItem tempLoopVar_objListItem in lstAvailable.Items) + { + objListItem = tempLoopVar_objListItem; + objList.Add(objListItem); + } + + foreach (ListItem tempLoopVar_objListItem in objList) + { + objListItem = tempLoopVar_objListItem; + if (objListItem.Selected) + { + lstAvailable.Items.Remove(objListItem); + lstAssigned.Items.Add(objListItem); + } + } + + lstAvailable.ClearSelection(); + lstAssigned.ClearSelection(); + + Sort(lstAssigned); + + } + + protected void cmdRemove_Click(object sender, EventArgs e) + { + + ListItem objListItem = default(ListItem); + + ArrayList objList = new ArrayList(); + + foreach (ListItem tempLoopVar_objListItem in lstAssigned.Items) + { + objListItem = tempLoopVar_objListItem; + objList.Add(objListItem); + } + + foreach (ListItem tempLoopVar_objListItem in objList) + { + objListItem = tempLoopVar_objListItem; + if (objListItem.Selected) + { + lstAssigned.Items.Remove(objListItem); + lstAvailable.Items.Add(objListItem); + } + } + + lstAvailable.ClearSelection(); + lstAssigned.ClearSelection(); + + Sort(lstAvailable); + + } + + protected void cmdAddAll_Click(object sender, EventArgs e) + { + + ListItem objListItem = default(ListItem); + + foreach (ListItem tempLoopVar_objListItem in lstAvailable.Items) + { + objListItem = tempLoopVar_objListItem; + lstAssigned.Items.Add(objListItem); + } + + lstAvailable.Items.Clear(); + + lstAvailable.ClearSelection(); + lstAssigned.ClearSelection(); + + Sort(lstAssigned); + + } + + protected void cmdRemoveAll_Click(object sender, EventArgs e) + { + + ListItem objListItem = default(ListItem); + + foreach (ListItem tempLoopVar_objListItem in lstAssigned.Items) + { + objListItem = tempLoopVar_objListItem; + lstAvailable.Items.Add(objListItem); + } + + lstAssigned.Items.Clear(); + + lstAvailable.ClearSelection(); + lstAssigned.ClearSelection(); + + Sort(lstAvailable); + } + + protected void Sort(ListBox ctlListBox) + { + + ArrayList arrListItems = new ArrayList(); + ListItem objListItem = default(ListItem); + + // store listitems in temp arraylist + foreach (ListItem tempLoopVar_objListItem in ctlListBox.Items) + { + objListItem = tempLoopVar_objListItem; + arrListItems.Add(objListItem); + } + + // sort arraylist based on text value + arrListItems.Sort(new ListItemComparer()); + + // clear control + ctlListBox.Items.Clear(); + + // add listitems to control + foreach (ListItem tempLoopVar_objListItem in arrListItems) + { + objListItem = tempLoopVar_objListItem; + ctlListBox.Items.Add(objListItem); + } + } + + protected void cmdAddCals_Click(object sender, EventArgs e) + { + ListItem objListItem = default(ListItem); + EventMasterInfo masterEvent = new EventMasterInfo(); + + foreach (ListItem tempLoopVar_objListItem in lstAvailableCals.Items) + { + objListItem = tempLoopVar_objListItem; + if (objListItem.Selected) + { + masterEvent.MasterID = 0; + masterEvent.ModuleID = ModuleId; + masterEvent.SubEventID = System.Convert.ToInt32(objListItem.Value); + _objCtlMasterEvent.EventsMasterSave(masterEvent); + } + } + + BindSubEvents(); + BindAvailableEvents(); + } + + protected void cmdAddAllCals_Click(object sender, EventArgs e) + { + ListItem objListItem = default(ListItem); + EventMasterInfo masterEvent = new EventMasterInfo(); + + foreach (ListItem tempLoopVar_objListItem in lstAvailableCals.Items) + { + objListItem = tempLoopVar_objListItem; + masterEvent.MasterID = 0; + masterEvent.ModuleID = ModuleId; + masterEvent.SubEventID = System.Convert.ToInt32(objListItem.Value); + _objCtlMasterEvent.EventsMasterSave(masterEvent); + } + + BindSubEvents(); + BindAvailableEvents(); + } + + protected void cmdRemoveCals_Click(object sender, EventArgs e) + { + ListItem objListItem = default(ListItem); + + foreach (ListItem tempLoopVar_objListItem in lstAssignedCals.Items) + { + objListItem = tempLoopVar_objListItem; + if (objListItem.Selected) + { + _objCtlMasterEvent.EventsMasterDelete(int.Parse(objListItem.Value), ModuleId); + } + } + + BindSubEvents(); + BindAvailableEvents(); + } + + protected void cmdRemoveAllCals_Click(object sender, EventArgs e) + { + ListItem objListItem = default(ListItem); + + foreach (ListItem tempLoopVar_objListItem in lstAssignedCals.Items) + { + objListItem = tempLoopVar_objListItem; + _objCtlMasterEvent.EventsMasterDelete(int.Parse(objListItem.Value), ModuleId); + } + + BindSubEvents(); + BindAvailableEvents(); + } + + protected void cmdUpdateTemplate_Click(object sender, EventArgs e) + { + string strTemplate = ddlTemplates.SelectedValue; + Settings.Templates.SaveTemplate(ModuleId, strTemplate, txtEventTemplate.Text.Trim()); + lblTemplateUpdated.Visible = true; + lblTemplateUpdated.Text = string.Format(Localization.GetString("TemplateUpdated", LocalResourceFile), Localization.GetString(strTemplate + "Name", LocalResourceFile)); + } + + protected void cmdResetTemplate_Click(object sender, EventArgs e) + { + string strTemplate = ddlTemplates.SelectedValue; + Settings.Templates.ResetTemplate(ModuleId, strTemplate, LocalResourceFile); + txtEventTemplate.Text = Settings.Templates.GetTemplate(strTemplate); + lblTemplateUpdated.Visible = true; + lblTemplateUpdated.Text = string.Format(Localization.GetString("TemplateReset", LocalResourceFile), Localization.GetString(strTemplate + "Name", LocalResourceFile)); + } + + protected void ddlTemplates_SelectedIndexChanged(object sender, EventArgs e) + { + txtEventTemplate.Text = Settings.Templates.GetTemplate(ddlTemplates.SelectedValue); + lblTemplateUpdated.Visible = false; + } + + protected void cancelButton_Click(object sender, EventArgs e) + { + try + { + Response.Redirect(GetSocialNavigateUrl(), true); + } + catch (Exception) //Module failed to load + { + //ProcessModuleLoadException(Me, exc) + } + } + + protected void updateButton_Click(object sender, EventArgs e) + { + try + { + UpdateSettings(); + Response.Redirect(GetSocialNavigateUrl(), true); + } + catch (Exception) //Module failed to load + { + //ProcessModuleLoadException(Me, exc) + } + } + + #endregion + + } + + #region Comparer Class + public class ListItemComparer : IComparer + { + + public int Compare(object x, object y) + { + ListItem a = (ListItem)x; + ListItem b = (ListItem)y; + CaseInsensitiveComparer c = new CaseInsensitiveComparer(); + return c.Compare(a.Text, b.Text); + } + } + #endregion + + #region DataClasses + public class ThemeSetting + { + #region Member Variables + public ThemeSettingTypeEnum SettingType; + public string ThemeName; + public string ThemeFile; + public string CssClass; + #endregion + #region Enumerators + public enum ThemeSettingTypeEnum + { + DefaultTheme = 0, + CustomTheme = 1 + } + #endregion + #region Methods + public bool ValidateSetting(string setting) + { + string[] s = setting.Split(','); + if (!(s.GetUpperBound(0) == 2)) + { + return false; + } + if (!Information.IsNumeric(s[0])) + { + return false; + } + return true; + } + + public void ReadSetting(string setting, int portalID) + { + if (!ValidateSetting(setting)) + { + throw (new Exception("Setting is not right format to convert into ThemeSetting")); + } + + string[] s = setting.Split(','); + SettingType = (ThemeSettingTypeEnum)int.Parse(s[0]); + ThemeName = s[1]; + CssClass = "Theme" + ThemeName; + switch (SettingType) + { + case ThemeSettingTypeEnum.DefaultTheme: + ThemeFile = string.Format("{0}/DesktopModules/Events/Themes/{1}/{1}.css", DotNetNuke.Common.Globals.ApplicationPath, ThemeName); + break; + case ThemeSettingTypeEnum.CustomTheme: + Entities.Portals.PortalController pc = new Entities.Portals.PortalController(); + var with_1 = pc.GetPortal(portalID); + ThemeFile = string.Format("{0}/{1}/DNNEvents/Themes/{2}/{2}.css", DotNetNuke.Common.Globals.ApplicationPath, with_1.HomeDirectory, ThemeName); + break; + } + + } + #endregion + #region Overrides + public override string ToString() + { + return string.Format("{0},{1},{2}", System.Convert.ToInt32(SettingType), ThemeName, ThemeFile); + } + #endregion + } + #endregion +} + + diff --git a/EventSettings.ascx.designer.cs b/EventSettings.ascx.designer.cs new file mode 100644 index 0000000..7e9bd82 --- /dev/null +++ b/EventSettings.ascx.designer.cs @@ -0,0 +1,3462 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DotNetNuke.Modules.Events { + + + public partial class EventSettings { + + /// + /// pnlEventsModuleSettings control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlEventsModuleSettings; + + /// + /// ValidationSummary1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary ValidationSummary1; + + /// + /// plTimeInterval control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plTimeInterval; + + /// + /// ddlTimeInterval control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlTimeInterval; + + /// + /// plAllowRecurring control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plAllowRecurring; + + /// + /// chkAllowRecurring control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkAllowRecurring; + + /// + /// plMaxRecurrences control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plMaxRecurrences; + + /// + /// txtMaxRecurrences control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtMaxRecurrences; + + /// + /// plPreventConflicts control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plPreventConflicts; + + /// + /// chkPreventConflicts control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPreventConflicts; + + /// + /// plLocationConflict control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plLocationConflict; + + /// + /// chkLocationConflict control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkLocationConflict; + + /// + /// plEnableSearch control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plEnableSearch; + + /// + /// chkEnableSearch control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnableSearch; + + /// + /// lblOwnerChangeAllowed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblOwnerChangeAllowed; + + /// + /// chkOwnerChangeAllowed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkOwnerChangeAllowed; + + /// + /// plExpireEvents control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plExpireEvents; + + /// + /// txtExpireEvents control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtExpireEvents; + + /// + /// plDays control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label plDays; + + /// + /// plPrivateMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plPrivateMessage; + + /// + /// txtPrivateMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPrivateMessage; + + /// + /// plModuleCategory control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plModuleCategory; + + /// + /// ddlModuleCategories control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Web.UI.WebControls.DnnComboBox ddlModuleCategories; + + /// + /// plModuleLocation control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plModuleLocation; + + /// + /// ddlModuleLocations control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Web.UI.WebControls.DnnComboBox ddlModuleLocations; + + /// + /// lblStandardEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblStandardEmail; + + /// + /// txtStandardEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtStandardEmail; + + /// + /// valStandardEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valStandardEmail; + + /// + /// lblTheme control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblTheme; + + /// + /// rbThemeStandard control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton rbThemeStandard; + + /// + /// ddlThemeStandard control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlThemeStandard; + + /// + /// rbThemeCustom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton rbThemeCustom; + + /// + /// ddlThemeCustom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlThemeCustom; + + /// + /// lblDefaultView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblDefaultView; + + /// + /// ddlDefaultView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlDefaultView; + + /// + /// lblAllowedViews control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblAllowedViews; + + /// + /// chkMonthAllowed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkMonthAllowed; + + /// + /// chkWeekAllowed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkWeekAllowed; + + /// + /// chkListAllowed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkListAllowed; + + /// + /// lblEnableContainerSkin control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEnableContainerSkin; + + /// + /// chkEnableContainerSkin control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnableContainerSkin; + + /// + /// lblCategoriesEnable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblCategoriesEnable; + + /// + /// ddlEnableCategories control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlEnableCategories; + + /// + /// lblRestrictCategories control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblRestrictCategories; + + /// + /// chkRestrictCategories control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkRestrictCategories; + + /// + /// lblLocationsEnable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblLocationsEnable; + + /// + /// ddlEnableLocations control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlEnableLocations; + + /// + /// lblRestrictLocations control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblRestrictLocations; + + /// + /// chkRestrictLocations control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkRestrictLocations; + + /// + /// plEnableEventNav control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plEnableEventNav; + + /// + /// chkEnableEventNav control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnableEventNav; + + /// + /// plIconBar control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plIconBar; + + /// + /// rblIconBar control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButtonList rblIconBar; + + /// + /// plHTMLEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plHTMLEmail; + + /// + /// rblHTMLEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButtonList rblHTMLEmail; + + /// + /// plWeekStart control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plWeekStart; + + /// + /// ddlWeekStart control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlWeekStart; + + /// + /// lblTimeZone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblTimeZone; + + /// + /// cboTimeZone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Web.UI.WebControls.DnnTimeZoneComboBox cboTimeZone; + + /// + /// plTZDisplay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plTZDisplay; + + /// + /// chkTZDisplay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkTZDisplay; + + /// + /// lblPrimaryTimeZone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblPrimaryTimeZone; + + /// + /// ddlPrimaryTimeZone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlPrimaryTimeZone; + + /// + /// lblSecondaryTimeZone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblSecondaryTimeZone; + + /// + /// ddlSecondaryTimeZone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlSecondaryTimeZone; + + /// + /// plEnableEventTimeZones control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plEnableEventTimeZones; + + /// + /// chkEnableEventTimeZones control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnableEventTimeZones; + + /// + /// lblEventDetailNewPage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEventDetailNewPage; + + /// + /// chkEventDetailNewPage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEventDetailNewPage; + + /// + /// lblDetailPageAllowed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblDetailPageAllowed; + + /// + /// chkDetailPageAllowed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkDetailPageAllowed; + + /// + /// lblEnrollmentPageAllowed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEnrollmentPageAllowed; + + /// + /// chkEnrollmentPageAllowed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnrollmentPageAllowed; + + /// + /// lblEnrollmentPageDefaultURL control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEnrollmentPageDefaultURL; + + /// + /// txtEnrollmentPageDefaultURL control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtEnrollmentPageDefaultURL; + + /// + /// lblEnableEnrollPopup control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEnableEnrollPopup; + + /// + /// chkEnableEnrollPopup control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnableEnrollPopup; + + /// + /// lblMonthCellEvents control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblMonthCellEvents; + + /// + /// chkMonthCellEvents control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkMonthCellEvents; + + /// + /// plShowEventsAlways control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plShowEventsAlways; + + /// + /// chkShowEventsAlways control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkShowEventsAlways; + + /// + /// plFridayWeekend control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plFridayWeekend; + + /// + /// chkFridayWeekend control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkFridayWeekend; + + /// + /// plTimeInTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plTimeInTitle; + + /// + /// chkTimeInTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkTimeInTitle; + + /// + /// lblEventDayNewPage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEventDayNewPage; + + /// + /// chkEventDayNewPage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEventDayNewPage; + + /// + /// lblMonthDaySelect control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblMonthDaySelect; + + /// + /// chkMonthDaySelect control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkMonthDaySelect; + + /// + /// lblIconsMonth control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblIconsMonth; + + /// + /// chkIconMonthPrio control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkIconMonthPrio; + + /// + /// imgIconMonthPrioHigh control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIconMonthPrioHigh; + + /// + /// imgIconMonthPrioLow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIconMonthPrioLow; + + /// + /// chkIconMonthRec control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkIconMonthRec; + + /// + /// imgIconMonthRec control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIconMonthRec; + + /// + /// chkIconMonthReminder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkIconMonthReminder; + + /// + /// imgIconMonthReminder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIconMonthReminder; + + /// + /// chkIconMonthEnroll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkIconMonthEnroll; + + /// + /// imgIconMonthEnroll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIconMonthEnroll; + + /// + /// lblFullTimeScale control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblFullTimeScale; + + /// + /// chkFullTimeScale control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkFullTimeScale; + + /// + /// lblIncludeEndValue control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblIncludeEndValue; + + /// + /// chkIncludeEndValue control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkIncludeEndValue; + + /// + /// lblShowValueMarks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblShowValueMarks; + + /// + /// chkShowValueMarks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkShowValueMarks; + + /// + /// lblIconsWeek control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblIconsWeek; + + /// + /// chkIconWeekPrio control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkIconWeekPrio; + + /// + /// imgIconWEEKPrioHigh control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIconWEEKPrioHigh; + + /// + /// imgIconWeekPrioLow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIconWeekPrioLow; + + /// + /// chkIconWeekRec control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkIconWeekRec; + + /// + /// imgIconWeekRec control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIconWeekRec; + + /// + /// chkIconWeekReminder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkIconWeekReminder; + + /// + /// imgIconWeekReminder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIconWeekReminder; + + /// + /// chkIconWeekEnroll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkIconWeekEnroll; + + /// + /// imgIconWeekEnroll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIconWeekEnroll; + + /// + /// plListViewGrid control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plListViewGrid; + + /// + /// rblListViewGrid control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButtonList rblListViewGrid; + + /// + /// plShowHeader control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plShowHeader; + + /// + /// rblShowHeader control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButtonList rblShowHeader; + + /// + /// plSelectedDays control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plSelectedDays; + + /// + /// rblSelectionTypeDays control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblSelectionTypeDays; + + /// + /// txtDaysBefore control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtDaysBefore; + + /// + /// Label4 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label Label4; + + /// + /// txtDaysAfter control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtDaysAfter; + + /// + /// Label8 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label Label8; + + /// + /// plSelectedNumEvents control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plSelectedNumEvents; + + /// + /// rblSelectionTypeEvents control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblSelectionTypeEvents; + + /// + /// txtNumEvents control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtNumEvents; + + /// + /// Label6 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label Label6; + + /// + /// txtEventDays control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtEventDays; + + /// + /// Label10 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label Label10; + + /// + /// plRestrictCategoriesToTimeFrame control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plRestrictCategoriesToTimeFrame; + + /// + /// chkRestrictCategoriesToTimeFrame control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkRestrictCategoriesToTimeFrame; + + /// + /// plRestrictLocationsToTimeFrame control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plRestrictLocationsToTimeFrame; + + /// + /// chkRestrictLocationsToTimeFrame control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkRestrictLocationsToTimeFrame; + + /// + /// plEventsFields control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plEventsFields; + + /// + /// plAvailable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label plAvailable; + + /// + /// plSelected control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label plSelected; + + /// + /// lstAvailable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ListBox lstAvailable; + + /// + /// cmdAdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdAdd; + + /// + /// cmdRemove control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdRemove; + + /// + /// cmdAddAll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdAddAll; + + /// + /// cmdRemoveAll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdRemoveAll; + + /// + /// lstAssigned control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ListBox lstAssigned; + + /// + /// plListPageSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plListPageSize; + + /// + /// ddlPageSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlPageSize; + + /// + /// plListDefaultSort control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plListDefaultSort; + + /// + /// ddlListSortedFieldDirection control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlListSortedFieldDirection; + + /// + /// plListDefaultColumn control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plListDefaultColumn; + + /// + /// ddlListDefaultColumn control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlListDefaultColumn; + + /// + /// lblCollapseRecurring control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblCollapseRecurring; + + /// + /// chkCollapseRecurring control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkCollapseRecurring; + + /// + /// lblIconsList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblIconsList; + + /// + /// chkIconListPrio control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkIconListPrio; + + /// + /// imgIconListPrioHigh control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIconListPrioHigh; + + /// + /// imgIconListPrioLow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIconListPrioLow; + + /// + /// chkIconListRec control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkIconListRec; + + /// + /// imgIconListRec control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIconListRec; + + /// + /// chkIconListReminder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkIconListReminder; + + /// + /// imgIconListReminder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIconListReminder; + + /// + /// chkIconListEnroll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkIconListEnroll; + + /// + /// imgIconListEnroll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIconListEnroll; + + /// + /// plListViewTable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plListViewTable; + + /// + /// chkListViewTable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkListViewTable; + + /// + /// plRptColumns control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plRptColumns; + + /// + /// txtRptColumns control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtRptColumns; + + /// + /// plRptRows control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plRptRows; + + /// + /// txtRptRows control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtRptRows; + + /// + /// plListViewUseTime control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plListViewUseTime; + + /// + /// chkListViewUseTime control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkListViewUseTime; + + /// + /// plCustomField1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plCustomField1; + + /// + /// chkCustomField1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkCustomField1; + + /// + /// plCustomField2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plCustomField2; + + /// + /// chkCustomField2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkCustomField2; + + /// + /// plToolTipMonth control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plToolTipMonth; + + /// + /// chkToolTipMonth control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkToolTipMonth; + + /// + /// plToolTipWeek control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plToolTipWeek; + + /// + /// chkToolTipWeek control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkToolTipWeek; + + /// + /// plToolTipDay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plToolTipDay; + + /// + /// chkToolTipDay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkToolTipDay; + + /// + /// plToolTipList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plToolTipList; + + /// + /// chkToolTipList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkToolTipList; + + /// + /// plTooltipLength control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plTooltipLength; + + /// + /// txtTooltipLength control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtTooltipLength; + + /// + /// plImageEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plImageEnabled; + + /// + /// chkImageEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkImageEnabled; + + /// + /// divImageEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divImageEnabled; + + /// + /// plEventImageMonth control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plEventImageMonth; + + /// + /// chkEventImageMonth control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEventImageMonth; + + /// + /// plEventImageWeek control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plEventImageWeek; + + /// + /// chkEventImageWeek control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEventImageWeek; + + /// + /// plMaxThumbWidth control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plMaxThumbWidth; + + /// + /// txtMaxThumbWidth control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtMaxThumbWidth; + + /// + /// plMaxThumbHeight control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plMaxThumbHeight; + + /// + /// txtMaxThumbHeight control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtMaxThumbHeight; + + /// + /// lblNewEventEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblNewEventEmail; + + /// + /// rblNewEventEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButtonList rblNewEventEmail; + + /// + /// ddNewEventEmailRoles control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddNewEventEmailRoles; + + /// + /// plNewPerEventEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plNewPerEventEmail; + + /// + /// chkNewPerEventEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkNewPerEventEmail; + + /// + /// plShowEventNotify control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plShowEventNotify; + + /// + /// chkEventNotify control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEventNotify; + + /// + /// divEventNotify control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divEventNotify; + + /// + /// lblNotifyAnon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblNotifyAnon; + + /// + /// chkNotifyAnon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkNotifyAnon; + + /// + /// lblSendReminderDefault control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblSendReminderDefault; + + /// + /// chkSendReminderDefault control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkSendReminderDefault; + + /// + /// lblReminderFrom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblReminderFrom; + + /// + /// txtReminderFrom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtReminderFrom; + + /// + /// valReminderFrom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valReminderFrom; + + /// + /// plEnrollment control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plEnrollment; + + /// + /// chkEventSignup control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEventSignup; + + /// + /// divEventSignup control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divEventSignup; + + /// + /// plEventSignupAllowPaid control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plEventSignupAllowPaid; + + /// + /// chkEventSignupAllowPaid control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEventSignupAllowPaid; + + /// + /// plAllowAnonEnroll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plAllowAnonEnroll; + + /// + /// chkAllowAnonEnroll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkAllowAnonEnroll; + + /// + /// divEventSignupAllowPaid control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divEventSignupAllowPaid; + + /// + /// plPayPal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plPayPal; + + /// + /// txtPayPalAccount control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPayPalAccount; + + /// + /// plPayPalURL control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plPayPalURL; + + /// + /// txtPayPalURL control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPayPalURL; + + /// + /// plDefaultEnrollView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plDefaultEnrollView; + + /// + /// chkDefaultEnrollView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkDefaultEnrollView; + + /// + /// plHideFullEnroll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plHideFullEnroll; + + /// + /// chkHideFullEnroll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkHideFullEnroll; + + /// + /// plMaxNoEnrolees control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plMaxNoEnrolees; + + /// + /// txtMaxNoEnrolees control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtMaxNoEnrolees; + + /// + /// plCancelDays control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plCancelDays; + + /// + /// txtCancelDays control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtCancelDays; + + /// + /// plEnrolListSortDirection control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plEnrolListSortDirection; + + /// + /// ddlEnrolListSortDirection control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlEnrolListSortDirection; + + /// + /// plEnrolListDaysBefore control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plEnrolListDaysBefore; + + /// + /// txtEnrolListDaysBefore control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtEnrolListDaysBefore; + + /// + /// plEnrolListDaysAfter control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plEnrolListDaysAfter; + + /// + /// txtEnrolListDaysAfter control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtEnrolListDaysAfter; + + /// + /// plEnrollColumns control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plEnrollColumns; + + /// + /// plEnVisibility control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label plEnVisibility; + + /// + /// plEnNone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label plEnNone; + + /// + /// plEnEditors control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label plEnEditors; + + /// + /// plEnViewers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label plEnViewers; + + /// + /// plEnAnon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label plEnAnon; + + /// + /// plEnUser control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label plEnUser; + + /// + /// rblEnUserNone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnUserNone; + + /// + /// rblEnUserEdit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnUserEdit; + + /// + /// rblEnUserView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnUserView; + + /// + /// rblEnUserAnon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnUserAnon; + + /// + /// plEnDisp control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label plEnDisp; + + /// + /// rblEnDispNone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnDispNone; + + /// + /// rblEnDispEdit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnDispEdit; + + /// + /// rblEnDispView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnDispView; + + /// + /// rblEnDispAnon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnDispAnon; + + /// + /// plEnEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label plEnEmail; + + /// + /// rblEnEmailNone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnEmailNone; + + /// + /// rblEnEmailEdit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnEmailEdit; + + /// + /// rblEnEmailView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnEmailView; + + /// + /// rblEnEmailAnon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnEmailAnon; + + /// + /// plEnPhone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label plEnPhone; + + /// + /// rblEnPhoneNone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnPhoneNone; + + /// + /// rblEnPhoneEdit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnPhoneEdit; + + /// + /// rblEnPhoneView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnPhoneView; + + /// + /// rblEnPhoneAnon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnPhoneAnon; + + /// + /// plEnApprove control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label plEnApprove; + + /// + /// rblEnApproveNone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnApproveNone; + + /// + /// rblEnApproveEdit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnApproveEdit; + + /// + /// rblEnApproveView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnApproveView; + + /// + /// rblEnApproveAnon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnApproveAnon; + + /// + /// plEnNo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label plEnNo; + + /// + /// rblEnNoNone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnNoNone; + + /// + /// rblEnNoEdit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnNoEdit; + + /// + /// rblEnNoView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnNoView; + + /// + /// rblEnNoAnon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputRadioButton rblEnNoAnon; + + /// + /// plEnrollEmailsToSend control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plEnrollEmailsToSend; + + /// + /// lblEnrollMessageApproved control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEnrollMessageApproved; + + /// + /// chkEnrollMessageApproved control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnrollMessageApproved; + + /// + /// lblEnrollMessageWaiting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEnrollMessageWaiting; + + /// + /// chkEnrollMessageWaiting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnrollMessageWaiting; + + /// + /// lblEnrollMessageDenied control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEnrollMessageDenied; + + /// + /// chkEnrollMessageDenied control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnrollMessageDenied; + + /// + /// lblEnrollMessageAdded control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEnrollMessageAdded; + + /// + /// chkEnrollMessageAdded control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnrollMessageAdded; + + /// + /// lblEnrollMessageDeleted control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEnrollMessageDeleted; + + /// + /// chkEnrollMessageDeleted control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnrollMessageDeleted; + + /// + /// lblEnrollMessagePaying control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEnrollMessagePaying; + + /// + /// chkEnrollMessagePaying control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnrollMessagePaying; + + /// + /// lblEnrollMessagePending control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEnrollMessagePending; + + /// + /// chkEnrollMessagePending control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnrollMessagePending; + + /// + /// lblEnrollMessagePaid control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEnrollMessagePaid; + + /// + /// chkEnrollMessagePaid control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnrollMessagePaid; + + /// + /// lblEnrollMessageIncorrect control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEnrollMessageIncorrect; + + /// + /// chkEnrollMessageIncorrect control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnrollMessageIncorrect; + + /// + /// lblEnrollMessageCancelled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEnrollMessageCancelled; + + /// + /// chkEnrollMessageCancelled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnrollMessageCancelled; + + /// + /// plModerateAll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plModerateAll; + + /// + /// chkModerateAll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkModerateAll; + + /// + /// plMaster control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plMaster; + + /// + /// chkMasterEvent control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkMasterEvent; + + /// + /// divMasterEvent control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divMasterEvent; + + /// + /// lblAddSubModuleName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblAddSubModuleName; + + /// + /// chkAddSubModuleName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkAddSubModuleName; + + /// + /// lblEnforceSubCalPerms control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEnforceSubCalPerms; + + /// + /// chkEnforceSubCalPerms control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnforceSubCalPerms; + + /// + /// plSubEvent control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plSubEvent; + + /// + /// plAvailableCals control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label plAvailableCals; + + /// + /// plSelectedCals control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label plSelectedCals; + + /// + /// lstAvailableCals control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ListBox lstAvailableCals; + + /// + /// cmdAddCals control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdAddCals; + + /// + /// cmdRemoveCals control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdRemoveCals; + + /// + /// cmdAddAllCals control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdAddAllCals; + + /// + /// cmdRemoveAllCals control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdRemoveAllCals; + + /// + /// lstAssignedCals control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ListBox lstAssignedCals; + + /// + /// lblEnableSEO control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEnableSEO; + + /// + /// chkEnableSEO control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnableSEO; + + /// + /// divSEOEnable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divSEOEnable; + + /// + /// lblSEODescriptionLength control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblSEODescriptionLength; + + /// + /// txtSEODescriptionLength control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSEODescriptionLength; + + /// + /// lblEnableSitemap control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblEnableSitemap; + + /// + /// chkEnableSitemap control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnableSitemap; + + /// + /// divSitemapEnable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divSitemapEnable; + + /// + /// lblSitemapPriority control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblSitemapPriority; + + /// + /// txtSitemapPriority control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSitemapPriority; + + /// + /// lblSitemapDaysBefore control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblSitemapDaysBefore; + + /// + /// txtSitemapDaysBefore control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSitemapDaysBefore; + + /// + /// lblSitemapDaysAfter control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblSitemapDaysAfter; + + /// + /// txtSitemapDaysAfter control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSitemapDaysAfter; + + /// + /// plRSSEnable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plRSSEnable; + + /// + /// chkRSSEnable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkRSSEnable; + + /// + /// divRSSEnable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divRSSEnable; + + /// + /// plRSSDateField control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plRSSDateField; + + /// + /// ddlRSSDateField control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlRSSDateField; + + /// + /// plRSSDays control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plRSSDays; + + /// + /// txtRSSDays control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtRSSDays; + + /// + /// plRSSTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plRSSTitle; + + /// + /// txtRSSTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtRSSTitle; + + /// + /// plRSSDesc control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plRSSDesc; + + /// + /// txtRSSDesc control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtRSSDesc; + + /// + /// plExportOwnerEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plExportOwnerEmail; + + /// + /// chkExportOwnerEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkExportOwnerEmail; + + /// + /// plExportAnonOwnerEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plExportAnonOwnerEmail; + + /// + /// chkExportAnonOwnerEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkExportAnonOwnerEmail; + + /// + /// pliCalOnIconBar control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl pliCalOnIconBar; + + /// + /// chkiCalOnIconBar control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkiCalOnIconBar; + + /// + /// pliCalEmailEnable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl pliCalEmailEnable; + + /// + /// chkiCalEmailEnable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkiCalEmailEnable; + + /// + /// pliCalURLinLocation control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl pliCalURLinLocation; + + /// + /// chkiCalURLinLocation control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkiCalURLinLocation; + + /// + /// pliCalIncludeCalname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl pliCalIncludeCalname; + + /// + /// chkiCalIncludeCalname control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkiCalIncludeCalname; + + /// + /// lbliCalDaysBefore control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lbliCalDaysBefore; + + /// + /// txtiCalDaysBefore control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtiCalDaysBefore; + + /// + /// lbliCalDaysAfter control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lbliCalDaysAfter; + + /// + /// txtiCalDaysAfter control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtiCalDaysAfter; + + /// + /// pliCalURLAppend control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl pliCalURLAppend; + + /// + /// txtiCalURLAppend control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtiCalURLAppend; + + /// + /// diviCalEventImage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl diviCalEventImage; + + /// + /// lbliCalDisplayImage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lbliCalDisplayImage; + + /// + /// chkiCalDisplayImage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkiCalDisplayImage; + + /// + /// diviCalDisplayImage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl diviCalDisplayImage; + + /// + /// lbliCalDefaultImage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lbliCalDefaultImage; + + /// + /// ctliCalDefaultImage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.UrlControl ctliCalDefaultImage; + + /// + /// pliCalURL control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl pliCalURL; + + /// + /// lbliCalURL control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox lbliCalURL; + + /// + /// plSocialGroupModule control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plSocialGroupModule; + + /// + /// ddlSocialGroupModule control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlSocialGroupModule; + + /// + /// lblSocialUserPrivate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblSocialUserPrivate; + + /// + /// chkSocialUserPrivate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkSocialUserPrivate; + + /// + /// lblSocialGroupSecurity control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblSocialGroupSecurity; + + /// + /// ddlSocialGroupSecurity control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlSocialGroupSecurity; + + /// + /// lblFBAdmins control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblFBAdmins; + + /// + /// txtFBAdmins control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtFBAdmins; + + /// + /// lblFBAppID control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblFBAppID; + + /// + /// txtFBAppID control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtFBAppID; + + /// + /// lblJournalIntegration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl lblJournalIntegration; + + /// + /// chkJournalIntegration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkJournalIntegration; + + /// + /// plTemplates control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UserControl plTemplates; + + /// + /// lnkTemplatesHelp control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlAnchor lnkTemplatesHelp; + + /// + /// ddlTemplates control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlTemplates; + + /// + /// txtEventTemplate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtEventTemplate; + + /// + /// cmdUpdateTemplate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.WebControls.CommandButton cmdUpdateTemplate; + + /// + /// cmdResetTemplate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.WebControls.CommandButton cmdResetTemplate; + + /// + /// lblTemplateUpdated control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblTemplateUpdated; + + /// + /// updateButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton updateButton; + + /// + /// cancelButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cancelButton; + } +} diff --git a/EventSettings.ascx.designer.vb b/EventSettings.ascx.designer.vb deleted file mode 100644 index 811cf48..0000000 --- a/EventSettings.ascx.designer.vb +++ /dev/null @@ -1,3464 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Namespace DotNetNuke.Modules.Events - - Partial Public Class EventSettings - - ''' - '''pnlEventsModuleSettings control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlEventsModuleSettings As Global.System.Web.UI.WebControls.Panel - - ''' - '''ValidationSummary1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ValidationSummary1 As Global.System.Web.UI.WebControls.ValidationSummary - - ''' - '''plTimeInterval control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plTimeInterval As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ddlTimeInterval control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlTimeInterval As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''plAllowRecurring control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plAllowRecurring As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkAllowRecurring control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkAllowRecurring As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plMaxRecurrences control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plMaxRecurrences As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtMaxRecurrences control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtMaxRecurrences As Global.System.Web.UI.WebControls.TextBox - - ''' - '''plPreventConflicts control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plPreventConflicts As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkPreventConflicts control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkPreventConflicts As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plLocationConflict control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plLocationConflict As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkLocationConflict control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkLocationConflict As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plEnableSearch control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEnableSearch As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkEnableSearch control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEnableSearch As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblOwnerChangeAllowed control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblOwnerChangeAllowed As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkOwnerChangeAllowed control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkOwnerChangeAllowed As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plExpireEvents control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plExpireEvents As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtExpireEvents control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtExpireEvents As Global.System.Web.UI.WebControls.TextBox - - ''' - '''plDays control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plDays As Global.System.Web.UI.WebControls.Label - - ''' - '''plPrivateMessage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plPrivateMessage As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtPrivateMessage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtPrivateMessage As Global.System.Web.UI.WebControls.TextBox - - ''' - '''plModuleCategory control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plModuleCategory As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ddlModuleCategories control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlModuleCategories As Global.DotNetNuke.Web.UI.WebControls.DnnComboBox - - ''' - '''plModuleLocation control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plModuleLocation As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ddlModuleLocations control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlModuleLocations As Global.DotNetNuke.Web.UI.WebControls.DnnComboBox - - ''' - '''lblStandardEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblStandardEmail As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtStandardEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtStandardEmail As Global.System.Web.UI.WebControls.TextBox - - ''' - '''valStandardEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valStandardEmail As Global.System.Web.UI.WebControls.RegularExpressionValidator - - ''' - '''lblTheme control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblTheme As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''rbThemeStandard control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rbThemeStandard As Global.System.Web.UI.WebControls.RadioButton - - ''' - '''ddlThemeStandard control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlThemeStandard As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''rbThemeCustom control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rbThemeCustom As Global.System.Web.UI.WebControls.RadioButton - - ''' - '''ddlThemeCustom control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlThemeCustom As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''lblDefaultView control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblDefaultView As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ddlDefaultView control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlDefaultView As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''lblAllowedViews control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblAllowedViews As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkMonthAllowed control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkMonthAllowed As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''chkWeekAllowed control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkWeekAllowed As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''chkListAllowed control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkListAllowed As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblEnableContainerSkin control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnableContainerSkin As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkEnableContainerSkin control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEnableContainerSkin As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblCategoriesEnable control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblCategoriesEnable As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ddlEnableCategories control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlEnableCategories As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''lblRestrictCategories control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblRestrictCategories As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkRestrictCategories control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkRestrictCategories As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblLocationsEnable control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblLocationsEnable As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ddlEnableLocations control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlEnableLocations As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''lblRestrictLocations control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblRestrictLocations As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkRestrictLocations control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkRestrictLocations As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plEnableEventNav control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEnableEventNav As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkEnableEventNav control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEnableEventNav As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plIconBar control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plIconBar As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''rblIconBar control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblIconBar As Global.System.Web.UI.WebControls.RadioButtonList - - ''' - '''plHTMLEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plHTMLEmail As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''rblHTMLEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblHTMLEmail As Global.System.Web.UI.WebControls.RadioButtonList - - ''' - '''plWeekStart control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plWeekStart As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ddlWeekStart control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlWeekStart As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''lblTimeZone control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblTimeZone As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''cboTimeZone control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cboTimeZone As Global.DotNetNuke.Web.UI.WebControls.DnnTimeZoneComboBox - - ''' - '''plTZDisplay control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plTZDisplay As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkTZDisplay control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkTZDisplay As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblPrimaryTimeZone control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblPrimaryTimeZone As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ddlPrimaryTimeZone control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlPrimaryTimeZone As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''lblSecondaryTimeZone control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblSecondaryTimeZone As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ddlSecondaryTimeZone control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlSecondaryTimeZone As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''plEnableEventTimeZones control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEnableEventTimeZones As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkEnableEventTimeZones control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEnableEventTimeZones As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblEventDetailNewPage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEventDetailNewPage As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkEventDetailNewPage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEventDetailNewPage As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblDetailPageAllowed control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblDetailPageAllowed As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkDetailPageAllowed control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkDetailPageAllowed As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblEnrollmentPageAllowed control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnrollmentPageAllowed As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkEnrollmentPageAllowed control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEnrollmentPageAllowed As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblEnrollmentPageDefaultURL control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnrollmentPageDefaultURL As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtEnrollmentPageDefaultURL control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtEnrollmentPageDefaultURL As Global.System.Web.UI.WebControls.TextBox - - ''' - '''lblEnableEnrollPopup control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnableEnrollPopup As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkEnableEnrollPopup control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEnableEnrollPopup As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblMonthCellEvents control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblMonthCellEvents As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkMonthCellEvents control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkMonthCellEvents As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plShowEventsAlways control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plShowEventsAlways As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkShowEventsAlways control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkShowEventsAlways As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plFridayWeekend control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plFridayWeekend As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkFridayWeekend control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkFridayWeekend As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plTimeInTitle control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plTimeInTitle As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkTimeInTitle control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkTimeInTitle As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblEventDayNewPage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEventDayNewPage As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkEventDayNewPage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEventDayNewPage As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblMonthDaySelect control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblMonthDaySelect As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkMonthDaySelect control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkMonthDaySelect As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblIconsMonth control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblIconsMonth As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkIconMonthPrio control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkIconMonthPrio As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''imgIconMonthPrioHigh control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgIconMonthPrioHigh As Global.System.Web.UI.WebControls.Image - - ''' - '''imgIconMonthPrioLow control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgIconMonthPrioLow As Global.System.Web.UI.WebControls.Image - - ''' - '''chkIconMonthRec control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkIconMonthRec As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''imgIconMonthRec control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgIconMonthRec As Global.System.Web.UI.WebControls.Image - - ''' - '''chkIconMonthReminder control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkIconMonthReminder As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''imgIconMonthReminder control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgIconMonthReminder As Global.System.Web.UI.WebControls.Image - - ''' - '''chkIconMonthEnroll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkIconMonthEnroll As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''imgIconMonthEnroll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgIconMonthEnroll As Global.System.Web.UI.WebControls.Image - - ''' - '''lblFullTimeScale control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblFullTimeScale As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkFullTimeScale control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkFullTimeScale As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblIncludeEndValue control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblIncludeEndValue As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkIncludeEndValue control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkIncludeEndValue As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblShowValueMarks control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblShowValueMarks As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkShowValueMarks control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkShowValueMarks As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblIconsWeek control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblIconsWeek As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkIconWeekPrio control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkIconWeekPrio As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''imgIconWEEKPrioHigh control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgIconWEEKPrioHigh As Global.System.Web.UI.WebControls.Image - - ''' - '''imgIconWeekPrioLow control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgIconWeekPrioLow As Global.System.Web.UI.WebControls.Image - - ''' - '''chkIconWeekRec control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkIconWeekRec As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''imgIconWeekRec control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgIconWeekRec As Global.System.Web.UI.WebControls.Image - - ''' - '''chkIconWeekReminder control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkIconWeekReminder As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''imgIconWeekReminder control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgIconWeekReminder As Global.System.Web.UI.WebControls.Image - - ''' - '''chkIconWeekEnroll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkIconWeekEnroll As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''imgIconWeekEnroll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgIconWeekEnroll As Global.System.Web.UI.WebControls.Image - - ''' - '''plListViewGrid control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plListViewGrid As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''rblListViewGrid control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblListViewGrid As Global.System.Web.UI.WebControls.RadioButtonList - - ''' - '''plShowHeader control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plShowHeader As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''rblShowHeader control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblShowHeader As Global.System.Web.UI.WebControls.RadioButtonList - - ''' - '''plSelectedDays control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plSelectedDays As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''rblSelectionTypeDays control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblSelectionTypeDays As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''txtDaysBefore control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtDaysBefore As Global.System.Web.UI.WebControls.TextBox - - ''' - '''Label4 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents Label4 As Global.System.Web.UI.WebControls.Label - - ''' - '''txtDaysAfter control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtDaysAfter As Global.System.Web.UI.WebControls.TextBox - - ''' - '''Label8 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents Label8 As Global.System.Web.UI.WebControls.Label - - ''' - '''plSelectedNumEvents control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plSelectedNumEvents As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''rblSelectionTypeEvents control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblSelectionTypeEvents As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''txtNumEvents control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtNumEvents As Global.System.Web.UI.WebControls.TextBox - - ''' - '''Label6 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents Label6 As Global.System.Web.UI.WebControls.Label - - ''' - '''txtEventDays control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtEventDays As Global.System.Web.UI.WebControls.TextBox - - ''' - '''Label10 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents Label10 As Global.System.Web.UI.WebControls.Label - - ''' - '''plRestrictCategoriesToTimeFrame control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plRestrictCategoriesToTimeFrame As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkRestrictCategoriesToTimeFrame control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkRestrictCategoriesToTimeFrame As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plRestrictLocationsToTimeFrame control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plRestrictLocationsToTimeFrame As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkRestrictLocationsToTimeFrame control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkRestrictLocationsToTimeFrame As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plEventsFields control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEventsFields As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''plAvailable control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plAvailable As Global.System.Web.UI.WebControls.Label - - ''' - '''plSelected control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plSelected As Global.System.Web.UI.WebControls.Label - - ''' - '''lstAvailable control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lstAvailable As Global.System.Web.UI.WebControls.ListBox - - ''' - '''cmdAdd control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdAdd As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''cmdRemove control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdRemove As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''cmdAddAll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdAddAll As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''cmdRemoveAll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdRemoveAll As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''lstAssigned control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lstAssigned As Global.System.Web.UI.WebControls.ListBox - - ''' - '''plListPageSize control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plListPageSize As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ddlPageSize control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlPageSize As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''plListDefaultSort control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plListDefaultSort As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ddlListSortedFieldDirection control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlListSortedFieldDirection As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''plListDefaultColumn control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plListDefaultColumn As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ddlListDefaultColumn control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlListDefaultColumn As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''lblCollapseRecurring control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblCollapseRecurring As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkCollapseRecurring control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkCollapseRecurring As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblIconsList control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblIconsList As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkIconListPrio control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkIconListPrio As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''imgIconListPrioHigh control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgIconListPrioHigh As Global.System.Web.UI.WebControls.Image - - ''' - '''imgIconListPrioLow control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgIconListPrioLow As Global.System.Web.UI.WebControls.Image - - ''' - '''chkIconListRec control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkIconListRec As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''imgIconListRec control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgIconListRec As Global.System.Web.UI.WebControls.Image - - ''' - '''chkIconListReminder control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkIconListReminder As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''imgIconListReminder control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgIconListReminder As Global.System.Web.UI.WebControls.Image - - ''' - '''chkIconListEnroll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkIconListEnroll As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''imgIconListEnroll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents imgIconListEnroll As Global.System.Web.UI.WebControls.Image - - ''' - '''plListViewTable control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plListViewTable As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkListViewTable control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkListViewTable As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plRptColumns control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plRptColumns As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtRptColumns control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtRptColumns As Global.System.Web.UI.WebControls.TextBox - - ''' - '''plRptRows control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plRptRows As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtRptRows control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtRptRows As Global.System.Web.UI.WebControls.TextBox - - ''' - '''plListViewUseTime control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plListViewUseTime As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkListViewUseTime control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkListViewUseTime As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plCustomField1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plCustomField1 As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkCustomField1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkCustomField1 As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plCustomField2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plCustomField2 As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkCustomField2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkCustomField2 As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plToolTipMonth control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plToolTipMonth As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkToolTipMonth control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkToolTipMonth As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plToolTipWeek control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plToolTipWeek As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkToolTipWeek control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkToolTipWeek As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plToolTipDay control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plToolTipDay As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkToolTipDay control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkToolTipDay As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plToolTipList control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plToolTipList As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkToolTipList control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkToolTipList As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plTooltipLength control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plTooltipLength As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtTooltipLength control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtTooltipLength As Global.System.Web.UI.WebControls.TextBox - - ''' - '''plImageEnabled control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plImageEnabled As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkImageEnabled control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkImageEnabled As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''divImageEnabled control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divImageEnabled As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''plEventImageMonth control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEventImageMonth As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkEventImageMonth control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEventImageMonth As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plEventImageWeek control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEventImageWeek As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkEventImageWeek control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEventImageWeek As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plMaxThumbWidth control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plMaxThumbWidth As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtMaxThumbWidth control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtMaxThumbWidth As Global.System.Web.UI.WebControls.TextBox - - ''' - '''plMaxThumbHeight control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plMaxThumbHeight As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtMaxThumbHeight control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtMaxThumbHeight As Global.System.Web.UI.WebControls.TextBox - - ''' - '''lblNewEventEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblNewEventEmail As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''rblNewEventEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblNewEventEmail As Global.System.Web.UI.WebControls.RadioButtonList - - ''' - '''ddNewEventEmailRoles control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddNewEventEmailRoles As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''plNewPerEventEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plNewPerEventEmail As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkNewPerEventEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkNewPerEventEmail As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plShowEventNotify control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plShowEventNotify As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkEventNotify control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEventNotify As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''divEventNotify control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divEventNotify As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblNotifyAnon control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblNotifyAnon As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkNotifyAnon control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkNotifyAnon As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblSendReminderDefault control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblSendReminderDefault As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkSendReminderDefault control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkSendReminderDefault As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblReminderFrom control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblReminderFrom As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtReminderFrom control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtReminderFrom As Global.System.Web.UI.WebControls.TextBox - - ''' - '''valReminderFrom control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valReminderFrom As Global.System.Web.UI.WebControls.RegularExpressionValidator - - ''' - '''plEnrollment control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEnrollment As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkEventSignup control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEventSignup As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''divEventSignup control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divEventSignup As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''plEventSignupAllowPaid control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEventSignupAllowPaid As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkEventSignupAllowPaid control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEventSignupAllowPaid As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plAllowAnonEnroll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plAllowAnonEnroll As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkAllowAnonEnroll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkAllowAnonEnroll As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''divEventSignupAllowPaid control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divEventSignupAllowPaid As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''plPayPal control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plPayPal As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtPayPalAccount control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtPayPalAccount As Global.System.Web.UI.WebControls.TextBox - - ''' - '''plPayPalURL control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plPayPalURL As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtPayPalURL control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtPayPalURL As Global.System.Web.UI.WebControls.TextBox - - ''' - '''plDefaultEnrollView control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plDefaultEnrollView As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkDefaultEnrollView control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkDefaultEnrollView As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plHideFullEnroll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plHideFullEnroll As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkHideFullEnroll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkHideFullEnroll As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plMaxNoEnrolees control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plMaxNoEnrolees As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtMaxNoEnrolees control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtMaxNoEnrolees As Global.System.Web.UI.WebControls.TextBox - - ''' - '''plCancelDays control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plCancelDays As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtCancelDays control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtCancelDays As Global.System.Web.UI.WebControls.TextBox - - ''' - '''plEnrolListSortDirection control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEnrolListSortDirection As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ddlEnrolListSortDirection control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlEnrolListSortDirection As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''plEnrolListDaysBefore control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEnrolListDaysBefore As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtEnrolListDaysBefore control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtEnrolListDaysBefore As Global.System.Web.UI.WebControls.TextBox - - ''' - '''plEnrolListDaysAfter control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEnrolListDaysAfter As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtEnrolListDaysAfter control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtEnrolListDaysAfter As Global.System.Web.UI.WebControls.TextBox - - ''' - '''plEnrollColumns control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEnrollColumns As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''plEnVisibility control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEnVisibility As Global.System.Web.UI.WebControls.Label - - ''' - '''plEnNone control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEnNone As Global.System.Web.UI.WebControls.Label - - ''' - '''plEnEditors control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEnEditors As Global.System.Web.UI.WebControls.Label - - ''' - '''plEnViewers control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEnViewers As Global.System.Web.UI.WebControls.Label - - ''' - '''plEnAnon control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEnAnon As Global.System.Web.UI.WebControls.Label - - ''' - '''plEnUser control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEnUser As Global.System.Web.UI.WebControls.Label - - ''' - '''rblEnUserNone control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnUserNone As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''rblEnUserEdit control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnUserEdit As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''rblEnUserView control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnUserView As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''rblEnUserAnon control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnUserAnon As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''plEnDisp control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEnDisp As Global.System.Web.UI.WebControls.Label - - ''' - '''rblEnDispNone control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnDispNone As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''rblEnDispEdit control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnDispEdit As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''rblEnDispView control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnDispView As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''rblEnDispAnon control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnDispAnon As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''plEnEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEnEmail As Global.System.Web.UI.WebControls.Label - - ''' - '''rblEnEmailNone control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnEmailNone As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''rblEnEmailEdit control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnEmailEdit As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''rblEnEmailView control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnEmailView As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''rblEnEmailAnon control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnEmailAnon As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''plEnPhone control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEnPhone As Global.System.Web.UI.WebControls.Label - - ''' - '''rblEnPhoneNone control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnPhoneNone As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''rblEnPhoneEdit control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnPhoneEdit As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''rblEnPhoneView control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnPhoneView As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''rblEnPhoneAnon control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnPhoneAnon As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''plEnApprove control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEnApprove As Global.System.Web.UI.WebControls.Label - - ''' - '''rblEnApproveNone control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnApproveNone As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''rblEnApproveEdit control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnApproveEdit As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''rblEnApproveView control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnApproveView As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''rblEnApproveAnon control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnApproveAnon As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''plEnNo control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEnNo As Global.System.Web.UI.WebControls.Label - - ''' - '''rblEnNoNone control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnNoNone As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''rblEnNoEdit control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnNoEdit As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''rblEnNoView control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnNoView As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''rblEnNoAnon control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rblEnNoAnon As Global.System.Web.UI.HtmlControls.HtmlInputRadioButton - - ''' - '''plEnrollEmailsToSend control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEnrollEmailsToSend As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''lblEnrollMessageApproved control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnrollMessageApproved As Global.System.Web.UI.WebControls.Label - - ''' - '''chkEnrollMessageApproved control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEnrollMessageApproved As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblEnrollMessageWaiting control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnrollMessageWaiting As Global.System.Web.UI.WebControls.Label - - ''' - '''chkEnrollMessageWaiting control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEnrollMessageWaiting As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblEnrollMessageDenied control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnrollMessageDenied As Global.System.Web.UI.WebControls.Label - - ''' - '''chkEnrollMessageDenied control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEnrollMessageDenied As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblEnrollMessageAdded control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnrollMessageAdded As Global.System.Web.UI.WebControls.Label - - ''' - '''chkEnrollMessageAdded control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEnrollMessageAdded As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblEnrollMessageDeleted control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnrollMessageDeleted As Global.System.Web.UI.WebControls.Label - - ''' - '''chkEnrollMessageDeleted control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEnrollMessageDeleted As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblEnrollMessagePaying control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnrollMessagePaying As Global.System.Web.UI.WebControls.Label - - ''' - '''chkEnrollMessagePaying control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEnrollMessagePaying As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblEnrollMessagePending control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnrollMessagePending As Global.System.Web.UI.WebControls.Label - - ''' - '''chkEnrollMessagePending control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEnrollMessagePending As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblEnrollMessagePaid control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnrollMessagePaid As Global.System.Web.UI.WebControls.Label - - ''' - '''chkEnrollMessagePaid control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEnrollMessagePaid As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblEnrollMessageIncorrect control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnrollMessageIncorrect As Global.System.Web.UI.WebControls.Label - - ''' - '''chkEnrollMessageIncorrect control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEnrollMessageIncorrect As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblEnrollMessageCancelled control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnrollMessageCancelled As Global.System.Web.UI.WebControls.Label - - ''' - '''chkEnrollMessageCancelled control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEnrollMessageCancelled As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plModerateAll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plModerateAll As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkModerateAll control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkModerateAll As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plMaster control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plMaster As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkMasterEvent control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkMasterEvent As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''divMasterEvent control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divMasterEvent As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblAddSubModuleName control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblAddSubModuleName As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkAddSubModuleName control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkAddSubModuleName As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblEnforceSubCalPerms control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnforceSubCalPerms As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkEnforceSubCalPerms control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEnforceSubCalPerms As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plSubEvent control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plSubEvent As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''plAvailableCals control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plAvailableCals As Global.System.Web.UI.WebControls.Label - - ''' - '''plSelectedCals control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plSelectedCals As Global.System.Web.UI.WebControls.Label - - ''' - '''lstAvailableCals control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lstAvailableCals As Global.System.Web.UI.WebControls.ListBox - - ''' - '''cmdAddCals control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdAddCals As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''cmdRemoveCals control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdRemoveCals As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''cmdAddAllCals control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdAddAllCals As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''cmdRemoveAllCals control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdRemoveAllCals As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''lstAssignedCals control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lstAssignedCals As Global.System.Web.UI.WebControls.ListBox - - ''' - '''lblEnableSEO control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnableSEO As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkEnableSEO control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEnableSEO As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''divSEOEnable control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divSEOEnable As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblSEODescriptionLength control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblSEODescriptionLength As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtSEODescriptionLength control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtSEODescriptionLength As Global.System.Web.UI.WebControls.TextBox - - ''' - '''lblEnableSitemap control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblEnableSitemap As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkEnableSitemap control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkEnableSitemap As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''divSitemapEnable control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divSitemapEnable As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lblSitemapPriority control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblSitemapPriority As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtSitemapPriority control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtSitemapPriority As Global.System.Web.UI.WebControls.TextBox - - ''' - '''lblSitemapDaysBefore control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblSitemapDaysBefore As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtSitemapDaysBefore control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtSitemapDaysBefore As Global.System.Web.UI.WebControls.TextBox - - ''' - '''lblSitemapDaysAfter control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblSitemapDaysAfter As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtSitemapDaysAfter control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtSitemapDaysAfter As Global.System.Web.UI.WebControls.TextBox - - ''' - '''plRSSEnable control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plRSSEnable As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkRSSEnable control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkRSSEnable As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''divRSSEnable control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divRSSEnable As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''plRSSDateField control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plRSSDateField As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ddlRSSDateField control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlRSSDateField As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''plRSSDays control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plRSSDays As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtRSSDays control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtRSSDays As Global.System.Web.UI.WebControls.TextBox - - ''' - '''plRSSTitle control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plRSSTitle As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtRSSTitle control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtRSSTitle As Global.System.Web.UI.WebControls.TextBox - - ''' - '''plRSSDesc control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plRSSDesc As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtRSSDesc control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtRSSDesc As Global.System.Web.UI.WebControls.TextBox - - ''' - '''plExportOwnerEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plExportOwnerEmail As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkExportOwnerEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkExportOwnerEmail As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plExportAnonOwnerEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plExportAnonOwnerEmail As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkExportAnonOwnerEmail control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkExportAnonOwnerEmail As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''pliCalOnIconBar control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pliCalOnIconBar As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkiCalOnIconBar control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkiCalOnIconBar As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''pliCalEmailEnable control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pliCalEmailEnable As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkiCalEmailEnable control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkiCalEmailEnable As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''pliCalURLinLocation control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pliCalURLinLocation As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkiCalURLinLocation control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkiCalURLinLocation As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''pliCalIncludeCalname control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pliCalIncludeCalname As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkiCalIncludeCalname control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkiCalIncludeCalname As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lbliCalDaysBefore control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lbliCalDaysBefore As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtiCalDaysBefore control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtiCalDaysBefore As Global.System.Web.UI.WebControls.TextBox - - ''' - '''lbliCalDaysAfter control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lbliCalDaysAfter As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtiCalDaysAfter control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtiCalDaysAfter As Global.System.Web.UI.WebControls.TextBox - - ''' - '''pliCalURLAppend control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pliCalURLAppend As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtiCalURLAppend control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtiCalURLAppend As Global.System.Web.UI.WebControls.TextBox - - ''' - '''diviCalEventImage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents diviCalEventImage As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lbliCalDisplayImage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lbliCalDisplayImage As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkiCalDisplayImage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkiCalDisplayImage As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''diviCalDisplayImage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents diviCalDisplayImage As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''lbliCalDefaultImage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lbliCalDefaultImage As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ctliCalDefaultImage control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ctliCalDefaultImage As Global.DotNetNuke.UI.UserControls.UrlControl - - ''' - '''pliCalURL control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pliCalURL As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''lbliCalURL control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lbliCalURL As Global.System.Web.UI.WebControls.TextBox - - ''' - '''plSocialGroupModule control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plSocialGroupModule As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ddlSocialGroupModule control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlSocialGroupModule As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''lblSocialUserPrivate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblSocialUserPrivate As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkSocialUserPrivate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkSocialUserPrivate As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''lblSocialGroupSecurity control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblSocialGroupSecurity As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''ddlSocialGroupSecurity control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlSocialGroupSecurity As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''lblFBAdmins control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblFBAdmins As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtFBAdmins control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtFBAdmins As Global.System.Web.UI.WebControls.TextBox - - ''' - '''lblFBAppID control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblFBAppID As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtFBAppID control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtFBAppID As Global.System.Web.UI.WebControls.TextBox - - ''' - '''lblJournalIntegration control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblJournalIntegration As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkJournalIntegration control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkJournalIntegration As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plTemplates control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plTemplates As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''lnkTemplatesHelp control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lnkTemplatesHelp As Global.System.Web.UI.HtmlControls.HtmlAnchor - - ''' - '''ddlTemplates control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ddlTemplates As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''txtEventTemplate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtEventTemplate As Global.System.Web.UI.WebControls.TextBox - - ''' - '''cmdUpdateTemplate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdUpdateTemplate As Global.DotNetNuke.UI.WebControls.CommandButton - - ''' - '''cmdResetTemplate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdResetTemplate As Global.DotNetNuke.UI.WebControls.CommandButton - - ''' - '''lblTemplateUpdated control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblTemplateUpdated As Global.System.Web.UI.WebControls.Label - - ''' - '''updateButton control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents updateButton As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''cancelButton control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cancelButton As Global.System.Web.UI.WebControls.LinkButton - End Class -End Namespace diff --git a/EventSettings.ascx.vb b/EventSettings.ascx.vb deleted file mode 100644 index 7834324..0000000 --- a/EventSettings.ascx.vb +++ /dev/null @@ -1,1573 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports System -Imports System.Web -Imports System.Web.UI.WebControls -Imports DotNetNuke.Entities.Tabs -Imports DotNetNuke.Entities.Modules -Imports DotNetNuke.Web.UI.WebControls.Extensions - -Namespace DotNetNuke.Modules.Events - - _ - Partial Class EventSettings - Inherits EventBase - -#Region " Web Form Designer Generated Code " - 'This call is required by the Web Form Designer. - Private Sub InitializeComponent() - End Sub - - Private Sub Page_Init(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Init - 'CODEGEN: This method call is required by the Web Form Designer - 'Do not modify it using the code editor. - InitializeComponent() - End Sub -#End Region - -#Region "Private Data" - Private ReadOnly _objCtlMasterEvent As New EventMasterController -#End Region - -#Region "Help Methods" - ' If adding new Setting also see 'SetDefaultModuleSettings' method in EventInfoHelper Class - - ''' - ''' Load current settings into the controls from the modulesettings - ''' - ''' - Private Sub Page_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load, Me.Load - If Security.PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) Or - IsSettingsEditor() Then - Else - Response.Redirect(GetSocialNavigateUrl(), True) - End If - - ' Set the selected theme - SetTheme(pnlEventsModuleSettings) - - ' Do we have to load the settings? - If Not Page.IsPostBack Then - LoadSettings() - End If - - ' Add the javascript to the page - AddJavaScript() - - End Sub - - Private Sub LoadSettings() - - Dim availableFields As New ArrayList - Dim selectedFields As New ArrayList - - ' Create Lists and Schedule - they should always exist - Dim objEventController As New EventController - objEventController.CreateListsAndSchedule() - - 'Set text and tooltip from resourcefile - chkMonthAllowed.Text = Localization.GetString("Month", LocalResourceFile) - chkWeekAllowed.Text = Localization.GetString("Week", LocalResourceFile) - chkListAllowed.Text = Localization.GetString("List", LocalResourceFile) - cmdAdd.ToolTip = Localization.GetString("Add", LocalResourceFile) - cmdAddAll.ToolTip = Localization.GetString("AddAll", LocalResourceFile) - cmdRemove.ToolTip = Localization.GetString("Remove", LocalResourceFile) - cmdRemoveAll.ToolTip = Localization.GetString("RemoveAll", LocalResourceFile) - cmdAddCals.ToolTip = Localization.GetString("AddCals", LocalResourceFile) - cmdAddAllCals.ToolTip = Localization.GetString("AddAllCals", LocalResourceFile) - cmdRemoveCals.ToolTip = Localization.GetString("RemoveCals", LocalResourceFile) - cmdRemoveAllCals.ToolTip = Localization.GetString("RemoveAllCals", LocalResourceFile) - chkIconMonthPrio.Text = Localization.GetString("Priority", LocalResourceFile) - imgIconMonthPrioHigh.AlternateText = Localization.GetString("HighPrio", LocalResourceFile) - imgIconMonthPrioLow.AlternateText = Localization.GetString("LowPrio", LocalResourceFile) - chkIconMonthRec.Text = Localization.GetString("Recurring", LocalResourceFile) - imgIconMonthRec.AlternateText = Localization.GetString("RecurringEvent", LocalResourceFile) - chkIconMonthReminder.Text = Localization.GetString("Reminder", LocalResourceFile) - imgIconMonthReminder.AlternateText = Localization.GetString("ReminderEnabled", LocalResourceFile) - chkIconMonthEnroll.Text = Localization.GetString("Enroll", LocalResourceFile) - imgIconMonthEnroll.AlternateText = Localization.GetString("EnrollEnabled", LocalResourceFile) - chkIconWeekPrio.Text = Localization.GetString("Priority", LocalResourceFile) - imgIconWEEKPrioHigh.AlternateText = Localization.GetString("HighPrio", LocalResourceFile) - imgIconWeekPrioLow.AlternateText = Localization.GetString("LowPrio", LocalResourceFile) - chkIconWeekRec.Text = Localization.GetString("Recurring", LocalResourceFile) - imgIconWeekRec.AlternateText = Localization.GetString("RecurringEvent", LocalResourceFile) - chkIconWeekReminder.Text = Localization.GetString("Reminder", LocalResourceFile) - imgIconWeekReminder.AlternateText = Localization.GetString("ReminderEnabled", LocalResourceFile) - chkIconWeekEnroll.Text = Localization.GetString("Enroll", LocalResourceFile) - imgIconWeekEnroll.AlternateText = Localization.GetString("EnrollEnabled", LocalResourceFile) - chkIconListPrio.Text = Localization.GetString("Priority", LocalResourceFile) - imgIconListPrioHigh.AlternateText = Localization.GetString("HighPrio", LocalResourceFile) - imgIconListPrioLow.AlternateText = Localization.GetString("LowPrio", LocalResourceFile) - chkIconListRec.Text = Localization.GetString("Recurring", LocalResourceFile) - imgIconListRec.AlternateText = Localization.GetString("RecurringEvent", LocalResourceFile) - chkIconListReminder.Text = Localization.GetString("Reminder", LocalResourceFile) - imgIconListReminder.AlternateText = Localization.GetString("ReminderEnabled", LocalResourceFile) - chkIconListEnroll.Text = Localization.GetString("Enroll", LocalResourceFile) - imgIconListEnroll.AlternateText = Localization.GetString("EnrollEnabled", LocalResourceFile) - cmdUpdateTemplate.Text = Localization.GetString("cmdUpdateTemplate", LocalResourceFile) - rbThemeStandard.Text = Localization.GetString("rbThemeStandard", LocalResourceFile) - rbThemeCustom.Text = Localization.GetString("rbThemeCustom", LocalResourceFile) - ddlModuleCategories.EmptyMessage = Localization.GetString("NoCategories", LocalResourceFile) - ddlModuleCategories.Localization.AllItemsCheckedString = Localization.GetString("AllCategories", LocalResourceFile) - ddlModuleCategories.Localization.CheckAllString = Localization.GetString("SelectAllCategories", LocalResourceFile) - ddlModuleLocations.EmptyMessage = Localization.GetString("NoLocations", LocalResourceFile) - ddlModuleLocations.Localization.AllItemsCheckedString = Localization.GetString("AllLocations", LocalResourceFile) - ddlModuleLocations.Localization.CheckAllString = Localization.GetString("SelectAllLocations", LocalResourceFile) - - - 'Add templates link - ' lnkTemplatesHelp.HRef = AddSkinContainerControls(EditUrl("", "", "TemplateHelp", "dnnprintmode=true"), "?") - lnkTemplatesHelp.HRef = AddSkinContainerControls(NavigateURL(TabId, PortalSettings, "", "mid=" & ModuleId, "ctl=TemplateHelp", "ShowNav=False", "dnnprintmode=true"), "?") - lnkTemplatesHelp.InnerText = Localization.GetString("TemplatesHelp", LocalResourceFile) - - 'Support for Time Interval Dropdown - Dim ctlLists As New Lists.ListController - Dim colThreadStatus As Generic.IEnumerable(Of Lists.ListEntryInfo) = ctlLists.GetListEntryInfoItems("Timeinterval") - ddlTimeInterval.Items.Clear() - - For Each entry As Lists.ListEntryInfo In colThreadStatus - ddlTimeInterval.Items.Add(entry.Value) - Next - ddlTimeInterval.Items.FindByValue(Settings.Timeinterval).Selected = True - - ' Set Dropdown TimeZone - cboTimeZone.DataBind(Settings.TimeZoneId) - - chkEnableEventTimeZones.Checked = Settings.EnableEventTimeZones - - BindToEnum(GetType(EventModuleSettings.TimeZones), ddlPrimaryTimeZone) - ddlPrimaryTimeZone.Items.FindByValue(CType(Settings.PrimaryTimeZone, String)).Selected = True - BindToEnum(GetType(EventModuleSettings.TimeZones), ddlSecondaryTimeZone) - ddlSecondaryTimeZone.Items.FindByValue(CType(Settings.SecondaryTimeZone, String)).Selected = True - - chkToolTipMonth.Checked = Settings.Eventtooltipmonth - chkToolTipWeek.Checked = Settings.Eventtooltipweek - chkToolTipDay.Checked = Settings.Eventtooltipday - chkToolTipList.Checked = Settings.Eventtooltiplist - txtTooltipLength.Text = Settings.Eventtooltiplength.ToString - chkImageEnabled.Checked = Settings.Eventimage - txtMaxThumbHeight.Text = Settings.MaxThumbHeight.ToString - txtMaxThumbWidth.Text = Settings.MaxThumbWidth.ToString - - chkMonthCellEvents.Checked = True - If Settings.Monthcellnoevents Then - chkMonthCellEvents.Checked = False - End If - - chkAddSubModuleName.Checked = Settings.Addsubmodulename - chkEnforceSubCalPerms.Checked = Settings.Enforcesubcalperms - - BindToEnum(GetType(EventModuleSettings.DisplayCategories), ddlEnableCategories) - ddlEnableCategories.Items.FindByValue(CType(Settings.Enablecategories, String)).Selected = True - chkRestrictCategories.Checked = Settings.Restrictcategories - BindToEnum(GetType(EventModuleSettings.DisplayLocations), ddlEnableLocations) - ddlEnableLocations.Items.FindByValue(CType(Settings.Enablelocations, String)).Selected = True - chkRestrictLocations.Checked = Settings.Restrictlocations - - chkEnableContainerSkin.Checked = Settings.Enablecontainerskin - chkEventDetailNewPage.Checked = Settings.Eventdetailnewpage - chkEnableEnrollPopup.Checked = Settings.Enableenrollpopup - chkEventImageMonth.Checked = Settings.EventImageMonth - chkEventImageWeek.Checked = Settings.EventImageWeek - chkEventDayNewPage.Checked = Settings.Eventdaynewpage - chkFullTimeScale.Checked = Settings.Fulltimescale - chkCollapseRecurring.Checked = Settings.Collapserecurring - chkIncludeEndValue.Checked = Settings.Includeendvalue - chkShowValueMarks.Checked = Settings.Showvaluemarks - - chkEnableSEO.Checked = Settings.EnableSEO - txtSEODescriptionLength.Text = Settings.SEODescriptionLength.ToString - - chkEnableSitemap.Checked = Settings.EnableSitemap - txtSitemapPriority.Text = Settings.SiteMapPriority.ToString - txtSitemapDaysBefore.Text = Settings.SiteMapDaysBefore.ToString - txtSitemapDaysAfter.Text = Settings.SiteMapDaysAfter.ToString - - chkiCalOnIconBar.Checked = Settings.IcalOnIconBar - chkiCalEmailEnable.Checked = Settings.IcalEmailEnable - chkiCalURLinLocation.Checked = Settings.IcalURLInLocation - chkiCalIncludeCalname.Checked = Settings.IcalIncludeCalname - txtiCalDaysBefore.Text = Settings.IcalDaysBefore.ToString - txtiCalDaysAfter.Text = Settings.IcalDaysAfter.ToString - txtiCalURLAppend.Text = Settings.IcalURLAppend - ctliCalDefaultImage.FileFilter = glbImageFileTypes - ctliCalDefaultImage.Url = "" - chkiCalDisplayImage.Checked = False - If Settings.IcalDefaultImage <> "" Then - ctliCalDefaultImage.Url = Mid(Settings.IcalDefaultImage, 7) - chkiCalDisplayImage.Checked = True - End If - If ctliCalDefaultImage.Url.StartsWith("FileID=") Then - Dim fileId As Integer = Integer.Parse(ctliCalDefaultImage.Url.Substring(7)) - Dim objFileInfo As Services.FileSystem.IFileInfo = Services.FileSystem.FileManager.Instance.GetFile(fileId) - If Not objFileInfo Is Nothing Then - ctliCalDefaultImage.Url = objFileInfo.Folder & objFileInfo.FileName - Else - ctliCalDefaultImage.Url = "" - End If - End If - Dim socialGroupId As Integer = GetUrlGroupId() - Dim socialGroupStr As String = "" - If socialGroupId > 0 Then - socialGroupStr = "&groupid=" & socialGroupId.ToString - End If - lbliCalURL.Text = AddHTTP(PortalSettings.PortalAlias.HTTPAlias & "/DesktopModules/Events/EventVCal.aspx?ItemID=0&Mid=" & ModuleId & "&tabid=" & TabId & socialGroupStr) - - ' Set Up Themes - LoadThemes() - - txtPayPalURL.Text = Settings.Paypalurl - - chkEnableEventNav.Checked = True - If Settings.DisableEventnav Then - chkEnableEventNav.Checked = False - End If - - chkAllowRecurring.Checked = Settings.Allowreoccurring - txtMaxRecurrences.Text = Settings.Maxrecurrences.ToString - chkEventNotify.Checked = Settings.Eventnotify - chkDetailPageAllowed.Checked = Settings.DetailPageAllowed - chkEnrollmentPageAllowed.Checked = Settings.EnrollmentPageAllowed - txtEnrollmentPageDefaultURL.Text = Settings.EnrollmentPageDefaultUrl - chkNotifyAnon.Checked = Settings.Notifyanon - chkSendReminderDefault.Checked = Settings.Sendreminderdefault - - rblNewEventEmail.Items(0).Selected = True - Select Case Settings.Neweventemails - Case "Subscribe" - rblNewEventEmail.Items(1).Selected = True - Case "Role" - rblNewEventEmail.Items(2).Selected = True - End Select - - LoadNewEventEmailRoles(Settings.Neweventemailrole) - chkNewPerEventEmail.Checked = Settings.Newpereventemail - - ddlDefaultView.Items.Clear() - ddlDefaultView.Items.Add(New ListItem(Localization.GetString("Month", LocalResourceFile), "EventMonth.ascx")) - ddlDefaultView.Items.Add(New ListItem(Localization.GetString("Week", LocalResourceFile), "EventWeek.ascx")) - ddlDefaultView.Items.Add(New ListItem(Localization.GetString("List", LocalResourceFile), "EventList.ascx")) - - ddlDefaultView.Items.FindByValue(Settings.DefaultView).Selected = True - - chkMonthAllowed.Checked = Settings.MonthAllowed - chkWeekAllowed.Checked = Settings.WeekAllowed - chkListAllowed.Checked = Settings.ListAllowed - chkEnableSearch.Checked = Settings.Eventsearch - chkPreventConflicts.Checked = Settings.Preventconflicts - chkLocationConflict.Checked = Settings.Locationconflict - chkShowEventsAlways.Checked = Settings.ShowEventsAlways - chkTimeInTitle.Checked = Settings.Timeintitle - chkMonthDaySelect.Checked = Settings.Monthdayselect - chkEventSignup.Checked = Settings.Eventsignup - chkEventSignupAllowPaid.Checked = Settings.Eventsignupallowpaid - chkDefaultEnrollView.Checked = Settings.Eventdefaultenrollview - chkHideFullEnroll.Checked = Settings.Eventhidefullenroll() - txtMaxNoEnrolees.Text = Settings.Maxnoenrolees.ToString - txtCancelDays.Text = Settings.Enrolcanceldays.ToString - chkFridayWeekend.Checked = Settings.Fridayweekend - chkModerateAll.Checked = Settings.Moderateall - chkTZDisplay.Checked = Settings.Tzdisplay - chkListViewUseTime.Checked = Settings.ListViewUseTime - - txtPayPalAccount.Text = Settings.Paypalaccount - If txtPayPalAccount.Text.Length = 0 Then - txtPayPalAccount.Text = PortalSettings.Email - End If - - txtReminderFrom.Text = Settings.Reminderfrom - If txtReminderFrom.Text.Length = 0 Then - txtReminderFrom.Text = PortalSettings.Email - End If - - txtStandardEmail.Text = Settings.StandardEmail - If txtStandardEmail.Text.Length = 0 Then - txtStandardEmail.Text = PortalSettings.Email - End If - - BindSubEvents() - BindAvailableEvents() - - chkMasterEvent.Checked = Settings.MasterEvent - - Enable_Disable_Cals() - - chkIconMonthPrio.Checked = Settings.IconMonthPrio - chkIconWeekPrio.Checked = Settings.IconWeekPrio - chkIconListPrio.Checked = Settings.IconListPrio - chkIconMonthRec.Checked = Settings.IconMonthRec - chkIconWeekRec.Checked = Settings.IconMonthRec - chkIconListRec.Checked = Settings.IconListRec - chkIconMonthReminder.Checked = Settings.IconMonthReminder - chkIconWeekReminder.Checked = Settings.IconWeekReminder - chkIconListReminder.Checked = Settings.IconListReminder - chkIconMonthEnroll.Checked = Settings.IconMonthEnroll - chkIconWeekEnroll.Checked = Settings.IconWeekEnroll - chkIconListEnroll.Checked = Settings.IconListEnroll - txtPrivateMessage.Text = Settings.PrivateMessage - - Dim columnNo As Integer - For columnNo = 1 To 13 - Dim columnAcronym As String = GetListColumnAcronym(columnNo) - Dim columnName As String = GetListColumnName(columnAcronym) - If Settings.EventsListFields.LastIndexOf(columnAcronym, StringComparison.Ordinal) > -1 Then - selectedFields.Add(columnName) - Else - availableFields.Add(columnName) - End If - Next - - lstAvailable.DataSource = availableFields - lstAvailable.DataBind() - Sort(lstAvailable) - - lstAssigned.DataSource = selectedFields - lstAssigned.DataBind() - Sort(lstAssigned) - - If Settings.EventsListSelectType = rblSelectionTypeDays.Value Then - rblSelectionTypeDays.Checked = True - rblSelectionTypeEvents.Checked = False - Else - rblSelectionTypeDays.Checked = False - rblSelectionTypeEvents.Checked = True - End If - - If Settings.ListViewGrid Then - rblListViewGrid.Items(0).Selected = True - Else - rblListViewGrid.Items(1).Selected = True - End If - chkListViewTable.Checked = Settings.ListViewTable - txtRptColumns.Text = Settings.RptColumns.ToString - txtRptRows.Text = Settings.RptRows.ToString - - ' Do we have to display the EventsList header? - If Settings.EventsListShowHeader <> "No" Then - rblShowHeader.Items(0).Selected = True - Else - rblShowHeader.Items(1).Selected = True - End If - - txtDaysBefore.Text = Settings.EventsListBeforeDays.ToString - txtDaysAfter.Text = Settings.EventsListAfterDays.ToString - txtNumEvents.Text = Settings.EventsListNumEvents.ToString - txtEventDays.Text = Settings.EventsListEventDays.ToString - chkRestrictCategoriesToTimeFrame.Checked = Settings.RestrictCategoriesToTimeFrame - chkRestrictLocationsToTimeFrame.Checked = Settings.RestrictLocationsToTimeFrame - - chkCustomField1.Checked = Settings.EventsCustomField1 - chkCustomField2.Checked = Settings.EventsCustomField2 - - ddlPageSize.Items.FindByValue(CStr(Settings.EventsListPageSize)).Selected = True - ddlListSortedFieldDirection.Items.Clear() - ddlListSortedFieldDirection.Items.Add(New ListItem(Localization.GetString("Asc", LocalResourceFile), "ASC")) - ddlListSortedFieldDirection.Items.Add(New ListItem(Localization.GetString("Desc", LocalResourceFile), "DESC")) - ddlListSortedFieldDirection.Items.FindByValue(Settings.EventsListSortDirection).Selected = True - - ddlListDefaultColumn.Items.Clear() - ddlListDefaultColumn.Items.Add(New ListItem(Localization.GetString("SortEventID", LocalResourceFile), "EventID")) - ddlListDefaultColumn.Items.Add(New ListItem(Localization.GetString("SortEventDateBegin", LocalResourceFile), "EventDateBegin")) - ddlListDefaultColumn.Items.Add(New ListItem(Localization.GetString("SortEventDateEnd", LocalResourceFile), "EventDateEnd")) - ddlListDefaultColumn.Items.Add(New ListItem(Localization.GetString("SortEventName", LocalResourceFile), "EventName")) - ddlListDefaultColumn.Items.Add(New ListItem(Localization.GetString("SortDuration", LocalResourceFile), "Duration")) - ddlListDefaultColumn.Items.Add(New ListItem(Localization.GetString("SortCategoryName", LocalResourceFile), "CategoryName")) - ddlListDefaultColumn.Items.Add(New ListItem(Localization.GetString("SortCustomField1", LocalResourceFile), "CustomField1")) - ddlListDefaultColumn.Items.Add(New ListItem(Localization.GetString("SortCustomField2", LocalResourceFile), "CustomField2")) - ddlListDefaultColumn.Items.Add(New ListItem(Localization.GetString("SortDescription", LocalResourceFile), "Description")) - ddlListDefaultColumn.Items.Add(New ListItem(Localization.GetString("SortLocationName", LocalResourceFile), "LocationName")) - ddlListDefaultColumn.Items.FindByValue(Settings.EventsListSortColumn).Selected = True - - ddlWeekStart.Items.Clear() - ddlWeekStart.Items.Add(New ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Default.ToString, CInt(System.Web.UI.WebControls.FirstDayOfWeek.Default).ToString)) - ddlWeekStart.Items.Add(New ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Monday.ToString, CInt(System.Web.UI.WebControls.FirstDayOfWeek.Monday).ToString)) - ddlWeekStart.Items.Add(New ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Tuesday.ToString, CInt(System.Web.UI.WebControls.FirstDayOfWeek.Tuesday).ToString)) - ddlWeekStart.Items.Add(New ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Wednesday.ToString, CInt(System.Web.UI.WebControls.FirstDayOfWeek.Wednesday).ToString)) - ddlWeekStart.Items.Add(New ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Thursday.ToString, CInt(System.Web.UI.WebControls.FirstDayOfWeek.Thursday).ToString)) - ddlWeekStart.Items.Add(New ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Friday.ToString, CInt(System.Web.UI.WebControls.FirstDayOfWeek.Friday).ToString)) - ddlWeekStart.Items.Add(New ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Saturday.ToString, CInt(System.Web.UI.WebControls.FirstDayOfWeek.Saturday).ToString)) - ddlWeekStart.Items.Add(New ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Sunday.ToString, CInt(System.Web.UI.WebControls.FirstDayOfWeek.Sunday).ToString)) - ddlWeekStart.Items.FindByValue(CInt(Settings.WeekStart).ToString).Selected = True - - If Settings.EnrollEditFields.LastIndexOf("01", StringComparison.Ordinal) > -1 Then - rblEnUserEdit.Checked = True - ElseIf Settings.EnrollViewFields.LastIndexOf("01", StringComparison.Ordinal) > -1 Then - rblEnUserView.Checked = True - ElseIf Settings.EnrollAnonFields.LastIndexOf("01", StringComparison.Ordinal) > -1 Then - rblEnUserAnon.Checked = True - Else - rblEnUserNone.Checked = True - End If - - If Settings.EnrollEditFields.LastIndexOf("02", StringComparison.Ordinal) > -1 Then - rblEnDispEdit.Checked = True - ElseIf Settings.EnrollViewFields.LastIndexOf("02", StringComparison.Ordinal) > -1 Then - rblEnDispView.Checked = True - ElseIf Settings.EnrollAnonFields.LastIndexOf("02", StringComparison.Ordinal) > -1 Then - rblEnDispAnon.Checked = True - Else - rblEnDispNone.Checked = True - End If - - If Settings.EnrollEditFields.LastIndexOf("03", StringComparison.Ordinal) > -1 Then - rblEnEmailEdit.Checked = True - ElseIf Settings.EnrollViewFields.LastIndexOf("03", StringComparison.Ordinal) > -1 Then - rblEnEmailView.Checked = True - ElseIf Settings.EnrollAnonFields.LastIndexOf("03", StringComparison.Ordinal) > -1 Then - rblEnEmailAnon.Checked = True - Else - rblEnEmailNone.Checked = True - End If - - If Settings.EnrollEditFields.LastIndexOf("04", StringComparison.Ordinal) > -1 Then - rblEnPhoneEdit.Checked = True - ElseIf Settings.EnrollViewFields.LastIndexOf("04", StringComparison.Ordinal) > -1 Then - rblEnPhoneView.Checked = True - ElseIf Settings.EnrollAnonFields.LastIndexOf("04", StringComparison.Ordinal) > -1 Then - rblEnPhoneAnon.Checked = True - Else - rblEnPhoneNone.Checked = True - End If - - If Settings.EnrollEditFields.LastIndexOf("05", StringComparison.Ordinal) > -1 Then - rblEnApproveEdit.Checked = True - ElseIf Settings.EnrollViewFields.LastIndexOf("05", StringComparison.Ordinal) > -1 Then - rblEnApproveView.Checked = True - ElseIf Settings.EnrollAnonFields.LastIndexOf("05", StringComparison.Ordinal) > -1 Then - rblEnApproveAnon.Checked = True - Else - rblEnApproveNone.Checked = True - End If - - If Settings.EnrollEditFields.LastIndexOf("06", StringComparison.Ordinal) > -1 Then - rblEnNoEdit.Checked = True - ElseIf Settings.EnrollViewFields.LastIndexOf("06", StringComparison.Ordinal) > -1 Then - rblEnNoView.Checked = True - ElseIf Settings.EnrollAnonFields.LastIndexOf("06", StringComparison.Ordinal) > -1 Then - rblEnNoAnon.Checked = True - Else - rblEnNoNone.Checked = True - End If - - - chkRSSEnable.Checked = Settings.RSSEnable - ddlRSSDateField.Items.Clear() - ddlRSSDateField.Items.Add(New ListItem(Localization.GetString("UpdatedDate", LocalResourceFile), "UPDATEDDATE")) - ddlRSSDateField.Items.Add(New ListItem(Localization.GetString("CreationDate", LocalResourceFile), "CREATIONDATE")) - ddlRSSDateField.Items.Add(New ListItem(Localization.GetString("EventDate", LocalResourceFile), "EVENTDATE")) - ddlRSSDateField.Items.FindByValue(Settings.RSSDateField).Selected = True - txtRSSDays.Text = Settings.RSSDays.ToString - txtRSSTitle.Text = Settings.RSSTitle - txtRSSDesc.Text = Settings.RSSDesc - txtExpireEvents.Text = Settings.Expireevents - chkExportOwnerEmail.Checked = Settings.Exportowneremail - chkExportAnonOwnerEmail.Checked = Settings.Exportanonowneremail - chkOwnerChangeAllowed.Checked = Settings.Ownerchangeallowed - - txtFBAdmins.Text = Settings.FBAdmins - txtFBAppID.Text = Settings.FBAppID - - Select Case Settings.IconBar - Case "BOTTOM" - rblIconBar.Items(1).Selected = True - Case "NONE" - rblIconBar.Items(2).Selected = True - Case Else - rblIconBar.Items(0).Selected = True - End Select - - Select Case Settings.HTMLEmail - Case "auto" - rblHTMLEmail.Items(1).Selected = True - Case "text" - rblHTMLEmail.Items(2).Selected = True - Case Else - rblHTMLEmail.Items(0).Selected = True - End Select - - - chkEnrollMessageApproved.Checked = Settings.SendEnrollMessageApproved - chkEnrollMessageWaiting.Checked = Settings.SendEnrollMessageWaiting - chkEnrollMessageDenied.Checked = Settings.SendEnrollMessageDenied - chkEnrollMessageAdded.Checked = Settings.SendEnrollMessageAdded - chkEnrollMessageDeleted.Checked = Settings.SendEnrollMessageDeleted - chkEnrollMessagePaying.Checked = Settings.SendEnrollMessagePaying - chkEnrollMessagePending.Checked = Settings.SendEnrollMessagePending - chkEnrollMessagePaid.Checked = Settings.SendEnrollMessagePaid - chkEnrollMessageIncorrect.Checked = Settings.SendEnrollMessageIncorrect - chkEnrollMessageCancelled.Checked = Settings.SendEnrollMessageCancelled - - chkAllowAnonEnroll.Checked = Settings.AllowAnonEnroll - BindToEnum(GetType(EventModuleSettings.SocialModule), ddlSocialGroupModule) - ddlSocialGroupModule.Items.FindByValue(CType(Settings.SocialGroupModule, String)).Selected = True - chkSocialUserPrivate.Checked = Settings.SocialUserPrivate - BindToEnum(GetType(EventModuleSettings.SocialGroupPrivacy), ddlSocialGroupSecurity) - ddlSocialGroupSecurity.Items.FindByValue(CType(Settings.SocialGroupSecurity, String)).Selected = True - - ddlEnrolListSortDirection.Items.Clear() - ddlEnrolListSortDirection.Items.Add(New ListItem(Localization.GetString("Asc", LocalResourceFile), "0")) - ddlEnrolListSortDirection.Items.Add(New ListItem(Localization.GetString("Desc", LocalResourceFile), "1")) - ddlEnrolListSortDirection.Items.FindByValue(CInt(Settings.EnrolListSortDirection).ToString).Selected = True - - txtEnrolListDaysBefore.Text = Settings.EnrolListDaysBefore.ToString - txtEnrolListDaysAfter.Text = Settings.EnrolListDaysAfter.ToString - - chkJournalIntegration.Checked = Settings.JournalIntegration - - LoadCategories() - LoadLocations() - - LoadTemplates() - - End Sub - - Private Sub AddJavaScript() - 'Add the external Validation.js to the Page - Const csname As String = "ExtValidationScriptFile" - Dim cstype As Type = Reflection.MethodBase.GetCurrentMethod().GetType() - Dim cstext As String = "" - If Not Page.ClientScript.IsClientScriptBlockRegistered(csname) Then - Page.ClientScript.RegisterClientScriptBlock(cstype, csname, cstext, False) - End If - - - ' Add javascript actions where required and build startup script - Dim script As String - Dim cstext2 As String = "" - cstext2 += "" - - ' Register the startup script - Const csname2 As String = "EventSettingsStartupScript" - Dim cstype2 As Type = Reflection.MethodBase.GetCurrentMethod().GetType() - If Not Page.ClientScript.IsStartupScriptRegistered(csname2) Then - Page.ClientScript.RegisterStartupScript(cstype2, csname2, cstext2, False) - End If - - End Sub - - Private Sub BindToEnum(enumType As Type, ByVal ddl As System.Web.UI.WebControls.DropDownList) - ' get the names from the enumeration - Dim names As String() = [Enum].GetNames(enumType) - ' get the values from the enumeration - Dim values As Array = [Enum].GetValues(enumType) - ' turn it into a hash table - ddl.Items.Clear() - For i As Integer = 0 To names.Length - 1 - ' note the cast to integer here is important - ' otherwise we'll just get the enum string back again - ddl.Items.Add(New ListItem(Localization.GetString(names(i), LocalResourceFile), CStr(CInt(values.GetValue(i))))) - Next - ' return the dictionary to be bound to - End Sub - - - Private Function GetListColumnName(ByVal columnAcronym As String) As String - Select Case columnAcronym - Case "EB" - Return "01 - " & Localization.GetString("EditButton", LocalResourceFile) - Case "BD" - Return "02 - " & Localization.GetString("BeginDateTime", LocalResourceFile) - Case "ED" - Return "03 - " & Localization.GetString("EndDateTime", LocalResourceFile) - Case "EN" - Return "04 - " & Localization.GetString("EventName", LocalResourceFile) - Case "IM" - Return "05 - " & Localization.GetString("Image", LocalResourceFile) - Case "DU" - Return "06 - " & Localization.GetString("Duration", LocalResourceFile) - Case "CA" - Return "07 - " & Localization.GetString("Category", LocalResourceFile) - Case "LO" - Return "08 - " & Localization.GetString("Location", LocalResourceFile) - Case "C1" - Return "09 - " & Localization.GetString("CustomField1", LocalResourceFile) - Case "C2" - Return "10 - " & Localization.GetString("CustomField2", LocalResourceFile) - Case "DE" - Return "11 - " & Localization.GetString("Description", LocalResourceFile) - Case "RT" - Return "12 - " & Localization.GetString("RecurText", LocalResourceFile) - Case "RU" - Return "13 - " & Localization.GetString("RecurUntil", LocalResourceFile) - Case Else - Return "" - End Select - End Function - - Private Function GetListColumnAcronym(ByVal columnNo As Integer) As String - Select Case columnNo - Case 1 - Return "EB" - Case 2 - Return "BD" - Case 3 - Return "ED" - Case 4 - Return "EN" - Case 5 - Return "IM" - Case 6 - Return "DU" - Case 7 - Return "CA" - Case 8 - Return "LO" - Case 9 - Return "C1" - Case 10 - Return "C2" - Case 11 - Return "DE" - Case 12 - Return "RT" - Case 13 - Return "RU" - Case Else - Return "" - End Select - End Function - - ''' - ''' Fill the themelist based on selection for default or custom skins - ''' - ''' - Private Sub LoadThemes() - Try - Const moduleThemesDirectoryPath As String = "/DesktopModules/Events/Themes" - - 'Clear list - ddlThemeStandard.Items.Clear() - ddlThemeCustom.Items.Clear() - - 'Add javascript to enable/disable ddl's - rbThemeCustom.Attributes.Add("onclick", String.Format("{0}.disabled='disabled';{1}.disabled=''", ddlThemeStandard.ClientID, ddlThemeCustom.ClientID)) - rbThemeStandard.Attributes.Add("onclick", String.Format("{0}.disabled='disabled';{1}.disabled=''", ddlThemeCustom.ClientID, ddlThemeStandard.ClientID)) - - 'Get the settings - Dim themeSettings As New ThemeSetting - If themeSettings.ValidateSetting(Settings.EventTheme) = False Then - themeSettings.ReadSetting(Settings.EventThemeDefault, PortalId) - ElseIf Settings.EventTheme <> "" Then - themeSettings.ReadSetting(Settings.EventTheme, PortalId) - End If - Select Case themeSettings.SettingType - Case ThemeSetting.ThemeSettingTypeEnum.CustomTheme - rbThemeCustom.Checked = True - Case ThemeSetting.ThemeSettingTypeEnum.DefaultTheme - rbThemeStandard.Checked = True - End Select - - 'Is default or custom selected - Dim moduleThemesDirectory As String = ApplicationPath & moduleThemesDirectoryPath - Dim serverThemesDirectory As String = Server.MapPath(moduleThemesDirectory) - Dim themeDirectories() As String = IO.Directory.GetDirectories(serverThemesDirectory) - Dim themeDirectory As String - For Each themeDirectory In themeDirectories - Dim dirparts() As String = themeDirectory.Split("\"c) - ddlThemeStandard.Items.Add(New ListItem(dirparts(dirparts.Length - 1), dirparts(dirparts.Length - 1))) - Next - If themeSettings.SettingType = ThemeSetting.ThemeSettingTypeEnum.DefaultTheme Then - If Not ddlThemeStandard.Items.FindByText(themeSettings.ThemeName) Is Nothing Then - ddlThemeStandard.Items.FindByText(themeSettings.ThemeName).Selected = True - End If - Else - ddlThemeStandard.Attributes.Add("disabled", "disabled") - End If - - 'Add custom event theme's - Dim pc As New Entities.Portals.PortalController - With pc.GetPortal(PortalId) - Dim eventSkinPath As String = String.Format("{0}\DNNEvents\Themes", .HomeDirectoryMapPath) - If Not IO.Directory.Exists(eventSkinPath) Then - IO.Directory.CreateDirectory(eventSkinPath) - End If - - For Each d As String In IO.Directory.GetDirectories(eventSkinPath) - ddlThemeCustom.Items.Add(New ListItem(New IO.DirectoryInfo(d).Name, New IO.DirectoryInfo(d).Name)) - Next - If ddlThemeCustom.Items.Count = 0 Then - rbThemeCustom.Enabled = False - End If - End With - - If themeSettings.SettingType = ThemeSetting.ThemeSettingTypeEnum.CustomTheme Then - If Not ddlThemeCustom.Items.FindByText(themeSettings.ThemeName) Is Nothing Then - ddlThemeCustom.Items.FindByText(themeSettings.ThemeName).Selected = True - End If - Else - ddlThemeCustom.Attributes.Add("disabled", "disabled") - End If - - Catch ex As Exception - Debug.Write(ex.ToString) - End Try - End Sub - - Private Sub LoadTemplates() - ddlTemplates.Items.Clear() - - Dim t As Type = Settings.Templates.GetType - Dim p As Reflection.PropertyInfo - For Each p In t.GetProperties - ddlTemplates.Items.Add(New ListItem(Localization.GetString(p.Name + "Name", LocalResourceFile), p.Name)) - Next - - ddlTemplates.Items.FindByValue("EventDetailsTemplate").Selected = True - txtEventTemplate.Text = Settings.Templates.GetTemplate(ddlTemplates.SelectedValue) - lblTemplateUpdated.Visible = False - - End Sub - - Private Sub LoadNewEventEmailRoles(ByVal roleID As Integer) - Dim objRoles As New Security.Roles.RoleController - ddNewEventEmailRoles.DataSource = objRoles.GetPortalRoles(PortalId) - ddNewEventEmailRoles.DataTextField = "RoleName" - ddNewEventEmailRoles.DataValueField = "RoleID" - ddNewEventEmailRoles.DataBind() - If roleID < 0 Or ddNewEventEmailRoles.Items.FindByValue(CType(roleID, String)) Is Nothing Then - Try - ddNewEventEmailRoles.Items.FindByValue(PortalSettings.RegisteredRoleId.ToString).Selected() = True - Catch - End Try - Else - ddNewEventEmailRoles.Items.FindByValue(CType(roleID, String)).Selected = True - End If - End Sub - - Private Sub LoadCategories() - ddlModuleCategories.Items.Clear() - Dim ctrlEventCategories As New EventCategoryController - Dim lstCategories As ArrayList = ctrlEventCategories.EventsCategoryList(PortalId) - ddlModuleCategories.DataSource = lstCategories - ddlModuleCategories.DataBind() - - If Settings.ModuleCategoriesSelected = EventModuleSettings.CategoriesSelected.Some Then - For Each moduleCategory As String In Settings.ModuleCategoryIDs - For Each item As Telerik.Web.UI.RadComboBoxItem In ddlModuleCategories.Items - If item.Value = moduleCategory Then - item.Checked = True - End If - Next - Next - ElseIf Settings.ModuleCategoriesSelected = EventModuleSettings.CategoriesSelected.All Then - For Each item As Telerik.Web.UI.RadComboBoxItem In ddlModuleCategories.Items - item.Checked = True - Next - End If - End Sub - - Private Sub LoadLocations() - ddlModuleLocations.Items.Clear() - Dim ctrlEventLocations As New EventLocationController - Dim lstLocations As ArrayList = ctrlEventLocations.EventsLocationList(PortalId) - ddlModuleLocations.DataSource = lstLocations - ddlModuleLocations.DataBind() - - If Settings.ModuleLocationsSelected = EventModuleSettings.LocationsSelected.Some Then - For Each moduleLocation As String In Settings.ModuleLocationIDs - For Each item As Telerik.Web.UI.RadComboBoxItem In ddlModuleLocations.Items - If item.Value = moduleLocation Then - item.Checked = True - End If - Next - Next - ElseIf Settings.ModuleLocationsSelected = EventModuleSettings.LocationsSelected.All Then - For Each item As Telerik.Web.UI.RadComboBoxItem In ddlModuleLocations.Items - item.Checked = True - Next - End If - End Sub - - ''' - ''' Take all settings and write them back to the database - ''' - ''' - Private Sub UpdateSettings() - - Dim emSettings As New EventModuleSettings(ModuleId, LocalResourceFile) - - Try - emSettings.Timeinterval = ddlTimeInterval.SelectedValue.Trim.ToString() - emSettings.TimeZoneId = cboTimeZone.SelectedValue - emSettings.EnableEventTimeZones = chkEnableEventTimeZones.Checked - emSettings.PrimaryTimeZone = CType(ddlPrimaryTimeZone.SelectedValue, EventModuleSettings.TimeZones) - emSettings.SecondaryTimeZone = CType(ddlSecondaryTimeZone.SelectedValue, EventModuleSettings.TimeZones) - emSettings.Eventtooltipmonth = chkToolTipMonth.Checked - emSettings.Eventtooltipweek = chkToolTipWeek.Checked - emSettings.Eventtooltipday = chkToolTipDay.Checked - emSettings.Eventtooltiplist = chkToolTipList.Checked - emSettings.Eventtooltiplength = CInt(txtTooltipLength.Text) - If chkMonthCellEvents.Checked Then - emSettings.Monthcellnoevents = False - Else - emSettings.Monthcellnoevents = True - End If - emSettings.Enablecategories = CType(ddlEnableCategories.SelectedValue, EventModuleSettings.DisplayCategories) - emSettings.Restrictcategories = chkRestrictCategories.Checked - emSettings.Enablelocations = CType(ddlEnableLocations.SelectedValue, EventModuleSettings.DisplayLocations) - emSettings.Restrictlocations = chkRestrictLocations.Checked - emSettings.Enablecontainerskin = chkEnableContainerSkin.Checked - emSettings.Eventdetailnewpage = chkEventDetailNewPage.Checked - emSettings.Enableenrollpopup = chkEnableEnrollPopup.Checked - emSettings.Eventdaynewpage = chkEventDayNewPage.Checked - emSettings.EventImageMonth = chkEventImageMonth.Checked - emSettings.EventImageWeek = chkEventImageWeek.Checked - emSettings.Eventnotify = chkEventNotify.Checked - emSettings.DetailPageAllowed = chkDetailPageAllowed.Checked - emSettings.EnrollmentPageAllowed = chkEnrollmentPageAllowed.Checked - emSettings.EnrollmentPageDefaultUrl = txtEnrollmentPageDefaultURL.Text - emSettings.Notifyanon = chkNotifyAnon.Checked - emSettings.Sendreminderdefault = chkSendReminderDefault.Checked - emSettings.Neweventemails = rblNewEventEmail.SelectedValue - emSettings.Neweventemailrole = CInt(ddNewEventEmailRoles.SelectedValue) - emSettings.Newpereventemail = chkNewPerEventEmail.Checked - emSettings.Tzdisplay = chkTZDisplay.Checked - emSettings.Paypalurl = txtPayPalURL.Text - If chkEnableEventNav.Checked Then - emSettings.DisableEventnav = False - Else - emSettings.DisableEventnav = True - End If - emSettings.Fulltimescale = chkFullTimeScale.Checked - emSettings.Collapserecurring = chkCollapseRecurring.Checked - emSettings.Includeendvalue = chkIncludeEndValue.Checked - emSettings.Showvaluemarks = chkShowValueMarks.Checked - emSettings.Eventimage = chkImageEnabled.Checked - emSettings.MaxThumbHeight = CInt(txtMaxThumbHeight.Text) - emSettings.MaxThumbWidth = CInt(txtMaxThumbWidth.Text) - emSettings.Allowreoccurring = chkAllowRecurring.Checked - emSettings.Maxrecurrences = txtMaxRecurrences.Text - emSettings.Eventsearch = chkEnableSearch.Checked - emSettings.Addsubmodulename = chkAddSubModuleName.Checked - emSettings.Enforcesubcalperms = chkEnforceSubCalPerms.Checked - emSettings.Preventconflicts = chkPreventConflicts.Checked - emSettings.Locationconflict = chkLocationConflict.Checked - emSettings.ShowEventsAlways = chkShowEventsAlways.Checked - emSettings.Timeintitle = chkTimeInTitle.Checked - emSettings.Monthdayselect = chkMonthDaySelect.Checked - emSettings.MasterEvent = chkMasterEvent.Checked - emSettings.Eventsignup = chkEventSignup.Checked - emSettings.Eventsignupallowpaid = chkEventSignupAllowPaid.Checked - emSettings.Eventdefaultenrollview = chkDefaultEnrollView.Checked - emSettings.Eventhidefullenroll() = chkHideFullEnroll.Checked - emSettings.Maxnoenrolees = CInt(txtMaxNoEnrolees.Text) - emSettings.Enrolcanceldays = CInt(txtCancelDays.Text) - emSettings.Fridayweekend = chkFridayWeekend.Checked - emSettings.Moderateall = chkModerateAll.Checked - emSettings.Paypalaccount = txtPayPalAccount.Text - emSettings.Reminderfrom = txtReminderFrom.Text - emSettings.StandardEmail = txtStandardEmail.Text - emSettings.EventsCustomField1 = chkCustomField1.Checked - emSettings.EventsCustomField2 = chkCustomField2.Checked - emSettings.DefaultView = ddlDefaultView.SelectedItem.Value - emSettings.EventsListPageSize = CInt(ddlPageSize.SelectedItem.Value) - emSettings.EventsListSortDirection = ddlListSortedFieldDirection.SelectedItem.Value - emSettings.EventsListSortColumn = ddlListDefaultColumn.SelectedItem.Value - emSettings.RSSEnable = chkRSSEnable.Checked - emSettings.RSSDateField = ddlRSSDateField.SelectedItem.Value - emSettings.RSSDays = CInt(txtRSSDays.Text) - emSettings.RSSTitle = txtRSSTitle.Text - emSettings.RSSDesc = txtRSSDesc.Text - emSettings.Expireevents = txtExpireEvents.Text - emSettings.Exportowneremail = chkExportOwnerEmail.Checked - emSettings.Exportanonowneremail = chkExportAnonOwnerEmail.Checked - emSettings.Ownerchangeallowed = chkOwnerChangeAllowed.Checked - emSettings.IconMonthPrio = chkIconMonthPrio.Checked - emSettings.IconMonthRec = chkIconMonthRec.Checked - emSettings.IconMonthReminder = chkIconMonthReminder.Checked - emSettings.IconMonthEnroll = chkIconMonthEnroll.Checked - emSettings.IconWeekPrio = chkIconWeekPrio.Checked - emSettings.IconWeekRec = chkIconWeekRec.Checked - emSettings.IconWeekReminder = chkIconWeekReminder.Checked - emSettings.IconWeekEnroll = chkIconWeekEnroll.Checked - emSettings.IconListPrio = chkIconListPrio.Checked - emSettings.IconListRec = chkIconListRec.Checked - emSettings.IconListReminder = chkIconListReminder.Checked - emSettings.IconListEnroll = chkIconListEnroll.Checked - emSettings.PrivateMessage = txtPrivateMessage.Text.Trim - emSettings.EnableSEO = chkEnableSEO.Checked - emSettings.SEODescriptionLength = CInt(txtSEODescriptionLength.Text) - emSettings.EnableSitemap = chkEnableSitemap.Checked - emSettings.SiteMapPriority = CType(txtSitemapPriority.Text, Single) - emSettings.SiteMapDaysBefore = CInt(txtSitemapDaysBefore.Text) - emSettings.SiteMapDaysAfter = CInt(txtSitemapDaysAfter.Text) - emSettings.WeekStart = CType(CInt(ddlWeekStart.SelectedValue), System.Web.UI.WebControls.FirstDayOfWeek) - emSettings.ListViewUseTime = chkListViewUseTime.Checked - - emSettings.IcalOnIconBar = chkiCalOnIconBar.Checked - emSettings.IcalEmailEnable = chkiCalEmailEnable.Checked - emSettings.IcalURLInLocation = chkiCalURLinLocation.Checked - emSettings.IcalIncludeCalname = chkiCalIncludeCalname.Checked - emSettings.IcalDaysBefore = CInt(txtiCalDaysBefore.Text) - emSettings.IcalDaysAfter = CInt(txtiCalDaysAfter.Text) - emSettings.IcalURLAppend = txtiCalURLAppend.Text - If chkiCalDisplayImage.Checked Then - emSettings.IcalDefaultImage = "Image=" & ctliCalDefaultImage.Url - Else - emSettings.IcalDefaultImage = "" - End If - 'objModules.UpdateModuleSetting(ModuleId, "EventDetailsTemplate", txtEventDetailsTemplate.Text.Trim) - - Dim moduleCategories As New ArrayList - If ddlModuleCategories.CheckedItems.Count <> ddlModuleCategories.Items.Count Then - For Each item As Telerik.Web.UI.RadComboBoxItem In ddlModuleCategories.CheckedItems - moduleCategories.Add(item.Value) - Next - Else - moduleCategories.Add("-1") - End If - emSettings.ModuleCategoryIDs = moduleCategories - - Dim moduleLocations As New ArrayList - If ddlModuleLocations.CheckedItems.Count <> ddlModuleLocations.Items.Count Then - For Each item As Telerik.Web.UI.RadComboBoxItem In ddlModuleLocations.CheckedItems - moduleLocations.Add(item.Value) - Next - Else - moduleLocations.Add("-1") - End If - emSettings.ModuleLocationIDs = moduleLocations - - ' ReSharper disable LocalizableElement - If chkMonthAllowed.Checked Or ddlDefaultView.SelectedItem.Value = "EventMonth.ascx" Then - emSettings.MonthAllowed = True - Else - emSettings.MonthAllowed = False - End If - If chkWeekAllowed.Checked Or ddlDefaultView.SelectedItem.Value = "EventWeek.ascx" Then - emSettings.WeekAllowed = True - Else - emSettings.WeekAllowed = False - End If - If chkListAllowed.Checked Or ddlDefaultView.SelectedItem.Value = "EventList.ascx" Then - emSettings.ListAllowed = True - Else - emSettings.ListAllowed = False - End If - ' ReSharper restore LocalizableElement - - Select Case rblIconBar.SelectedIndex - Case 0 - emSettings.IconBar = "TOP" - Case 1 - emSettings.IconBar = "BOTTOM" - Case 2 - emSettings.IconBar = "NONE" - End Select - - Select Case rblHTMLEmail.SelectedIndex - Case 0 - emSettings.HTMLEmail = "html" - Case 1 - emSettings.HTMLEmail = "auto" - Case 2 - emSettings.HTMLEmail = "text" - End Select - - 'EPT: Be sure we start next display time in the correct view - ' Update the cookie so the appropriate view is shown when settings page is exited - - Dim objCookie As HttpCookie = New HttpCookie("DNNEvents" & ModuleId) - objCookie.Value = ddlDefaultView.SelectedItem.Value - If Request.Cookies.Get("DNNEvents" & ModuleId) Is Nothing Then - Response.Cookies.Add(objCookie) - Else - Response.Cookies.Set(objCookie) - End If - - 'Set eventtheme data - Dim themeSettings As New ThemeSetting - With themeSettings - If rbThemeStandard.Checked Then - .SettingType = ThemeSetting.ThemeSettingTypeEnum.DefaultTheme - .ThemeName = ddlThemeStandard.SelectedItem.Text - .ThemeFile = "" - ElseIf rbThemeCustom.Checked Then - .SettingType = ThemeSetting.ThemeSettingTypeEnum.CustomTheme - .ThemeName = ddlThemeCustom.SelectedItem.Text - .ThemeFile = "" - End If - End With - emSettings.EventTheme = themeSettings.ToString - - 'List Events Mode Stuff - 'Update Fields to Display - Dim objListItem As ListItem - Dim listFields As String = "" - For Each objListItem In lstAssigned.Items - Dim columnNo As Integer = CInt(objListItem.Text.Substring(0, 2)) - Dim columnAcronym As String = GetListColumnAcronym(columnNo) - If listFields.Length > 0 Then - listFields = listFields + ";" + columnAcronym - Else - listFields = columnAcronym - End If - Next - emSettings.EventsListFields = listFields - - listFields = EnrollListFields(rblEnUserAnon.Checked, rblEnDispAnon.Checked, rblEnEmailAnon.Checked, rblEnPhoneAnon.Checked, rblEnApproveAnon.Checked, rblEnNoAnon.Checked) - emSettings.EnrollAnonFields = listFields - - listFields = EnrollListFields(rblEnUserView.Checked, rblEnDispView.Checked, rblEnEmailView.Checked, rblEnPhoneView.Checked, rblEnApproveView.Checked, rblEnNoView.Checked) - emSettings.EnrollViewFields = listFields - - listFields = EnrollListFields(rblEnUserEdit.Checked, rblEnDispEdit.Checked, rblEnEmailEdit.Checked, rblEnPhoneEdit.Checked, rblEnApproveEdit.Checked, rblEnNoEdit.Checked) - emSettings.EnrollEditFields = listFields - - If rblSelectionTypeDays.Checked Then - emSettings.EventsListSelectType = rblSelectionTypeDays.Value - Else - emSettings.EventsListSelectType = rblSelectionTypeEvents.Value - End If - If rblListViewGrid.Items(0).Selected = True Then - emSettings.ListViewGrid = True - Else - emSettings.ListViewGrid = False - End If - emSettings.ListViewTable = chkListViewTable.Checked - emSettings.RptColumns = CInt(txtRptColumns.Text.Trim.ToString()) - emSettings.RptRows = CInt(txtRptRows.Text.Trim.ToString()) - - If rblShowHeader.Items(0).Selected = True Then - emSettings.EventsListShowHeader = rblShowHeader.Items(0).Value - Else - emSettings.EventsListShowHeader = rblShowHeader.Items(1).Value - End If - emSettings.EventsListBeforeDays = CInt(txtDaysBefore.Text.Trim.ToString()) - emSettings.EventsListAfterDays = CInt(txtDaysAfter.Text.Trim.ToString()) - emSettings.EventsListNumEvents = CInt(txtNumEvents.Text.Trim.ToString()) - emSettings.EventsListEventDays = CInt(txtEventDays.Text.Trim.ToString()) - emSettings.RestrictCategoriesToTimeFrame = chkRestrictCategoriesToTimeFrame.Checked - emSettings.RestrictLocationsToTimeFrame = chkRestrictLocationsToTimeFrame.Checked - - emSettings.FBAdmins = txtFBAdmins.Text - emSettings.FBAppID = txtFBAppID.Text - - emSettings.SendEnrollMessageApproved = chkEnrollMessageApproved.Checked - emSettings.SendEnrollMessageWaiting = chkEnrollMessageWaiting.Checked - emSettings.SendEnrollMessageDenied = chkEnrollMessageDenied.Checked - emSettings.SendEnrollMessageAdded = chkEnrollMessageAdded.Checked - emSettings.SendEnrollMessageDeleted = chkEnrollMessageDeleted.Checked - emSettings.SendEnrollMessagePaying = chkEnrollMessagePaying.Checked - emSettings.SendEnrollMessagePending = chkEnrollMessagePending.Checked - emSettings.SendEnrollMessagePaid = chkEnrollMessagePaid.Checked - emSettings.SendEnrollMessageIncorrect = chkEnrollMessageIncorrect.Checked - emSettings.SendEnrollMessageCancelled = chkEnrollMessageCancelled.Checked - - emSettings.AllowAnonEnroll = chkAllowAnonEnroll.Checked - emSettings.SocialGroupModule = CType(ddlSocialGroupModule.SelectedValue, EventModuleSettings.SocialModule) - If emSettings.SocialGroupModule <> EventModuleSettings.SocialModule.No Then - emSettings.Ownerchangeallowed = False - emSettings.Neweventemails = "Never" - emSettings.MasterEvent = False - End If - If emSettings.SocialGroupModule = EventModuleSettings.SocialModule.UserProfile Then - emSettings.EnableSitemap = False - emSettings.Eventsearch = False - emSettings.Eventsignup = False - emSettings.Moderateall = False - End If - emSettings.SocialUserPrivate = chkSocialUserPrivate.Checked - emSettings.SocialGroupSecurity = CType(ddlSocialGroupSecurity.SelectedValue, EventModuleSettings.SocialGroupPrivacy) - - emSettings.EnrolListSortDirection = CType(ddlEnrolListSortDirection.SelectedValue, SortDirection) - emSettings.EnrolListDaysBefore = CInt(txtEnrolListDaysBefore.Text) - emSettings.EnrolListDaysAfter = CInt(txtEnrolListDaysAfter.Text) - - emSettings.JournalIntegration = chkJournalIntegration.Checked - - emSettings.SaveSettings(ModuleId) - CreateThemeDirectory() - - - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - - End Sub - - ''' - ''' Get Assigned Sub Events and Bind to Grid - ''' - ''' - Private Sub BindSubEvents() - With lstAssignedCals - .DataTextField = "SubEventTitle" - .DataValueField = "MasterID" - .DataSource = Nothing - .DataBind() - .DataSource = _objCtlMasterEvent.EventsMasterAssignedModules(ModuleId) - .DataBind() - End With - End Sub - - ''' - ''' Get Avaiable Sub Events for Portal and Bind to DropDown - ''' - ''' - Private Sub BindAvailableEvents() - With lstAvailableCals - .DataTextField = "SubEventTitle" - .DataValueField = "SubEventID" - .DataSource = Nothing - .DataBind() - .DataSource = _objCtlMasterEvent.EventsMasterAvailableModules(PortalId, ModuleId) - .DataBind() - End With - End Sub - - Private Sub Enable_Disable_Cals() - divMasterEvent.Visible = chkMasterEvent.Checked - End Sub - - Private Function EnrollListFields(ByVal blUser As Boolean, ByVal blDisp As Boolean, ByVal blEmail As Boolean, ByVal blPhone As Boolean, ByVal blApprove As Boolean, ByVal blNo As Boolean) As String - Dim listFields As String = "" - If blUser Then - listFields = listFields + "01;" - End If - If blDisp Then - listFields = listFields + "02;" - End If - If blEmail Then - listFields = listFields + "03;" - End If - If blPhone Then - listFields = listFields + "04;" - End If - If blApprove Then - listFields = listFields + "05;" - End If - If blNo Then - listFields = listFields + "06;" - End If - Return listFields - End Function - - Public Function AddSkinContainerControls(ByVal url As String, ByVal addchar As String) As String - Dim objCtlTab As New TabController - Dim objTabInfo As TabInfo = objCtlTab.GetTab(TabId, PortalId, False) - Dim skinSrc As String = Nothing - If Not objTabInfo.SkinSrc = "" Then - skinSrc = objTabInfo.SkinSrc - If Right(skinSrc, 5) = ".ascx" Then - skinSrc = Left(skinSrc, Len(skinSrc) - 5) - End If - End If - Dim objCtlModule As New ModuleController - Dim objModuleInfo As ModuleInfo = objCtlModule.GetModule(ModuleId, TabId, False) - Dim containerSrc As String = Nothing - If objModuleInfo.DisplayTitle Then - If Not objModuleInfo.ContainerSrc = "" Then - containerSrc = objModuleInfo.ContainerSrc - ElseIf Not objTabInfo.ContainerSrc = "" Then - containerSrc = objTabInfo.ContainerSrc - End If - If Not containerSrc Is Nothing Then - If Right(containerSrc, 5) = ".ascx" Then - containerSrc = Left(containerSrc, Len(containerSrc) - 5) - End If - End If - Else - containerSrc = "[G]Containers/_default/No+Container" - End If - If Not containerSrc Is Nothing Then - url += addchar + "ContainerSrc=" & HttpUtility.HtmlEncode(containerSrc) - addchar = "&" - End If - If Not skinSrc Is Nothing Then - url += addchar + "SkinSrc=" & HttpUtility.HtmlEncode(skinSrc) - End If - Return url - End Function - -#End Region - -#Region "Links, Buttons and Events" - Private Sub chkMasterEvent_CheckedChanged(ByVal sender As System.Object, ByVal e As EventArgs) Handles chkMasterEvent.CheckedChanged - cmdRemoveAllCals_Click(sender, e) - Enable_Disable_Cals() - End Sub - - Private Sub cmdAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdAdd.Click - - Dim objListItem As ListItem - - Dim objList As ArrayList = New ArrayList - - For Each objListItem In lstAvailable.Items - objList.Add(objListItem) - Next - - For Each objListItem In objList - If objListItem.Selected Then - lstAvailable.Items.Remove(objListItem) - lstAssigned.Items.Add(objListItem) - End If - Next - - lstAvailable.ClearSelection() - lstAssigned.ClearSelection() - - Sort(lstAssigned) - - End Sub - - Private Sub cmdRemove_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdRemove.Click - - Dim objListItem As ListItem - - Dim objList As ArrayList = New ArrayList - - For Each objListItem In lstAssigned.Items - objList.Add(objListItem) - Next - - For Each objListItem In objList - If objListItem.Selected Then - lstAssigned.Items.Remove(objListItem) - lstAvailable.Items.Add(objListItem) - End If - Next - - lstAvailable.ClearSelection() - lstAssigned.ClearSelection() - - Sort(lstAvailable) - - End Sub - - Private Sub cmdAddAll_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdAddAll.Click - - Dim objListItem As ListItem - - For Each objListItem In lstAvailable.Items - lstAssigned.Items.Add(objListItem) - Next - - lstAvailable.Items.Clear() - - lstAvailable.ClearSelection() - lstAssigned.ClearSelection() - - Sort(lstAssigned) - - End Sub - - Private Sub cmdRemoveAll_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdRemoveAll.Click - - Dim objListItem As ListItem - - For Each objListItem In lstAssigned.Items - lstAvailable.Items.Add(objListItem) - Next - - lstAssigned.Items.Clear() - - lstAvailable.ClearSelection() - lstAssigned.ClearSelection() - - Sort(lstAvailable) - End Sub - - Private Sub Sort(ByVal ctlListBox As ListBox) - - Dim arrListItems As New ArrayList - Dim objListItem As ListItem - - ' store listitems in temp arraylist - For Each objListItem In ctlListBox.Items - arrListItems.Add(objListItem) - Next - - ' sort arraylist based on text value - arrListItems.Sort(New ListItemComparer) - - ' clear control - ctlListBox.Items.Clear() - - ' add listitems to control - For Each objListItem In arrListItems - ctlListBox.Items.Add(objListItem) - Next - End Sub - - Private Sub cmdAddCals_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdAddCals.Click - Dim objListItem As ListItem - Dim masterEvent As New EventMasterInfo - - For Each objListItem In lstAvailableCals.Items - If objListItem.Selected Then - masterEvent.MasterID = Nothing - masterEvent.ModuleID = ModuleId - masterEvent.SubEventID = CType(objListItem.Value(), Integer) - _objCtlMasterEvent.EventsMasterSave(masterEvent) - End If - Next - - BindSubEvents() - BindAvailableEvents() - End Sub - - Private Sub cmdAddAllCals_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdAddAllCals.Click - Dim objListItem As ListItem - Dim masterEvent As New EventMasterInfo - - For Each objListItem In lstAvailableCals.Items - masterEvent.MasterID = Nothing - masterEvent.ModuleID = ModuleId - masterEvent.SubEventID = CType(objListItem.Value(), Integer) - _objCtlMasterEvent.EventsMasterSave(masterEvent) - Next - - BindSubEvents() - BindAvailableEvents() - End Sub - - Private Sub cmdRemoveCals_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdRemoveCals.Click - Dim objListItem As ListItem - - For Each objListItem In lstAssignedCals.Items - If objListItem.Selected Then - _objCtlMasterEvent.EventsMasterDelete(CInt(objListItem.Value()), ModuleId) - End If - Next - - BindSubEvents() - BindAvailableEvents() - End Sub - - Private Sub cmdRemoveAllCals_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdRemoveAllCals.Click - Dim objListItem As ListItem - - For Each objListItem In lstAssignedCals.Items - _objCtlMasterEvent.EventsMasterDelete(CInt(objListItem.Value()), ModuleId) - Next - - BindSubEvents() - BindAvailableEvents() - End Sub - - Private Sub cmdUpdateTemplate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdUpdateTemplate.Click - Dim strTemplate As String = ddlTemplates.SelectedValue - Settings.Templates.SaveTemplate(ModuleId, strTemplate, txtEventTemplate.Text.Trim) - lblTemplateUpdated.Visible = True - lblTemplateUpdated.Text = String.Format(Localization.GetString("TemplateUpdated", LocalResourceFile), Localization.GetString(strTemplate + "Name", LocalResourceFile)) - End Sub - - Private Sub cmdResetTemplate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdResetTemplate.Click - Dim strTemplate As String = ddlTemplates.SelectedValue - Settings.Templates.ResetTemplate(ModuleId, strTemplate, LocalResourceFile) - txtEventTemplate.Text = Settings.Templates.GetTemplate(strTemplate) - lblTemplateUpdated.Visible = True - lblTemplateUpdated.Text = String.Format(Localization.GetString("TemplateReset", LocalResourceFile), Localization.GetString(strTemplate + "Name", LocalResourceFile)) - End Sub - - Private Sub ddlTemplates_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ddlTemplates.SelectedIndexChanged - txtEventTemplate.Text = Settings.Templates.GetTemplate(ddlTemplates.SelectedValue) - lblTemplateUpdated.Visible = False - End Sub - - Private Sub cancelButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cancelButton.Click - Try - Response.Redirect(GetSocialNavigateUrl(), True) - Catch exc As Exception 'Module failed to load - 'ProcessModuleLoadException(Me, exc) - End Try - End Sub - - Private Sub updateButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles updateButton.Click - Try - UpdateSettings() - Response.Redirect(GetSocialNavigateUrl(), True) - Catch exc As Exception 'Module failed to load - 'ProcessModuleLoadException(Me, exc) - End Try - End Sub - -#End Region - - End Class - -#Region "Comparer Class" - Public Class ListItemComparer - Implements IComparer - - Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer Implements IComparer.Compare - Dim a As ListItem = CType(x, ListItem) - Dim b As ListItem = CType(y, ListItem) - Dim c As New CaseInsensitiveComparer - Return c.Compare(a.Text, b.Text) - End Function - End Class -#End Region - -#Region "DataClasses" - Public Class ThemeSetting -#Region "Member Variables" - Public SettingType As ThemeSettingTypeEnum - Public ThemeName As String - Public ThemeFile As String - Public CssClass As String -#End Region -#Region "Enumerators" - Public Enum ThemeSettingTypeEnum - DefaultTheme = 0 - CustomTheme = 1 - End Enum -#End Region -#Region "Methods" - Public Function ValidateSetting(ByVal setting As String) As Boolean - Dim s() As String = setting.Split(CChar(",")) - If Not s.GetUpperBound(0) = 2 Then Return False - If Not IsNumeric(s(0)) Then Return False - Return True - End Function - - Public Sub ReadSetting(ByVal setting As String, ByVal portalID As Integer) - If Not ValidateSetting(setting) Then Throw New Exception("Setting is not right format to convert into ThemeSetting") - - Dim s() As String = setting.Split(CChar(",")) - SettingType = CType(s(0), ThemeSettingTypeEnum) - ThemeName = s(1) - CssClass = "Theme" & ThemeName - Select Case SettingType - Case ThemeSettingTypeEnum.DefaultTheme - ThemeFile = String.Format("{0}/DesktopModules/Events/Themes/{1}/{1}.css", ApplicationPath, ThemeName) - Case ThemeSettingTypeEnum.CustomTheme - Dim pc As New Entities.Portals.PortalController - With pc.GetPortal(PortalID) - ThemeFile = String.Format("{0}/{1}/DNNEvents/Themes/{2}/{2}.css", ApplicationPath, .HomeDirectory, ThemeName) - End With - End Select - - End Sub -#End Region -#Region "Overrides" - Public Overrides Function ToString() As String - Return String.Format("{0},{1},{2}", CInt(SettingType), ThemeName, ThemeFile) - End Function -#End Region - End Class -#End Region -End Namespace diff --git a/EventTemplateHelp.ascx b/EventTemplateHelp.ascx index 0ba6e0f..e76498b 100644 --- a/EventTemplateHelp.ascx +++ b/EventTemplateHelp.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="EventTemplateHelp.ascx.vb" Inherits="DotNetNuke.Modules.Events.EventTemplateHelp" %> +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EventTemplateHelp.ascx.cs" Inherits="DotNetNuke.Modules.Events.EventTemplateHelp" %>

    Template help

    @@ -961,4 +961,4 @@ The following tokens have specific limited uses:-

    Reference:Date and Time Format Strings (msdn.microsoft.com) -
    \ No newline at end of file + diff --git a/EventTemplateHelp.ascx.cs b/EventTemplateHelp.ascx.cs new file mode 100644 index 0000000..038bd1b --- /dev/null +++ b/EventTemplateHelp.ascx.cs @@ -0,0 +1,40 @@ +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events +{ + using System; + using DNNtc; + + [ModuleControlProperties("TemplateHelp", "Event Template Help", ControlType.View, "https://dnnevents.codeplex.com/documentation", true, true)] + public partial class EventTemplateHelp : EventBase + { + protected void Page_Load(object sender, EventArgs e) + { + // Set the selected theme + this.SetTheme(this.pnlEventsModuleTHelp); + + this.ModuleConfiguration.DisplayPrint = true; + } + } +} \ No newline at end of file diff --git a/EventTemplateHelp.ascx.designer.cs b/EventTemplateHelp.ascx.designer.cs new file mode 100644 index 0000000..32b8212 --- /dev/null +++ b/EventTemplateHelp.ascx.designer.cs @@ -0,0 +1,55 @@ +// VBConversions Note: VB project level imports +using DotNetNuke.UI; +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using DotNetNuke.Entities.Users; +using System.Web.UI; +using System.Drawing; +using DotNetNuke.Framework; +using Microsoft.VisualBasic; +using System.Configuration; +using System.Web.UI.WebControls; +using System.Collections; +using DotNetNuke.Common.Utilities; +//using System.Linq; + using System.Web; +using DotNetNuke.Common; +using System.Web.UI.HtmlControls; +using DotNetNuke.Services.Localization; +using System.Data; +using System; +using DotNetNuke.Data; +using DotNetNuke; +// End of VB project level imports + + + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + + + namespace DotNetNuke.Modules.Events + { + + public partial class EventTemplateHelp + { + + /// + ///pnlEventsModuleTHelp control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlEventsModuleTHelp; + } + } + + diff --git a/EventTemplateHelp.ascx.designer.vb b/EventTemplateHelp.ascx.designer.vb deleted file mode 100644 index 4e55f5e..0000000 --- a/EventTemplateHelp.ascx.designer.vb +++ /dev/null @@ -1,26 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Namespace DotNetNuke.Modules.Events - - Partial Public Class EventTemplateHelp - - ''' - '''pnlEventsModuleTHelp control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlEventsModuleTHelp As Global.System.Web.UI.WebControls.Panel - End Class -End Namespace diff --git a/EventTemplateHelp.ascx.vb b/EventTemplateHelp.ascx.vb deleted file mode 100644 index 03e6fa1..0000000 --- a/EventTemplateHelp.ascx.vb +++ /dev/null @@ -1,36 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Namespace DotNetNuke.Modules.Events - - _ - Partial Public Class EventTemplateHelp - Inherits EventBase - - Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load - ' Set the selected theme - SetTheme(pnlEventsModuleTHelp) - - ModuleConfiguration.DisplayPrint = True - - - End Sub - - End Class -End Namespace diff --git a/EventVCal.aspx b/EventVCal.aspx index 48176a4..1d22d0a 100644 --- a/EventVCal.aspx +++ b/EventVCal.aspx @@ -1 +1,2 @@ -<%@ Page Language="vb" AutoEventWireup="false" Codebehind="EventVCal.aspx.vb" Inherits="DotNetNuke.Modules.Events.EventVCal" Explicit="True" %> +<%@ Page Language="C#" AutoEventWireup="true" Codebehind="EventVCal.aspx.cs" Inherits="DotNetNuke.Modules.Events.EventVCal" Explicit="True" %> + diff --git a/EventVCal.aspx.cs b/EventVCal.aspx.cs new file mode 100644 index 0000000..cebaa46 --- /dev/null +++ b/EventVCal.aspx.cs @@ -0,0 +1,65 @@ +using System.Diagnostics; +using System.Web.UI; +using System.Web; +using System; + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events + { + public partial class EventVCal : Page + { + +#region Web Form Designer Generated Code + + //This call is required by the Web Form Designer. + [DebuggerStepThrough()]private void InitializeComponent() + { + + } + + private void Page_Init(System.Object sender, EventArgs e) + { + //CODEGEN: This method call is required by the Web Form Designer + //Do not modify it using the code editor. + InitializeComponent(); + } + +#endregion + +#region Event Handlers + private void Page_Load(System.Object sender, EventArgs e) + { + VEvent oVEvent = new VEvent(); + //N. Pitsch + HttpContext oContext = default(HttpContext); + oContext = HttpContext.Current; + oVEvent.ProcessVCalRequest(oContext); + } +#endregion + + } + } + + diff --git a/EventVCal.aspx.designer.cs b/EventVCal.aspx.designer.cs new file mode 100644 index 0000000..bd05988 --- /dev/null +++ b/EventVCal.aspx.designer.cs @@ -0,0 +1,54 @@ +// VBConversions Note: VB project level imports +using DotNetNuke.UI; +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using DotNetNuke.Entities.Users; +using System.Web.UI; +using System.Drawing; +using DotNetNuke.Framework; +using Microsoft.VisualBasic; +using System.Configuration; +using System.Web.UI.WebControls; +using System.Collections; +using DotNetNuke.Common.Utilities; +//using System.Linq; + using System.Web; +using DotNetNuke.Common; +using System.Web.UI.HtmlControls; +using DotNetNuke.Services.Localization; +using System.Data; +using System; +using DotNetNuke.Data; +using DotNetNuke; +// End of VB project level imports + + + +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:2.0.50727.832 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + + + + + namespace DotNetNuke.Modules.Events + { + + /// + ///EventVCal-Klasse. + /// + /// + ///Automatisch generierte Klasse. + /// + public partial class EventVCal + { + } + } + + diff --git a/EventVCal.aspx.designer.vb b/EventVCal.aspx.designer.vb deleted file mode 100644 index ac13b9b..0000000 --- a/EventVCal.aspx.designer.vb +++ /dev/null @@ -1,25 +0,0 @@ -'------------------------------------------------------------------------------ -' -' Dieser Code wurde von einem Tool generiert. -' Laufzeitversion:2.0.50727.832 -' -' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -' der Code erneut generiert wird. -' -'------------------------------------------------------------------------------ - -Option Strict Off -Option Explicit On - - -Namespace DotNetNuke.Modules.Events - - ''' - '''EventVCal-Klasse. - ''' - ''' - '''Automatisch generierte Klasse. - ''' - Partial Public Class EventVCal - End Class -End Namespace diff --git a/EventVCal.aspx.vb b/EventVCal.aspx.vb deleted file mode 100644 index cd90f85..0000000 --- a/EventVCal.aspx.vb +++ /dev/null @@ -1,54 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - - -Namespace DotNetNuke.Modules.Events - Partial Class EventVCal - Inherits Page - -#Region " Web Form Designer Generated Code " - - 'This call is required by the Web Form Designer. - Private Sub InitializeComponent() - - End Sub - - Private Sub Page_Init(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Init - 'CODEGEN: This method call is required by the Web Form Designer - 'Do not modify it using the code editor. - InitializeComponent() - End Sub - -#End Region - -#Region "Event Handlers" - Private Sub Page_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load - Dim oVEvent As New VEvent() - 'N. Pitsch - Dim oContext As HttpContext - oContext = HttpContext.Current - With oVEvent - .ProcessVCalRequest(oContext) - End With - End Sub -#End Region - - End Class -End Namespace diff --git a/EventWeek.ascx b/EventWeek.ascx index 824cd56..5454219 100644 --- a/EventWeek.ascx +++ b/EventWeek.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="EventWeek.ascx.vb" Inherits="DotNetNuke.Modules.Events.EventWeek" %> +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EventWeek.ascx.cs" Inherits="DotNetNuke.Modules.Events.EventWeek" %> <%@ Register TagPrefix="evt" Namespace="DotNetNuke.Modules.Events.ScheduleControl" Assembly="DotNetNuke.Modules.Events.ScheduleControl" %> <%@ Register TagPrefix="evt" TagName="Category" Src="~/DesktopModules/Events/SubControls/SelectCategory.ascx" %> <%@ Register TagPrefix="evt" TagName="Location" Src="~/DesktopModules/Events/SubControls/SelectLocation.ascx" %> @@ -13,13 +13,13 @@
    - Today  + Today 
    - +
    @@ -29,13 +29,13 @@
    - << + << - >> + >>
    @@ -44,7 +44,7 @@ TimeScaleInterval="30" StartTimeField="StartTime" EndTimeField="EndTime" Layout="Vertical" GridLines="None" StartDay="Sunday" TimeFieldsContainDate="True" - CssClass="WeekTable"> + CssClass="WeekTable" OnItemDataBound="schWeek_ItemDataBound"> <%#Eval("Icons")%>
    + diff --git a/EventWeek.ascx.cs b/EventWeek.ascx.cs new file mode 100644 index 0000000..0f96606 --- /dev/null +++ b/EventWeek.ascx.cs @@ -0,0 +1,368 @@ +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using Microsoft.VisualBasic; +using System.Collections; +using DotNetNuke.Services.Localization; +using System.Data; +using System; +using System.Globalization; +using DotNetNuke.Modules.Events.ScheduleControl; + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events + { + + public partial class EventWeek : EventBase + { + + +#region Web Form Designer Generated Code + + //This call is required by the Web Form Designer. + [DebuggerStepThrough()]private void InitializeComponent() + { + + } + + private void Page_Init(System.Object sender, EventArgs e) + { + //CODEGEN: This method call is required by the Web Form Designer + //Do not modify it using the code editor. + InitializeComponent(); + } + +#endregion + +#region Private Variables + private DateTime _dWeekStart; + private ArrayList _selectedEvents; + private CultureInfo _culture = System.Threading.Thread.CurrentThread.CurrentCulture; +#endregion + +#region Page Events + private void Page_Load(System.Object sender, EventArgs e) + { + try + { + LocalizeAll(); + + SetupViewControls(EventIcons, EventIcons2, SelectCategory, SelectLocation, pnlDateControls); + DateTime initDate = SelectedDate.Date; + dpGoToDate.SelectedDate = initDate; + dpGoToDate.Calendar.FirstDayOfWeek = Settings.WeekStart; + + if (!IsPostBack) + { + schWeek.StartDay = _culture.DateTimeFormat.FirstDayOfWeek; + if (Settings.WeekStart != System.Web.UI.WebControls.FirstDayOfWeek.Default) + { + schWeek.StartDay = (DayOfWeek) Settings.WeekStart; + } + if (Settings.Fulltimescale) + { + schWeek.FullTimeScale = true; + } + if (Settings.Includeendvalue) + { + schWeek.IncludeEndValue = true; + } + else + { + schWeek.IncludeEndValue = false; + } + if (Settings.Showvaluemarks) + { + schWeek.ShowValueMarks = true; + } + else + { + schWeek.ShowValueMarks = false; + } + BindPage(initDate); + } + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } +#endregion + +#region Helper Methods + private void LocalizeAll() + { + lnkToday.Text = Localization.GetString("lnkToday", LocalResourceFile); + dpGoToDate.DatePopupButton.ToolTip = Localization.GetString("DatePickerTooltip", LocalResourceFile); + } + + private void BindPage(DateTime dDate) + { + DateTime dBegin = default(DateTime); + DateTime dEnd = default(DateTime); + DateTime sBegin = default(DateTime); + DateTime sEnd = default(DateTime); + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + + try + { + // Set Date Range + if (Settings.WeekStart != System.Web.UI.WebControls.FirstDayOfWeek.Default) + { + _dWeekStart = dDate.AddDays(System.Convert.ToDouble(-(int)dDate.DayOfWeek + Settings.WeekStart)); + } + else + { + _dWeekStart = dDate.AddDays(System.Convert.ToDouble(-(int)dDate.DayOfWeek)); + } + if ((int)dDate.DayOfWeek < (int)Settings.WeekStart & Settings.WeekStart != System.Web.UI.WebControls.FirstDayOfWeek.Default) + { + _dWeekStart = _dWeekStart.AddDays(-7); + } + lblWeekOf.Text = string.Format(Localization.GetString("capWeekEvent", LocalResourceFile), DateAndTime.DatePart(Interval: DateInterval.WeekOfYear, DateValue: _dWeekStart, FirstWeekOfYearValue: FirstWeekOfYear.FirstFourDays), _dWeekStart.ToLongDateString()); + ViewState[ModuleId + "WeekOf"] = _dWeekStart.ToShortDateString(); + + // Allow 7 days for events that might start before beginning of week + sBegin = _dWeekStart; + dBegin = DateAndTime.DateAdd(DateInterval.Day, -7, _dWeekStart); + sEnd = DateAndTime.DateAdd(DateInterval.Day, System.Convert.ToDouble(+ 7), _dWeekStart); + dEnd = sEnd; + + // Get Events/Sub-Calendar Events + + bool getSubEvents = Settings.MasterEvent; + _selectedEvents = objEventInfoHelper.GetEvents(dBegin, dEnd, getSubEvents, SelectCategory.SelectedCategory, SelectLocation.SelectedLocation, GetUrlGroupId(), GetUrlUserId()); + + _selectedEvents = objEventInfoHelper.ConvertEventListToDisplayTimeZone(_selectedEvents, GetDisplayTimeZoneId()); + + // Setup ScheduleGeneral + // Create DataView + DataTable eventTable = new DataTable("Events"); + eventTable.Columns.Add("ID", Type.GetType("System.Int32")); + eventTable.Columns.Add("CreatedByID", Type.GetType("System.Int32")); + eventTable.Columns.Add("OwnerID", Type.GetType("System.Int32")); + eventTable.Columns.Add("StartTime", Type.GetType("System.DateTime")); + eventTable.Columns.Add("EndTime", Type.GetType("System.DateTime")); + eventTable.Columns.Add("Icons", Type.GetType("System.String")); + eventTable.Columns.Add("Task", Type.GetType("System.String")); + eventTable.Columns.Add("Description", Type.GetType("System.String")); + eventTable.Columns.Add("StartDateTime", Type.GetType("System.DateTime")); + eventTable.Columns.Add("Duration", Type.GetType("System.Int32")); + eventTable.Columns.Add("URL", Type.GetType("System.String")); + eventTable.Columns.Add("Target", Type.GetType("System.String")); + eventTable.Columns.Add("Tooltip", Type.GetType("System.String")); + eventTable.Columns.Add("BackColor", Type.GetType("System.String")); + + if (Settings.Eventtooltipweek) + { + toolTipManager.TargetControls.Clear(); + } + + DataRow dgRow = default(DataRow); + EventInfo objEvent = default(EventInfo); + foreach (EventInfo tempLoopVar_objEvent in _selectedEvents) + { + objEvent = tempLoopVar_objEvent; + // If full enrollments should be hidden, ignore + if (HideFullEvent(objEvent)) + { + continue; + } + + if (objEvent.EventTimeEnd > sBegin && objEvent.EventTimeBegin < sEnd) + { + dgRow = eventTable.NewRow(); + dgRow["ID"] = objEvent.EventID; + dgRow["CreatedByID"] = objEvent.CreatedByID; + dgRow["OwnerID"] = objEvent.OwnerID; + dgRow["StartTime"] = objEvent.EventTimeBegin; + if (!objEvent.AllDayEvent) + { + dgRow["EndTime"] = objEvent.EventTimeEnd; + } + else + { + // all day events are recorded as 23:59 + dgRow["EndTime"] = objEvent.EventTimeEnd.AddMinutes(1); + } + //**** Add ModuleName if SubCalendar + string imagestring = ""; + if (Settings.Eventimage && Settings.EventImageWeek + && objEvent.ImageURL != null && objEvent.ImageDisplay == true) + { + imagestring = ImageInfo(objEvent.ImageURL, objEvent.ImageHeight, objEvent.ImageWidth); + } + + dgRow["BackColor"] = ""; + string iconString = ""; + + string eventtext = CreateEventName(objEvent, Settings.Templates.txtWeekEventText); + + if (!IsPrivateNotModerator || UserId == objEvent.OwnerID) + { + string forecolorstr = ""; + string backcolorstr = ""; + string blankstr = ""; + if (objEvent.Color != "") + { + backcolorstr = "background-color: " + objEvent.Color + ";"; + blankstr = " "; + dgRow["BackColor"] = objEvent.Color; + } + if (objEvent.FontColor != "") + { + forecolorstr = "color: " + objEvent.FontColor + ";"; + } + dgRow["Task"] = "" + imagestring + blankstr + eventtext + blankstr + ""; + + iconString = CreateIconString(objEvent, Settings.IconWeekPrio, Settings.IconWeekRec, Settings.IconWeekReminder, Settings.IconWeekEnroll); + + // Get detail page url + dgRow["URL"] = objEventInfoHelper.DetailPageURL(objEvent); + if (objEvent.DetailPage && objEvent.DetailNewWin) + { + dgRow["Target"] = "_blank"; + } + + } + else + { + dgRow["Task"] = imagestring + eventtext; + } + + dgRow["Icons"] = iconString; + dgRow["Description"] = objEvent.EventDesc; + dgRow["StartDateTime"] = objEvent.EventTimeBegin; + dgRow["Duration"] = objEvent.Duration; + if (Settings.Eventtooltipweek) + { + bool isEvtEditor = IsEventEditor(objEvent, false); + dgRow["Tooltip"] = ToolTipCreate(objEvent, Settings.Templates.txtTooltipTemplateTitle, Settings.Templates.txtTooltipTemplateBody, isEvtEditor); + } + + + eventTable.Rows.Add(dgRow); + } + } + DataView dvEvent = new DataView(eventTable); + + schWeek.StartDate = _dWeekStart; + schWeek.DateFormatString = Settings.Templates.txtWeekTitleDate; + schWeek.Weeks = 1; + schWeek.DataSource = dvEvent; + schWeek.DataBind(); + } + catch + { + } + } + + #endregion + + #region Links and Buttons + protected void lnkNext_Click(System.Object sender, EventArgs e) + { + DateTime dDate = System.Convert.ToDateTime(System.Convert.ToDateTime(ViewState[ModuleId + "WeekOf"]).AddDays(7)); + SelectedDate = dDate.Date; + dpGoToDate.SelectedDate = dDate.Date; + SelectCategory.StoreCategories(); + SelectLocation.StoreLocations(); + BindPage(dDate); + } + + protected void lnkPrev_Click(System.Object sender, EventArgs e) + { + DateTime dDate = System.Convert.ToDateTime(System.Convert.ToDateTime(ViewState[ModuleId + "WeekOf"]).AddDays(-7)); + SelectedDate = dDate.Date; + dpGoToDate.SelectedDate = dDate.Date; + SelectCategory.StoreCategories(); + SelectLocation.StoreLocations(); + BindPage(dDate); + } + + protected void schWeek_ItemDataBound(object sender, ScheduleItemEventArgs e) + { + if (e.Item.ItemType == ScheduleItemType.Item | e.Item.ItemType == ScheduleItemType.AlternatingItem) + { + DataRowView row = (DataRowView) e.Item.DataItem; + System.Web.UI.WebControls.TableCell itemCell = (System.Web.UI.WebControls.TableCell) e.Item.Parent; + if (Settings.Eventtooltipweek) + { + string tooltip = System.Convert.ToString(row["Tooltip"]); + itemCell.Attributes.Add("title", tooltip); + toolTipManager.TargetControls.Add(itemCell.ClientID, true); + } + if (IsPrivateNotModerator && !(UserId == System.Convert.ToInt32(row["OwnerID"]))) + { + itemCell.Style.Add("cursor", "text"); + itemCell.Style.Add("text-decoration", "none"); + itemCell.Attributes.Add("onclick", "javascript:return false;"); + } + string backColor = System.Convert.ToString(row["BackColor"]); + if (!string.IsNullOrEmpty(backColor)) + { + itemCell.BackColor = GetColor(backColor); + } + } + } + + protected void SelectCategory_CategorySelected(object sender, System.Web.UI.WebControls.CommandEventArgs e) + { + //Store the other selection(s) too. + SelectLocation.StoreLocations(); + DateTime dDate = System.Convert.ToDateTime(ViewState[ModuleId + "WeekOf"]); + BindPage(dDate); + } + protected void SelectLocation_LocationSelected(object sender, System.Web.UI.WebControls.CommandEventArgs e) + { + //Store the other selection(s) too. + SelectCategory.StoreCategories(); + DateTime dDate = System.Convert.ToDateTime(ViewState[ModuleId + "WeekOf"]); + BindPage(dDate); + } + + protected void lnkToday_Click(object sender, EventArgs e) + { + DateTime dDate = DateTime.Now.Date; + SelectedDate = dDate; + dpGoToDate.SelectedDate = dDate; + SelectCategory.StoreCategories(); + SelectLocation.StoreLocations(); + BindPage(dDate); + } + + protected void dpGoToDate_SelectedDateChanged(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e) + { + DateTime dDate = System.Convert.ToDateTime(dpGoToDate.SelectedDate); + SelectedDate = dDate; + BindPage(dDate); + } + +#endregion + + } + + } + + diff --git a/EventWeek.ascx.designer.cs b/EventWeek.ascx.designer.cs new file mode 100644 index 0000000..45ad716 --- /dev/null +++ b/EventWeek.ascx.designer.cs @@ -0,0 +1,153 @@ +// VBConversions Note: VB project level imports +using DotNetNuke.UI; +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using DotNetNuke.Entities.Users; +using System.Web.UI; +using System.Drawing; +using DotNetNuke.Framework; +using Microsoft.VisualBasic; +using System.Configuration; +using System.Web.UI.WebControls; +using System.Collections; +using DotNetNuke.Common.Utilities; +//using System.Linq; + using System.Web; +using DotNetNuke.Common; +using System.Web.UI.HtmlControls; +using DotNetNuke.Services.Localization; +using System.Data; +using System; +using DotNetNuke.Data; +using DotNetNuke; +// End of VB project level imports + + + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + + + namespace DotNetNuke.Modules.Events + { + + public partial class EventWeek + { + + /// + ///toolTipManager control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Web.UI.WebControls.DnnToolTipManager toolTipManager; + + /// + ///pnlDateControls control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlDateControls; + + /// + ///lnkToday control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton lnkToday; + + /// + ///dpGoToDate control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Web.UI.WebControls.DnnDatePicker dpGoToDate; + + /// + ///SelectCategory control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.SelectCategory SelectCategory; + + /// + ///SelectLocation control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.SelectLocation SelectLocation; + + /// + ///EventIcons control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.EventIcons EventIcons; + + /// + ///lnkPrev control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton lnkPrev; + + /// + ///lblWeekOf control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblWeekOf; + + /// + ///lnkNext control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton lnkNext; + + /// + ///schWeek control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.ScheduleControl.ScheduleCalendar schWeek; + + /// + ///EventIcons2 control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.Modules.Events.EventIcons EventIcons2; + } + } + diff --git a/EventWeek.ascx.designer.vb b/EventWeek.ascx.designer.vb deleted file mode 100644 index 63b63c5..0000000 --- a/EventWeek.ascx.designer.vb +++ /dev/null @@ -1,125 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Namespace DotNetNuke.Modules.Events - - Partial Public Class EventWeek - - ''' - '''toolTipManager control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents toolTipManager As Global.DotNetNuke.Web.UI.WebControls.DnnToolTipManager - - ''' - '''pnlDateControls control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlDateControls As Global.System.Web.UI.WebControls.Panel - - ''' - '''lnkToday control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lnkToday As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''dpGoToDate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents dpGoToDate As Global.DotNetNuke.Web.UI.WebControls.DnnDatePicker - - ''' - '''SelectCategory control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents SelectCategory As Global.DotNetNuke.Modules.Events.SelectCategory - - ''' - '''SelectLocation control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents SelectLocation As Global.DotNetNuke.Modules.Events.SelectLocation - - ''' - '''EventIcons control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents EventIcons As Global.DotNetNuke.Modules.Events.EventIcons - - ''' - '''lnkPrev control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lnkPrev As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''lblWeekOf control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblWeekOf As Global.System.Web.UI.WebControls.Label - - ''' - '''lnkNext control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lnkNext As Global.System.Web.UI.WebControls.LinkButton - - ''' - '''schWeek control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents schWeek As Global.DotNetNuke.Modules.Events.ScheduleControl.ScheduleCalendar - - ''' - '''EventIcons2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents EventIcons2 As Global.DotNetNuke.Modules.Events.EventIcons - End Class -End Namespace diff --git a/EventWeek.ascx.vb b/EventWeek.ascx.vb deleted file mode 100644 index 99d1aab..0000000 --- a/EventWeek.ascx.vb +++ /dev/null @@ -1,305 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports System -Imports System.Globalization -Imports System.Web.UI.WebControls -Imports DotNetNuke.Modules.Events.ScheduleControl - - -Namespace DotNetNuke.Modules.Events - - Partial Class EventWeek - Inherits EventBase - - -#Region " Web Form Designer Generated Code " - - 'This call is required by the Web Form Designer. - Private Sub InitializeComponent() - - End Sub - - Private Sub Page_Init(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Init - 'CODEGEN: This method call is required by the Web Form Designer - 'Do not modify it using the code editor. - InitializeComponent() - End Sub - -#End Region - -#Region "Private Variables" - Private _dWeekStart As Date - Private _selectedEvents As ArrayList - Private ReadOnly _culture As CultureInfo = Threading.Thread.CurrentThread.CurrentCulture -#End Region - -#Region "Page Events" - Private Sub Page_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load - Try - LocalizeAll() - - SetupViewControls(EventIcons, EventIcons2, SelectCategory, SelectLocation, pnlDateControls) - Dim initDate As Date = SelectedDate.Date() - dpGoToDate.SelectedDate = initDate - dpGoToDate.Calendar.FirstDayOfWeek = Settings.WeekStart - - If Not IsPostBack Then - schWeek.StartDay = _culture.DateTimeFormat.FirstDayOfWeek - If Settings.WeekStart <> System.Web.UI.WebControls.FirstDayOfWeek.Default Then - schWeek.StartDay = CType(Settings.WeekStart, DayOfWeek) - End If - If Settings.Fulltimescale Then - schWeek.FullTimeScale = True - End If - If Settings.Includeendvalue Then - schWeek.IncludeEndValue = True - Else - schWeek.IncludeEndValue = False - End If - If Settings.Showvaluemarks Then - schWeek.ShowValueMarks = True - Else - schWeek.ShowValueMarks = False - End If - BindPage(initDate) - End If - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub -#End Region - -#Region "Helper Methods" - Private Sub LocalizeAll() - lnkToday.Text = Localization.GetString("lnkToday", LocalResourceFile) - dpGoToDate.DatePopupButton.ToolTip = Localization.GetString("DatePickerTooltip", LocalResourceFile) - End Sub - - Private Sub BindPage(ByVal dDate As DateTime) - Dim dBegin, dEnd, sBegin, sEnd As Date - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - - Try - ' Set Date Range - If Settings.WeekStart <> System.Web.UI.WebControls.FirstDayOfWeek.Default Then - _dWeekStart = dDate.AddDays(-dDate.DayOfWeek + Settings.WeekStart) - Else - _dWeekStart = dDate.AddDays(-dDate.DayOfWeek) - End If - If dDate.DayOfWeek < Settings.WeekStart And Settings.WeekStart <> FirstDayOfWeek.Default Then - _dWeekStart = _dWeekStart.AddDays(-7) - End If - lblWeekOf.Text = String.Format(Localization.GetString("capWeekEvent", LocalResourceFile), DatePart(DateInterval.WeekOfYear, _dWeekStart, , FirstWeekOfYear.FirstFourDays), _dWeekStart.ToLongDateString) - ViewState(ModuleId & "WeekOf") = _dWeekStart.ToShortDateString - - ' Allow 7 days for events that might start before beginning of week - sBegin = _dWeekStart - dBegin = DateAdd(DateInterval.Day, -7, _dWeekStart) - sEnd = DateAdd(DateInterval.Day, +7, _dWeekStart) - dEnd = sEnd - - ' Get Events/Sub-Calendar Events - - Dim getSubEvents As Boolean = Settings.MasterEvent - _selectedEvents = objEventInfoHelper.GetEvents(dBegin, dEnd, getSubEvents, SelectCategory.SelectedCategory, SelectLocation.SelectedLocation, GetUrlGroupId, GetUrlUserId) - - _selectedEvents = objEventInfoHelper.ConvertEventListToDisplayTimeZone(_selectedEvents, GetDisplayTimeZoneId()) - - ' Setup ScheduleGeneral - ' Create DataView - Dim eventTable As DataTable = New DataTable("Events") - With eventTable.Columns - .Add("ID", Type.GetType("System.Int32")) - .Add("CreatedByID", Type.GetType("System.Int32")) - .Add("OwnerID", Type.GetType("System.Int32")) - .Add("StartTime", Type.GetType("System.DateTime")) - .Add("EndTime", Type.GetType("System.DateTime")) - .Add("Icons", Type.GetType("System.String")) - .Add("Task", Type.GetType("System.String")) - .Add("Description", Type.GetType("System.String")) - .Add("StartDateTime", Type.GetType("System.DateTime")) - .Add("Duration", Type.GetType("System.Int32")) - .Add("URL", Type.GetType("System.String")) - .Add("Target", Type.GetType("System.String")) - .Add("Tooltip", Type.GetType("System.String")) - .Add("BackColor", Type.GetType("System.String")) - End With - - If Settings.Eventtooltipweek Then - toolTipManager.TargetControls.Clear() - End If - - Dim dgRow As DataRow - Dim objEvent As EventInfo - For Each objEvent In _selectedEvents - ' If full enrollments should be hidden, ignore - If HideFullEvent(objEvent) Then - Continue For - End If - - If objEvent.EventTimeEnd > sBegin And objEvent.EventTimeBegin < sEnd Then - dgRow = eventTable.NewRow() - dgRow("ID") = objEvent.EventID - dgRow("CreatedByID") = objEvent.CreatedByID - dgRow("OwnerID") = objEvent.OwnerID - dgRow("StartTime") = objEvent.EventTimeBegin - If Not objEvent.AllDayEvent Then - dgRow("EndTime") = objEvent.EventTimeEnd - Else - ' all day events are recorded as 23:59 - dgRow("EndTime") = objEvent.EventTimeEnd.AddMinutes(1) - End If - '**** Add ModuleName if SubCalendar - Dim imagestring As String = "" - If Settings.Eventimage And Settings.EventImageWeek _ - And objEvent.ImageURL <> Nothing And objEvent.ImageDisplay = True Then - imagestring = ImageInfo(objEvent.ImageURL, objEvent.ImageHeight, objEvent.ImageWidth) - End If - - dgRow("BackColor") = "" - Dim iconString As String = "" - - Dim eventtext As String = CreateEventName(objEvent, Settings.Templates.txtWeekEventText) - - If Not IsPrivateNotModerator Or UserId = objEvent.OwnerID Then - Dim forecolorstr As String = "" - Dim backcolorstr As String = "" - Dim blankstr As String = "" - If objEvent.Color <> "" Then - backcolorstr = "background-color: " + objEvent.Color + ";" - blankstr = " " - dgRow("BackColor") = objEvent.Color - End If - If objEvent.FontColor <> "" Then - forecolorstr = "color: " + objEvent.FontColor + ";" - End If - dgRow("Task") = "" + imagestring + blankstr + eventtext + blankstr + "" - - iconString = CreateIconString(objEvent, Settings.IconWeekPrio, Settings.IconWeekRec, Settings.IconWeekReminder, Settings.IconWeekEnroll) - - ' Get detail page url - dgRow("URL") = objEventInfoHelper.DetailPageURL(objEvent) - If objEvent.DetailPage And objEvent.DetailNewWin Then - dgRow("Target") = "_blank" - End If - - Else - dgRow("Task") = imagestring + eventtext - End If - - dgRow("Icons") = iconString - dgRow("Description") = objEvent.EventDesc - dgRow("StartDateTime") = objEvent.EventTimeBegin - dgRow("Duration") = objEvent.Duration - If Settings.Eventtooltipweek Then - Dim isEvtEditor As Boolean = IsEventEditor(objEvent, False) - dgRow("Tooltip") = ToolTipCreate(objEvent, Settings.Templates.txtTooltipTemplateTitle, Settings.Templates.txtTooltipTemplateBody, isEvtEditor) - End If - - - eventTable.Rows.Add(dgRow) - End If - Next - Dim dvEvent As New DataView(eventTable) - - schWeek.StartDate = _dWeekStart - schWeek.DateFormatString = Settings.Templates.txtWeekTitleDate - schWeek.Weeks = 1 - schWeek.DataSource = dvEvent - schWeek.DataBind() - Catch - End Try - End Sub - -#End Region - -#Region "Links and Buttons" - Private Sub lnkNext_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles lnkNext.Click - Dim dDate As DateTime = CType(ViewState(ModuleId & "WeekOf"), DateTime).AddDays(7) - SelectedDate = dDate.Date - dpGoToDate.SelectedDate = dDate.Date - SelectCategory.StoreCategories() - SelectLocation.StoreLocations() - BindPage(dDate) - End Sub - - Private Sub lnkPrev_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles lnkPrev.Click - Dim dDate As DateTime = CType(ViewState(ModuleId & "WeekOf"), DateTime).AddDays(-7) - SelectedDate = dDate.Date - dpGoToDate.SelectedDate = dDate.Date - SelectCategory.StoreCategories() - SelectLocation.StoreLocations() - BindPage(dDate) - End Sub - - Private Sub schWeek_ItemDataBound(ByVal sender As Object, ByVal e As ScheduleItemEventArgs) Handles schWeek.ItemDataBound - If e.Item.ItemType = ScheduleItemType.Item Or e.Item.ItemType = ScheduleItemType.AlternatingItem Then - Dim row As DataRowView = CType(e.Item.DataItem, DataRowView) - Dim itemCell As System.Web.UI.WebControls.TableCell = CType(e.Item.Parent, System.Web.UI.WebControls.TableCell) - If Settings.Eventtooltipweek Then - Dim tooltip As String = CType(row("Tooltip"), String) - itemCell.Attributes.Add("title", tooltip) - toolTipManager.TargetControls.Add(itemCell.ClientID, True) - End If - If IsPrivateNotModerator And Not UserId = CType(row("OwnerID"), Integer) Then - itemCell.Style.Add("cursor", "text") - itemCell.Style.Add("text-decoration", "none") - itemCell.Attributes.Add("onclick", "javascript:return false;") - End If - Dim backColor As String = CType(row("BackColor"), String) - If backColor <> "" Then - itemCell.BackColor = GetColor(backColor) - End If - End If - End Sub - - Private Sub SelectCategory_CategorySelected(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs) Handles SelectCategory.CategorySelectedChanged - 'Store the other selection(s) too. - SelectLocation.StoreLocations() - Dim dDate As DateTime = CType(ViewState(ModuleId & "WeekOf"), DateTime) - BindPage(dDate) - End Sub - Private Sub SelectLocation_LocationSelected(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs) Handles SelectLocation.LocationSelectedChanged - 'Store the other selection(s) too. - SelectCategory.StoreCategories() - Dim dDate As DateTime = CType(ViewState(ModuleId & "WeekOf"), DateTime) - BindPage(dDate) - End Sub - - Private Sub lnkToday_Click(ByVal sender As Object, ByVal e As EventArgs) Handles lnkToday.Click - Dim dDate As Date = DateTime.Now.Date() - SelectedDate = dDate - dpGoToDate.SelectedDate = dDate - SelectCategory.StoreCategories() - SelectLocation.StoreLocations() - BindPage(dDate) - End Sub - - Private Sub dpGoToDate_SelectedDateChanged(sender As Object, e As Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs) Handles dpGoToDate.SelectedDateChanged - Dim dDate As Date = CType(dpGoToDate.SelectedDate, Date) - SelectedDate = dDate - BindPage(dDate) - End Sub - -#End Region - - End Class - -End Namespace diff --git a/Events.ascx b/Events.ascx index c9bd672..5cf4cc8 100644 --- a/Events.ascx +++ b/Events.ascx @@ -1,7 +1,8 @@ -<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="Events.ascx.vb" Inherits="DotNetNuke.Modules.Events.Events" %> +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Events.ascx.cs" Inherits="DotNetNuke.Modules.Events.Events" %>
    Please update module settings...contact Portal Admin.
    + diff --git a/Events.ascx.cs b/Events.ascx.cs new file mode 100644 index 0000000..c851fea --- /dev/null +++ b/Events.ascx.cs @@ -0,0 +1,586 @@ +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using System.Web; +using DotNetNuke.Services.Localization; +using System; +using DotNetNuke.Security; + +#region Copyright +// +// DotNetNuke® - http://www.dotnetnuke.com +// Copyright (c) 2002-2018 +// by DotNetNuke Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// +#endregion + + +namespace DotNetNuke.Modules.Events +{ + [DNNtc.ModulePermission("EVENTS_MODULE", "EVENTSSET", "Edit Settings")] + [DNNtc.ModulePermission("EVENTS_MODULE", "EVENTSMOD", "Events Moderator")] + [DNNtc.ModulePermission("EVENTS_MODULE", "EVENTSEDT", "Events Editor")] + [DNNtc.ModulePermission("EVENTS_MODULE", "EVENTSCAT", "Global Category Editor")] + [DNNtc.ModulePermission("EVENTS_MODULE", "EVENTSLOC", "Global Location Editor")] + [DNNtc.ModuleDependencies(DNNtc.ModuleDependency.CoreVersion, "8.0.0")] + [DNNtc.ModuleControlProperties("", "Events Container", DNNtc.ControlType.View, "https://dnnevents.codeplex.com/documentation", true, false)] + public partial class Events : EventBase, Entities.Modules.IActionable + { + + #region Private Members + + private int _itemId; + private string _mcontrolToLoad = ""; + private int _socialGroupId = 0; + private int _socialUserId = 0; + + #endregion + + #region Event Handlers + + //This call is required by the Web Form Designer. + [DebuggerStepThrough()] + private static void InitializeComponent() + { } + + private static void Page_Init(object sender, EventArgs e) + { + //CODEGEN: This method call is required by the Web Form Designer + //Do not modify it using the code editor. + InitializeComponent(); + } + + private void Page_Load(System.Object sender, EventArgs e) + { + + SetTheme(pnlEventsModule); + AddFacebookMetaTags(); + LoadModuleControl(); // Load Module Control onto Page + } + + #endregion + + #region Private Methods + + private void LoadModuleControl() + { + try + { + _socialGroupId = GetUrlGroupId(); + _socialUserId = GetUrlUserId(); + Entities.Modules.ModuleController objModules = new Entities.Modules.ModuleController(); + Entities.Modules.ModuleInfo objModule = objModules.GetModule(ModuleId, TabId); + Entities.Modules.DesktopModuleInfo objDesktopModule = + Entities.Modules.DesktopModuleController.GetDesktopModule(objModule.DesktopModuleID, PortalId); + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + + // Force Module Default Settings on new Version or New Module Instance + if (objDesktopModule.Version != Settings.Version) + { + CreateThemeDirectory(); + // objEventInfoHelper.SetDefaultModuleSettings(ModuleId, TabId, Page, LocalResourceFile) + } + + if (!(Request.QueryString["mctl"] == null) && + (ModuleId == System.Convert.ToInt32(Request.QueryString["ModuleID"]) || + ModuleId == System.Convert.ToInt32(Request.QueryString["mid"]))) + { + if (Request["mctl"].EndsWith(".ascx")) + { + _mcontrolToLoad = Request["mctl"]; + } + else + { + _mcontrolToLoad = Request["mctl"] + ".ascx"; + } + } + + // Set Default, if none selected + if (_mcontrolToLoad.Length == 0) + { + if (!ReferenceEquals(Request.Cookies.Get("DNNEvents" + System.Convert.ToString(ModuleId)), null)) + { + _mcontrolToLoad = Request.Cookies.Get("DNNEvents" + System.Convert.ToString(ModuleId)).Value; + } + else + { + // See if Default View Set + _mcontrolToLoad = Settings.DefaultView; + } + } + + // Check for Valid Module to Load + _mcontrolToLoad = System.IO.Path.GetFileNameWithoutExtension(_mcontrolToLoad) + ".ascx"; + switch (_mcontrolToLoad.ToLower()) + { + case "eventdetails.ascx": + // Search and RSS feed may direct detail page url to base module - + // should be put in new page + if (Settings.Eventdetailnewpage) + { + //Get the item id of the selected event + if (!(ReferenceEquals(Request.Params["ItemId"], null))) + { + _itemId = int.Parse(Request.Params["ItemId"]); + EventController objCtlEvents = new EventController(); + EventInfo objEvent = objCtlEvents.EventsGet(_itemId, ModuleId); + if (!ReferenceEquals(objEvent, null)) + { + Response.Redirect( + objEventInfoHelper.GetDetailPageRealURL( + objEvent.EventID, _socialGroupId, _socialUserId)); + } + } + } + break; + case "eventday.ascx": + break; + case "eventmonth.ascx": + break; + case "eventweek.ascx": + break; + case "eventrpt.ascx": + if (Settings.ListViewGrid) + { + _mcontrolToLoad = "EventList.ascx"; + } + break; + case "eventlist.ascx": + if (!Settings.ListViewGrid) + { + _mcontrolToLoad = "EventRpt.ascx"; + } + break; + case "eventmoderate.ascx": + Response.Redirect( + objEventInfoHelper.AddSkinContainerControls( + DotNetNuke.Common.Globals.NavigateURL(TabId, "Moderate", "Mid=" + ModuleId.ToString()), + "?")); + break; + case "eventmyenrollments.ascx": + break; + default: + lblModuleSettings.Text = Localization.GetString("lblBadControl", LocalResourceFile); + lblModuleSettings.Visible = true; + return; + } + + Entities.Modules.PortalModuleBase objPortalModuleBase = + (Entities.Modules.PortalModuleBase)(LoadControl(_mcontrolToLoad)); + objPortalModuleBase.ModuleConfiguration = ModuleConfiguration.Clone(); + objPortalModuleBase.ID = System.IO.Path.GetFileNameWithoutExtension(_mcontrolToLoad); + phMain.Controls.Add(objPortalModuleBase); + + //EVT-4499 Exlude the EventMyEnrollment.ascx to be set as cookie + if (_mcontrolToLoad.ToLower() != "eventdetails.ascx" + && _mcontrolToLoad.ToLower() != "eventday.ascx" + && _mcontrolToLoad.ToLower() != "eventmyenrollments.ascx") + { + HttpCookie objCookie = new HttpCookie("DNNEvents" + System.Convert.ToString(ModuleId)); + objCookie.Value = _mcontrolToLoad; + if (ReferenceEquals(Request.Cookies.Get("DNNEvents" + System.Convert.ToString(ModuleId)), null)) + { + Response.Cookies.Add(objCookie); + } + else + { + Response.Cookies.Set(objCookie); + } + } + + } + catch (Exception exc) + { + Exceptions.ProcessModuleLoadException(this, exc); + } + } + + #endregion + + #region Optional Interfaces + + public Entities.Modules.Actions.ModuleActionCollection ModuleActions + { + get + { + _socialGroupId = GetUrlGroupId(); + _socialUserId = GetUrlUserId(); + // ReSharper disable LocalVariableHidesMember + // ReSharper disable InconsistentNaming + Entities.Modules.Actions.ModuleActionCollection Actions = + new Entities.Modules.Actions.ModuleActionCollection(); + // ReSharper restore InconsistentNaming + // ReSharper restore LocalVariableHidesMember + EventInfoHelper objEventInfoHelper = new EventInfoHelper(ModuleId, TabId, PortalId, Settings); + SecurityAccessLevel securityLevel = SecurityAccessLevel.View; + + try + { + if (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString())) + { + securityLevel = SecurityAccessLevel.Admin; + } + + // Add Event + if (IsModuleEditor()) + { + if (_socialGroupId > 0) + { + Actions.Add(GetNextActionID(), + Localization.GetString("MenuAddEvents", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/cal-add.gif", + objEventInfoHelper.AddSkinContainerControls( + EditUrl("groupid", _socialGroupId.ToString(), "Edit"), "?"), false, + securityLevel, true, false); + } + else if (_socialUserId > 0) + { + if (_socialUserId == UserId || IsModerator()) + { + Actions.Add(GetNextActionID(), + Localization.GetString("MenuAddEvents", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/cal-add.gif", + objEventInfoHelper.AddSkinContainerControls( + EditUrl("userid", _socialUserId.ToString(), "Edit"), "?"), false, + securityLevel, true, false); + } + } + else + { + Actions.Add(GetNextActionID(), + Localization.GetString("MenuAddEvents", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/cal-add.gif", + objEventInfoHelper.AddSkinContainerControls(EditUrl("Edit"), "?"), false, + securityLevel, true, false); + } + } + + if (!(Request.QueryString["mctl"] == null) && + ModuleId == System.Convert.ToInt32(Request.QueryString["ModuleID"])) + { + if (Request["mctl"].EndsWith(".ascx")) + { + _mcontrolToLoad = Request["mctl"]; + } + else + { + _mcontrolToLoad = Request["mctl"] + ".ascx"; + } + } + + // Set Default, if none selected + if (_mcontrolToLoad.Length == 0) + { + if (!ReferenceEquals(Request.Cookies.Get("DNNEvents" + System.Convert.ToString(ModuleId)), + null)) + { + _mcontrolToLoad = Request + .Cookies.Get("DNNEvents" + System.Convert.ToString(ModuleId)).Value; + } + else + { + // See if Default View Set + _mcontrolToLoad = Settings.DefaultView; + } + } + + //Add Month and Week Views + if (Settings.MonthAllowed && _mcontrolToLoad != "EventMonth.ascx") + { + if (_socialGroupId > 0) + { + Actions.Add(GetNextActionID(), Localization.GetString("MenuMonth", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/cal-month.gif", + DotNetNuke.Common.Globals.NavigateURL( + TabId, "", "ModuleID=" + ModuleId.ToString(), + "mctl=EventMonth", "groupid=" + _socialGroupId.ToString()), + false, securityLevel, true, false); + } + else if (_socialUserId > 0) + { + Actions.Add(GetNextActionID(), Localization.GetString("MenuMonth", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/cal-month.gif", + DotNetNuke.Common.Globals.NavigateURL( + TabId, "", "ModuleID=" + ModuleId.ToString(), + "mctl=EventMonth", "userid=" + _socialUserId.ToString()), + false, securityLevel, true, false); + } + else + { + Actions.Add(GetNextActionID(), Localization.GetString("MenuMonth", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/cal-month.gif", + DotNetNuke.Common.Globals.NavigateURL( + TabId, "", "ModuleID=" + ModuleId.ToString(), + "mctl=EventMonth"), false, securityLevel, true, false); + } + } + if (Settings.WeekAllowed && _mcontrolToLoad != "EventWeek.ascx") + { + if (_socialGroupId > 0) + { + Actions.Add(GetNextActionID(), Localization.GetString("MenuWeek", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/cal-week.gif", + DotNetNuke.Common.Globals.NavigateURL( + TabId, "", "ModuleID=" + ModuleId.ToString(), + "mctl=EventWeek", "groupid=" + _socialGroupId.ToString()), + false, securityLevel, true, false); + } + else if (_socialUserId > 0) + { + Actions.Add(GetNextActionID(), Localization.GetString("MenuWeek", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/cal-week.gif", + DotNetNuke.Common.Globals.NavigateURL( + TabId, "", "ModuleID=" + ModuleId.ToString(), + "mctl=EventWeek", "userid=" + _socialUserId.ToString()), + false, securityLevel, true, false); + } + else + { + Actions.Add(GetNextActionID(), Localization.GetString("MenuWeek", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/cal-week.gif", + DotNetNuke.Common.Globals.NavigateURL( + TabId, "", "ModuleID=" + ModuleId.ToString(), + "mctl=EventWeek"), false, securityLevel, true, false); + } + } + if (Settings.ListAllowed && _mcontrolToLoad != "EventList.ascx") + { + if (_socialGroupId > 0) + { + Actions.Add(GetNextActionID(), Localization.GetString("MenuList", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/cal-list.gif", + DotNetNuke.Common.Globals.NavigateURL( + TabId, "", "ModuleID=" + ModuleId.ToString(), + "mctl=EventList", "groupid=" + _socialGroupId.ToString()), + false, securityLevel, true, false); + } + else if (_socialUserId > 0) + { + Actions.Add(GetNextActionID(), Localization.GetString("MenuList", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/cal-list.gif", + DotNetNuke.Common.Globals.NavigateURL( + TabId, "", "ModuleID=" + ModuleId.ToString(), + "mctl=EventList", "userid=" + _socialUserId.ToString()), + false, securityLevel, true, false); + } + else + { + Actions.Add(GetNextActionID(), Localization.GetString("MenuList", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/cal-list.gif", + DotNetNuke.Common.Globals.NavigateURL( + TabId, "", "ModuleID=" + ModuleId.ToString(), + "mctl=EventList"), false, securityLevel, true, false); + } + } + + + // See if Enrollments + if (Settings.Eventsignup) + { + if (_socialGroupId > 0) + { + Actions.Add(GetNextActionID(), + Localization.GetString("MenuMyEnrollments", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/cal-enroll.gif", + DotNetNuke.Common.Globals.NavigateURL( + TabId, "", "ModuleID=" + ModuleId.ToString(), + "mctl=EventMyEnrollments", + "groupid=" + _socialGroupId.ToString()), false, + securityLevel, true, false); + } + else if (_socialUserId > 0) + { + Actions.Add(GetNextActionID(), + Localization.GetString("MenuMyEnrollments", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/cal-enroll.gif", + DotNetNuke.Common.Globals.NavigateURL( + TabId, "", "ModuleID=" + ModuleId.ToString(), + "mctl=EventMyEnrollments", + "userid=" + _socialUserId.ToString()), false, securityLevel, + true, false); + } + else + { + Actions.Add(GetNextActionID(), + Localization.GetString("MenuMyEnrollments", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/cal-enroll.gif", + DotNetNuke.Common.Globals.NavigateURL( + TabId, "", "ModuleID=" + ModuleId.ToString(), + "mctl=EventMyEnrollments"), false, securityLevel, true, + false); + } + } + + if (IsModerator() && Settings.Moderateall) + { + if (_socialGroupId > 0) + { + Actions.Add(GetNextActionID(), + Localization.GetString("MenuModerate", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/moderate.gif", + objEventInfoHelper.AddSkinContainerControls( + EditUrl("groupid", _socialGroupId.ToString(), "Moderate"), "?"), false, + securityLevel, true, false); + } + else if (_socialUserId > 0) + { + Actions.Add(GetNextActionID(), + Localization.GetString("MenuModerate", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/moderate.gif", + objEventInfoHelper.AddSkinContainerControls( + EditUrl("userid", _socialUserId.ToString(), "Moderate"), "?"), false, + securityLevel, true, false); + } + else + { + Actions.Add(GetNextActionID(), + Localization.GetString("MenuModerate", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/moderate.gif", + objEventInfoHelper.AddSkinContainerControls(EditUrl("Moderate"), "?"), + false, securityLevel, true, false); + } + } + if (IsSettingsEditor()) + { + if (_socialGroupId > 0) + { + Actions.Add(GetNextActionID(), + Localization.GetString("MenuSettings", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + Entities.Icons.IconController.IconURL("EditTab"), + objEventInfoHelper.AddSkinContainerControls( + EditUrl("groupid", _socialGroupId.ToString(), "EventSettings"), "?"), + false, securityLevel, true, false); + } + else if (_socialUserId > 0) + { + Actions.Add(GetNextActionID(), + Localization.GetString("MenuSettings", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + Entities.Icons.IconController.IconURL("EditTab"), + objEventInfoHelper.AddSkinContainerControls( + EditUrl("userid", _socialUserId.ToString(), "EventSettings"), "?"), + false, securityLevel, true, false); + } + else + { + Actions.Add(GetNextActionID(), + Localization.GetString("MenuSettings", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + Entities.Icons.IconController.IconURL("EditTab"), + objEventInfoHelper.AddSkinContainerControls(EditUrl("EventSettings"), "?"), + false, securityLevel, true, false); + } + } + if (IsCategoryEditor()) + { + if (_socialGroupId > 0) + { + Actions.Add(GetNextActionID(), + Localization.GetString("MenuCategories", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/SmallCalendar.gif", + objEventInfoHelper.AddSkinContainerControls( + EditUrl("groupid", _socialGroupId.ToString(), "Categories"), "?"), + false, securityLevel, true, false); + } + else if (_socialUserId > 0) + { + Actions.Add(GetNextActionID(), + Localization.GetString("MenuCategories", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/SmallCalendar.gif", + objEventInfoHelper.AddSkinContainerControls( + EditUrl("userid", _socialUserId.ToString(), "Categories"), "?"), false, + securityLevel, true, false); + } + else + { + Actions.Add(GetNextActionID(), + Localization.GetString("MenuCategories", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/SmallCalendar.gif", + objEventInfoHelper.AddSkinContainerControls(EditUrl("Categories"), "?"), + false, securityLevel, true, false); + } + } + if (IsLocationEditor()) + { + if (_socialGroupId > 0) + { + Actions.Add(GetNextActionID(), + Localization.GetString("MenuLocations", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/SmallCalendar.gif", + objEventInfoHelper.AddSkinContainerControls( + EditUrl("groupid", _socialGroupId.ToString(), "Locations"), "?"), false, + securityLevel, true, false); + } + else if (_socialUserId > 0) + { + Actions.Add(GetNextActionID(), + Localization.GetString("MenuLocations", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/SmallCalendar.gif", + objEventInfoHelper.AddSkinContainerControls( + EditUrl("userid", _socialUserId.ToString(), "Locations"), "?"), false, + securityLevel, true, false); + } + else + { + Actions.Add(GetNextActionID(), + Localization.GetString("MenuLocations", LocalResourceFile), + Entities.Modules.Actions.ModuleActionType.ContentOptions, "", + "../DesktopModules/Events/Images/SmallCalendar.gif", + objEventInfoHelper.AddSkinContainerControls(EditUrl("Locations"), "?"), + false, securityLevel, true, false); + } + } + + } + catch (Exception) + { + //ProcessModuleLoadException(Me, exc) + } + return Actions; + } + } + + #endregion + + } + +} + + diff --git a/Events.ascx.designer.cs b/Events.ascx.designer.cs new file mode 100644 index 0000000..075c97a --- /dev/null +++ b/Events.ascx.designer.cs @@ -0,0 +1,73 @@ +// VBConversions Note: VB project level imports +using DotNetNuke.UI; +using DotNetNuke.Services.Exceptions; +using System.Diagnostics; +using DotNetNuke.Entities.Users; +using System.Web.UI; +using System.Drawing; +using DotNetNuke.Framework; +using Microsoft.VisualBasic; +using System.Configuration; +using System.Web.UI.WebControls; +using System.Collections; +using DotNetNuke.Common.Utilities; +//using System.Linq; + using System.Web; +using DotNetNuke.Common; +using System.Web.UI.HtmlControls; +using DotNetNuke.Services.Localization; +using System.Data; +using System; +using DotNetNuke.Data; +using DotNetNuke; +// End of VB project level imports + + + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + + + namespace DotNetNuke.Modules.Events + { + + public partial class Events + { + + /// + ///pnlEventsModule control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlEventsModule; + + /// + ///phMain control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.PlaceHolder phMain; + + /// + ///lblModuleSettings control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblModuleSettings; + } + } + + diff --git a/Events.ascx.designer.vb b/Events.ascx.designer.vb deleted file mode 100644 index 4e8503b..0000000 --- a/Events.ascx.designer.vb +++ /dev/null @@ -1,44 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Namespace DotNetNuke.Modules.Events - - Partial Public Class Events - - ''' - '''pnlEventsModule control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlEventsModule As Global.System.Web.UI.WebControls.Panel - - ''' - '''phMain control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents phMain As Global.System.Web.UI.WebControls.PlaceHolder - - ''' - '''lblModuleSettings control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblModuleSettings As Global.System.Web.UI.WebControls.Label - End Class -End Namespace diff --git a/Events.ascx.vb b/Events.ascx.vb deleted file mode 100644 index cf51f55..0000000 --- a/Events.ascx.vb +++ /dev/null @@ -1,301 +0,0 @@ -' -' DotNetNuke® - http://www.dnnsoftware.com -' Copyright (c) 2002-2013 -' by DNNCorp -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - -Imports DotNetNuke.Common -Imports DotNetNuke.Services.Exceptions -Imports DotNetNuke.Security -Imports DotNetNuke.Services.Localization - -Namespace DotNetNuke.Modules.Events - - _ - _ - _ - _ - _ - _ - _ - Partial Class Events - Inherits EventBase - Implements Entities.Modules.IActionable - -#Region "Private Members" - Private _itemId As Integer - Private _mcontrolToLoad As String = "" - Private _socialGroupId As Integer = 0 - Private _socialUserId As Integer = 0 -#End Region - -#Region "Event Handlers" - - 'This call is required by the Web Form Designer. - Private Shared Sub InitializeComponent() - - End Sub - - Private Shared Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Init - 'CODEGEN: This method call is required by the Web Form Designer - 'Do not modify it using the code editor. - InitializeComponent() - End Sub - - Private Sub Page_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load - - SetTheme(pnlEventsModule) - AddFacebookMetaTags() - LoadModuleControl() ' Load Module Control onto Page - End Sub -#End Region - -#Region "Private Methods " - Private Sub LoadModuleControl() - Try - _socialGroupId = GetUrlGroupId() - _socialUserId = GetUrlUserId() - Dim objModules As New Entities.Modules.ModuleController - Dim objModule As Entities.Modules.ModuleInfo = objModules.GetModule(ModuleId, TabId) - Dim objDesktopModule As Entities.Modules.DesktopModuleInfo = Entities.Modules.DesktopModuleController.GetDesktopModule(objModule.DesktopModuleID, PortalId) - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - - ' Force Module Default Settings on new Version or New Module Instance - If objDesktopModule.Version <> Settings.Version Then - CreateThemeDirectory() - ' objEventInfoHelper.SetDefaultModuleSettings(ModuleId, TabId, Page, LocalResourceFile) - End If - - If Not Request.QueryString("mctl") = Nothing And _ - (ModuleId = CType(Request.QueryString("ModuleID"), Integer) Or _ - ModuleId = CType(Request.QueryString("mid"), Integer)) Then - If Request("mctl").EndsWith(".ascx") Then - _mcontrolToLoad = Request("mctl") - Else - _mcontrolToLoad = Request("mctl") & ".ascx" - End If - End If - - ' Set Default, if none selected - If _mcontrolToLoad.Length = 0 Then - If Not Request.Cookies.Get("DNNEvents" & ModuleId) Is Nothing Then - _mcontrolToLoad = Request.Cookies.Get("DNNEvents" & ModuleId).Value - Else - ' See if Default View Set - _mcontrolToLoad = Settings.DefaultView - End If - End If - - ' Check for Valid Module to Load - _mcontrolToLoad = IO.Path.GetFileNameWithoutExtension(_mcontrolToLoad) + ".ascx" - Select Case _mcontrolToLoad.ToLower - Case "eventdetails.ascx" - ' Search and RSS feed may direct detail page url to base module - - ' should be put in new page - If Settings.Eventdetailnewpage Then - 'Get the item id of the selected event - If Not (Request.Params("ItemId") Is Nothing) Then - _itemId = Int32.Parse(Request.Params("ItemId")) - Dim objCtlEvents As New EventController - Dim objEvent As EventInfo = objCtlEvents.EventsGet(_itemId, ModuleId) - If Not objEvent Is Nothing Then - Response.Redirect(objEventInfoHelper.GetDetailPageRealURL(objEvent.EventID, _socialGroupId, _socialUserId)) - End If - End If - End If - Case "eventday.ascx" - Case "eventmonth.ascx" - Case "eventweek.ascx" - Case "eventrpt.ascx" - If Settings.ListViewGrid Then - _mcontrolToLoad = "EventList.ascx" - End If - Case "eventlist.ascx" - If Not Settings.ListViewGrid Then - _mcontrolToLoad = "EventRpt.ascx" - End If - Case "eventmoderate.ascx" - Response.Redirect(objEventInfoHelper.AddSkinContainerControls(NavigateURL(TabId, "Moderate", "Mid=" & ModuleId.ToString), "?")) - Case "eventmyenrollments.ascx" - Case Else - lblModuleSettings.Text = Localization.GetString("lblBadControl", LocalResourceFile) - lblModuleSettings.Visible = True - Exit Sub - End Select - - Dim objPortalModuleBase As Entities.Modules.PortalModuleBase = CType(LoadControl(_mcontrolToLoad), Entities.Modules.PortalModuleBase) - objPortalModuleBase.ModuleConfiguration = ModuleConfiguration.Clone - objPortalModuleBase.ID = IO.Path.GetFileNameWithoutExtension(_mcontrolToLoad) - phMain.Controls.Add(objPortalModuleBase) - - 'EVT-4499 Exlude the EventMyEnrollment.ascx to be set as cookie - If _mcontrolToLoad.ToLower <> "eventdetails.ascx" _ - And _mcontrolToLoad.ToLower <> "eventday.ascx" _ - And _mcontrolToLoad.ToLower <> "eventmyenrollments.ascx" Then - Dim objCookie As HttpCookie = New HttpCookie("DNNEvents" & ModuleId) - objCookie.Value = _mcontrolToLoad - If Request.Cookies.Get("DNNEvents" & ModuleId) Is Nothing Then - Response.Cookies.Add(objCookie) - Else - Response.Cookies.Set(objCookie) - End If - End If - - Catch exc As Exception - ProcessModuleLoadException(Me, exc) - End Try - End Sub -#End Region - -#Region "Optional Interfaces" - Public ReadOnly Property ModuleActions() As Entities.Modules.Actions.ModuleActionCollection Implements Entities.Modules.IActionable.ModuleActions - Get - _socialGroupId = GetUrlGroupId() - _socialUserId = GetUrlUserId() - ' ReSharper disable LocalVariableHidesMember - ' ReSharper disable InconsistentNaming - Dim Actions As New Entities.Modules.Actions.ModuleActionCollection - ' ReSharper restore InconsistentNaming - ' ReSharper restore LocalVariableHidesMember - Dim objEventInfoHelper As New EventInfoHelper(ModuleId, TabId, PortalId, Settings) - Dim securityLevel As SecurityAccessLevel = SecurityAccessLevel.View - - Try - If PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) Then - securityLevel = SecurityAccessLevel.Admin - End If - - ' Add Event - If IsModuleEditor() Then - If _socialGroupId > 0 Then - Actions.Add(GetNextActionID(), Localization.GetString("MenuAddEvents", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/cal-add.gif", objEventInfoHelper.AddSkinContainerControls(EditUrl("groupid", _socialGroupId.ToString, "Edit"), "?"), False, securityLevel, True, False) - ElseIf _socialUserId > 0 Then - If _socialUserId = UserId Or IsModerator() Then - Actions.Add(GetNextActionID(), Localization.GetString("MenuAddEvents", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/cal-add.gif", objEventInfoHelper.AddSkinContainerControls(EditUrl("userid", _socialUserId.ToString, "Edit"), "?"), False, securityLevel, True, False) - End If - Else - Actions.Add(GetNextActionID(), Localization.GetString("MenuAddEvents", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/cal-add.gif", objEventInfoHelper.AddSkinContainerControls(EditUrl("Edit"), "?"), False, securityLevel, True, False) - End If - End If - - If Not Request.QueryString("mctl") = Nothing And ModuleId = CType(Request.QueryString("ModuleID"), Integer) Then - If Request("mctl").EndsWith(".ascx") Then - _mcontrolToLoad = Request("mctl") - Else - _mcontrolToLoad = Request("mctl") & ".ascx" - End If - End If - - ' Set Default, if none selected - If _mcontrolToLoad.Length = 0 Then - If Not Request.Cookies.Get("DNNEvents" & ModuleId) Is Nothing Then - _mcontrolToLoad = Request.Cookies.Get("DNNEvents" & ModuleId).Value - Else - ' See if Default View Set - _mcontrolToLoad = Settings.DefaultView - End If - End If - - 'Add Month and Week Views - If Settings.MonthAllowed And _mcontrolToLoad <> "EventMonth.ascx" Then - If _socialGroupId > 0 Then - Actions.Add(GetNextActionID, Localization.GetString("MenuMonth", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/cal-month.gif", NavigateURL(TabId, "", "ModuleID=" & ModuleId.ToString, "mctl=EventMonth", "groupid=" & _socialGroupId.ToString), False, securityLevel, True, False) - ElseIf _socialUserId > 0 Then - Actions.Add(GetNextActionID, Localization.GetString("MenuMonth", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/cal-month.gif", NavigateURL(TabId, "", "ModuleID=" & ModuleId.ToString, "mctl=EventMonth", "userid=" & _socialUserId.ToString), False, securityLevel, True, False) - Else - Actions.Add(GetNextActionID, Localization.GetString("MenuMonth", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/cal-month.gif", NavigateURL(TabId, "", "ModuleID=" & ModuleId.ToString, "mctl=EventMonth"), False, securityLevel, True, False) - End If - End If - If Settings.WeekAllowed And _mcontrolToLoad <> "EventWeek.ascx" Then - If _socialGroupId > 0 Then - Actions.Add(GetNextActionID, Localization.GetString("MenuWeek", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/cal-week.gif", NavigateURL(TabId, "", "ModuleID=" & ModuleId.ToString, "mctl=EventWeek", "groupid=" & _socialGroupId.ToString), False, securityLevel, True, False) - ElseIf _socialUserId > 0 Then - Actions.Add(GetNextActionID, Localization.GetString("MenuWeek", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/cal-week.gif", NavigateURL(TabId, "", "ModuleID=" & ModuleId.ToString, "mctl=EventWeek", "userid=" & _socialUserId.ToString), False, securityLevel, True, False) - Else - Actions.Add(GetNextActionID, Localization.GetString("MenuWeek", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/cal-week.gif", NavigateURL(TabId, "", "ModuleID=" & ModuleId.ToString, "mctl=EventWeek"), False, securityLevel, True, False) - End If - End If - If Settings.ListAllowed And _mcontrolToLoad <> "EventList.ascx" Then - If _socialGroupId > 0 Then - Actions.Add(GetNextActionID, Localization.GetString("MenuList", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/cal-list.gif", NavigateURL(TabId, "", "ModuleID=" & ModuleId.ToString, "mctl=EventList", "groupid=" & _socialGroupId.ToString), False, securityLevel, True, False) - ElseIf _socialUserId > 0 Then - Actions.Add(GetNextActionID, Localization.GetString("MenuList", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/cal-list.gif", NavigateURL(TabId, "", "ModuleID=" & ModuleId.ToString, "mctl=EventList", "userid=" & _socialUserId.ToString), False, securityLevel, True, False) - Else - Actions.Add(GetNextActionID, Localization.GetString("MenuList", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/cal-list.gif", NavigateURL(TabId, "", "ModuleID=" & ModuleId.ToString, "mctl=EventList"), False, securityLevel, True, False) - End If - End If - - - ' See if Enrollments - If Settings.Eventsignup Then - If _socialGroupId > 0 Then - Actions.Add(GetNextActionID, Localization.GetString("MenuMyEnrollments", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/cal-enroll.gif", NavigateURL(TabId, "", "ModuleID=" & ModuleId.ToString, "mctl=EventMyEnrollments", "groupid=" & _socialGroupId.ToString), False, securityLevel, True, False) - ElseIf _socialUserId > 0 Then - Actions.Add(GetNextActionID, Localization.GetString("MenuMyEnrollments", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/cal-enroll.gif", NavigateURL(TabId, "", "ModuleID=" & ModuleId.ToString, "mctl=EventMyEnrollments", "userid=" & _socialUserId.ToString), False, securityLevel, True, False) - Else - Actions.Add(GetNextActionID, Localization.GetString("MenuMyEnrollments", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/cal-enroll.gif", NavigateURL(TabId, "", "ModuleID=" & ModuleId.ToString, "mctl=EventMyEnrollments"), False, securityLevel, True, False) - End If - End If - - If IsModerator() And Settings.Moderateall Then - If _socialGroupId > 0 Then - Actions.Add(GetNextActionID(), Localization.GetString("MenuModerate", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/moderate.gif", objEventInfoHelper.AddSkinContainerControls(EditUrl("groupid", _socialGroupId.ToString, "Moderate"), "?"), False, securityLevel, True, False) - ElseIf _socialUserId > 0 Then - Actions.Add(GetNextActionID(), Localization.GetString("MenuModerate", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/moderate.gif", objEventInfoHelper.AddSkinContainerControls(EditUrl("userid", _socialUserId.ToString, "Moderate"), "?"), False, securityLevel, True, False) - Else - Actions.Add(GetNextActionID(), Localization.GetString("MenuModerate", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/moderate.gif", objEventInfoHelper.AddSkinContainerControls(EditUrl("Moderate"), "?"), False, securityLevel, True, False) - End If - End If - If IsSettingsEditor() Then - If _socialGroupId > 0 Then - Actions.Add(GetNextActionID(), Localization.GetString("MenuSettings", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", Entities.Icons.IconController.IconURL("EditTab"), objEventInfoHelper.AddSkinContainerControls(EditUrl("groupid", _socialGroupId.ToString, "EventSettings"), "?"), False, securityLevel, True, False) - ElseIf _socialUserId > 0 Then - Actions.Add(GetNextActionID(), Localization.GetString("MenuSettings", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", Entities.Icons.IconController.IconURL("EditTab"), objEventInfoHelper.AddSkinContainerControls(EditUrl("userid", _socialUserId.ToString, "EventSettings"), "?"), False, securityLevel, True, False) - Else - Actions.Add(GetNextActionID(), Localization.GetString("MenuSettings", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", Entities.Icons.IconController.IconURL("EditTab"), objEventInfoHelper.AddSkinContainerControls(EditUrl("EventSettings"), "?"), False, securityLevel, True, False) - End If - End If - If IsCategoryEditor() Then - If _socialGroupId > 0 Then - Actions.Add(GetNextActionID(), Localization.GetString("MenuCategories", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/SmallCalendar.gif", objEventInfoHelper.AddSkinContainerControls(EditUrl("groupid", _socialGroupId.ToString, "Categories"), "?"), False, securityLevel, True, False) - ElseIf _socialUserId > 0 Then - Actions.Add(GetNextActionID(), Localization.GetString("MenuCategories", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/SmallCalendar.gif", objEventInfoHelper.AddSkinContainerControls(EditUrl("userid", _socialUserId.ToString, "Categories"), "?"), False, securityLevel, True, False) - Else - Actions.Add(GetNextActionID(), Localization.GetString("MenuCategories", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/SmallCalendar.gif", objEventInfoHelper.AddSkinContainerControls(EditUrl("Categories"), "?"), False, securityLevel, True, False) - End If - End If - If IsLocationEditor() Then - If _socialGroupId > 0 Then - Actions.Add(GetNextActionID(), Localization.GetString("MenuLocations", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/SmallCalendar.gif", objEventInfoHelper.AddSkinContainerControls(EditUrl("groupid", _socialGroupId.ToString, "Locations"), "?"), False, securityLevel, True, False) - ElseIf _socialUserId > 0 Then - Actions.Add(GetNextActionID(), Localization.GetString("MenuLocations", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/SmallCalendar.gif", objEventInfoHelper.AddSkinContainerControls(EditUrl("userid", _socialUserId.ToString, "Locations"), "?"), False, securityLevel, True, False) - Else - Actions.Add(GetNextActionID(), Localization.GetString("MenuLocations", LocalResourceFile), Entities.Modules.Actions.ModuleActionType.ContentOptions, "", "../DesktopModules/Events/Images/SmallCalendar.gif", objEventInfoHelper.AddSkinContainerControls(EditUrl("Locations"), "?"), False, securityLevel, True, False) - End If - End If - - Catch exc As Exception - 'ProcessModuleLoadException(Me, exc) - End Try - Return Actions - End Get - End Property -#End Region - - End Class - -End Namespace diff --git a/Installation/06.03.02.SqlDataProvider b/Installation/06.03.02.SqlDataProvider new file mode 100644 index 0000000..16a1718 --- /dev/null +++ b/Installation/06.03.02.SqlDataProvider @@ -0,0 +1,208 @@ +/************************************************************/ +/***** *****/ +/***** SqlDataProvider *****/ +/***** Install/Upgrade for Events module 06.02.03 *****/ +/***** *****/ +/***** Note: To manually execute this script you must *****/ +/***** perform a search AND replace operation *****/ +/***** for {databaseOwner} AND {objectQualifier} *****/ +/***** or use 'SQL' FROM Host Menu AND run this. *****/ +/***** *****/ +/************************************************************/ + +if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}EventsModerateSignups]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) +drop procedure {databaseOwner}[{objectQualifier}EventsModerateSignups] +GO + +/*** EventsModerateSignups ***/ +CREATE PROCEDURE {databaseOwner}[{objectQualifier}EventsModerateSignups] +( + @ModuleID int, + @SocialGroupId int +) +AS +BEGIN +SET NOCOUNT ON; +SET DATEFORMAT mdy; + +SELECT s.EventID, + s.SignupID, + s.ModuleID, + s.Userid, + s.Approved, + u.DisplayName as UserName, + u.Email, + c.EventDateBegin, + c.EventTimeBegin, + c.EventName, + c.Importance, + c.Approved as EventApproved, + c.MaxEnrollment, + ( SELECT COUNT(*) + FROM {databaseOwner}[{objectQualifier}EventsSignups] + WHERE EventID = c.EventID AND c.Signups = 1 + ) as Enrolled, + PayPalStatus, + PayPalReason, + PayPalTransID, + PayPalPayerID, + PayPalPayerStatus, + PayPalRecieverEmail, + PayPalUserEmail, + PayPalPayerEmail, + PayPalFirstName, + PayPalLastName, + PayPalAddress, + PayPalCity, + PayPalState, + PayPalZip, + PayPalCountry, + PayPalCurrency, + PayPalPaymentDate, + PayPalAmount, + PayPalFee, + AnonEmail, + AnonName, + AnonTelephone, + AnonCulture, + AnonTimeZoneId, + S.FirstName, + S.LastName, + S.Company, + S.JobTitle, + S.ReferenceNumber, + S.Street, + S.PostalCode, + S.City, + S.Region, + S.Country +FROM {databaseOwner}[{objectQualifier}EventsRecurMaster] AS r RIGHT OUTER JOIN + {databaseOwner}[{objectQualifier}Events] AS c ON r.RecurMasterID = c.RecurMasterID RIGHT OUTER JOIN + {databaseOwner}[{objectQualifier}EventsSignups] AS s LEFT OUTER JOIN + {databaseOwner}[{objectQualifier}Users] AS u ON s.UserID = u.UserID ON c.EventID = s.EventID +Where s.Approved = 0 + AND s.ModuleID = @ModuleID + AND (r.SocialGroupId = @SocialGroupId or (r.SocialGroupId is null and @SocialGroupId = -1)) +ORDER BY c.EventDateBegin, c.EventTimeBegin, c.EventName, UserName +END +GO + +/*** EventsGetByRange ***/ +if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}EventsGetByRange]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) +drop procedure {databaseOwner}[{objectQualifier}EventsGetByRange] +GO + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}EventsGetByRange] +( + @ModuleIDs nvarchar(1024), + @BeginDate datetime, + @EndDate datetime, + @CategoryIDs nvarchar(1024), + @LocationIDs nvarchar(1024), + @SocialGroupId int, + @SocialUserId int +) +AS +BEGIN +SET NOCOUNT ON; +SET DATEFORMAT mdy; + +CREATE Table #EventIDs + (EventID Int, NoOfRecurrences Int, LastRecurrence DateTime) + +INSERT INTO #EventIDs (EventID, NoOfRecurrences, LastRecurrence) +SELECT DISTINCT e.EventID, Count(E2.EventID) as NoOfRecurrences, Max(E2.EventTimeBegin) as LastRecurrence + FROM {databaseOwner}[{objectQualifier}Events] E + LEFT OUTER JOIN {databaseOwner}[{objectQualifier}EventsMaster] M ON E.ModuleID = M.SubEventID + LEFT JOIN {databaseOwner}[{objectQualifier}Events] as E2 ON E.RecurMasterID = E2.RecurMasterID + WHERE ((E.EventTimeBegin < DATEADD(DAY,1,@EndDate) AND DATEADD(minute,E.Duration,E.EventTimeBegin) >= @BeginDate) OR + (E.EventTimeBegin >= @BeginDate AND E.EventTimeBegin < DATEADD(DAY,1, @EndDate))) + AND E.Approved = 1 + AND E.Cancelled = 0 + AND (E.ModuleID in (SELECT * FROM {databaseOwner}[{objectQualifier}EventsSplitIDs](@ModuleIDs))) +GROUP By E.EventID + +SELECT E.PortalID, E.EventID, E.RecurMasterID, E.ModuleID, E.EventDateBegin, E.EventDateEnd, + E.EventTimeBegin, E.Duration, E.EventName, E.EventDesc, + E.Importance, E.CreatedDate, + CreatedBy = U.DisplayName, + E.CreatedByID, + E.Every, + E.Period, + E.RepeatType, + E.Notify, + E.approved, + E.Signups, + E.MaxEnrollment, + (Select Sum(NoEnrolees) from {databaseOwner}[{objectQualifier}EventsSignups] WHERE EventID = E.EventID and E.Signups = 1) as Enrolled, + ET.NoOfRecurrences, + ET.LastRecurrence, + E.EnrollRoleID, + E.EnrollFee, + E.EnrollType, + E.PayPalAccount, + E.Cancelled, + E.DetailPage, + E.DetailNewWin, + E.DetailURL, + E.ImageURL, + E.ImageType, + E.ImageWidth, + E.ImageHeight, + E.ImageDisplay, + E.Location, + c.LocationName, + c.MapURL, + E.Category, + b.CategoryName, + b.Color, + b.FontColor, + E.Reminder, + E.SendReminder, + E.ReminderTime, + E.ReminderTimeMeasurement, + E.ReminderFrom, + E.SearchSubmitted, + E.CustomField1, + E.CustomField2, + E.EnrollListView, + E.DisplayEndDate, + E.AllDayEvent, + E.OwnerID, + OwnerName = O.DisplayName, + E.LastUpdatedAt, + LastUpdatedBy = L.DisplayName, + E.LastUpdatedID, + RMOwnerID = r.OwnerID, + r.RRULE, + E.OriginalDateBegin, + E.NewEventEmailSent, + r.EventTimeZoneId, + E.AllowAnonEnroll, + E.ContentItemId, + E.JournalItem, + r.SocialGroupId, + r.SocialUserId, + E.Summary, + E.Sequence, + RMSequence = r.Sequence, + SocialUserUserName = S.UserName, + SocialUserDisplayName = S.DisplayName + FROM {databaseOwner}[{objectQualifier}Events] E + inner join {databaseOwner}[{objectQualifier}EventsRecurMaster] AS r on E.RecurMasterID = r.RecurMasterID + left outer join {databaseOwner}[{objectQualifier}Users] U on E.CreatedByID = U.UserID + left outer join {databaseOwner}[{objectQualifier}Users] O on E.OwnerID = O.UserID + left outer join {databaseOwner}[{objectQualifier}Users] L on E.LastUpdatedID = L.UserID + left outer join {databaseOwner}[{objectQualifier}Users] S on r.SocialUserId = S.UserID + left join {databaseOwner}[{objectQualifier}EventsCategory] b on E.Category = b.Category + left join {databaseOwner}[{objectQualifier}EventsLocation] c on E.Location = c.Location + left join #EventIDs ET on E.EventID = ET.EventID +WHERE E.EventID in (Select EventID from #EventIDs) + AND (e.Category in (SELECT * FROM {databaseOwner}[{objectQualifier}EventsSplitIDs](@CategoryIDs)) or @CategoryIDs = '-1') + AND (e.Location in (SELECT * FROM {databaseOwner}[{objectQualifier}EventsSplitIDs](@LocationIDs)) or @LocationIDs = '-1') + AND (r.SocialGroupId = @SocialGroupId or @SocialGroupId = -1) + AND (r.SocialUserId = @SocialUserId or @SocialUserId = -1) +ORDER BY e.EventTimeBegin +END + +GO diff --git a/Installation/Attributes.cs b/Installation/Attributes.cs new file mode 100644 index 0000000..436ac3e --- /dev/null +++ b/Installation/Attributes.cs @@ -0,0 +1,106 @@ +using System; + +namespace DNNtc +{ + + #region Attributes + /// + /// This class is used to indicate which UserControls should be in the install package + /// + public class ModuleControlProperties : Attribute + { + /// + /// Creates a attribute with the right properties to create a control. + /// + /// The key. + /// The title. + /// type of the user control. + /// The help URL. + /// if set to true [supports partial rendering]. + /// if set to true [supports pop ups]. + public ModuleControlProperties(string key, string title, ControlType userControlType, string helpUrl, bool supportsPartialRendering = false, bool supportsPopUps = false) + { + //Intentially left empty + } + } + + /// + /// Module permission attribute + /// + [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] + public class ModulePermission : Attribute + { + /// + /// Empty Constructor for Intellisense + /// + /// + /// + /// + public ModulePermission(string Code, string Key, string Name) + { + //Intentially left empty + } + } + + public class BusinessControllerClass : Attribute + { + //Intentially left empty + } + + public class UpgradeEventMessage : Attribute + { + public UpgradeEventMessage(string VersionList) + { + //Intentially left empty + } + } + + [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] + public class ModuleDependencies : Attribute + { + public ModuleDependencies(ModuleDependency Type, string Value) + { + //Intentially left empty + } + } + + #endregion + + #region Helper Enumerations + + /// + /// Enum for type of component used. + /// + public enum ComponentType + { + Script, + Assembly, + Module + } + + /// + /// Enum for the type of controls DotNetNuke is using. + /// + public enum ControlType + { + SkinObject, + Anonymous, + View, + Edit, + Admin, + Host + } + + /// + /// The type of dependency for the DotNetNuke Module + /// + public enum ModuleDependency + { + CoreVersion, + Package, + Permission, + Type + } + + #endregion +} \ No newline at end of file diff --git a/Installation/Attributes.vb b/Installation/Attributes.vb deleted file mode 100644 index 80b64c3..0000000 --- a/Installation/Attributes.vb +++ /dev/null @@ -1,157 +0,0 @@ -Imports System -Namespace DNNtc - -#Region " Attributes " - ''' - ''' This class is used to set information about the package - ''' - _ - Public Class PackageProperties - Inherits Attribute - ' ReSharper disable UnusedParameter.Local - ''' - ''' Creates a attribute with the right properties to create a package. Use on View element - ''' - ''' The package name - ''' Ordinal number for sorting packages in the manifest - ''' The package friendly name - ''' The package description - ''' The package iconfile name - ''' Name of Owner - ''' Organization of owner - ''' Url of owner - ''' Email of owner - - Public Sub New(ByVal name As String, ByVal viewOrder As Integer, ByVal friendlyName As String, ByVal description As String, ByVal iconFile As String, ByVal ownerName As String, ByVal ownerOrganization As String, ByVal ownerUrl As String, ByVal ownerEmail As String) - 'Intentially left empty - End Sub - - ''' - ''' Creates a attribute with the right properties to create a package. Use on other elements - ''' - ''' The package name - Public Sub New(ByVal name As String) - ' ReSharper restore UnusedParameter.Local - 'Intentially left empty - End Sub - - End Class - - ''' - ''' This class is used to set information about the module - ''' - _ - Public Class ModuleProperties - Inherits Attribute - ' ReSharper disable UnusedParameter.Local - ''' - ''' Creates a attribute with the right properties to create a module. Use on View element - ''' - ''' The module name. - ''' The module friendlyname. - ''' the module default cachetime. - - Public Sub New(ByVal name As String, ByVal friendlyname As String, ByVal defaultCacheTime As Integer) - 'Intentially left empty - End Sub - - ''' - ''' Creates a attribute with the right properties to create a module. Use on other elements - ''' - ''' The module name. - Public Sub New(ByVal name As String) - ' ReSharper restore UnusedParameter.Local - 'Intentially left empty - End Sub - - End Class - - ''' - ''' This class is used to indicate which UserControls should be in the install package - ''' - Public Class ModuleControlProperties - Inherits Attribute - ' ReSharper disable UnusedParameter.Local - ''' - ''' Initializes a new instance of the class. - ''' - ''' The key. - ''' The title. - ''' Type of the user control. - ''' The help URL. - ''' if set to true [supports partial rendering]. - ''' if set to true [supports pop ups]. - - Public Sub New(ByVal key As String, ByVal title As String, ByVal userControlType As ControlType, ByVal helpUrl As String, ByVal supportsPartialRendering As Boolean, ByVal supportsPopUps As Boolean) - ' ReSharper restore UnusedParameter.Local - 'Intentially left empty - End Sub - - End Class - - ''' - ''' Module permission attribute - ''' - _ - Public Class ModulePermission - Inherits Attribute - ' ReSharper disable UnusedParameter.Local - ''' - ''' Empty Constructor for Intellisense - ''' - ''' - ''' - ''' - Public Sub New(ByVal code As String, ByVal key As String, ByVal name As String) - ' ReSharper restore UnusedParameter.Local - 'Intentially left empty - End Sub - End Class - - Public Class BusinessControllerClass - Inherits Attribute - 'Intentially left empty - End Class - - Public Class UpgradeEventMessage - Inherits Attribute - ' ReSharper disable UnusedParameter.Local - Public Sub New(ByVal versionList As String) - ' ReSharper restore UnusedParameter.Local - 'Intentially left empty - End Sub - End Class - - _ - Public Class ModuleDependencies - Inherits Attribute - ' ReSharper disable UnusedParameter.Local - Public Sub New(ByVal type As ModuleDependency, ByVal value As String) - ' ReSharper restore UnusedParameter.Local - 'Intentially left empty - End Sub - End Class - -#End Region - -#Region " Enums " - - Public Enum ControlType - SkinObject - Anonymous - View - Edit - Admin - Host - End Enum - - Public Enum ModuleDependency - CoreVersion - Package - Permission - Type - End Enum - -#End Region - -End Namespace \ No newline at end of file diff --git a/Installation/CleanUp/Cleanup.06.03.02.txt b/Installation/CleanUp/Cleanup.06.03.02.txt new file mode 100644 index 0000000..99f59b3 --- /dev/null +++ b/Installation/CleanUp/Cleanup.06.03.02.txt @@ -0,0 +1,3 @@ +'Remove old versions of events +Install\Module\Events_06.03.01_Source.zip +Install\Module\Events_06.03.01_Install.zip diff --git a/Installation/CleanUp/Cleanup.07.00.00.txt b/Installation/CleanUp/Cleanup.07.00.00.txt new file mode 100644 index 0000000..10e7eef --- /dev/null +++ b/Installation/CleanUp/Cleanup.07.00.00.txt @@ -0,0 +1,8 @@ +'Remove old versions of events +Install\Module\Events_06.03.01_Source.zip +Install\Module\Events_06.03.01_Install.zip +Install\Module\Events_06.03.02_Source.zip +Install\Module\Events_06.03.02_Install.zip +'Tidy up debug files if any +Bin\DotNetNuke.Modules.Events.pdb +Bin\DotNetNuke.Modules.Events.ScheduleControl.pdb diff --git a/Installation/DNN_Events.dnn b/Installation/DNN_Events.dnn index 5412ec9..4ac924f 100644 --- a/Installation/DNN_Events.dnn +++ b/Installation/DNN_Events.dnn @@ -1,6 +1,6 @@ - + Events This module renders single and recurring events and includes Master and Sub Calendars with Event Rollup, TimeZone Adjustment, Event Enrollment, and Event Notification. DesktopModules\Events\DNN_Events.png @@ -11,10 +11,10 @@ support@dnnsoftware.com - + true - 08.00.00 + 8.0.0 @@ -210,6 +210,11 @@ 06.02.02.SqlDataProvider 06.02.02 +