diff --git a/src/classes/C501_CTRL_ClassReg_CreateAcct.cls b/src/classes/C501_CTRL_ClassReg_CreateAcct.cls index dddb835..f0c9afb 100644 --- a/src/classes/C501_CTRL_ClassReg_CreateAcct.cls +++ b/src/classes/C501_CTRL_ClassReg_CreateAcct.cls @@ -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 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 FsAcctMap = Schema.SObjectType.Account.fieldSets.getMap(); Map 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('jon-c@501commons.org',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('salesforce@techbridgegirls.org',parent.Email,Label.C501_RegSite_ConfirmSMS+' '+schoolNameText.Name,emailMessage); C501_UTIL_ClassRegUtilities.logActivityToContact(parent.Id,Label.C501_RegSite_ConfirmSMS+' '+schoolNameText.Name, emailMessage,'Email'); } diff --git a/src/classes/C501_CTRL_ClassReg_CreateAcct.cls-meta.xml b/src/classes/C501_CTRL_ClassReg_CreateAcct.cls-meta.xml index 6eb4331..0549075 100644 --- a/src/classes/C501_CTRL_ClassReg_CreateAcct.cls-meta.xml +++ b/src/classes/C501_CTRL_ClassReg_CreateAcct.cls-meta.xml @@ -6,5 +6,10 @@ 11 npe01 + + 3 + 7 + npe5 + Active diff --git a/src/classes/C501_CTRL_ClassReg_Login.cls b/src/classes/C501_CTRL_ClassReg_Login.cls index 2b75c0b..153f94a 100644 --- a/src/classes/C501_CTRL_ClassReg_Login.cls +++ b/src/classes/C501_CTRL_ClassReg_Login.cls @@ -17,7 +17,7 @@ public class C501_CTRL_ClassReg_Login { phoneNumber = ''; confirmation = ''; identityInput = null; - remember = true; + remember = false; } public PageReference confirmLoginBySendToAddress(){ diff --git a/src/classes/C501_UTIL_ClassRegUtilities.cls b/src/classes/C501_UTIL_ClassRegUtilities.cls index 3db802e..14e28e5 100644 --- a/src/classes/C501_UTIL_ClassRegUtilities.cls +++ b/src/classes/C501_UTIL_ClassRegUtilities.cls @@ -190,8 +190,8 @@ public class C501_UTIL_ClassRegUtilities { public static void sendEmailConfirmation(ID AcctID, String emailAddress){ Class_Site_Login_Attempt__c att = generateLoginCode(AcctID, emailAddress); - String message = Label.C501_ClassReg_CodeMessage + ' '+att.Secret_Code__c + ' ' +Label.C501_ClassReg_CodeMessageDisclaim; - SendEmailGeneric('jon-c@501commons.org',emailAddress,Label.C501_ClassReg_ConfirmCodeSubject,message); + String message = Label.C501_ClassReg_CodeMessage + ' '+att.Secret_Code__c + ' ' +Label.C501_ClassReg_CodeMessageDisclaim+' '+Label.C501_ClassReg_CodeMessageExpire; + SendEmailGeneric('salesforce@techbridgegirls.org',emailAddress,Label.C501_ClassReg_ConfirmCodeSubject,message); insert att; } @@ -278,7 +278,7 @@ public class C501_UTIL_ClassRegUtilities { public static void sendSMS(ID AcctID,String phoneNumber){ Class_Site_Login_Attempt__c att = generateLoginCode(AcctId, phoneNumber); - sendSMSGeneric(phoneNumber,Label.C501_ClassReg_CodeMessage + ' '+att.Secret_Code__c + ' ' + Label.C501_ClassReg_CodeMessageDisclaim); + sendSMSGeneric(phoneNumber,Label.C501_ClassReg_CodeMessage + ' '+att.Secret_Code__c + ' ' + Label.C501_ClassReg_CodeMessageDisclaim+' '+Label.C501_ClassReg_CodeMessageExpire); insert att; } diff --git a/src/labels/CustomLabels.labels b/src/labels/CustomLabels.labels index 72ec630..f510031 100644 --- a/src/labels/CustomLabels.labels +++ b/src/labels/CustomLabels.labels @@ -14,6 +14,13 @@ C501_ClassReg_AddtlStudentInfo Additional Student Information + + C501_ClassReg_AuthPickup + en_US + false + C501_ClassReg_AuthPickup + If you selected "Someone will pick up my child", What is the name of someone authorized to pick up your child? + C501_ClassReg_AuthToTreatMinor en_US @@ -77,6 +84,13 @@ C501_ClassReg_ChildSchoolRegion Techbridge serves girls in four different regions. Which region is your child's school in? + + C501_ClassReg_CodeMessage + en_US + false + C501_ClassReg_CodeMessage + Hello There! Your code for the Techbridge Girls registration system is: + C501_ClassReg_CodeMessageDisclaim en_US @@ -84,6 +98,13 @@ C501_ClassReg_CodeMessageDisclaim This is an unmonitored account so please don’t reply. + + C501_ClassReg_CodeMessageExpire + en_US + false + C501_ClassReg_CodeMessageExpire + Code expires in 30 min. + C501_ClassReg_ConfirmCodeSubject en_US @@ -91,6 +112,13 @@ C501_ClassReg_ConfirmCodeSubject Your Techbridge Girls Confirmation Code + + C501_ClassReg_EmergencySubtext + en_US + false + C501_ClassReg_EmergencySubtext + In case the parent/guardian cannot be reached, please provide an EMERGENCY CONTACT. + C501_ClassReg_EvalStudy en_US @@ -272,6 +300,13 @@ We may also look at your child’s school information, like attendance and cours C501_ClassReg_PhotoVideoP1 Occasionally, Techbridge Girls program activities may be photographed, videotaped, and/or audio taped for educational, publicity or fundraising purposes. Please indicate if you give permission for you and/or your child or ward to appear in videos, photos and/or audio recordings without compensation (e.g., as part of brochures, slide shows or program websites). Your authorization below also permits Techbridge Girls to share photos and other media depicting you and/or your child or ward with partner organizations for use in their promotions of Techbridge Girls events and programs. + + C501_ClassReg_PickUpChild + en_US + false + C501_ClassReg_PickUpChild + Persons allowed to pick up my child: + C501_ClassReg_PlzSelectOne en_US @@ -391,6 +426,13 @@ We may also look at your child’s school information, like attendance and cours C501_RegSite_Continue Continue + + C501_RegSite_DontKnowID + en_US + false + C501_RegSite_DontKnowID + Check here if you don't know and authorize Techbridge Girls to get this from your child's school. + C501_RegSite_EmailConfirmP2 en_US @@ -412,6 +454,13 @@ We may also look at your child’s school information, like attendance and cours C501_RegSite_EmailConfirmP4 . Please contact the Techbridge Teacher at your school or community site for any questions. + + C501_RegSite_EmergencyContacts + en_US + false + C501_RegSite_EmergencyContacts + Emergency Contacts + C501_RegSite_FamilyInformation en_US @@ -468,6 +517,20 @@ We may also look at your child’s school information, like attendance and cours C501_RegSite_Login Log in + + C501_RegSite_NoAllergies + en_US + false + C501_RegSite_NoAllergies + No Food Restrictions or Allergies + + + C501_RegSite_NoAllergiesError + en_US + false + C501_RegSite_NoAllergiesError + Please indicate if your child has any food allergies or restrictions. + C501_RegSite_NotProvided en_US @@ -503,6 +566,13 @@ We may also look at your child’s school information, like attendance and cours C501_RegSite_ParentLastName Parent/Guardian Last Name + + C501_RegSite_PickUpChildError + en_US + false + C501_RegSite_PickUpChildError + Please identify someone who can pick up your child from the program. + C501_RegSite_ProvidePhoneEmail en_US @@ -510,6 +580,13 @@ We may also look at your child’s school information, like attendance and cours C501_RegSite_ProvidePhoneEmail Please provide your phone number or email address to log in. + + C501_RegSite_ProvideStudentId + en_US + false + C501_RegSite_ProvideStudentId + Please provide a Student ID Number, or give us permission to get it from your child's school. + C501_RegSite_RememberMeDevice en_US @@ -566,6 +643,13 @@ We may also look at your child’s school information, like attendance and cours C501_RegSite_StudentInformation Student Information + + C501_RegSite_Transport + en_US + false + C501_RegSite_Transport + Transportation and Authorized Pickup + C501_RegSite_WeSentYouCode en_US diff --git a/src/objects/Account.object b/src/objects/Account.object index 360eb9a..042644e 100644 --- a/src/objects/Account.object +++ b/src/objects/Account.object @@ -28,6 +28,16 @@ SUBSTITUTE(C501_Class_Site_Mobile_Number__c, "(", ""), " false Phone + + C501_Next_program_start_date__c + false + This is the date that the next class begins at this school. + + false + false + false + Date + Primary_Teacher__c SetNull diff --git a/src/objects/Contact.object b/src/objects/Contact.object index 8d2439f..97cfd80 100644 --- a/src/objects/Contact.object +++ b/src/objects/Contact.object @@ -3,11 +3,6 @@ C501_Class_Registration_Site_Child Used by the class registration site to define the fields used on the child contact. - - Allergies__c - false - false - Medication__c false @@ -28,86 +23,6 @@ false false - - Student_Transportation__c - false - false - - - Authorized_Pickup_1_Name__c - false - false - - - Authorized_Pickup_1_Phone__c - false - false - - - Authorized_Pickup_1_Relationship__c - false - false - - - Authorized_Pickup_2_Name__c - false - false - - - Authorized_Pickup_2_Phone__c - false - false - - - Authorized_Pickup_2_Relationship__c - false - false - - - Authorized_Pickup_3_Name__c - false - false - - - Authorized_Pickup_3_Phone__c - false - false - - - Authorized_Pickup_3_Relationship__c - false - false - - - Alternate_Contact_Name__c - false - false - - - Alternate_Contact_Phone__c - false - false - - - Alternate_Contact_Relationship__c - false - false - - - Emergency_Contact_2_Name__c - false - false - - - Emergency_Contact_2_Phone__c - false - false - - - Emergency_Contact_2_Relationship__c - false - false - @@ -153,7 +68,7 @@ Allergies__c false - Does your child have any food restrictions or food allergies (vegetarian, vegan, dairy, gluten, nuts, kosher, Halal, seafood, no pork products, etc.)? (If Yes, please explain. If No, please write "None") + Does your child have any food restrictions or food allergies (vegetarian, vegan, dairy, gluten, nuts, kosher, Halal, seafood, no pork products, etc.)? (If Yes, please explain. If No, please check the box below.) 255 false @@ -165,7 +80,7 @@ Alternate_Contact_Name__c false - In case the parent/guardian cannot be reached, please provide an EMERGENCY CONTACT + Emergency Contact Name 100 false @@ -199,7 +114,7 @@ Authorized_Pickup_1_Name__c false - If you selected "Someone will pick up my child", What is the name of someone authorized to pick up your child? + Authorized Pickup 1 Name 100 false @@ -233,7 +148,7 @@ Authorized_Pickup_2_Name__c false - Name of a second person authorized to pick up your child: + Authorized Pickup 2 Name 100 false @@ -267,7 +182,7 @@ Authorized_Pickup_3_Name__c false - Name of a third person authorized to pick up your child: + Authorized Pickup 3 Name 100 false @@ -301,7 +216,7 @@ Emergency_Contact_2_Name__c false - Please provide the name of a Second Emergency Contact + Second Emergency Contact's Name 100 false @@ -810,6 +725,11 @@ true false + + Do not need translation + false + + Amharic false @@ -866,6 +786,11 @@ false + + Not able to volunteer + false + + Make calls false diff --git a/src/package.xml b/src/package.xml index ad421be..a88444a 100644 --- a/src/package.xml +++ b/src/package.xml @@ -21,6 +21,7 @@ Account.C501_Class_Site_Mobile_Number_Lookup__c Account.C501_Class_Site_Mobile_Number__c + Account.C501_Next_program_start_date__c Account.Primary_Teacher__c Account.Region__c Account.Secondary_Teacher__c @@ -103,6 +104,7 @@ C501_ClassReg_AND C501_ClassReg_AddtlStudentInfo + C501_ClassReg_AuthPickup C501_ClassReg_AuthToTreatMinor C501_ClassReg_AuthToTreatMinorLabel C501_ClassReg_AuthToTreatMinorP1 @@ -113,8 +115,11 @@ C501_ClassReg_ChildSchoolName C501_ClassReg_ChildSchoolName C501_ClassReg_ChildSchoolRegion + C501_ClassReg_CodeMessage C501_ClassReg_CodeMessageDisclaim + C501_ClassReg_CodeMessageExpire C501_ClassReg_ConfirmCodeSubject + C501_ClassReg_EmergencySubtext C501_ClassReg_EvalStudy C501_ClassReg_EvalStudyH1 C501_ClassReg_EvalStudyH1P1 @@ -140,6 +145,7 @@ C501_ClassReg_PhotoVideo C501_ClassReg_PhotoVideoLabel C501_ClassReg_PhotoVideoP1 + C501_ClassReg_PickUpChild C501_ClassReg_PlzSelectOne C501_ClassReg_StudentID C501_ClassReg_StudentID @@ -159,9 +165,11 @@ C501_RegSite_ConfirmMessageSite C501_RegSite_ConfirmSMS C501_RegSite_Continue + C501_RegSite_DontKnowID C501_RegSite_EmailConfirmP2 C501_RegSite_EmailConfirmP3 C501_RegSite_EmailConfirmP4 + C501_RegSite_EmergencyContacts C501_RegSite_FamilyInformation C501_RegSite_FinishedApp C501_RegSite_FirstName @@ -170,12 +178,16 @@ C501_RegSite_LeaveBlank C501_RegSite_LeaveBlankEmail C501_RegSite_Login + C501_RegSite_NoAllergies + C501_RegSite_NoAllergiesError C501_RegSite_NotProvided C501_RegSite_ParentContactRequired C501_RegSite_ParentEmail C501_RegSite_ParentFirstName C501_RegSite_ParentLastName + C501_RegSite_PickUpChildError C501_RegSite_ProvidePhoneEmail + C501_RegSite_ProvideStudentId C501_RegSite_RememberMeDevice C501_RegSite_SelectGrade C501_RegSite_SelectSchool @@ -184,6 +196,7 @@ C501_RegSite_State C501_RegSite_StreetAddress C501_RegSite_StudentInformation + C501_RegSite_Transport C501_RegSite_WeSentYouCode C501_RegSite_Youarenotauthenticated C501_RegSite_ZipCode diff --git a/src/pages/C501_ClassReg_CreateAcct.page b/src/pages/C501_ClassReg_CreateAcct.page index cbd7b66..e362503 100644 --- a/src/pages/C501_ClassReg_CreateAcct.page +++ b/src/pages/C501_ClassReg_CreateAcct.page @@ -215,6 +215,147 @@ + +
+
+

+ {! $Label.C501_RegSite_EmergencyContacts } +

+

+ {! $Label.C501_ClassReg_EmergencySubtext } +

+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+

+ {! $Label.C501_RegSite_Transport } +

+
+
+
+
+
+ + +
+
+
+
+
+

+ {! $Label.C501_ClassReg_PickUpChild } +

+ +
+ Error: {! $Label.C501_RegSite_PickUpChildError } +
+
+ + +
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+

@@ -224,32 +365,63 @@

-
+
-
+
+
+
+
-
-
+
+
+
+ {! $Label.C501_RegSite_DontKnowID } + + +
+ Error: {! $Label.C501_ClassReg_PlzSelectOne } +
+
+
- +
+
+
+
+ + {! $Label.C501_RegSite_NoAllergies } + + +
+ Error: {! $Label.C501_ClassReg_PlzSelectOne } +
+
+
+
+
+
- + + - + + + + + +
@@ -326,8 +503,11 @@
- - + + +
@@ -337,8 +517,10 @@
- - + +
diff --git a/src/pages/C501_ClassReg_Login.page b/src/pages/C501_ClassReg_Login.page index 1ee1b00..cdbffdd 100644 --- a/src/pages/C501_ClassReg_Login.page +++ b/src/pages/C501_ClassReg_Login.page @@ -55,10 +55,10 @@

-

+