<?php

namespace DataView;

class Userconfig {
  
  

  
  

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

		var i94b39213b7e21f477fbe24dce2aae6209de88fb1cd84f3e30108650a20ef35c9timeout = null;
		function changefilter_userconfig_Tables_Doc_defaultDoctypeSearchFilter(val, callback) {
			if(i94b39213b7e21f477fbe24dce2aae6209de88fb1cd84f3e30108650a20ef35c9timeout) clearTimeout(i94b39213b7e21f477fbe24dce2aae6209de88fb1cd84f3e30108650a20ef35c9timeout);

			i94b39213b7e21f477fbe24dce2aae6209de88fb1cd84f3e30108650a20ef35c9timeout = setTimeout(function() {
				$.getJSON(reloaduserconfig({action: 'getfilter_userconfig_Tables_Doc_defaultDoctypeItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_userconfig_Tables_Doc_defaultDoctype_orig'] = val;
				});
			}, 300);
		}

	function getfilter_userconfig_Tables_Doc_defaultDoctypeListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_userconfig_Tables_Doc_defaultDoctype_orig']) ? json_encode($_GET['filter_userconfig_Tables_Doc_defaultDoctype_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="94b39213b7e21f477fbe24dce2aae6209de88fb1cd84f3e30108650a20ef35c9" type="text">' +
			'<label class="mdl-textfield__label" for="94b39213b7e21f477fbe24dce2aae6209de88fb1cd84f3e30108650a20ef35c9">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_userconfig_Tables_Doc_defaultDoctype', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_userconfig_Tables_Doc_defaultDoctype_orig'] = '';
					delete query['filter_userconfig_Tables_Doc_defaultDoctype'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloaduserconfig();
					
				} else {
					$('#table_userconfig').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_userconfig_Tables_Doc_defaultDoctypeSearchFilter(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\Userconfig::getfilter_userconfig_Tables_Doc_defaultDoctypeItemsByStringAction(''));
		?>;

		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_userconfig_Tables_Doc_defaultDoctype_orig'] = '';
				delete query['filter_userconfig_Tables_Doc_defaultDoctype'];
				reload('', items);reloaduserconfig();
				
			})).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_userconfig_Tables_Doc_defaultDoctype', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_userconfig_Tables_Doc_defaultDoctypeListMultiFilter("' + 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_userconfig_Tables_Doc_defaultDoctypeListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_userconfig_Tables_Doc_defaultDoctype', val, cb.checked);
		  } else {
			  delete query['filter_userconfig_Tables_Doc_defaultDoctype'];
		  }reloaduserconfig();
        
    }

		var i94b39213b7e21f477fbe24dce2aae6209de88fb1cd84f3e30108650a20ef35c9timeout = null;
		function changefilter_userconfig_Tables_Doc_defaultDoctypeSearchFilter(val, callback) {
			if(i94b39213b7e21f477fbe24dce2aae6209de88fb1cd84f3e30108650a20ef35c9timeout) clearTimeout(i94b39213b7e21f477fbe24dce2aae6209de88fb1cd84f3e30108650a20ef35c9timeout);

			i94b39213b7e21f477fbe24dce2aae6209de88fb1cd84f3e30108650a20ef35c9timeout = setTimeout(function() {
				$.getJSON(reloaduserconfig({action: 'getfilter_userconfig_Tables_Doc_defaultDoctypeItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_userconfig_Tables_Doc_defaultDoctype_orig'] = val;
				});
			}, 300);
		}

	function getfilter_userconfig_Tables_Doc_defaultDoctypeListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_userconfig_Tables_Doc_defaultDoctype_orig']) ? json_encode($_GET['filter_userconfig_Tables_Doc_defaultDoctype_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="94b39213b7e21f477fbe24dce2aae6209de88fb1cd84f3e30108650a20ef35c9" type="text">' +
			'<label class="mdl-textfield__label" for="94b39213b7e21f477fbe24dce2aae6209de88fb1cd84f3e30108650a20ef35c9">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_userconfig_Tables_Doc_defaultDoctype', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_userconfig_Tables_Doc_defaultDoctype_orig'] = '';
					delete query['filter_userconfig_Tables_Doc_defaultDoctype'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloaduserconfig();
					
				} else {
					$('#table_userconfig').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_userconfig_Tables_Doc_defaultDoctypeSearchFilter(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\Userconfig::getfilter_userconfig_Tables_Doc_defaultDoctypeItemsByStringAction(''));
		?>;

		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_userconfig_Tables_Doc_defaultDoctype_orig'] = '';
				delete query['filter_userconfig_Tables_Doc_defaultDoctype'];
				reload('', items);reloaduserconfig();
				
			})).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_userconfig_Tables_Doc_defaultDoctype', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_userconfig_Tables_Doc_defaultDoctypeListMultiFilter("' + 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 updateNumberuserconfig(col) {
										//var checklist = window.DataViewChecked['userconfig'][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['userconfig'] && window.DataViewChecked['userconfig'][col].ranges.length > 0) {
											$('.userconfig__mass-action').css('visibility', 'visible');
											$('.userconfig__action').css('visibility', 'hidden');
										} else {
											$('.userconfig__mass-action').css('visibility', 'hidden');
											$('.userconfig__action').css('visibility', 'visible');
										}
										$('.userconfig__checkbox').each(function (idx, x) {
											for (var cssclass of x.classList) {
												if (cssclass.startsWith('userconfig__checkbox-'+col+'-')) {
													var my_id = cssclass.substr(('userconfig__checkbox-'+col+'-').length);
													if (window.DataViewChecked) {
														x.MaterialCheckbox[checklist.has(my_id) ? 'check' : 'uncheck']();
													}
												}
											}
										});
									}
									function reloaduserconfig (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/Userconfig/" + 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::getAdmin())) && ((false))) { ?>
											delete nq['action'];
											querystr = "DataView/Userconfig/renderTabTable?" + Object.keys(nq).map(function(k){ return k + "=" +  encodeURIComponent(nq[k]); }).join("&");
											// per Ajax laden
											if(!$("#userconfig-table")?.parent()?.parent()?.hasClass('fop-form-feature-collapsed') || $("#userconfig-table")?.parent()?.parent()?.hasClass('fop-form-feature-mode-area')) {
											$.get(querystr, function(data){
												var tab = $("#userconfig-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
												updateNumberuserconfig('ID');
											});
											} else {
												// gesamten Tab ersetzen
												var tab = $("#userconfig-table");
												tab.children().remove();
												el = tab.html('<div class="fop-lazy-reload" onclick="reloaduserconfig()"></div>');
											}
											<?php } ?>
											
										}
									}
									function checkuserconfig (id, col, checked) {
										// ID-Liste aufbauen
										if (!window.DataViewChecked) window.DataViewChecked = {};
										if (!window.DataViewChecked['userconfig']) window.DataViewChecked['userconfig'] = {};
										if (!window.DataViewChecked['userconfig'][col]) window.DataViewChecked['userconfig'][col] = new IDList();

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

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

    
  }

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

	</script>
	<?php
	
    
  }

  public static function renderTabTableAction() { 
    
    // Methodenimplementierung überschrieben.
    throw new \FOP\AccessDeniedException();return false;
  }

  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 ((FALSE)) WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('delete').' FROM '.qi('userconfig').' 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 /* Configuration_Stammdaten_bankname */ '.qi('Configuration_Stammdaten_bankname').' AS '.qi('Configuration_Stammdaten_bankname').',
									/* Configuration_Stammdaten_bic */ '.qi('Configuration_Stammdaten_bic').' AS '.qi('Configuration_Stammdaten_bic').',
									/* Configuration_Stammdaten_email */ '.qi('Configuration_Stammdaten_email').' AS '.qi('Configuration_Stammdaten_email').',
									/* Configuration_Stammdaten_fax */ '.qi('Configuration_Stammdaten_fax').' AS '.qi('Configuration_Stammdaten_fax').',
									/* Configuration_Stammdaten_finanzamt */ '.qi('Configuration_Stammdaten_finanzamt').' AS '.qi('Configuration_Stammdaten_finanzamt').',
									/* Configuration_Stammdaten_firmenname */ '.qi('Configuration_Stammdaten_firmenname').' AS '.qi('Configuration_Stammdaten_firmenname').',
									/* Configuration_Stammdaten_firmenname2 */ '.qi('Configuration_Stammdaten_firmenname2').' AS '.qi('Configuration_Stammdaten_firmenname2').',
									/* Configuration_Stammdaten_flst */ '.qi('Configuration_Stammdaten_flst').' AS '.qi('Configuration_Stammdaten_flst').',
									/* Configuration_Stammdaten_geschaeftsfuehrer1 */ '.qi('Configuration_Stammdaten_geschaeftsfuehrer1').' AS '.qi('Configuration_Stammdaten_geschaeftsfuehrer1').',
									/* Configuration_Stammdaten_geschaeftsfuehrer2 */ '.qi('Configuration_Stammdaten_geschaeftsfuehrer2').' AS '.qi('Configuration_Stammdaten_geschaeftsfuehrer2').',
									/* Configuration_Stammdaten_handelsregisternummer */ '.qi('Configuration_Stammdaten_handelsregisternummer').' AS '.qi('Configuration_Stammdaten_handelsregisternummer').',
									/* Configuration_Stammdaten_headerText */ '.qi('Configuration_Stammdaten_headerText').' AS '.qi('Configuration_Stammdaten_headerText').',
									/* Configuration_Stammdaten_iban */ '.qi('Configuration_Stammdaten_iban').' AS '.qi('Configuration_Stammdaten_iban').',
									/* Configuration_Stammdaten_logo */ '.qi('Configuration_Stammdaten_logo').' AS '.qi('Configuration_Stammdaten_logo').',
									/* Configuration_Stammdaten_mobil */ '.qi('Configuration_Stammdaten_mobil').' AS '.qi('Configuration_Stammdaten_mobil').',
									/* Configuration_Stammdaten_ort */ '.qi('Configuration_Stammdaten_ort').' AS '.qi('Configuration_Stammdaten_ort').',
									/* Configuration_Stammdaten_plz */ '.qi('Configuration_Stammdaten_plz').' AS '.qi('Configuration_Stammdaten_plz').',
									/* Configuration_Stammdaten_registergericht */ '.qi('Configuration_Stammdaten_registergericht').' AS '.qi('Configuration_Stammdaten_registergericht').',
									/* Configuration_Stammdaten_steuernr */ '.qi('Configuration_Stammdaten_steuernr').' AS '.qi('Configuration_Stammdaten_steuernr').',
									/* Configuration_Stammdaten_strasse */ '.qi('Configuration_Stammdaten_strasse').' AS '.qi('Configuration_Stammdaten_strasse').',
									/* Configuration_Stammdaten_telefon */ '.qi('Configuration_Stammdaten_telefon').' AS '.qi('Configuration_Stammdaten_telefon').',
									/* Configuration_Stammdaten_umsatzsteuerid */ '.qi('Configuration_Stammdaten_umsatzsteuerid').' AS '.qi('Configuration_Stammdaten_umsatzsteuerid').',
									/* Configuration_Stammdaten_website */ '.qi('Configuration_Stammdaten_website').' AS '.qi('Configuration_Stammdaten_website').',
									/* FOP_AI_precontext */ '.qi('FOP_AI_precontext').' AS '.qi('FOP_AI_precontext').',
									/* FOP_AI_token */ '.qi('FOP_AI_token').' AS '.qi('FOP_AI_token').',
									/* FOP_Index_Impressum */ '.qi('FOP_Index_Impressum').' AS '.qi('FOP_Index_Impressum').',
									/* ID */ '.qi('ID').' AS '.qi('ID').',
									/* RevisionEmail_Doc_auth */ '.qi('RevisionEmail_Doc_auth').' AS '.qi('RevisionEmail_Doc_auth').',
									/* RevisionEmail_Doc_host */ '.qi('RevisionEmail_Doc_host').' AS '.qi('RevisionEmail_Doc_host').',
									/* RevisionEmail_Doc_password */ '.qi('RevisionEmail_Doc_password').' AS '.qi('RevisionEmail_Doc_password').',
									/* RevisionEmail_Doc_port */ '.qi('RevisionEmail_Doc_port').' AS '.qi('RevisionEmail_Doc_port').',
									/* RevisionEmail_Doc_syncdate */ '.qi('RevisionEmail_Doc_syncdate').' AS '.qi('RevisionEmail_Doc_syncdate').',
									/* RevisionEmail_Doc_username */ '.qi('RevisionEmail_Doc_username').' AS '.qi('RevisionEmail_Doc_username').',
									/* Tables_Doc_defaultDoctype */ '.qi('Tables_Doc_defaultDoctype').' AS '.qi('Tables_Doc_defaultDoctype').',
									/* Tables_Doc_defaultDoctype::canView */ '.qi('ref:Tables_Doc_defaultDoctype').'.'.qi('Tables_Doc_defaultDoctype:canView').' AS '.qi('Tables_Doc_defaultDoctype::canView').',
									/* Tables_Doc_defaultDoctype::description */ '.qi('ref:Tables_Doc_defaultDoctype').'.'.qi('Tables_Doc_defaultDoctype:description').' AS '.qi('Tables_Doc_defaultDoctype::description').',
									/* operation::create */ ' . ((false) ? 1 : 0) . ' AS '.qi('operation::create').',
									/* operation::delete */ (FALSE) AS '.qi('operation::delete').',
									/* operation::edit */ ('.\FOP\Database::quote(\FOP\User::getAdmin()).') AS '.qi('operation::edit').',
									/* operation::index */ ' . ((false) ? 1 : 0) . ' AS '.qi('operation::index').',
									/* operation::view */ ('.\FOP\Database::quote(\FOP\User::getAdmin()).') AS '.qi('operation::view').',
									1
								FROM '.qi('userconfig').' '.qi('userconfig').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('Tables_Doc_defaultDoctype:ID').', '.qi('docType').'.'.qi('name').' AS '.qi('Tables_Doc_defaultDoctype:description').', (('.\FOP\Database::quote(\FOP\User::getDokument()).')) AS '.qi('Tables_Doc_defaultDoctype:canView').' FROM '.qi('docType').') '.qi('ref:Tables_Doc_defaultDoctype').' ON '.qi('ref:Tables_Doc_defaultDoctype').'.'.qi('Tables_Doc_defaultDoctype:ID').' = '.qi('Tables_Doc_defaultDoctype').'
								WHERE ((('.\FOP\Database::quote(\FOP\User::getAdmin()).')))) AS t
								LEFT JOIN '.qi('docType').' AS '.qi('sorter-Tables_Doc_defaultDoctype').' ON t.'.qi('Tables_Doc_defaultDoctype').' = '.qi('sorter-Tables_Doc_defaultDoctype').'.'.qi('ID').'
								WHERE ' . (isset($params['range_min_userconfig_RevisionEmail_Doc_syncdate']) ? ($params['range_min_userconfig_RevisionEmail_Doc_syncdate'] !== '' && is_numeric($params['range_min_userconfig_RevisionEmail_Doc_syncdate']) ? 't.'.qi('RevisionEmail_Doc_syncdate').' >= ' . \FOP\Database::quote($params['range_min_userconfig_RevisionEmail_Doc_syncdate']) . ' AND ' : '') : '') . 
								(isset($params['range_max_userconfig_RevisionEmail_Doc_syncdate']) ? ($params['range_max_userconfig_RevisionEmail_Doc_syncdate'] !== '' && is_numeric($params['range_max_userconfig_RevisionEmail_Doc_syncdate']) ? 't.'.qi('RevisionEmail_Doc_syncdate').' <= ' . \FOP\Database::quote($params['range_max_userconfig_RevisionEmail_Doc_syncdate']) . ' AND ' : '') : '') . 
								(isset($params['fullsearch_userconfig_Configuration_Stammdaten_logo']) && $params['fullsearch_userconfig_Configuration_Stammdaten_logo'] ? 't.'.qi('Configuration_Stammdaten_logo').' IN (SELECT '.qi('ID').' FROM fop_files WHERE filename LIKE '.\FOP\Database::quote('%' . $params['fullsearch_userconfig_Configuration_Stammdaten_logo'] . '%').') AND ' : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_logo']) ? ($params['filter_userconfig_Configuration_Stammdaten_logo'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_logo']))->toSQL('t.'.qi('Configuration_Stammdaten_logo').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_headerText']) ? ($params['filter_userconfig_Configuration_Stammdaten_headerText'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_headerText']))->toSQL('t.'.qi('Configuration_Stammdaten_headerText').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_firmenname']) ? ($params['filter_userconfig_Configuration_Stammdaten_firmenname'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_firmenname']))->toSQL('t.'.qi('Configuration_Stammdaten_firmenname').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_firmenname2']) ? ($params['filter_userconfig_Configuration_Stammdaten_firmenname2'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_firmenname2']))->toSQL('t.'.qi('Configuration_Stammdaten_firmenname2').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_strasse']) ? ($params['filter_userconfig_Configuration_Stammdaten_strasse'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_strasse']))->toSQL('t.'.qi('Configuration_Stammdaten_strasse').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_flst']) ? ($params['filter_userconfig_Configuration_Stammdaten_flst'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_flst']))->toSQL('t.'.qi('Configuration_Stammdaten_flst').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_plz']) ? ($params['filter_userconfig_Configuration_Stammdaten_plz'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_plz']))->toSQL('t.'.qi('Configuration_Stammdaten_plz').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_ort']) ? ($params['filter_userconfig_Configuration_Stammdaten_ort'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_ort']))->toSQL('t.'.qi('Configuration_Stammdaten_ort').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_telefon']) ? ($params['filter_userconfig_Configuration_Stammdaten_telefon'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_telefon']))->toSQL('t.'.qi('Configuration_Stammdaten_telefon').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_mobil']) ? ($params['filter_userconfig_Configuration_Stammdaten_mobil'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_mobil']))->toSQL('t.'.qi('Configuration_Stammdaten_mobil').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_fax']) ? ($params['filter_userconfig_Configuration_Stammdaten_fax'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_fax']))->toSQL('t.'.qi('Configuration_Stammdaten_fax').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_email']) ? ($params['filter_userconfig_Configuration_Stammdaten_email'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_email']))->toSQL('t.'.qi('Configuration_Stammdaten_email').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_website']) ? ($params['filter_userconfig_Configuration_Stammdaten_website'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_website']))->toSQL('t.'.qi('Configuration_Stammdaten_website').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_iban']) ? ($params['filter_userconfig_Configuration_Stammdaten_iban'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_iban']))->toSQL('t.'.qi('Configuration_Stammdaten_iban').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_bic']) ? ($params['filter_userconfig_Configuration_Stammdaten_bic'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_bic']))->toSQL('t.'.qi('Configuration_Stammdaten_bic').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_bankname']) ? ($params['filter_userconfig_Configuration_Stammdaten_bankname'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_bankname']))->toSQL('t.'.qi('Configuration_Stammdaten_bankname').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_geschaeftsfuehrer1']) ? ($params['filter_userconfig_Configuration_Stammdaten_geschaeftsfuehrer1'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_geschaeftsfuehrer1']))->toSQL('t.'.qi('Configuration_Stammdaten_geschaeftsfuehrer1').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_geschaeftsfuehrer2']) ? ($params['filter_userconfig_Configuration_Stammdaten_geschaeftsfuehrer2'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_geschaeftsfuehrer2']))->toSQL('t.'.qi('Configuration_Stammdaten_geschaeftsfuehrer2').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_registergericht']) ? ($params['filter_userconfig_Configuration_Stammdaten_registergericht'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_registergericht']))->toSQL('t.'.qi('Configuration_Stammdaten_registergericht').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_handelsregisternummer']) ? ($params['filter_userconfig_Configuration_Stammdaten_handelsregisternummer'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_handelsregisternummer']))->toSQL('t.'.qi('Configuration_Stammdaten_handelsregisternummer').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_finanzamt']) ? ($params['filter_userconfig_Configuration_Stammdaten_finanzamt'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_finanzamt']))->toSQL('t.'.qi('Configuration_Stammdaten_finanzamt').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_steuernr']) ? ($params['filter_userconfig_Configuration_Stammdaten_steuernr'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_steuernr']))->toSQL('t.'.qi('Configuration_Stammdaten_steuernr').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Configuration_Stammdaten_umsatzsteuerid']) ? ($params['filter_userconfig_Configuration_Stammdaten_umsatzsteuerid'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_umsatzsteuerid']))->toSQL('t.'.qi('Configuration_Stammdaten_umsatzsteuerid').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_FOP_AI_token']) ? ($params['filter_userconfig_FOP_AI_token'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_FOP_AI_token']))->toSQL('t.'.qi('FOP_AI_token').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_FOP_AI_precontext']) ? ($params['filter_userconfig_FOP_AI_precontext'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_FOP_AI_precontext']))->toSQL('t.'.qi('FOP_AI_precontext').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_Tables_Doc_defaultDoctype']) ? ($params['filter_userconfig_Tables_Doc_defaultDoctype'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_Tables_Doc_defaultDoctype']))->toSQL('t.'.qi('Tables_Doc_defaultDoctype').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_RevisionEmail_Doc_host']) ? ($params['filter_userconfig_RevisionEmail_Doc_host'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_RevisionEmail_Doc_host']))->toSQL('t.'.qi('RevisionEmail_Doc_host').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_RevisionEmail_Doc_port']) ? ($params['filter_userconfig_RevisionEmail_Doc_port'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_RevisionEmail_Doc_port']))->toSQL('t.'.qi('RevisionEmail_Doc_port').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_RevisionEmail_Doc_auth']) ? ($params['filter_userconfig_RevisionEmail_Doc_auth'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_RevisionEmail_Doc_auth']))->toSQL('t.'.qi('RevisionEmail_Doc_auth').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_RevisionEmail_Doc_username']) ? ($params['filter_userconfig_RevisionEmail_Doc_username'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_RevisionEmail_Doc_username']))->toSQL('t.'.qi('RevisionEmail_Doc_username').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_RevisionEmail_Doc_password']) ? ($params['filter_userconfig_RevisionEmail_Doc_password'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_RevisionEmail_Doc_password']))->toSQL('t.'.qi('RevisionEmail_Doc_password').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_RevisionEmail_Doc_syncdate']) ? ($params['filter_userconfig_RevisionEmail_Doc_syncdate'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_RevisionEmail_Doc_syncdate']))->toSQL('t.'.qi('RevisionEmail_Doc_syncdate').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_FOP_Index_Impressum']) ? ($params['filter_userconfig_FOP_Index_Impressum'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_FOP_Index_Impressum']))->toSQL('t.'.qi('FOP_Index_Impressum').'') . ') AND ') : '') : '') . 
								(isset($params['filter_userconfig_ID']) ? ($params['filter_userconfig_ID'] !== '' ? ('(' . (new \FOP\IDList($params['filter_userconfig_ID']))->toSQL('t.'.qi('ID').'') . ') AND ') : '') : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_headerText']) ? 't.'.qi('Configuration_Stammdaten_headerText').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_headerText'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_firmenname']) ? 't.'.qi('Configuration_Stammdaten_firmenname').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_firmenname'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_firmenname2']) ? 't.'.qi('Configuration_Stammdaten_firmenname2').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_firmenname2'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_strasse']) ? 't.'.qi('Configuration_Stammdaten_strasse').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_strasse'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_flst']) ? 't.'.qi('Configuration_Stammdaten_flst').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_flst'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_plz']) ? 't.'.qi('Configuration_Stammdaten_plz').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_plz'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_ort']) ? 't.'.qi('Configuration_Stammdaten_ort').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_ort'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_telefon']) ? 't.'.qi('Configuration_Stammdaten_telefon').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_telefon'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_mobil']) ? 't.'.qi('Configuration_Stammdaten_mobil').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_mobil'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_fax']) ? 't.'.qi('Configuration_Stammdaten_fax').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_fax'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_email']) ? 't.'.qi('Configuration_Stammdaten_email').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_email'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_website']) ? 't.'.qi('Configuration_Stammdaten_website').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_website'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_iban']) ? 't.'.qi('Configuration_Stammdaten_iban').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_iban'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_bic']) ? 't.'.qi('Configuration_Stammdaten_bic').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_bic'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_bankname']) ? 't.'.qi('Configuration_Stammdaten_bankname').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_bankname'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_geschaeftsfuehrer1']) ? 't.'.qi('Configuration_Stammdaten_geschaeftsfuehrer1').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_geschaeftsfuehrer1'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_geschaeftsfuehrer2']) ? 't.'.qi('Configuration_Stammdaten_geschaeftsfuehrer2').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_geschaeftsfuehrer2'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_registergericht']) ? 't.'.qi('Configuration_Stammdaten_registergericht').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_registergericht'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_handelsregisternummer']) ? 't.'.qi('Configuration_Stammdaten_handelsregisternummer').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_handelsregisternummer'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_finanzamt']) ? 't.'.qi('Configuration_Stammdaten_finanzamt').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_finanzamt'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_steuernr']) ? 't.'.qi('Configuration_Stammdaten_steuernr').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_steuernr'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_Configuration_Stammdaten_umsatzsteuerid']) ? 't.'.qi('Configuration_Stammdaten_umsatzsteuerid').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_Configuration_Stammdaten_umsatzsteuerid'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_FOP_AI_token']) ? 't.'.qi('FOP_AI_token').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_FOP_AI_token'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_FOP_AI_precontext']) ? 't.'.qi('FOP_AI_precontext').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_FOP_AI_precontext'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_RevisionEmail_Doc_host']) ? 't.'.qi('RevisionEmail_Doc_host').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_RevisionEmail_Doc_host'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_RevisionEmail_Doc_port']) ? 't.'.qi('RevisionEmail_Doc_port').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_RevisionEmail_Doc_port'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_RevisionEmail_Doc_username']) ? 't.'.qi('RevisionEmail_Doc_username').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_RevisionEmail_Doc_username'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig_FOP_Index_Impressum']) ? 't.'.qi('FOP_Index_Impressum').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig_FOP_Index_Impressum'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_headerText']) ? 'NOT t.'.qi('Configuration_Stammdaten_headerText').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_headerText'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_firmenname']) ? 'NOT t.'.qi('Configuration_Stammdaten_firmenname').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_firmenname'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_firmenname2']) ? 'NOT t.'.qi('Configuration_Stammdaten_firmenname2').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_firmenname2'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_strasse']) ? 'NOT t.'.qi('Configuration_Stammdaten_strasse').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_strasse'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_flst']) ? 'NOT t.'.qi('Configuration_Stammdaten_flst').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_flst'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_plz']) ? 'NOT t.'.qi('Configuration_Stammdaten_plz').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_plz'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_ort']) ? 'NOT t.'.qi('Configuration_Stammdaten_ort').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_ort'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_telefon']) ? 'NOT t.'.qi('Configuration_Stammdaten_telefon').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_telefon'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_mobil']) ? 'NOT t.'.qi('Configuration_Stammdaten_mobil').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_mobil'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_fax']) ? 'NOT t.'.qi('Configuration_Stammdaten_fax').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_fax'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_email']) ? 'NOT t.'.qi('Configuration_Stammdaten_email').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_email'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_website']) ? 'NOT t.'.qi('Configuration_Stammdaten_website').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_website'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_iban']) ? 'NOT t.'.qi('Configuration_Stammdaten_iban').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_iban'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_bic']) ? 'NOT t.'.qi('Configuration_Stammdaten_bic').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_bic'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_bankname']) ? 'NOT t.'.qi('Configuration_Stammdaten_bankname').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_bankname'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_geschaeftsfuehrer1']) ? 'NOT t.'.qi('Configuration_Stammdaten_geschaeftsfuehrer1').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_geschaeftsfuehrer1'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_geschaeftsfuehrer2']) ? 'NOT t.'.qi('Configuration_Stammdaten_geschaeftsfuehrer2').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_geschaeftsfuehrer2'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_registergericht']) ? 'NOT t.'.qi('Configuration_Stammdaten_registergericht').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_registergericht'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_handelsregisternummer']) ? 'NOT t.'.qi('Configuration_Stammdaten_handelsregisternummer').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_handelsregisternummer'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_finanzamt']) ? 'NOT t.'.qi('Configuration_Stammdaten_finanzamt').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_finanzamt'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_steuernr']) ? 'NOT t.'.qi('Configuration_Stammdaten_steuernr').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_steuernr'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_Configuration_Stammdaten_umsatzsteuerid']) ? 'NOT t.'.qi('Configuration_Stammdaten_umsatzsteuerid').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_Configuration_Stammdaten_umsatzsteuerid'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_FOP_AI_token']) ? 'NOT t.'.qi('FOP_AI_token').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_FOP_AI_token'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_FOP_AI_precontext']) ? 'NOT t.'.qi('FOP_AI_precontext').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_FOP_AI_precontext'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_RevisionEmail_Doc_host']) ? 'NOT t.'.qi('RevisionEmail_Doc_host').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_RevisionEmail_Doc_host'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_RevisionEmail_Doc_port']) ? 'NOT t.'.qi('RevisionEmail_Doc_port').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_RevisionEmail_Doc_port'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_RevisionEmail_Doc_username']) ? 'NOT t.'.qi('RevisionEmail_Doc_username').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_RevisionEmail_Doc_username'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_userconfig_FOP_Index_Impressum']) ? 'NOT t.'.qi('FOP_Index_Impressum').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_userconfig_FOP_Index_Impressum'] . '%') . ' AND ' : '') . 
								(isset($params['search_userconfig']) ? '(' . 't.'.qi('Configuration_Stammdaten_headerText').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_firmenname').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_firmenname2').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_strasse').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_flst').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_plz').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_ort').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_telefon').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_mobil').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_fax').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_email').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_website').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_iban').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_bic').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_bankname').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_geschaeftsfuehrer1').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_geschaeftsfuehrer2').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_registergericht').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_handelsregisternummer').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_finanzamt').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_steuernr').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('Configuration_Stammdaten_umsatzsteuerid').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('FOP_AI_token').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('FOP_AI_precontext').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('RevisionEmail_Doc_host').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('RevisionEmail_Doc_port').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('RevisionEmail_Doc_username').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ' OR ' . 't.'.qi('FOP_Index_Impressum').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_userconfig'] . '%') . ') AND ' : '') . 
								'
								 TRUE ';
								return $sql;
	
    
  }

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

    
  }

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

								$order = (\FOP\Util::array_value(array(
									'Tables_Doc_defaultDoctype ASC' => 'ORDER BY '.qi('sorter-Tables_Doc_defaultDoctype').'.'.qi('sortableOrder').' ',
									'Tables_Doc_defaultDoctype DESC' => 'ORDER BY '.qi('sorter-Tables_Doc_defaultDoctype').'.'.qi('sortableOrder').' DESC',
									'FOP_AI_precontext ASC' => 'ORDER BY t.'.qi('FOP_AI_precontext').' ASC',
									'Configuration_Stammdaten_email ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_email').' ASC',
									'Configuration_Stammdaten_headerText ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_headerText').' ASC',
									'FOP_Index_Impressum ASC' => 'ORDER BY t.'.qi('FOP_Index_Impressum').' ASC',
									'Configuration_Stammdaten_telefon ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_telefon').' ASC',
									'Configuration_Stammdaten_mobil ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_mobil').' ASC',
									'Configuration_Stammdaten_fax ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_fax').' ASC',
									'Configuration_Stammdaten_plz ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_plz').' ASC',
									'Configuration_Stammdaten_firmenname ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_firmenname').' ASC',
									'Configuration_Stammdaten_firmenname2 ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_firmenname2').' ASC',
									'Configuration_Stammdaten_strasse ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_strasse').' ASC',
									'Configuration_Stammdaten_flst ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_flst').' ASC',
									'Configuration_Stammdaten_ort ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_ort').' ASC',
									'Configuration_Stammdaten_bic ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_bic').' ASC',
									'Configuration_Stammdaten_bankname ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_bankname').' ASC',
									'Configuration_Stammdaten_geschaeftsfuehrer1 ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_geschaeftsfuehrer1').' ASC',
									'Configuration_Stammdaten_geschaeftsfuehrer2 ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_geschaeftsfuehrer2').' ASC',
									'Configuration_Stammdaten_registergericht ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_registergericht').' ASC',
									'Configuration_Stammdaten_handelsregisternummer ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_handelsregisternummer').' ASC',
									'Configuration_Stammdaten_finanzamt ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_finanzamt').' ASC',
									'Configuration_Stammdaten_steuernr ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_steuernr').' ASC',
									'Configuration_Stammdaten_umsatzsteuerid ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_umsatzsteuerid').' ASC',
									'FOP_AI_token ASC' => 'ORDER BY t.'.qi('FOP_AI_token').' ASC',
									'RevisionEmail_Doc_host ASC' => 'ORDER BY t.'.qi('RevisionEmail_Doc_host').' ASC',
									'RevisionEmail_Doc_port ASC' => 'ORDER BY t.'.qi('RevisionEmail_Doc_port').' ASC',
									'RevisionEmail_Doc_username ASC' => 'ORDER BY t.'.qi('RevisionEmail_Doc_username').' ASC',
									'Configuration_Stammdaten_iban ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_iban').' ASC',
									'Configuration_Stammdaten_website ASC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_website').' ASC',
									'RevisionEmail_Doc_syncdate ASC' => 'ORDER BY t.'.qi('RevisionEmail_Doc_syncdate').' ASC',
									'FOP_AI_precontext DESC' => 'ORDER BY t.'.qi('FOP_AI_precontext').' DESC',
									'Configuration_Stammdaten_email DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_email').' DESC',
									'Configuration_Stammdaten_headerText DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_headerText').' DESC',
									'FOP_Index_Impressum DESC' => 'ORDER BY t.'.qi('FOP_Index_Impressum').' DESC',
									'Configuration_Stammdaten_telefon DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_telefon').' DESC',
									'Configuration_Stammdaten_mobil DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_mobil').' DESC',
									'Configuration_Stammdaten_fax DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_fax').' DESC',
									'Configuration_Stammdaten_plz DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_plz').' DESC',
									'Configuration_Stammdaten_firmenname DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_firmenname').' DESC',
									'Configuration_Stammdaten_firmenname2 DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_firmenname2').' DESC',
									'Configuration_Stammdaten_strasse DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_strasse').' DESC',
									'Configuration_Stammdaten_flst DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_flst').' DESC',
									'Configuration_Stammdaten_ort DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_ort').' DESC',
									'Configuration_Stammdaten_bic DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_bic').' DESC',
									'Configuration_Stammdaten_bankname DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_bankname').' DESC',
									'Configuration_Stammdaten_geschaeftsfuehrer1 DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_geschaeftsfuehrer1').' DESC',
									'Configuration_Stammdaten_geschaeftsfuehrer2 DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_geschaeftsfuehrer2').' DESC',
									'Configuration_Stammdaten_registergericht DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_registergericht').' DESC',
									'Configuration_Stammdaten_handelsregisternummer DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_handelsregisternummer').' DESC',
									'Configuration_Stammdaten_finanzamt DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_finanzamt').' DESC',
									'Configuration_Stammdaten_steuernr DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_steuernr').' DESC',
									'Configuration_Stammdaten_umsatzsteuerid DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_umsatzsteuerid').' DESC',
									'FOP_AI_token DESC' => 'ORDER BY t.'.qi('FOP_AI_token').' DESC',
									'RevisionEmail_Doc_host DESC' => 'ORDER BY t.'.qi('RevisionEmail_Doc_host').' DESC',
									'RevisionEmail_Doc_port DESC' => 'ORDER BY t.'.qi('RevisionEmail_Doc_port').' DESC',
									'RevisionEmail_Doc_username DESC' => 'ORDER BY t.'.qi('RevisionEmail_Doc_username').' DESC',
									'Configuration_Stammdaten_iban DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_iban').' DESC',
									'Configuration_Stammdaten_website DESC' => 'ORDER BY t.'.qi('Configuration_Stammdaten_website').' DESC',
									'RevisionEmail_Doc_syncdate DESC' => 'ORDER BY t.'.qi('RevisionEmail_Doc_syncdate').' DESC',
									'' => ''), isset($params['sort_userconfig']) ? $params['sort_userconfig'] : '') ?: '');
								// 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['Configuration_Stammdaten_logo'] = intval($item['Configuration_Stammdaten_logo']);
											$item['Configuration_Stammdaten_telefon'] = \FOP\Sanitizers::a_phone($item['Configuration_Stammdaten_telefon']);
											$item['Configuration_Stammdaten_mobil'] = \FOP\Sanitizers::a_phone($item['Configuration_Stammdaten_mobil']);
											$item['Configuration_Stammdaten_fax'] = \FOP\Sanitizers::a_phone($item['Configuration_Stammdaten_fax']);
											$item['Configuration_Stammdaten_email'] = \FOP\Sanitizers::a_text($item['Configuration_Stammdaten_email']);
											$item['Configuration_Stammdaten_website'] = \FOP\Sanitizers::a_text($item['Configuration_Stammdaten_website']);
											$item['Configuration_Stammdaten_iban'] = \FOP\Sanitizers::a_text($item['Configuration_Stammdaten_iban']);
											$item['Tables_Doc_defaultDoctype'] = \FOP\Sanitizers::null_converter($item['Tables_Doc_defaultDoctype']);
											$item['RevisionEmail_Doc_password'] = \Types\Password::decryptSymmetric($item['RevisionEmail_Doc_password']);
											$item['RevisionEmail_Doc_syncdate'] = intval($item['RevisionEmail_Doc_syncdate']);
											
											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['Configuration_Stammdaten_logo'] = intval($item['Configuration_Stammdaten_logo']);
										$item['Configuration_Stammdaten_telefon'] = \FOP\Sanitizers::a_phone($item['Configuration_Stammdaten_telefon']);
										$item['Configuration_Stammdaten_mobil'] = \FOP\Sanitizers::a_phone($item['Configuration_Stammdaten_mobil']);
										$item['Configuration_Stammdaten_fax'] = \FOP\Sanitizers::a_phone($item['Configuration_Stammdaten_fax']);
										$item['Configuration_Stammdaten_email'] = \FOP\Sanitizers::a_text($item['Configuration_Stammdaten_email']);
										$item['Configuration_Stammdaten_website'] = \FOP\Sanitizers::a_text($item['Configuration_Stammdaten_website']);
										$item['Configuration_Stammdaten_iban'] = \FOP\Sanitizers::a_text($item['Configuration_Stammdaten_iban']);
										$item['Tables_Doc_defaultDoctype'] = \FOP\Sanitizers::null_converter($item['Tables_Doc_defaultDoctype']);
										$item['RevisionEmail_Doc_password'] = \Types\Password::decryptSymmetric($item['RevisionEmail_Doc_password']);
										$item['RevisionEmail_Doc_syncdate'] = intval($item['RevisionEmail_Doc_syncdate']);
										
									}
									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 ( // Corner Case: Monat
		isset($params['range_min_userconfig_RevisionEmail_Doc_syncdate'])
		&& isset($params['range_max_userconfig_RevisionEmail_Doc_syncdate'])
		&& (date('d', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']) == '01') //check first day of month
		&& (date('d', $params['range_max_userconfig_RevisionEmail_Doc_syncdate']) == date('t', $params['range_max_userconfig_RevisionEmail_Doc_syncdate'])) //check last day of month
		&& (date('Y-m', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']) == date('Y-m', $params['range_max_userconfig_RevisionEmail_Doc_syncdate'])) //check if same year and month
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_userconfig_RevisionEmail_Doc_syncdate&apos;] = &apos;'.strtotime('first day of last month', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']).'&apos;;
				query[&apos;range_max_userconfig_RevisionEmail_Doc_syncdate&apos;] = &apos;'.strtotime('last day of last month', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']).'&apos;;
				reloaduserconfig(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_userconfig_RevisionEmail_Doc_syncdate&apos;] = &apos;'.strtotime('first day of next month', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']).'&apos;;
				query[&apos;range_max_userconfig_RevisionEmail_Doc_syncdate&apos;] = &apos;'.strtotime('last day of next month', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']).'&apos;;
				reloaduserconfig(); ">add_circle_outline</i>' : ''),
			htmlentities(_('IMAP-Synchronisationsdatum') . ': ' . strftime('%B', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']) . ' ' . date('Y', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']))
		]);
	} else if ( // Corner Case: Tag
		isset($params['range_min_userconfig_RevisionEmail_Doc_syncdate'])
		&& isset($params['range_max_userconfig_RevisionEmail_Doc_syncdate'])
		&& (date('Y-m-d', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']) == (date('Y-m-d', $params['range_max_userconfig_RevisionEmail_Doc_syncdate'])))
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_userconfig_RevisionEmail_Doc_syncdate&apos;] = &apos;'.strtotime('last day', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']).'&apos;;
				query[&apos;range_max_userconfig_RevisionEmail_Doc_syncdate&apos;] = &apos;'.strtotime('last day', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']).'&apos;;
				reloaduserconfig(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_userconfig_RevisionEmail_Doc_syncdate&apos;] = &apos;'.strtotime('next day', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']).'&apos;;
				query[&apos;range_max_userconfig_RevisionEmail_Doc_syncdate&apos;] = &apos;'.strtotime('next day', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']).'&apos;;
				reloaduserconfig(); ">add_circle_outline</i>' : ''),
			htmlentities(_('IMAP-Synchronisationsdatum') . ': ' . date('d.m.Y', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']))
		]);
	} else if ( // Corner Case: Jahr
		isset($params['range_min_userconfig_RevisionEmail_Doc_syncdate'])
		&& isset($params['range_max_userconfig_RevisionEmail_Doc_syncdate'])
		&& (date('Y', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']) == (date('Y', $params['range_max_userconfig_RevisionEmail_Doc_syncdate'])))
		&& ((date('m-d', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']) == '01-01'))
		&& ((date('m-d', $params['range_max_userconfig_RevisionEmail_Doc_syncdate']) == '12-31'))
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_userconfig_RevisionEmail_Doc_syncdate&apos;] = &apos;'.strtotime('first day of January last year', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']).'&apos;;
				query[&apos;range_max_userconfig_RevisionEmail_Doc_syncdate&apos;] = &apos;'.strtotime('last day of December last year', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']).'&apos;;
				reloaduserconfig(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_userconfig_RevisionEmail_Doc_syncdate&apos;] = &apos;'.strtotime('first day of January next year', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']).'&apos;;
				query[&apos;range_max_userconfig_RevisionEmail_Doc_syncdate&apos;] = &apos;'.strtotime('last day of December next year', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']).'&apos;;
				reloaduserconfig(); ">add_circle_outline</i>' : ''),
			htmlentities(_('IMAP-Synchronisationsdatum') . ': ' . date('Y', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']))
		]);
	} else if ( // Corner Case: Quartal
		isset($params['range_min_userconfig_RevisionEmail_Doc_syncdate'])
		&& isset($params['range_max_userconfig_RevisionEmail_Doc_syncdate'])
		&& ( (
		 ((date('m-d', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']) == '01-01'))
		&& ((date('m-d', $params['range_max_userconfig_RevisionEmail_Doc_syncdate']) == '03-31')) )
		|| (
		 ((date('m-d', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']) == '04-01'))
		&& ((date('m-d', $params['range_max_userconfig_RevisionEmail_Doc_syncdate']) == '06-30')) )
		|| (
		 ((date('m-d', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']) == '07-01'))
		&& ((date('m-d', $params['range_max_userconfig_RevisionEmail_Doc_syncdate']) == '09-30')) )
		|| (
		 ((date('m-d', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']) == '10-01'))
		&& ((date('m-d', $params['range_max_userconfig_RevisionEmail_Doc_syncdate']) == '12-31')) )
	) ) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
					query[&apos;range_min_userconfig_RevisionEmail_Doc_syncdate&apos;] = &apos;'.strtotime('first day of -3 months', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']).'&apos;;
					query[&apos;range_max_userconfig_RevisionEmail_Doc_syncdate&apos;] = &apos;'.strtotime('last day of -3 months', $params['range_max_userconfig_RevisionEmail_Doc_syncdate']).'&apos;;
					reloaduserconfig(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_userconfig_RevisionEmail_Doc_syncdate&apos;] = &apos;'.strtotime('first day of +3 months', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']).'&apos;;
				query[&apos;range_max_userconfig_RevisionEmail_Doc_syncdate&apos;] = &apos;'.strtotime('last day of +3 months', $params['range_max_userconfig_RevisionEmail_Doc_syncdate']).'&apos;;
				reloaduserconfig(); ">add_circle_outline</i>' : ''),	
			htmlentities(_('IMAP-Synchronisationsdatum') . ': Q' . (ceil((date('m', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']))/3)) . ' (' . date('d.m.', $params['range_min_userconfig_RevisionEmail_Doc_syncdate']) . ' - ' . date('d.m.Y', $params['range_max_userconfig_RevisionEmail_Doc_syncdate']) . ')')
		]);
	}
	else if (isset($params['range_min_userconfig_RevisionEmail_Doc_syncdate']) && isset($params['range_max_userconfig_RevisionEmail_Doc_syncdate'])) {
		array_push($filters, _('IMAP-Synchronisationsdatum') . ': ' . (($params['range_min_userconfig_RevisionEmail_Doc_syncdate']) ? strftime(_('dateformat_php2'), intval($params['range_min_userconfig_RevisionEmail_Doc_syncdate'])) : '') . ' ' . _('filters_between') . ' ' . (($params['range_max_userconfig_RevisionEmail_Doc_syncdate']) ? strftime(_('dateformat_php2'), intval($params['range_max_userconfig_RevisionEmail_Doc_syncdate'])) : ''));
	} else if (isset($params['range_min_userconfig_RevisionEmail_Doc_syncdate'])) {
		array_push($filters, _('IMAP-Synchronisationsdatum') . ': ' . _('filters_from') . ' ' . (($params['range_min_userconfig_RevisionEmail_Doc_syncdate']) ? strftime(_('dateformat_php2'), intval($params['range_min_userconfig_RevisionEmail_Doc_syncdate'])) : ''));
	} else if (isset($params['range_max_userconfig_RevisionEmail_Doc_syncdate'])) {
		array_push($filters, _('IMAP-Synchronisationsdatum') . ': ' . _('filters_to') . ' ' . (($params['range_max_userconfig_RevisionEmail_Doc_syncdate']) ? strftime(_('dateformat_php2'), intval($params['range_max_userconfig_RevisionEmail_Doc_syncdate'])) : ''));
	}if (isset($params['fullsearch_userconfig_Configuration_Stammdaten_logo'])) {
		array_push($filters, _('Configuration_Stammdaten_logo') . ' ' . _('filter_contains') . ' ' . $params['fullsearch_userconfig_Configuration_Stammdaten_logo']);
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_logo'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_logo'] == '_null') {
			array_push($filters, _('Firmenlogo') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_logo']))->all() AS $val) {
				$value = \FOP\Database::query('SELECT filename FROM fop_files WHERE '.qi('ID').' = ' . intval($val))->fetchColumn();
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Firmenlogo') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_headerText'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_headerText'] == '_null') {
			array_push($filters, _('Text unter dem Header') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_headerText']))->all() AS $val) {
				$value = mb_substr(preg_replace('/[ \t\r\n]+/', ' ', strip_tags(preg_replace('/<style.*?\/style>/s', '', html_entity_decode($val)))), 0, 20) . (strlen($val) >= 20 ? '...' : '');
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Text unter dem Header') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_firmenname'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_firmenname'] == '_null') {
			array_push($filters, _('Firmenname') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_firmenname']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Firmenname') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_firmenname2'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_firmenname2'] == '_null') {
			array_push($filters, _('Firmenname Zusatz') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_firmenname2']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Firmenname Zusatz') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_strasse'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_strasse'] == '_null') {
			array_push($filters, _('Straße Nr.') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_strasse']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Straße Nr.') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_flst'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_flst'] == '_null') {
			array_push($filters, _('Flurstück') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_flst']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Flurstück') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_plz'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_plz'] == '_null') {
			array_push($filters, _('PLZ') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_plz']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('PLZ') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_ort'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_ort'] == '_null') {
			array_push($filters, _('Ort') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_ort']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Ort') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_telefon'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_telefon'] == '_null') {
			array_push($filters, _('Telefon') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_telefon']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Telefon') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_mobil'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_mobil'] == '_null') {
			array_push($filters, _('Mobil') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_mobil']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Mobil') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_fax'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_fax'] == '_null') {
			array_push($filters, _('Fax') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_fax']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Fax') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_email'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_email'] == '_null') {
			array_push($filters, _('E-Mail') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_email']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('E-Mail') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_website'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_website'] == '_null') {
			array_push($filters, _('Homepage') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_website']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Homepage') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_iban'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_iban'] == '_null') {
			array_push($filters, _('IBAN') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_iban']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('IBAN') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_bic'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_bic'] == '_null') {
			array_push($filters, _('BIC/Swift') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_bic']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('BIC/Swift') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_bankname'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_bankname'] == '_null') {
			array_push($filters, _('Name der Bank') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_bankname']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Name der Bank') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_geschaeftsfuehrer1'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_geschaeftsfuehrer1'] == '_null') {
			array_push($filters, _('1. Geschäftsführer') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_geschaeftsfuehrer1']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('1. Geschäftsführer') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_geschaeftsfuehrer2'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_geschaeftsfuehrer2'] == '_null') {
			array_push($filters, _('2. Geschäftsführer') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_geschaeftsfuehrer2']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('2. Geschäftsführer') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_registergericht'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_registergericht'] == '_null') {
			array_push($filters, _('Registergericht') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_registergericht']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Registergericht') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_handelsregisternummer'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_handelsregisternummer'] == '_null') {
			array_push($filters, _('Handelsregisternummer') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_handelsregisternummer']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Handelsregisternummer') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_finanzamt'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_finanzamt'] == '_null') {
			array_push($filters, _('Finanzamt') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_finanzamt']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Finanzamt') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_steuernr'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_steuernr'] == '_null') {
			array_push($filters, _('Steuernr.') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_steuernr']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Steuernr.') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Configuration_Stammdaten_umsatzsteuerid'])) {
		if ($params['filter_userconfig_Configuration_Stammdaten_umsatzsteuerid'] == '_null') {
			array_push($filters, _('Umsatzsteuer-ID') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Configuration_Stammdaten_umsatzsteuerid']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Umsatzsteuer-ID') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_FOP_AI_token'])) {
		if ($params['filter_userconfig_FOP_AI_token'] == '_null') {
			array_push($filters, _('Lizenzschlüssel für KI') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_FOP_AI_token']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Lizenzschlüssel für KI') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_FOP_AI_precontext'])) {
		if ($params['filter_userconfig_FOP_AI_precontext'] == '_null') {
			array_push($filters, _('Vorwissen für die KI') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_FOP_AI_precontext']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Vorwissen für die KI') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_RevisionEmail_Doc_host'])) {
		if ($params['filter_userconfig_RevisionEmail_Doc_host'] == '_null') {
			array_push($filters, _('IMAP-Host') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_RevisionEmail_Doc_host']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('IMAP-Host') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_RevisionEmail_Doc_port'])) {
		if ($params['filter_userconfig_RevisionEmail_Doc_port'] == '_null') {
			array_push($filters, _('IMAP-Port') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_RevisionEmail_Doc_port']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('IMAP-Port') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_RevisionEmail_Doc_auth'])) {
		if ($params['filter_userconfig_RevisionEmail_Doc_auth'] == '_null') {
			array_push($filters, _('IMAP-Authentication') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_RevisionEmail_Doc_auth']))->all() AS $val) {
				$value = \Types\Mail_security::toString($val);
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('IMAP-Authentication') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_RevisionEmail_Doc_username'])) {
		if ($params['filter_userconfig_RevisionEmail_Doc_username'] == '_null') {
			array_push($filters, _('IMAP-Username') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_RevisionEmail_Doc_username']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('IMAP-Username') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_RevisionEmail_Doc_password'])) {
		if ($params['filter_userconfig_RevisionEmail_Doc_password'] == '_null') {
			array_push($filters, _('IMAP-Password') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_RevisionEmail_Doc_password']))->all() AS $val) {
				$value = '*****';
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('IMAP-Password') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_RevisionEmail_Doc_syncdate'])) {
		if ($params['filter_userconfig_RevisionEmail_Doc_syncdate'] == '_null') {
			array_push($filters, _('IMAP-Synchronisationsdatum') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_RevisionEmail_Doc_syncdate']))->all() AS $val) {
				$value = ($val) ? strftime(_('dateformat_php2'), intval($val)) : '';
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('IMAP-Synchronisationsdatum') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_FOP_Index_Impressum'])) {
		if ($params['filter_userconfig_FOP_Index_Impressum'] == '_null') {
			array_push($filters, _('Impressum-Text') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_FOP_Index_Impressum']))->all() AS $val) {
				$value = mb_substr(preg_replace('/[ \t\r\n]+/', ' ', strip_tags(preg_replace('/<style.*?\/style>/s', '', html_entity_decode($val)))), 0, 20) . (strlen($val) >= 20 ? '...' : '');
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Impressum-Text') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_userconfig_Tables_Doc_defaultDoctype'])) {
		if ($params['filter_userconfig_Tables_Doc_defaultDoctype'] == '_null') {
			array_push($filters, _('Dokumenttyp Standardwert neue Dokumente') . ': ' . _('-'));
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_userconfig_Tables_Doc_defaultDoctype']))->all() AS $val) {
				$value = 
  \FOP\Database::query('SELECT '.qi('docType').'.'.qi('name').' AS description FROM '.qi('docType').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($val))->fetchColumn() ?: _('-')
;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Dokumenttyp Standardwert neue Dokumente') . ': ' . implode(', ', $values));
		}
	}if (isset($params['search_userconfig_Configuration_Stammdaten_headerText'])) {
		array_push($filters, _('Configuration_Stammdaten_headerText') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_headerText']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_firmenname'])) {
		array_push($filters, _('Configuration_Stammdaten_firmenname') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_firmenname']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_firmenname2'])) {
		array_push($filters, _('Configuration_Stammdaten_firmenname2') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_firmenname2']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_strasse'])) {
		array_push($filters, _('Configuration_Stammdaten_strasse') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_strasse']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_flst'])) {
		array_push($filters, _('Configuration_Stammdaten_flst') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_flst']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_plz'])) {
		array_push($filters, _('Configuration_Stammdaten_plz') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_plz']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_ort'])) {
		array_push($filters, _('Configuration_Stammdaten_ort') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_ort']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_telefon'])) {
		array_push($filters, _('Configuration_Stammdaten_telefon') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_telefon']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_mobil'])) {
		array_push($filters, _('Configuration_Stammdaten_mobil') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_mobil']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_fax'])) {
		array_push($filters, _('Configuration_Stammdaten_fax') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_fax']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_email'])) {
		array_push($filters, _('Configuration_Stammdaten_email') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_email']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_website'])) {
		array_push($filters, _('Configuration_Stammdaten_website') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_website']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_iban'])) {
		array_push($filters, _('Configuration_Stammdaten_iban') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_iban']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_bic'])) {
		array_push($filters, _('Configuration_Stammdaten_bic') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_bic']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_bankname'])) {
		array_push($filters, _('Configuration_Stammdaten_bankname') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_bankname']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_geschaeftsfuehrer1'])) {
		array_push($filters, _('Configuration_Stammdaten_geschaeftsfuehrer1') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_geschaeftsfuehrer1']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_geschaeftsfuehrer2'])) {
		array_push($filters, _('Configuration_Stammdaten_geschaeftsfuehrer2') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_geschaeftsfuehrer2']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_registergericht'])) {
		array_push($filters, _('Configuration_Stammdaten_registergericht') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_registergericht']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_handelsregisternummer'])) {
		array_push($filters, _('Configuration_Stammdaten_handelsregisternummer') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_handelsregisternummer']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_finanzamt'])) {
		array_push($filters, _('Configuration_Stammdaten_finanzamt') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_finanzamt']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_steuernr'])) {
		array_push($filters, _('Configuration_Stammdaten_steuernr') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_steuernr']);
	}if (isset($params['search_userconfig_Configuration_Stammdaten_umsatzsteuerid'])) {
		array_push($filters, _('Configuration_Stammdaten_umsatzsteuerid') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_Configuration_Stammdaten_umsatzsteuerid']);
	}if (isset($params['search_userconfig_FOP_AI_token'])) {
		array_push($filters, _('FOP_AI_token') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_FOP_AI_token']);
	}if (isset($params['search_userconfig_FOP_AI_precontext'])) {
		array_push($filters, _('FOP_AI_precontext') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_FOP_AI_precontext']);
	}if (isset($params['search_userconfig_RevisionEmail_Doc_host'])) {
		array_push($filters, _('RevisionEmail_Doc_host') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_RevisionEmail_Doc_host']);
	}if (isset($params['search_userconfig_RevisionEmail_Doc_port'])) {
		array_push($filters, _('RevisionEmail_Doc_port') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_RevisionEmail_Doc_port']);
	}if (isset($params['search_userconfig_RevisionEmail_Doc_username'])) {
		array_push($filters, _('RevisionEmail_Doc_username') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_RevisionEmail_Doc_username']);
	}if (isset($params['search_userconfig_FOP_Index_Impressum'])) {
		array_push($filters, _('FOP_Index_Impressum') . ' ' . _('filter_contains') . ' ' . $params['search_userconfig_FOP_Index_Impressum']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_headerText'])) {
		array_push($filters, _('Configuration_Stammdaten_headerText') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_headerText']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_firmenname'])) {
		array_push($filters, _('Configuration_Stammdaten_firmenname') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_firmenname']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_firmenname2'])) {
		array_push($filters, _('Configuration_Stammdaten_firmenname2') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_firmenname2']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_strasse'])) {
		array_push($filters, _('Configuration_Stammdaten_strasse') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_strasse']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_flst'])) {
		array_push($filters, _('Configuration_Stammdaten_flst') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_flst']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_plz'])) {
		array_push($filters, _('Configuration_Stammdaten_plz') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_plz']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_ort'])) {
		array_push($filters, _('Configuration_Stammdaten_ort') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_ort']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_telefon'])) {
		array_push($filters, _('Configuration_Stammdaten_telefon') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_telefon']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_mobil'])) {
		array_push($filters, _('Configuration_Stammdaten_mobil') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_mobil']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_fax'])) {
		array_push($filters, _('Configuration_Stammdaten_fax') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_fax']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_email'])) {
		array_push($filters, _('Configuration_Stammdaten_email') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_email']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_website'])) {
		array_push($filters, _('Configuration_Stammdaten_website') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_website']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_iban'])) {
		array_push($filters, _('Configuration_Stammdaten_iban') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_iban']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_bic'])) {
		array_push($filters, _('Configuration_Stammdaten_bic') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_bic']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_bankname'])) {
		array_push($filters, _('Configuration_Stammdaten_bankname') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_bankname']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_geschaeftsfuehrer1'])) {
		array_push($filters, _('Configuration_Stammdaten_geschaeftsfuehrer1') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_geschaeftsfuehrer1']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_geschaeftsfuehrer2'])) {
		array_push($filters, _('Configuration_Stammdaten_geschaeftsfuehrer2') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_geschaeftsfuehrer2']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_registergericht'])) {
		array_push($filters, _('Configuration_Stammdaten_registergericht') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_registergericht']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_handelsregisternummer'])) {
		array_push($filters, _('Configuration_Stammdaten_handelsregisternummer') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_handelsregisternummer']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_finanzamt'])) {
		array_push($filters, _('Configuration_Stammdaten_finanzamt') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_finanzamt']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_steuernr'])) {
		array_push($filters, _('Configuration_Stammdaten_steuernr') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_steuernr']);
	}if (isset($params['searchnot_userconfig_Configuration_Stammdaten_umsatzsteuerid'])) {
		array_push($filters, _('Configuration_Stammdaten_umsatzsteuerid') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_Configuration_Stammdaten_umsatzsteuerid']);
	}if (isset($params['searchnot_userconfig_FOP_AI_token'])) {
		array_push($filters, _('FOP_AI_token') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_FOP_AI_token']);
	}if (isset($params['searchnot_userconfig_FOP_AI_precontext'])) {
		array_push($filters, _('FOP_AI_precontext') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_FOP_AI_precontext']);
	}if (isset($params['searchnot_userconfig_RevisionEmail_Doc_host'])) {
		array_push($filters, _('RevisionEmail_Doc_host') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_RevisionEmail_Doc_host']);
	}if (isset($params['searchnot_userconfig_RevisionEmail_Doc_port'])) {
		array_push($filters, _('RevisionEmail_Doc_port') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_RevisionEmail_Doc_port']);
	}if (isset($params['searchnot_userconfig_RevisionEmail_Doc_username'])) {
		array_push($filters, _('RevisionEmail_Doc_username') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_RevisionEmail_Doc_username']);
	}if (isset($params['searchnot_userconfig_FOP_Index_Impressum'])) {
		array_push($filters, _('FOP_Index_Impressum') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_userconfig_FOP_Index_Impressum']);
	}
		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(\'_userconfig_\')) delete query[q];} reloaduserconfig(); ">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 == 'userconfig') {
	\FOP\Session::setPayload('dv-userconfig', [
		'id' => 'userconfig',
		'tbl' => 'userconfig',
		'idcol' => 'ID',
		'prev' => \DataViewRouter\Userconfig::stepURL('userconfig', 'XXX', -1),
		'next' => \DataViewRouter\Userconfig::stepURL('userconfig', '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\Userconfig::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();

    
  }


  
  

  
  
}



