Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/bcgov/EDUC-CAPS
Browse files Browse the repository at this point in the history
  • Loading branch information
ITK-klo committed Nov 8, 2024
2 parents 3e13db7 + c532703 commit 025a515
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,23 @@ CAPS.ChildCareQuarterlyReport.ShowHideFields = function (executionContext) {
var formContext = executionContext.getFormContext();
if (formContext.getAttribute("caps_selfoperated").getValue() === true) {
formContext.getControl("caps_notdirectlyoperatingsecuredauthorizedoperator").setVisible(false);
formContext.getControl("caps_nameofauthorizedoperator").setVisible(false);
}
else {
formContext.getControl("caps_notdirectlyoperatingsecuredauthorizedoperator").setVisible(true);
formContext.getControl("caps_nameofauthorizedoperator").setVisible(true);
//formContext.getAttribute("caps_nameofauthorizedoperator").setValue(null);
}
//If no Or Information Previously Provided Or Self Operated is Yes
//If no Self Operated is No
if (formContext.getAttribute("caps_notdirectlyoperatingsecuredauthorizedoperator").getValue() === 746660001 ||
formContext.getAttribute("caps_notdirectlyoperatingsecuredauthorizedoperator").getValue() === 746660002 ||
formContext.getAttribute("caps_notdirectlyoperatingsecuredauthorizedoperator").getValue() === null ||
formContext.getAttribute("caps_selfoperated").getValue() === true) {
formContext.getControl("caps_whattypeofauthorizedoperator").setVisible(false);
formContext.getControl("caps_forprofitoperatorjustification").setVisible(false);
formContext.getAttribute("caps_whattypeofauthorizedoperator").setValue(null);
formContext.getAttribute("caps_forprofitoperatorjustification").setValue(null);
formContext.getControl("caps_nameofauthorizedoperator").setVisible(false);
formContext.getAttribute("caps_nameofauthorizedoperator").setValue(null);
}
else {
formContext.getControl("caps_whattypeofauthorizedoperator").setVisible(true);
Expand All @@ -40,14 +44,15 @@ CAPS.ChildCareQuarterlyReport.ShowHideFields = function (executionContext) {
formContext.getAttribute("caps_whattypeofauthorizedoperator").getValue() === null) {
formContext.getControl("caps_forprofitoperatorjustification").setVisible(false);
formContext.getAttribute("caps_forprofitoperatorjustification").setValue(null);
formContext.getControl("caps_nameofauthorizedoperator").setVisible(true);

}
else {
formContext.getControl("caps_forprofitoperatorjustification").setVisible(true);
}
}
//If Received funding from additional sources is No or Information Previously Provided
//If Received funding from additional sources is No
if (formContext.getAttribute("caps_receivedfundingfromadditionalsources").getValue() === 746660001 ||
formContext.getAttribute("caps_receivedfundingfromadditionalsources").getValue() === 746660002 ||
formContext.getAttribute("caps_receivedfundingfromadditionalsources").getValue() === null) {
formContext.getControl("caps_amountreceivedandfromwhom").setVisible(false);
formContext.getAttribute("caps_amountreceivedandfromwhom").setValue(null);
Expand Down
5 changes: 5 additions & 0 deletions CAPS/WebResources/Scripts/FormHandler/caps_Project.Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -1311,11 +1311,16 @@ CAPS.Project.ToggleBUSReplacement = function (executionContext) {
//Show Bus to be replaced and make mandatory
formContext.getControl("caps_bus").setVisible(true);
formContext.getAttribute("caps_bus").setRequiredLevel("required");
if (executionContext.getFormContext() != FORM_STATE.CREATE) {
formContext.getControl("caps_currentkilometers").setVisible(true);
}

}
else {
//hide Bus to be replaced and make optional and clear
formContext.getControl("caps_bus").setVisible(false);
formContext.getAttribute("caps_bus").setRequiredLevel("none");
formContext.getControl("caps_currentkilometers").setVisible(false);
if (formContext.getAttribute("caps_bus").getValue() != null && executionContext.getFormContext() != FORM_STATE.READ_ONLY) {
formContext.getAttribute("caps_bus").setValue(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ CAPS.ProjectTracker.showHideCategoryRelevantSections = function (formContext) {
if (categoryCode === 'CC_CONVERSION_MINOR') {

formContext.getAttribute("caps_childcareconstructiontype").controls.forEach(control => control.setVisible(false));
formContext.ui.tabs.get("tab_child_care").sections.get("tab_10_section_1").setVisible(false);
formContext.ui.tabs.get("tab_child_care").sections.get("tab_10_section_1").setVisible(true);

}
if (categoryCode === 'CC_UPGRADE') {
Expand All @@ -618,7 +618,7 @@ CAPS.ProjectTracker.showHideCategoryRelevantSections = function (formContext) {
formContext.getAttribute("caps_proposedchildcarefacility").controls.forEach(control => control.setVisible(false));
formContext.getAttribute("caps_childcareconstructiontype").controls.forEach(control => control.setVisible(false));
formContext.getAttribute("caps_healthauthority").controls.forEach(control => control.setVisible(false));
formContext.ui.tabs.get("tab_child_care").sections.get("tab_10_section_1").setVisible(false);
formContext.ui.tabs.get("tab_child_care").sections.get("tab_10_section_1").setVisible(true);
}


Expand Down
3 changes: 3 additions & 0 deletions CAPS/WebResources/WebResources.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,17 @@
<Content Include="Scripts\Ribbon\caps_Batch.Sign.js" />
<Content Include="Scripts\Ribbon\caps_Batch.Complete.js" />
<Content Include="Scripts\Ribbon\caps_ChildCare.Ribbon.js" />
<Content Include="Scripts\Ribbon\caps_ChildCareActualEnrolment.Ribbons.js" />
<Content Include="Scripts\Ribbon\caps_ChildCareEnrolmentProjection.Ribbon.js" />
<Content Include="Scripts\Ribbon\caps_ChildCareProgressReport.Ribbons.js" />
<Content Include="Scripts\Ribbon\caps_ChildCareQuarterlyReport.Ribbon.js" />
<Content Include="Scripts\Ribbon\caps_DrawRequest.SubgridReadytoSubmit.js" />
<Content Include="Scripts\Ribbon\caps_DrawRequest.ReadytoSubmit.js" />
<Content Include="Scripts\Ribbon\caps_Batch.Submit.js" />
<Content Include="Scripts\Ribbon\caps_CallForSubmission.Ribbon.js" />
<Content Include="Scripts\Ribbon\caps_CertificateOfApproval.Ribbon.js" />
<Content Include="Scripts\Ribbon\caps_EnrolmentProjection.Ribbon.js" />
<Content Include="Scripts\Ribbon\caps_ExistingChildCareSpaces.Ribbon.js" />
<Content Include="Scripts\Ribbon\caps_Facility.Ribbon.js" />
<Content Include="Scripts\Ribbon\caps_PRFSAlternativeOption.Ribbon.js" />
<Content Include="Scripts\Ribbon\caps_ProgressReport.Ribbon.js" />
Expand Down

0 comments on commit 025a515

Please sign in to comment.