-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
384 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,9 @@ public class C501_CTRL_ClassReg_CreateAcct { | |
public ID loginID {get; set;} | ||
public String schoolName {get; set;} | ||
public Account schoolNameText {get; set;} | ||
public Boolean dontKnowId {get; set;} | ||
public Boolean noAllergies {get; set;} | ||
|
||
public String schoolRegion { | ||
get{ | ||
if(schoolRegion == null){ | ||
|
@@ -22,9 +25,12 @@ public class C501_CTRL_ClassReg_CreateAcct { | |
public School_Term__c term {get; set;} | ||
public String grade {get; set;} | ||
public Boolean noState {get; set;} | ||
public Boolean needPickup {get; set;} | ||
public Boolean noSchool {get; set;} | ||
public Boolean noGrade {get; set;} | ||
public Boolean noWaiver {get; set;} | ||
public Boolean noStuID {get; set;} | ||
public Boolean noAllergyResp {get; set;} | ||
private String RegType {get; set;} | ||
|
||
public List<SelectOption> schoolList { | ||
|
@@ -103,6 +109,10 @@ public class C501_CTRL_ClassReg_CreateAcct { | |
noSchool = false; | ||
noGrade = false; | ||
noWaiver = false; | ||
dontKnowId = false; | ||
noStuID = false; | ||
noAllergyResp = false; | ||
needPickup = false; | ||
|
||
Map<String, Schema.FieldSet> FsAcctMap = Schema.SObjectType.Account.fieldSets.getMap(); | ||
Map<String, Schema.FieldSet> FsContMap = Schema.SObjectType.Contact.fieldSets.getMap(); | ||
|
@@ -198,6 +208,31 @@ public class C501_CTRL_ClassReg_CreateAcct { | |
} else { | ||
noGrade = false; | ||
} | ||
|
||
if(term.Student_School_ID__c == null && dontKnowId == false){ | ||
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,Label.C501_RegSite_ProvideStudentId ) ); | ||
noStuId = true; | ||
passValidation = false; | ||
} else { | ||
noStuId = false; | ||
} | ||
|
||
if(child.Allergies__c == null && noAllergies == false){ | ||
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,Label.C501_RegSite_NoAllergiesError ) ); | ||
noAllergyResp = true; | ||
passValidation = false; | ||
} else { | ||
noAllergyResp = false; | ||
} | ||
|
||
if(child.Student_Transportation__c == 'Will receive a ride' && (child.Authorized_Pickup_1_Name__c == null || child.Authorized_Pickup_1_Phone__c == null || child.Authorized_Pickup_1_Relationship__c == null ) ){ | ||
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,Label.C501_RegSite_PickUpChildError ) ); | ||
needPickup = true; | ||
passValidation = false; | ||
} else { | ||
needPickup = false; | ||
} | ||
|
||
if( parent.Email == null && parent.HomePhone == null && parent.MobilePhone == null && parent.OtherPhone == null ){ | ||
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,Label.C501_RegSite_ParentContactRequired) ); | ||
passValidation = false; | ||
|
@@ -232,11 +267,15 @@ public class C501_CTRL_ClassReg_CreateAcct { | |
|
||
schoolNameText = [Select id, | ||
Name, | ||
Teachers_at_Site__c, | ||
Primary_Teacher__r.FirstName , | ||
Primary_Teacher__r.LastName , | ||
Secondary_Teacher__r.FirstName , | ||
Secondary_Teacher__r.LastName | ||
C501_Next_Program_Start_Date__c, | ||
( | ||
SELECT npe5__Status__c, | ||
npe5__Contact__c, | ||
npe5__Contact__r.FirstName, | ||
npe5__Contact__r.LastName | ||
FROM npe5__Affiliations__r | ||
WHERE npe5__Status__c = 'Current' | ||
) | ||
from Account | ||
where id = :schoolName]; | ||
|
||
|
@@ -250,14 +289,21 @@ public class C501_CTRL_ClassReg_CreateAcct { | |
C501_UTIL_ClassRegUtilities.sendSMSGenericFuture(parent.MobilePhone,Label.C501_RegSite_ConfirmSMS+' '+schoolNameText.Name ); | ||
} | ||
if(parent.Email != null && parent.Email != '' ){ | ||
String teacherName = schoolNameText.Primary_Teacher__r.FirstName + ' ' + schoolNameText.Primary_Teacher__r.LastName; | ||
|
||
if(schoolNameText.Secondary_Teacher__r.LastName != null){ | ||
teacherName = teacherName + ' ' + Label.C501_ClassReg_AND + ' ' + schoolNameText.Secondary_Teacher__r.FirstName + ' ' + schoolNameText.Secondary_Teacher__r.LastName; | ||
String teacherName = ''; | ||
for(Integer i = 0; i < schoolNameText.npe5__Affiliations__r.size(); i++){ | ||
if(i != 0 && i + 1 == schoolNameText.npe5__Affiliations__r.size() && schoolNameText.npe5__Affiliations__r.size() > 1){ | ||
teacherName = teacherName + ' ' + Label.C501_ClassReg_AND + ' '; | ||
} else if(i != 0 && schoolNameText.npe5__Affiliations__r.size() > 1 ) { | ||
teacherName = teacherName + ', '; | ||
} | ||
teacherName = teacherName + schoolNameText.npe5__Affiliations__r[i].npe5__Contact__r.FirstName + ' ' +schoolNameText.npe5__Affiliations__r[i].npe5__Contact__r.LastName; | ||
} | ||
|
||
String emailMessage = Label.C501_RegSite_ConfirmSMS+' '+schoolNameText.Name +Label.C501_RegSite_EmailConfirmP2+' '+Label.C501_RegSite_EmailConfirmP3+' '+teacherName+Label.C501_RegSite_EmailConfirmP4; | ||
C501_UTIL_ClassRegUtilities.SendEmailGeneric('[email protected]',parent.Email,Label.C501_RegSite_ConfirmSMS+' '+schoolNameText.Name,emailMessage); | ||
|
||
String nextStartDate = Datetime.newInstance(schoolNameText.C501_Next_Program_Start_Date__c, Time.newInstance(0,0,0,0)).format('MMMMM d, yyyy'); | ||
|
||
String emailMessage = Label.C501_RegSite_ConfirmSMS+' '+schoolNameText.Name +Label.C501_RegSite_EmailConfirmP2+' '+nextStartDate+' '+Label.C501_RegSite_EmailConfirmP3+' '+teacherName+Label.C501_RegSite_EmailConfirmP4; | ||
C501_UTIL_ClassRegUtilities.SendEmailGeneric('[email protected]',parent.Email,Label.C501_RegSite_ConfirmSMS+' '+schoolNameText.Name,emailMessage); | ||
|
||
C501_UTIL_ClassRegUtilities.logActivityToContact(parent.Id,Label.C501_RegSite_ConfirmSMS+' '+schoolNameText.Name, emailMessage,'Email'); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.