<?php

namespace DataView;

class CampaignFollow {
  
  

  
  

    // --- Statische Methoden ---
  
  public static function renderScript() { 
    
    
    // --- BLOCK: main ---
    
								\FOP\I18n::ensureIsLoaded();
								?>
								<script type="text/javascript">
									
    function changefilter_campaignFollow_stateListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_campaignFollow_state', val, cb.checked);
		  } else {
			  delete query['filter_campaignFollow_state'];
		  }reloadcampaignFollow();
        
    }

		var ied7541909d9eb93c13e29766b6aa2af5c478b2eae68076ac3ab2005b02f40591timeout = null;
		function changefilter_campaignFollow_stateSearchFilter(val, callback) {
			if(ied7541909d9eb93c13e29766b6aa2af5c478b2eae68076ac3ab2005b02f40591timeout) clearTimeout(ied7541909d9eb93c13e29766b6aa2af5c478b2eae68076ac3ab2005b02f40591timeout);

			ied7541909d9eb93c13e29766b6aa2af5c478b2eae68076ac3ab2005b02f40591timeout = setTimeout(function() {
				$.getJSON(reloadcampaignFollow({action: 'getfilter_campaignFollow_stateItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_campaignFollow_state_orig'] = val;
				});
			}, 300);
		}

	function getfilter_campaignFollow_stateListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_campaignFollow_state_orig']) ? json_encode($_GET['filter_campaignFollow_state_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="ed7541909d9eb93c13e29766b6aa2af5c478b2eae68076ac3ab2005b02f40591" type="text">' +
			'<label class="mdl-textfield__label" for="ed7541909d9eb93c13e29766b6aa2af5c478b2eae68076ac3ab2005b02f40591">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_campaignFollow_state', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_campaignFollow_state_orig'] = '';
					delete query['filter_campaignFollow_state'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadcampaignFollow();
					
				} else {
					$('#table_campaignFollow').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_campaignFollow_stateSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\CampaignFollow::getfilter_campaignFollow_stateItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_campaignFollow_state_orig'] = '';
				delete query['filter_campaignFollow_state'];
				reload('', items);reloadcampaignFollow();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_campaignFollow_state', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_campaignFollow_stateListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
    function changefilter_campaignFollow_nextStateListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_campaignFollow_nextState', val, cb.checked);
		  } else {
			  delete query['filter_campaignFollow_nextState'];
		  }reloadcampaignFollow();
        
    }

		var ie1bde1fb2ead3c4103b348597d41726a0696008bf58626085cfdd2a172d7f337timeout = null;
		function changefilter_campaignFollow_nextStateSearchFilter(val, callback) {
			if(ie1bde1fb2ead3c4103b348597d41726a0696008bf58626085cfdd2a172d7f337timeout) clearTimeout(ie1bde1fb2ead3c4103b348597d41726a0696008bf58626085cfdd2a172d7f337timeout);

			ie1bde1fb2ead3c4103b348597d41726a0696008bf58626085cfdd2a172d7f337timeout = setTimeout(function() {
				$.getJSON(reloadcampaignFollow({action: 'getfilter_campaignFollow_nextStateItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_campaignFollow_nextState_orig'] = val;
				});
			}, 300);
		}

	function getfilter_campaignFollow_nextStateListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_campaignFollow_nextState_orig']) ? json_encode($_GET['filter_campaignFollow_nextState_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="e1bde1fb2ead3c4103b348597d41726a0696008bf58626085cfdd2a172d7f337" type="text">' +
			'<label class="mdl-textfield__label" for="e1bde1fb2ead3c4103b348597d41726a0696008bf58626085cfdd2a172d7f337">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_campaignFollow_nextState', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_campaignFollow_nextState_orig'] = '';
					delete query['filter_campaignFollow_nextState'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadcampaignFollow();
					
				} else {
					$('#table_campaignFollow').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_campaignFollow_nextStateSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\CampaignFollow::getfilter_campaignFollow_nextStateItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_campaignFollow_nextState_orig'] = '';
				delete query['filter_campaignFollow_nextState'];
				reload('', items);reloadcampaignFollow();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_campaignFollow_nextState', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_campaignFollow_nextStateListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
    function changefilter_campaignFollow_campaignListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_campaignFollow_campaign', val, cb.checked);
		  } else {
			  delete query['filter_campaignFollow_campaign'];
		  }reloadcampaignFollow();
        
    }

		var i5a01678f2f9accc36a391adb99d135b6af6f7c91a33f7a4e5c1c01403e293533timeout = null;
		function changefilter_campaignFollow_campaignSearchFilter(val, callback) {
			if(i5a01678f2f9accc36a391adb99d135b6af6f7c91a33f7a4e5c1c01403e293533timeout) clearTimeout(i5a01678f2f9accc36a391adb99d135b6af6f7c91a33f7a4e5c1c01403e293533timeout);

			i5a01678f2f9accc36a391adb99d135b6af6f7c91a33f7a4e5c1c01403e293533timeout = setTimeout(function() {
				$.getJSON(reloadcampaignFollow({action: 'getfilter_campaignFollow_campaignItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_campaignFollow_campaign_orig'] = val;
				});
			}, 300);
		}

	function getfilter_campaignFollow_campaignListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_campaignFollow_campaign_orig']) ? json_encode($_GET['filter_campaignFollow_campaign_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="5a01678f2f9accc36a391adb99d135b6af6f7c91a33f7a4e5c1c01403e293533" type="text">' +
			'<label class="mdl-textfield__label" for="5a01678f2f9accc36a391adb99d135b6af6f7c91a33f7a4e5c1c01403e293533">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_campaignFollow_campaign', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_campaignFollow_campaign_orig'] = '';
					delete query['filter_campaignFollow_campaign'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadcampaignFollow();
					
				} else {
					$('#table_campaignFollow').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_campaignFollow_campaignSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\CampaignFollow::getfilter_campaignFollow_campaignItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_campaignFollow_campaign_orig'] = '';
				delete query['filter_campaignFollow_campaign'];
				reload('', items);reloadcampaignFollow();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_campaignFollow_campaign', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_campaignFollow_campaignListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
    function changefilter_campaignFollow_nextCampaignListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_campaignFollow_nextCampaign', val, cb.checked);
		  } else {
			  delete query['filter_campaignFollow_nextCampaign'];
		  }reloadcampaignFollow();
        
    }

		var i7f558361bd3931b6e7487f8ed6abb76821fd1fd4198376ade4dffac3ae1282a7timeout = null;
		function changefilter_campaignFollow_nextCampaignSearchFilter(val, callback) {
			if(i7f558361bd3931b6e7487f8ed6abb76821fd1fd4198376ade4dffac3ae1282a7timeout) clearTimeout(i7f558361bd3931b6e7487f8ed6abb76821fd1fd4198376ade4dffac3ae1282a7timeout);

			i7f558361bd3931b6e7487f8ed6abb76821fd1fd4198376ade4dffac3ae1282a7timeout = setTimeout(function() {
				$.getJSON(reloadcampaignFollow({action: 'getfilter_campaignFollow_nextCampaignItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_campaignFollow_nextCampaign_orig'] = val;
				});
			}, 300);
		}

	function getfilter_campaignFollow_nextCampaignListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_campaignFollow_nextCampaign_orig']) ? json_encode($_GET['filter_campaignFollow_nextCampaign_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="7f558361bd3931b6e7487f8ed6abb76821fd1fd4198376ade4dffac3ae1282a7" type="text">' +
			'<label class="mdl-textfield__label" for="7f558361bd3931b6e7487f8ed6abb76821fd1fd4198376ade4dffac3ae1282a7">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_campaignFollow_nextCampaign', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_campaignFollow_nextCampaign_orig'] = '';
					delete query['filter_campaignFollow_nextCampaign'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadcampaignFollow();
					
				} else {
					$('#table_campaignFollow').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_campaignFollow_nextCampaignSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\CampaignFollow::getfilter_campaignFollow_nextCampaignItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_campaignFollow_nextCampaign_orig'] = '';
				delete query['filter_campaignFollow_nextCampaign'];
				reload('', items);reloadcampaignFollow();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_campaignFollow_nextCampaign', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_campaignFollow_nextCampaignListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
									
    function changefilter_campaignFollow_stateListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_campaignFollow_state', val, cb.checked);
		  } else {
			  delete query['filter_campaignFollow_state'];
		  }reloadcampaignFollow();
        
    }

		var ied7541909d9eb93c13e29766b6aa2af5c478b2eae68076ac3ab2005b02f40591timeout = null;
		function changefilter_campaignFollow_stateSearchFilter(val, callback) {
			if(ied7541909d9eb93c13e29766b6aa2af5c478b2eae68076ac3ab2005b02f40591timeout) clearTimeout(ied7541909d9eb93c13e29766b6aa2af5c478b2eae68076ac3ab2005b02f40591timeout);

			ied7541909d9eb93c13e29766b6aa2af5c478b2eae68076ac3ab2005b02f40591timeout = setTimeout(function() {
				$.getJSON(reloadcampaignFollow({action: 'getfilter_campaignFollow_stateItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_campaignFollow_state_orig'] = val;
				});
			}, 300);
		}

	function getfilter_campaignFollow_stateListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_campaignFollow_state_orig']) ? json_encode($_GET['filter_campaignFollow_state_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="ed7541909d9eb93c13e29766b6aa2af5c478b2eae68076ac3ab2005b02f40591" type="text">' +
			'<label class="mdl-textfield__label" for="ed7541909d9eb93c13e29766b6aa2af5c478b2eae68076ac3ab2005b02f40591">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_campaignFollow_state', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_campaignFollow_state_orig'] = '';
					delete query['filter_campaignFollow_state'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadcampaignFollow();
					
				} else {
					$('#table_campaignFollow').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_campaignFollow_stateSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\CampaignFollow::getfilter_campaignFollow_stateItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_campaignFollow_state_orig'] = '';
				delete query['filter_campaignFollow_state'];
				reload('', items);reloadcampaignFollow();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_campaignFollow_state', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_campaignFollow_stateListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
    function changefilter_campaignFollow_nextStateListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_campaignFollow_nextState', val, cb.checked);
		  } else {
			  delete query['filter_campaignFollow_nextState'];
		  }reloadcampaignFollow();
        
    }

		var ie1bde1fb2ead3c4103b348597d41726a0696008bf58626085cfdd2a172d7f337timeout = null;
		function changefilter_campaignFollow_nextStateSearchFilter(val, callback) {
			if(ie1bde1fb2ead3c4103b348597d41726a0696008bf58626085cfdd2a172d7f337timeout) clearTimeout(ie1bde1fb2ead3c4103b348597d41726a0696008bf58626085cfdd2a172d7f337timeout);

			ie1bde1fb2ead3c4103b348597d41726a0696008bf58626085cfdd2a172d7f337timeout = setTimeout(function() {
				$.getJSON(reloadcampaignFollow({action: 'getfilter_campaignFollow_nextStateItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_campaignFollow_nextState_orig'] = val;
				});
			}, 300);
		}

	function getfilter_campaignFollow_nextStateListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_campaignFollow_nextState_orig']) ? json_encode($_GET['filter_campaignFollow_nextState_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="e1bde1fb2ead3c4103b348597d41726a0696008bf58626085cfdd2a172d7f337" type="text">' +
			'<label class="mdl-textfield__label" for="e1bde1fb2ead3c4103b348597d41726a0696008bf58626085cfdd2a172d7f337">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_campaignFollow_nextState', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_campaignFollow_nextState_orig'] = '';
					delete query['filter_campaignFollow_nextState'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadcampaignFollow();
					
				} else {
					$('#table_campaignFollow').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_campaignFollow_nextStateSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\CampaignFollow::getfilter_campaignFollow_nextStateItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_campaignFollow_nextState_orig'] = '';
				delete query['filter_campaignFollow_nextState'];
				reload('', items);reloadcampaignFollow();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_campaignFollow_nextState', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_campaignFollow_nextStateListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
    function changefilter_campaignFollow_campaignListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_campaignFollow_campaign', val, cb.checked);
		  } else {
			  delete query['filter_campaignFollow_campaign'];
		  }reloadcampaignFollow();
        
    }

		var i5a01678f2f9accc36a391adb99d135b6af6f7c91a33f7a4e5c1c01403e293533timeout = null;
		function changefilter_campaignFollow_campaignSearchFilter(val, callback) {
			if(i5a01678f2f9accc36a391adb99d135b6af6f7c91a33f7a4e5c1c01403e293533timeout) clearTimeout(i5a01678f2f9accc36a391adb99d135b6af6f7c91a33f7a4e5c1c01403e293533timeout);

			i5a01678f2f9accc36a391adb99d135b6af6f7c91a33f7a4e5c1c01403e293533timeout = setTimeout(function() {
				$.getJSON(reloadcampaignFollow({action: 'getfilter_campaignFollow_campaignItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_campaignFollow_campaign_orig'] = val;
				});
			}, 300);
		}

	function getfilter_campaignFollow_campaignListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_campaignFollow_campaign_orig']) ? json_encode($_GET['filter_campaignFollow_campaign_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="5a01678f2f9accc36a391adb99d135b6af6f7c91a33f7a4e5c1c01403e293533" type="text">' +
			'<label class="mdl-textfield__label" for="5a01678f2f9accc36a391adb99d135b6af6f7c91a33f7a4e5c1c01403e293533">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_campaignFollow_campaign', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_campaignFollow_campaign_orig'] = '';
					delete query['filter_campaignFollow_campaign'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadcampaignFollow();
					
				} else {
					$('#table_campaignFollow').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_campaignFollow_campaignSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\CampaignFollow::getfilter_campaignFollow_campaignItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_campaignFollow_campaign_orig'] = '';
				delete query['filter_campaignFollow_campaign'];
				reload('', items);reloadcampaignFollow();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_campaignFollow_campaign', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_campaignFollow_campaignListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
    function changefilter_campaignFollow_nextCampaignListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_campaignFollow_nextCampaign', val, cb.checked);
		  } else {
			  delete query['filter_campaignFollow_nextCampaign'];
		  }reloadcampaignFollow();
        
    }

		var i7f558361bd3931b6e7487f8ed6abb76821fd1fd4198376ade4dffac3ae1282a7timeout = null;
		function changefilter_campaignFollow_nextCampaignSearchFilter(val, callback) {
			if(i7f558361bd3931b6e7487f8ed6abb76821fd1fd4198376ade4dffac3ae1282a7timeout) clearTimeout(i7f558361bd3931b6e7487f8ed6abb76821fd1fd4198376ade4dffac3ae1282a7timeout);

			i7f558361bd3931b6e7487f8ed6abb76821fd1fd4198376ade4dffac3ae1282a7timeout = setTimeout(function() {
				$.getJSON(reloadcampaignFollow({action: 'getfilter_campaignFollow_nextCampaignItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_campaignFollow_nextCampaign_orig'] = val;
				});
			}, 300);
		}

	function getfilter_campaignFollow_nextCampaignListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_campaignFollow_nextCampaign_orig']) ? json_encode($_GET['filter_campaignFollow_nextCampaign_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="7f558361bd3931b6e7487f8ed6abb76821fd1fd4198376ade4dffac3ae1282a7" type="text">' +
			'<label class="mdl-textfield__label" for="7f558361bd3931b6e7487f8ed6abb76821fd1fd4198376ade4dffac3ae1282a7">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_campaignFollow_nextCampaign', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_campaignFollow_nextCampaign_orig'] = '';
					delete query['filter_campaignFollow_nextCampaign'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadcampaignFollow();
					
				} else {
					$('#table_campaignFollow').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_campaignFollow_nextCampaignSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\CampaignFollow::getfilter_campaignFollow_nextCampaignItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_campaignFollow_nextCampaign_orig'] = '';
				delete query['filter_campaignFollow_nextCampaign'];
				reload('', items);reloadcampaignFollow();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_campaignFollow_nextCampaign', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_campaignFollow_nextCampaignListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
									function updateNumbercampaignFollow(col) {
										//var checklist = window.DataViewChecked['campaignFollow'][col];
										//if (checklist.id) {
											// checklist is online
											// TODO: check if cache is alive, otherwise reload from ajax, delay execution and return now
											//checklist.ranges = [[1,10000000]]; // mostly we use indirect idlists to tick all marks; so this is an approximation
										//}
										// checkboxes aktualisieren
										if (window.DataViewChecked && window.DataViewChecked['campaignFollow'] && window.DataViewChecked['campaignFollow'][col].ranges.length > 0) {
											$('.campaignFollow__mass-action').css('visibility', 'visible');
											$('.campaignFollow__action').css('visibility', 'hidden');
										} else {
											$('.campaignFollow__mass-action').css('visibility', 'hidden');
											$('.campaignFollow__action').css('visibility', 'visible');
										}
										$('.campaignFollow__checkbox').each(function (idx, x) {
											for (var cssclass of x.classList) {
												if (cssclass.startsWith('campaignFollow__checkbox-'+col+'-')) {
													var my_id = cssclass.substr(('campaignFollow__checkbox-'+col+'-').length);
													if (window.DataViewChecked) {
														x.MaterialCheckbox[checklist.has(my_id) ? 'check' : 'uncheck']();
													}
												}
											}
										});
									}
									function reloadcampaignFollow (params, returnUrl, onlyScroll, addPadding = 0) {
										// copy query
										let nq = JSON.parse(JSON.stringify(query));
										nq['parent_request'] = <?php echo json_encode(strtok(\FOP\Util::getBackUrl(), '?')); ?>;
										<?php if (isset($_GET['select'])) { ?>nq['select'] = 'select';<?php } ?>
										
										if (params) {
											for (var i in params) nq[i] = params[i];
											var action = nq['action'];
											delete nq['action'];
											let querystr = "DataView/CampaignFollow/" + action + "?" + Object.keys(nq).map(function(k){ return k + "=" +  encodeURIComponent(nq[k]); }).join("&");
											// direkt aufrufen (ist wohl ein Download oder so)
											if (returnUrl) return querystr;
											window.location.href = querystr;
										} else {
											let querystr;
											
											
											<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
											delete nq['action'];
											querystr = "DataView/CampaignFollow/renderTabTable?" + Object.keys(nq).map(function(k){ return k + "=" +  encodeURIComponent(nq[k]); }).join("&");
											// per Ajax laden
											if(!$("#campaignFollow-table")?.parent()?.parent()?.hasClass('fop-form-feature-collapsed') || $("#campaignFollow-table")?.parent()?.parent()?.hasClass('fop-form-feature-mode-area')) {
											$.get(querystr, function(data){
												var tab = $("#campaignFollow-table");
												var top = tab.find('.fop-table-body-inner');
												var el;
												if (onlyScroll && (el = $('<div class="tabcontent">' + data + '</div>').find('.fop-table-body-inner'))) {
													// nur Scroll-Bereich ersetzen
													var paddingTop = parseInt(el.css('paddingTop') || '0px', 10);
													var minHeight = parseInt(el.css('minHeight'), 10)
													paddingTop += addPadding;
													minHeight += addPadding;
													top.css({paddingTop: paddingTop.toString()+'px', minHeight: minHeight.toString()+'px'}); // Offset
													el = el.children();
													top.empty();
													top.append(el);
													el = top; // top-upgrade doppelt machen, dadurch vermeiden wir das Array-upgrade => Performance
												} else {
													// gesamten Tab ersetzen
													tab.children().remove();
													el = tab.html('<div class="tabcontent">' + data + '</div>');
												}
												try {
													for (var i = 0; i < el.length; i++) upgradeDOM(el[i]);
												} catch (e) {
													console.log(e);
												}
												upgradeTable(el.find('.fop-table .fop-table-header')); // Falls es Tabellen-Layout ist: Spalten-Order anpassen
												flushURL(); // Neue URL in Titelleiste eintragen

												// Checkbox-Auswahl ankreuzen
												updateNumbercampaignFollow('ID');
											});
											} else {
												// gesamten Tab ersetzen
												var tab = $("#campaignFollow-table");
												tab.children().remove();
												el = tab.html('<div class="fop-lazy-reload" onclick="reloadcampaignFollow()"></div>');
											}
											<?php } ?>
											
										}
									}
									function checkcampaignFollow (id, col, checked) {
										// ID-Liste aufbauen
										if (!window.DataViewChecked) window.DataViewChecked = {};
										if (!window.DataViewChecked['campaignFollow']) window.DataViewChecked['campaignFollow'] = {};
										if (!window.DataViewChecked['campaignFollow'][col]) window.DataViewChecked['campaignFollow'][col] = new IDList();

										// Abfrage aller gecheckten IDs für eine Tabelle
										if (!id) {
											return window.DataViewChecked['campaignFollow'][col].toString();
										}

										// check all, check id
										if (id == 'all') {
											// TODO: umbauen #1289: 'all' auch nur auf ne idlist reduzieren
											if (checked) {
												$.get(reloadcampaignFollow({action: 'getids', col: col}, true), function (ids) {
													window.DataViewChecked['campaignFollow'][col] = new IDList(ids);
													updateNumbercampaignFollow(col);
												});
											} else {
												window.DataViewChecked['campaignFollow'][col] = new IDList();
												updateNumbercampaignFollow(col);
											}
										} else {
											var ids = new IDList(id);
											var allcb = $('#campaignFollow__all-checkbox');
											if (allcb[0]) {
												allcb[0].parentElement.MaterialCheckbox.uncheck(); // TODO: prüfen, ob Gruppen-CBs voll werden
											}
											if (checked == 'set') {
												window.DataViewChecked['campaignFollow'][col] = ids;
											} else for (id of ids.all()) {
												if (checked) {
													window.DataViewChecked['campaignFollow'][col].push(id);
												} else {
													window.DataViewChecked['campaignFollow'][col].remove(id);
												}
											}
											updateNumbercampaignFollow(col);
										}
									}
								</script><?php

    
  }

  public static function renderSpecialFilters() { 
    
    
    // --- BLOCK: main ---
    ?>
	
	<script type"text/javascript">
		function updateSpecialFilter(param, val) {
			query[param] = val.toString();reloadcampaignFollow();
			
		}

	</script>
	<?php
	
    
  }

  public static function renderTabTableAction() { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
     ?><div class='fop-dv-buttonbar'><?php if((!\FOP\User::getIsGuest())) { ?><a class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" onclick="
		var self = this;
		event.preventDefault();
		$.get(reloadcampaignFollow({action: 'open', fop_table: 'campaignFollow', fop_id: '_', fop_from: location.href}, true))
		.then(function () {
			window.open_url(self.href, false);
		});" href="<?php echo htmlentities(\TablesRouter\CampaignFollow::createURL2(['from' => $_GET['from'] ?? null, 'popup' => $_GET['popup'] ?? null])); ?>"><i class="material-icons">add</i> <?php echo(sprintf(_('create %s'), _('Follow-Up'))); ?></a><?php } ?></div><?php 
								\FOP\User::getIsGuest();
								$itemheight = 32;
								$itemsperpage = ceil(1080 / $itemheight * 0.8);
								$page = (isset($_GET['page_campaignFollow']) ? intval($_GET['page_campaignFollow']) : 0);
								$addlines = (isset($_GET['addlines_campaignFollow']) ? intval($_GET['addlines_campaignFollow']) : 0);
								$firstitem = $page * $itemsperpage;
								$sqladdon = ' LIMIT ' . ($itemsperpage * 2) . ' OFFSET ' . ($firstitem);
								$data = self::getData($sqladdon, $_GET);
								$arr = $data["items"];
								$itemcount = $data["itemcount"];
								$lastPage = ceil($itemcount/$itemsperpage-1);
								// calculate width of first column: 67px + 32px for each shortcut
								$firstColumnWidth = 66 + 34 + 34;
								$additionalLines = 0;

									// Spaltenliste zuerst aufbauen, damit sie noch umsortiert werden kann
									$order = 1000;
									$columns = [];
									
										if(true){
											$col = [
												'id' => 'campaign',
												'desc' => _('Aktion'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['campaign'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'state',
												'desc' => _('Zustand'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['state'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'nextCampaign',
												'desc' => _('Nächste Kampagne'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['nextCampaign'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'timeout',
												'desc' => _('Timeout / Tage'),
												'order' => ++$order,
												'width' => 60, // default value
												'collapsed' => 0

											];
											$columns['timeout'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'nextState',
												'desc' => _('Neuer Zustand'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['nextState'] = $col;
										}
									

									// gespeicherte Spaltenanordnung
									foreach (\FOP\Database::query('SELECT * FROM fop_dataview WHERE '.qi('user').' = ' . \FOP\Database::quote(\FOP\User::getID()) . ' AND dataview = ' . \FOP\Database::quote('campaignFollow'))->fetchAll(\PDO::FETCH_ASSOC) AS $column => $c) {
										if (isset($columns[$c['column']])) {
											$columns[$c['column']]['order'] = $c['order']; // order, width, collapsed
											$columns[$c['column']]['width'] = $c['width']; // order, width, collapsed
											$columns[$c['column']]['collapsed'] = $c['collapsed']; // order, width, collapsed
										}
									}

									// DOM vor-rendern
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='campaign'
												data-order='<?php echo intval($columns['campaign']['order']); ?>'
												data-width='<?php echo intval($columns['campaign']['width']); ?>'
												data-collapsed='<?php echo intval($columns['campaign']['collapsed']); ?>'
												style='width: <?php echo intval($columns['campaign']['width']); ?>px; <?php if ($columns['campaign']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadcampaignFollow(); 
		}});
		
		win.append(getfilter_campaignFollow_campaignListMultiFilter()); win.find('input').first().focus();
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_campaignFollow'] == 'campaign ASC') {
			query['sort_campaignFollow'] = 'campaign DESC';
		 } else if (query['sort_campaignFollow'] == 'campaign DESC') {
		 	delete query['sort_campaignFollow'];
		 } else {
			query['sort_campaignFollow'] = 'campaign ASC';
		 }
		 reloadcampaignFollow();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('Aktion')); ?>'><?php echo(_('Aktion')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_campaignFollow']) && $_GET['sort_campaignFollow'] == 'campaign ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_campaignFollow']) && $_GET['sort_campaignFollow'] == 'campaign DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_campaignFollow_campaign']) || isset($_GET['range_max_campaignFollow_campaign']) || isset($_GET['deps_campaignFollow_campaign']) || isset($_GET['fullsearch_campaignFollow_campaign']) || isset($_GET['dynamic_campaignFollow_campaign']) || isset($_GET['search_campaignFollow_campaign']) || isset($_GET['searchnot_campaignFollow_campaign']) || isset($_GET['filter_campaignFollow_campaign'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['campaign']['header'] = ob_get_contents(); ob_end_clean();
											$columns['campaign']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['campaign']['width']); ?>px; <?php if ($columns['campaign']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='campaign'><?php
	
	call_user_func(function () use ($item) {
	$id = $item['campaign'];
	$val = $item['campaign::description'];
	$canView = $item['campaign::canView'];
	if ($val !== null) {
		if ($canView) echo "<a tabindex=\"-1\" class=\"mdl-button mdl-button-small tbl-link\" data-tbl=\"campaign\" data-id=\"".htmlentities($id)."\" onclick=\"event.stopPropagation(); event.preventDefault(); open_url(this.href, true);\" href=\"" . \TablesRouter\Campaign::viewURL($id, ['from' => \FOP\Util::getBackURL()]) . "\">(…)</a>";echo htmlentities($val);
	} else {
		echo htmlentities(_('Zustandswechsel nach Timeout') ?: '-');
	}
	});
	
?>
</div><?php
											};
											$columns['campaign']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='campaign'
													data-order='<?php echo intval($columns['campaign']['order']); ?>'
													data-width='<?php echo intval($columns['campaign']['width']); ?>'
													data-collapsed='<?php echo intval($columns['campaign']['collapsed']); ?>'
													style='width: <?php echo intval($columns['campaign']['width']); ?>px; <?php if ($columns['campaign']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='state'
												data-order='<?php echo intval($columns['state']['order']); ?>'
												data-width='<?php echo intval($columns['state']['width']); ?>'
												data-collapsed='<?php echo intval($columns['state']['collapsed']); ?>'
												style='width: <?php echo intval($columns['state']['width']); ?>px; <?php if ($columns['state']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadcampaignFollow(); 
		}});
		
		win.append(getfilter_campaignFollow_stateListMultiFilter()); win.find('input').first().focus();
		return false;
	">
													<span class='title-title' title='<?php echo(_('Zustand')); ?>'><?php echo(_('Zustand')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_campaignFollow']) && $_GET['sort_campaignFollow'] == 'state ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_campaignFollow']) && $_GET['sort_campaignFollow'] == 'state DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_campaignFollow_state']) || isset($_GET['range_max_campaignFollow_state']) || isset($_GET['deps_campaignFollow_state']) || isset($_GET['fullsearch_campaignFollow_state']) || isset($_GET['dynamic_campaignFollow_state']) || isset($_GET['search_campaignFollow_state']) || isset($_GET['searchnot_campaignFollow_state']) || isset($_GET['filter_campaignFollow_state'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['state']['header'] = ob_get_contents(); ob_end_clean();
											$columns['state']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['state']['width']); ?>px; <?php if ($columns['state']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='state'><?php
	
	call_user_func(function () use ($item) {
	$id = $item['state'];
	$val = $item['state::description'];
	$canView = $item['state::canView'];
	if ($val !== null) {
		echo htmlentities($val);
	} else {
		echo htmlentities(_('') ?: '-');
	}
	});
	
?>
</div><?php
											};
											$columns['state']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='state'
													data-order='<?php echo intval($columns['state']['order']); ?>'
													data-width='<?php echo intval($columns['state']['width']); ?>'
													data-collapsed='<?php echo intval($columns['state']['collapsed']); ?>'
													style='width: <?php echo intval($columns['state']['width']); ?>px; <?php if ($columns['state']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='nextCampaign'
												data-order='<?php echo intval($columns['nextCampaign']['order']); ?>'
												data-width='<?php echo intval($columns['nextCampaign']['width']); ?>'
												data-collapsed='<?php echo intval($columns['nextCampaign']['collapsed']); ?>'
												style='width: <?php echo intval($columns['nextCampaign']['width']); ?>px; <?php if ($columns['nextCampaign']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadcampaignFollow(); 
		}});
		
		win.append(getfilter_campaignFollow_nextCampaignListMultiFilter()); win.find('input').first().focus();
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_campaignFollow'] == 'nextCampaign ASC') {
			query['sort_campaignFollow'] = 'nextCampaign DESC';
		 } else if (query['sort_campaignFollow'] == 'nextCampaign DESC') {
		 	delete query['sort_campaignFollow'];
		 } else {
			query['sort_campaignFollow'] = 'nextCampaign ASC';
		 }
		 reloadcampaignFollow();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('Nächste Kampagne')); ?>'><?php echo(_('Nächste Kampagne')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_campaignFollow']) && $_GET['sort_campaignFollow'] == 'nextCampaign ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_campaignFollow']) && $_GET['sort_campaignFollow'] == 'nextCampaign DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_campaignFollow_nextCampaign']) || isset($_GET['range_max_campaignFollow_nextCampaign']) || isset($_GET['deps_campaignFollow_nextCampaign']) || isset($_GET['fullsearch_campaignFollow_nextCampaign']) || isset($_GET['dynamic_campaignFollow_nextCampaign']) || isset($_GET['search_campaignFollow_nextCampaign']) || isset($_GET['searchnot_campaignFollow_nextCampaign']) || isset($_GET['filter_campaignFollow_nextCampaign'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['nextCampaign']['header'] = ob_get_contents(); ob_end_clean();
											$columns['nextCampaign']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['nextCampaign']['width']); ?>px; <?php if ($columns['nextCampaign']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='nextCampaign'><?php
	
	call_user_func(function () use ($item) {
	$id = $item['nextCampaign'];
	$val = $item['nextCampaign::description'];
	$canView = $item['nextCampaign::canView'];
	if ($val !== null) {
		if ($canView) echo "<a tabindex=\"-1\" class=\"mdl-button mdl-button-small tbl-link\" data-tbl=\"campaign\" data-id=\"".htmlentities($id)."\" onclick=\"event.stopPropagation(); event.preventDefault(); open_url(this.href, true);\" href=\"" . \TablesRouter\Campaign::viewURL($id, ['from' => \FOP\Util::getBackURL()]) . "\">(…)</a>";echo htmlentities($val);
	} else {
		echo htmlentities(_('Zustandswechsel nach Timeout') ?: '-');
	}
	});
	
?>
</div><?php
											};
											$columns['nextCampaign']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='nextCampaign'
													data-order='<?php echo intval($columns['nextCampaign']['order']); ?>'
													data-width='<?php echo intval($columns['nextCampaign']['width']); ?>'
													data-collapsed='<?php echo intval($columns['nextCampaign']['collapsed']); ?>'
													style='width: <?php echo intval($columns['nextCampaign']['width']); ?>px; <?php if ($columns['nextCampaign']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='timeout'
												data-order='<?php echo intval($columns['timeout']['order']); ?>'
												data-width='<?php echo intval($columns['timeout']['width']); ?>'
												data-collapsed='<?php echo intval($columns['timeout']['collapsed']); ?>'
												style='width: <?php echo intval($columns['timeout']['width']); ?>px; <?php if ($columns['timeout']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadcampaignFollow(); 
		}});
		var von, bis; win.append('<div class=\'fop-floatsorter\'>' + window.i18n_von + '</div>').append(von = $('<input type=\'number\' step=\'any\'><br>').val(query['range_min_campaignFollow_timeout']).on('change keyup paste', function () { query['range_min_campaignFollow_timeout'] = von.val(); delete query['page_campaignFollow']; changed = true; }))
