Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PersonalSiteContactInfo: Allow Comments to be exposed directly #512

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/classes/VOL_CTRL_PersonalSiteContactInfo.cls
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ global with sharing class VOL_CTRL_PersonalSiteContactInfo {
// for the shifts start time - end date & time, using the appropriate
// time zone that might be specified on the Job, Campaign, or Site Guest User.
// Note that it stores the formatted Time in the Hours' System_Note__c field (in memory only).
// Note that it stores the formatted Date in the Hours' Comment field (in memory only).
private void dateTimeFixup(list<Volunteer_Hours__c> listHours) {
// get default time zone for site guest user
User u = [Select TimeZoneSidKey From User where id =: Userinfo.getUserId()];
Expand All @@ -256,7 +255,6 @@ global with sharing class VOL_CTRL_PersonalSiteContactInfo {
if (dtStart == null) {
// if we don't have a start time, then format by GMT, to avoid timezones moving the date!
dtStart = hr.Start_Date__c;
hr.Comments__c = dtStart.formatGmt(strDateFormat);
} else {
double duration = hr.Hours_Worked__c == null ? hr.Volunteer_Shift__r.Duration__c : hr.Hours_Worked__c;
DateTime dtEnd = dtStart.addMinutes(integer.valueOf(duration * 60));
Expand All @@ -267,10 +265,7 @@ global with sharing class VOL_CTRL_PersonalSiteContactInfo {
hr.System_Note__c = dtStart.format(strFormatEndTime, strTimeZone) + ' - ' + dtEnd.format(strFormatEndTime, strTimeZone);
} else {
hr.System_Note__c = dtStart.format(strFormatEndTime, strTimeZone) + ' - ' + dtEnd.format(strFormat, strTimeZone);
}

// also save user formated Start Date in Comments field
hr.Comments__c = dtStart.format(strDateFormat, strTimeZone);
}
}
}
}
Expand Down Expand Up @@ -467,4 +462,4 @@ global with sharing class VOL_CTRL_PersonalSiteContactInfo {
return ''; // allow the page to load without the ranking
}
}
}
}