<?php

namespace DataView;

class Doc_to_mitglied {
  
  

  
  

    // --- Statische Methoden ---
  
  public static function renderTabTableAction($id) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
     ?><div class='fop-dv-buttonbar'><?php if(((\FOP\User::getDokument())) && (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?><?php if (\FOP\Database::query('SELECT '.(\FOP\User::getIsGuest() ? 'false' : 'true').' FROM '.qi('mitglied').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($id))->fetchColumn() == 1) { ?><?php if (\FOP\Database::query('SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getSuperadmin()).' THEN TRUE ELSE NOT ('.qi('mitglied').'.'.qi('superadmin').') END) FROM '.qi('mitglied').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($id))->fetchColumn() == 1) { ?><?php if (\FOP\Database::query('SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getGruppe()).' THEN TRUE ELSE NOT (('.qi('mitglied').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) END) FROM '.qi('mitglied').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($id))->fetchColumn() == 1) { ?><?php if (\FOP\Database::query('SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getMitglied()).' THEN TRUE ELSE NOT ((('.qi('mitglied').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) AND (NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeItem').' '.qi('7sncgH3z').' WHERE '.qi('7sncgH3z').'.'.qi('item').' = '.qi('mitglied').'.'.qi('ID').' AND (EXISTS (SELECT (TRUE) FROM '.qi('gruppeVerantwortlich').' '.qi('eHueOsQC').' WHERE '.qi('eHueOsQC').'.'.qi('gruppe').' = '.qi('7sncgH3z').'.'.qi('list').' AND (('.qi('eHueOsQC').'.'.qi('mitglied').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1)) LIMIT 1)))) END) FROM '.qi('mitglied').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($id))->fetchColumn() == 1) { ?><a class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" onclick="var self = this; $.get(reloaddoc_to_mitglied({action: 'open', fop_table: 'doc', fop_id: '_', fop_from: location.href}, true)).then(function () { open_url(self.href, true);}); return false;" href="<?php echo htmlentities(\TablesRouter\Doc::createURL2(['from' => \FOP\Util::getBackUrl(), 'column_to-mitglied' => $id])); ?>"><i class="material-icons">add</i> <?php echo(sprintf(_('create %s'), _('Dokument'))); ?></a><?php } ?><?php } ?><?php } ?><?php } ?><?php } ?></div><?php 
								\FOP\User::getIsGuest();
								$itemheight = 32;
								$itemsperpage = ceil(1080 / $itemheight * 0.8);
								$page = (isset($_GET['page_doc_to-mitglied']) ? intval($_GET['page_doc_to-mitglied']) : 0);
								$addlines = (isset($_GET['addlines_doc_to-mitglied']) ? intval($_GET['addlines_doc_to-mitglied']) : 0);
								$firstitem = $page * $itemsperpage;
								$sqladdon = ' LIMIT ' . ($itemsperpage * 2) . ' OFFSET ' . ($firstitem);
								$data = self::getData($sqladdon, $_GET, $id);
								$arr = $data["items"];
								$itemcount = $data["itemcount"];
								$lastPage = ceil($itemcount/$itemsperpage-1);
								// calculate width of first column: 67px + 32px for each shortcut
								$firstColumnWidth = 66 + 34 + 34;
								$additionalLines = 0;

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

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

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

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

											];
											$columns['notes'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'date',
												'desc' => _('Erfassungsdatum'),
												'order' => ++$order,
												'width' => 100, // default value
												'collapsed' => 1

											];
											$columns['date'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'to-gruppe',
												'desc' => _('linked to %s|Gruppe'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['to-gruppe'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'to-protokoll',
												'desc' => _('linked to %s|Protokoll'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['to-protokoll'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'first',
												'desc' => _('firstrevision'),
												'order' => ++$order,
												'width' => 100, // default value
												'collapsed' => 1

											];
											$columns['first'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'last',
												'desc' => _('currentrevision'),
												'order' => ++$order,
												'width' => 100, // default value
												'collapsed' => 1

											];
											$columns['last'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'archive',
												'desc' => _('Archiv'),
												'order' => ++$order,
												'width' => 40, // default value
												'collapsed' => 0

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

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

									// DOM vor-rendern
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='file'
												data-order='<?php echo intval($columns['file']['order']); ?>'
												data-width='<?php echo intval($columns['file']['width']); ?>'
												data-collapsed='<?php echo intval($columns['file']['collapsed']); ?>'
												style='width: <?php echo intval($columns['file']['width']); ?>px; <?php if ($columns['file']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloaddoc_to_mitglied(); 
		}});
		var el, text;
		win.append(el = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label fop-floatsorter\' style=\'width: calc(100% - 42px);\'><input class=\'mdl-textfield__input\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(_('search')); ?></label></div>');
		text = el.find('input');
		text.val(query['fullsearch_doc_to-mitglied_file']);
		text.on('change keyup paste', function () { query['fullsearch_doc_to-mitglied_file'] = text.val(); delete query['page_doc_to-mitglied']; changed = true; });
		text.focus();
		text.select();
		return false;
	">
													<span class='title-title' title='<?php echo(_('download')); ?>'><?php echo(_('download')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_doc_to-mitglied']) && $_GET['sort_doc_to-mitglied'] == 'file ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_doc_to-mitglied']) && $_GET['sort_doc_to-mitglied'] == 'file DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_doc_to-mitglied_file']) || isset($_GET['range_max_doc_to-mitglied_file']) || isset($_GET['deps_doc_to-mitglied_file']) || isset($_GET['fullsearch_doc_to-mitglied_file']) || isset($_GET['dynamic_doc_to-mitglied_file']) || isset($_GET['search_doc_to-mitglied_file']) || isset($_GET['searchnot_doc_to-mitglied_file']) || isset($_GET['filter_doc_to-mitglied_file'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['file']['header'] = ob_get_contents(); ob_end_clean();
											$columns['file']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['file']['width']); ?>px; <?php if ($columns['file']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='file'><?php if ($item['file']) { ?><a target='_blank' onclick='event.stopPropagation()' href='fop-files/<?php echo urlencode(htmlentities($item['file'])); ?>/x'><?php call_user_func(function($v) { $result = \FOP\Database::query('SELECT filename FROM fop_files WHERE '.qi('ID').' = '.intval($v))->fetch(\PDO::FETCH_ASSOC); echo htmlentities($result['filename']); }, $item['file']); ?></a><?php } else { echo '-'; } ?></div><?php
											};
											$columns['file']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='file'
													data-order='<?php echo intval($columns['file']['order']); ?>'
													data-width='<?php echo intval($columns['file']['width']); ?>'
													data-collapsed='<?php echo intval($columns['file']['collapsed']); ?>'
													style='width: <?php echo intval($columns['file']['width']); ?>px; <?php if ($columns['file']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='type'
												data-order='<?php echo intval($columns['type']['order']); ?>'
												data-width='<?php echo intval($columns['type']['width']); ?>'
												data-collapsed='<?php echo intval($columns['type']['collapsed']); ?>'
												style='width: <?php echo intval($columns['type']['width']); ?>px; <?php if ($columns['type']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloaddoc_to_mitglied(); 
		}});
		
		win.append(getfilter_doc_to_mitglied_typeListMultiFilter()); win.find('input').first().focus();
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_doc_to-mitglied'] == 'type ASC') {
			query['sort_doc_to-mitglied'] = 'type DESC';
		 } else if (query['sort_doc_to-mitglied'] == 'type DESC') {
		 	delete query['sort_doc_to-mitglied'];
		 } else {
			query['sort_doc_to-mitglied'] = 'type ASC';
		 }
		 reloaddoc_to_mitglied();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('Kategorie')); ?>'><?php echo(_('Kategorie')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_doc_to-mitglied']) && $_GET['sort_doc_to-mitglied'] == 'type ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_doc_to-mitglied']) && $_GET['sort_doc_to-mitglied'] == 'type DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_doc_to-mitglied_type']) || isset($_GET['range_max_doc_to-mitglied_type']) || isset($_GET['deps_doc_to-mitglied_type']) || isset($_GET['fullsearch_doc_to-mitglied_type']) || isset($_GET['dynamic_doc_to-mitglied_type']) || isset($_GET['search_doc_to-mitglied_type']) || isset($_GET['searchnot_doc_to-mitglied_type']) || isset($_GET['filter_doc_to-mitglied_type'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['type']['header'] = ob_get_contents(); ob_end_clean();
											$columns['type']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['type']['width']); ?>px; <?php if ($columns['type']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='type'><?php
	
	call_user_func(function () use ($item) {
	$id = $item['type'];
	$val = $item['type::description'];
	$canView = $item['type::canView'];
	if ($val !== null) {
		if ($canView) echo "<a tabindex=\"-1\" class=\"mdl-button mdl-button-small tbl-link\" data-tbl=\"docType\" data-id=\"".htmlentities($id)."\" onclick=\"event.stopPropagation(); event.preventDefault(); open_url(this.href, false);\" href=\"" . \TablesRouter\DocType::viewURL($id, ['from' => \FOP\Util::getBackURL()]) . "\">(…)</a>";echo htmlentities($val);
	} else {
		echo htmlentities(_('-') ?: '-');
	}
	});
	
?>
</div><?php
											};
											$columns['type']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='type'
													data-order='<?php echo intval($columns['type']['order']); ?>'
													data-width='<?php echo intval($columns['type']['width']); ?>'
													data-collapsed='<?php echo intval($columns['type']['collapsed']); ?>'
													style='width: <?php echo intval($columns['type']['width']); ?>px; <?php if ($columns['type']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='subject'
												data-order='<?php echo intval($columns['subject']['order']); ?>'
												data-width='<?php echo intval($columns['subject']['width']); ?>'
												data-collapsed='<?php echo intval($columns['subject']['collapsed']); ?>'
												style='width: <?php echo intval($columns['subject']['width']); ?>px; <?php if ($columns['subject']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloaddoc_to_mitglied(); 
		}});
		
		var el = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label fop-floatsorter\' style=\'width: calc(100% - 42px);\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(_('search')); ?></label></div>');
		win.append(el);
		var text = el.find('input');
		text.val(query['search_doc_to-mitglied_subject'])
		text.on('change keyup paste', function () { if (text.val()) { query['search_doc_to-mitglied_subject'] = text.val(); } else { delete query['search_doc_to-mitglied_subject']; } changed = true; });
		text.focus();
		text.select();
		text.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_doc_to_mitglied').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});

		var el2 = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(htmlentities(htmlentities(_('filter_contains_not')))); ?></label></div>');
		win.append(el2);
		var text2 = el2.find('input');
		text2.val(query['searchnot_doc_to-mitglied_subject'])
		text2.on('change keyup paste', function () { if (text2.val()) { query['searchnot_doc_to-mitglied_subject'] = text2.val(); } else { delete query['searchnot_doc_to-mitglied_subject']; } changed = true; });
		text2.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_doc_to_mitglied').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});
	
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_doc_to-mitglied'] == 'subject ASC') {
			query['sort_doc_to-mitglied'] = 'subject DESC';
		 } else if (query['sort_doc_to-mitglied'] == 'subject DESC') {
		 	delete query['sort_doc_to-mitglied'];
		 } else {
			query['sort_doc_to-mitglied'] = 'subject ASC';
		 }
		 reloaddoc_to_mitglied();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('Betreff')); ?>'><?php echo(_('Betreff')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_doc_to-mitglied']) && $_GET['sort_doc_to-mitglied'] == 'subject ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_doc_to-mitglied']) && $_GET['sort_doc_to-mitglied'] == 'subject DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_doc_to-mitglied_subject']) || isset($_GET['range_max_doc_to-mitglied_subject']) || isset($_GET['deps_doc_to-mitglied_subject']) || isset($_GET['fullsearch_doc_to-mitglied_subject']) || isset($_GET['dynamic_doc_to-mitglied_subject']) || isset($_GET['search_doc_to-mitglied_subject']) || isset($_GET['searchnot_doc_to-mitglied_subject']) || isset($_GET['filter_doc_to-mitglied_subject'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['subject']['header'] = ob_get_contents(); ob_end_clean();
											$columns['subject']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['subject']['width']); ?>px; <?php if ($columns['subject']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='subject'><span class='overflow-text' title="<?php echo htmlentities($item['subject']); ?>"><?php echo htmlentities($item['subject']); ?></span></div><?php
											};
											$columns['subject']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='subject'
													data-order='<?php echo intval($columns['subject']['order']); ?>'
													data-width='<?php echo intval($columns['subject']['width']); ?>'
													data-collapsed='<?php echo intval($columns['subject']['collapsed']); ?>'
													style='width: <?php echo intval($columns['subject']['width']); ?>px; <?php if ($columns['subject']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='notes'
												data-order='<?php echo intval($columns['notes']['order']); ?>'
												data-width='<?php echo intval($columns['notes']['width']); ?>'
												data-collapsed='<?php echo intval($columns['notes']['collapsed']); ?>'
												style='width: <?php echo intval($columns['notes']['width']); ?>px; <?php if ($columns['notes']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloaddoc_to_mitglied(); 
		}});
		
		var el = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label fop-floatsorter\' style=\'width: calc(100% - 42px);\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(_('search')); ?></label></div>');
		win.append(el);
		var text = el.find('input');
		text.val(query['search_doc_to-mitglied_notes'])
		text.on('change keyup paste', function () { if (text.val()) { query['search_doc_to-mitglied_notes'] = text.val(); } else { delete query['search_doc_to-mitglied_notes']; } changed = true; });
		text.focus();
		text.select();
		text.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_doc_to_mitglied').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});

		var el2 = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(htmlentities(htmlentities(_('filter_contains_not')))); ?></label></div>');
		win.append(el2);
		var text2 = el2.find('input');
		text2.val(query['searchnot_doc_to-mitglied_notes'])
		text2.on('change keyup paste', function () { if (text2.val()) { query['searchnot_doc_to-mitglied_notes'] = text2.val(); } else { delete query['searchnot_doc_to-mitglied_notes']; } changed = true; });
		text2.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_doc_to_mitglied').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});
	
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_doc_to-mitglied'] == 'notes ASC') {
			query['sort_doc_to-mitglied'] = 'notes DESC';
		 } else if (query['sort_doc_to-mitglied'] == 'notes DESC') {
		 	delete query['sort_doc_to-mitglied'];
		 } else {
			query['sort_doc_to-mitglied'] = 'notes ASC';
		 }
		 reloaddoc_to_mitglied();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('Notizen')); ?>'><?php echo(_('Notizen')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_doc_to-mitglied']) && $_GET['sort_doc_to-mitglied'] == 'notes ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_doc_to-mitglied']) && $_GET['sort_doc_to-mitglied'] == 'notes DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_doc_to-mitglied_notes']) || isset($_GET['range_max_doc_to-mitglied_notes']) || isset($_GET['deps_doc_to-mitglied_notes']) || isset($_GET['fullsearch_doc_to-mitglied_notes']) || isset($_GET['dynamic_doc_to-mitglied_notes']) || isset($_GET['search_doc_to-mitglied_notes']) || isset($_GET['searchnot_doc_to-mitglied_notes']) || isset($_GET['filter_doc_to-mitglied_notes'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['notes']['header'] = ob_get_contents(); ob_end_clean();
											$columns['notes']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['notes']['width']); ?>px; <?php if ($columns['notes']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='notes'><?php 
	$html = preg_replace('/^<!DOCTYPE.+?>/m', '', \FOP\Sanitizers::htmlentities_decode($item['notes'])); ?>
	<span style="display: block;" onmouseenter='handleHTMLOverlay(event, &apos;#overlayFormnotes<?php echo htmlentities($item['ID'] ?? 'fail'); ?>&apos;);' onmouseleave='handleHTMLOverlayFade(event, &apos;#overlayFormnotes<?php echo htmlentities($item['ID'] ?? 'fail'); ?>&apos;);' ng-non-bindable><?php echo htmlentities(mb_substr(preg_replace('/[ \t\r\n]+/', ' ', strip_tags(preg_replace('/<style.*?\/style>/s', '', html_entity_decode($item['notes'])))), 0, 50) . (strlen(preg_replace('/[ \t\r\n]+/', ' ', strip_tags(preg_replace('/<style.*?\/style>/s', '', html_entity_decode($item['notes']))))) >= 50 ? '...' : ''));  ?></span>
	<div class="overlay-iframe" id="overlayFormnotes<?php echo $item['ID'] ?? 'fail'; ?>">
		<div class="iframe-container" id="iframecontainer">
			<?php echo \FOP\Util::SanitizeUserHtml($html); ?>
		</div>
	</div>
</div><?php
											};
											$columns['notes']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='notes'
													data-order='<?php echo intval($columns['notes']['order']); ?>'
													data-width='<?php echo intval($columns['notes']['width']); ?>'
													data-collapsed='<?php echo intval($columns['notes']['collapsed']); ?>'
													style='width: <?php echo intval($columns['notes']['width']); ?>px; <?php if ($columns['notes']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='date'
												data-order='<?php echo intval($columns['date']['order']); ?>'
												data-width='<?php echo intval($columns['date']['width']); ?>'
												data-collapsed='<?php echo intval($columns['date']['collapsed']); ?>'
												style='width: <?php echo intval($columns['date']['width']); ?>px; <?php if ($columns['date']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloaddoc_to_mitglied(); 
		}}, 600);
		date_filter(win, 'doc_to-mitglied', 'date', <?php echo htmlentities(json_encode(_('period'))); ?>, <?php echo htmlentities(json_encode(\FOP\I18n::getShortLocale())); ?>, <?php echo htmlentities(json_encode(_('dateformat_moment'))); ?>, function() { reloaddoc_to_mitglied();  reloaddoc_to_mitglied(); });
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_doc_to-mitglied'] == 'date ASC') {
			query['sort_doc_to-mitglied'] = 'date DESC';
		 } else if (query['sort_doc_to-mitglied'] == 'date DESC') {
		 	delete query['sort_doc_to-mitglied'];
		 } else {
			query['sort_doc_to-mitglied'] = 'date ASC';
		 }
		 reloaddoc_to_mitglied();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('Erfassungsdatum')); ?>'><?php echo(_('Erfassungsdatum')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_doc_to-mitglied']) && $_GET['sort_doc_to-mitglied'] == 'date ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_doc_to-mitglied']) && $_GET['sort_doc_to-mitglied'] == 'date DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_doc_to-mitglied_date']) || isset($_GET['range_max_doc_to-mitglied_date']) || isset($_GET['deps_doc_to-mitglied_date']) || isset($_GET['fullsearch_doc_to-mitglied_date']) || isset($_GET['dynamic_doc_to-mitglied_date']) || isset($_GET['search_doc_to-mitglied_date']) || isset($_GET['searchnot_doc_to-mitglied_date']) || isset($_GET['filter_doc_to-mitglied_date'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['date']['header'] = ob_get_contents(); ob_end_clean();
											$columns['date']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['date']['width']); ?>px; <?php if ($columns['date']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='date'><span class='overflow-text' title="<?php echo htmlentities(($item['date']) ? strftime(_('dateformat_php2'), intval($item['date'])) : ''); ?>"><?php echo htmlentities(($item['date']) ? strftime(_('dateformat_php2'), intval($item['date'])) : ''); ?></span></div><?php
											};
											$columns['date']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='date'
													data-order='<?php echo intval($columns['date']['order']); ?>'
													data-width='<?php echo intval($columns['date']['width']); ?>'
													data-collapsed='<?php echo intval($columns['date']['collapsed']); ?>'
													style='width: <?php echo intval($columns['date']['width']); ?>px; <?php if ($columns['date']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='to-gruppe'
												data-order='<?php echo intval($columns['to-gruppe']['order']); ?>'
												data-width='<?php echo intval($columns['to-gruppe']['width']); ?>'
												data-collapsed='<?php echo intval($columns['to-gruppe']['collapsed']); ?>'
												style='width: <?php echo intval($columns['to-gruppe']['width']); ?>px; <?php if ($columns['to-gruppe']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloaddoc_to_mitglied(); 
		}});
		
		win.append(getfilter_doc_to_mitglied_to_gruppeListMultiFilter()); win.find('input').first().focus();
		return false;
	">
													<span class='title-title' title='<?php echo(sprintf(_('linked to %s'), _('Gruppe'))); ?>'><?php echo(sprintf(_('linked to %s'), _('Gruppe'))); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_doc_to-mitglied']) && $_GET['sort_doc_to-mitglied'] == 'to-gruppe ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_doc_to-mitglied']) && $_GET['sort_doc_to-mitglied'] == 'to-gruppe DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_doc_to-mitglied_to-gruppe']) || isset($_GET['range_max_doc_to-mitglied_to-gruppe']) || isset($_GET['deps_doc_to-mitglied_to-gruppe']) || isset($_GET['fullsearch_doc_to-mitglied_to-gruppe']) || isset($_GET['dynamic_doc_to-mitglied_to-gruppe']) || isset($_GET['search_doc_to-mitglied_to-gruppe']) || isset($_GET['searchnot_doc_to-mitglied_to-gruppe']) || isset($_GET['filter_doc_to-mitglied_to-gruppe'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['to-gruppe']['header'] = ob_get_contents(); ob_end_clean();
											$columns['to-gruppe']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['to-gruppe']['width']); ?>px; <?php if ($columns['to-gruppe']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; <?php if (($item['to-gruppe::vis'] ?? '0') == '0') { echo 'visibility: hidden;'; } ?>' data-column='to-gruppe'><?php
	
	call_user_func(function () use ($item) {
	$id = $item['to-gruppe'];
	$val = $item['to-gruppe::description'];
	$canView = $item['to-gruppe::canView'];
	if ($val !== null) {
		if ($canView) echo "<a tabindex=\"-1\" class=\"mdl-button mdl-button-small tbl-link\" data-tbl=\"gruppe\" data-id=\"".htmlentities($id)."\" onclick=\"event.stopPropagation(); event.preventDefault(); open_url(this.href, true);\" href=\"" . \TablesRouter\Gruppe::viewURL($id, ['from' => \FOP\Util::getBackURL()]) . "\">(…)</a>";echo htmlentities($val);
	} else {
		echo htmlentities(_('-') ?: '-');
	}
	});
	
?>
</div><?php
											};
											$columns['to-gruppe']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='to-gruppe'
													data-order='<?php echo intval($columns['to-gruppe']['order']); ?>'
													data-width='<?php echo intval($columns['to-gruppe']['width']); ?>'
													data-collapsed='<?php echo intval($columns['to-gruppe']['collapsed']); ?>'
													style='width: <?php echo intval($columns['to-gruppe']['width']); ?>px; <?php if ($columns['to-gruppe']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='to-protokoll'
												data-order='<?php echo intval($columns['to-protokoll']['order']); ?>'
												data-width='<?php echo intval($columns['to-protokoll']['width']); ?>'
												data-collapsed='<?php echo intval($columns['to-protokoll']['collapsed']); ?>'
												style='width: <?php echo intval($columns['to-protokoll']['width']); ?>px; <?php if ($columns['to-protokoll']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloaddoc_to_mitglied(); 
		}});
		
		win.append(getfilter_doc_to_mitglied_to_protokollListMultiFilter()); win.find('input').first().focus();
		return false;
	">
													<span class='title-title' title='<?php echo(sprintf(_('linked to %s'), _('Protokoll'))); ?>'><?php echo(sprintf(_('linked to %s'), _('Protokoll'))); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_doc_to-mitglied']) && $_GET['sort_doc_to-mitglied'] == 'to-protokoll ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_doc_to-mitglied']) && $_GET['sort_doc_to-mitglied'] == 'to-protokoll DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_doc_to-mitglied_to-protokoll']) || isset($_GET['range_max_doc_to-mitglied_to-protokoll']) || isset($_GET['deps_doc_to-mitglied_to-protokoll']) || isset($_GET['fullsearch_doc_to-mitglied_to-protokoll']) || isset($_GET['dynamic_doc_to-mitglied_to-protokoll']) || isset($_GET['search_doc_to-mitglied_to-protokoll']) || isset($_GET['searchnot_doc_to-mitglied_to-protokoll']) || isset($_GET['filter_doc_to-mitglied_to-protokoll'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['to-protokoll']['header'] = ob_get_contents(); ob_end_clean();
											$columns['to-protokoll']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['to-protokoll']['width']); ?>px; <?php if ($columns['to-protokoll']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; <?php if (($item['to-protokoll::vis'] ?? '0') == '0') { echo 'visibility: hidden;'; } ?>' data-column='to-protokoll'><?php
	
	call_user_func(function () use ($item) {
	$id = $item['to-protokoll'];
	$val = $item['to-protokoll::description'];
	$canView = $item['to-protokoll::canView'];
	if ($val !== null) {
		if ($canView) echo "<a tabindex=\"-1\" class=\"mdl-button mdl-button-small tbl-link\" data-tbl=\"protokoll\" data-id=\"".htmlentities($id)."\" onclick=\"event.stopPropagation(); event.preventDefault(); open_url(this.href, false);\" href=\"" . \TablesRouter\Protokoll::viewURL($id, ['from' => \FOP\Util::getBackURL()]) . "\">(…)</a>";echo htmlentities($val);
	} else {
		echo htmlentities(_('-') ?: '-');
	}
	});
	
?>
</div><?php
											};
											$columns['to-protokoll']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='to-protokoll'
													data-order='<?php echo intval($columns['to-protokoll']['order']); ?>'
													data-width='<?php echo intval($columns['to-protokoll']['width']); ?>'
													data-collapsed='<?php echo intval($columns['to-protokoll']['collapsed']); ?>'
													style='width: <?php echo intval($columns['to-protokoll']['width']); ?>px; <?php if ($columns['to-protokoll']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='first'
												data-order='<?php echo intval($columns['first']['order']); ?>'
												data-width='<?php echo intval($columns['first']['width']); ?>'
												data-collapsed='<?php echo intval($columns['first']['collapsed']); ?>'
												style='width: <?php echo intval($columns['first']['width']); ?>px; <?php if ($columns['first']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloaddoc_to_mitglied(); 
		}}, 600);
		date_filter(win, 'doc_to-mitglied', 'first', <?php echo htmlentities(json_encode(_('period'))); ?>, <?php echo htmlentities(json_encode(\FOP\I18n::getShortLocale())); ?>, <?php echo htmlentities(json_encode(_('dateformat_moment'))); ?>, function() { reloaddoc_to_mitglied();  reloaddoc_to_mitglied(); });
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_doc_to-mitglied'] == 'first ASC') {
			query['sort_doc_to-mitglied'] = 'first DESC';
		 } else if (query['sort_doc_to-mitglied'] == 'first DESC') {
		 	delete query['sort_doc_to-mitglied'];
		 } else {
			query['sort_doc_to-mitglied'] = 'first ASC';
		 }
		 reloaddoc_to_mitglied();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('firstrevision')); ?>'><?php echo(_('firstrevision')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_doc_to-mitglied']) && $_GET['sort_doc_to-mitglied'] == 'first ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_doc_to-mitglied']) && $_GET['sort_doc_to-mitglied'] == 'first DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_doc_to-mitglied_first']) || isset($_GET['range_max_doc_to-mitglied_first']) || isset($_GET['deps_doc_to-mitglied_first']) || isset($_GET['fullsearch_doc_to-mitglied_first']) || isset($_GET['dynamic_doc_to-mitglied_first']) || isset($_GET['search_doc_to-mitglied_first']) || isset($_GET['searchnot_doc_to-mitglied_first']) || isset($_GET['filter_doc_to-mitglied_first'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['first']['header'] = ob_get_contents(); ob_end_clean();
											$columns['first']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['first']['width']); ?>px; <?php if ($columns['first']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='first'><span class='overflow-text' title="<?php echo htmlentities(($item['first']) ? strftime(_('dateformat_php2'), intval($item['first'])) : ''); ?>"><?php echo htmlentities(($item['first']) ? strftime(_('dateformat_php2'), intval($item['first'])) : ''); ?></span></div><?php
											};
											$columns['first']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='first'
													data-order='<?php echo intval($columns['first']['order']); ?>'
													data-width='<?php echo intval($columns['first']['width']); ?>'
													data-collapsed='<?php echo intval($columns['first']['collapsed']); ?>'
													style='width: <?php echo intval($columns['first']['width']); ?>px; <?php if ($columns['first']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='last'
												data-order='<?php echo intval($columns['last']['order']); ?>'
												data-width='<?php echo intval($columns['last']['width']); ?>'
												data-collapsed='<?php echo intval($columns['last']['collapsed']); ?>'
												style='width: <?php echo intval($columns['last']['width']); ?>px; <?php if ($columns['last']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloaddoc_to_mitglied(); 
		}}, 600);
		date_filter(win, 'doc_to-mitglied', 'last', <?php echo htmlentities(json_encode(_('period'))); ?>, <?php echo htmlentities(json_encode(\FOP\I18n::getShortLocale())); ?>, <?php echo htmlentities(json_encode(_('dateformat_moment'))); ?>, function() { reloaddoc_to_mitglied();  reloaddoc_to_mitglied(); });
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_doc_to-mitglied'] == 'last ASC') {
			query['sort_doc_to-mitglied'] = 'last DESC';
		 } else if (query['sort_doc_to-mitglied'] == 'last DESC') {
		 	delete query['sort_doc_to-mitglied'];
		 } else {
			query['sort_doc_to-mitglied'] = 'last ASC';
		 }
		 reloaddoc_to_mitglied();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('currentrevision')); ?>'><?php echo(_('currentrevision')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_doc_to-mitglied']) && $_GET['sort_doc_to-mitglied'] == 'last ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_doc_to-mitglied']) && $_GET['sort_doc_to-mitglied'] == 'last DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_doc_to-mitglied_last']) || isset($_GET['range_max_doc_to-mitglied_last']) || isset($_GET['deps_doc_to-mitglied_last']) || isset($_GET['fullsearch_doc_to-mitglied_last']) || isset($_GET['dynamic_doc_to-mitglied_last']) || isset($_GET['search_doc_to-mitglied_last']) || isset($_GET['searchnot_doc_to-mitglied_last']) || isset($_GET['filter_doc_to-mitglied_last'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['last']['header'] = ob_get_contents(); ob_end_clean();
											$columns['last']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['last']['width']); ?>px; <?php if ($columns['last']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='last'><span class='overflow-text' title="<?php echo htmlentities(($item['last']) ? strftime(_('dateformat_php2'), intval($item['last'])) : ''); ?>"><?php echo htmlentities(($item['last']) ? strftime(_('dateformat_php2'), intval($item['last'])) : ''); ?></span></div><?php
											};
											$columns['last']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='last'
													data-order='<?php echo intval($columns['last']['order']); ?>'
													data-width='<?php echo intval($columns['last']['width']); ?>'
													data-collapsed='<?php echo intval($columns['last']['collapsed']); ?>'
													style='width: <?php echo intval($columns['last']['width']); ?>px; <?php if ($columns['last']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='archive'
												data-order='<?php echo intval($columns['archive']['order']); ?>'
												data-width='<?php echo intval($columns['archive']['width']); ?>'
												data-collapsed='<?php echo intval($columns['archive']['collapsed']); ?>'
												style='width: <?php echo intval($columns['archive']['width']); ?>px; <?php if ($columns['archive']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloaddoc_to_mitglied(); 
		}});
		win
	.append($('<input type=\'checkbox\'' + (querySet('filter_doc_to-mitglied_archive', '0') ? ' checked>': '>')).change(function (){querySet('filter_doc_to-mitglied_archive', '0', $(this).prop('checked')); delete query['page_doc_to-mitglied']; changed=true;})).append(' <?php echo(_('off')); ?><br/>')
	.append($('<input type=\'checkbox\'' + (querySet('filter_doc_to-mitglied_archive', '1') ? ' checked>': '>')).change(function (){querySet('filter_doc_to-mitglied_archive', '1', $(this).prop('checked')); delete query['page_doc_to-mitglied']; changed=true;})).append(' <?php echo(_('on')); ?><br/>')