.append('<div>' + window.i18n_bis + '</div>').append(bis = $('<input type=\'number\' step=\'any\'>').val(query['range_max_campaignFollow_timeout']).on('change keyup paste', function () { query['range_max_campaignFollow_timeout'] = bis.val(); delete query['page_campaignFollow']; changed = true; }))
; von.focus(); von.select();
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_campaignFollow'] == 'timeout ASC') {
			query['sort_campaignFollow'] = 'timeout DESC';
		 } else if (query['sort_campaignFollow'] == 'timeout DESC') {
		 	delete query['sort_campaignFollow'];
		 } else {
			query['sort_campaignFollow'] = 'timeout ASC';
		 }
		 reloadcampaignFollow();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	" style='text-align: right;'>
													<span class='title-title' title='<?php echo(_('Timeout / Tage')); ?>'><?php echo(_('Timeout / Tage')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_campaignFollow']) && $_GET['sort_campaignFollow'] == 'timeout ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_campaignFollow']) && $_GET['sort_campaignFollow'] == 'timeout DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_campaignFollow_timeout']) || isset($_GET['range_max_campaignFollow_timeout']) || isset($_GET['deps_campaignFollow_timeout']) || isset($_GET['fullsearch_campaignFollow_timeout']) || isset($_GET['dynamic_campaignFollow_timeout']) || isset($_GET['search_campaignFollow_timeout']) || isset($_GET['searchnot_campaignFollow_timeout']) || isset($_GET['filter_campaignFollow_timeout'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['timeout']['header'] = ob_get_contents(); ob_end_clean();
											$columns['timeout']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['timeout']['width']); ?>px; <?php if ($columns['timeout']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; <?php if (($item['timeout::vis'] ?? '0') == '0') { echo 'visibility: hidden;'; } ?>' data-column='timeout'><span style="white-space: nowrap; width: 100%; display: inline-block; text-align: right;"><?php echo htmlentities(\Types\Integer::print($item['timeout'])); ?>
	</span></div><?php
											};
											$columns['timeout']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='timeout'
													data-order='<?php echo intval($columns['timeout']['order']); ?>'
													data-width='<?php echo intval($columns['timeout']['width']); ?>'
													data-collapsed='<?php echo intval($columns['timeout']['collapsed']); ?>'
													style='width: <?php echo intval($columns['timeout']['width']); ?>px; <?php if ($columns['timeout']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='nextState'
												data-order='<?php echo intval($columns['nextState']['order']); ?>'
												data-width='<?php echo intval($columns['nextState']['width']); ?>'
												data-collapsed='<?php echo intval($columns['nextState']['collapsed']); ?>'
												style='width: <?php echo intval($columns['nextState']['width']); ?>px; <?php if ($columns['nextState']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadcampaignFollow(); 
		}});
		
		win.append(getfilter_campaignFollow_nextStateListMultiFilter()); win.find('input').first().focus();
		return false;
	">
													<span class='title-title' title='<?php echo(_('Neuer Zustand')); ?>'><?php echo(_('Neuer Zustand')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_campaignFollow']) && $_GET['sort_campaignFollow'] == 'nextState ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_campaignFollow']) && $_GET['sort_campaignFollow'] == 'nextState DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_campaignFollow_nextState']) || isset($_GET['range_max_campaignFollow_nextState']) || isset($_GET['deps_campaignFollow_nextState']) || isset($_GET['fullsearch_campaignFollow_nextState']) || isset($_GET['dynamic_campaignFollow_nextState']) || isset($_GET['search_campaignFollow_nextState']) || isset($_GET['searchnot_campaignFollow_nextState']) || isset($_GET['filter_campaignFollow_nextState'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['nextState']['header'] = ob_get_contents(); ob_end_clean();
											$columns['nextState']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['nextState']['width']); ?>px; <?php if ($columns['nextState']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='nextState'><?php
	
	call_user_func(function () use ($item) {
	$id = $item['nextState'];
	$val = $item['nextState::description'];
	$canView = $item['nextState::canView'];
	if ($val !== null) {
		echo htmlentities($val);
	} else {
		echo htmlentities(_('') ?: '-');
	}
	});
	
?>
</div><?php
											};
											$columns['nextState']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='nextState'
													data-order='<?php echo intval($columns['nextState']['order']); ?>'
													data-width='<?php echo intval($columns['nextState']['width']); ?>'
													data-collapsed='<?php echo intval($columns['nextState']['collapsed']); ?>'
													style='width: <?php echo intval($columns['nextState']['width']); ?>px; <?php if ($columns['nextState']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									

									// sort by order
									uasort($columns, function ($a, $b) {
										return $a['order'] - $b['order'];
									});
									?>
									<style type='text/css'>
										#campaignFollow-table .fop-table-header {
											height: <?php echo 32; ?>px;
										}
										#campaignFollow-table .fop-table-header .fop-table-column .title,
										#campaignFollow-table .fop-column-handle,
										#campaignFollow-table .fop-table-row,
										#campaignFollow-table .fop-table-row .fop-table-column,
										#campaignFollow-table .fop-table-column-multicontrol,
										#campaignFollow-table .fop-filter-button {
											height: 32px;
											line-height: 32px;
										}
										</style>
											<div class="fop-table" data-table-id="campaignFollow">
											<div class="fop-legend"></div>
											<div class="fop-filter-string-wrapper"><div class="fop-filter-string"><label>Filter:</label> <span><?php echo self::getFilterHTML($_GET); ?></span></div></div>
											
											<?php if (isset($_GET['select'])) { echo '<br>'; } ?>
											<div class="fop-table-header">
											<?php if (!isset($_GET['select'])) { ?>
												<div class="fop-table-column noprint" style="width: <?php echo json_encode($firstColumnWidth); ?>px;">
													
													<div class="fop-table-column-multicontrol">
													<label class="mdl-checkbox mdl-js-checkbox"  style='width: auto;' for="campaignFollow__all-checkbox">
														<input class="mdl-checkbox__input" id="campaignFollow__all-checkbox" type="checkbox" onchange="checkcampaignFollow('all', 'ID', this.checked);">
														</label>
														<button type="button" class="mdl-button mdl-js-button mdl-button--icon campaignFollow__mass-action" style='visibility: hidden;' onclick="$.get('DataView/CampaignFollow/permissions?id=' + checkcampaignFollow(null, 'ID'), function (data) { for (var method in data) if (method != '__cnt') { var btn = $('[data-interaction-name=&quot;' + method + '&quot;]'); if (data[method] >= 1) btn.show(); else btn.hide(); btn.find('.cnt').text(data[method]); }; }); dropDownFixPosition($(this), $(this).next())">
															<i class="material-icons">more_vert</i>
														</button>
														<ul class="mdl-list mdl-card mdl-shadow--4dp fop-scroll-menu">
															<?php
		if(true) { ?>
			<span class="mdl-list__item mdl-button">
				<span class="mdl-list__item mdl-button" data-interaction-name="filterall" style="margin-right:auto; text-align:left;"
					onclick="for (key in query) if (key.indexOf('range_min_campaignFollow_') == 0 || key.indexOf('range_max_campaignFollow_') == 0 || key.indexOf('deps_campaignFollow_') == 0 || key.indexOf('fullsearch_campaignFollow_') == 0 || key.indexOf('dynamic_campaignFollow_') == 0 || key.indexOf('search_campaignFollow_') == 0 || key.indexOf('searchnot_campaignFollow_') == 0 || key.indexOf('filter_campaignFollow_') == 0) delete query[key]; reloadcampaignFollow(); $(this).closest('.overlay').click(); return false;">
					<span style="float:left;"><i class="material-icons">list</i></span><span class="fop-menu-caption" title="<?php echo(_('view all elements')); ?>"><?php echo(_('view all elements')); ?> 
					</span>
				</span>
			</span>
		<?php } ?><?php
		if(true) { ?>
			<span class="mdl-list__item mdl-button">
				<span class="mdl-list__item mdl-button" data-interaction-name="filteronly" style="margin-right:auto; text-align:left;"
					onclick="query['filter_campaignFollow_ID'] = checkcampaignFollow(null, 'ID'); delete query['page_campaignFollow']; reloadcampaignFollow(); $(this).closest('.overlay').click(); return false;">
					<span style="float:left;"><i class="material-icons">arrow_forward</i></span><span class="fop-menu-caption" title="<?php echo(_('view only these elements')); ?>"><?php echo(_('view only these elements')); ?> (<span class='cnt'></span>)
					</span>
				</span>
			</span>
		<?php } ?><?php
		if(true) { ?>
			<span class="mdl-list__item mdl-button">
				<span class="mdl-list__item mdl-button" data-interaction-name="filterrange" style="margin-right:auto; text-align:left;"
					onclick="
		var ticks = new IDList(checkcampaignFollow(null, 'ID'));
		var range = prompt('Bitte geben Sie den Bereich ein', '1-' + ticks.count());
		var newticks = new IDList();
		if (range) {
			range = range.split('-');
			if (range.length == 1) {
				range.push(range[0]);
			}
			var skip = (range[0] || 1) - 1;
			var take = (range[1] || Infinity) - skip;
			for (var item of ticks.all()) {
				if (skip > 0) {
					skip--;
				} else if (take > 0) {
					newticks.push(item);
					take--;
				} else break;
			}
			checkcampaignFollow(newticks, 'ID', 'set');
		} $(this).closest('.overlay').click(); return false;">
					<span style="float:left;"><i class="material-icons">colorize</i></span><span class="fop-menu-caption" title="<?php echo(_('limit range')); ?>"><?php echo(_('limit range')); ?> (<span class='cnt'></span>)
					</span>
				</span>
			</span>
		<?php } ?><?php
		if(true && (!\FOP\User::getIsGuest())) { ?>
			<span class="mdl-list__item mdl-button">
				<span class="mdl-list__item mdl-button" data-interaction-name="delete" style="margin-right:auto; text-align:left;"
					onclick="if(!confirm(<?php echo htmlentities(json_encode(_('confirmdelete'))); ?>)) return;$.get('Tables/CampaignFollow/delete?ajax&from=<?php echo urlencode(\FOP\Util::getBackUrl()); ?>&id=' + escape(checkcampaignFollow(null, 'ID'))).then(function () { reloadcampaignFollow(); }, function (err) { if (err.responseText.startsWith('http')) { window.location.href = err.responseText; } else {alert(err.responseText); }}); $(this).closest('.overlay').click(); return false;">
					<span style="float:left;"><i class="material-icons">delete</i></span><span class="fop-menu-caption" title="<?php echo(_('delete')); ?>"><?php echo(_('delete')); ?> (<span class='cnt'></span>)
					</span>
				</span>
			</span>
		<?php } ?>
														</ul>
														<!-- column hide -->
														<button type="button" class="mdl-button mdl-js-button mdl-button--icon" onclick="dropDownFixPosition($(this), $(this).next())">
															<i class="material-icons">visibility</i>
														</button>
														<ul class="mdl-list mdl-card mdl-shadow--4dp fop-scroll-menu">
															<?php foreach ($columns AS $col) { ?>
																<li class="mdl-list__item mdl-button" onclick="
																	var isVisible = this.firstElementChild.innerText !== 'clear';
																	this.firstElementChild.innerText = isVisible ? 'clear' : 'visibility'; // switch icon
																	tableColumnVisibility('campaignFollow', <?php echo htmlentities(json_encode($col['id'])); ?>, !isVisible); // the rest is up to a helper function in layout/tables.fop
																	">
																	<i class="material-icons"><?php if ($col['collapsed']) { echo 'clear'; } else { echo 'visibility'; }?></i>
																	<?php echo htmlentities($col['desc']); ?>
																</li>
															<?php } ?>
															<li class="mdl-list__item mdl-button" onclick="
																$.get('FOP/Index/dataview?data='+encodeURIComponent(JSON.stringify({dataview: 'campaignFollow', reset: true}))).then(function () { location.reload(); });
																">
																<i class="material-icons">refresh</i>
																<?php echo _('reset all'); ?>
															</li>
														</ul>
													</div>
												</div><?php }
												
												foreach ($columns AS $col) {
													// Spalten-Überschrift rendern
													echo $col['header'];
												} ?>
											 </div>
											
											<div class="fop-table-body" id="table_campaignFollow" <?php \EasyEditor\Navigation::printScroll('dv.CampaignFollow', '/* scroll horiz */ this.previousElementSibling.firstElementChild.style.marginLeft = \'-\' + this.scrollLeft + \'px\';
												/* scroll verti */
												var self = this;
												if (window.DataViewScrollReloadTimeout) clearTimeout(window.DataViewScrollReloadTimeout);
												window.DataViewScrollReloadTimeout = setTimeout(function () {
													var currentPage = parseInt(query[\'page_campaignFollow\'] || 0);
													var paddingTop = parseInt( self.lastElementChild.style.paddingTop, 10);
													var wantedPage = Math.max(0, currentPage + Math.floor((self.scrollTop - paddingTop) / ' . ($itemheight * $itemsperpage) . '));
													if (wantedPage != currentPage) {
														query[\'page_campaignFollow\'] = wantedPage;
														reloadcampaignFollow(undefined, undefined, true);
													}
												}, 50);
											'); ?>>
												<div class="fop-table-body-inner" style="min-height: <?php echo 12 + $itemheight * ($itemcount + $additionalLines); ?>px; padding-top: <?php echo $itemheight * $itemsperpage * $page; ?>px;">
												<?php foreach($arr as $itempos => $item) {
													?>
													<div class="fop-table-row" style="" data-campaignFollow-id="<?php echo htmlentities($item['ID']); ?>">

													<?php if (!isset($_GET['select'])) { ?>
													<div class='fop-table-column noprint' style="width: <?php echo json_encode($firstColumnWidth); ?>px;" onclick="$(this).find('input[type=checkbox]').first().click(); event.stopPropagation();">
													<label onclick="event.stopPropagation();" class="mdl-checkbox mdl-js-checkbox campaignFollow__checkbox campaignFollow__checkbox campaignFollow__checkbox-ID-<?php echo htmlentities($item['ID']); ?>" style="width: auto;" for="campaignFollow__<?php echo htmlentities($itempos); ?>-checkbox">
													<input class="mdl-checkbox__input" id="campaignFollow__<?php echo htmlentities($itempos); ?>-checkbox" type="checkbox" onchange="<?php if (isset($item['ID'])) echo 'checkcampaignFollow(' . htmlentities(json_encode($item['ID'])) . ', \'ID\', this.checked); ' ?>">
													</label><button type="button" class="mdl-button mdl-js-button mdl-button--icon campaignFollow__action" onclick="
														event.stopPropagation();
														dropDownFixPosition($(this), $(this).next());
														">
														<i class="material-icons">more_vert</i>
													</button><ul class="mdl-list mdl-card mdl-shadow--4dp fop-scroll-menu" id="fop-scroll-menu-campaignFollow-action-<?php echo $item['ID'] ?? 0; ?>">
														<?php
		if(isset($item['ID']) && $item['operation::view'] && $item['operation::edit']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="edit" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\CampaignFollow::editURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="   
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">edit</i></span><span class="fop-menu-caption" title="<?php echo(_('edit')); ?>"><?php echo(_('edit')); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && $item['operation::delete']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="delete" style="margin-right:auto; text-align:left;" href="#"
				onclick="if(!confirm(<?php echo htmlentities(json_encode(_('confirmdelete'))); ?>)) return false;   $.get('Tables/CampaignFollow/delete?ajax&id=<?php echo htmlentities($item['ID']);?>&from=<?php echo htmlentities(\FOP\Util::getBackUrl());?>').then(function () { reloadcampaignFollow(); }, function (err) { if (err.responseText.startsWith('http')) { window.location.href = err.responseText; } else {alert(err.responseText); }}); $(this).closest('.overlay').click(); return false;
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">delete</i></span><span class="fop-menu-caption" title="<?php echo(_('delete')); ?>"><?php echo(_('delete')); ?></span>
			</a>
		<?php } ?>
													</ul><?php
		if(isset($item['ID']) && $item['operation::view'] && $item['operation::edit']) {
			?><a class="mdl-button mdl-js-button mdl-button--icon tbl-link" data-tbl="campaignFollow" data-id="<?php echo htmlentities($item['ID']); ?>" data-interaction-name="edit" href="<?php echo htmlentities(\TablesRouter\CampaignFollow::editURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="event.stopPropagation();    reloadcampaignFollow();
					$(this).closest('.overlay').click();
					if (this.href != '#') {
						open_url(this.href, false);
					}
					event.preventDefault();"
				title="<?php echo(_('edit')); ?>">
				<i class="material-icons">edit</i>
			</a><?php } ?>
													</div><?php } ?><?php
													
													foreach ($columns AS $col) {
														$col['render']($item);
													}
													?></div>
												 <?php }?>

													</div>
												</div>

												
												
												</div><?php
												
	
    
  }

  public static function getidsAction($col) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
			$q = \FOP\Database::query('SELECT t.'.qi($col).' '.self::getSQL($_GET));
			$result = new \FOP\IDList();
			while ($item = $q->fetchColumn()) {
				$result->push($item);
			}
			die($result->toString());

    
  }

  public static function permissionsAction($id) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
		$ids = new \FOP\IDList($id);
		header('Content-Type: application/json');
		
		$perms = \FOP\Database::query('SELECT COUNT(*) AS __cnt, SUM(CASE (TRUE) WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('filteronly').', SUM(CASE (TRUE) WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('filterrange').', SUM(CASE (TRUE) WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('filterall').', SUM(CASE ('.(\FOP\User::getIsGuest() ? 'false' : 'true').') WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('delete').' FROM '.qi('campaignFollow').' WHERE ' . $ids->toSQL(qi('ID')))->fetch(\PDO::FETCH_ASSOC);
		
		return $perms;
	
    
  }

  public static function getSQL($params) { 
    
    
    // --- BLOCK: main ---
    
								// returns a sql snippet 'FROM (...) AS t WHERE' where you can prepend your select clauses and append your ORDER LIMIT
								$sql = 'FROM (SELECT /* ID */ '.qi('ID').' AS '.qi('ID').',
									/* campaign */ '.qi('campaign').' AS '.qi('campaign').',
									/* campaign::canView */ '.qi('ref:campaign').'.'.qi('campaign:canView').' AS '.qi('campaign::canView').',
									/* campaign::description */ '.qi('ref:campaign').'.'.qi('campaign:description').' AS '.qi('campaign::description').',
									/* nextCampaign */ '.qi('nextCampaign').' AS '.qi('nextCampaign').',
									/* nextCampaign::canView */ '.qi('ref:nextCampaign').'.'.qi('nextCampaign:canView').' AS '.qi('nextCampaign::canView').',
									/* nextCampaign::description */ '.qi('ref:nextCampaign').'.'.qi('nextCampaign:description').' AS '.qi('nextCampaign::description').',
									/* nextState */ '.qi('nextState').' AS '.qi('nextState').',
									/* nextState::canView */ '.qi('ref:nextState').'.'.qi('nextState:canView').' AS '.qi('nextState::canView').',
									/* nextState::description */ '.qi('ref:nextState').'.'.qi('nextState:description').' AS '.qi('nextState::description').',
									/* operation::create */ ' . (!\FOP\User::getIsGuest() ? 1 : 0) . ' AS '.qi('operation::create').',
									/* operation::delete */ '.(\FOP\User::getIsGuest() ? 'false' : 'true').' AS '.qi('operation::delete').',
									/* operation::edit */ '.(\FOP\User::getIsGuest() ? 'false' : 'true').' AS '.qi('operation::edit').',
									/* operation::index */ ' . (!\FOP\User::getIsGuest() ? 1 : 0) . ' AS '.qi('operation::index').',
									/* operation::view */ '.(\FOP\User::getIsGuest() ? 'false' : 'true').' AS '.qi('operation::view').',
									/* state */ '.qi('state').' AS '.qi('state').',
									/* state::canView */ '.qi('ref:state').'.'.qi('state:canView').' AS '.qi('state::canView').',
									/* state::description */ '.qi('ref:state').'.'.qi('state:description').' AS '.qi('state::description').',
									/* timeout */ '.qi('timeout').' AS '.qi('timeout').',
									/* timeout::vis */ (COALESCE('.qi('campaignFollow').'.'.qi('nextCampaign').', 0)) = (0) AS '.qi('timeout::vis').',
									1
								FROM '.qi('campaignFollow').' '.qi('campaignFollow').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('state:ID').', '.qi('campaignState').'.'.qi('desc').' AS '.qi('state:description').', (('.\FOP\Database::quote(\FOP\User::getCampaign()).')) AS '.qi('state:canView').' FROM '.qi('campaignState').') '.qi('ref:state').' ON '.qi('ref:state').'.'.qi('state:ID').' = '.qi('state').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('nextState:ID').', '.qi('campaignState').'.'.qi('desc').' AS '.qi('nextState:description').', (('.\FOP\Database::quote(\FOP\User::getCampaign()).')) AS '.qi('nextState:canView').' FROM '.qi('campaignState').') '.qi('ref:nextState').' ON '.qi('ref:nextState').'.'.qi('nextState:ID').' = '.qi('nextState').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('campaign:ID').', '.qi('campaign').'.'.qi('name').' AS '.qi('campaign:description').', (('.\FOP\Database::quote(\FOP\User::getCampaign()).')) AS '.qi('campaign:canView').' FROM '.qi('campaign').') '.qi('ref:campaign').' ON '.qi('ref:campaign').'.'.qi('campaign:ID').' = '.qi('campaign').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('nextCampaign:ID').', '.qi('campaign').'.'.qi('name').' AS '.qi('nextCampaign:description').', (('.\FOP\Database::quote(\FOP\User::getCampaign()).')) AS '.qi('nextCampaign:canView').' FROM '.qi('campaign').') '.qi('ref:nextCampaign').' ON '.qi('ref:nextCampaign').'.'.qi('nextCampaign:ID').' = '.qi('nextCampaign').'
								WHERE (('.(\FOP\User::getIsGuest() ? 'false' : 'true').'))) AS t
								LEFT JOIN '.qi('campaign').' AS '.qi('sorter-campaign').' ON t.'.qi('campaign').' = '.qi('sorter-campaign').'.'.qi('ID').'
								LEFT JOIN '.qi('campaign').' AS '.qi('sorter-nextCampaign').' ON t.'.qi('nextCampaign').' = '.qi('sorter-nextCampaign').'.'.qi('ID').'
								WHERE ' . (isset($params['range_min_campaignFollow_timeout']) ? ($params['range_min_campaignFollow_timeout'] !== '' && is_numeric($params['range_min_campaignFollow_timeout']) ? 't.'.qi('timeout').' >= ' . \FOP\Database::quote($params['range_min_campaignFollow_timeout']) . ' AND ' : '') : '') . 
								(isset($params['range_max_campaignFollow_timeout']) ? ($params['range_max_campaignFollow_timeout'] !== '' && is_numeric($params['range_max_campaignFollow_timeout']) ? 't.'.qi('timeout').' <= ' . \FOP\Database::quote($params['range_max_campaignFollow_timeout']) . ' AND ' : '') : '') . 
								(isset($params['filter_campaignFollow_campaign']) ? ($params['filter_campaignFollow_campaign'] !== '' ? ('(' . (new \FOP\IDList($params['filter_campaignFollow_campaign']))->toSQL('t.'.qi('campaign').'') . ') AND ') : '') : '') . 
								(isset($params['filter_campaignFollow_state']) ? ($params['filter_campaignFollow_state'] !== '' ? ('(' . (new \FOP\IDList($params['filter_campaignFollow_state']))->toSQL('t.'.qi('state').'') . ') AND ') : '') : '') . 
								(isset($params['filter_campaignFollow_nextCampaign']) ? ($params['filter_campaignFollow_nextCampaign'] !== '' ? ('(' . (new \FOP\IDList($params['filter_campaignFollow_nextCampaign']))->toSQL('t.'.qi('nextCampaign').'') . ') AND ') : '') : '') . 
								(isset($params['filter_campaignFollow_timeout']) ? ($params['filter_campaignFollow_timeout'] !== '' ? ('(' . (new \FOP\IDList($params['filter_campaignFollow_timeout']))->toSQL('t.'.qi('timeout').'') . ') AND ') : '') : '') . 
								(isset($params['filter_campaignFollow_nextState']) ? ($params['filter_campaignFollow_nextState'] !== '' ? ('(' . (new \FOP\IDList($params['filter_campaignFollow_nextState']))->toSQL('t.'.qi('nextState').'') . ') AND ') : '') : '') . 
								(isset($params['filter_campaignFollow_ID']) ? ($params['filter_campaignFollow_ID'] !== '' ? ('(' . (new \FOP\IDList($params['filter_campaignFollow_ID']))->toSQL('t.'.qi('ID').'') . ') AND ') : '') : '') . 
								'
								 TRUE ';
								return $sql;
	
    
  }

  public static function getfilter_campaignFollow_stateItemsByStringAction($fstr) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
		// Auf aktive DataView-Items einschränken
		$params = $_GET;
		unset($params['filter_campaignFollow_state']);
		return \Types\CampaignState::getItems(null, -1, $fstr, ''.qi('ID').' IN (SELECT DISTINCT t.'.qi('state').''.self::getSQL($params).')');
	

    
  }

  public static function getfilter_campaignFollow_nextStateItemsByStringAction($fstr) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
		// Auf aktive DataView-Items einschränken
		$params = $_GET;
		unset($params['filter_campaignFollow_nextState']);
		return \Types\CampaignState::getItems(null, -1, $fstr, ''.qi('ID').' IN (SELECT DISTINCT t.'.qi('nextState').''.self::getSQL($params).')');
	

    
  }

  public static function getfilter_campaignFollow_campaignItemsByStringAction($fstr) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
		// Auf aktive DataView-Items einschränken
		$params = $_GET;
		unset($params['filter_campaignFollow_campaign']);
		return \Types\CampaignNullFollow::getItems(null, -1, $fstr, ''.qi('ID').' IN (SELECT DISTINCT t.'.qi('campaign').''.self::getSQL($params).')');
	

    
  }

  public static function getfilter_campaignFollow_nextCampaignItemsByStringAction($fstr) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
		// Auf aktive DataView-Items einschränken
		$params = $_GET;
		unset($params['filter_campaignFollow_nextCampaign']);
		return \Types\CampaignNullFollow::getItems(null, -1, $fstr, ''.qi('ID').' IN (SELECT DISTINCT t.'.qi('nextCampaign').''.self::getSQL($params).')');
	

    
  }

  public static function getData($sqladdon, $params, $stream = false ) { 
    
    
    // --- BLOCK: main ---
    
								$sql = self::getSQL($params);

								$order = (\FOP\Util::array_value(array(
									'campaign ASC' => 'ORDER BY '.qi('sorter-campaign').'.'.qi('pinned').' DESC, '.qi('sorter-campaign').'.'.qi('lastUpdate').' DESC',
									'nextCampaign ASC' => 'ORDER BY '.qi('sorter-nextCampaign').'.'.qi('pinned').' DESC, '.qi('sorter-nextCampaign').'.'.qi('lastUpdate').' DESC',
									'campaign DESC' => 'ORDER BY '.qi('sorter-campaign').'.'.qi('pinned').' ASC, '.qi('sorter-campaign').'.'.qi('lastUpdate').' ASC',
									'nextCampaign DESC' => 'ORDER BY '.qi('sorter-nextCampaign').'.'.qi('pinned').' ASC, '.qi('sorter-nextCampaign').'.'.qi('lastUpdate').' ASC',
									'timeout ASC' => 'ORDER BY t.'.qi('timeout').' ASC',
									'timeout DESC' => 'ORDER BY t.'.qi('timeout').' DESC',
									'' => ''), isset($params['sort_campaignFollow']) ? $params['sort_campaignFollow'] : '') ?: '');
								// wenn sqladdon bereits ein ORDER enthält, kein order aufbauen
								if (strpos($sqladdon, 'ORDER') !== false) {
									$order = '';
								}
								if ($stream) {
									// als Stream (währenddessen darf keine weitere SQL-Query laufen) für große Datenmengen und Statistiken
									$result = (function () use ($sql, $order, $sqladdon) {
										$stream = \FOP\Database::query('SELECT t.* ' . $sql . $order . $sqladdon);
										while ($item = $stream->fetch(\PDO::FETCH_ASSOC)) {
											$item['campaign'] = \FOP\Sanitizers::null_converter($item['campaign']);
											$item['state'] = \FOP\Sanitizers::null_converter($item['state']);
											$item['nextCampaign'] = \FOP\Sanitizers::null_converter($item['nextCampaign']);
											$item['timeout'] = \Types\Integer::unpack($item['timeout']);
											$item['nextState'] = \FOP\Sanitizers::null_converter($item['nextState']);
											
											yield $item;
										}
									})();
								} else {
									// als RAM-Array
									$result = \FOP\Database::query('SELECT t.* ' . $sql . $order . $sqladdon);
									$arr = $result->fetchAll(\PDO::FETCH_ASSOC);
									$itemcount = count($arr);

									foreach($arr as $i => &$item){
										$item['campaign'] = \FOP\Sanitizers::null_converter($item['campaign']);
										$item['state'] = \FOP\Sanitizers::null_converter($item['state']);
										$item['nextCampaign'] = \FOP\Sanitizers::null_converter($item['nextCampaign']);
										$item['timeout'] = \Types\Integer::unpack($item['timeout']);
										$item['nextState'] = \FOP\Sanitizers::null_converter($item['nextState']);
										
									}
									unset($item);

									$result = ["items" => $arr, "itemcount" => $itemcount];

									
								}

								return $result;
	
    
  }

  public static function getFilterHTML($params, $delimiter = ', ' , $showButton = true ) { 
    
    
    // --- BLOCK: main ---
    
		// Contract: ist showButton == false, sollten keine HTML-Tags im Output enthalten sein (Verwendung in Dateinamen!!)
		$filters = [];
		
	if (isset($params['range_min_campaignFollow_timeout']) && isset($params['range_max_campaignFollow_timeout'])) {
		array_push($filters, _('Timeout / Tage') . ': ' . (\Types\Integer::print($params['range_min_campaignFollow_timeout'])
	) . ' ' . _('filters_between') . ' ' . (\Types\Integer::print($params['range_max_campaignFollow_timeout'])
	));
	} else if (isset($params['range_min_campaignFollow_timeout'])) {
		array_push($filters, _('Timeout / Tage') . ': ' . _('filters_from') . ' ' . (\Types\Integer::print($params['range_min_campaignFollow_timeout'])
	));
	} else if (isset($params['range_max_campaignFollow_timeout'])) {
		array_push($filters, _('Timeout / Tage') . ': ' . _('filters_to') . ' ' . (\Types\Integer::print($params['range_max_campaignFollow_timeout'])
	));
	}if (isset($params['filter_campaignFollow_timeout'])) {
		if ($params['filter_campaignFollow_timeout'] == '_null') {
			array_push($filters, _('Timeout / Tage') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_campaignFollow_timeout']))->all() AS $val) {
				$value = \Types\Integer::print($val)
	;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Timeout / Tage') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_campaignFollow_campaign'])) {
		if ($params['filter_campaignFollow_campaign'] == '_null') {
			array_push($filters, _('Aktion') . ': ' . _('Zustandswechsel nach Timeout'));
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_campaignFollow_campaign']))->all() AS $val) {
				$value = 
  \FOP\Database::query('SELECT '.qi('campaign').'.'.qi('name').' AS description FROM '.qi('campaign').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($val))->fetchColumn() ?: _('Zustandswechsel nach Timeout')
;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Aktion') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_campaignFollow_state'])) {
		if ($params['filter_campaignFollow_state'] == '_null') {
			array_push($filters, _('Zustand') . ': ' . _(''));
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_campaignFollow_state']))->all() AS $val) {
				$value = 
  \FOP\Database::query('SELECT '.qi('campaignState').'.'.qi('desc').' AS description FROM '.qi('campaignState').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($val))->fetchColumn() ?: _('')
;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Zustand') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_campaignFollow_nextCampaign'])) {
		if ($params['filter_campaignFollow_nextCampaign'] == '_null') {
			array_push($filters, _('Nächste Kampagne') . ': ' . _('Zustandswechsel nach Timeout'));
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_campaignFollow_nextCampaign']))->all() AS $val) {
				$value = 
  \FOP\Database::query('SELECT '.qi('campaign').'.'.qi('name').' AS description FROM '.qi('campaign').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($val))->fetchColumn() ?: _('Zustandswechsel nach Timeout')
;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Nächste Kampagne') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_campaignFollow_nextState'])) {
		if ($params['filter_campaignFollow_nextState'] == '_null') {
			array_push($filters, _('Neuer Zustand') . ': ' . _(''));
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_campaignFollow_nextState']))->all() AS $val) {
				$value = 
  \FOP\Database::query('SELECT '.qi('campaignState').'.'.qi('desc').' AS description FROM '.qi('campaignState').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($val))->fetchColumn() ?: _('')
;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Neuer Zustand') . ': ' . implode(', ', $values));
		}
	}
		if (count($filters)) {
			$result = implode($delimiter, array_map(function ($filter) {
				if (is_array($filter)) {
					return implode('', $filter);
				}
				return htmlentities($filter);
			}, $filters))
			// Button, um Filter zu entfernen
			. ($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="for (var q in query) {if (q.includes(\'_campaignFollow_\')) delete query[q];} reloadcampaignFollow(); ">clear</i>' : '');
		} else {
			$result = _('no_filter');
		}
		return $result;
	
    
  }

  public static function openAction($fop_table, $fop_id, $fop_from) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    

