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

Tuesdays work on portal #2287

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,241 @@ public with sharing class IPS_ParticipantPortalActivityController {
}
return tempWrapperList;
}

/*
* Open meetings that is connected with participants worktrail
* Portal Activity
* */
@AuraEnabled(cacheable = true)
public static List<IPS_ParticipantPortalEvent> getParticipantOpenMeetings(String recordId,String contactId){
Id trailRecordId = recordId;
Id participantId = contactId;

List<IPS_ParticipantPortalEvent> wrapperList = new List<IPS_ParticipantPortalEvent>();
wrapperList = getOpenMeetings(trailRecordId,participantId);
return wrapperList;
}

private static List<IPS_ParticipantPortalEvent> getOpenMeetings(Id trailRecordId,Id participantId){
List<IPS_ParticipantPortalEvent> tempWrapperList = new List<IPS_ParticipantPortalEvent>();

Date todaysDate = System.today();
List<Event> tempEventList = new List<Event>();
tempEventList =[
SELECT
id,
IPS_subjectAndDate__c,
Location,
StartDateTime,
EndDateTime,
Description,
IPS_employerName__c
FROM event
WHERE
ActivityDate >=: todaysDate
AND WhoId= :participantId
AND WhatId = :trailRecordId
AND (IPS_Type__c ='Meeting with Participant' OR IPS_Type__c='Meeting with Employer')
AND IPS_Status1__c ='Open'
ORDER BY ActivityDate DESC
];

for(Event t:tempEventList){
IPS_ParticipantPortalEvent tempList = new IPS_ParticipantPortalEvent();
tempList.Emne = t.IPS_subjectAndDate__c;
tempList.FraTidDato = t.StartDateTime;
tempList.TilTidDato = t.EndDateTime;
tempList.ReferatKommentar = t.Description;
tempList.EventId = t.id;
tempList.Lokasjon =t.Location;
tempList.Arbeidsgiver = t.IPS_employerName__c;
tempWrapperList.add(tempList);
}
return tempWrapperList;

}

/*
* Open jobs that is connected with participants worktrail
* Portal Activity
* */
@AuraEnabled(cacheable=true)
public static List<IPS_ParticipantPortalJob> getParticipantOpenJobs(String recordId){
Id trailRecordId = recordId;

List<IPS_ParticipantPortalJob> wrapperList = new List<IPS_ParticipantPortalJob>();
wrapperList = getOpenJobs(trailRecordId);
return wrapperList;

}
private static List<IPS_ParticipantPortalJob> getOpenJobs(Id trailRecordId){
List<IPS_ParticipantPortalJob> tempWrapperList = new List<IPS_ParticipantPortalJob>();

List<ips_Job__c> tempJobList = new List<ips_Job__c>();

tempJobList =[
SELECT
Id,
IPS_jobSubject__c,
ips_Start_Date__c,
ips_End_Date__c,
ips_Form_of_Employment__c,
ips_Job_Support__c,
ips_Number_of_hours__c
FROM ips_Job__c
WHERE ips_Work_Trail__c =:trailRecordId
AND ips_Form_of_Employment__c !='work training'
AND ips_Status__c ='Ongoing'
];

for(ips_Job__c j:tempJobList){
IPS_ParticipantPortalJob tempList = new IPS_ParticipantPortalJob();
tempList.Emne = j.IPS_jobSubject__c;
tempList.JobbId = j.id;
tempList.StartDato = j.ips_Start_Date__c;
tempList.SluttDato = j.ips_End_Date__c;
tempList.AntallTimerUke = j.ips_Number_of_hours__c;
tempList.Plan =j.ips_Job_Support__c;
tempList.Arbeidsform = IPS_ParticipantPortalUtility.formatTypeOf(j.ips_Form_of_Employment__c);
tempWrapperList.add(tempList);
}
return tempWrapperList;
}

