/* ****************************************************************************
Sets the [Intake Needed] checkbox according to the Client havinng an active
enrollment on the selected Program
**************************************************************************** */
setFormElement('is_intake_needed', cfs_SetIntakeNeeded());
function cfs_SetIntakeNeeded() {
var cfs_condition = 'people_id = \'\'' + getElementFromXML(formXML, 'people_id') + '\'\' AND program_info_id = \'\'' + getFormElement('program_providing_service') + '\'\'';
var cfs_has_enrollment = (getDataValue('current_program_enrollment_view', 'people_id', getElementFromXML(formXML, 'people_id'), 'program_name', cfs_condition)) ? true : false;
var cfs_is_active = (getDataValue('current_program_enrollment_view', 'people_id', getElementFromXML(formXML, 'people_id'), 'end_date', cfs_condition)) ? false : true;
if (!cfs_has_enrollment) {
var cfs_intake_needed = true;
} else {
var cfs_intake_needed = (cfs_is_active) ? false : true;
}
cfs_intake_needed = (getFormElement('program_providing_service') == '') ? false : cfs_intake_needed;
return cfs_intake_needed
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.