|
1
|
|
|
/* |
|
2
|
|
|
* To change this license header, choose License Headers in Project Properties. |
|
3
|
|
|
* To change this template file, choose Tools | Templates |
|
4
|
|
|
* and open the template in the editor. |
|
5
|
|
|
*/ |
|
6
|
|
|
|
|
7
|
|
|
|
|
8
|
|
|
|
|
9
|
|
|
var CreateJobPosterAPI = {}; |
|
10
|
|
|
|
|
11
|
|
|
CreateJobPosterAPI.jobPosterObj = null; |
|
12
|
|
|
|
|
13
|
|
|
CreateJobPosterAPI.version = "v1"; |
|
14
|
|
|
CreateJobPosterAPI.baseURL = "/tc/api/" + CreateJobPosterAPI.version + ""; |
|
15
|
|
|
|
|
16
|
|
|
CreateJobPosterAPI.JobPosterQuestion = function (question, description) { |
|
17
|
|
|
this.question = question; |
|
18
|
|
|
this.description = description; |
|
19
|
|
|
}; |
|
20
|
|
|
|
|
21
|
|
|
CreateJobPosterAPI.JobPostNonLocalized = function ( |
|
22
|
|
|
id, |
|
23
|
|
|
manager_user_id, |
|
24
|
|
|
title, |
|
25
|
|
|
title_fr, |
|
26
|
|
|
department_id, |
|
27
|
|
|
province_id, |
|
28
|
|
|
branch_en, |
|
29
|
|
|
branch_fr, |
|
30
|
|
|
division_en, |
|
31
|
|
|
division_fr, |
|
32
|
|
|
city, |
|
33
|
|
|
city_fr, |
|
34
|
|
|
open_date_time, |
|
35
|
|
|
close_date_time, |
|
36
|
|
|
start_date, |
|
37
|
|
|
term_qty, |
|
38
|
|
|
remuneration_range_low, |
|
39
|
|
|
remuneration_range_high, |
|
40
|
|
|
impact, |
|
41
|
|
|
impact_fr, |
|
42
|
|
|
key_tasks_en, |
|
43
|
|
|
key_tasks_fr, |
|
44
|
|
|
core_competencies_en, |
|
45
|
|
|
core_competencies_fr, |
|
46
|
|
|
developing_competencies_en, |
|
47
|
|
|
developing_competencies_fr, |
|
48
|
|
|
questions_en, |
|
49
|
|
|
questions_fr, |
|
50
|
|
|
noc, |
|
51
|
|
|
classification, |
|
52
|
|
|
clearance_id, |
|
53
|
|
|
language_id |
|
54
|
|
|
) { |
|
55
|
|
|
this.id = id; |
|
56
|
|
|
this.manager_user_id = manager_user_id; |
|
57
|
|
|
this.title = {}; |
|
58
|
|
|
this.title.en_CA = title; |
|
59
|
|
|
this.title.fr_CA = title_fr; |
|
60
|
|
|
this.department_id = department_id; |
|
61
|
|
|
this.province_id = province_id; |
|
62
|
|
|
this.branch = {}; |
|
63
|
|
|
this.branch.en_CA = branch_en; |
|
64
|
|
|
this.branch.fr_CA = branch_fr; |
|
65
|
|
|
this.division = {}; |
|
66
|
|
|
this.division.en_CA = division_en; |
|
67
|
|
|
this.division.fr_CA = division_fr; |
|
68
|
|
|
this.city = {}; |
|
69
|
|
|
this.city.en_CA = city; |
|
70
|
|
|
this.city.fr_CA = city_fr; |
|
71
|
|
|
this.open_date_time = open_date_time; |
|
72
|
|
|
this.close_date_time = close_date_time; |
|
73
|
|
|
this.start_date = start_date; |
|
74
|
|
|
this.term_qty = term_qty; |
|
75
|
|
|
this.remuneration_range_low = remuneration_range_low; |
|
76
|
|
|
this.remuneration_range_high = remuneration_range_high; |
|
77
|
|
|
this.impact = {}; |
|
78
|
|
|
this.impact.en_CA = impact; |
|
79
|
|
|
this.impact.fr_CA = impact_fr; |
|
80
|
|
|
this.key_tasks = {}; |
|
81
|
|
|
this.key_tasks.en_CA = key_tasks_en; |
|
82
|
|
|
this.key_tasks.fr_CA = key_tasks_fr; |
|
83
|
|
|
this.core_competencies = {}; |
|
84
|
|
|
this.core_competencies.en_CA = core_competencies_en; |
|
85
|
|
|
this.core_competencies.fr_CA = core_competencies_fr; |
|
86
|
|
|
this.developing_competencies = {}; |
|
87
|
|
|
this.developing_competencies.en_CA = developing_competencies_en; |
|
88
|
|
|
this.developing_competencies.fr_CA = developing_competencies_fr; |
|
89
|
|
|
this.questions = {}; |
|
90
|
|
|
this.questions.en_CA = questions_en; |
|
91
|
|
|
this.questions.fr_CA = questions_fr; |
|
92
|
|
|
this.noc = noc; |
|
93
|
|
|
this.classification = classification; |
|
94
|
|
|
this.clearance_id = clearance_id; |
|
95
|
|
|
this.language_id = language_id; |
|
96
|
|
|
|
|
97
|
|
|
this.term_units_id = 2; //default to months for now |
|
98
|
|
|
this.job_min_level_id = 1; //default to CS1 |
|
99
|
|
|
this.job_max_level_id = 3; //default to CS3 |
|
100
|
|
|
}; |
|
101
|
|
|
|
|
102
|
|
|
CreateJobPosterAPI.localizeJobPost = function (jobPostNonLocalized, locale) { |
|
103
|
|
|
var jp = jobPostNonLocalized; |
|
104
|
|
|
|
|
105
|
|
|
return new JobPostAPI.JobPost( |
|
|
|
|
|
|
106
|
|
|
jp.id, |
|
107
|
|
|
jp.manager_user_id, |
|
108
|
|
|
jp.title[locale], |
|
109
|
|
|
jp.appplicants_to_date, |
|
110
|
|
|
jp.close_date_time, |
|
111
|
|
|
LookupAPI.getLocalizedLookupValue("department", jp.department_id), |
|
|
|
|
|
|
112
|
|
|
jp.branch[locale], |
|
113
|
|
|
jp.division[locale], |
|
114
|
|
|
jp.city[locale], |
|
115
|
|
|
LookupAPI.getLocalizedLookupValue("province", jp.province_id), |
|
116
|
|
|
jp.term_qty, |
|
117
|
|
|
LookupAPI.getLocalizedLookupValue("jobterm", jp.term_units_id), |
|
118
|
|
|
jp.remuneration_type, |
|
119
|
|
|
jp.remuneration_range_low, |
|
120
|
|
|
jp.remuneration_range_high, |
|
121
|
|
|
jp.impact[locale], |
|
122
|
|
|
jp.key_tasks[locale], |
|
123
|
|
|
jp.core_competencies[locale], |
|
124
|
|
|
jp.developing_competencies[locale], |
|
125
|
|
|
jp.questions[locale], |
|
126
|
|
|
jp.noc, |
|
127
|
|
|
jp.classification, |
|
128
|
|
|
LookupAPI.getLocalizedLookupValue("clearance", jp.clearance_id), |
|
129
|
|
|
LookupAPI.getLocalizedLookupValue("language", jp.language_id), |
|
130
|
|
|
jp.start_date |
|
131
|
|
|
); |
|
132
|
|
|
}; |
|
133
|
|
|
|
|
134
|
|
|
CreateJobPosterAPI.showCreateJobPosterForm = function () { |
|
135
|
|
|
var stateInfo = {pageInfo: 'create_job_poster', pageTitle: 'Talent Cloud: Create Job Poster'}; |
|
136
|
|
|
document.title = stateInfo.pageTitle; |
|
137
|
|
|
history.pushState(stateInfo, stateInfo.pageInfo, '#CreateJobPoster'); |
|
|
|
|
|
|
138
|
|
|
|
|
139
|
|
|
ManagerEventsAPI.hideAllLayouts(); |
|
|
|
|
|
|
140
|
|
|
|
|
141
|
|
|
document.getElementById("createJobPoster_openDate").value = Utilities.formatDateTimeLocal(new Date()); |
|
|
|
|
|
|
142
|
|
|
|
|
143
|
|
|
CreateJobPosterAPI.getManagerProfile(CreateJobPosterAPI.prepopulateValuesFromManagerProfile); |
|
144
|
|
|
|
|
145
|
|
|
var createJobPosterSection = document.getElementById("createJobPosterSection"); |
|
146
|
|
|
createJobPosterSection.classList.remove("hidden"); |
|
147
|
|
|
|
|
148
|
|
|
// New Subpage Hero Scripts |
|
149
|
|
|
|
|
150
|
|
|
Utilities.getHeroElements(); |
|
151
|
|
|
|
|
152
|
|
|
var posterHeroTitle = document.getElementById("posterHeroTitle"); |
|
153
|
|
|
posterHeroTitle.classList.remove("hidden"); |
|
154
|
|
|
posterHeroTitle.setAttribute("aria-hidden", "false"); |
|
155
|
|
|
|
|
156
|
|
|
// Google Analytics |
|
157
|
|
|
|
|
158
|
|
|
ga('set', 'page', '/admin/create-job'); |
|
159
|
|
|
ga('send', 'pageview'); |
|
160
|
|
|
|
|
161
|
|
|
}; |
|
162
|
|
|
|
|
163
|
|
|
CreateJobPosterAPI.localizeCreateJobPosterForm = function (siteContent) { |
|
|
|
|
|
|
164
|
|
|
try { |
|
165
|
|
|
LookupAPI.populateDropdown("department", "createJobPoster_department"); |
|
|
|
|
|
|
166
|
|
|
LookupAPI.populateDropdown("province", "createJobPoster_province"); |
|
167
|
|
|
LookupAPI.populateDropdown("clearance", "createJobPoster_clearance"); |
|
168
|
|
|
LookupAPI.populateDropdown("language", "createJobPoster_language"); |
|
169
|
|
|
} catch (e) { |
|
170
|
|
|
(console.error || console.log).call(console, e.stack || e); |
|
171
|
|
|
} |
|
172
|
|
|
} |
|
|
|
|
|
|
173
|
|
|
|
|
174
|
|
|
CreateJobPosterAPI.prepopulateValuesFromManagerProfile = function (managerProfileResponse) { |
|
175
|
|
|
if (managerProfileResponse) { |
|
176
|
|
|
var response = JSON.parse(managerProfileResponse); |
|
177
|
|
|
|
|
178
|
|
|
document.getElementById("createJobPoster_department").value = response.manager_profile.user_manager_profile_department_id; |
|
179
|
|
|
|
|
180
|
|
|
document.getElementById("createJobPoster_branch").value = response.manager_profile_details.en_CA.user_manager_profile_details_branch; |
|
181
|
|
|
document.getElementById("createJobPoster_branch_fr").value = response.manager_profile_details.fr_CA.user_manager_profile_details_branch; |
|
182
|
|
|
document.getElementById("createJobPoster_division").value = response.manager_profile_details.en_CA.user_manager_profile_details_division; |
|
183
|
|
|
document.getElementById("createJobPoster_division_fr").value = response.manager_profile_details.fr_CA.user_manager_profile_details_division; |
|
184
|
|
|
|
|
185
|
|
|
} |
|
186
|
|
|
}; |
|
187
|
|
|
|
|
188
|
|
|
//below are the functions for the tabbed layout of the 'create job poster' page for managers |
|
189
|
|
|
CreateJobPosterAPI.goToTab = function (tabId) { |
|
190
|
|
|
var stepGroups = document.getElementsByClassName('stepGroup'); |
|
191
|
|
|
//console.log("+ " + stepGroups); |
|
192
|
|
|
|
|
193
|
|
|
if (tabId === "createJobPosterReviewTab") { |
|
194
|
|
|
CreateJobPosterAPI.populateReviewTab(); |
|
195
|
|
|
} |
|
196
|
|
|
|
|
197
|
|
|
for (var s = 0; s < stepGroups.length; s++) { |
|
198
|
|
|
var stepGroup = stepGroups[s]; |
|
199
|
|
|
//console.log(stepGroup); |
|
200
|
|
|
if (!stepGroup.classList.contains('hidden')) { |
|
201
|
|
|
stepGroup.classList.add('hidden'); |
|
202
|
|
|
} |
|
203
|
|
|
if (stepGroup.id === tabId) { |
|
204
|
|
|
stepGroup.classList.remove('hidden'); |
|
205
|
|
|
} |
|
206
|
|
|
} |
|
207
|
|
|
}; |
|
208
|
|
|
|
|
209
|
|
|
CreateJobPosterAPI.populateReviewTab = function () { |
|
210
|
|
|
CreateJobPosterAPI.populateJobPosterObjFromForm(); |
|
211
|
|
|
|
|
212
|
|
|
if (CreateJobPosterAPI.jobPosterObj) { |
|
213
|
|
|
var demoAreaEnglish = document.getElementById("createJobPosterDemoAreaEnglish"); |
|
214
|
|
|
demoAreaEnglish.innerHTML = ""; |
|
215
|
|
|
var jobEnglish = CreateJobPosterAPI.localizeJobPost(CreateJobPosterAPI.jobPosterObj, "en_CA"); |
|
216
|
|
|
demoAreaEnglish.appendChild(JobPostAPI.populateJobSummary(jobEnglish, true, "en_CA")); |
|
|
|
|
|
|
217
|
|
|
|
|
218
|
|
|
//Create demo french |
|
219
|
|
|
var demoAreaFrench = document.getElementById("createJobPosterDemoAreaFrench"); |
|
220
|
|
|
demoAreaFrench.innerHTML = ""; |
|
221
|
|
|
var jobFrench = CreateJobPosterAPI.localizeJobPost(CreateJobPosterAPI.jobPosterObj, "fr_CA"); |
|
222
|
|
|
demoAreaFrench.appendChild(JobPostAPI.populateJobSummary(jobFrench, true, "fr_CA")); |
|
223
|
|
|
} else { |
|
224
|
|
|
window.alert("Job Poster must be submitted first"); |
|
225
|
|
|
} |
|
226
|
|
|
}; |
|
227
|
|
|
|
|
228
|
|
|
CreateJobPosterAPI.stepHighlight = function (stepID) { |
|
229
|
|
|
var s1 = document.getElementById("createJobPosterStep1Label"); |
|
230
|
|
|
s1.classList.remove("create-job-poster-tab-current"); |
|
231
|
|
|
var s2 = document.getElementById("createJobPosterStep2Label"); |
|
232
|
|
|
s2.classList.remove("create-job-poster-tab-current"); |
|
233
|
|
|
var s3 = document.getElementById("createJobPosterStep3Label"); |
|
234
|
|
|
s3.classList.remove("create-job-poster-tab-current"); |
|
235
|
|
|
var s4 = document.getElementById("createJobPosterStep4Label"); |
|
236
|
|
|
s4.classList.remove("create-job-poster-tab-current"); |
|
237
|
|
|
|
|
238
|
|
|
var current = document.getElementById(stepID); |
|
239
|
|
|
current.classList.add("create-job-poster-tab-current"); |
|
240
|
|
|
}; |
|
241
|
|
|
|
|
242
|
|
|
CreateJobPosterAPI.validateJobPosterForm = function () { |
|
243
|
|
|
CreateJobPosterAPI.populateJobPosterObjFromForm(); |
|
244
|
|
|
|
|
245
|
|
|
var jp = CreateJobPosterAPI.jobPosterObj; |
|
|
|
|
|
|
246
|
|
|
|
|
247
|
|
|
var valid = true; |
|
248
|
|
|
if (valid) { |
|
249
|
|
|
CreateJobPosterAPI.submitJobPosterForm(); |
|
250
|
|
|
} |
|
251
|
|
|
}; |
|
252
|
|
|
|
|
253
|
|
|
CreateJobPosterAPI.populateJobPosterObjFromForm = function () { |
|
254
|
|
|
var id = 0; |
|
255
|
|
|
//Keep same id if it already exists |
|
256
|
|
|
if (CreateJobPosterAPI.jobPosterObj) { |
|
257
|
|
|
id = CreateJobPosterAPI.jobPosterObj.id; |
|
258
|
|
|
} |
|
259
|
|
|
|
|
260
|
|
|
var manager_user_id = 0; |
|
261
|
|
|
if (UserAPI.hasSessionUser()) { |
|
|
|
|
|
|
262
|
|
|
//For now, assume there is a one-to-one relation between users and hiring managers |
|
263
|
|
|
manager_user_id = UserAPI.getSessionUserAsJSON().user_id; |
|
264
|
|
|
} |
|
265
|
|
|
|
|
266
|
|
|
var title = document.getElementById("createJobPoster_jobTitle").value; |
|
267
|
|
|
|
|
268
|
|
|
var title_fr = document.getElementById("createJobPoster_jobTitle_fr").value; |
|
269
|
|
|
|
|
270
|
|
|
var department_id = document.getElementById("createJobPoster_department").value; |
|
271
|
|
|
|
|
272
|
|
|
var province_id = document.getElementById("createJobPoster_province").value; |
|
273
|
|
|
|
|
274
|
|
|
var branch_en = document.getElementById("createJobPoster_branch").value; |
|
275
|
|
|
var branch_fr = document.getElementById("createJobPoster_branch_fr").value; |
|
276
|
|
|
|
|
277
|
|
|
var division_en = document.getElementById("createJobPoster_division").value; |
|
278
|
|
|
var division_fr = document.getElementById("createJobPoster_division_fr").value; |
|
279
|
|
|
|
|
280
|
|
|
var city = document.getElementById("createJobPoster_city").value; |
|
281
|
|
|
|
|
282
|
|
|
var city_fr = document.getElementById("createJobPoster_city").value; |
|
283
|
|
|
|
|
284
|
|
|
var open_date_time = document.getElementById("createJobPoster_openDate").value; |
|
285
|
|
|
|
|
286
|
|
|
var close_date_time = document.getElementById("createJobPoster_closeDate").value; |
|
287
|
|
|
|
|
288
|
|
|
var start_date = document.getElementById("createJobPoster_startDate").value; |
|
289
|
|
|
|
|
290
|
|
|
var term_qty = document.getElementById("createJobPoster_termQuantity").value; |
|
291
|
|
|
|
|
292
|
|
|
var remuneration_range_low = document.getElementById("createJobPoster_remunerationLowRange").value; |
|
293
|
|
|
|
|
294
|
|
|
var remuneration_range_high = document.getElementById("createJobPoster_remunerationHighRange").value; |
|
295
|
|
|
|
|
296
|
|
|
var impact = document.getElementById("createJobPoster_impact").value; |
|
297
|
|
|
|
|
298
|
|
|
var impact_fr = document.getElementById("createJobPoster_impact_fr").value; |
|
299
|
|
|
|
|
300
|
|
|
//TODO: actually get list items from ui |
|
301
|
|
|
var key_tasks_en = CreateJobPosterAPI.getTextareaContentsAsList("createJobPoster_keyTasks"); |
|
302
|
|
|
var key_tasks_fr = CreateJobPosterAPI.getTextareaContentsAsList("createJobPoster_keyTasks_fr"); |
|
303
|
|
|
|
|
304
|
|
|
var core_competencies_en = CreateJobPosterAPI.getTextareaContentsAsList("createJobPoster_coreCompetencies"); |
|
305
|
|
|
var core_competencies_fr = CreateJobPosterAPI.getTextareaContentsAsList("createJobPoster_coreCompetencies_fr"); |
|
306
|
|
|
|
|
307
|
|
|
var developing_competencies_en = CreateJobPosterAPI.getTextareaContentsAsList("createJobPoster_developingCompetencies"); |
|
308
|
|
|
var developing_competencies_fr = CreateJobPosterAPI.getTextareaContentsAsList("createJobPoster_developingCompetencies_fr"); |
|
309
|
|
|
|
|
310
|
|
|
//Get questions & descriptions from repeaters |
|
311
|
|
|
var questionWrappers = document.querySelectorAll(".job-poster__open-question:not(.repeater__template)"); |
|
312
|
|
|
|
|
313
|
|
|
var questionObjs_en = []; |
|
314
|
|
|
var questionObjs_fr = []; |
|
315
|
|
|
|
|
316
|
|
|
for (var i = 0; i < questionWrappers.length; i++) { |
|
317
|
|
|
var question_en = questionWrappers[i].querySelector(".job-poster__open-question-wrapper--english .job-poster__open-question-input").value; |
|
318
|
|
|
var question_fr = questionWrappers[i].querySelector(".job-poster__open-question-wrapper--french .job-poster__open-question-input").value; |
|
319
|
|
|
|
|
320
|
|
|
var description_en = questionWrappers[i].querySelector(".job-poster__open-question-wrapper--english .job-poster__open-question-description-input").value; |
|
321
|
|
|
var description_fr = questionWrappers[i].querySelector(".job-poster__open-question-wrapper--french .job-poster__open-question-description-input").value; |
|
322
|
|
|
|
|
323
|
|
|
if (question_en && question_fr) { |
|
324
|
|
|
questionObjs_en.push(new CreateJobPosterAPI.JobPosterQuestion(question_en, description_en)); |
|
325
|
|
|
questionObjs_fr.push(new CreateJobPosterAPI.JobPosterQuestion(question_fr, description_fr)); |
|
326
|
|
|
} |
|
327
|
|
|
} |
|
328
|
|
|
|
|
329
|
|
|
var noc = document.getElementById("createJobPoster_noc").value; |
|
330
|
|
|
|
|
331
|
|
|
// TAL-150 |
|
332
|
|
|
var classification = document.getElementById("createJobPoster_classification").value; |
|
333
|
|
|
|
|
334
|
|
|
var clearance_id = document.getElementById("createJobPoster_clearance").value; |
|
335
|
|
|
|
|
336
|
|
|
var language_id = document.getElementById("createJobPoster_language").value; |
|
337
|
|
|
|
|
338
|
|
|
CreateJobPosterAPI.jobPosterObj = new CreateJobPosterAPI.JobPostNonLocalized( |
|
339
|
|
|
id, manager_user_id, title, title_fr, department_id, province_id, branch_en, branch_fr, division_en, division_fr, city, city_fr, open_date_time, |
|
340
|
|
|
close_date_time, start_date, term_qty, remuneration_range_low, remuneration_range_high, impact, impact_fr, key_tasks_en, key_tasks_fr, |
|
341
|
|
|
core_competencies_en, core_competencies_fr, developing_competencies_en, developing_competencies_fr, questionObjs_en, questionObjs_fr, noc, classification, |
|
342
|
|
|
clearance_id, language_id); |
|
343
|
|
|
} |
|
|
|
|
|
|
344
|
|
|
|
|
345
|
|
|
CreateJobPosterAPI.getTextareaContentsAsList = function (textareaElementId) { |
|
346
|
|
|
var list = document.getElementById(textareaElementId).value.split(/\r|\n/); |
|
347
|
|
|
for (var i = (list.length - 1); i >= 0; i--) { |
|
348
|
|
|
list[i] = list[i].trim(); |
|
349
|
|
|
if (list[i] === "") { |
|
350
|
|
|
list.splice(i, 1); |
|
351
|
|
|
} |
|
352
|
|
|
} |
|
353
|
|
|
return list; |
|
354
|
|
|
} |
|
|
|
|
|
|
355
|
|
|
|
|
356
|
|
|
|
|
357
|
|
|
CreateJobPosterAPI.submitJobPosterForm = function () { |
|
358
|
|
|
|
|
359
|
|
|
if (CreateJobPosterAPI.jobPosterObj) { |
|
360
|
|
|
var jobPosterJson = JSON.stringify(CreateJobPosterAPI.jobPosterObj); |
|
361
|
|
|
|
|
362
|
|
|
//TODO: use the following code instead when updateJobPoster is ready |
|
363
|
|
|
/* |
|
364
|
|
|
if (CreateJobPosterAPI.jobObj.id > 0) { |
|
365
|
|
|
CreateJobPosterAPI.updateJobPoster(jobPosterJson); |
|
366
|
|
|
} else { |
|
367
|
|
|
CreateJobPosterAPI.createJobPoster(jobPosterJson); |
|
368
|
|
|
} |
|
369
|
|
|
*/ |
|
370
|
|
|
|
|
371
|
|
|
CreateJobPosterAPI.createJobPoster(jobPosterJson); |
|
372
|
|
|
return true; |
|
373
|
|
|
} else { |
|
|
|
|
|
|
374
|
|
|
return false; |
|
375
|
|
|
} |
|
376
|
|
|
}; |
|
377
|
|
|
|
|
378
|
|
|
CreateJobPosterAPI.hideCreateJobPosterForm = function () { |
|
379
|
|
|
var jobPosterCreation = document.getElementById("createJobPosterOverlay"); |
|
380
|
|
|
jobPosterCreation.classList.add("hidden"); |
|
381
|
|
|
}; |
|
382
|
|
|
|
|
383
|
|
|
CreateJobPosterAPI.createJobPoster = function (jobPosterJson) { |
|
384
|
|
|
var createJobPoster_URL = CreateJobPosterAPI.baseURL + "/createJobPoster"; |
|
|
|
|
|
|
385
|
|
|
DataAPI.sendRequest(manager_profile_url, 'POST', {}, jobPosterJson, function(request) { |
|
|
|
|
|
|
386
|
|
|
CreateJobPosterAPI.postJobPosterComplete(request.response); |
|
387
|
|
|
}); |
|
388
|
|
|
}; |
|
389
|
|
|
|
|
390
|
|
|
CreateJobPosterAPI.postJobPosterComplete = function (response) { |
|
391
|
|
|
//TODO |
|
392
|
|
|
CreateJobPosterAPI.jobPosterObj.id = JSON.parse(response).job_poster_id; |
|
393
|
|
|
|
|
394
|
|
|
CreateJobPosterAPI.goToTab("createJobPosterReviewTab"); |
|
395
|
|
|
|
|
396
|
|
|
|
|
397
|
|
|
|
|
398
|
|
|
}; |
|
399
|
|
|
|
|
400
|
|
|
CreateJobPosterAPI.getManagerProfile = function (responseCallback) { |
|
401
|
|
|
if (UserAPI.hasSessionUser()) { |
|
|
|
|
|
|
402
|
|
|
var user = UserAPI.getSessionUserAsJSON(); |
|
403
|
|
|
var user_id = user["user_id"]; |
|
|
|
|
|
|
404
|
|
|
var manager_profile_url = CreateJobPosterAPI.baseURL + "/getManagerProfile/" + user_id; |
|
405
|
|
|
DataAPI.sendRequest(manager_profile_url, 'GET', {}, null, function(request) { |
|
|
|
|
|
|
406
|
|
|
responseCallback(request.response); |
|
407
|
|
|
}); |
|
408
|
|
|
} |
|
409
|
|
|
}; |
|
410
|
|
|
|
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.