;
		return false;
	">
													<span class='title-title' title='<?php echo(_('Archiv')); ?>'><?php echo(_('Archiv')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_doc_to-mitglied']) && $_GET['sort_doc_to-mitglied'] == 'archive ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_doc_to-mitglied']) && $_GET['sort_doc_to-mitglied'] == 'archive DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_doc_to-mitglied_archive']) || isset($_GET['range_max_doc_to-mitglied_archive']) || isset($_GET['deps_doc_to-mitglied_archive']) || isset($_GET['fullsearch_doc_to-mitglied_archive']) || isset($_GET['dynamic_doc_to-mitglied_archive']) || isset($_GET['search_doc_to-mitglied_archive']) || isset($_GET['searchnot_doc_to-mitglied_archive']) || isset($_GET['filter_doc_to-mitglied_archive'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['archive']['header'] = ob_get_contents(); ob_end_clean();
											$columns['archive']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['archive']['width']); ?>px; <?php if ($columns['archive']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='archive'><?php if($item['archive'] == 1){ ?>✓<?php }else{ ?><?php }?></div><?php
											};
											$columns['archive']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='archive'
													data-order='<?php echo intval($columns['archive']['order']); ?>'
													data-width='<?php echo intval($columns['archive']['width']); ?>'
													data-collapsed='<?php echo intval($columns['archive']['collapsed']); ?>'
													style='width: <?php echo intval($columns['archive']['width']); ?>px; <?php if ($columns['archive']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									

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

													<?php if (!isset($_GET['select'])) { ?>
													<div class='fop-table-column noprint' style="width: <?php echo json_encode($firstColumnWidth); ?>px;" onclick="$(this).find('input[type=checkbox]').first().click(); event.stopPropagation();">
													<label onclick="event.stopPropagation();" class="mdl-checkbox mdl-js-checkbox doc_to_mitglied__checkbox doc_to_mitglied__checkbox doc_to_mitglied__checkbox-ID-<?php echo htmlentities($item['ID']); ?>" style="width: auto;" for="doc_to_mitglied__<?php echo htmlentities($itempos); ?>-checkbox">
													<input class="mdl-checkbox__input" id="doc_to_mitglied__<?php echo htmlentities($itempos); ?>-checkbox" type="checkbox" onchange="<?php if (isset($item['ID'])) echo 'checkdoc_to_mitglied(' . htmlentities(json_encode($item['ID'])) . ', \'ID\', this.checked); ' ?>">
													</label><button type="button" class="mdl-button mdl-js-button mdl-button--icon doc_to_mitglied__action" onclick="
														event.stopPropagation();
														dropDownFixPosition($(this), $(this).next());
														">
														<i class="material-icons">more_vert</i>
													</button><ul class="mdl-list mdl-card mdl-shadow--4dp fop-scroll-menu" id="fop-scroll-menu-doc_to-mitglied-action-<?php echo $item['ID'] ?? 0; ?>">
														<?php
		if(isset($item['ID']) && $item['operation::view']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="view" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\Doc::viewURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick=" if (!event.ctrlKey) { open_url(reloaddoc_to_mitglied({action: 'open', fop_table: 'doc', fop_id: <?php echo htmlentities(json_encode($item['ID'])); ?>, fop_from: location.href}, true), true); return false; } $(this).closest('.overlay').click(); return false;  
					open_url(this.href, true);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">find_in_page</i></span><span class="fop-menu-caption" title="<?php echo(_('open')); ?>"><?php echo(_('open')); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && $item['operation::view'] && $item['operation::edit']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="edit" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\Doc::editURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="   
					open_url(this.href, true);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">edit</i></span><span class="fop-menu-caption" title="<?php echo(_('edit')); ?>"><?php echo(_('edit')); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && $item['operation::view'] && $item['operation::edit'] && $item['operation::85d1b573ee36a75e68edfb481189fc7817384d39e08985b286816a5d2410d60f']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="archive" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\Doc::archiveURL2(['id' => $item['ID'], 'from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="   
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">archive</i></span><span class="fop-menu-caption" title="<?php echo(_('archivieren')); ?>"><?php echo(_('archivieren')); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && (!\FOP\User::getIsGuest())) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="create_doc_revision_doc" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\Doc_revision::createURL2(['column_doc' => $item['ID'], 'from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="   
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">create</i></span><span class="fop-menu-caption" title="<?php echo(sprintf(_('create %s'), sprintf(_('revision %s'), _('Dokument')))); ?>"><?php echo(sprintf(_('create %s'), sprintf(_('revision %s'), _('Dokument')))); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && $item['operation::view']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="merge" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\Doc::mergeURL2(['id' => $item['ID'], 'from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="   
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">⛙</i></span><span class="fop-menu-caption" title="<?php echo(_('Duplikat/Version zusammenführen')); ?>"><?php echo(_('Duplikat/Version zusammenführen')); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && $item['operation::delete']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="delete" style="margin-right:auto; text-align:left;" href="#"
				onclick="if(!confirm(<?php echo htmlentities(json_encode(_('confirmdelete'))); ?>)) return false;   $.get('Tables/Doc/delete?ajax&id=<?php echo htmlentities($item['ID']);?>&from=<?php echo htmlentities(\FOP\Util::getBackUrl());?>').then(function () { reloaddoc_to_mitglied(); }, function (err) { if (err.responseText.startsWith('http')) { window.location.href = err.responseText; } else {alert(err.responseText); }}); $(this).closest('.overlay').click(); return false;
					open_url(this.href, true);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">delete</i></span><span class="fop-menu-caption" title="<?php echo(_('delete')); ?>"><?php echo(_('delete')); ?></span>
			</a>
		<?php } ?>
													</ul><?php
		if(isset($item['ID']) && $item['operation::view'] && $item['operation::edit']) {
			?><a class="mdl-button mdl-js-button mdl-button--icon tbl-link" data-tbl="doc" data-id="<?php echo htmlentities($item['ID']); ?>" data-interaction-name="edit" href="<?php echo htmlentities(\TablesRouter\Doc::editURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="event.stopPropagation();    reloaddoc_to_mitglied();
					$(this).closest('.overlay').click();
					if (this.href != '#') {
						open_url(this.href, true);
					}
					event.preventDefault();"
				title="<?php echo(_('edit')); ?>">
				<i class="material-icons">edit</i>
			</a><?php } ?><?php
		if(isset($item['ID']) && $item['operation::view']) {
			?><a class="mdl-button mdl-js-button mdl-button--icon tbl-link" data-tbl="doc" data-id="<?php echo htmlentities($item['ID']); ?>" data-interaction-name="view" href="<?php echo htmlentities(\TablesRouter\Doc::viewURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="event.stopPropagation();  if (!event.ctrlKey) { open_url(reloaddoc_to_mitglied({action: 'open', fop_table: 'doc', fop_id: <?php echo htmlentities(json_encode($item['ID'])); ?>, fop_from: location.href}, true), true); return false; }  reloaddoc_to_mitglied();
					$(this).closest('.overlay').click();
					if (this.href != '#') {
						open_url(this.href, true);
					}
					event.preventDefault();"
				title="<?php echo(_('open')); ?>">
				<i class="material-icons">find_in_page</i>
			</a><?php } ?>
													</div><?php } ?><?php
													
													foreach ($columns AS $col) {
														$col['render']($item);
													}
													?></div>
												 <?php }?>

													</div>
												</div>

												
												
												</div><?php
												
	
    
  }

  public static function renderScript($id) { 
    
    
    // --- BLOCK: main ---
    
								\FOP\I18n::ensureIsLoaded();
								?>
								<script type="text/javascript">
									
    function changefilter_doc_to_mitglied_typeListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_doc_to-mitglied_type', val, cb.checked);
		  } else {
			  delete query['filter_doc_to-mitglied_type'];
		  }reloaddoc_to_mitglied();
        
    }

		var id0b3c91cc3237f65224aa0db7139a9a8f0a2646e0e83fc3b5937effe9d4e0c31timeout = null;
		function changefilter_doc_to_mitglied_typeSearchFilter(val, callback) {
			if(id0b3c91cc3237f65224aa0db7139a9a8f0a2646e0e83fc3b5937effe9d4e0c31timeout) clearTimeout(id0b3c91cc3237f65224aa0db7139a9a8f0a2646e0e83fc3b5937effe9d4e0c31timeout);

			id0b3c91cc3237f65224aa0db7139a9a8f0a2646e0e83fc3b5937effe9d4e0c31timeout = setTimeout(function() {
				$.getJSON(reloaddoc_to_mitglied({action: 'getfilter_doc_to_mitglied_typeItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_doc_to-mitglied_type_orig'] = val;
				});
			}, 300);
		}

	function getfilter_doc_to_mitglied_typeListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_doc_to-mitglied_type_orig']) ? json_encode($_GET['filter_doc_to-mitglied_type_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="d0b3c91cc3237f65224aa0db7139a9a8f0a2646e0e83fc3b5937effe9d4e0c31" type="text">' +
			'<label class="mdl-textfield__label" for="d0b3c91cc3237f65224aa0db7139a9a8f0a2646e0e83fc3b5937effe9d4e0c31">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_doc_to-mitglied_type', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_doc_to-mitglied_type_orig'] = '';
					delete query['filter_doc_to-mitglied_type'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloaddoc_to_mitglied();
					
				} else {
					$('#table_doc_to_mitglied').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_doc_to_mitglied_typeSearchFilter(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\Doc_to_mitglied::getfilter_doc_to_mitglied_typeItemsByStringAction('', $id));
		?>;

		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_doc_to-mitglied_type_orig'] = '';
				delete query['filter_doc_to-mitglied_type'];
				reload('', items);reloaddoc_to_mitglied();
				
			})).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_doc_to-mitglied_type', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_doc_to_mitglied_typeListMultiFilter("' + 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_doc_to_mitglied_to_gruppeListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_doc_to-mitglied_to-gruppe', val, cb.checked);
		  } else {
			  delete query['filter_doc_to-mitglied_to-gruppe'];
		  }reloaddoc_to_mitglied();
        
    }

		var ib15715f1e4d416ca1b49a6137141d2ac5f42b132732f838671f52ad0f163e74dtimeout = null;
		function changefilter_doc_to_mitglied_to_gruppeSearchFilter(val, callback) {
			if(ib15715f1e4d416ca1b49a6137141d2ac5f42b132732f838671f52ad0f163e74dtimeout) clearTimeout(ib15715f1e4d416ca1b49a6137141d2ac5f42b132732f838671f52ad0f163e74dtimeout);

			ib15715f1e4d416ca1b49a6137141d2ac5f42b132732f838671f52ad0f163e74dtimeout = setTimeout(function() {
				$.getJSON(reloaddoc_to_mitglied({action: 'getfilter_doc_to_mitglied_to_gruppeItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_doc_to-mitglied_to-gruppe_orig'] = val;
				});
			}, 300);
		}

	function getfilter_doc_to_mitglied_to_gruppeListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_doc_to-mitglied_to-gruppe_orig']) ? json_encode($_GET['filter_doc_to-mitglied_to-gruppe_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="b15715f1e4d416ca1b49a6137141d2ac5f42b132732f838671f52ad0f163e74d" type="text">' +
			'<label class="mdl-textfield__label" for="b15715f1e4d416ca1b49a6137141d2ac5f42b132732f838671f52ad0f163e74d">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_doc_to-mitglied_to-gruppe', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_doc_to-mitglied_to-gruppe_orig'] = '';
					delete query['filter_doc_to-mitglied_to-gruppe'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloaddoc_to_mitglied();
					
				} else {
					$('#table_doc_to_mitglied').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_doc_to_mitglied_to_gruppeSearchFilter(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\Doc_to_mitglied::getfilter_doc_to_mitglied_to_gruppeItemsByStringAction('', $id));
		?>;

		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_doc_to-mitglied_to-gruppe_orig'] = '';
				delete query['filter_doc_to-mitglied_to-gruppe'];
				reload('', items);reloaddoc_to_mitglied();
				
			})).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_doc_to-mitglied_to-gruppe', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_doc_to_mitglied_to_gruppeListMultiFilter("' + 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_doc_to_mitglied_to_mitgliedListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_doc_to-mitglied_to-mitglied', val, cb.checked);
		  } else {
			  delete query['filter_doc_to-mitglied_to-mitglied'];
		  }reloaddoc_to_mitglied();
        
    }

		var if7cc1142e1f48511afc78f1c48a29f48dbf81563fb58f0194ee79f47f3fa24f5timeout = null;
		function changefilter_doc_to_mitglied_to_mitgliedSearchFilter(val, callback) {
			if(if7cc1142e1f48511afc78f1c48a29f48dbf81563fb58f0194ee79f47f3fa24f5timeout) clearTimeout(if7cc1142e1f48511afc78f1c48a29f48dbf81563fb58f0194ee79f47f3fa24f5timeout);

			if7cc1142e1f48511afc78f1c48a29f48dbf81563fb58f0194ee79f47f3fa24f5timeout = setTimeout(function() {
				$.getJSON(reloaddoc_to_mitglied({action: 'getfilter_doc_to_mitglied_to_mitgliedItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_doc_to-mitglied_to-mitglied_orig'] = val;
				});
			}, 300);
		}

	function getfilter_doc_to_mitglied_to_mitgliedListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_doc_to-mitglied_to-mitglied_orig']) ? json_encode($_GET['filter_doc_to-mitglied_to-mitglied_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="f7cc1142e1f48511afc78f1c48a29f48dbf81563fb58f0194ee79f47f3fa24f5" type="text">' +
			'<label class="mdl-textfield__label" for="f7cc1142e1f48511afc78f1c48a29f48dbf81563fb58f0194ee79f47f3fa24f5">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_doc_to-mitglied_to-mitglied', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_doc_to-mitglied_to-mitglied_orig'] = '';
					delete query['filter_doc_to-mitglied_to-mitglied'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloaddoc_to_mitglied();
					
				} else {
					$('#table_doc_to_mitglied').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_doc_to_mitglied_to_mitgliedSearchFilter(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\Doc_to_mitglied::getfilter_doc_to_mitglied_to_mitgliedItemsByStringAction('', $id));
		?>;

		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_doc_to-mitglied_to-mitglied_orig'] = '';
				delete query['filter_doc_to-mitglied_to-mitglied'];
				reload('', items);reloaddoc_to_mitglied();
				
			})).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_doc_to-mitglied_to-mitglied', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_doc_to_mitglied_to_mitgliedListMultiFilter("' + 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_doc_to_mitglied_to_protokollListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_doc_to-mitglied_to-protokoll', val, cb.checked);
		  } else {
			  delete query['filter_doc_to-mitglied_to-protokoll'];
		  }reloaddoc_to_mitglied();
        
    }

		var i716fdef948b63ce3a8b06fe987a69bb8ddff0f0ed80c8fadbe1172fe089df6fetimeout = null;
		function changefilter_doc_to_mitglied_to_protokollSearchFilter(val, callback) {
			if(i716fdef948b63ce3a8b06fe987a69bb8ddff0f0ed80c8fadbe1172fe089df6fetimeout) clearTimeout(i716fdef948b63ce3a8b06fe987a69bb8ddff0f0ed80c8fadbe1172fe089df6fetimeout);

			i716fdef948b63ce3a8b06fe987a69bb8ddff0f0ed80c8fadbe1172fe089df6fetimeout = setTimeout(function() {
				$.getJSON(reloaddoc_to_mitglied({action: 'getfilter_doc_to_mitglied_to_protokollItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_doc_to-mitglied_to-protokoll_orig'] = val;
				});
			}, 300);
		}

	function getfilter_doc_to_mitglied_to_protokollListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_doc_to-mitglied_to-protokoll_orig']) ? json_encode($_GET['filter_doc_to-mitglied_to-protokoll_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="716fdef948b63ce3a8b06fe987a69bb8ddff0f0ed80c8fadbe1172fe089df6fe" type="text">' +
			'<label class="mdl-textfield__label" for="716fdef948b63ce3a8b06fe987a69bb8ddff0f0ed80c8fadbe1172fe089df6fe">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_doc_to-mitglied_to-protokoll', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_doc_to-mitglied_to-protokoll_orig'] = '';
					delete query['filter_doc_to-mitglied_to-protokoll'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloaddoc_to_mitglied();
					
				} else {
					$('#table_doc_to_mitglied').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_doc_to_mitglied_to_protokollSearchFilter(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\Doc_to_mitglied::getfilter_doc_to_mitglied_to_protokollItemsByStringAction('', $id));
		?>;

		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_doc_to-mitglied_to-protokoll_orig'] = '';
				delete query['filter_doc_to-mitglied_to-protokoll'];
				reload('', items);reloaddoc_to_mitglied();
				
			})).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_doc_to-mitglied_to-protokoll', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_doc_to_mitglied_to_protokollListMultiFilter("' + 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_doc_to_mitglied_typeListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_doc_to-mitglied_type', val, cb.checked);
		  } else {
			  delete query['filter_doc_to-mitglied_type'];
		  }reloaddoc_to_mitglied();
        
    }

		var id0b3c91cc3237f65224aa0db7139a9a8f0a2646e0e83fc3b5937effe9d4e0c31timeout = null;
		function changefilter_doc_to_mitglied_typeSearchFilter(val, callback) {
			if(id0b3c91cc3237f65224aa0db7139a9a8f0a2646e0e83fc3b5937effe9d4e0c31timeout) clearTimeout(id0b3c91cc3237f65224aa0db7139a9a8f0a2646e0e83fc3b5937effe9d4e0c31timeout);

			id0b3c91cc3237f65224aa0db7139a9a8f0a2646e0e83fc3b5937effe9d4e0c31timeout = setTimeout(function() {
				$.getJSON(reloaddoc_to_mitglied({action: 'getfilter_doc_to_mitglied_typeItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_doc_to-mitglied_type_orig'] = val;
				});
			}, 300);
		}

	function getfilter_doc_to_mitglied_typeListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_doc_to-mitglied_type_orig']) ? json_encode($_GET['filter_doc_to-mitglied_type_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="d0b3c91cc3237f65224aa0db7139a9a8f0a2646e0e83fc3b5937effe9d4e0c31" type="text">' +
			'<label class="mdl-textfield__label" for="d0b3c91cc3237f65224aa0db7139a9a8f0a2646e0e83fc3b5937effe9d4e0c31">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_doc_to-mitglied_type', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_doc_to-mitglied_type_orig'] = '';
					delete query['filter_doc_to-mitglied_type'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloaddoc_to_mitglied();
					
				} else {
					$('#table_doc_to_mitglied').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_doc_to_mitglied_typeSearchFilter(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\Doc_to_mitglied::getfilter_doc_to_mitglied_typeItemsByStringAction('', $id));
		?>;

		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_doc_to-mitglied_type_orig'] = '';
				delete query['filter_doc_to-mitglied_type'];
				reload('', items);reloaddoc_to_mitglied();
				
			})).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_doc_to-mitglied_type', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_doc_to_mitglied_typeListMultiFilter("' + 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_doc_to_mitglied_to_gruppeListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_doc_to-mitglied_to-gruppe', val, cb.checked);
		  } else {
			  delete query['filter_doc_to-mitglied_to-gruppe'];
		  }reloaddoc_to_mitglied();
        
    }

		var ib15715f1e4d416ca1b49a6137141d2ac5f42b132732f838671f52ad0f163e74dtimeout = null;
		function changefilter_doc_to_mitglied_to_gruppeSearchFilter(val, callback) {
			if(ib15715f1e4d416ca1b49a6137141d2ac5f42b132732f838671f52ad0f163e74dtimeout) clearTimeout(ib15715f1e4d416ca1b49a6137141d2ac5f42b132732f838671f52ad0f163e74dtimeout);

			ib15715f1e4d416ca1b49a6137141d2ac5f42b132732f838671f52ad0f163e74dtimeout = setTimeout(function() {
				$.getJSON(reloaddoc_to_mitglied({action: 'getfilter_doc_to_mitglied_to_gruppeItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_doc_to-mitglied_to-gruppe_orig'] = val;
				});
			}, 300);
		}

	function getfilter_doc_to_mitglied_to_gruppeListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_doc_to-mitglied_to-gruppe_orig']) ? json_encode($_GET['filter_doc_to-mitglied_to-gruppe_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="b15715f1e4d416ca1b49a6137141d2ac5f42b132732f838671f52ad0f163e74d" type="text">' +
			'<label class="mdl-textfield__label" for="b15715f1e4d416ca1b49a6137141d2ac5f42b132732f838671f52ad0f163e74d">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_doc_to-mitglied_to-gruppe', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_doc_to-mitglied_to-gruppe_orig'] = '';
					delete query['filter_doc_to-mitglied_to-gruppe'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloaddoc_to_mitglied();
					
				} else {
					$('#table_doc_to_mitglied').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_doc_to_mitglied_to_gruppeSearchFilter(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\Doc_to_mitglied::getfilter_doc_to_mitglied_to_gruppeItemsByStringAction('', $id));
		?>;

		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_doc_to-mitglied_to-gruppe_orig'] = '';
				delete query['filter_doc_to-mitglied_to-gruppe'];
				reload('', items);reloaddoc_to_mitglied();
				
			})).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_doc_to-mitglied_to-gruppe', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_doc_to_mitglied_to_gruppeListMultiFilter("' + 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_doc_to_mitglied_to_mitgliedListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_doc_to-mitglied_to-mitglied', val, cb.checked);
		  } else {
			  delete query['filter_doc_to-mitglied_to-mitglied'];
		  }reloaddoc_to_mitglied();
        
    }

		var if7cc1142e1f48511afc78f1c48a29f48dbf81563fb58f0194ee79f47f3fa24f5timeout = null;
		function changefilter_doc_to_mitglied_to_mitgliedSearchFilter(val, callback) {
			if(if7cc1142e1f48511afc78f1c48a29f48dbf81563fb58f0194ee79f47f3fa24f5timeout) clearTimeout(if7cc1142e1f48511afc78f1c48a29f48dbf81563fb58f0194ee79f47f3fa24f5timeout);

			if7cc1142e1f48511afc78f1c48a29f48dbf81563fb58f0194ee79f47f3fa24f5timeout = setTimeout(function() {
				$.getJSON(reloaddoc_to_mitglied({action: 'getfilter_doc_to_mitglied_to_mitgliedItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_doc_to-mitglied_to-mitglied_orig'] = val;
				});
			}, 300);
		}

	function getfilter_doc_to_mitglied_to_mitgliedListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_doc_to-mitglied_to-mitglied_orig']) ? json_encode($_GET['filter_doc_to-mitglied_to-mitglied_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="f7cc1142e1f48511afc78f1c48a29f48dbf81563fb58f0194ee79f47f3fa24f5" type="text">' +
			'<label class="mdl-textfield__label" for="f7cc1142e1f48511afc78f1c48a29f48dbf81563fb58f0194ee79f47f3fa24f5">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_doc_to-mitglied_to-mitglied', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_doc_to-mitglied_to-mitglied_orig'] = '';
					delete query['filter_doc_to-mitglied_to-mitglied'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloaddoc_to_mitglied();
					
				} else {
					$('#table_doc_to_mitglied').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_doc_to_mitglied_to_mitgliedSearchFilter(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\Doc_to_mitglied::getfilter_doc_to_mitglied_to_mitgliedItemsByStringAction('', $id));
		?>;

		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_doc_to-mitglied_to-mitglied_orig'] = '';
				delete query['filter_doc_to-mitglied_to-mitglied'];
				reload('', items);reloaddoc_to_mitglied();
				
			})).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_doc_to-mitglied_to-mitglied', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_doc_to_mitglied_to_mitgliedListMultiFilter("' + 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_doc_to_mitglied_to_protokollListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_doc_to-mitglied_to-protokoll', val, cb.checked);
		  } else {
			  delete query['filter_doc_to-mitglied_to-protokoll'];
		  }reloaddoc_to_mitglied();
        
    }

		var i716fdef948b63ce3a8b06fe987a69bb8ddff0f0ed80c8fadbe1172fe089df6fetimeout = null;
		function changefilter_doc_to_mitglied_to_protokollSearchFilter(val, callback) {
			if(i716fdef948b63ce3a8b06fe987a69bb8ddff0f0ed80c8fadbe1172fe089df6fetimeout) clearTimeout(i716fdef948b63ce3a8b06fe987a69bb8ddff0f0ed80c8fadbe1172fe089df6fetimeout);

			i716fdef948b63ce3a8b06fe987a69bb8ddff0f0ed80c8fadbe1172fe089df6fetimeout = setTimeout(function() {
				$.getJSON(reloaddoc_to_mitglied({action: 'getfilter_doc_to_mitglied_to_protokollItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_doc_to-mitglied_to-protokoll_orig'] = val;
				});
			}, 300);
		}

	function getfilter_doc_to_mitglied_to_protokollListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_doc_to-mitglied_to-protokoll_orig']) ? json_encode($_GET['filter_doc_to-mitglied_to-protokoll_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="716fdef948b63ce3a8b06fe987a69bb8ddff0f0ed80c8fadbe1172fe089df6fe" type="text">' +
			'<label class="mdl-textfield__label" for="716fdef948b63ce3a8b06fe987a69bb8ddff0f0ed80c8fadbe1172fe089df6fe">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_doc_to-mitglied_to-protokoll', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_doc_to-mitglied_to-protokoll_orig'] = '';
					delete query['filter_doc_to-mitglied_to-protokoll'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloaddoc_to_mitglied();
					
				} else {
					$('#table_doc_to_mitglied').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_doc_to_mitglied_to_protokollSearchFilter(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\Doc_to_mitglied::getfilter_doc_to_mitglied_to_protokollItemsByStringAction('', $id));
		?>;

		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_doc_to-mitglied_to-protokoll_orig'] = '';
				delete query['filter_doc_to-mitglied_to-protokoll'];
				reload('', items);reloaddoc_to_mitglied();
				
			})).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_doc_to-mitglied_to-protokoll', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_doc_to_mitglied_to_protokollListMultiFilter("' + 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 updateNumberdoc_to_mitglied(col) {
										//var checklist = window.DataViewChecked['doc_to-mitglied'][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['doc_to-mitglied'] && window.DataViewChecked['doc_to-mitglied'][col].ranges.length > 0) {
											$('.doc_to_mitglied__mass-action').css('visibility', 'visible');
											$('.doc_to_mitglied__action').css('visibility', 'hidden');
										} else {
											$('.doc_to_mitglied__mass-action').css('visibility', 'hidden');
											$('.doc_to_mitglied__action').css('visibility', 'visible');
										}
										$('.doc_to_mitglied__checkbox').each(function (idx, x) {
											for (var cssclass of x.classList) {
												if (cssclass.startsWith('doc_to_mitglied__checkbox-'+col+'-')) {
													var my_id = cssclass.substr(('doc_to_mitglied__checkbox-'+col+'-').length);
													if (window.DataViewChecked) {
														x.MaterialCheckbox[checklist.has(my_id) ? 'check' : 'uncheck']();
													}
												}
											}
										});
									}
									function reloaddoc_to_mitglied (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 } ?>
										nq["id"] = <?php echo json_encode($id); ?>; 
										if (params) {
											for (var i in params) nq[i] = params[i];
											var action = nq['action'];
											delete nq['action'];
											let querystr = "DataView/Doc_to_mitglied/" + 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::getDokument())) && (!\FOP\User::getIsGuest())) { ?>
											delete nq['action'];
											querystr = "DataView/Doc_to_mitglied/renderTabTable?" + Object.keys(nq).map(function(k){ return k + "=" +  encodeURIComponent(nq[k]); }).join("&");
											// per Ajax laden
											if(!$("#doc_to_mitglied-table")?.parent()?.parent()?.hasClass('fop-form-feature-collapsed') || $("#doc_to_mitglied-table")?.parent()?.parent()?.hasClass('fop-form-feature-mode-area')) {
											$.get(querystr, function(data){
												var tab = $("#doc_to_mitglied-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
												updateNumberdoc_to_mitglied('ID');
											});
											} else {
												// gesamten Tab ersetzen
												var tab = $("#doc_to_mitglied-table");
												tab.children().remove();
												el = tab.html('<div class="fop-lazy-reload" onclick="reloaddoc_to_mitglied()"></div>');
											}
											<?php } ?>
											
										}
									}
									function checkdoc_to_mitglied (id, col, checked) {
										// ID-Liste aufbauen
										if (!window.DataViewChecked) window.DataViewChecked = {};
										if (!window.DataViewChecked['doc_to-mitglied']) window.DataViewChecked['doc_to-mitglied'] = {};
										if (!window.DataViewChecked['doc_to-mitglied'][col]) window.DataViewChecked['doc_to-mitglied'][col] = new IDList();

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

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

    
  }

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

	</script>
	<?php
	
    
  }

  public static function getSQL($params, $id) { 
    
    
    // --- 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 /* ::color */ CASE  WHEN ((((SELECT Tables_Doc_defaultDoctype FROM userconfig WHERE userconfig.'.qi('ID').' = 1 LIMIT 1)) IS NULL) AND (('.qi('doc').'.'.qi('type').') IS NULL)) OR (('.qi('doc').'.'.qi('type').') = ((SELECT Tables_Doc_defaultDoctype FROM userconfig WHERE userconfig.'.qi('ID').' = 1 LIMIT 1))) THEN (\'#f002\')  ELSE NULL END AS '.qi('::color').',
									/* ID */ '.qi('ID').' AS '.qi('ID').',
									/* archive */ '.qi('archive').' AS '.qi('archive').',
									/* boxid */ '.qi('boxid').' AS '.qi('boxid').',
									/* date */ '.qi('date').' AS '.qi('date').',
									/* file */ (SELECT ('.qi('pcs0uG6Q').'.'.qi('file').') FROM '.qi('doc_revision').' '.qi('pcs0uG6Q').' WHERE '.qi('pcs0uG6Q').'.'.qi('doc').' = '.qi('doc').'.'.qi('ID').' ORDER BY '.qi('pcs0uG6Q').'.'.qi('created').' DESC LIMIT 1) AS '.qi('file').',
									/* first */ (SELECT MIN('.qi('2cOfKiO9').'.'.qi('created').') FROM '.qi('doc_revision').' '.qi('2cOfKiO9').' WHERE '.qi('2cOfKiO9').'.'.qi('doc').' = '.qi('doc').'.'.qi('ID').' LIMIT 1) AS '.qi('first').',
									/* last */ (SELECT MAX('.qi('Y34Pv7BX').'.'.qi('created').') FROM '.qi('doc_revision').' '.qi('Y34Pv7BX').' WHERE '.qi('Y34Pv7BX').'.'.qi('doc').' = '.qi('doc').'.'.qi('ID').' LIMIT 1) AS '.qi('last').',
									/* msgid */ '.qi('msgid').' AS '.qi('msgid').',
									/* notes */ '.qi('notes').' AS '.qi('notes').',
									/* operation::85d1b573ee36a75e68edfb481189fc7817384d39e08985b286816a5d2410d60f */ (('.qi('doc').'.'.qi('archive').') = (0)) AS '.qi('operation::85d1b573ee36a75e68edfb481189fc7817384d39e08985b286816a5d2410d60f').',
									/* operation::create */ ('.\FOP\Database::quote(\FOP\User::getDokument()).') AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getGruppe()).' THEN TRUE ELSE NOT (('.qi('Lz3GkDZU').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) END) FROM '.qi('mitglied').' '.qi('Lz3GkDZU').' WHERE '.qi('Lz3GkDZU').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getMitglied()).' THEN TRUE ELSE NOT ((('.qi('NZmTwx0z').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) AND (NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeItem').' '.qi('7sncgH3z').' WHERE '.qi('7sncgH3z').'.'.qi('item').' = '.qi('NZmTwx0z').'.'.qi('ID').' AND (EXISTS (SELECT (TRUE) FROM '.qi('gruppeVerantwortlich').' '.qi('eHueOsQC').' WHERE '.qi('eHueOsQC').'.'.qi('gruppe').' = '.qi('7sncgH3z').'.'.qi('list').' AND (('.qi('eHueOsQC').'.'.qi('mitglied').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1)) LIMIT 1)))) END) FROM '.qi('mitglied').' '.qi('NZmTwx0z').' WHERE '.qi('NZmTwx0z').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT ('.\FOP\Database::quote(\FOP\User::getProtokoll()).') FROM '.qi('protokoll').' '.qi('S0UBR3pi').' WHERE '.qi('S0UBR3pi').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-protokoll').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getSuperadmin()).' THEN TRUE ELSE NOT ('.qi('kXMUqzLH').'.'.qi('superadmin').') END) FROM '.qi('mitglied').' '.qi('kXMUqzLH').' WHERE '.qi('kXMUqzLH').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getMitglied()).' THEN TRUE ELSE NOT ((NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeItem').' '.qi('hX7wRx63').' WHERE '.qi('hX7wRx63').'.'.qi('list').' = '.qi('7zme5GbR').'.'.qi('ID').' AND (('.qi('hX7wRx63').'.'.qi('item').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1))) AND (NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeVerantwortlich').' '.qi('yvRIjwTv').' WHERE '.qi('yvRIjwTv').'.'.qi('gruppe').' = '.qi('7zme5GbR').'.'.qi('ID').' AND (('.qi('yvRIjwTv').'.'.qi('mitglied').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1))) AND (NOT ('.qi('7zme5GbR').'.'.qi('public').'))) END) FROM '.qi('gruppe').' '.qi('7zme5GbR').' WHERE '.qi('7zme5GbR').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-gruppe').' LIMIT 1), TRUE)) AS '.qi('operation::create').',
									/* operation::delete */ (FALSE) AND ('.\FOP\Database::quote(\FOP\User::getDokument()).') AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getGruppe()).' THEN TRUE ELSE NOT (('.qi('jiHGDwTc').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) END) FROM '.qi('mitglied').' '.qi('jiHGDwTc').' WHERE '.qi('jiHGDwTc').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getMitglied()).' THEN TRUE ELSE NOT ((('.qi('2L3JcPgq').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) AND (NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeItem').' '.qi('7sncgH3z').' WHERE '.qi('7sncgH3z').'.'.qi('item').' = '.qi('2L3JcPgq').'.'.qi('ID').' AND (EXISTS (SELECT (TRUE) FROM '.qi('gruppeVerantwortlich').' '.qi('eHueOsQC').' WHERE '.qi('eHueOsQC').'.'.qi('gruppe').' = '.qi('7sncgH3z').'.'.qi('list').' AND (('.qi('eHueOsQC').'.'.qi('mitglied').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1)) LIMIT 1)))) END) FROM '.qi('mitglied').' '.qi('2L3JcPgq').' WHERE '.qi('2L3JcPgq').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT ('.\FOP\Database::quote(\FOP\User::getProtokoll()).') FROM '.qi('protokoll').' '.qi('aVKzkIxT').' WHERE '.qi('aVKzkIxT').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-protokoll').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getSuperadmin()).' THEN TRUE ELSE NOT ('.qi('oYgz3Zk9').'.'.qi('superadmin').') END) FROM '.qi('mitglied').' '.qi('oYgz3Zk9').' WHERE '.qi('oYgz3Zk9').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getMitglied()).' THEN TRUE ELSE NOT ((NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeItem').' '.qi('hX7wRx63').' WHERE '.qi('hX7wRx63').'.'.qi('list').' = '.qi('Je6BzKDx').'.'.qi('ID').' AND (('.qi('hX7wRx63').'.'.qi('item').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1))) AND (NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeVerantwortlich').' '.qi('yvRIjwTv').' WHERE '.qi('yvRIjwTv').'.'.qi('gruppe').' = '.qi('Je6BzKDx').'.'.qi('ID').' AND (('.qi('yvRIjwTv').'.'.qi('mitglied').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1))) AND (NOT ('.qi('Je6BzKDx').'.'.qi('public').'))) END) FROM '.qi('gruppe').' '.qi('Je6BzKDx').' WHERE '.qi('Je6BzKDx').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-gruppe').' LIMIT 1), TRUE)) AS '.qi('operation::delete').',
									/* operation::edit */ ('.\FOP\Database::quote(\FOP\User::getDokument()).') AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getGruppe()).' THEN TRUE ELSE NOT (('.qi('a3H18ePF').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) END) FROM '.qi('mitglied').' '.qi('a3H18ePF').' WHERE '.qi('a3H18ePF').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getMitglied()).' THEN TRUE ELSE NOT ((('.qi('fXl0iMc3').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) AND (NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeItem').' '.qi('7sncgH3z').' WHERE '.qi('7sncgH3z').'.'.qi('item').' = '.qi('fXl0iMc3').'.'.qi('ID').' AND (EXISTS (SELECT (TRUE) FROM '.qi('gruppeVerantwortlich').' '.qi('eHueOsQC').' WHERE '.qi('eHueOsQC').'.'.qi('gruppe').' = '.qi('7sncgH3z').'.'.qi('list').' AND (('.qi('eHueOsQC').'.'.qi('mitglied').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1)) LIMIT 1)))) END) FROM '.qi('mitglied').' '.qi('fXl0iMc3').' WHERE '.qi('fXl0iMc3').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT ('.\FOP\Database::quote(\FOP\User::getProtokoll()).') FROM '.qi('protokoll').' '.qi('iVCI3rck').' WHERE '.qi('iVCI3rck').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-protokoll').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getSuperadmin()).' THEN TRUE ELSE NOT ('.qi('Ot4cBnlj').'.'.qi('superadmin').') END) FROM '.qi('mitglied').' '.qi('Ot4cBnlj').' WHERE '.qi('Ot4cBnlj').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getMitglied()).' THEN TRUE ELSE NOT ((NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeItem').' '.qi('hX7wRx63').' WHERE '.qi('hX7wRx63').'.'.qi('list').' = '.qi('K2POIfyF').'.'.qi('ID').' AND (('.qi('hX7wRx63').'.'.qi('item').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1))) AND (NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeVerantwortlich').' '.qi('yvRIjwTv').' WHERE '.qi('yvRIjwTv').'.'.qi('gruppe').' = '.qi('K2POIfyF').'.'.qi('ID').' AND (('.qi('yvRIjwTv').'.'.qi('mitglied').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1))) AND (NOT ('.qi('K2POIfyF').'.'.qi('public').'))) END) FROM '.qi('gruppe').' '.qi('K2POIfyF').' WHERE '.qi('K2POIfyF').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-gruppe').' LIMIT 1), TRUE)) AS '.qi('operation::edit').',
									/* operation::index */ ' . (!\FOP\User::getIsGuest() ? 1 : 0) . ' AS '.qi('operation::index').',
									/* operation::view */ ('.\FOP\Database::quote(\FOP\User::getDokument()).') AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getGruppe()).' THEN TRUE ELSE NOT (('.qi('ok3G4wPh').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) END) FROM '.qi('mitglied').' '.qi('ok3G4wPh').' WHERE '.qi('ok3G4wPh').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getMitglied()).' THEN TRUE ELSE NOT ((('.qi('2Hyq8DKe').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) AND (NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeItem').' '.qi('7sncgH3z').' WHERE '.qi('7sncgH3z').'.'.qi('item').' = '.qi('2Hyq8DKe').'.'.qi('ID').' AND (EXISTS (SELECT (TRUE) FROM '.qi('gruppeVerantwortlich').' '.qi('eHueOsQC').' WHERE '.qi('eHueOsQC').'.'.qi('gruppe').' = '.qi('7sncgH3z').'.'.qi('list').' AND (('.qi('eHueOsQC').'.'.qi('mitglied').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1)) LIMIT 1)))) END) FROM '.qi('mitglied').' '.qi('2Hyq8DKe').' WHERE '.qi('2Hyq8DKe').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT ('.\FOP\Database::quote(\FOP\User::getProtokoll()).') FROM '.qi('protokoll').' '.qi('jYtYUs5c').' WHERE '.qi('jYtYUs5c').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-protokoll').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getSuperadmin()).' THEN TRUE ELSE NOT ('.qi('bmxCMQlw').'.'.qi('superadmin').') END) FROM '.qi('mitglied').' '.qi('bmxCMQlw').' WHERE '.qi('bmxCMQlw').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getMitglied()).' THEN TRUE ELSE NOT ((NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeItem').' '.qi('hX7wRx63').' WHERE '.qi('hX7wRx63').'.'.qi('list').' = '.qi('9lhFb6lb').'.'.qi('ID').' AND (('.qi('hX7wRx63').'.'.qi('item').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1))) AND (NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeVerantwortlich').' '.qi('yvRIjwTv').' WHERE '.qi('yvRIjwTv').'.'.qi('gruppe').' = '.qi('9lhFb6lb').'.'.qi('ID').' AND (('.qi('yvRIjwTv').'.'.qi('mitglied').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1))) AND (NOT ('.qi('9lhFb6lb').'.'.qi('public').'))) END) FROM '.qi('gruppe').' '.qi('9lhFb6lb').' WHERE '.qi('9lhFb6lb').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-gruppe').' LIMIT 1), TRUE)) AS '.qi('operation::view').',
									/* postboxtype */ '.qi('postboxtype').' AS '.qi('postboxtype').',
									/* subject */ '.qi('subject').' AS '.qi('subject').',
									/* to-gruppe */ '.qi('to-gruppe').' AS '.qi('to-gruppe').',
									/* to-gruppe::canView */ '.qi('ref:to-gruppe').'.'.qi('to-gruppe:canView').' AS '.qi('to-gruppe::canView').',
									/* to-gruppe::description */ '.qi('ref:to-gruppe').'.'.qi('to-gruppe:description').' AS '.qi('to-gruppe::description').',
									/* to-gruppe::vis */ (SELECT ('.qi('lBXFiXqU').'.'.qi('has-gruppe').') FROM '.qi('docType').' '.qi('lBXFiXqU').' WHERE '.qi('lBXFiXqU').'.'.qi('ID').' = '.qi('doc').'.'.qi('type').' LIMIT 1) AS '.qi('to-gruppe::vis').',
									/* to-mitglied */ '.qi('to-mitglied').' AS '.qi('to-mitglied').',
									/* to-mitglied::canView */ '.qi('ref:to-mitglied').'.'.qi('to-mitglied:canView').' AS '.qi('to-mitglied::canView').',
									/* to-mitglied::description */ '.qi('ref:to-mitglied').'.'.qi('to-mitglied:description').' AS '.qi('to-mitglied::description').',
									/* to-mitglied::vis */ (SELECT ('.qi('6GSnIHxl').'.'.qi('has-mitglied').') FROM '.qi('docType').' '.qi('6GSnIHxl').' WHERE '.qi('6GSnIHxl').'.'.qi('ID').' = '.qi('doc').'.'.qi('type').' LIMIT 1) AS '.qi('to-mitglied::vis').',
									/* to-protokoll */ '.qi('to-protokoll').' AS '.qi('to-protokoll').',
									/* to-protokoll::canView */ '.qi('ref:to-protokoll').'.'.qi('to-protokoll:canView').' AS '.qi('to-protokoll::canView').',
									/* to-protokoll::description */ '.qi('ref:to-protokoll').'.'.qi('to-protokoll:description').' AS '.qi('to-protokoll::description').',
									/* to-protokoll::vis */ (SELECT ('.qi('51Tp3gKR').'.'.qi('has-protokoll').') FROM '.qi('docType').' '.qi('51Tp3gKR').' WHERE '.qi('51Tp3gKR').'.'.qi('ID').' = '.qi('doc').'.'.qi('type').' LIMIT 1) AS '.qi('to-protokoll::vis').',
									/* type */ '.qi('type').' AS '.qi('type').',
									/* type::canView */ '.qi('ref:type').'.'.qi('type:canView').' AS '.qi('type::canView').',
									/* type::description */ '.qi('ref:type').'.'.qi('type:description').' AS '.qi('type::description').',
									1
								FROM '.qi('doc').' '.qi('doc').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('type:ID').', '.qi('docType').'.'.qi('name').' AS '.qi('type:description').', (('.\FOP\Database::quote(\FOP\User::getDokument()).')) AS '.qi('type:canView').' FROM '.qi('docType').') '.qi('ref:type').' ON '.qi('ref:type').'.'.qi('type:ID').' = '.qi('type').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('to-protokoll:ID').', CONCAT('.(\FOP\Database::getDriver() == 'mysql' ? 'DATE_FORMAT(FROM_UNIXTIME' : 'to_char(to_timestamp') . '('.qi('protokoll').'.'.qi('date').')'.(\FOP\Database::getDriver() == 'mysql' ? '' : '::date') . ', '.\FOP\Database::sessionVarSQL('dateformat').'), \': \', '.qi('protokoll').'.'.qi('bez').') AS '.qi('to-protokoll:description').', (('.\FOP\Database::quote(\FOP\User::getProtokoll()).')) AS '.qi('to-protokoll:canView').' FROM '.qi('protokoll').') '.qi('ref:to-protokoll').' ON '.qi('ref:to-protokoll').'.'.qi('to-protokoll:ID').' = '.qi('to-protokoll').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('to-gruppe:ID').', '.qi('gruppe').'.'.qi('name').' AS '.qi('to-gruppe:description').', ((CASE WHEN '.\FOP\Database::quote(\FOP\User::getMitglied()).' THEN TRUE ELSE NOT ((NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeItem').' '.qi('hX7wRx63').' WHERE '.qi('hX7wRx63').'.'.qi('list').' = '.qi('gruppe').'.'.qi('ID').' AND (('.qi('hX7wRx63').'.'.qi('item').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1))) AND (NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeVerantwortlich').' '.qi('yvRIjwTv').' WHERE '.qi('yvRIjwTv').'.'.qi('gruppe').' = '.qi('gruppe').'.'.qi('ID').' AND (('.qi('yvRIjwTv').'.'.qi('mitglied').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1))) AND (NOT ('.qi('gruppe').'.'.qi('public').'))) END)) AS '.qi('to-gruppe:canView').' FROM '.qi('gruppe').') '.qi('ref:to-gruppe').' ON '.qi('ref:to-gruppe').'.'.qi('to-gruppe:ID').' = '.qi('to-gruppe').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('to-mitglied:ID').', CONCAT('.qi('mitglied').'.'.qi('vorname').', \' \', '.qi('mitglied').'.'.qi('name').') AS '.qi('to-mitglied:description').', ((CASE WHEN '.\FOP\Database::quote(\FOP\User::getGruppe()).' THEN TRUE ELSE NOT (('.qi('mitglied').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) END) AND (CASE WHEN '.\FOP\Database::quote(\FOP\User::getMitglied()).' THEN TRUE ELSE NOT ((('.qi('mitglied').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) AND (NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeItem').' '.qi('7sncgH3z').' WHERE '.qi('7sncgH3z').'.'.qi('item').' = '.qi('mitglied').'.'.qi('ID').' AND (EXISTS (SELECT (TRUE) FROM '.qi('gruppeVerantwortlich').' '.qi('eHueOsQC').' WHERE '.qi('eHueOsQC').'.'.qi('gruppe').' = '.qi('7sncgH3z').'.'.qi('list').' AND (('.qi('eHueOsQC').'.'.qi('mitglied').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1)) LIMIT 1)))) END) AND (CASE WHEN '.\FOP\Database::quote(\FOP\User::getSuperadmin()).' THEN TRUE ELSE NOT ('.qi('mitglied').'.'.qi('superadmin').') END)) AS '.qi('to-mitglied:canView').' FROM '.qi('mitglied').') '.qi('ref:to-mitglied').' ON '.qi('ref:to-mitglied').'.'.qi('to-mitglied:ID').' = '.qi('to-mitglied').'
								WHERE ('.qi('to-mitglied').' = ' . \FOP\Database::quote($id) . ')
									AND (('.\FOP\Database::quote(\FOP\User::getDokument()).') AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getGruppe()).' THEN TRUE ELSE NOT (('.qi('ok3G4wPh').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) END) FROM '.qi('mitglied').' '.qi('ok3G4wPh').' WHERE '.qi('ok3G4wPh').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getMitglied()).' THEN TRUE ELSE NOT ((('.qi('2Hyq8DKe').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) AND (NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeItem').' '.qi('7sncgH3z').' WHERE '.qi('7sncgH3z').'.'.qi('item').' = '.qi('2Hyq8DKe').'.'.qi('ID').' AND (EXISTS (SELECT (TRUE) FROM '.qi('gruppeVerantwortlich').' '.qi('eHueOsQC').' WHERE '.qi('eHueOsQC').'.'.qi('gruppe').' = '.qi('7sncgH3z').'.'.qi('list').' AND (('.qi('eHueOsQC').'.'.qi('mitglied').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1)) LIMIT 1)))) END) FROM '.qi('mitglied').' '.qi('2Hyq8DKe').' WHERE '.qi('2Hyq8DKe').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT ('.\FOP\Database::quote(\FOP\User::getProtokoll()).') FROM '.qi('protokoll').' '.qi('jYtYUs5c').' WHERE '.qi('jYtYUs5c').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-protokoll').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getSuperadmin()).' THEN TRUE ELSE NOT ('.qi('bmxCMQlw').'.'.qi('superadmin').') END) FROM '.qi('mitglied').' '.qi('bmxCMQlw').' WHERE '.qi('bmxCMQlw').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getMitglied()).' THEN TRUE ELSE NOT ((NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeItem').' '.qi('hX7wRx63').' WHERE '.qi('hX7wRx63').'.'.qi('list').' = '.qi('9lhFb6lb').'.'.qi('ID').' AND (('.qi('hX7wRx63').'.'.qi('item').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1))) AND (NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeVerantwortlich').' '.qi('yvRIjwTv').' WHERE '.qi('yvRIjwTv').'.'.qi('gruppe').' = '.qi('9lhFb6lb').'.'.qi('ID').' AND (('.qi('yvRIjwTv').'.'.qi('mitglied').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1))) AND (NOT ('.qi('9lhFb6lb').'.'.qi('public').'))) END) FROM '.qi('gruppe').' '.qi('9lhFb6lb').' WHERE '.qi('9lhFb6lb').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-gruppe').' LIMIT 1), TRUE)))) AS t
								LEFT JOIN '.qi('mitglied').' AS '.qi('sorter-to-mitglied').' ON t.'.qi('to-mitglied').' = '.qi('sorter-to-mitglied').'.'.qi('ID').'
								LEFT JOIN '.qi('docType').' AS '.qi('sorter-type').' ON t.'.qi('type').' = '.qi('sorter-type').'.'.qi('ID').'
								WHERE ' . (isset($params['range_min_doc_to-mitglied_date']) ? ($params['range_min_doc_to-mitglied_date'] !== '' && is_numeric($params['range_min_doc_to-mitglied_date']) ? 't.'.qi('date').' >= ' . \FOP\Database::quote($params['range_min_doc_to-mitglied_date']) . ' AND ' : '') : '') . 
								(isset($params['range_min_doc_to-mitglied_first']) ? ($params['range_min_doc_to-mitglied_first'] !== '' && is_numeric($params['range_min_doc_to-mitglied_first']) ? 't.'.qi('first').' >= ' . \FOP\Database::quote($params['range_min_doc_to-mitglied_first']) . ' AND ' : '') : '') . 
								(isset($params['range_min_doc_to-mitglied_last']) ? ($params['range_min_doc_to-mitglied_last'] !== '' && is_numeric($params['range_min_doc_to-mitglied_last']) ? 't.'.qi('last').' >= ' . \FOP\Database::quote($params['range_min_doc_to-mitglied_last']) . ' AND ' : '') : '') . 
								(isset($params['range_max_doc_to-mitglied_date']) ? ($params['range_max_doc_to-mitglied_date'] !== '' && is_numeric($params['range_max_doc_to-mitglied_date']) ? 't.'.qi('date').' <= ' . \FOP\Database::quote($params['range_max_doc_to-mitglied_date']) . ' AND ' : '') : '') . 
								(isset($params['range_max_doc_to-mitglied_first']) ? ($params['range_max_doc_to-mitglied_first'] !== '' && is_numeric($params['range_max_doc_to-mitglied_first']) ? 't.'.qi('first').' <= ' . \FOP\Database::quote($params['range_max_doc_to-mitglied_first']) . ' AND ' : '') : '') . 
								(isset($params['range_max_doc_to-mitglied_last']) ? ($params['range_max_doc_to-mitglied_last'] !== '' && is_numeric($params['range_max_doc_to-mitglied_last']) ? 't.'.qi('last').' <= ' . \FOP\Database::quote($params['range_max_doc_to-mitglied_last']) . ' AND ' : '') : '') . 
								(isset($params['fullsearch_doc_to-mitglied_file']) && $params['fullsearch_doc_to-mitglied_file'] ? 't.'.qi('file').' IN (SELECT '.qi('ID').' FROM fop_files WHERE filename LIKE '.\FOP\Database::quote('%' . $params['fullsearch_doc_to-mitglied_file'] . '%').') AND ' : '') . 
								(isset($params['filter_doc_to-mitglied_type']) ? ($params['filter_doc_to-mitglied_type'] !== '' ? ('(' . (new \FOP\IDList($params['filter_doc_to-mitglied_type']))->toSQL('t.'.qi('type').'') . ') AND ') : '') : '') . 
								(isset($params['filter_doc_to-mitglied_date']) ? ($params['filter_doc_to-mitglied_date'] !== '' ? ('(' . (new \FOP\IDList($params['filter_doc_to-mitglied_date']))->toSQL('t.'.qi('date').'') . ') AND ') : '') : '') . 
								(isset($params['filter_doc_to-mitglied_subject']) ? ($params['filter_doc_to-mitglied_subject'] !== '' ? ('(' . (new \FOP\IDList($params['filter_doc_to-mitglied_subject']))->toSQL('t.'.qi('subject').'') . ') AND ') : '') : '') . 
								(isset($params['filter_doc_to-mitglied_notes']) ? ($params['filter_doc_to-mitglied_notes'] !== '' ? ('(' . (new \FOP\IDList($params['filter_doc_to-mitglied_notes']))->toSQL('t.'.qi('notes').'') . ') AND ') : '') : '') . 
								(isset($params['filter_doc_to-mitglied_to-mitglied']) ? ($params['filter_doc_to-mitglied_to-mitglied'] !== '' ? ('(' . (new \FOP\IDList($params['filter_doc_to-mitglied_to-mitglied']))->toSQL('t.'.qi('to-mitglied').'') . ') AND ') : '') : '') . 
								(isset($params['filter_doc_to-mitglied_to-protokoll']) ? ($params['filter_doc_to-mitglied_to-protokoll'] !== '' ? ('(' . (new \FOP\IDList($params['filter_doc_to-mitglied_to-protokoll']))->toSQL('t.'.qi('to-protokoll').'') . ') AND ') : '') : '') . 
								(isset($params['filter_doc_to-mitglied_to-gruppe']) ? ($params['filter_doc_to-mitglied_to-gruppe'] !== '' ? ('(' . (new \FOP\IDList($params['filter_doc_to-mitglied_to-gruppe']))->toSQL('t.'.qi('to-gruppe').'') . ') AND ') : '') : '') . 
								(isset($params['filter_doc_to-mitglied_first']) ? ($params['filter_doc_to-mitglied_first'] !== '' ? ('(' . (new \FOP\IDList($params['filter_doc_to-mitglied_first']))->toSQL('t.'.qi('first').'') . ') AND ') : '') : '') . 
								(isset($params['filter_doc_to-mitglied_last']) ? ($params['filter_doc_to-mitglied_last'] !== '' ? ('(' . (new \FOP\IDList($params['filter_doc_to-mitglied_last']))->toSQL('t.'.qi('last').'') . ') AND ') : '') : '') . 
								(isset($params['filter_doc_to-mitglied_file']) ? ($params['filter_doc_to-mitglied_file'] !== '' ? ('(' . (new \FOP\IDList($params['filter_doc_to-mitglied_file']))->toSQL('t.'.qi('file').'') . ') AND ') : '') : '') . 
								(isset($params['filter_doc_to-mitglied_ID']) ? ($params['filter_doc_to-mitglied_ID'] !== '' ? ('(' . (new \FOP\IDList($params['filter_doc_to-mitglied_ID']))->toSQL('t.'.qi('ID').'') . ') AND ') : '') : '') . 
								(isset($params['filter_doc_to-mitglied_archive']) ? ($params['filter_doc_to-mitglied_archive'] !== '' ? ('(' . (new \FOP\IDList($params['filter_doc_to-mitglied_archive']))->toSQL('t.'.qi('archive').'') . ') AND ') : '') : '(' . (new \FOP\IDList('0,_null'))->toSQL('t.'.qi('archive').'') . ') AND ') . 
								(isset($params['search_doc_to-mitglied_subject']) ? 't.'.qi('subject').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_doc_to-mitglied_subject'] . '%') . ' AND ' : '') . 
								(isset($params['search_doc_to-mitglied_notes']) ? 't.'.qi('notes').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_doc_to-mitglied_notes'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_doc_to-mitglied_subject']) ? 'NOT t.'.qi('subject').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_doc_to-mitglied_subject'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_doc_to-mitglied_notes']) ? 'NOT t.'.qi('notes').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_doc_to-mitglied_notes'] . '%') . ' AND ' : '') . 
								(isset($params['search_doc_to-mitglied']) ? '(' . 't.'.qi('subject').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_doc_to-mitglied'] . '%') . ' OR ' . 't.'.qi('notes').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_doc_to-mitglied'] . '%') . ') AND ' : '') . 
								'
								 TRUE ';
								return $sql;
	
    
  }

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

    
  }

  public static function downloadAction($ids, $id) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
		$ids = new \FOP\IDList($ids);
		$data = self::getData('', $_GET, $id);
		header('Content-Type: application/zip');
		header('Content-Disposition: attachment; filename="Download.zip"');
		$zip = new \ZipArchive;
		$zipfilename = tempnam(sys_get_temp_dir(), 'fop-zip');
		$zip->open($zipfilename, \ZipArchive::CREATE);
		set_time_limit(60 + 3 * count($data['items'])); // 3s pro Datei Extra Zeitlimit
		foreach($data['items'] AS $item) {
			if (!$ids->has($item['ID'])) continue;
			$fid = $item['file'];
			\FOP\Files::attachFileToZip($fid, $zip, '', true);
		}
		$zip->close();
		readfile($zipfilename); // Ausgabe ZIP
		unlink($zipfilename);
		die();
    
  }

  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 (('.\FOP\Database::quote(\FOP\User::getDokument()).') AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getGruppe()).' THEN TRUE ELSE NOT (('.qi('ok3G4wPh').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) END) FROM '.qi('mitglied').' '.qi('ok3G4wPh').' WHERE '.qi('ok3G4wPh').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getMitglied()).' THEN TRUE ELSE NOT ((('.qi('2Hyq8DKe').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) AND (NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeItem').' '.qi('7sncgH3z').' WHERE '.qi('7sncgH3z').'.'.qi('item').' = '.qi('2Hyq8DKe').'.'.qi('ID').' AND (EXISTS (SELECT (TRUE) FROM '.qi('gruppeVerantwortlich').' '.qi('eHueOsQC').' WHERE '.qi('eHueOsQC').'.'.qi('gruppe').' = '.qi('7sncgH3z').'.'.qi('list').' AND (('.qi('eHueOsQC').'.'.qi('mitglied').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1)) LIMIT 1)))) END) FROM '.qi('mitglied').' '.qi('2Hyq8DKe').' WHERE '.qi('2Hyq8DKe').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT ('.\FOP\Database::quote(\FOP\User::getProtokoll()).') FROM '.qi('protokoll').' '.qi('jYtYUs5c').' WHERE '.qi('jYtYUs5c').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-protokoll').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getSuperadmin()).' THEN TRUE ELSE NOT ('.qi('bmxCMQlw').'.'.qi('superadmin').') END) FROM '.qi('mitglied').' '.qi('bmxCMQlw').' WHERE '.qi('bmxCMQlw').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getMitglied()).' THEN TRUE ELSE NOT ((NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeItem').' '.qi('hX7wRx63').' WHERE '.qi('hX7wRx63').'.'.qi('list').' = '.qi('9lhFb6lb').'.'.qi('ID').' AND (('.qi('hX7wRx63').'.'.qi('item').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1))) AND (NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeVerantwortlich').' '.qi('yvRIjwTv').' WHERE '.qi('yvRIjwTv').'.'.qi('gruppe').' = '.qi('9lhFb6lb').'.'.qi('ID').' AND (('.qi('yvRIjwTv').'.'.qi('mitglied').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1))) AND (NOT ('.qi('9lhFb6lb').'.'.qi('public').'))) END) FROM '.qi('gruppe').' '.qi('9lhFb6lb').' WHERE '.qi('9lhFb6lb').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-gruppe').' LIMIT 1), TRUE))) AND (('.\FOP\Database::quote(\FOP\User::getDokument()).') AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getGruppe()).' THEN TRUE ELSE NOT (('.qi('a3H18ePF').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) END) FROM '.qi('mitglied').' '.qi('a3H18ePF').' WHERE '.qi('a3H18ePF').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getMitglied()).' THEN TRUE ELSE NOT ((('.qi('fXl0iMc3').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) AND (NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeItem').' '.qi('7sncgH3z').' WHERE '.qi('7sncgH3z').'.'.qi('item').' = '.qi('fXl0iMc3').'.'.qi('ID').' AND (EXISTS (SELECT (TRUE) FROM '.qi('gruppeVerantwortlich').' '.qi('eHueOsQC').' WHERE '.qi('eHueOsQC').'.'.qi('gruppe').' = '.qi('7sncgH3z').'.'.qi('list').' AND (('.qi('eHueOsQC').'.'.qi('mitglied').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1)) LIMIT 1)))) END) FROM '.qi('mitglied').' '.qi('fXl0iMc3').' WHERE '.qi('fXl0iMc3').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT ('.\FOP\Database::quote(\FOP\User::getProtokoll()).') FROM '.qi('protokoll').' '.qi('iVCI3rck').' WHERE '.qi('iVCI3rck').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-protokoll').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getSuperadmin()).' THEN TRUE ELSE NOT ('.qi('Ot4cBnlj').'.'.qi('superadmin').') END) FROM '.qi('mitglied').' '.qi('Ot4cBnlj').' WHERE '.qi('Ot4cBnlj').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getMitglied()).' THEN TRUE ELSE NOT ((NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeItem').' '.qi('hX7wRx63').' WHERE '.qi('hX7wRx63').'.'.qi('list').' = '.qi('K2POIfyF').'.'.qi('ID').' AND (('.qi('hX7wRx63').'.'.qi('item').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1))) AND (NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeVerantwortlich').' '.qi('yvRIjwTv').' WHERE '.qi('yvRIjwTv').'.'.qi('gruppe').' = '.qi('K2POIfyF').'.'.qi('ID').' AND (('.qi('yvRIjwTv').'.'.qi('mitglied').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1))) AND (NOT ('.qi('K2POIfyF').'.'.qi('public').'))) END) FROM '.qi('gruppe').' '.qi('K2POIfyF').' WHERE '.qi('K2POIfyF').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-gruppe').' LIMIT 1), TRUE))) AND ((('.qi('doc').'.'.qi('archive').') = (0))) WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('archive').', SUM(CASE (TRUE) WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('download').', 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) AND ('.\FOP\Database::quote(\FOP\User::getDokument()).') AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getGruppe()).' THEN TRUE ELSE NOT (('.qi('jiHGDwTc').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) END) FROM '.qi('mitglied').' '.qi('jiHGDwTc').' WHERE '.qi('jiHGDwTc').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getMitglied()).' THEN TRUE ELSE NOT ((('.qi('2L3JcPgq').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) AND (NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeItem').' '.qi('7sncgH3z').' WHERE '.qi('7sncgH3z').'.'.qi('item').' = '.qi('2L3JcPgq').'.'.qi('ID').' AND (EXISTS (SELECT (TRUE) FROM '.qi('gruppeVerantwortlich').' '.qi('eHueOsQC').' WHERE '.qi('eHueOsQC').'.'.qi('gruppe').' = '.qi('7sncgH3z').'.'.qi('list').' AND (('.qi('eHueOsQC').'.'.qi('mitglied').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1)) LIMIT 1)))) END) FROM '.qi('mitglied').' '.qi('2L3JcPgq').' WHERE '.qi('2L3JcPgq').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT ('.\FOP\Database::quote(\FOP\User::getProtokoll()).') FROM '.qi('protokoll').' '.qi('aVKzkIxT').' WHERE '.qi('aVKzkIxT').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-protokoll').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getSuperadmin()).' THEN TRUE ELSE NOT ('.qi('oYgz3Zk9').'.'.qi('superadmin').') END) FROM '.qi('mitglied').' '.qi('oYgz3Zk9').' WHERE '.qi('oYgz3Zk9').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-mitglied').' LIMIT 1), TRUE)) AND (COALESCE((SELECT (CASE WHEN '.\FOP\Database::quote(\FOP\User::getMitglied()).' THEN TRUE ELSE NOT ((NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeItem').' '.qi('hX7wRx63').' WHERE '.qi('hX7wRx63').'.'.qi('list').' = '.qi('Je6BzKDx').'.'.qi('ID').' AND (('.qi('hX7wRx63').'.'.qi('item').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1))) AND (NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeVerantwortlich').' '.qi('yvRIjwTv').' WHERE '.qi('yvRIjwTv').'.'.qi('gruppe').' = '.qi('Je6BzKDx').'.'.qi('ID').' AND (('.qi('yvRIjwTv').'.'.qi('mitglied').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1))) AND (NOT ('.qi('Je6BzKDx').'.'.qi('public').'))) END) FROM '.qi('gruppe').' '.qi('Je6BzKDx').' WHERE '.qi('Je6BzKDx').'.'.qi('ID').' = '.qi('doc').'.'.qi('to-gruppe').' LIMIT 1), TRUE))) WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('delete').' FROM '.qi('doc').' WHERE ' . $ids->toSQL(qi('ID')))->fetch(\PDO::FETCH_ASSOC);
		
		return $perms;
	
    
  }

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

    
  }

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

    
  }

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

    
  }

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

    
  }

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

								$order = (\FOP\Util::array_value(array(
									'to-mitglied ASC' => 'ORDER BY '.qi('sorter-to-mitglied').'.'.qi('name').' , '.qi('sorter-to-mitglied').'.'.qi('name').' , '.qi('sorter-to-mitglied').'.'.qi('name').' , '.qi('sorter-to-mitglied').'.'.qi('name').' , '.qi('sorter-to-mitglied').'.'.qi('vorname').' , '.qi('sorter-to-mitglied').'.'.qi('vorname').' , '.qi('sorter-to-mitglied').'.'.qi('vorname').' , '.qi('sorter-to-mitglied').'.'.qi('vorname').' ',
									'type ASC' => 'ORDER BY '.qi('sorter-type').'.'.qi('sortableOrder').' , '.qi('sorter-type').'.'.qi('sortableOrder').' , '.qi('sorter-type').'.'.qi('sortableOrder').' , '.qi('sorter-type').'.'.qi('sortableOrder').' ',
									'to-mitglied DESC' => 'ORDER BY '.qi('sorter-to-mitglied').'.'.qi('name').' DESC, '.qi('sorter-to-mitglied').'.'.qi('name').' DESC, '.qi('sorter-to-mitglied').'.'.qi('name').' DESC, '.qi('sorter-to-mitglied').'.'.qi('name').' DESC, '.qi('sorter-to-mitglied').'.'.qi('vorname').' DESC, '.qi('sorter-to-mitglied').'.'.qi('vorname').' DESC, '.qi('sorter-to-mitglied').'.'.qi('vorname').' DESC, '.qi('sorter-to-mitglied').'.'.qi('vorname').' DESC',
									'type DESC' => 'ORDER BY '.qi('sorter-type').'.'.qi('sortableOrder').' DESC, '.qi('sorter-type').'.'.qi('sortableOrder').' DESC, '.qi('sorter-type').'.'.qi('sortableOrder').' DESC, '.qi('sorter-type').'.'.qi('sortableOrder').' DESC',
									'notes ASC' => 'ORDER BY t.'.qi('notes').' ASC',
									'subject ASC' => 'ORDER BY t.'.qi('subject').' ASC',
									'date ASC' => 'ORDER BY t.'.qi('date').' ASC',
									'first ASC' => 'ORDER BY t.'.qi('first').' ASC',
									'last ASC' => 'ORDER BY t.'.qi('last').' ASC',
									'notes DESC' => 'ORDER BY t.'.qi('notes').' DESC',
									'subject DESC' => 'ORDER BY t.'.qi('subject').' DESC',
									'date DESC' => 'ORDER BY t.'.qi('date').' DESC',
									'first DESC' => 'ORDER BY t.'.qi('first').' DESC',
									'last DESC' => 'ORDER BY t.'.qi('last').' DESC',
									'' => ''), isset($params['sort_doc_to-mitglied']) ? $params['sort_doc_to-mitglied'] : '') ?: 'ORDER BY '.qi('t').'.'.qi('date').' DESC');
								// 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['type'] = \FOP\Sanitizers::null_converter($item['type']);
											$item['date'] = intval($item['date']);
											$item['to-mitglied'] = \FOP\Sanitizers::null_converter($item['to-mitglied']);
											$item['to-protokoll'] = \FOP\Sanitizers::null_converter($item['to-protokoll']);
											$item['to-gruppe'] = \FOP\Sanitizers::null_converter($item['to-gruppe']);
											$item['first'] = intval($item['first']);
											$item['last'] = intval($item['last']);
											$item['file'] = intval($item['file']);
											$item['archive'] = \FOP\Util::BoolSanitizer($item['archive']);
											
											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['type'] = \FOP\Sanitizers::null_converter($item['type']);
										$item['date'] = intval($item['date']);
										$item['to-mitglied'] = \FOP\Sanitizers::null_converter($item['to-mitglied']);
										$item['to-protokoll'] = \FOP\Sanitizers::null_converter($item['to-protokoll']);
										$item['to-gruppe'] = \FOP\Sanitizers::null_converter($item['to-gruppe']);
										$item['first'] = intval($item['first']);
										$item['last'] = intval($item['last']);
										$item['file'] = intval($item['file']);
										$item['archive'] = \FOP\Util::BoolSanitizer($item['archive']);
										
									}
									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_doc_to-mitglied_date'])
		&& isset($params['range_max_doc_to-mitglied_date'])
		&& (date('d', $params['range_min_doc_to-mitglied_date']) == '01') //check first day of month
		&& (date('d', $params['range_max_doc_to-mitglied_date']) == date('t', $params['range_max_doc_to-mitglied_date'])) //check last day of month
		&& (date('Y-m', $params['range_min_doc_to-mitglied_date']) == date('Y-m', $params['range_max_doc_to-mitglied_date'])) //check if same year and month
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_date&apos;] = &apos;'.strtotime('first day of last month', $params['range_min_doc_to-mitglied_date']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_date&apos;] = &apos;'.strtotime('last day of last month', $params['range_min_doc_to-mitglied_date']).'&apos;;
				reloaddoc_to_mitglied(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_date&apos;] = &apos;'.strtotime('first day of next month', $params['range_min_doc_to-mitglied_date']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_date&apos;] = &apos;'.strtotime('last day of next month', $params['range_min_doc_to-mitglied_date']).'&apos;;
				reloaddoc_to_mitglied(); ">add_circle_outline</i>' : ''),
			htmlentities(_('Erfassungsdatum') . ': ' . strftime('%B', $params['range_min_doc_to-mitglied_date']) . ' ' . date('Y', $params['range_min_doc_to-mitglied_date']))
		]);
	} else if ( // Corner Case: Tag
		isset($params['range_min_doc_to-mitglied_date'])
		&& isset($params['range_max_doc_to-mitglied_date'])
		&& (date('Y-m-d', $params['range_min_doc_to-mitglied_date']) == (date('Y-m-d', $params['range_max_doc_to-mitglied_date'])))
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_date&apos;] = &apos;'.strtotime('last day', $params['range_min_doc_to-mitglied_date']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_date&apos;] = &apos;'.strtotime('last day', $params['range_min_doc_to-mitglied_date']).'&apos;;
				reloaddoc_to_mitglied(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_date&apos;] = &apos;'.strtotime('next day', $params['range_min_doc_to-mitglied_date']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_date&apos;] = &apos;'.strtotime('next day', $params['range_min_doc_to-mitglied_date']).'&apos;;
				reloaddoc_to_mitglied(); ">add_circle_outline</i>' : ''),
			htmlentities(_('Erfassungsdatum') . ': ' . date('d.m.Y', $params['range_min_doc_to-mitglied_date']))
		]);
	} else if ( // Corner Case: Jahr
		isset($params['range_min_doc_to-mitglied_date'])
		&& isset($params['range_max_doc_to-mitglied_date'])
		&& (date('Y', $params['range_min_doc_to-mitglied_date']) == (date('Y', $params['range_max_doc_to-mitglied_date'])))
		&& ((date('m-d', $params['range_min_doc_to-mitglied_date']) == '01-01'))
		&& ((date('m-d', $params['range_max_doc_to-mitglied_date']) == '12-31'))
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_date&apos;] = &apos;'.strtotime('first day of January last year', $params['range_min_doc_to-mitglied_date']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_date&apos;] = &apos;'.strtotime('last day of December last year', $params['range_min_doc_to-mitglied_date']).'&apos;;
				reloaddoc_to_mitglied(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_date&apos;] = &apos;'.strtotime('first day of January next year', $params['range_min_doc_to-mitglied_date']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_date&apos;] = &apos;'.strtotime('last day of December next year', $params['range_min_doc_to-mitglied_date']).'&apos;;
				reloaddoc_to_mitglied(); ">add_circle_outline</i>' : ''),
			htmlentities(_('Erfassungsdatum') . ': ' . date('Y', $params['range_min_doc_to-mitglied_date']))
		]);
	} else if ( // Corner Case: Quartal
		isset($params['range_min_doc_to-mitglied_date'])
		&& isset($params['range_max_doc_to-mitglied_date'])
		&& ( (
		 ((date('m-d', $params['range_min_doc_to-mitglied_date']) == '01-01'))
		&& ((date('m-d', $params['range_max_doc_to-mitglied_date']) == '03-31')) )
		|| (
		 ((date('m-d', $params['range_min_doc_to-mitglied_date']) == '04-01'))
		&& ((date('m-d', $params['range_max_doc_to-mitglied_date']) == '06-30')) )
		|| (
		 ((date('m-d', $params['range_min_doc_to-mitglied_date']) == '07-01'))
		&& ((date('m-d', $params['range_max_doc_to-mitglied_date']) == '09-30')) )
		|| (
		 ((date('m-d', $params['range_min_doc_to-mitglied_date']) == '10-01'))
		&& ((date('m-d', $params['range_max_doc_to-mitglied_date']) == '12-31')) )
	) ) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
					query[&apos;range_min_doc_to-mitglied_date&apos;] = &apos;'.strtotime('first day of -3 months', $params['range_min_doc_to-mitglied_date']).'&apos;;
					query[&apos;range_max_doc_to-mitglied_date&apos;] = &apos;'.strtotime('last day of -3 months', $params['range_max_doc_to-mitglied_date']).'&apos;;
					reloaddoc_to_mitglied(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_date&apos;] = &apos;'.strtotime('first day of +3 months', $params['range_min_doc_to-mitglied_date']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_date&apos;] = &apos;'.strtotime('last day of +3 months', $params['range_max_doc_to-mitglied_date']).'&apos;;
				reloaddoc_to_mitglied(); ">add_circle_outline</i>' : ''),	
			htmlentities(_('Erfassungsdatum') . ': Q' . (ceil((date('m', $params['range_min_doc_to-mitglied_date']))/3)) . ' (' . date('d.m.', $params['range_min_doc_to-mitglied_date']) . ' - ' . date('d.m.Y', $params['range_max_doc_to-mitglied_date']) . ')')
		]);
	}
	else if (isset($params['range_min_doc_to-mitglied_date']) && isset($params['range_max_doc_to-mitglied_date'])) {
		array_push($filters, _('Erfassungsdatum') . ': ' . (($params['range_min_doc_to-mitglied_date']) ? strftime(_('dateformat_php2'), intval($params['range_min_doc_to-mitglied_date'])) : '') . ' ' . _('filters_between') . ' ' . (($params['range_max_doc_to-mitglied_date']) ? strftime(_('dateformat_php2'), intval($params['range_max_doc_to-mitglied_date'])) : ''));
	} else if (isset($params['range_min_doc_to-mitglied_date'])) {
		array_push($filters, _('Erfassungsdatum') . ': ' . _('filters_from') . ' ' . (($params['range_min_doc_to-mitglied_date']) ? strftime(_('dateformat_php2'), intval($params['range_min_doc_to-mitglied_date'])) : ''));
	} else if (isset($params['range_max_doc_to-mitglied_date'])) {
		array_push($filters, _('Erfassungsdatum') . ': ' . _('filters_to') . ' ' . (($params['range_max_doc_to-mitglied_date']) ? strftime(_('dateformat_php2'), intval($params['range_max_doc_to-mitglied_date'])) : ''));
	}
	
	if ( // Corner Case: Monat
		isset($params['range_min_doc_to-mitglied_first'])
		&& isset($params['range_max_doc_to-mitglied_first'])
		&& (date('d', $params['range_min_doc_to-mitglied_first']) == '01') //check first day of month
		&& (date('d', $params['range_max_doc_to-mitglied_first']) == date('t', $params['range_max_doc_to-mitglied_first'])) //check last day of month
		&& (date('Y-m', $params['range_min_doc_to-mitglied_first']) == date('Y-m', $params['range_max_doc_to-mitglied_first'])) //check if same year and month
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_first&apos;] = &apos;'.strtotime('first day of last month', $params['range_min_doc_to-mitglied_first']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_first&apos;] = &apos;'.strtotime('last day of last month', $params['range_min_doc_to-mitglied_first']).'&apos;;
				reloaddoc_to_mitglied(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_first&apos;] = &apos;'.strtotime('first day of next month', $params['range_min_doc_to-mitglied_first']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_first&apos;] = &apos;'.strtotime('last day of next month', $params['range_min_doc_to-mitglied_first']).'&apos;;
				reloaddoc_to_mitglied(); ">add_circle_outline</i>' : ''),
			htmlentities(_('firstrevision') . ': ' . strftime('%B', $params['range_min_doc_to-mitglied_first']) . ' ' . date('Y', $params['range_min_doc_to-mitglied_first']))
		]);
	} else if ( // Corner Case: Tag
		isset($params['range_min_doc_to-mitglied_first'])
		&& isset($params['range_max_doc_to-mitglied_first'])
		&& (date('Y-m-d', $params['range_min_doc_to-mitglied_first']) == (date('Y-m-d', $params['range_max_doc_to-mitglied_first'])))
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_first&apos;] = &apos;'.strtotime('last day', $params['range_min_doc_to-mitglied_first']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_first&apos;] = &apos;'.strtotime('last day', $params['range_min_doc_to-mitglied_first']).'&apos;;
				reloaddoc_to_mitglied(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_first&apos;] = &apos;'.strtotime('next day', $params['range_min_doc_to-mitglied_first']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_first&apos;] = &apos;'.strtotime('next day', $params['range_min_doc_to-mitglied_first']).'&apos;;
				reloaddoc_to_mitglied(); ">add_circle_outline</i>' : ''),
			htmlentities(_('firstrevision') . ': ' . date('d.m.Y', $params['range_min_doc_to-mitglied_first']))
		]);
	} else if ( // Corner Case: Jahr
		isset($params['range_min_doc_to-mitglied_first'])
		&& isset($params['range_max_doc_to-mitglied_first'])
		&& (date('Y', $params['range_min_doc_to-mitglied_first']) == (date('Y', $params['range_max_doc_to-mitglied_first'])))
		&& ((date('m-d', $params['range_min_doc_to-mitglied_first']) == '01-01'))
		&& ((date('m-d', $params['range_max_doc_to-mitglied_first']) == '12-31'))
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_first&apos;] = &apos;'.strtotime('first day of January last year', $params['range_min_doc_to-mitglied_first']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_first&apos;] = &apos;'.strtotime('last day of December last year', $params['range_min_doc_to-mitglied_first']).'&apos;;
				reloaddoc_to_mitglied(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_first&apos;] = &apos;'.strtotime('first day of January next year', $params['range_min_doc_to-mitglied_first']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_first&apos;] = &apos;'.strtotime('last day of December next year', $params['range_min_doc_to-mitglied_first']).'&apos;;
				reloaddoc_to_mitglied(); ">add_circle_outline</i>' : ''),
			htmlentities(_('firstrevision') . ': ' . date('Y', $params['range_min_doc_to-mitglied_first']))
		]);
	} else if ( // Corner Case: Quartal
		isset($params['range_min_doc_to-mitglied_first'])
		&& isset($params['range_max_doc_to-mitglied_first'])
		&& ( (
		 ((date('m-d', $params['range_min_doc_to-mitglied_first']) == '01-01'))
		&& ((date('m-d', $params['range_max_doc_to-mitglied_first']) == '03-31')) )
		|| (
		 ((date('m-d', $params['range_min_doc_to-mitglied_first']) == '04-01'))
		&& ((date('m-d', $params['range_max_doc_to-mitglied_first']) == '06-30')) )
		|| (
		 ((date('m-d', $params['range_min_doc_to-mitglied_first']) == '07-01'))
		&& ((date('m-d', $params['range_max_doc_to-mitglied_first']) == '09-30')) )
		|| (
		 ((date('m-d', $params['range_min_doc_to-mitglied_first']) == '10-01'))
		&& ((date('m-d', $params['range_max_doc_to-mitglied_first']) == '12-31')) )
	) ) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
					query[&apos;range_min_doc_to-mitglied_first&apos;] = &apos;'.strtotime('first day of -3 months', $params['range_min_doc_to-mitglied_first']).'&apos;;
					query[&apos;range_max_doc_to-mitglied_first&apos;] = &apos;'.strtotime('last day of -3 months', $params['range_max_doc_to-mitglied_first']).'&apos;;
					reloaddoc_to_mitglied(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_first&apos;] = &apos;'.strtotime('first day of +3 months', $params['range_min_doc_to-mitglied_first']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_first&apos;] = &apos;'.strtotime('last day of +3 months', $params['range_max_doc_to-mitglied_first']).'&apos;;
				reloaddoc_to_mitglied(); ">add_circle_outline</i>' : ''),	
			htmlentities(_('firstrevision') . ': Q' . (ceil((date('m', $params['range_min_doc_to-mitglied_first']))/3)) . ' (' . date('d.m.', $params['range_min_doc_to-mitglied_first']) . ' - ' . date('d.m.Y', $params['range_max_doc_to-mitglied_first']) . ')')
		]);
	}
	else if (isset($params['range_min_doc_to-mitglied_first']) && isset($params['range_max_doc_to-mitglied_first'])) {
		array_push($filters, _('firstrevision') . ': ' . (($params['range_min_doc_to-mitglied_first']) ? strftime(_('dateformat_php2'), intval($params['range_min_doc_to-mitglied_first'])) : '') . ' ' . _('filters_between') . ' ' . (($params['range_max_doc_to-mitglied_first']) ? strftime(_('dateformat_php2'), intval($params['range_max_doc_to-mitglied_first'])) : ''));
	} else if (isset($params['range_min_doc_to-mitglied_first'])) {
		array_push($filters, _('firstrevision') . ': ' . _('filters_from') . ' ' . (($params['range_min_doc_to-mitglied_first']) ? strftime(_('dateformat_php2'), intval($params['range_min_doc_to-mitglied_first'])) : ''));
	} else if (isset($params['range_max_doc_to-mitglied_first'])) {
		array_push($filters, _('firstrevision') . ': ' . _('filters_to') . ' ' . (($params['range_max_doc_to-mitglied_first']) ? strftime(_('dateformat_php2'), intval($params['range_max_doc_to-mitglied_first'])) : ''));
	}
	
	if ( // Corner Case: Monat
		isset($params['range_min_doc_to-mitglied_last'])
		&& isset($params['range_max_doc_to-mitglied_last'])
		&& (date('d', $params['range_min_doc_to-mitglied_last']) == '01') //check first day of month
		&& (date('d', $params['range_max_doc_to-mitglied_last']) == date('t', $params['range_max_doc_to-mitglied_last'])) //check last day of month
		&& (date('Y-m', $params['range_min_doc_to-mitglied_last']) == date('Y-m', $params['range_max_doc_to-mitglied_last'])) //check if same year and month
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_last&apos;] = &apos;'.strtotime('first day of last month', $params['range_min_doc_to-mitglied_last']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_last&apos;] = &apos;'.strtotime('last day of last month', $params['range_min_doc_to-mitglied_last']).'&apos;;
				reloaddoc_to_mitglied(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_last&apos;] = &apos;'.strtotime('first day of next month', $params['range_min_doc_to-mitglied_last']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_last&apos;] = &apos;'.strtotime('last day of next month', $params['range_min_doc_to-mitglied_last']).'&apos;;
				reloaddoc_to_mitglied(); ">add_circle_outline</i>' : ''),
			htmlentities(_('currentrevision') . ': ' . strftime('%B', $params['range_min_doc_to-mitglied_last']) . ' ' . date('Y', $params['range_min_doc_to-mitglied_last']))
		]);
	} else if ( // Corner Case: Tag
		isset($params['range_min_doc_to-mitglied_last'])
		&& isset($params['range_max_doc_to-mitglied_last'])
		&& (date('Y-m-d', $params['range_min_doc_to-mitglied_last']) == (date('Y-m-d', $params['range_max_doc_to-mitglied_last'])))
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_last&apos;] = &apos;'.strtotime('last day', $params['range_min_doc_to-mitglied_last']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_last&apos;] = &apos;'.strtotime('last day', $params['range_min_doc_to-mitglied_last']).'&apos;;
				reloaddoc_to_mitglied(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_last&apos;] = &apos;'.strtotime('next day', $params['range_min_doc_to-mitglied_last']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_last&apos;] = &apos;'.strtotime('next day', $params['range_min_doc_to-mitglied_last']).'&apos;;
				reloaddoc_to_mitglied(); ">add_circle_outline</i>' : ''),
			htmlentities(_('currentrevision') . ': ' . date('d.m.Y', $params['range_min_doc_to-mitglied_last']))
		]);
	} else if ( // Corner Case: Jahr
		isset($params['range_min_doc_to-mitglied_last'])
		&& isset($params['range_max_doc_to-mitglied_last'])
		&& (date('Y', $params['range_min_doc_to-mitglied_last']) == (date('Y', $params['range_max_doc_to-mitglied_last'])))
		&& ((date('m-d', $params['range_min_doc_to-mitglied_last']) == '01-01'))
		&& ((date('m-d', $params['range_max_doc_to-mitglied_last']) == '12-31'))
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_last&apos;] = &apos;'.strtotime('first day of January last year', $params['range_min_doc_to-mitglied_last']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_last&apos;] = &apos;'.strtotime('last day of December last year', $params['range_min_doc_to-mitglied_last']).'&apos;;
				reloaddoc_to_mitglied(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_last&apos;] = &apos;'.strtotime('first day of January next year', $params['range_min_doc_to-mitglied_last']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_last&apos;] = &apos;'.strtotime('last day of December next year', $params['range_min_doc_to-mitglied_last']).'&apos;;
				reloaddoc_to_mitglied(); ">add_circle_outline</i>' : ''),
			htmlentities(_('currentrevision') . ': ' . date('Y', $params['range_min_doc_to-mitglied_last']))
		]);
	} else if ( // Corner Case: Quartal
		isset($params['range_min_doc_to-mitglied_last'])
		&& isset($params['range_max_doc_to-mitglied_last'])
		&& ( (
		 ((date('m-d', $params['range_min_doc_to-mitglied_last']) == '01-01'))
		&& ((date('m-d', $params['range_max_doc_to-mitglied_last']) == '03-31')) )
		|| (
		 ((date('m-d', $params['range_min_doc_to-mitglied_last']) == '04-01'))
		&& ((date('m-d', $params['range_max_doc_to-mitglied_last']) == '06-30')) )
		|| (
		 ((date('m-d', $params['range_min_doc_to-mitglied_last']) == '07-01'))
		&& ((date('m-d', $params['range_max_doc_to-mitglied_last']) == '09-30')) )
		|| (
		 ((date('m-d', $params['range_min_doc_to-mitglied_last']) == '10-01'))
		&& ((date('m-d', $params['range_max_doc_to-mitglied_last']) == '12-31')) )
	) ) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
					query[&apos;range_min_doc_to-mitglied_last&apos;] = &apos;'.strtotime('first day of -3 months', $params['range_min_doc_to-mitglied_last']).'&apos;;
					query[&apos;range_max_doc_to-mitglied_last&apos;] = &apos;'.strtotime('last day of -3 months', $params['range_max_doc_to-mitglied_last']).'&apos;;
					reloaddoc_to_mitglied(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_doc_to-mitglied_last&apos;] = &apos;'.strtotime('first day of +3 months', $params['range_min_doc_to-mitglied_last']).'&apos;;
				query[&apos;range_max_doc_to-mitglied_last&apos;] = &apos;'.strtotime('last day of +3 months', $params['range_max_doc_to-mitglied_last']).'&apos;;
				reloaddoc_to_mitglied(); ">add_circle_outline</i>' : ''),	
			htmlentities(_('currentrevision') . ': Q' . (ceil((date('m', $params['range_min_doc_to-mitglied_last']))/3)) . ' (' . date('d.m.', $params['range_min_doc_to-mitglied_last']) . ' - ' . date('d.m.Y', $params['range_max_doc_to-mitglied_last']) . ')')
		]);
	}
	else if (isset($params['range_min_doc_to-mitglied_last']) && isset($params['range_max_doc_to-mitglied_last'])) {
		array_push($filters, _('currentrevision') . ': ' . (($params['range_min_doc_to-mitglied_last']) ? strftime(_('dateformat_php2'), intval($params['range_min_doc_to-mitglied_last'])) : '') . ' ' . _('filters_between') . ' ' . (($params['range_max_doc_to-mitglied_last']) ? strftime(_('dateformat_php2'), intval($params['range_max_doc_to-mitglied_last'])) : ''));
	} else if (isset($params['range_min_doc_to-mitglied_last'])) {
		array_push($filters, _('currentrevision') . ': ' . _('filters_from') . ' ' . (($params['range_min_doc_to-mitglied_last']) ? strftime(_('dateformat_php2'), intval($params['range_min_doc_to-mitglied_last'])) : ''));
	} else if (isset($params['range_max_doc_to-mitglied_last'])) {
		array_push($filters, _('currentrevision') . ': ' . _('filters_to') . ' ' . (($params['range_max_doc_to-mitglied_last']) ? strftime(_('dateformat_php2'), intval($params['range_max_doc_to-mitglied_last'])) : ''));
	}if (isset($params['fullsearch_doc_to-mitglied_file'])) {
		array_push($filters, _('file') . ' ' . _('filter_contains') . ' ' . $params['fullsearch_doc_to-mitglied_file']);
	}if (isset($params['filter_doc_to-mitglied_date'])) {
		if ($params['filter_doc_to-mitglied_date'] == '_null') {
			array_push($filters, _('Erfassungsdatum') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_doc_to-mitglied_date']))->all() AS $val) {
				$value = ($val) ? strftime(_('dateformat_php2'), intval($val)) : '';
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Erfassungsdatum') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_doc_to-mitglied_subject'])) {
		if ($params['filter_doc_to-mitglied_subject'] == '_null') {
			array_push($filters, _('Betreff') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_doc_to-mitglied_subject']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Betreff') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_doc_to-mitglied_notes'])) {
		if ($params['filter_doc_to-mitglied_notes'] == '_null') {
			array_push($filters, _('Notizen') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_doc_to-mitglied_notes']))->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, _('Notizen') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_doc_to-mitglied_first'])) {
		if ($params['filter_doc_to-mitglied_first'] == '_null') {
			array_push($filters, _('firstrevision') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_doc_to-mitglied_first']))->all() AS $val) {
				$value = ($val) ? strftime(_('dateformat_php2'), intval($val)) : '';
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('firstrevision') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_doc_to-mitglied_last'])) {
		if ($params['filter_doc_to-mitglied_last'] == '_null') {
			array_push($filters, _('currentrevision') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_doc_to-mitglied_last']))->all() AS $val) {
				$value = ($val) ? strftime(_('dateformat_php2'), intval($val)) : '';
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('currentrevision') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_doc_to-mitglied_file'])) {
		if ($params['filter_doc_to-mitglied_file'] == '_null') {
			array_push($filters, _('download') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_doc_to-mitglied_file']))->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, _('download') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_doc_to-mitglied_archive'])) {
		if ($params['filter_doc_to-mitglied_archive'] == '_null') {
			array_push($filters, _('Archiv') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_doc_to-mitglied_archive']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Archiv') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_doc_to-mitglied_type'])) {
		if ($params['filter_doc_to-mitglied_type'] == '_null') {
			array_push($filters, _('Kategorie') . ': ' . _('-'));
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_doc_to-mitglied_type']))->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, _('Kategorie') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_doc_to-mitglied_to-gruppe'])) {
		if ($params['filter_doc_to-mitglied_to-gruppe'] == '_null') {
			array_push($filters, _('linked to %s|Gruppe') . ': ' . _('-'));
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_doc_to-mitglied_to-gruppe']))->all() AS $val) {
				$value = 
  \FOP\Database::query('SELECT '.qi('gruppe').'.'.qi('name').' AS description FROM '.qi('gruppe').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($val))->fetchColumn() ?: _('-')
;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('linked to %s|Gruppe') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_doc_to-mitglied_to-mitglied'])) {
		if ($params['filter_doc_to-mitglied_to-mitglied'] == '_null') {
			array_push($filters, _('linked to %s|Mitglied') . ': ' . _('-'));
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_doc_to-mitglied_to-mitglied']))->all() AS $val) {
				$value = 
  \FOP\Database::query('SELECT CONCAT('.qi('mitglied').'.'.qi('vorname').', \' \', '.qi('mitglied').'.'.qi('name').') AS description FROM '.qi('mitglied').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($val))->fetchColumn() ?: _('-')
;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('linked to %s|Mitglied') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_doc_to-mitglied_to-protokoll'])) {
		if ($params['filter_doc_to-mitglied_to-protokoll'] == '_null') {
			array_push($filters, _('linked to %s|Protokoll') . ': ' . _('-'));
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_doc_to-mitglied_to-protokoll']))->all() AS $val) {
				$value = 
  \FOP\Database::query('SELECT CONCAT('.(\FOP\Database::getDriver() == 'mysql' ? 'DATE_FORMAT(FROM_UNIXTIME' : 'to_char(to_timestamp') . '('.qi('protokoll').'.'.qi('date').')'.(\FOP\Database::getDriver() == 'mysql' ? '' : '::date') . ', '.\FOP\Database::sessionVarSQL('dateformat').'), \': \', '.qi('protokoll').'.'.qi('bez').') AS description FROM '.qi('protokoll').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($val))->fetchColumn() ?: _('-')
;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('linked to %s|Protokoll') . ': ' . implode(', ', $values));
		}
	}if (isset($params['search_doc_to-mitglied_subject'])) {
		array_push($filters, _('subject') . ' ' . _('filter_contains') . ' ' . $params['search_doc_to-mitglied_subject']);
	}if (isset($params['search_doc_to-mitglied_notes'])) {
		array_push($filters, _('notes') . ' ' . _('filter_contains') . ' ' . $params['search_doc_to-mitglied_notes']);
	}if (isset($params['searchnot_doc_to-mitglied_subject'])) {
		array_push($filters, _('subject') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_doc_to-mitglied_subject']);
	}if (isset($params['searchnot_doc_to-mitglied_notes'])) {
		array_push($filters, _('notes') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_doc_to-mitglied_notes']);
	}
		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(\'_doc_to-mitglied_\')) delete query[q];} reloaddoc_to_mitglied(); ">clear</i>' : '');
		} else {
			$result = _('no_filter');
		}
		return $result;
	
    
  }

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

if ($fop_table == 'doc') {
	\FOP\Session::setPayload('dv-doc', [
		'id' => 'doc_to-mitglied',
		'tbl' => 'doc',
		'idcol' => 'ID',
		'prev' => \DataViewRouter\Doc_to_mitglied::stepURL('doc', 'XXX', -1),
		'next' => \DataViewRouter\Doc_to_mitglied::stepURL('doc', 'XXX',  1),
		'from' => $fop_from,
		'param_id' => $id
	]);
	
	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\Doc::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, $dv['param_id']);
	$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();

    
  }


  
  

  
  
}



