Hi Adrián,
Good place for DNN development is - http://www.adefwebserver.com/DotNetNukeHELP/.
And several code changes, in eventdetails.ascx.vb. You will also need to add an entry to EventDetails.ascx.resx. Shout if it isn't obvious.
' See if the User is Logged on and if they already are signed up
' And that Signup is Authorized
' And also that the Date/Time has not passed
If (Context.Request.IsAuthenticated) And _
(startdate.Date >= Now().Date) And _
(objEvent.Signups) Then
If (objEvent.EnrollRoleID.Length = 0 Or objEvent.EnrollRoleID = "0") Then
UserEnrollment(objEvent, startdate)
ElseIf objEvent.EnrollRoleID <> "" Then
If IsNumeric(objEvent.EnrollRoleID) Then
If IsEnrollRole(CInt(objEvent.EnrollRoleID)) Then
UserEnrollment(objEvent, startdate)
End If
End If
End If
End If
'Are You Sure You Want To Enroll?'
cmdSignup.Attributes.Add("onClick", " return confirm('" + Localization.GetString("SureYouWantToEnroll", LocalResourceFile) + "');")
Changed to
' See if user already are signed up
' And that Signup is Authorized
' And also that the Date/Time has not passed
If (startdate.Date >= Now().Date) And _
(objEvent.Signups) Then
If (objEvent.EnrollRoleID.Length = 0 Or objEvent.EnrollRoleID = "0") Then
UserEnrollment(objEvent, startdate)
ElseIf objEvent.EnrollRoleID <> "" Then
If IsNumeric(objEvent.EnrollRoleID) Then
If IsEnrollRole(CInt(objEvent.EnrollRoleID)) Then
UserEnrollment(objEvent, startdate)
End If
End If
End If
End If
'Are You Sure You Want To Enroll?'
If Request.IsAuthenticated Then
cmdSignup.Attributes.Add("onClick", " return confirm('" + Localization.GetString("SureYouWantToEnroll", LocalResourceFile) + "');")
End If
And....
' Display User Enrollment Info on Page
Private Sub UserEnrollment(ByVal objEvent As EventInfo, ByVal EventDate As DateTime)
If CType(Settings("eventsignup"), Boolean) Then
' If not already enrolled, allow the user to signup (if enabled)
objEventSignups = objCtlEventSignups.EventsSignupsGetUser(objEvent.EventID, UserId, EventDate, ModuleId)
If (objEventSignups Is Nothing) Then
If (objEvent.Enrolled < objEvent.MaxEnrollment) Or _
(objEvent.MaxEnrollment = 0) Then
' User is not enrolled for this event...press the link to enroll!
cmdSignup.Visible = True
End If
Else
lblSignup.Visible = True
If objEventSignups.Approved Then
' User is enrolled and approved for this event!
lblSignup.Text = Localization.GetString("YouAreEnrolledForThisEvent", LocalResourceFile)
Else
' User is enrolled for this event, but not yet approved!
lblSignup.Text = Localization.GetString("EnrolledButNotApproved", LocalResourceFile)
End If
End If
If Request.Params("Status") = "enrolled" Then
' User has been successfully enrolled for this event (paid enrollment)
Me.lblSignup.Text = Localization.GetString("StatusPPSuccess", LocalResourceFile)
lblSignup.Visible = True
ElseIf Request.Params("Status") = "cancelled" Then
' User has been cancelled paid enrollment
Me.lblSignup.Text = Localization.GetString("StatusPPCancelled", LocalResourceFile)
lblSignup.Visible = True
End If
End If
End Sub
Changed to
' Display User Enrollment Info on Page
Private Sub UserEnrollment(ByVal objEvent As EventInfo, ByVal EventDate As DateTime)
If CType(Settings("eventsignup"), Boolean) Then
If Not Request.IsAuthenticated Then
cmdSignup.Visible = True
cmdSignup.Text = Localization.GetString("LoginToEnroll", LocalResourceFile)
Else
' If not already enrolled, allow the user to signup (if enabled)
objEventSignups = objCtlEventSignups.EventsSignupsGetUser(objEvent.EventID, UserId, EventDate, ModuleId)
If (objEventSignups Is Nothing) Then
If (objEvent.Enrolled < objEvent.MaxEnrollment) Or _
(objEvent.MaxEnrollment = 0) Then
' User is not enrolled for this event...press the link to enroll!
cmdSignup.Visible = True
cmdSignup.Text = Localization.GetString("EnrollForEvent", LocalResourceFile)
End If
Else
lblSignup.Visible = True
If objEventSignups.Approved Then
' User is enrolled and approved for this event!
lblSignup.Text = Localization.GetString("YouAreEnrolledForThisEvent", LocalResourceFile)
Else
' User is enrolled for this event, but not yet approved!
lblSignup.Text = Localization.GetString("EnrolledButNotApproved", LocalResourceFile)
End If
End If
If Request.Params("Status") = "enrolled" Then
' User has been successfully enrolled for this event (paid enrollment)
Me.lblSignup.Text = Localization.GetString("StatusPPSuccess", LocalResourceFile)
lblSignup.Visible = True
ElseIf Request.Params("Status") = "cancelled" Then
' User has been cancelled paid enrollment
Me.lblSignup.Text = Localization.GetString("StatusPPCancelled", LocalResourceFile)
lblSignup.Visible = True
End If
End If
End If
End Sub
and....
Private Sub cmdSignup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSignup.Click
Dim objEvent As New EventInfo
Try
objEvent = Me.objCtlEvent.EventsGet(itemID, ModuleId)
If objEvent.EnrollType = "PAID" Then
Try
Response.Redirect(NavigateURL(TabId, "PPEnroll", "Mid=" & ModuleId, "ItemID=" & itemID))
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
Else
Changed to
Private Sub cmdSignup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSignup.Click
If Not Request.IsAuthenticated Then
RedirectToLogin()
End If
Dim objEvent As New EventInfo
Try
objEvent = Me.objCtlEvent.EventsGet(itemID, ModuleId)
If objEvent.EnrollType = "PAID" Then
Try
Response.Redirect(NavigateURL(TabId, "PPEnroll", "Mid=" & ModuleId, "ItemID=" & itemID))
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
Else
Cheers
Roger