function WizardScoreOntario() { WizardScore.call(this); } WizardScoreOntario.prototype = Object.create(WizardScore.prototype); WizardScoreOntario.prototype.constructor = WizardScoreOntario; WizardScoreOntario.prototype.GetStepContainersArray = function() { return ["user_base_info", "user_english_language_test_info", "user_english_language_common_info", "user_english_language_exact_info", "user_french_language_test_info", "user_french_language_common_info", "user_french_language_exact_info", "user_school_field_of_study", "user_has_school_canada_info", "user_school_canada_info", "user_has_job_offer_info", "user_job_offer_canada_info", "user_has_work_permit_info", "user_has_work_experience_info", "user_work_experience_info", "user_work_experience_additional_info", "user_work_experience_additional_info_button"]; } WizardScoreOntario.prototype.IsStepVisible = function(step) { let result = true; if ((step == "user_work_experience_info") || (step == "user_work_experience_additional_info") || (step == "user_work_experience_additional_info_button")) result &= (IsButtonGroupCheckBoxOn("#has_work_experience")); if ((step == "user_school_canada_info") || (step == "user_school_field_of_study")) result &= (IsButtonGroupCheckBoxOn("#has_study_experience_canada")); if (step == "user_job_offer_canada_info") result &= (IsButtonGroupCheckBoxOn("#has_job_offer_group")); if (step == "user_work_experience_additional_info") result &= this.shouldShowYearSalaryControl(); result &= WizardScore.prototype.IsStepVisible.call(this, step); return result; } WizardScoreOntario.prototype.LoadControlsFromJSON = function(json) { // console.log(json); WizardScore.prototype.LoadControlsFromJSON.call(this, json); this.loadNocsControlsFromJSON(json, false); this.loadJobOfferControlsFromJSON(json, false); SetButtonGroupCheckBoxValue("#has_study_experience_canada", (json.user_study_exp_canada > 0)); this.setSelectBoxValueByMaximumValue("#user_study_exp_canada", json.user_study_exp_canada); } WizardScoreOntario.prototype.hasCanadaWorkExperience = function() { if (this.nocs_manager) { for (let i = 0; i < this.nocs_manager.items_list.length; i++) { if (IsButtonGroupCheckBoxOn(this.nocs_manager.items_list[i].location_check_box)) return true; } } return false; } WizardScoreOntario.prototype.shouldShowYearSalaryControl = function() { let result = (IsButtonGroupCheckBoxOn("#has_study_experience_canada")); if (IsButtonGroupCheckBoxOn("#has_work_experience")) result = result || (this.hasCanadaWorkExperience()); return result; } WizardScoreOntario.prototype.initializeJobOfferNocsManagers = function() { const _this = this; WizardScore.prototype.initializeJobOfferNocsManagers.call(this); if (this.job_offer_nocs_manager) { this.job_offer_nocs_manager.OnApplyProfession(function(item, noc_title, job_id, noc_id, noc_code, noc_level, noc_title_en, user_data_id) { _this.getHourWageForNocID(noc_id, "Ontario", function(wage) { $("#job_offer_wage_hour").val(wage); }); }); } } WizardScoreOntario.prototype.ChangeInputsEnabledState = function(is_disabled) { $("#median_salary_year").attr("disabled", is_disabled && (!this.shouldShowYearSalaryControl())); $("#user_study_exp_canada").attr("disabled", is_disabled && (IsButtonGroupCheckBoxOff("#has_study_experience_canada"))); WizardScore.prototype.ChangeInputsEnabledState.call(this, is_disabled); }