Changeset 3488696
- Timestamp:
- 03/23/2026 08:36:05 AM (11 days ago)
- Location:
- travelmanager-buchungssoftware/trunk
- Files:
-
- 2 edited
-
index.php (modified) (1 diff)
-
js/functions-tm.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
travelmanager-buchungssoftware/trunk/index.php
r3486421 r3488696 4 4 Plugin URI: https://travelmanager.de/support/wordpress/ 5 5 Description: Inhalte aus der Travelmanager, Tickyt Buchungssoftware und Gastrozack Gastrokasse direkt in WordPress einbinden 6 Version: 22.3 46 Version: 22.35 7 7 Author: Philipp Stäbler 8 8 Text Domain: travelmanager -
travelmanager-buchungssoftware/trunk/js/functions-tm.js
r3486155 r3488696 44 44 }); 45 45 46 function travelmanagerKalenderInfotextOpen(){ 47 if($(".eventcalendar.godirect").length>0){ 48 return true; 49 } 50 $.each($("div.eventycalendar div.eventlink[infotext]"),function(){ 51 var div = $(this); 52 var href = $(div).find("a").attr("href"); 53 54 $(this).on("click",function(){ 55 var title=decodeURIComponent($(div).attr("headline")); 56 var infotext=decodeURIComponent($(div).attr("infotext")); 57 58 infotext+="<br><br><center><a href='"+href+"' target='_blank' class='button'>Jetzt buchen</a></center>"; 59 60 showDialog(title,infotext); 61 return false; 62 }); 63 }); 64 } 65 66 function loadListCategorie(obj){ 67 var container = $(obj).closest(".listcategories"); 68 var linie_typ_id = $(container).find(".linientyp_id").val(); 69 var ts = $(container).find(".monat").val(); 70 var data = {}; 71 data["linie_typ_id"] = linie_typ_id; 72 data["ts"] = ts; 73 data["action"] = 'travelmanager_listcategories'; 74 data["hash"]=jQuery(container).attr("hash"); 75 76 jQuery.blockUI({ message: dialoge["inhalt_laden"]+'...'}); 46 })(jQuery); 47 48 function TMchangeMonth(obj){ 49 var data = {}; 50 data["extra_months"] = jQuery(obj).closest(".eventycalendar").find("select.zeitraum").val(); 51 data["action"] = 'travelmanager_eventcalendar'; 52 data["hash"]=jQuery(obj).closest(".eventycalendar").attr("hash"); 53 data["station_id"] = jQuery(obj).closest(".eventycalendar").find("select.station").val(); 54 data["category_id"] = jQuery(obj).closest(".eventycalendar").find("select.category").val(); 55 56 try { 57 clearTimeout(myTimeout); 58 } 59 catch (e) {} 60 61 jQuery.blockUI({ message: dialoge["inhalt_laden"]+'...'}); 62 myTimeout = setTimeout(function(){ 77 63 jQuery.post(ajaxurl, data, function(response) { 78 64 jQuery.unblockUI(); 79 65 if(response.html){ 80 var html = response.html; 81 html+="<div class='wp-block-columns'>"; 82 html+="<div class='wp-block-column'>"; 83 //Allow Prev Button 84 if($(obj).closest(".listcategories").find(".monat").find("option:selected").prev().length==1){ 85 html+="<button class='button' onclick='listCategorieJump(this,false);'>Zurück</button>"; 66 jQuery(obj).closest(".eventycalendar").find(".calendercontainer").html(response.html); 67 68 travelmanagerKalenderInfotextOpen(); 69 } 70 }); 71 72 }, 20); 73 } 74 75 76 function travelmanagerKalenderInfotextOpen(){ 77 if(jQuery(".eventcalendar.godirect").length>0){ 78 return true; 79 } 80 jQuery.each(jQuery("div.eventycalendar div.eventlink[infotext]"),function(){ 81 var div = jQuery(this); 82 var href = jQuery(div).find("a").attr("href"); 83 84 jQuery(this).on("click",function(){ 85 var title=decodeURIComponent(jQuery(div).attr("headline")); 86 var infotext=decodeURIComponent(jQuery(div).attr("infotext")); 87 88 infotext+="<br><br><center><a href='"+href+"' target='_blank' class='button'>"+dialoge["jetzt_buchen"]+"</a></center>"; 89 90 showDialog(title,infotext); 91 return false; 92 }); 93 }); 94 } 95 96 function showDialog(title, vMeldung, onclose, optionalButton) { 97 if (jQuery(".dialog_meldung_popup").length == 0) { 98 var vObj = jQuery('<div class="dialog_meldung_popup"></div>'); 99 } else { 100 var vObj = jQuery(".dialog_meldung_popup"); 101 } 102 if (typeof vMeldung === 'object') { 103 jQuery(vObj).append(vMeldung); 104 var vDestroy = false; 105 } else { 106 jQuery(vObj).html(vMeldung); 107 var vDestroy = true; 108 } 109 110 var width = jQuery(window).width(); 111 if (width > 880) { 112 width = 880; 113 } else if (width > 480) { 114 width = 480; 115 } 116 117 var height = jQuery(window).height(); 118 if (height > 580) { 119 height = 580; 120 } 121 122 var vIntervall; 123 124 jQuery(vObj).dialog({ 125 height: height, 126 width: width, 127 title: title, 128 position: { 129 my: "center", 130 at: "center", 131 of: window 132 }, 133 modal: true, 134 buttons: { 135 "Close": { 136 text: dialoge["schliessen"], 137 click: function () { 138 jQuery(this).dialog("close"); 139 }, 140 class: "ui-button-left" 141 }, 142 ...(optionalButton ? { 143 "Optional": { 144 text: optionalButton.text, 145 click: optionalButton.action, 146 class: "ui-button-right" 86 147 } 87 html+="</div>"; 88 html+="<div class='wp-block-column text-right'>"; 89 html+="<button class='button' onclick='listCategorieJump(this,true);'>Weiter</button>"; 90 html+="</div>"; 91 html+="</div>"; 92 93 jQuery(container).find(".fahrplan").html(html); 94 } 95 }); 96 } 97 function listCategorieJump(obj,forward){ 98 99 var select = $(obj).closest(".listcategories").find(".monat"); 100 101 if(forward){ 102 var option = $(select).find("option:selected").next(); 103 } 104 else{ 105 var option = $(select).find("option:selected").prev(); 106 } 107 108 $(select).val($(option).attr('value')); 109 loadListCategorie(obj); 110 } 111 112 function showDialogListCategorie(obj){ 113 var title=decodeURIComponent($(obj).attr("linie")); 114 var infotext=decodeURIComponent($(obj).attr("infotext")); 115 infotext+="<div class='text-center buchung'><a href='"+$(obj).attr("href")+"' class='button buttonbuchung'>Buchen</a></div>"; 116 showDialog(title,infotext); 117 } 118 119 function showDialogTimetableList(title,content,bookingLink=""){ 120 121 if(bookingLink!==""){ 122 var button = { 123 text: dialoge["jetzt_buchen"], 124 action: function () { 125 window.location.href=bookingLink; 126 } 127 } 128 } 129 else{ 130 var button = null; 131 } 132 showDialog(title, content, null, button); 133 134 } 135 136 function showDialog(title, vMeldung, onclose, optionalButton) { 137 if ($(".dialog_meldung_popup").length == 0) { 138 var vObj = $('<div class="dialog_meldung_popup"></div>'); 139 } else { 140 var vObj = $(".dialog_meldung_popup"); 141 } 142 if (typeof vMeldung === 'object') { 143 $(vObj).append(vMeldung); 144 var vDestroy = false; 145 } else { 146 $(vObj).html(vMeldung); 147 var vDestroy = true; 148 } 149 150 var width = $(window).width(); 151 if (width > 880) { 152 width = 880; 153 } else if (width > 480) { 154 width = 480; 155 } 156 157 var height = $(window).height(); 158 if (height > 580) { 159 height = 580; 160 } 161 162 var vIntervall; 163 164 $(vObj).dialog({ 165 height: height, 166 width: width, 167 title: title, 168 position: { 169 my: "center", 170 at: "center", 171 of: window 172 }, 173 modal: true, 174 buttons: { 175 "Close": { 176 text: dialoge["schliessen"], 177 click: function () { 178 $(this).dialog("close"); 179 }, 180 class: "ui-button-left" 181 }, 182 ...(optionalButton ? { 183 "Optional": { 184 text: optionalButton.text, 185 click: optionalButton.action, 186 class: "ui-button-right" 187 } 188 } : {}) 189 }, 190 open: function (event, ui) { 191 $("body").css({ overflow: 'hidden' }); 192 $(".ui-dialog-content").scrollTop(0); 193 }, 194 close: function (event, ui) { 195 clearInterval(vIntervall); 196 $("body").css({ overflow: 'inherit' }); 197 198 if (vDestroy == true) { 199 $(this).remove(); 200 } 201 202 if (onclose != undefined) { 203 eval(onclose); 204 } 205 } 206 }); 207 } 208 209 210 211 function TMchangeMonth(obj){ 212 var data = {}; 213 data["extra_months"] = $(obj).closest(".eventycalendar").find("select.zeitraum").val(); 214 data["action"] = 'travelmanager_eventcalendar'; 215 data["hash"]=jQuery(obj).closest(".eventycalendar").attr("hash"); 216 data["station_id"] = $(obj).closest(".eventycalendar").find("select.station").val(); 217 data["category_id"] = $(obj).closest(".eventycalendar").find("select.category").val(); 218 219 try { 220 clearTimeout(myTimeout); 221 } 222 catch (e) {} 223 224 jQuery.blockUI({ message: dialoge["inhalt_laden"]+'...'}); 225 myTimeout = setTimeout(function(){ 226 jQuery.post(ajaxurl, data, function(response) { 227 jQuery.unblockUI(); 228 if(response.html){ 229 jQuery(obj).closest(".eventycalendar").find(".calendercontainer").html(response.html); 230 231 travelmanagerKalenderInfotextOpen(); 232 } 233 }); 234 235 }, 20); 236 } 237 238 function TMFindenInteraktiv(obj){ 239 var data = {}; 240 data["data"] = $(obj).closest("form").serialize(); 241 data["action"] = 'travelmanager_list'; 242 data["hash"]=$(obj).attr("hash"); 243 244 try { 245 clearTimeout(myTimeout); 246 } 247 catch (e) {} 248 249 jQuery.blockUI({ message: dialoge["inhalt_laden"]+'...'}); 250 myTimeout = setTimeout(function(){ 251 jQuery.post(ajaxurl, data, function(response) { 252 jQuery.unblockUI(); 253 if(response.html){ 254 jQuery(obj).closest(".listcontainer").find(".suchergebnis").html(response.html); 255 } 256 }); 257 258 }, 20); 259 } 260 261 function TMFindenTabs(obj){ 262 263 var data = {}; 264 data["linie_typ_id"] = $(obj).closest(".containerfind").find("[name='linie_typ_id']").val(); 265 data["action"] = 'travelmanager_tabs'; 266 data["hash"]=$(obj).attr("hash"); 267 268 try { 269 clearTimeout(myTimeout); 270 } 271 catch (e) {} 272 273 jQuery.blockUI({ message: dialoge["inhalt_laden"]+'...'}); 274 myTimeout = setTimeout(function(){ 275 jQuery.post(ajaxurl, data, function(response) { 276 277 //Objekt leeren 278 $(obj).closest(".containerfind").find( '.findencontainer' ).html(""); 279 280 281 jQuery.unblockUI(); 282 if(response.html){ 283 $(obj).closest(".containerfind").find(".findencontainer").html(response.html); 284 285 //Tabs initialisieren 286 $(obj).closest(".containerfind").find( '.jqueryuitabs' ).tabs(); 287 } 288 }); 289 290 }, 20); 291 } 292 293 })(jQuery); 148 } : {}) 149 }, 150 open: function (event, ui) { 151 jQuery("body").css({ overflow: 'hidden' }); 152 jQuery(".ui-dialog-content").scrollTop(0); 153 }, 154 close: function (event, ui) { 155 clearInterval(vIntervall); 156 jQuery("body").css({ overflow: 'inherit' }); 157 158 if (vDestroy == true) { 159 jQuery(this).remove(); 160 } 161 162 if (onclose != undefined) { 163 eval(onclose); 164 } 165 } 166 }); 167 } 168 169 170 function loadListCategorie(obj){ 171 var container = jQuery(obj).closest(".listcategories"); 172 var linie_typ_id = jQuery(container).find(".linientyp_id").val(); 173 var ts = jQuery(container).find(".monat").val(); 174 var data = {}; 175 data["linie_typ_id"] = linie_typ_id; 176 data["ts"] = ts; 177 data["action"] = 'travelmanager_listcategories'; 178 data["hash"]=jQuery(container).attr("hash"); 179 180 jQuery.blockUI({ message: dialoge["inhalt_laden"]+'...'}); 181 jQuery.post(ajaxurl, data, function(response) { 182 jQuery.unblockUI(); 183 if(response.html){ 184 var html = response.html; 185 html+="<div class='wp-block-columns'>"; 186 html+="<div class='wp-block-column'>"; 187 //Allow Prev Button 188 if(jQuery(obj).closest(".listcategories").find(".monat").find("option:selected").prev().length==1){ 189 html+="<button class='button' onclick='listCategorieJump(this,false);'>Zurück</button>"; 190 } 191 html+="</div>"; 192 html+="<div class='wp-block-column text-right'>"; 193 html+="<button class='button' onclick='listCategorieJump(this,true);'>Weiter</button>"; 194 html+="</div>"; 195 html+="</div>"; 196 197 jQuery(container).find(".fahrplan").html(html); 198 } 199 }); 200 } 201 function listCategorieJump(obj,forward){ 202 203 var select = jQuery(obj).closest(".listcategories").find(".monat"); 204 205 if(forward){ 206 var option = jQuery(select).find("option:selected").next(); 207 } 208 else{ 209 var option = jQuery(select).find("option:selected").prev(); 210 } 211 212 jQuery(select).val(jQuery(option).attr('value')); 213 loadListCategorie(obj); 214 } 215 216 function showDialogListCategorie(obj){ 217 var title=decodeURIComponent(jQuery(obj).attr("linie")); 218 var infotext=decodeURIComponent(jQuery(obj).attr("infotext")); 219 infotext+="<div class='text-center buchung'><a href='"+jQuery(obj).attr("href")+"' class='button buttonbuchung'>Buchen</a></div>"; 220 showDialog(title,infotext); 221 } 222 223 function showDialogTimetableList(title,content,bookingLink=""){ 224 225 if(bookingLink!==""){ 226 var button = { 227 text: dialoge["jetzt_buchen"], 228 action: function () { 229 window.location.href=bookingLink; 230 } 231 } 232 } 233 else{ 234 var button = null; 235 } 236 showDialog(title, content, null, button); 237 238 } 239 240 function TMFindenInteraktiv(obj){ 241 var data = {}; 242 data["data"] = jQuery(obj).closest("form").serialize(); 243 data["action"] = 'travelmanager_list'; 244 data["hash"]=jQuery(obj).attr("hash"); 245 246 try { 247 clearTimeout(myTimeout); 248 } 249 catch (e) {} 250 251 jQuery.blockUI({ message: dialoge["inhalt_laden"]+'...'}); 252 myTimeout = setTimeout(function(){ 253 jQuery.post(ajaxurl, data, function(response) { 254 jQuery.unblockUI(); 255 if(response.html){ 256 jQuery(obj).closest(".listcontainer").find(".suchergebnis").html(response.html); 257 } 258 }); 259 260 }, 20); 261 } 262 263 function TMFindenTabs(obj){ 264 265 var data = {}; 266 data["linie_typ_id"] = jQuery(obj).closest(".containerfind").find("[name='linie_typ_id']").val(); 267 data["action"] = 'travelmanager_tabs'; 268 data["hash"]=jQuery(obj).attr("hash"); 269 270 try { 271 clearTimeout(myTimeout); 272 } 273 catch (e) {} 274 275 jQuery.blockUI({ message: dialoge["inhalt_laden"]+'...'}); 276 myTimeout = setTimeout(function(){ 277 jQuery.post(ajaxurl, data, function(response) { 278 279 //Objekt leeren 280 jQuery(obj).closest(".containerfind").find( '.findencontainer' ).html(""); 281 282 jQuery.unblockUI(); 283 if(response.html){ 284 jQuery(obj).closest(".containerfind").find(".findencontainer").html(response.html); 285 286 //Tabs initialisieren 287 jQuery(obj).closest(".containerfind").find( '.jqueryuitabs' ).tabs(); 288 } 289 }); 290 291 }, 20); 292 }
Note: See TracChangeset
for help on using the changeset viewer.