/* This work is licensed under Creative Commons GNU LGPL License. License: http://creativecommons.org/licenses/LGPL/2.1/ Version: 0.9 Author: Stefan Goessner/2006 Web: http://goessner.net/ */ function xml2json(xml, tab) { var X = { toObj: function(xml) { var o = {}; if (xml.nodeType==1) { // element node .. if (xml.attributes.length) // element with attributes .. for (var i=0; i 1) o = X.escape(X.innerXml(xml)); else for (var n=xml.firstChild; n; n=n.nextSibling) o["#cdata"] = X.escape(n.nodeValue); } } if (!xml.attributes.length && !xml.firstChild) o = null; } else if (xml.nodeType==9) { // document.node o = X.toObj(xml.documentElement); } else alert("unhandled node type: " + xml.nodeType); return o; }, toJson: function(o, name, ind) { var json = name ? ("\""+name+"\"") : ""; if (o instanceof Array) { for (var i=0,n=o.length; i 1 ? ("\n"+ind+"\t"+o.join(",\n"+ind+"\t")+"\n"+ind) : o.join("")) + "]"; } else if (o == null) json += (name&&":") + "null"; else if (typeof(o) == "object") { var arr = []; for (var m in o) arr[arr.length] = X.toJson(o[m], m, ind+"\t"); json += (name?":{":"{") + (arr.length > 1 ? ("\n"+ind+"\t"+arr.join(",\n"+ind+"\t")+"\n"+ind) : arr.join("")) + "}"; //json += (name?":[":"[") + (arr.length > 1 ? ("\n"+ind+"\t"+arr.join(",\n"+ind+"\t")+"\n"+ind) : arr.join("")) + "]"; } else if (typeof(o) == "string") json += (name&&":") + "\"" + o.toString() + "\""; else json += (name&&":") + o.toString(); return json; }, innerXml: function(node) { var s = "" if ("innerHTML" in node) s = node.innerHTML; else { var asXml = function(n) { var s = ""; if (n.nodeType == 1) { s += "<" + n.nodeName; for (var i=0; i"; } else s += "/>"; } else if (n.nodeType == 3) s += n.nodeValue; else if (n.nodeType == 4) s += ""; return s; }; for (var c=node.firstChild; c; c=c.nextSibling) s += asXml(c); } return s; }, escape: function(txt) { return txt.replace(/[\\]/g, "\\\\") .replace(/[\"]/g, '\\"') .replace(/[\n]/g, '\\n') .replace(/[\r]/g, '\\r'); }, removeWhite: function(e) { e.normalize(); for (var n = e.firstChild; n; ) { if (n.nodeType == 3) { // text node if (!n.nodeValue.match(/[^ \f\n\r\t\v]/)) { // pure whitespace text node var nxt = n.nextSibling; e.removeChild(n); n = nxt; } else n = n.nextSibling; } else if (n.nodeType == 1) { // element node X.removeWhite(n); n = n.nextSibling; } else // any other node n = n.nextSibling; } return e; } }; if (xml.nodeType == 9) // document node xml = xml.documentElement; var json = X.toJson(X.toObj(X.removeWhite(xml)), xml.nodeName, "\t"); return "{\n" + tab + (tab ? json.replace(/\t/g, tab) : json.replace(/\t|\n/g, "")) + "\n}"; } function parseXml(xml) { var dom = null; if (window.DOMParser) { try { dom = (new DOMParser()).parseFromString(xml, "text/xml"); } catch (e) { dom = null; } } else if (window.ActiveXObject) { try { dom = new ActiveXObject('Microsoft.XMLDOM'); dom.async = false; if (!dom.loadXML(xml)) // parse error .. window.alert(dom.parseError.reason + dom.parseError.srcText); } catch (e) { dom = null; } } else alert("cannot parse xml string!"); return dom; } function Put_Title_Content(once='') { console.log('Put_Title_Content: '+once); var tmp_message = ''; var tmp_title = ''; console.log(jQuery('label[for="wpas__st_wc_headline_hotel"]:visible').length); console.log('#wpas__st_wc_headline_hotel'); console.log('once: '+once); console.log(jQuery( "#wpas_message" ).val()); console.log('jQuery( "#wpas_message" ).val() in PutTitleContent()'); if(once!='Hotel' && jQuery('label[for="wpas__st_wc_headline_hotel"]:visible').length>0){ jQuery('#wpas__st_giata_hotel').change(); return; }else if(once=='Hotel' && jQuery( "#wpas_message" ).val()!=''){ tmp_message = jQuery( "#wpas_message" ).val(); tmp_title = jQuery( "#wpas_title" ).val(); } jQuery( "#wpas_message" ).val(''); jQuery( "#wpas_title" ).val(''); Content_wpas_message = ''; Content_wpas_title = ''; Content_wpas_cats = new Array(); Content_wpas_excerp_flight = ''; Content_wpas_excerp_extra = ''; Content_wpas_cat_Hotel = false; Content_wpas_cat_Flug = false; Content_wpas_cat_Zusatzleistung = false; Content_wpas_cat_Kreuzfahrt = false //Content_wpas_cat_Hotel_done = false; Content_wpas_cat_Flug_done = false; Content_wpas_cat_Zusatzleistung_done = false; //Content_wpas_cat_Kreuzfahrt_done = false; st_wc_cat_arr_select = new Array(); jQuery.each(st_wc_cat_arr, function( index, st_wc_cat_check ) { var st_wc_cat_tmp = st_wc_cat_check.val(); var st_wc_cat_val_arr = st_wc_cat_tmp.split("#"); if (jQuery(this).attr('checked')){ st_wc_cat_arr_select.push(jQuery(this)); } }) st_wc_cat_selectors = jQuery('.cat_selector:visible'); jQuery.each(st_wc_cat_selectors, function( index, st_wc_cat_selector ) { st_wc_cat_selected = jQuery(st_wc_cat_selector).find('input[type="radio"]:checked').first().val(); //console.log(st_wc_cat_selected); //console.log('st_wc_cat_selected'); Content_wpas_cats.push(st_wc_cat_selected); //console.log(Content_wpas_cats); //console.log('Content_wpas_cats'); }) Content_wpas_cats.push(jQuery('#wpas__st_wc_triptype').val()); //** BEFÖRDERUNG jQuery.each(st_wc_cat_arr_select, function( index, st_wc_cat_check ) { var st_wc_cat_tmp = st_wc_cat_check.val(); var st_wc_cat_val_arr = st_wc_cat_tmp.split("#"); var st_wc_cat = st_wc_cat_val_arr['1']; switch(st_wc_cat) { case 'Flug': case 'Bahn': case 'Bus': case 'Schiff': //console.log(jQuery('.storno_subheadline_flight').length); //console.log("jQuery('.storno_subheadline_flight').length"); if(!Content_wpas_cat_Flug_done){ for(let i=0; i < jQuery('.storno_subheadline_flight:visible').length; i++){ var st_flight_origin_tmp = jQuery('#wpas__st_flight_origin_tmp_'+i).val(); var st_flight_destination_tmp = jQuery('#wpas__st_flight_destination_tmp_'+i).val(); var st_flight_airline_tmp = jQuery('#wpas__st_flight_airline_tmp_'+i).val(); var st_flight_type_tmp = jQuery('input[name=wpas__st_flight_type]:checked').val(); var st_flight_type_arr = st_flight_type_tmp.split("#"); var st_flight_type = st_flight_type_arr['1']; var st_flight_segment_type_tmp = jQuery('input[name=wpas__st_flight_segment_type_'+i+']:checked').val(); var st_flight_segment_type_arr = st_flight_segment_type_tmp.split("#"); var st_flight_segment_type = st_flight_segment_type_arr['1']; var st_flight_segment_id = jQuery('#wpas__st_flight_segment_id_'+i).val(); var st_flight_segment_remark = jQuery('#wpas__st_flight_segment_remark_'+i).val(); var st_flight_datetype_tmp = jQuery('#wpas__st_flight_datetype_'+i).val(); var st_flight_datetype_arr = st_flight_datetype_tmp.split("#"); var st_flight_datetype = st_flight_datetype_arr['0']; if(st_flight_datetype=='FD'){ var st_flight_segment_start = jQuery('#wpas__st_flight_segment_start_'+i).val(); var st_flight_segment_end = jQuery('#wpas__st_flight_segment_end_'+i).val(); }else{ var st_flight_segment_start = jQuery('#wpas__st_flight_segment_manualdate_start_'+i).val() +' '+ jQuery('#wpas__st_flight_segment_manualtime_start_'+i).val(); var st_flight_segment_end = jQuery('#wpas__st_flight_segment_manualdate_end_'+i).val() +' '+ jQuery('#wpas__st_flight_segment_manualtime_end_'+i).val(); } var wp_content = ''; var wp_excerp = ''; //** Nicht mehr erforderlich. /* if(i==0){ wp_content += ''+st_flight_type+'
'; } */ //wp_content += st_flight_segment_type+' ('+st_flight_segment_id+'): '+st_flight_origin_tmp+' ('+st_flight_segment_start+') nach '+st_flight_destination_tmp+' ('+st_flight_segment_end+') mit '+st_flight_airline_tmp; wp_content += ''+st_flight_segment_type+'
' wp_content += ''; wp_content += ''; wp_content += ''; wp_content += '
'+st_flight_segment_start+' ab '+st_flight_origin_tmp+' mit '+st_flight_airline_tmp+'
'+st_flight_segment_end+' an '+st_flight_destination_tmp+' '+st_flight_segment_id+'
'; if(st_flight_segment_remark!=''){ wp_content += '
'+st_flight_segment_remark+'
'; } wp_content += '
'; wp_excerp += st_flight_segment_type+' - '+st_flight_origin_tmp+' nach '+st_flight_destination_tmp+' mit '+st_flight_airline_tmp; var wp_title = st_flight_type+': '+st_flight_origin_tmp+' nach '+st_flight_destination_tmp+' mit '+st_flight_airline_tmp; if(st_flight_type!='' && st_flight_segment_type!='' && st_flight_segment_id!='' && st_flight_origin_tmp!='' && st_flight_segment_start!='' && st_flight_destination_tmp!='' && st_flight_segment_end!='' && st_flight_airline_tmp!='' && Content_wpas_cat_Flug==false){ if(i==0){ Content_wpas_message += '
Beförderung
'; //Content_wpas_excerp_flight += 'Beförderung: '; } Content_wpas_message += wp_content+'
'; Content_wpas_excerp_flight += wp_excerp; if(jQuery('.storno_subheadline_flight:visible').length!=parseInt(i)+1){ Content_wpas_excerp_flight += ' | '; } if(Content_wpas_title==''){ if(i==0){ Content_wpas_title += 'Beförderung - '; } Content_wpas_title += wp_title+' | '; }else{ if(i==0){Content_wpas_title += ', inkl. Beförderung';} } //Content_wpas_excerp_flight } if(jQuery('.storno_subheadline_flight:visible').length==parseInt(i)+1){ Content_wpas_cat_Flug=true; } } Content_wpas_cat_Flug_done = true; } console.log(wp_content); console.log(wp_title); console.log('.storno_subheadline_flight'); break; } }) //** UNTERKUNFT jQuery.each(st_wc_cat_arr_select, function( index, st_wc_cat_check ) { var st_wc_cat_tmp = st_wc_cat_check.val(); var st_wc_cat_val_arr = st_wc_cat_tmp.split("#"); var st_wc_cat = st_wc_cat_val_arr['1']; switch(st_wc_cat) { case 'Hotel': case 'Kreuzfahrtschiff': case 'Ferienwohnung': case 'Privat': var wpas__st_giata_hotel_val = jQuery('#wpas__st_giata_hotel').val(); console.log('wpas__st_giata_hotel_val: '+wpas__st_giata_hotel_val); console.log('Content_wpas_cat_Hotel: '+Content_wpas_cat_Hotel); if(Content_wpas_cat_Hotel==false && wpas__st_giata_hotel_val !=''){ console.log('wpas__st_giata_hotel_val: '+wpas__st_giata_hotel_val); if(wpas__st_giata_hotel_val=='0#0'){ var st_giata_hotel_manual = jQuery('#wpas__st_giata_hotel_manual').val(); var st_giata_hotel_desc_manual = jQuery('#wpas__st_giata_hotel_desc_manual' ).val(); var st_giata_type_tmp = jQuery('input[name=wpas__st_giata_type]:checked' ).val(); var st_giata_type_arr = st_giata_type_tmp.split("#"); var st_giata_type = st_giata_type_arr['1']; var st_giata_country = jQuery('#wpas__st_giata_country option:selected' ).text(); var st_giata_city = jQuery('#wpas__st_giata_city option:selected' ).text(); //jQuery( "#wpas_message" ).val( '
Unterkunft '+st_giata_type+'
'+st_giata_hotel_desc_manual ); //jQuery( "#wpas_title" ).val( st_giata_type+': '+st_giata_hotel_manual+' ('+st_giata_city+' - '+st_giata_country+')' ); tmp_message = '
Unterkunft '+st_giata_type+'
'+st_giata_hotel_desc_manual; tmp_title = st_giata_type+': '+st_giata_hotel_manual+' ('+st_giata_city+' - '+st_giata_country+')'; console.log('tmp_message: '+tmp_message); console.log('tmp_title '+tmp_title); } //Content_wpas_message += jQuery( "#wpas_message" ).val(); //Content_wpas_title = jQuery( "#wpas_title" ).val(); Content_wpas_message += tmp_message; Content_wpas_title += tmp_title; Content_wpas_cat_Hotel=true; } break; } }) //** EXTRAS jQuery.each(st_wc_cat_arr_select, function( index, st_wc_cat_check ) { var st_wc_cat_tmp = st_wc_cat_check.val(); var st_wc_cat_val_arr = st_wc_cat_tmp.split("#"); var st_wc_cat = st_wc_cat_val_arr['1']; switch(st_wc_cat) { case 'Zusatzleistung': case 'Mietwagen': case 'Eventticket': case 'Ausflug': case 'Transfer': console.log(jQuery('.storno_subheadline_extra').length); console.log("jQuery('.storno_subheadline_extra').length"); if(!Content_wpas_cat_Zusatzleistung_done){ for(let i=0; i < jQuery('.storno_subheadline_extra:visible').length; i++){ var st_extra_title = jQuery('#wpas__st_extra_title_'+i).val(); var st_extra_desc = jQuery('#wpas__st_extra_desc_'+i).val(); var st_extra_type_tmp = jQuery('input[name=wpas__st_extra_type_'+i+']:checked').val(); var st_extra_type_arr = st_extra_type_tmp.split("#"); var st_extra_type = st_extra_type_arr['1']; var st_extra_segment_start = jQuery('#wpas__st_extra_segment_start_'+i).val(); var st_extra_segment_end =jQuery('#wpas__st_extra_segment_end_'+i).val(); //var wp_content = ''+st_extra_type+' - '+st_extra_title+': ('+st_extra_segment_start+' - '+st_extra_segment_end+'): '+st_extra_desc; var wp_content = ''+st_extra_type+'
'; wp_content += st_extra_segment_start+' - '+st_extra_segment_end+'
'; wp_content += st_extra_title+'
'; wp_content += st_extra_desc; var wp_excerp = st_extra_type+' - '+st_extra_title; var wp_title = st_extra_type+': '+st_extra_title+': '+st_extra_desc; if(jQuery('.storno_subheadline_extra:visible').length==parseInt(i)+1){ if(jQuery('input[name="wpas__st_extra_segment_transfer[]"]').attr('checked')){ wp_content += '
Inklusive Transfer zur Unterkunft'; wp_title += ' Inklusive Transfer zur Unterkunft.'; } if(jQuery('input[name="wpas__st_extra_segment_train[]"]').attr('checked')){ wp_content += '
Inklusive Zug zum FLug'; wp_title += ' Inklusive Zug zum FLug.' } } if(st_extra_type!='' && st_extra_title!='' && st_extra_segment_start!='' && st_extra_segment_end!='' && st_extra_desc!='' && Content_wpas_cat_Zusatzleistung==false){ if(i==0){ Content_wpas_message += '
Extras
'; //Content_wpas_excerp_extra += 'Extras: '; } Content_wpas_message += wp_content+'
'; Content_wpas_excerp_extra += wp_excerp; if(jQuery('.storno_subheadline_extra:visible').length!=parseInt(i)+1){ Content_wpas_excerp_extra += ' | '; } if(Content_wpas_title==''){ if(i==0){ Content_wpas_title += 'Extras - '; } Content_wpas_title += wp_title+ ' | '; }else{ if(i==0){Content_wpas_title += ' und Extras';} } //Content_wpas_excerp_extra } if(jQuery('.storno_subheadline_extra:visible').length==parseInt(i)+1){ Content_wpas_cat_Zusatzleistung=true; } } Content_wpas_cat_Zusatzleistung_done = true } console.log(wp_content); console.log(wp_title); console.log('.storno_subheadline_extra'); break; } }) //************ /*OLD CRUISE*/ //************ /* jQuery.each(st_wc_cat_arr_select, function( index, st_wc_cat_check ) { var st_wc_cat_tmp = st_wc_cat_check.val(); var st_wc_cat_val_arr = st_wc_cat_tmp.split("#"); var st_wc_cat = st_wc_cat_val_arr['1']; switch(st_wc_cat) { case 'Kreuzfahrt': var st_cruise_ship_manual = jQuery('#wpas__st_cruise_ship_manual').val(); var st_cruise_country = jQuery('#wpas__st_cruise_country option:selected' ).text(); var st_cruise_city = jQuery('#wpas__st_cruise_city option:selected' ).text(); var st_cruise_title = st_cruise_ship_manual+' ('+st_cruise_city+' - '+st_cruise_country+')'; var st_cruise_desc = jQuery('#wpas__st_cruise_ship_desc_manual').val(); if(st_cruise_title!='' && st_cruise_desc!='' && Content_wpas_cat_Kreuzfahrt==false){ Content_wpas_message += '
Kreuzfahrt
'+st_cruise_title+': '+st_cruise_desc; if(Content_wpas_title==''){ Content_wpas_title += 'Kreuzfahrt: '+st_cruise_title; }else{ Content_wpas_title += ' und Kreuzfahrt'; } Content_wpas_cat_Kreuzfahrt=true; } break; } }) */ //************ /*OLD CRUISE*/ //************ if(Content_wpas_message==''){ Content_wpas_message = 'Unkategorisiert: Unkategorisiert'; } //** Override all previous/above Title construction Content_wpas_title = jQuery( "#wpas__st_wc_prodtitle" ).val(); if(Content_wpas_title==''){ Content_wpas_title = 'Unkategorisiert: Unkategorisiert'; } //Content_wpas_message += '
'+jQuery( "#wpas__st_giata_imagearray" ).val(); //Content_wpas_message += '
'+jQuery( '#wpas__st_wc_cat').val(); jQuery( "#wpas_message" ).val( Content_wpas_message ); jQuery( "#wpas_title" ).val( Content_wpas_title ); jQuery( "#wpas__st_flight_title" ).val( Content_wpas_excerp_flight ); jQuery( "#wpas__st_extra_title" ).val( Content_wpas_excerp_extra ); var Content_wpas_cats_clean = []; jQuery.each(Content_wpas_cats, function(i, e) { if (jQuery.inArray(e, Content_wpas_cats_clean) == -1) Content_wpas_cats_clean.push(e); }); Content_wpas_cats = Content_wpas_cats_clean.toString(); jQuery( '#wpas__st_wc_cat').val(Content_wpas_cats); console.log(jQuery( '#wpas__st_wc_cat').val()); console.log("jQuery( '#wpas__st_wc_cat').val()"); } function switch_headline_info() { jQuery("#wpas__st_wc_headline_flight_2_wrapper, #wpas__st_wc_headline_hotel_2_wrapper, #wpas__st_wc_headline_extra_2_wrapper").hide(); } function switch_prodtype_fields() { var st_wc_prodtype_tmp = jQuery('#wpas__st_wc_prodtype').val(); var st_wc_prodtype_arr = st_wc_prodtype_tmp.split("#"); var st_wc_prodtype = st_wc_prodtype_arr['0']; console.log(st_wc_prodtype); jQuery(".prod_switch").hide(); jQuery(".prod_switch input, .prod_switch select, .prod_switch textarea").prop( "disabled", true ); jQuery(".prod_switch.st_required input, .prod_switch.st_required select, .prod_switch.st_required textarea").prop( "required", false ); jQuery(".prod_"+st_wc_prodtype).show(); jQuery(".prod_"+st_wc_prodtype+" input, .prod_"+st_wc_prodtype+" select, .prod_"+st_wc_prodtype+" textarea").prop( "disabled", false ); jQuery(".prod_"+st_wc_prodtype+".st_required input, .prod_"+st_wc_prodtype+".st_required select, .prod_"+st_wc_prodtype+".st_required textarea").prop( "required", true ); } function switch_flight_datetype(i) { var st_flight_datetype_tmp = jQuery('#wpas__st_flight_datetype_'+i).val(); var st_flight_datetype_arr = st_flight_datetype_tmp.split("#"); var st_flight_datetype = st_flight_datetype_arr['0']; jQuery(".flight_datetype_switch_"+i).hide(); jQuery(".flight_datetype_switch_"+i+" input, .flight_datetype_switch_"+i+" select, .flight_datetype_switch_"+i+" textarea").prop( "disabled", true ); jQuery(".flight_datetype_switch_"+i+".st_required input, .flight_datetype_switch_"+i+".st_required select, .flight_datetype_switch_"+i+".st_required textarea").prop( "required", false ); jQuery(".flight_datetype_"+i+"_"+st_flight_datetype).show(); jQuery(".flight_datetype_"+i+"_"+st_flight_datetype+" input, .flight_datetype_"+i+"_"+st_flight_datetype+" select, .flight_datetype_"+i+"_"+st_flight_datetype+" textarea").prop( "disabled", false ); jQuery(".flight_datetype_"+i+"_"+st_flight_datetype+".st_required input, .flight_datetype_"+i+"_"+st_flight_datetype+".st_required select, .flight_datetype_"+i+"_"+st_flight_datetype+".st_required textarea").prop( "required", true ); } function switch_giata_type() { var st_giata_type_tmp = jQuery('input[type=radio][name=wpas__st_giata_type]:checked').val(); var st_giata_type_arr = st_giata_type_tmp.split("#"); var st_giata_type = st_giata_type_arr['0']; jQuery(".giata_type_switch").hide(); jQuery(".giata_type_switch input, .giata_type_switch select, .giata_type_switch textarea").prop( "disabled", true ); jQuery(".giata_type_switch.st_required input, .giata_type_switch.st_required select, .giata_type_switch.st_required textarea").prop( "required", false ); if(st_giata_type=='CR'){ jQuery(".giata_type_"+st_giata_type).show(); jQuery(".giata_type_"+st_giata_type+" input, .giata_type_"+st_giata_type+" select, .giata_type_"+st_giata_type+" textarea").prop( "disabled", false ); jQuery(".giata_type_"+st_giata_type+".st_required input, .giata_type_"+st_giata_type+".st_required select, .giata_type_"+st_giata_type+".st_required textarea").prop( "required", true ); } } function switch_cat_fields() { jQuery(".cat_switch").hide(); jQuery(".cat_switch input, .cat_switch select, .cat_switch textarea").prop( "disabled", true ); jQuery(".cat_switch.st_required input, .cat_switch.st_required select, .cat_switch.st_required textarea").prop( "required", false ); st_wc_cat_arr = new Array(); jQuery.each(jQuery('.st_wc_cat'), function( index, value ) { st_wc_cat_arr.push(jQuery(this).find('input').first()); }) jQuery.each(st_wc_cat_arr, function( index, st_wc_cat_check ) { var st_wc_cat_tmp = st_wc_cat_check.val(); var st_wc_cat_val_arr = st_wc_cat_tmp.split("#"); var st_wc_cat = st_wc_cat_val_arr['1']; if (jQuery(this).attr('checked')){ jQuery(".cat_"+st_wc_cat).show(); jQuery(".cat_"+st_wc_cat+" input, .cat_"+st_wc_cat+" select, .cat_"+st_wc_cat+" textarea").prop( "disabled", false ); jQuery(".cat_"+st_wc_cat+".st_required input, .cat_"+st_wc_cat+".st_required select, .cat_"+st_wc_cat+".st_required textarea").prop( "required", true ); if(st_wc_cat=='Hotel'){ switch_provider_fields(); switch_hotel_fields(); switch_giata_type(); } /* if(st_wc_cat=='Kreuzfahrt'){ switch_cruise_provider_fields(); switch_cruise_fields(); } */ if(st_wc_cat=='Flug'){ switch_flight_segments(1); } if(st_wc_cat=='Zusatzleistung'){ switch_extra_segments(1); } } }) Put_Title_Content(); switch_headline_info(); } function switch_provider_fields() { var st_giata_provider_manual_tmp = jQuery('#wpas__st_giata_provider').val(); var st_giata_provider_manual_arr = st_giata_provider_manual_tmp.split("#"); var st_giata_provider_manual = st_giata_provider_manual_arr['1']; if(st_giata_provider_manual=='0'){ jQuery("#wpas__st_giata_provider_manual_wrapper").show(); jQuery("#wpas__st_giata_provider_manual").prop( "disabled", false ); jQuery("#wpas__st_giata_provider_manual").prop( "required", true ); jQuery("#wpas__st_giata_providerlogo_manual_wrapper").show(); jQuery("#wpas__st_giata_providerlogo_manual").prop( "disabled", false ); jQuery("#wpas__st_giata_providerlogo_manual").prop( "required", true ); }else{ jQuery("#wpas__st_giata_provider_manual_wrapper").hide(); jQuery("#wpas__st_giata_provider_manual").prop( "disabled", true ); jQuery("#wpas__st_giata_provider_manual").prop( "required", false ); jQuery("#wpas__st_giata_providerlogo_manual_wrapper").hide(); jQuery("#wpas__st_giata_providerlogo_manual").prop( "disabled", true ); jQuery("#wpas__st_giata_providerlogo_manual").prop( "required", false ); jQuery("#wpas__st_giata_hotel_manual_wrapper").hide(); jQuery("#wpas__st_giata_hotel_manual").prop( "disabled", true ); jQuery("#wpas__st_giata_hotel_manual").prop( "required", false ); jQuery("#wpas__st_giata_hotel_desc_manual_wrapper").hide(); jQuery("#wpas__st_giata_hotel_desc_manual").prop( "disabled", true ); jQuery("#wpas__st_giata_hotel_desc_manual").prop( "required", false ); jQuery("#wpas__st_giata_imagearray_wrapper").hide(); jQuery("#wpas__st_giata_imagearray_wrapper").prop( "disabled", true ); jQuery("#wpas__st_giata_imagearray_wrapper").prop( "required", false ); } } function switch_hotel_fields() { var st_giata_hotel_manual_tmp = jQuery('#wpas__st_giata_hotel').val(); var st_giata_hotel_manual_arr = st_giata_hotel_manual_tmp.split("#"); var st_giata_hotel_manual = st_giata_hotel_manual_arr['1']; if(st_giata_hotel_manual=='0'){ jQuery("#wpas__st_giata_hotel_manual_wrapper").show(); jQuery("#wpas__st_giata_hotel_manual").prop( "disabled", false ); jQuery("#wpas__st_giata_hotel_manual").prop( "required", true ); jQuery("#wpas__st_giata_hotel_desc_manual_wrapper").show(); jQuery("#wpas__st_giata_hotel_desc_manual").prop( "disabled", false ); jQuery("#wpas__st_giata_hotel_desc_manual").prop( "required", true ); jQuery("#wpas__st_giata_imagearray_wrapper").val('').show(); }else{ jQuery("#wpas__st_giata_hotel_manual_wrapper").hide(); jQuery("#wpas__st_giata_hotel_manual").prop( "disabled", true ); jQuery("#wpas__st_giata_hotel_manual").prop( "required", false ); jQuery("#wpas__st_giata_hotel_desc_manual_wrapper").hide(); jQuery("#wpas__st_giata_hotel_desc_manual").prop( "disabled", true ); jQuery("#wpas__st_giata_hotel_desc_manual").prop( "required", false ); jQuery("#wpas__st_giata_imagearray_wrapper").hide(); } } //************ /*OLD CRUISE*/ //************ /* function switch_cruise_fields() { var st_cruise_ship_manual_tmp = jQuery('#wpas__st_cruise_ship').val(); var st_cruise_ship_manual_arr = st_cruise_ship_manual_tmp.split("#"); var st_cruise_ship_manual = st_cruise_ship_manual_arr['1']; if(st_cruise_ship_manual=='0'){ jQuery("#wpas__st_cruise_ship_manual_wrapper").show(); jQuery("#wpas__st_cruise_ship_manual").prop( "disabled", false ); jQuery("#wpas__st_cruise_ship_manual").prop( "required", true ); jQuery("#wpas__st_cruise_ship_desc_manual_wrapper").show(); jQuery("#wpas__st_cruise_ship_desc_manual").prop( "disabled", false ); jQuery("#wpas__st_cruise_ship_desc_manual").prop( "required", true ); }else{ jQuery("#wpas__st_cruise_ship_manual_wrapper").hide(); jQuery("#wpas__st_cruise_ship_manual").prop( "disabled", true ); jQuery("#wpas__st_cruise_ship_manual").prop( "required", false ); jQuery("#wpas__st_cruise_ship_desc_manual_wrapper").hide(); jQuery("#wpas__st_cruise_ship_desc_manual").prop( "disabled", true ); jQuery("#wpas__st_cruise_ship_desc_manual").prop( "required", false ); } } function switch_cruise_provider_fields() { var st_cruise_provider_manual_tmp = jQuery('#wpas__st_cruise_provider').val(); var st_cruise_provider_manual_arr = st_cruise_provider_manual_tmp.split("#"); var st_cruise_provider_manual = st_cruise_provider_manual_arr['1']; if(st_cruise_provider_manual=='0'){ jQuery("#wpas__st_cruise_provider_manual_wrapper").show(); jQuery("#wpas__st_cruise_provider_manual").prop( "disabled", false ); jQuery("#wpas__st_cruise_provider_manual").prop( "required", true ); }else{ jQuery("#wpas__st_cruise_provider_manual_wrapper").hide(); jQuery("#wpas__st_cruise_provider_manual").prop( "disabled", true ); jQuery("#wpas__st_cruise_provider_manual").prop( "required", false ); jQuery("#wpas__st_cruise_hotel_manual_wrapper").hide(); jQuery("#wpas__st_cruise_hotel_manual").prop( "disabled", true ); jQuery("#wpas__st_cruise_hotel_manual").prop( "required", false ); jQuery("#wpas__st_cruise_hotel_desc_manual_wrapper").hide(); jQuery("#wpas__st_cruise_hotel_desc_manual").prop( "disabled", true ); jQuery("#wpas__st_cruise_hotel_desc_manual").prop( "required", false ); } } */ //************ /*OLD CRUISE*/ //************ function switch_flight_segments(segments) { var seg_visible = jQuery('.storno_subheadline_flight:visible').length; var st_flight_type_tmp = jQuery('input[name=wpas__st_flight_type]:checked').val(); var st_flight_type_arr = st_flight_type_tmp.split("#"); var st_flight_type = st_flight_type_arr['0']; var iterator = 0; var minLimit = 1; console.log(seg_visible); console.log(segments); console.log('segments'); switch(segments) { case 'remove': iterator = seg_visible - 1; break; case 'add': iterator = seg_visible + 1; break; default: iterator = segments; } switch(st_flight_type) { case 'NO': jQuery('#segment_flight_btn').hide(); minLimit = 0; break; case 'OW': jQuery('#segment_flight_btn').hide(); minLimit = 1; break; case 'RT': jQuery('#segment_flight_btn').hide(); minLimit = 2; break; case 'MS': jQuery('#segment_flight_btn').show(); minLimit = 1; break; } if(iterator8){ iterator=8; } for(let i=0; i < 8; i++) { jQuery("#wpas__st_wc_subheadline_flight_"+i+"_wrapper").hide(); jQuery("#wpas__st_flight_segment_type_"+i+"_wrapper").hide(); jQuery('input[name=wpas__st_flight_segment_type_'+i+']').prop( "disabled", true ); jQuery('input[name=wpas__st_flight_segment_type_'+i+']').prop( "required", false ); jQuery("#wpas__st_flight_airline_tmp_"+i+"_wrapper").hide(); jQuery("#wpas__st_flight_airline_tmp_"+i).prop( "disabled", true ); jQuery("#wpas__st_flight_airline_tmp_"+i).prop( "required", false ); jQuery("#wpas__st_flight_segment_id_"+i+"_wrapper").hide(); jQuery("#wpas__st_flight_segment_id_"+i).prop( "disabled", true ); jQuery("#wpas__st_flight_segment_id_"+i).prop( "required", false ); jQuery("#wpas__st_flight_origin_tmp_"+i+"_wrapper").hide(); jQuery("#wpas__st_flight_origin_tmp_"+i).prop( "disabled", true ); jQuery("#wpas__st_flight_origin_tmp_"+i).prop( "required", false ); jQuery("#wpas__st_flight_destination_tmp_"+i+"_wrapper").hide(); jQuery("#wpas__st_flight_destination_tmp_"+i).prop( "disabled", true ); jQuery("#wpas__st_flight_destination_tmp_"+i).prop( "required", false ); jQuery("#wpas__st_flight_segment_start_"+i+"_wrapper").hide(); jQuery("#wpas__st_flight_segment_start_"+i).prop( "disabled", true ); jQuery("#wpas__st_flight_segment_start_"+i).prop( "required", false ); jQuery("#wpas__st_flight_segment_end_"+i+"_wrapper").hide(); jQuery("#wpas__st_flight_segment_end_"+i).prop( "disabled", true ); jQuery("#wpas__st_flight_segment_end_"+i).prop( "required", false ); jQuery("#wpas__st_flight_datetype_"+i+"_wrapper").hide(); jQuery("#wpas__st_flight_datetype_"+i).prop( "disabled", true ); jQuery("#wpas__st_flight_datetype_"+i).prop( "required", false ); jQuery("#wpas__st_flight_segment_remark_"+i+"_wrapper").hide(); jQuery("#wpas__st_flight_segment_remark_"+i).prop( "disabled", true ); jQuery("#wpas__st_flight_segment_remark_"+i).prop( "required", false ); jQuery("#wpas__st_flight_segment_manualdate_start_"+i+"_wrapper").hide(); jQuery("#wpas__st_flight_segment_manualdate_start_"+i).prop( "disabled", true ); jQuery("#wpas__st_flight_segment_manualdate_start_"+i).prop( "required", false ); jQuery("#wpas__st_flight_segment_manualtime_start_"+i+"_wrapper").hide(); jQuery("#wpas__st_flight_segment_manualtime_start_"+i).prop( "disabled", true ); jQuery("#wpas__st_flight_segment_manualtime_start_"+i).prop( "required", false ); jQuery("#wpas__st_flight_segment_manualdate_end_"+i+"_wrapper").hide(); jQuery("#wpas__st_flight_segment_manualdate_end_"+i).prop( "disabled", true ); jQuery("#wpas__st_flight_segment_manualdate_end_"+i).prop( "required", false ); jQuery("#wpas__st_flight_segment_manualtime_end_"+i+"_wrapper").hide(); jQuery("#wpas__st_flight_segment_manualtime_end_"+i).prop( "disabled", true ); jQuery("#wpas__st_flight_segment_manualtime_end_"+i).prop( "required", false ); } for(let i=0; i < iterator; i++) { jQuery("#wpas__st_wc_subheadline_flight_"+i+"_wrapper").show(); jQuery("#wpas__st_flight_segment_type_"+i+"_wrapper").show(); jQuery('input[name=wpas__st_flight_segment_type_'+i+']').prop( "disabled", false ); jQuery('input[name=wpas__st_flight_segment_type_'+i+']').prop( "required", true ); jQuery("#wpas__st_flight_airline_tmp_"+i+"_wrapper").show(); jQuery("#wpas__st_flight_airline_tmp_"+i).prop( "disabled", false ); jQuery("#wpas__st_flight_airline_tmp_"+i).prop( "required", true ); jQuery("#wpas__st_flight_segment_id_"+i+"_wrapper").show(); jQuery("#wpas__st_flight_segment_id_"+i).prop( "disabled", false ); jQuery("#wpas__st_flight_segment_id_"+i).prop( "required", true ); jQuery("#wpas__st_flight_origin_tmp_"+i+"_wrapper").show(); jQuery("#wpas__st_flight_origin_tmp_"+i).prop( "disabled", false ); jQuery("#wpas__st_flight_origin_tmp_"+i).prop( "required", true ); jQuery("#wpas__st_flight_destination_tmp_"+i+"_wrapper").show(); jQuery("#wpas__st_flight_destination_tmp_"+i).prop( "disabled", false ); jQuery("#wpas__st_flight_destination_tmp_"+i).prop( "required", true ); jQuery("#wpas__st_flight_segment_start_"+i+"_wrapper").show(); jQuery("#wpas__st_flight_segment_start_"+i).prop( "disabled", false ); jQuery("#wpas__st_flight_segment_start_"+i).prop( "required", true ); jQuery("#wpas__st_flight_segment_end_"+i+"_wrapper").show(); jQuery("#wpas__st_flight_segment_end_"+i).prop( "disabled", false ); jQuery("#wpas__st_flight_segment_end_"+i).prop( "required", true ); jQuery("#wpas__st_flight_datetype_"+i+"_wrapper").show(); jQuery("#wpas__st_flight_datetype_"+i).prop( "disabled", false ); jQuery("#wpas__st_flight_datetype_"+i).prop( "required", true ); jQuery("#wpas__st_flight_segment_remark_"+i+"_wrapper").show(); jQuery("#wpas__st_flight_segment_remark_"+i).prop( "disabled", false ); jQuery("#wpas__st_flight_segment_remark_"+i).prop( "required", true ); jQuery("#wpas__st_flight_segment_manualdate_start_"+i+"_wrapper").show(); jQuery("#wpas__st_flight_segment_manualdate_start_"+i).prop( "disabled", false ); jQuery("#wpas__st_flight_segment_manualdate_start_"+i).prop( "required", true ); jQuery("#wpas__st_flight_segment_manualtime_start_"+i+"_wrapper").show(); jQuery("#wpas__st_flight_segment_manualtime_start_"+i).prop( "disabled", false ); jQuery("#wpas__st_flight_segment_manualtime_start_"+i).prop( "required", true ); jQuery("#wpas__st_flight_segment_manualdate_end_"+i+"_wrapper").show(); jQuery("#wpas__st_flight_segment_manualdate_end_"+i).prop( "disabled", false ); jQuery("#wpas__st_flight_segment_manualdate_end_"+i).prop( "required", true ); jQuery("#wpas__st_flight_segment_manualtime_end_"+i+"_wrapper").show(); jQuery("#wpas__st_flight_segment_manualtime_end_"+i).prop( "disabled", false ); jQuery("#wpas__st_flight_segment_manualtime_end_"+i).prop( "required", true ); switch_flight_datetype(i); } } function switch_extra_segments(segments) { var seg_visible = jQuery('.storno_subheadline_extra:visible').length; var iterator = 0; console.log(seg_visible); console.log(segments); console.log('segments'); switch(segments) { case 'remove': iterator = seg_visible - 1; break; case 'add': iterator = seg_visible + 1; break; default: iterator = segments; } if(iterator<1){ iterator=1; }else if(iterator>6){ iterator=6; } for(let i=0; i < 8; i++) { jQuery("#wpas__st_wc_subheadline_zusatzleistung_"+i+"_wrapper").hide(); jQuery("#wpas__st_extra_type_"+i+"_wrapper").hide(); //'input[name=wpas__st_extra_type_'+i+']' jQuery('input[name=wpas__st_extra_type_'+i+']').prop( "disabled", true ); jQuery('input[name=wpas__st_extra_type_'+i+']').prop( "required", false ); jQuery("#wpas__st_extra_segment_start_"+i+"_wrapper").hide(); jQuery("#wpas__st_extra_segment_start_"+i).prop( "disabled", true ); jQuery("#wpas__st_extra_segment_start_"+i).prop( "required", false ); jQuery("#wpas__st_extra_segment_end_"+i+"_wrapper").hide(); jQuery("#wpas__st_extra_segment_end_"+i).prop( "disabled", true ); jQuery("#wpas__st_extra_segment_end_"+i).prop( "required", false ); jQuery("#wpas__st_extra_title_"+i+"_wrapper").hide(); jQuery("#wpas__st_extra_title_"+i).prop( "disabled", true ); jQuery("#wpas__st_extra_title_"+i).prop( "required", false ); jQuery("#wpas__st_extra_desc_"+i+"_wrapper").hide(); jQuery("#wpas__st_extra_desc_"+i).prop( "disabled", true ); jQuery("#wpas__st_extra_desc_"+i).prop( "required", false ); } for(let i=0; i < iterator; i++) { jQuery("#wpas__st_wc_subheadline_zusatzleistung_"+i+"_wrapper").show(); jQuery("#wpas__st_extra_type_"+i+"_wrapper").show(); jQuery('input[name=wpas__st_extra_type_'+i+']').prop( "disabled", false ); jQuery('input[name=wpas__st_extra_type_'+i+']').prop( "required", true ); jQuery("#wpas__st_extra_segment_start_"+i+"_wrapper").show(); jQuery("#wpas__st_extra_segment_start_"+i).prop( "disabled", false ); jQuery("#wpas__st_extra_segment_start_"+i).prop( "required", true ); jQuery("#wpas__st_extra_segment_end_"+i+"_wrapper").show(); jQuery("#wpas__st_extra_segment_end_"+i).prop( "disabled", false ); jQuery("#wpas__st_extra_segment_end_"+i).prop( "required", true ); jQuery("#wpas__st_extra_title_"+i+"_wrapper").show(); jQuery("#wpas__st_extra_title_"+i).prop( "disabled", false ); jQuery("#wpas__st_extra_title_"+i).prop( "required", true ); jQuery("#wpas__st_extra_desc_"+i+"_wrapper").show(); jQuery("#wpas__st_extra_desc_"+i).prop( "disabled", false ); jQuery("#wpas__st_extra_desc_"+i).prop( "required", true ); } } /******* ** Author: Aris 2018 ** Web: Travelator.tv *******/ jQuery(document).ready(function($) { //$("#wpas-new-ticket").submit(function(e){ // e.preventDefault(); //}); //********************* //GENERAL POST HANDLING //********************* $('#wpas__st_wc_sale_valid').datetimepicker({ format:'d.m.Y', minDate:'-1970/01/02', timepicker:false }); $('#wpas__st_wc_date_start').datetimepicker({ format:'d.m.Y', onSelectDate:function(){ $( "#wpas__st_wc_date_end" ).focus(); }, minDate:'-1970/01/02', timepicker:false }); $('#wpas__st_wc_date_end').datetimepicker({ format:'d.m.Y', minDate:'-1970/01/02', onShow:function( ct ){ this.setOptions({ minDate:$('#wpas__st_wc_date_start').val()?$('#wpas__st_wc_date_start').val():false }) }, timepicker:false }); $('#wpas__st_wc_season_start').datetimepicker({ format:'d.m.Y', onSelectDate:function(){ $( "#wpas__st_wc_season_end" ).focus(); }, minDate:'-1970/01/02', timepicker:false }); $('#wpas__st_wc_season_end').datetimepicker({ format:'d.m.Y', minDate:'-1970/01/02', onShow:function( ct ){ this.setOptions({ minDate:$('#wpas__st_wc_season_start').val()?$('#wpas__st_wc_season_start').val():false }) }, timepicker:false }); for(let i=0; i < $('.storno_subheadline_flight').length; i++){ $('#wpas__st_flight_segment_start_'+i).datetimepicker({ format:'d.m.Y H:i', onSelectTime:function(){ $( "#wpas__st_flight_segment_end_"+i ).focus(); }, minDate:'-1970/01/02' }); $('#wpas__st_flight_segment_end_'+i).datetimepicker({ format:'d.m.Y H:i', minDate:'-1970/01/02', onShow:function( ct ){ this.setOptions({ minDate: $('#wpas__st_flight_segment_start_'+i).val() ? $('#wpas__st_flight_segment_start_'+i).val():false }) } }); } for(let i=0; i < $('.storno_subheadline_extra').length; i++){ $('#wpas__st_extra_segment_start_'+i).datetimepicker({ format:'d.m.Y H:i', onSelectTime:function(){ $( "#wpas__st_extra_segment_end_"+i ).focus(); }, minDate:'-1970/01/02' }); $('#wpas__st_extra_segment_end_'+i).datetimepicker({ format:'d.m.Y H:i', minDate:'-1970/01/02', onShow:function( ct ){ this.setOptions({ minDate: $('#wpas__st_extra_segment_start_'+i).val() ? $('#wpas__st_extra_segment_start_'+i).val():false }) } }); } // SET DEFAULT RADIOS $( "#wpas__st_wc_prodtype").val("SA#Storno"); $( "#wpas__st_wc_triptype").val("PAR#Pauschalreise"); $( "#wpas__st_wc_prodpricetype" ).val('PI#Gesamtpreis'); $( "#wpas__st_flight_type-option4" ).attr('checked',true); $( "#wpas__st_giata_type-option1" ).attr('checked',true).change(); $( "#wpas__st_extra_type-option3" ).attr('checked',true); for(let i=0; i < $('.storno_subheadline_flight').length; i++){ var flug = $('input[name=wpas__st_flight_segment_type_'+i+']')[0]; $(flug).attr('checked', true); $('#wpas__st_flight_datetype_'+i).val('FD#FesteReisedaten'); } for(let i=0; i < $('.storno_subheadline_extra').length; i++){ var ausflug = $('input[name=wpas__st_extra_type_'+i+']')[2]; $(ausflug).attr('checked', true); } //ADD BTNs $('
Abschnitt entfernen
 
Abschnitt hinzufügen
').insertBefore( "#wpas__st_wc_headline_hotel_wrapper" ); $('#flight_segment_remove').click(function(){ switch_flight_segments('remove'); }) $('#flight_segment_add').click(function(){ switch_flight_segments('add'); }) $(".wpas-submission-form-inside-after-subject").first().append('
Zusatzleistung entfernen
 
Zusatzleistung hinzufügen
'); $('#extra_segment_remove').click(function(){ switch_extra_segments('remove'); }) $('#extra_segment_add').click(function(){ switch_extra_segments('add'); }) $("#wpas__st_wc_headline_general_wrapper label, #wpas__st_wc_headline_category_wrapper label, #wpas__st_wc_headline_flight_wrapper label, #wpas__st_wc_headline_hotel_wrapper label, #wpas__st_wc_headline_extra_wrapper label").prepend('i'); $('#wpas__st_wc_headline_general_wrapper label').click(function(){ $( "#wpas__st_wc_headline_general_2_wrapper" ).toggle(); }) $('#wpas__st_wc_headline_category_wrapper label').click(function(){ $( "#wpas__st_wc_headline_category_2_wrapper" ).toggle(); }) $('#wpas__st_wc_headline_flight_wrapper label').click(function(){ $( "#wpas__st_wc_headline_flight_2_wrapper" ).toggle(); }) $('#wpas__st_wc_headline_hotel_wrapper label').click(function(){ $( "#wpas__st_wc_headline_hotel_2_wrapper" ).toggle(); }) $('#wpas__st_wc_headline_extra_wrapper label').click(function(){ $( "#wpas__st_wc_headline_extra_2_wrapper" ).toggle(); }) $('input[name=wpas__st_flight_type]').change(function() { var st_flight_type_arr = this.value.split("#"); var st_flight_type = st_flight_type_arr['0']; switch(st_flight_type) { case 'NO': switch_flight_segments(0); break; case 'OW': switch_flight_segments(1); break; case 'RT': switch_flight_segments(2); break; case 'MS': switch_flight_segments(1); break; } }); if($('.st_wc_cat').length) { //EVENT SHOW HIDE INVENTORY $.each($('.st_wc_cat'), function( index, value ) { $(this).find('input').first().on('change', function () { switch_cat_fields(); }).change(); }); }else{console.log('Laufzeitfehler .st_wc_cat');} if($('#wpas__st_wc_cats').length) { $('#wpas__st_wc_cat').on('change', function() { $('#wpas__st_wc_cat').val($( "#wpas__st_wc_cats" ).val()); }) }else{console.log('Laufzeitfehler #wpas__st_wc_cats');} if($('#wpas__st_wc_prodtype').length) { //EVENT SWITCH PRODTYPE $('#wpas__st_wc_prodtype').change(function() { switch_prodtype_fields(); }).change(); }else{console.log('Laufzeitfehler #wpas__st_wc_prodtype');} //************ /*OLD CRUISE*/ //************ /* if($('#wpas__st_cruise_ship_manual').length) { $("#wpas__st_cruise_ship_manual").bind('blur keyup',function(e) { if (e.type === 'blur' || e.keyCode === 13){ var st_cruise_ship_manual = $('#wpas__st_cruise_ship_manual').val(); var st_cruise_country = $('#wpas__st_cruise_country option:selected' ).text(); var st_cruise_city = $('#wpas__st_cruise_city option:selected' ).text(); $( "#wpas_title" ).val( 'Kreuzfahrt: '+st_cruise_ship_manual+' ('+st_cruise_city+' - '+st_cruise_country+')' ); $( "#wpas__st_cruise_ship" ).val( '0#0' ); } }) }else{console.log('Laufzeitfehler #wpas__st_cruise_ship_manual');} if($('#wpas__st_cruise_ship_desc_manual').length) { $("#wpas__st_cruise_ship_desc_manual").bind('blur keyup',function(e) { if (e.type === 'blur' || e.keyCode === 13){ var st_cruise_ship_desc_manual = $('#wpas__st_cruise_ship_desc_manual' ).val(); $( "#wpas_message" ).val( '
Kreuzfahrt
'+st_cruise_ship_desc_manual ); $( "#wpas__st_cruise_imagearray" ).val( '' ); Put_Title_Content(); } }) }else{console.log('Laufzeitfehler #wpas__st_cruise_ship_desc_manual');} if($('#wpas__st_cruise_provider_manual').length) { $( "#wpas__st_cruise_provider_manual" ).blur(function() { var val_tmp =$( "#wpas__st_cruise_provider_manual" ).val(); $( "#wpas__st_cruise_operator" ).val( '0#0' ); }); }else{console.log('Laufzeitfehler #wpas__st_cruise_provider_manual');} */ //************ /*OLD CRUISE*/ //************ //************ //EXTRA FIELDS //************ for(let i=0; i < jQuery('.storno_subheadline_extra').length; i++){ if($('#wpas__st_extra_desc_'+i).length) { //EVENT SET TITLE ON INPUT $("#wpas__st_extra_desc_"+i).bind('blur keyup',function(e) { if (e.type === 'blur' || e.keyCode === 13){ Put_Title_Content(); } }) }else{console.log('Laufzeitfehler #wpas__st_extra_desc_'+i);} if($('#wpas__st_extra_title_'+i).length) { //EVENT SET TITLE ON INPUT $("#wpas__st_extra_title_"+i).bind('blur keyup',function(e) { if (e.type === 'blur' || e.keyCode === 13){ Put_Title_Content(); } }) }else{console.log('Laufzeitfehler #wpas__st_extra_title_'+i);} if($('#wpas__st_extra_segment_end_'+i).length) { //EVENT SWITCH DATETYPE FIELDS $('#wpas__st_extra_segment_end_'+i).change(function() { Put_Title_Content(); }) }else{console.log('Laufzeitfehler #wpas__st_extra_segment_end_'+i);} if($('#wpas__st_extra_segment_start_'+i).length) { //EVENT SWITCH DATETYPE FIELDS $('#wpas__st_extra_segment_start_'+i).change(function() { Put_Title_Content(); }) }else{console.log('Laufzeitfehler #wpas__st_extra_segment_start_'+i);} if($('input[type=radio][name=wpas__st_extra_type_'+i+']').length) { //EVENT SWITCH DATETYPE FIELDS $('input[type=radio][name=wpas__st_extra_type_'+i+']').change(function() { Put_Title_Content(); }); }else{console.log('Laufzeitfehler input[type=radio][name=wpas__st_extra_type_'+i+']');} } //************ //GIATA FIELDS //************ if($('#wpas__st_wc_prodtitle').length) { //EVENT SET TITLE ON INPUT $("#wpas__st_wc_prodtitle").bind('blur keyup',function(e) { if (e.type === 'blur' || e.keyCode === 13){ Put_Title_Content(); } }) }else{console.log('Laufzeitfehler #wpas__st_wc_prodtitle');} if($('#wpas__st_giata_hotel_manual').length) { //EVENT SET TITLE ON INPUT $("#wpas__st_giata_hotel_manual").bind('blur keyup',function(e) { if (e.type === 'blur' || e.keyCode === 13){ Put_Title_Content(); } }) }else{console.log('Laufzeitfehler #wpas__st_giata_hotel_manual');} if($('#wpas__st_giata_hotel_desc_manual').length) { //EVENT SET MESSAGE ON INPUT $("#wpas__st_giata_hotel_desc_manual").bind('blur keyup',function(e) { if (e.type === 'blur' || e.keyCode === 13){ Put_Title_Content(); } }) }else{console.log('Laufzeitfehler #wpas__st_giata_hotel_desc_manual');} if($('#wpas__st_giata_provider_manual').length) { //EVENT SET MANUAL OPERATOR $( "#wpas__st_giata_provider_manual" ).blur(function() { var val_tmp =$( "#wpas__st_giata_provider_manual" ).val(); $( "#wpas__st_giata_operator" ).val( '0#'+val_tmp ); }); }else{console.log('Laufzeitfehler #wpas__st_giata_provider_manual');} if($('input[type=radio][name=wpas__st_giata_type]').length) { $('input[type=radio][name=wpas__st_giata_type]').change(function() { if (this.value == 'AP#Ferienwohnung' || this.value == 'PR#Privat') { if(($("#wpas__st_giata_hotel option[value='0#0']").length == 0)){ $('#wpas__st_giata_hotel').append($('