@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | require_once '../controller/MicroReferenceController.php'; |
17 | 17 | require_once '../controller/WorkSampleController.php'; |
18 | 18 | |
19 | -class JobApplicationController{ |
|
19 | +class JobApplicationController { |
|
20 | 20 | |
21 | - public static function getApplicationQuestionAnswers($jobPosterApplicationId){ |
|
21 | + public static function getApplicationQuestionAnswers($jobPosterApplicationId) { |
|
22 | 22 | |
23 | 23 | $questionAnswers = JobApplicationDAO::getApplicationQuestionAnswersByApplicationId($jobPosterApplicationId); |
24 | 24 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | } |
28 | 28 | |
29 | - public static function getJobPosterApplicationById($jobPosterApplicationId){ |
|
29 | + public static function getJobPosterApplicationById($jobPosterApplicationId) { |
|
30 | 30 | |
31 | 31 | $jobPosterApplication = JobApplicationDAO::getJobPosterApplicationByApplicationId($jobPosterApplicationId); |
32 | 32 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | public static function updateJobApplicationWithAnswers($jobApplicationWithAnswers) { |
52 | 52 | $rowsModified = JobApplicationDAO::updateJobPosterApplication($jobApplicationWithAnswers->getJob_poster_application()); |
53 | 53 | $applicationId = $jobApplicationWithAnswers->getJob_poster_application()->getJob_poster_application_id(); |
54 | - foreach($jobApplicationWithAnswers->getApplication_question_answers() as $questionAnswer) { |
|
54 | + foreach ($jobApplicationWithAnswers->getApplication_question_answers() as $questionAnswer) { |
|
55 | 55 | $questionAnswer->setJob_poster_application_id($applicationId); //Just to ensure id is correct |
56 | 56 | $rowsModified = $rowsModified + JobApplicationDAO::putApplicationQuestionAnswer($questionAnswer); |
57 | 57 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $questionAnswers = self::getApplicationQuestionAnswers($jobPosterApplication->getJob_poster_application_id()); |
71 | 71 | $jobApplicationWithAnswers = new JobApplicationWithAnswers($jobPosterApplication, $questionAnswers); |
72 | 72 | return $jobApplicationWithAnswers; |
73 | - } else { |
|
73 | + }else { |
|
74 | 74 | return false; |
75 | 75 | } |
76 | 76 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | public static function getJobApplicationsWithAnswersForJobPosterApplications($jobPosterApplications) { |
79 | 79 | $jobApplicationsWithAnswers = []; |
80 | 80 | |
81 | - foreach($jobPosterApplications as $jpa) { |
|
81 | + foreach ($jobPosterApplications as $jpa) { |
|
82 | 82 | $questionAnswers = self::getApplicationQuestionAnswers($jpa->getJob_poster_application_id()); |
83 | 83 | $jobApplication = new JobApplicationWithAnswers($jpa, $questionAnswers); |
84 | 84 | array_push($jobApplicationsWithAnswers, $jobApplication); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | |
113 | 113 | $jobPosterApplicationId = JobApplicationDAO::createJobPosterApplication($jobApplicationWithAnswers->getJob_poster_application()); |
114 | 114 | |
115 | - foreach($jobApplicationWithAnswers->getApplication_question_answers() as $questionAnswer) { |
|
115 | + foreach ($jobApplicationWithAnswers->getApplication_question_answers() as $questionAnswer) { |
|
116 | 116 | $questionAnswer->setJob_poster_application_id($jobPosterApplicationId); |
117 | 117 | } |
118 | 118 | JobApplicationDAO::createApplicationQuestionAnswers($jobApplicationWithAnswers->getApplication_question_answers()); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $workSamples = WorkSampleController::getAllWorkSamplesForJobApplication($jobPosterApplicationId, $locale); |
166 | 166 | |
167 | 167 | return new FullJobApplication($jobPosterApplication, $jobSeekerProfile, $questionAnswers, $skillDeclarations, $microReferences, $workSamples); |
168 | - } else { |
|
168 | + }else { |
|
169 | 169 | return false; |
170 | 170 | } |
171 | 171 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $isDraft = self::jobApplicationIsDraft($jobPosterApplicationId); |
175 | 175 | if ($isDraft) { |
176 | 176 | return JobApplicationDAO::setJobAppliationStatus($jobPosterApplicationId, "Submitted"); |
177 | - } else { |
|
177 | + }else { |
|
178 | 178 | return ["false"=>"Cannot submit an application which is not a draft"]; |
179 | 179 | } |
180 | 180 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | ini_set("display_errors", 1); |
6 | 6 | set_time_limit(0); |
7 | 7 | |
8 | -if(!isset($_SESSION)){ |
|
8 | +if (!isset($_SESSION)) { |
|
9 | 9 | session_start(); |
10 | 10 | } |
11 | 11 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | if ($resourceKey != null && !empty($resourceKey)) { |
38 | 38 | if ($keyOption != null) { |
39 | 39 | return $commonLabelArray[$resourceKey][$keyOption]; |
40 | - } else { |
|
40 | + }else { |
|
41 | 41 | return $commonLabelArray[$resourceKey]; |
42 | 42 | } |
43 | 43 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | if ($resourceKey != null && !empty($resourceKey)) { |
58 | 58 | if ($keyOption != null) { |
59 | 59 | return $labelArray[$resourceKey][$keyOption]; |
60 | - } else { |
|
60 | + }else { |
|
61 | 61 | return $labelArray[$resourceKey]; |
62 | 62 | } |
63 | 63 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | ini_set("display_errors", 0); |
7 | 7 | set_time_limit(0); |
8 | 8 | |
9 | -if(!isset($_SESSION)){ |
|
9 | +if (!isset($_SESSION)) { |
|
10 | 10 | session_start(); |
11 | 11 | } |
12 | 12 | |
@@ -16,10 +16,10 @@ discard block |
||
16 | 16 | require_once '../config/smtp.config.inc'; |
17 | 17 | require_once '../model/User.php'; |
18 | 18 | |
19 | -class EmailConfirmationController{ |
|
19 | +class EmailConfirmationController { |
|
20 | 20 | |
21 | - public static function sendConfirmationEmail(User $user){ |
|
22 | - $conf_url = 'https://'.filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_ENCODED)."/#Confirmation/".$user->getUser_id(); |
|
21 | + public static function sendConfirmationEmail(User $user) { |
|
22 | + $conf_url = 'https://' . filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_ENCODED) . "/#Confirmation/" . $user->getUser_id(); |
|
23 | 23 | $from_name = FROM_NAME; |
24 | 24 | $from_email = FROM_EMAIL; |
25 | 25 | $to = $user->getEmail(); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | </head> |
32 | 32 | <body> |
33 | 33 | <p>Thank you for registering with TalentCloud. / French content here</p> |
34 | - <p><a href='".$conf_url."'>Click here to confirm your email address with us. / French content</a></p> |
|
34 | + <p><a href='".$conf_url . "'>Click here to confirm your email address with us. / French content</a></p> |
|
35 | 35 | </body> |
36 | 36 | </html>"; |
37 | 37 | |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | // More headers |
43 | 43 | $headers .= 'From:' . $from_email . "\r\n"; |
44 | 44 | //var_dump($message); |
45 | - if(!@mail($to,$subject,$message,$headers)){ |
|
45 | + if (!@mail($to, $subject, $message, $headers)) { |
|
46 | 46 | return false; |
47 | - }else{ |
|
47 | + }else { |
|
48 | 48 | return true; |
49 | 49 | } |
50 | 50 |
@@ -44,7 +44,7 @@ |
||
44 | 44 | //var_dump($message); |
45 | 45 | if(!@mail($to,$subject,$message,$headers)){ |
46 | 46 | return false; |
47 | - }else{ |
|
47 | + } else{ |
|
48 | 48 | return true; |
49 | 49 | } |
50 | 50 |
@@ -150,9 +150,9 @@ |
||
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
153 | - * |
|
154 | - * @param int $jobSeekerProfileId |
|
155 | - */ |
|
153 | + * |
|
154 | + * @param int $jobSeekerProfileId |
|
155 | + */ |
|
156 | 156 | public static function getUserByJobSeekerProfileId($jobSeekerProfileId) { |
157 | 157 | $user = UserDAO::getUserByJobSeekerProfileId($jobSeekerProfileId); |
158 | 158 | return $user; |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | ini_set("display_errors", 1); |
6 | 6 | set_time_limit(0); |
7 | 7 | |
8 | -if(!isset($_SESSION)){ |
|
8 | +if (!isset($_SESSION)) { |
|
9 | 9 | session_start(); |
10 | 10 | } |
11 | 11 | |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | require_once '../controller/JobSeekerController.php'; |
25 | 25 | require_once '../dao/UserDAO.php'; |
26 | 26 | |
27 | -class UserController{ |
|
27 | +class UserController { |
|
28 | 28 | |
29 | 29 | //TO-DO : remove - should not be used |
30 | 30 | /** |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @param User $user |
44 | 44 | * @return type |
45 | 45 | */ |
46 | - public static function getUserById(User $user){ |
|
46 | + public static function getUserById(User $user) { |
|
47 | 47 | $existingUser = UserDAO::getUserById($user); |
48 | 48 | return $existingUser; |
49 | 49 | } |
@@ -53,15 +53,15 @@ discard block |
||
53 | 53 | * @param User $user |
54 | 54 | * @return type |
55 | 55 | */ |
56 | - public static function getUserByOpenId(User $user){ |
|
56 | + public static function getUserByOpenId(User $user) { |
|
57 | 57 | //get existing user by openId |
58 | 58 | $existingUser = UserDAO::getUserOpenById($user); |
59 | 59 | //var_dump($existingUser); |
60 | 60 | //get user_id from existing user |
61 | 61 | //if user_id is not null, then log the user in automatically |
62 | - if($existingUser){ |
|
62 | + if ($existingUser) { |
|
63 | 63 | return $existingUser; |
64 | - }else{ |
|
64 | + }else { |
|
65 | 65 | //if user_id is null, then the user is not registered and we should register them automatically |
66 | 66 | //register new user |
67 | 67 | $newUser = UserController::registerUser($user); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | - public static function registerUser(User $newUser){ |
|
72 | + public static function registerUser(User $newUser) { |
|
73 | 73 | //$newUser->setUser_role('jobseeker'); |
74 | 74 | //This is a temporary automatic confirmation until the mail server is setup |
75 | 75 | //var_dump($newUser); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $userRegistered = false; |
78 | 78 | $confEmailSent = true; |
79 | 79 | $registeredUser = UserDAO::registerUser($newUser); |
80 | - if($registeredUser instanceof User && $registeredUser->getUser_id() !== null){ |
|
80 | + if ($registeredUser instanceof User && $registeredUser->getUser_id() !== null) { |
|
81 | 81 | $userRegistered = true; |
82 | 82 | //$confEmailSent = UserController::confirmEmail($registeredUser); |
83 | 83 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $userId = $registeredUser->getUser_id(); |
88 | 88 | $jobSeekerProfile = new JobSeekerProfile(); |
89 | 89 | $result = JobSeekerController::addJobSeekerProfile($jobSeekerProfile, $userId); |
90 | - } else if ($registeredUser->getUser_role() === 'administrator') { |
|
90 | + }else if ($registeredUser->getUser_role() === 'administrator') { |
|
91 | 91 | |
92 | 92 | $userId = $registeredUser->getUser_id(); |
93 | 93 | $managerProfile = new ManagerProfile(); |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | if ($oldUser->getEmail() != $updatedUser->getEmail()) { |
130 | 130 | $confEmailSent = UserController::confirmEmail($updatedUser); |
131 | 131 | $updatedUser->setIs_confirmed(false); |
132 | - } else { |
|
132 | + }else { |
|
133 | 133 | $updatedUser->setIs_confirmed($oldUser->getIs_confirmed()); |
134 | 134 | } |
135 | 135 | $updateSuccessful = UserDAO::updateUser($updatedUser); //do updates |
@@ -61,7 +61,7 @@ |
||
61 | 61 | //if user_id is not null, then log the user in automatically |
62 | 62 | if($existingUser){ |
63 | 63 | return $existingUser; |
64 | - }else{ |
|
64 | + } else{ |
|
65 | 65 | //if user_id is null, then the user is not registered and we should register them automatically |
66 | 66 | //register new user |
67 | 67 | $newUser = UserController::registerUser($user); |
@@ -19,50 +19,50 @@ discard block |
||
19 | 19 | */ |
20 | 20 | class LocaleController { |
21 | 21 | |
22 | - /** |
|
23 | - * |
|
24 | - * @global type array - $locales |
|
25 | - * @return type array - $locales |
|
26 | - */ |
|
27 | - public static function getLocales() { |
|
22 | + /** |
|
23 | + * |
|
24 | + * @global type array - $locales |
|
25 | + * @return type array - $locales |
|
26 | + */ |
|
27 | + public static function getLocales() { |
|
28 | 28 | |
29 | - $locales = LocaleDAO::getLocales(); |
|
29 | + $locales = LocaleDAO::getLocales(); |
|
30 | 30 | |
31 | - return $locales; |
|
32 | - } |
|
31 | + return $locales; |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * |
|
36 | - * @global type array - $locales |
|
37 | - * @return type array - $locales |
|
38 | - */ |
|
39 | - public static function getSiteLocales() { |
|
40 | - $locales = array(); |
|
34 | + /** |
|
35 | + * |
|
36 | + * @global type array - $locales |
|
37 | + * @return type array - $locales |
|
38 | + */ |
|
39 | + public static function getSiteLocales() { |
|
40 | + $locales = array(); |
|
41 | 41 | |
42 | - //$locales = unserialize(LOCALES); |
|
42 | + //$locales = unserialize(LOCALES); |
|
43 | 43 | $locales = LocaleDAO::getLocales(); |
44 | 44 | |
45 | - return $locales; |
|
46 | - } |
|
45 | + return $locales; |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * |
|
50 | - * @global type array - $locales |
|
51 | - * @return type array - $locales |
|
52 | - */ |
|
53 | - public static function getSessionLocale() { |
|
48 | + /** |
|
49 | + * |
|
50 | + * @global type array - $locales |
|
51 | + * @return type array - $locales |
|
52 | + */ |
|
53 | + public static function getSessionLocale() { |
|
54 | 54 | |
55 | 55 | $locale = new Locale(); |
56 | 56 | |
57 | - return $locale; |
|
58 | - } |
|
57 | + return $locale; |
|
58 | + } |
|
59 | 59 | |
60 | - /** |
|
61 | - * |
|
62 | - * @global type array - $locales |
|
63 | - * @return type array - $locales |
|
64 | - */ |
|
65 | - public static function setLocale($newLocale) { |
|
60 | + /** |
|
61 | + * |
|
62 | + * @global type array - $locales |
|
63 | + * @return type array - $locales |
|
64 | + */ |
|
65 | + public static function setLocale($newLocale) { |
|
66 | 66 | |
67 | 67 | $pieces = explode("_", $newLocale); |
68 | 68 | |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | |
72 | 72 | $locale = LocaleDAO::getLocaleByIsoCode($country_code,$language_abbreviation); |
73 | 73 | //var_dump($locale); |
74 | - return $locale; |
|
75 | - } |
|
74 | + return $locale; |
|
75 | + } |
|
76 | 76 | |
77 | 77 | } |
78 | 78 |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | ini_set("display_errors", 1); |
6 | 6 | set_time_limit(0); |
7 | 7 | |
8 | -if(!isset($_SESSION)){ |
|
8 | +if (!isset($_SESSION)) { |
|
9 | 9 | session_start(); |
10 | 10 | } |
11 | 11 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $country_code = $pieces[1]; |
70 | 70 | $language_abbreviation = $pieces[0]; |
71 | 71 | |
72 | - $locale = LocaleDAO::getLocaleByIsoCode($country_code,$language_abbreviation); |
|
72 | + $locale = LocaleDAO::getLocaleByIsoCode($country_code, $language_abbreviation); |
|
73 | 73 | //var_dump($locale); |
74 | 74 | return $locale; |
75 | 75 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | ini_set("display_errors", 1); |
6 | 6 | set_time_limit(0); |
7 | 7 | |
8 | -if(!isset($_SESSION)){ |
|
8 | +if (!isset($_SESSION)) { |
|
9 | 9 | session_start(); |
10 | 10 | } |
11 | 11 | |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | * @param string $locale |
42 | 42 | * @return JobPoster $jobPoster |
43 | 43 | */ |
44 | - public static function getJobPosterById($locale,$jobPosterId) { |
|
44 | + public static function getJobPosterById($locale, $jobPosterId) { |
|
45 | 45 | |
46 | - $jobPoster = JobPosterDAO::getJobPosterById($locale,$jobPosterId); |
|
46 | + $jobPoster = JobPosterDAO::getJobPosterById($locale, $jobPosterId); |
|
47 | 47 | return $jobPoster; |
48 | 48 | } |
49 | 49 | |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | * @param string $locale |
66 | 66 | * @return JobPoster[] $jobPosters |
67 | 67 | */ |
68 | - public static function getJobPostersByManagerId($locale,$managerId) { |
|
68 | + public static function getJobPostersByManagerId($locale, $managerId) { |
|
69 | 69 | |
70 | 70 | $jobPosters = new JobPosters(); |
71 | - $jobs = JobPosterDAO::getJobPostersByManagerId($locale,$managerId); |
|
71 | + $jobs = JobPosterDAO::getJobPostersByManagerId($locale, $managerId); |
|
72 | 72 | $jobPosters->setJobs($jobs); |
73 | 73 | return $jobPosters; |
74 | 74 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | ini_set("display_errors", 1); |
6 | 6 | set_time_limit(0); |
7 | 7 | |
8 | -if(!isset($_SESSION)){ |
|
8 | +if (!isset($_SESSION)) { |
|
9 | 9 | session_start(); |
10 | 10 | } |
11 | 11 | |
@@ -56,14 +56,14 @@ discard block |
||
56 | 56 | * @param string $locale |
57 | 57 | * @return Page object |
58 | 58 | */ |
59 | - public static function addJobSeekerProfile($jobSeekerProfile,$user_id) { |
|
60 | - $newJobSeekerProfile = JobSeekerDAO::addJobSeekerProfile($jobSeekerProfile,$user_id); |
|
59 | + public static function addJobSeekerProfile($jobSeekerProfile, $user_id) { |
|
60 | + $newJobSeekerProfile = JobSeekerDAO::addJobSeekerProfile($jobSeekerProfile, $user_id); |
|
61 | 61 | return $newJobSeekerProfile; |
62 | 62 | } |
63 | 63 | |
64 | - public static function getJobSeekers(){ |
|
64 | + public static function getJobSeekers() { |
|
65 | 65 | $jobSeekerProfiles = JobSeekerDAO::getJobSeekers(); |
66 | - foreach($jobSeekerProfiles as $profile) { |
|
66 | + foreach ($jobSeekerProfiles as $profile) { |
|
67 | 67 | $answers = JobSeekerDAO::getJobSeekerProfileAnswers($profile->getJob_seeker_profile_id()); |
68 | 68 | $profile->setJob_seeker_profile_answers($answers); |
69 | 69 | } |
@@ -4,9 +4,9 @@ |
||
4 | 4 | require_once '../model/ApplicationWorkSample.php'; |
5 | 5 | require_once '../dao/WorkSampleDAO.php'; |
6 | 6 | |
7 | -class WorkSampleController{ |
|
7 | +class WorkSampleController { |
|
8 | 8 | |
9 | - public static function getAllWorkSamplesForJobApplication($jobPosterApplicationId, $locale){ |
|
9 | + public static function getAllWorkSamplesForJobApplication($jobPosterApplicationId, $locale) { |
|
10 | 10 | |
11 | 11 | $applicationWorkSamples = WorkSampleDAO::getWorkSamplesForJobApplication($jobPosterApplicationId, $locale); |
12 | 12 |
@@ -16,7 +16,7 @@ |
||
16 | 16 | $previousEntry = TeamCultureDAO::getTeamCultureNonLocalizedForManagerProfile($managerProfileId); |
17 | 17 | if ($previousEntry) { |
18 | 18 | $result = TeamCultureDAO::updateTeamCultureForManagerProfile($teamCulture, $managerProfileId); |
19 | - } else { |
|
19 | + }else { |
|
20 | 20 | $result = TeamCultureDAO::createTeamCultureForManagerProfile($teamCulture, $managerProfileId); |
21 | 21 | } |
22 | 22 | return $result; |