/*
* Open job trainings that is connected with participants worktrail
* Portal Activity
* */
@AuraEnabled(cacheable=true)
public static List<IPS_ParticipantPortalJob> getParticipantOpenJobTrainings(String recordId){
Id trailRecordId = recordId;

List<IPS_ParticipantPortalJob> wrapperList = new List<IPS_ParticipantPortalJob>();
wrapperList = getOpenJobTrainings(trailRecordId);
return wrapperList;

}
private static List<IPS_ParticipantPortalJob> getOpenJobTrainings(Id trailRecordId){
List<IPS_ParticipantPortalJob> tempWrapperList = new List<IPS_ParticipantPortalJob>();

List<ips_Job__c> tempJobTrainingList = new List<ips_Job__c>();

tempJobTrainingList =[
SELECT
Id,
IPS_jobSubject__c,
ips_Start_Date__c,
ips_End_Date__c,
ips_Form_of_Employment__c,
ips_Job_Support__c,
ips_Number_of_hours__c
FROM ips_Job__c
WHERE ips_Work_Trail__c =:trailRecordId
AND ips_Form_of_Employment__c ='work training'
AND ips_Status__c ='Ongoing'
];

for(ips_Job__c j:tempJobTrainingList){
IPS_ParticipantPortalJob tempList = new IPS_ParticipantPortalJob();
tempList.Emne = j.IPS_jobSubject__c;
tempList.JobbId = j.id;
tempList.StartDato = j.ips_Start_Date__c;
tempList.SluttDato = j.ips_End_Date__c;
tempList.AntallTimerUke = j.ips_Number_of_hours__c;
tempList.Plan =j.ips_Job_Support__c;
tempWrapperList.add(tempList);
}
return tempWrapperList;
}

/*
* Open education that is connected with participants worktrail
* Portal Activity
* */
@AuraEnabled(cacheable=true)
public static List<IPS_ParticipantPortalEducation> getParticipantOpenEducations(String recordId){
Id trailRecordId = recordId;

List<IPS_ParticipantPortalEducation> wrapperList = new List<IPS_ParticipantPortalEducation>();
wrapperList = getOpenEducations(trailRecordId);
return wrapperList;

}
private static List<IPS_ParticipantPortalEducation> getOpenEducations(Id trailRecordId){
List<IPS_ParticipantPortalEducation> tempWrapperList = new List<IPS_ParticipantPortalEducation>();

List<ips_Education__c> tempEducationList = new List<ips_Education__c>();
tempEducationList =[
SELECT
id,
Name,
ips_Name_of_the_Education_Institution__c,
ips_Start_Date__c,
ips_End_Date__c,
ips_Education_Support_Plan__c,
ips_Form_of_Education__c
FROM ips_Education__c
WHERE ips_Work_Trail__c =:trailRecordId
AND ips_Status__c = 'Ongoing'
];

for(ips_Education__c e:tempEducationList){
IPS_ParticipantPortalEducation tempList = new IPS_ParticipantPortalEducation();
tempList.UtdanningNavn = e.Name;
tempList.UtdanningId = e.id;
tempList.UtdanningSted = e.ips_Name_of_the_Education_Institution__c;
tempList.Utdanningsform = IPS_ParticipantPortalUtility.formatTypeOf(e.ips_Form_of_Education__c);
tempList.UtdanningStart = e.ips_Start_Date__c;
tempList.UtdanningSlutt = e.ips_End_Date__c;
tempList.Plan = e.ips_Education_Support_Plan__c;
tempWrapperList.add(tempList);
}
return tempWrapperList;
}

