function scJQGeneralAdd() { scLoadScInput('input:text.sc-js-input'); scLoadScInput('input:password.sc-js-input'); scLoadScInput('input:checkbox.sc-js-input'); scLoadScInput('input:radio.sc-js-input'); scLoadScInput('select.sc-js-input'); scLoadScInput('textarea.sc-js-input'); } // scJQGeneralAdd function scFocusField(sField) { var $oField = $('#id_sc_field_' + sField); if (0 == $oField.length) { $oField = $('input[name=' + sField + ']'); } if (0 == $oField.length && document.F1.elements[sField]) { $oField = $(document.F1.elements[sField]); } if ($("#id_ac_" + sField).length > 0) { if ($oField.hasClass("select2-hidden-accessible")) { if (false == scSetFocusOnField($oField, sField)) { setTimeout(function() { scSetFocusOnField($oField, sField); }, 500); } } else { if (false == scSetFocusOnField($oField, sField)) { if (false == scSetFocusOnField($("#id_ac_" + sField, sField))) { setTimeout(function() { scSetFocusOnField($("#id_ac_" + sField, sField)); }, 500); } } else { setTimeout(function() { scSetFocusOnField($oField, sField); }, 500); } } } else { setTimeout(function() { scSetFocusOnField($oField, sField); }, 500); } } // scFocusField function scSetFocusOnField($oField, sField) { if ($oField.length > 0 && $oField[0].offsetHeight > 0 && $oField[0].offsetWidth > 0 && !$oField[0].disabled) { if (sField == 'client_id') { $oField.select2('open'); } else { $oField[0].focus(); } return true; } return false; } // scSetFocusOnField function scEventControl_init(iSeqRow) { scEventControl_data["ref" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""}; scEventControl_data["booking_type" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""}; scEventControl_data["status" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""}; scEventControl_data["client_id" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""}; scEventControl_data["first_name" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""}; scEventControl_data["last_name" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""}; scEventControl_data["email" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""}; scEventControl_data["description" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""}; scEventControl_data["booking_date" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""}; scEventControl_data["portugal_time" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""}; scEventControl_data["start_time" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""}; scEventControl_data["hours_booked" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""}; scEventControl_data["amount_eur" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""}; scEventControl_data["info_field" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""}; } function scEventControl_active(iSeqRow) { if (scEventControl_data["ref" + iSeqRow] && scEventControl_data["ref" + iSeqRow]["blur"]) { return true; } if (scEventControl_data["ref" + iSeqRow] && scEventControl_data["ref" + iSeqRow]["change"]) { return true; } if (scEventControl_data["booking_type" + iSeqRow] && scEventControl_data["booking_type" + iSeqRow]["blur"]) { return true; } if (scEventControl_data["booking_type" + iSeqRow] && scEventControl_data["booking_type" + iSeqRow]["change"]) { return true; } if (scEventControl_data["status" + iSeqRow] && scEventControl_data["status" + iSeqRow]["blur"]) { return true; } if (scEventControl_data["status" + iSeqRow] && scEventControl_data["status" + iSeqRow]["change"]) { return true; } if (scEventControl_data["client_id" + iSeqRow] && scEventControl_data["client_id" + iSeqRow]["blur"]) { return true; } if (scEventControl_data["client_id" + iSeqRow] && scEventControl_data["client_id" + iSeqRow]["change"]) { return true; } if (scEventControl_data["first_name" + iSeqRow] && scEventControl_data["first_name" + iSeqRow]["blur"]) { return true; } if (scEventControl_data["first_name" + iSeqRow] && scEventControl_data["first_name" + iSeqRow]["change"]) { return true; } if (scEventControl_data["last_name" + iSeqRow] && scEventControl_data["last_name" + iSeqRow]["blur"]) { return true; } if (scEventControl_data["last_name" + iSeqRow] && scEventControl_data["last_name" + iSeqRow]["change"]) { return true; } if (scEventControl_data["email" + iSeqRow] && scEventControl_data["email" + iSeqRow]["blur"]) { return true; } if (scEventControl_data["email" + iSeqRow] && scEventControl_data["email" + iSeqRow]["change"]) { return true; } if (scEventControl_data["description" + iSeqRow] && scEventControl_data["description" + iSeqRow]["blur"]) { return true; } if (scEventControl_data["description" + iSeqRow] && scEventControl_data["description" + iSeqRow]["change"]) { return true; } if (scEventControl_data["booking_date" + iSeqRow] && scEventControl_data["booking_date" + iSeqRow]["blur"]) { return true; } if (scEventControl_data["booking_date" + iSeqRow] && scEventControl_data["booking_date" + iSeqRow]["change"]) { return true; } if (scEventControl_data["portugal_time" + iSeqRow] && scEventControl_data["portugal_time" + iSeqRow]["blur"]) { return true; } if (scEventControl_data["portugal_time" + iSeqRow] && scEventControl_data["portugal_time" + iSeqRow]["change"]) { return true; } if (scEventControl_data["start_time" + iSeqRow] && scEventControl_data["start_time" + iSeqRow]["blur"]) { return true; } if (scEventControl_data["start_time" + iSeqRow] && scEventControl_data["start_time" + iSeqRow]["change"]) { return true; } if (scEventControl_data["hours_booked" + iSeqRow] && scEventControl_data["hours_booked" + iSeqRow]["blur"]) { return true; } if (scEventControl_data["hours_booked" + iSeqRow] && scEventControl_data["hours_booked" + iSeqRow]["change"]) { return true; } if (scEventControl_data["amount_eur" + iSeqRow] && scEventControl_data["amount_eur" + iSeqRow]["blur"]) { return true; } if (scEventControl_data["amount_eur" + iSeqRow] && scEventControl_data["amount_eur" + iSeqRow]["change"]) { return true; } if (scEventControl_data["info_field" + iSeqRow] && scEventControl_data["info_field" + iSeqRow]["blur"]) { return true; } if (scEventControl_data["info_field" + iSeqRow] && scEventControl_data["info_field" + iSeqRow]["change"]) { return true; } return false; } // scEventControl_active function scEventControl_onFocus(oField, iSeq) { var fieldId, fieldName; fieldId = $(oField).attr("id"); fieldName = fieldId.substr(12); scEventControl_data[fieldName]["blur"] = true; if ("booking_type" + iSeq == fieldName) { scEventControl_data[fieldName]["blur"] = false; } if ("client_id" + iSeq == fieldName) { scEventControl_data[fieldName]["blur"] = false; } if ("booking_date" + iSeq == fieldName) { scEventControl_data[fieldName]["change"] = true; scEventControl_data[fieldName]["original"] = $(oField).val(); scEventControl_data[fieldName]["calculated"] = $(oField).val(); return; } if ("booking_type" + iSeq == fieldName) { scEventControl_data[fieldName]["change"] = true; scEventControl_data[fieldName]["original"] = $(oField).val(); scEventControl_data[fieldName]["calculated"] = $(oField).val(); return; } if ("client_id" + iSeq == fieldName) { scEventControl_data[fieldName]["change"] = true; scEventControl_data[fieldName]["original"] = $(oField).val(); scEventControl_data[fieldName]["calculated"] = $(oField).val(); return; } if ("start_time" + iSeq == fieldName) { scEventControl_data[fieldName]["change"] = true; scEventControl_data[fieldName]["original"] = $(oField).val(); scEventControl_data[fieldName]["calculated"] = $(oField).val(); return; } scEventControl_data[fieldName]["change"] = false; } // scEventControl_onFocus function scEventControl_onBlur(sFieldName) { scEventControl_data[sFieldName]["blur"] = false; if (scEventControl_data[sFieldName]["change"]) { if (scEventControl_data[sFieldName]["original"] == $("#id_sc_field_" + sFieldName).val() || scEventControl_data[sFieldName]["calculated"] == $("#id_sc_field_" + sFieldName).val()) { scEventControl_data[sFieldName]["change"] = false; } } } // scEventControl_onBlur function scEventControl_onChange(sFieldName) { scEventControl_data[sFieldName]["change"] = false; } // scEventControl_onChange function scEventControl_onAutocomp(sFieldName) { scEventControl_data[sFieldName]["autocomp"] = false; } // scEventControl_onChange var scEventControl_data = {}; function scJQEventsAdd(iSeqRow) { $('#id_sc_field_id' + iSeqRow).bind('change', function() { sc_form_booking_client_request_id_onchange(this, iSeqRow, event) }); $('#id_sc_field_ref' + iSeqRow).bind('blur', function() { sc_form_booking_client_request_ref_onblur('#id_sc_field_ref' + iSeqRow, iSeqRow, event) }) .bind('change', function() { sc_form_booking_client_request_ref_onchange(this, iSeqRow, event) }) .bind('focus', function() { sc_form_booking_client_request_ref_onfocus(this, iSeqRow, event) }); $('#id_sc_field_booking_type' + iSeqRow).bind('blur', function() { sc_form_booking_client_request_booking_type_onblur('#id_sc_field_booking_type' + iSeqRow, iSeqRow, event) }) .bind('change', function() { sc_form_booking_client_request_booking_type_onchange(this, iSeqRow, event) }) .bind('focus', function() { sc_form_booking_client_request_booking_type_onfocus(this, iSeqRow, event) }); $('#id_sc_field_hours_booked' + iSeqRow).bind('blur', function() { sc_form_booking_client_request_hours_booked_onblur('#id_sc_field_hours_booked' + iSeqRow, iSeqRow, event) }) .bind('change', function() { sc_form_booking_client_request_hours_booked_onchange(this, iSeqRow, event) }) .bind('click', function() { sc_form_booking_client_request_hours_booked_onclick(this, iSeqRow, event) }) .bind('focus', function() { sc_form_booking_client_request_hours_booked_onfocus(this, iSeqRow, event) }); $('#id_sc_field_client_id' + iSeqRow).bind('select2:close', function() { sc_form_booking_client_request_client_id_onblur('#id_sc_field_client_id' + iSeqRow, iSeqRow, event) }) .bind('change', function() { sc_form_booking_client_request_client_id_onchange(this, iSeqRow, event) }) .bind('focus', function() { sc_form_booking_client_request_client_id_onfocus(this, iSeqRow, event) }); $('#id_sc_field_amount_eur' + iSeqRow).bind('blur', function() { sc_form_booking_client_request_amount_eur_onblur('#id_sc_field_amount_eur' + iSeqRow, iSeqRow, event) }) .bind('change', function() { sc_form_booking_client_request_amount_eur_onchange(this, iSeqRow, event) }) .bind('focus', function() { sc_form_booking_client_request_amount_eur_onfocus(this, iSeqRow, event) }); $('#id_sc_field_description' + iSeqRow).bind('blur', function() { sc_form_booking_client_request_description_onblur('#id_sc_field_description' + iSeqRow, iSeqRow, event) }) .bind('change', function() { sc_form_booking_client_request_description_onchange(this, iSeqRow, event) }) .bind('focus', function() { sc_form_booking_client_request_description_onfocus(this, iSeqRow, event) }); $('#id_sc_field_usr_login' + iSeqRow).bind('change', function() { sc_form_booking_client_request_usr_login_onchange(this, iSeqRow, event) }); $('#id_sc_field_first_name' + iSeqRow).bind('blur', function() { sc_form_booking_client_request_first_name_onblur('#id_sc_field_first_name' + iSeqRow, iSeqRow, event) }) .bind('change', function() { sc_form_booking_client_request_first_name_onchange(this, iSeqRow, event) }) .bind('focus', function() { sc_form_booking_client_request_first_name_onfocus(this, iSeqRow, event) }); $('#id_sc_field_last_name' + iSeqRow).bind('blur', function() { sc_form_booking_client_request_last_name_onblur('#id_sc_field_last_name' + iSeqRow, iSeqRow, event) }) .bind('change', function() { sc_form_booking_client_request_last_name_onchange(this, iSeqRow, event) }) .bind('focus', function() { sc_form_booking_client_request_last_name_onfocus(this, iSeqRow, event) }); $('#id_sc_field_email' + iSeqRow).bind('blur', function() { sc_form_booking_client_request_email_onblur('#id_sc_field_email' + iSeqRow, iSeqRow, event) }) .bind('change', function() { sc_form_booking_client_request_email_onchange(this, iSeqRow, event) }) .bind('focus', function() { sc_form_booking_client_request_email_onfocus(this, iSeqRow, event) }); $('#id_sc_field_booking_date' + iSeqRow).bind('blur', function() { sc_form_booking_client_request_booking_date_onblur('#id_sc_field_booking_date' + iSeqRow, iSeqRow, event) }) .bind('change', function() { sc_form_booking_client_request_booking_date_onchange(this, iSeqRow, event) }) .bind('focus', function() { sc_form_booking_client_request_booking_date_onfocus(this, iSeqRow, event) }); $('#id_sc_field_start_time' + iSeqRow).bind('blur', function() { sc_form_booking_client_request_start_time_onblur('#id_sc_field_start_time' + iSeqRow, iSeqRow, event) }) .bind('change', function() { sc_form_booking_client_request_start_time_onchange(this, iSeqRow, event) }) .bind('focus', function() { sc_form_booking_client_request_start_time_onfocus(this, iSeqRow, event) }); $('#id_sc_field_notes' + iSeqRow).bind('change', function() { sc_form_booking_client_request_notes_onchange(this, iSeqRow, event) }); $('#id_sc_field_status' + iSeqRow).bind('blur', function() { sc_form_booking_client_request_status_onblur('#id_sc_field_status' + iSeqRow, iSeqRow, event) }) .bind('change', function() { sc_form_booking_client_request_status_onchange(this, iSeqRow, event) }) .bind('focus', function() { sc_form_booking_client_request_status_onfocus(this, iSeqRow, event) }); $('#id_sc_field_created_at' + iSeqRow).bind('change', function() { sc_form_booking_client_request_created_at_onchange(this, iSeqRow, event) }); $('#id_sc_field_created_at_hora' + iSeqRow).bind('change', function() { sc_form_booking_client_request_created_at_hora_onchange(this, iSeqRow, event) }); $('#id_sc_field_info_field' + iSeqRow).bind('blur', function() { sc_form_booking_client_request_info_field_onblur('#id_sc_field_info_field' + iSeqRow, iSeqRow, event) }) .bind('change', function() { sc_form_booking_client_request_info_field_onchange(this, iSeqRow, event) }) .bind('focus', function() { sc_form_booking_client_request_info_field_onfocus(this, iSeqRow, event) }); $('#id_sc_field_portugal_time' + iSeqRow).bind('blur', function() { sc_form_booking_client_request_portugal_time_onblur('#id_sc_field_portugal_time' + iSeqRow, iSeqRow, event) }) .bind('change', function() { sc_form_booking_client_request_portugal_time_onchange(this, iSeqRow, event) }) .bind('focus', function() { sc_form_booking_client_request_portugal_time_onfocus(this, iSeqRow, event) }); $('.sc-ui-radio-status' + iSeqRow).on('click', function() { scMarkFormAsChanged(); }); $('.sc-ui-radio-hours_booked' + iSeqRow).on('click', function() { scMarkFormAsChanged(); }); } // scJQEventsAdd Upload_Cancel = false; function sc_form_booking_client_request_id_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_form_booking_client_request_ref_onblur(oThis, iSeqRow, event) { do_ajax_form_booking_client_request_validate_ref(); scCssBlur(oThis); } function sc_form_booking_client_request_ref_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_form_booking_client_request_ref_onfocus(oThis, iSeqRow, event) { scEventControl_onFocus(oThis, iSeqRow); scCssFocus(oThis); } function sc_form_booking_client_request_booking_type_onblur(oThis, iSeqRow, event) { do_ajax_form_booking_client_request_validate_booking_type(); scCssBlur(oThis); } function sc_form_booking_client_request_booking_type_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); do_ajax_form_booking_client_request_event_booking_type_onchange(); } function sc_form_booking_client_request_booking_type_onfocus(oThis, iSeqRow, event) { scEventControl_onFocus(oThis, iSeqRow); scCssFocus(oThis); } function sc_form_booking_client_request_hours_booked_onblur(oThis, iSeqRow, event) { do_ajax_form_booking_client_request_validate_hours_booked(); scCssBlur(oThis); } function sc_form_booking_client_request_hours_booked_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_form_booking_client_request_hours_booked_onclick(oThis, iSeqRow, event) { do_ajax_form_booking_client_request_event_hours_booked_onclick(); } function sc_form_booking_client_request_hours_booked_onfocus(oThis, iSeqRow, event) { scEventControl_onFocus(oThis, iSeqRow); scCssFocus(oThis); } function sc_form_booking_client_request_client_id_onblur(oThis, iSeqRow, event) { do_ajax_form_booking_client_request_validate_client_id(); scCssBlur(oThis); } function sc_form_booking_client_request_client_id_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); do_ajax_form_booking_client_request_event_client_id_onchange(); } function sc_form_booking_client_request_client_id_onfocus(oThis, iSeqRow, event) { scEventControl_onFocus(oThis, iSeqRow); scCssFocus(oThis); } function sc_form_booking_client_request_amount_eur_onblur(oThis, iSeqRow, event) { do_ajax_form_booking_client_request_validate_amount_eur(); scCssBlur(oThis); } function sc_form_booking_client_request_amount_eur_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_form_booking_client_request_amount_eur_onfocus(oThis, iSeqRow, event) { scEventControl_onFocus(oThis, iSeqRow); scCssFocus(oThis); } function sc_form_booking_client_request_description_onblur(oThis, iSeqRow, event) { do_ajax_form_booking_client_request_validate_description(); scCssBlur(oThis); } function sc_form_booking_client_request_description_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_form_booking_client_request_description_onfocus(oThis, iSeqRow, event) { scEventControl_onFocus(oThis, iSeqRow); scCssFocus(oThis); } function sc_form_booking_client_request_usr_login_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_form_booking_client_request_first_name_onblur(oThis, iSeqRow, event) { do_ajax_form_booking_client_request_validate_first_name(); scCssBlur(oThis); } function sc_form_booking_client_request_first_name_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_form_booking_client_request_first_name_onfocus(oThis, iSeqRow, event) { scEventControl_onFocus(oThis, iSeqRow); scCssFocus(oThis); } function sc_form_booking_client_request_last_name_onblur(oThis, iSeqRow, event) { do_ajax_form_booking_client_request_validate_last_name(); scCssBlur(oThis); } function sc_form_booking_client_request_last_name_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_form_booking_client_request_last_name_onfocus(oThis, iSeqRow, event) { scEventControl_onFocus(oThis, iSeqRow); scCssFocus(oThis); } function sc_form_booking_client_request_email_onblur(oThis, iSeqRow, event) { do_ajax_form_booking_client_request_validate_email(); scCssBlur(oThis); } function sc_form_booking_client_request_email_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_form_booking_client_request_email_onfocus(oThis, iSeqRow, event) { scEventControl_onFocus(oThis, iSeqRow); scCssFocus(oThis); } function sc_form_booking_client_request_booking_date_onblur(oThis, iSeqRow, event) { do_ajax_form_booking_client_request_validate_booking_date(); scCssBlur(oThis); } function sc_form_booking_client_request_booking_date_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); do_ajax_form_booking_client_request_event_booking_date_onchange(); } function sc_form_booking_client_request_booking_date_onfocus(oThis, iSeqRow, event) { scEventControl_onFocus(oThis, iSeqRow); scCssFocus(oThis); } function sc_form_booking_client_request_start_time_onblur(oThis, iSeqRow, event) { do_ajax_form_booking_client_request_validate_start_time(); scCssBlur(oThis); } function sc_form_booking_client_request_start_time_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); do_ajax_form_booking_client_request_event_start_time_onchange(); } function sc_form_booking_client_request_start_time_onfocus(oThis, iSeqRow, event) { scEventControl_onFocus(oThis, iSeqRow); scCssFocus(oThis); } function sc_form_booking_client_request_notes_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_form_booking_client_request_status_onblur(oThis, iSeqRow, event) { do_ajax_form_booking_client_request_validate_status(); scCssBlur(oThis); } function sc_form_booking_client_request_status_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_form_booking_client_request_status_onfocus(oThis, iSeqRow, event) { scEventControl_onFocus(oThis, iSeqRow); scCssFocus(oThis); } function sc_form_booking_client_request_created_at_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_form_booking_client_request_created_at_hora_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_form_booking_client_request_info_field_onblur(oThis, iSeqRow, event) { do_ajax_form_booking_client_request_validate_info_field(); scCssBlur(oThis); } function sc_form_booking_client_request_info_field_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_form_booking_client_request_info_field_onfocus(oThis, iSeqRow, event) { scEventControl_onFocus(oThis, iSeqRow); scCssFocus(oThis); } function sc_form_booking_client_request_portugal_time_onblur(oThis, iSeqRow, event) { do_ajax_form_booking_client_request_validate_portugal_time(); scCssBlur(oThis); } function sc_form_booking_client_request_portugal_time_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_form_booking_client_request_portugal_time_onfocus(oThis, iSeqRow, event) { scEventControl_onFocus(oThis, iSeqRow); scCssFocus(oThis); } function displayChange_block(block, status) { if ("0" == block) { displayChange_block_0(status); } if ("1" == block) { displayChange_block_1(status); } if ("2" == block) { displayChange_block_2(status); } } function displayChange_block_0(status) { displayChange_field("ref", "", status); displayChange_field("booking_type", "", status); displayChange_field("status", "", status); } function displayChange_block_1(status) { displayChange_field("client_id", "", status); displayChange_field("first_name", "", status); displayChange_field("last_name", "", status); displayChange_field("email", "", status); displayChange_field("description", "", status); } function displayChange_block_2(status) { displayChange_field("booking_date", "", status); displayChange_field("portugal_time", "", status); displayChange_field("start_time", "", status); displayChange_field("hours_booked", "", status); displayChange_field("amount_eur", "", status); displayChange_field("info_field", "", status); } function displayChange_row(row, status) { displayChange_field_ref(row, status); displayChange_field_booking_type(row, status); displayChange_field_status(row, status); displayChange_field_client_id(row, status); displayChange_field_first_name(row, status); displayChange_field_last_name(row, status); displayChange_field_email(row, status); displayChange_field_description(row, status); displayChange_field_booking_date(row, status); displayChange_field_portugal_time(row, status); displayChange_field_start_time(row, status); displayChange_field_hours_booked(row, status); displayChange_field_amount_eur(row, status); displayChange_field_info_field(row, status); } function displayChange_field(field, row, status) { if ("ref" == field) { displayChange_field_ref(row, status); } if ("booking_type" == field) { displayChange_field_booking_type(row, status); } if ("status" == field) { displayChange_field_status(row, status); } if ("client_id" == field) { displayChange_field_client_id(row, status); } if ("first_name" == field) { displayChange_field_first_name(row, status); } if ("last_name" == field) { displayChange_field_last_name(row, status); } if ("email" == field) { displayChange_field_email(row, status); } if ("description" == field) { displayChange_field_description(row, status); } if ("booking_date" == field) { displayChange_field_booking_date(row, status); } if ("portugal_time" == field) { displayChange_field_portugal_time(row, status); } if ("start_time" == field) { displayChange_field_start_time(row, status); } if ("hours_booked" == field) { displayChange_field_hours_booked(row, status); } if ("amount_eur" == field) { displayChange_field_amount_eur(row, status); } if ("info_field" == field) { displayChange_field_info_field(row, status); } } function displayChange_field_ref(row, status) { var fieldId; } function displayChange_field_booking_type(row, status) { var fieldId; } function displayChange_field_status(row, status) { var fieldId; } function displayChange_field_client_id(row, status) { var fieldId; if ("on" == status) { Ctrl_Disabled = false; if ("all" == row) { var fieldList = $(".css_client_id__obj"); for (var i = 0; i < fieldList.length; i++) { $($(fieldList[i]).attr("id")).select2("destroy"); } } else { if ($('#select2-id_sc_field_client_id' + row + '-container').hasClass('scFormInputDisabled')) { Ctrl_Disabled = true; } $("#id_sc_field_client_id" + row).select2("destroy"); } scJQSelect2Add(row, "client_id"); if (Ctrl_Disabled) { $('#select2-id_sc_field_client_id' + row + '-container').addClass('scFormInputDisabled') } } } function displayChange_field_first_name(row, status) { var fieldId; } function displayChange_field_last_name(row, status) { var fieldId; } function displayChange_field_email(row, status) { var fieldId; } function displayChange_field_description(row, status) { var fieldId; } function displayChange_field_booking_date(row, status) { var fieldId; } function displayChange_field_portugal_time(row, status) { var fieldId; } function displayChange_field_start_time(row, status) { var fieldId; } function displayChange_field_hours_booked(row, status) { var fieldId; } function displayChange_field_amount_eur(row, status) { var fieldId; } function displayChange_field_info_field(row, status) { var fieldId; } function scRecreateSelect2() { displayChange_field_client_id("all", "on"); } function scResetPagesDisplay() { $(".sc-form-page").show(); } function scHidePage(pageNo) { $("#id_form_booking_client_request_form" + pageNo).hide(); } function scCheckNoPageSelected() { if (!$(".sc-form-page").filter(".scTabActive").filter(":visible").length) { var inactiveTabs = $(".sc-form-page").filter(".scTabInactive").filter(":visible"); if (inactiveTabs.length) { var tabNo = $(inactiveTabs[0]).attr("id").substr(38); } } } var sc_jq_calendar_value = {}; function scJQCalendarAdd(iSeqRow) { $("#id_sc_field_booking_date" + iSeqRow).datepicker('destroy'); $("#id_sc_field_booking_date" + iSeqRow).datepicker({ beforeShow: function(input, inst) { var $oField = $(this), aParts = $oField.val().split(" "), sTime = ""; sc_jq_calendar_value["#id_sc_field_booking_date" + iSeqRow] = $oField.val(); }, onClose: function(dateText, inst) { do_ajax_form_booking_client_request_validate_booking_date(iSeqRow); }, showWeek: true, numberOfMonths: 1, changeMonth: true, changeYear: true, yearRange: 'c-5:c+5', dayNames: ["