if ($fop_table == 'campaignFollow') {
	\FOP\Session::setPayload('dv-campaignFollow', [
		'id' => 'campaignFollow',
		'tbl' => 'campaignFollow',
		'idcol' => 'ID',
		'prev' => \DataViewRouter\CampaignFollow::stepURL('campaignFollow', 'XXX', -1),
		'next' => \DataViewRouter\CampaignFollow::stepURL('campaignFollow', 'XXX',  1),
		'from' => $fop_from
	]);
	
	if ($fop_id == '_') return; // nur Rückreferenz setzen, nicht öffnen
	$params = [];
	if (isset($_GET['popup'])) $params['popup'] = true;
	if (isset($_GET['from'])) $params['from'] = $_GET['from'];
	$params['id'] = $fop_id;
	
	$url = \TablesRouter\CampaignFollow::viewURL2($params);
	header('Location: ' . $url);
}

die();
    
  }

  public static function stepAction($tbl, $id, $step) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
	$dv = \FOP\Session::getPayload('dv-'.$tbl);
	$url = $dv['from'];
	$parts = parse_url($url);
	parse_str($parts['query'], $query);
	$data = self::getData('', $query);
	$col = $dv['idcol'];
	$ids = array_map(function ($x) use ($col) {return $x[$col];}, $data['items']);
	if (!count($ids)) {
		header('Location: ' . \FOP\Util::getCurrentBaseurl() . 'Tables/' . preg_replace('/[^a-zA-Z0-9_]/', '_', ucfirst($dv['tbl'])));
		die();
	}
	$idx = array_search($id, $ids);
	$idx += count($ids) + $step;
	$idx = $idx % count($ids);
	header('Location: ' . \FOP\Util::getCurrentBaseurl() . 'Tables/' . preg_replace('/[^a-zA-Z0-9_]/', '_', ucfirst($dv['tbl'])) . '/view?id=' . urlencode($ids[$idx]));
	die();

    
  }


  
  

  
  
}