/*
* Open AMS education/training that is connected with participants worktrail
* Portal Activity
* */
@AuraEnabled(cacheable=true)
public static List<IPS_ParticipantPortalEducation> getParticipantOpenEducationTrainingAMS(String recordId){
Id trailRecordId = recordId;

List<IPS_ParticipantPortalEducation> wrapperList = new List<IPS_ParticipantPortalEducation>();
wrapperList = getOpenEducationsTraining(trailRecordId);
return wrapperList;

}
private static List<IPS_ParticipantPortalEducation> getOpenEducationsTraining(Id trailRecordId){
List<IPS_ParticipantPortalEducation> tempWrapperList = new List<IPS_ParticipantPortalEducation>();

List<AMS_Vocational_education_and_training__c> tempEducationList = new List<AMS_Vocational_education_and_training__c>();
tempEducationList =[
SELECT
id,
Name,
AMS_Name_of_the_Education_institution__c,
AMS_Start_Date__c,
AMS_End_Date__c,
AMS_Education_Support_Plan__c,
AMS_Form_of_Study__c
FROM AMS_Vocational_education_and_training__c
WHERE AMS_Work_Trail__c =:trailRecordId
AND AMS_Status__c = 'Ongoing'
];

for(AMS_Vocational_education_and_training__c e:tempEducationList){
IPS_ParticipantPortalEducation tempList = new IPS_ParticipantPortalEducation();
tempList.UtdanningNavn = e.Name;
tempList.UtdanningId = e.id;
tempList.UtdanningSted = e.AMS_Name_of_the_Education_institution__c;
tempList.Utdanningsform = IPS_ParticipantPortalUtility.formatTypeOf(e.AMS_Form_of_Study__c);
tempList.UtdanningStart = e.AMS_Start_Date__c;
tempList.UtdanningSlutt = e.AMS_End_Date__c;
tempList.Plan = e.AMS_Education_Support_Plan__c;
tempWrapperList.add(tempList);
}
return tempWrapperList;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* wrapperclass used by IPS_ParticipantPortalActivityController
* experience cloud for participant
**/

public class IPS_ParticipantPortalEducation {
@AuraEnabled public Date UtdanningStart{get; set;}
@AuraEnabled public Date UtdanningSlutt{get; set;}
@AuraEnabled public String Utdanningsform{get; set;}
@AuraEnabled public String Plan{get; set;}
@AuraEnabled public String UtdanningId{get; set;}
@AuraEnabled public String UtdanningNavn{get; set;}
@AuraEnabled public String UtdanningSted{get; set;}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
18 changes: 10 additions & 8 deletions force-app/main/default/classes/IPS_ParticipantPortalEvent.cls
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/*
* wrapperclass used by IPS_ParticipantPortalActivityController
* experience cloud for participant
**/
public class IPS_ParticipantPortalEvent {
@AuraEnabled public String EventId{get;set;}
@AuraEnabled public String Emne{get;set;}
@AuraEnabled public String Type{get;set;}
@AuraEnabled public String Status{get;set;}
@AuraEnabled public String TilDato{get;set;}
@AuraEnabled public String FraDato{get;set;}
@AuraEnabled public String ForfallsDato{get;set;}
@AuraEnabled public String RelatertTil{get;set;}
@AuraEnabled public String RelatertNavnKontakt{get;set;}
@AuraEnabled public String Tildelt{get;set;}
@AuraEnabled public Datetime TilTidDato{get;set;}
@AuraEnabled public Datetime FraTidDato{get;set;}
@AuraEnabled public String ReferatKommentar{get;set;}
@AuraEnabled public String Arbeidsgiver{get;set;}
@AuraEnabled public String Lokasjon{get;set;}
}
14 changes: 14 additions & 0 deletions force-app/main/default/classes/IPS_ParticipantPortalJob.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* wrapperclass used by IPS_ParticipantPortalActivityController
* experience cloud for participant
**/
public class IPS_ParticipantPortalJob {
@AuraEnabled public Date StartDato{get; set;}
@AuraEnabled public Date SluttDato{get; set;}
@AuraEnabled public Decimal AntallTimerUke{get; set;}
@AuraEnabled public String Arbeidsform{get; set;}
@AuraEnabled public String Arbeidsoppgaver{get; set;}
@AuraEnabled public String Plan{get; set;}
@AuraEnabled public String JobbId{get; set;}
@AuraEnabled public String Emne{get; set;}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
11 changes: 3 additions & 8 deletions force-app/main/default/classes/IPS_ParticipantPortalTask.cls
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
public class IPS_ParticipantPortalTask {
@AuraEnabled public String OppgaveId{get;set;}
@AuraEnabled public String Emne{get;set;}
@AuraEnabled public String ReferatKommentar{get;set;}
@AuraEnabled public String TypeOppgave{get;set;}
@AuraEnabled public String Status{get;set;}
@AuraEnabled public String TilDato{get;set;}
@AuraEnabled public String FraDato{get;set;}
@AuraEnabled public String ForfallsDato{get;set;}
@AuraEnabled public String RelatertTil{get;set;}
@AuraEnabled public String RelatertNavnKontakt{get;set;}
@AuraEnabled public String Tildelt{get;set;}
@AuraEnabled public String ReferatKommentar{get;set;}


}
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public with sharing class IPS_ParticipantPortalTrailController {
tempList.jobbsporEierNavn = t.IPS_ownerName__c;
tempList.jobbsporStatus = t.ips_Status__c;
tempList.jobbsporHenvistDato = IPS_ParticipantPortalUtility.formatDate(t.ips_Referred_date__c);
tempList.ipsHovedmaal = t.ips_Main_Goal_list__c;
tempList.ipsHovedmaal = IPS_ParticipantPortalUtility.formatMainGoal(t.ips_Main_Goal_list__c);
tempList.jobbsporHovedmaalBeskrivelse = t.ips_Main_goal__c;
tempList.ipsPrioriterteOnsker = t.ips_Priority_career_wishes__c;
tempList.ipsRammerJobbUtvikling = t.ips_Framework_for_job_development_search__c;
Expand Down Expand Up @@ -124,7 +124,7 @@ public with sharing class IPS_ParticipantPortalTrailController {
tempList.amsYrkeBransjeKarriere = t.ips_Desired_profession_industry_career__c;
tempList.amsArbeidsmiljoe = t.ips_Desired_working_environment__c;
tempList.amsArbeidsoppgaver = t.ips_Desired_work_tasks__c;
tempList.amsHovedmaal = t.ips_UO_Service__c;
tempList.amsHovedmaal = IPS_ParticipantPortalUtility.formatMainGoal(t.ips_UO_Service__c);
tempList.amsMobilitet = t.ips_Mobility__c;
tempList.amsOkonomiskeForhold = t.ips_Economic_conditions__c;
tempList.amsSosialeForhold = t.ips_Social_conditions__c;
Expand Down
25 changes: 25 additions & 0 deletions force-app/main/default/classes/IPS_ParticipantPortalUtility.cls
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,29 @@ public with sharing class IPS_ParticipantPortalUtility{
else{return 'Ingen hovedmål valgt';}
}

public static String formatTypeOf(string typeOf){
//job types
if(typeOf =='Apprentice'){return 'Lærling';}
if(typeOf =='Freelance / self-employed'){return 'Freelance/selvstendig næringsdrivende';}
if(typeOf =='Permanent employment'){return 'Fast ansettelse';}
if(typeOf =='Temporary employment'){return 'Tidsbegrenset ansettelse';}
if(typeOf =='work training'){return 'Arbeidstrening';}
if(typeOf =='Zero hours contrac'){return 'Tilkalling ekstrajobb';}
//education types
if(typeOf =='Certificate of Apprenticeship'){return 'Lærling';}
if(typeOf =='Full-time Study'){return 'Heltidsstudie';}
if(typeOf =='Part-time Study'){return 'Deltidsstudie';}
if(typeOf =='Evening Course'){return 'Kurs på kveldstid';}
if(typeOf =='Day Cource'){return 'Kurs på dagtid';}
if(typeOf =='Module-structured subject and vocational training'){return 'Modulstrukturert fag- og yrkesopplæring';}
//ams education types
if(typeOf =='Vocational certificate at work'){return 'Fagbrev på jobb';}
if(typeOf =='0+4 scheme'){return '0+4 ordning';}
if(typeOf =='practice letter candidate'){return 'Praksisbrevkandidat';}
if(typeOf =='practice candidate'){return 'Praksiskandidat';}
if(typeOf =='Teaching candidate'){return 'Lærerkandidat';}
if(typeOf =='Upper Secondary Education for Adults (VOV)'){return 'Videregående opplæring for voksne (VOV)';}
else{return 'Ingen type valgt';}
}

}
Loading
Loading