<?php

namespace Tables;

class AufgabeProperty {
  
  

  
  

    // --- Statische Methoden ---
  
  public static function getDefaults() { 
    
    
    // --- BLOCK: main ---
    
	// erstellt ein leeres Objekt zum Befüllen mit Daten oder als Default fürs Create-Formular
	$data = ['textValue' => '',
		'dateValue' => null,
		'doubleValue' => 0,
		'htmlValue' => '',
		'aufgabePropertyDropdown2Value' => null,
		'parent' => null,
		'type' => null];
	return $data;
	
    
  }

  public static function deleteConfirmAction($id = null ) { 
    
    
    // --- BLOCK: 0_CSRFValidate ---
    
	if ($_SERVER['REQUEST_METHOD'] === 'POST') \FOP\Session::validateCSRFToken(); else \FOP\Session::getCSRFToken();

    // --- BLOCK: 0_CSRF_ensure ---
    
	\FOP\Session::getCSRFToken();
    // --- BLOCK: access ---
    if(!((!\FOP\User::getIsGuest()))) throw new \FOP\AccessDeniedException();
    // --- BLOCK: access+validators ---
    
	if ($_SERVER['REQUEST_METHOD'] === 'POST') {
		
		/* Validatoren */
		
		

		
		/* Sanitizer */

		

		
	}
	
    // --- BLOCK: access-itemlist-aufgabeProperty-delete ---
    
		// ID-Liste neu aufbauen und nur die übrig lassen, die auch erlaubt sind
		$id_ = new \FOP\IDList($id);
		$id = new \FOP\IDList();
		foreach (\FOP\Database::query('SELECT '.qi('ID').' FROM '.qi('aufgabeProperty').' WHERE ('.(\FOP\User::getIsGuest() ? 'false' : 'true').') AND ' . $id_->toSQL(qi('ID')))->fetchAll(\PDO::FETCH_COLUMN) AS $id_sub) {
			$id->push($id_sub);
		}
	
    // --- BLOCK: main ---
    
		// Main block
	
    // --- BLOCK: main-1 ---
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
		if (true) {
			\FOP\Database::beginTransaction();
    // --- BLOCK: main-2:save-main ---
    /* view */
    // --- BLOCK: main-3 ---
    
			\FOP\Database::commitTransaction();
			
		}
		
		if (isset($_POST['no'])) {
			
			if (isset($_POST['fop-from']) && $_POST['fop-from']) {
				// Redirect zu fop-from
				header('Location: ' . preg_replace('/&insert_param=(.*)$/', '&$1=' . ($id instanceof \FOP\IDList ? $id->toString() : $id), $_POST['fop-from']));
			} else {
				header('Location: ' . \TablesRouter\AufgabeProperty::viewURL2(['id' => $id, 'popup' => $_GET['popup'] ?? null]));
			}
			die();
	
		}
		if (isset($_POST['yes'])) {
			
			if (isset($_POST['fop-from']) && $_POST['fop-from'] && strrpos($_POST['fop-from'], 'insert_param') !== false) {
				// Redirect zu fop-from
				header('Location: ' . preg_replace('/&insert_param=(.*)$/', '&$1=' . ($id instanceof \FOP\IDList ? $id->toString() : $id), $_POST['fop-from']));
			} else {
				header('Location: ' . \TablesRouter\AufgabeProperty::deleteURL2(['id' => $id, 'popup' => $_GET['popup'] ?? null, 'from' => $_POST['fop-from'] ?? null]));
			}
			die();
	
		}
		die(json_encode($_POST));
	} else {
    // --- BLOCK: main-4:load-main ---
    
		$data = [];
	
    // --- BLOCK: main-5 ---
    ?><?php
			header('Content-Type: text/html; charset=UTF-8');
			header('X-XSS-Protection: 1; mode=block');
			header('Strict-Transport-Security: max-age=63072000');
			header('X-Content-Type-Options: nosniff');
			header("Content-Security-Policy: default-src *  data: blob: 'unsafe-inline' 'unsafe-eval'; script-src * 'unsafe-inline' 'unsafe-eval'; connect-src * 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src *; style-src * data: blob: 'unsafe-inline'; font-src * data: blob: 'unsafe-inline';");


		?><!DOCTYPE html><html><head><title><?php echo(_('confirmdelete')); ?></title><base href='<?php echo \FOP\Util::getCurrentBaseurl(); ?>'><meta name="google" content="notranslate"><meta http-equiv="Content-Language" content="<?php echo htmlentities(\FOP\I18n::getLocale()); ?>"><meta charset="utf-8"><link rel="stylesheet" type="text/css" href="style_dependencies.css?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"><link rel="stylesheet" type="text/css" href="style.css?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"><script type="text/javascript" src="js/script_dependencies.js?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"></script><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="mobile-web-app-capable" content="yes"><link rel="manifest" href="manifest.webmanifest"><script type="text/javascript">moment.locale('<?php echo(\FOP\I18n::getShortLocale()); ?>');</script><script type="text/javascript" src="js/form.js"></script><script type="text/javascript">window.globals = <?php
	echo json_encode(['user:superadmin' => /* TODO: resanitizer später mal */(integer) \FOP\User::getSuperadmin(), 'user:mitglied' => /* TODO: resanitizer später mal */(integer) \FOP\User::getMitglied(), 'user:gruppe' => /* TODO: resanitizer später mal */(integer) \FOP\User::getGruppe(), 'user:campaign' => /* TODO: resanitizer später mal */(integer) \FOP\User::getCampaign(), 'user:sammlung' => /* TODO: resanitizer später mal */(integer) \FOP\User::getSammlung(), 'user:protokoll' => /* TODO: resanitizer später mal */(integer) \FOP\User::getProtokoll(), 'user:ID' => /* TODO: resanitizer später mal */(integer) \FOP\User::getID(), 'user:buchhaltung' => /* TODO: resanitizer später mal */(integer) \FOP\User::getBuchhaltung()]);
?>;</script><script type="text/javascript" src="angular/<?php echo(\FOP\I18n::getShortLocale()); ?>/js/alltypes.js?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"></script><script type="text/javascript" src="angular/angular-i18n/angular-locale_<?php echo \FOP\I18n::getAngularLocale(); ?>.js"></script><script type="text/javascript" src="js/date-filter.js"></script><script type="text/javascript" src="js/dropdown.js"></script><script type="text/javascript" src="js/numeric.js"></script><script type="text/javascript" src="js/getparam.js"></script><script type="text/javascript" src="js/tables.js"></script>
		<script type="text/javascript" src="js/parsehash.js"></script><script type="text/javascript">
		window.query = <?php echo json_encode($_GET, JSON_FORCE_OBJECT); ?>;
		window.baseurl = <?php echo json_encode(\FOP\Util::getCurrentBaseurl()); ?>;

		window.i18n_weiter = <?php echo json_encode(_('Weiter'));?>;
		//Filter I18n:
		window.i18n_quartal = <?php echo json_encode(_('Quarter'));?>;
		window.i18n_alle = <?php echo json_encode(_('All'));?>;
		window.i18n_leere = <?php echo json_encode(_('Empty'));?>;
		window.i18n_tag = <?php echo json_encode(_('Tag'));?>;
		window.i18n_woche = <?php echo json_encode(_('Woche'));?>;
		window.i18n_zeitraum = <?php echo json_encode(_('Period'));?>;
		window.i18n_monat = <?php echo json_encode(_('Monat'));?>;
		window.i18n_jahr = <?php echo json_encode(_('Jahr'));?>;
		window.i18n_von = <?php echo json_encode(_('filters_from'));?>;
		window.i18n_bis = <?php echo json_encode(_('filters_to'));?>;
		window.i18n_tabButton = <?php echo json_encode(_('open_in_new_tab'));?>;
		window.i18n_closeButton = <?php echo json_encode(_('close'));?>;
		</script></head><script type="text/javascript">const fopPushPublicKey = '<?php echo(addslashes(\FOP\Configuration::getFOPPushPublicKey())); ?>';
        const fopUserID = <?php echo(intval(\FOP\User::getID())); ?>;
        var fopPushDisabled = false;
    </script><script type="text/javascript" src="js/serviceworkersetup.js"></script><body ng-app='app'>
		<div class='mdl-js-snackbar mdl-snackbar' id='snackbar'>
			<div class='mdl-snackbar__text'></div>
			<button class='mdl-snackbar__action' type='button'></button>
		</div>
		<script>
			var snackbar = document.querySelector('#snackbar');
			componentHandler.upgradeElement(snackbar, 'MaterialSnackbar');
			$(function () {
				setTimeout(function () {
					$('.fop-layout').scrollTop(0);
				}, 0);
			});
		</script>

		<?php if (isset($_GET['popup'])) { ?>
		<header class="fop-header mdl-layout__header mdl-layout__header mdl-layout__header--scroll">
				<div class="mdl-layout__header-row">
					<span class="mdl-layout-title"><?php echo(_('confirmdelete')); ?></span><div class="mdl-layout-spacer"></div><span class="noprint mdl-layout-title mdl-layout--large-screen-only"><div class="mdl-textfield mdl-js-textfield"><input id="supersearch" accesskey="f" class="mdl-textfield__input" type="text" onkeydown="if (event.keyCode == 13 && this.value) window.location.href = 'FOP/Index/searchURL?q=' + encodeURIComponent(this.value) + '&from=<?php echo htmlentities(urlencode(\FOP\Util::getBackUrl())); ?>';" value="<?php echo htmlentities($_GET['q'] ?? ''); ?>" style="border-bottom: 1px solid white;"/><label class="mdl-textfield__label" style="color: inherit"><?php echo(_('search')); ?> - <?php
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
			// MAC: Control+ davor
			echo 'Control + ';
		}
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) {
			// Firefox
			if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
				// MAC: Control + Alt + key
				echo 'Alt + F';
			} else {
				echo 'Alt + Shift + F';
			}
		} else {
			// Internet Explorer, Chrome, Safari, Opera
			echo 'Alt + F';
		}
	?></label></div></span><i onclick='addFav(null)' class='material-icons fop-favorites' id='favorites_button'>star_border</i>
				</div>
      	</header>
			<style>
				.content {
					margin-top: 0px !important;
				}
			</style>
			<div id='content' class='popup' >
		<?php } else { ?>
			<div class="fop-layout mdl-layout mdl-js-layout mdl-layout--fixed-drawer mdl-layout--fixed-header">
			<header class="fop-header mdl-layout__header mdl-layout__header mdl-layout__header--scroll">
				<div class="mdl-layout__header-row">
					<span class="mdl-layout-title"><?php echo(_('confirmdelete')); ?></span><div class="mdl-layout-spacer"></div><span class="noprint mdl-layout-title mdl-layout--large-screen-only"><div class="mdl-textfield mdl-js-textfield"><input id="supersearch" accesskey="f" class="mdl-textfield__input" type="text" onkeydown="if (event.keyCode == 13 && this.value) window.location.href = 'FOP/Index/searchURL?q=' + encodeURIComponent(this.value) + '&from=<?php echo htmlentities(urlencode(\FOP\Util::getBackUrl())); ?>';" value="<?php echo htmlentities($_GET['q'] ?? ''); ?>" style="border-bottom: 1px solid white;"/><label class="mdl-textfield__label" style="color: inherit"><?php echo(_('search')); ?> - <?php
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
			// MAC: Control+ davor
			echo 'Control + ';
		}
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) {
			// Firefox
			if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
				// MAC: Control + Alt + key
				echo 'Alt + F';
			} else {
				echo 'Alt + Shift + F';
			}
		} else {
			// Internet Explorer, Chrome, Safari, Opera
			echo 'Alt + F';
		}
	?></label></div></span><i onclick='addFav(null)' class='material-icons fop-favorites' id='favorites_button'>star_border</i>
				</div>
      		</header>


				<?php  \EasyEditor\Navigation::render(); ?>
      
				<main class="mdl-layout__content" id="content">
					<div class="fop-content">
						<?php } ?>
						
							<div class="content" id="1">
								

								<form
									
									action="<?php echo \TablesRouter\AufgabeProperty::deleteConfirmURL2(['popup' => $_GET['popup'] ?? null, 'id' => $id]); ?>"
									method="post"
									enctype="multipart/form-data" ng-submit='submit($event)'
								 
								id="cardform-wf_aufgabeProperty_deleteConfirm"
								style="width: 100%; height: 100%;"
								class='mdl-grid'
									ng-controller="FormWf_aufgabeProperty_deleteConfirm" ng-init="form = <?php echo htmlentities(json_encode([]));
									?>;"
								>
								<?php
								 echo '<input type="hidden" name="csrftoken" value="' . htmlentities(\FOP\Session::getCSRFToken()) . '">';
								 if (isset($_GET['from'])) echo '<input type="hidden" name="fop-from" value="' . htmlentities($_GET['from']) . '">';
								 ?>
								<div id='fop-upbar'></div>
								
									<?php
									$features = [];
									if (true && (true)) {
									$feature = [
										'id' => 'constraints',
										'title' => _(''),
										'order' => '200', // 200 (50)
										'mode' => 'area', // 
										'position' => 'full', // 
										'collapsed' => 0, // 
										'canEdit' => !\FOP\User::getIsGuest(),
										'visibility' => null
									];
									$features[$feature['id']] = $feature;
									}
									
									if (true && (true)) {
									$feature = [
										'id' => 'buttons',
										'title' => _('Aktionen'),
										'order' => '300', // 300 (50)
										'mode' => 'area', // 
										'position' => 'full', // 
										'collapsed' => 0, // 
										'canEdit' => !\FOP\User::getIsGuest(),
										'visibility' => null
									];
									$features[$feature['id']] = $feature;
									}
									
									if (true && (false || true)) {
									$feature = [
										'id' => 'main',
										'title' => _('Daten'),
										'order' => '100', // 100 (20)
										'mode' => 'area', // 
										'position' => 'full', // 
										'collapsed' => 0, // 
										'canEdit' => !\FOP\User::getIsGuest(),
										'visibility' => '0' .'||'. (true ? 'true' : '0')
											
									];
									$features[$feature['id']] = $feature;
									}
									

									
									/* load order from database
										schema: fop_form_feature(user, form, subid, key, value)
										key = (order, mode, position, collapsed)
									*/
									$upbar_collapsed = false;
									// default values
									foreach (\FOP\Database::query('SELECT subid, '.qi('key').', (SELECT '.qi('value').' FROM fop_form_feature b WHERE a.subid = b.subid AND a.'.qi('key').' = b.'.qi('key').' AND '.qi('user').' = '.intval(\FOP\User::getID()).' GROUP BY '.qi('value').' ORDER BY COUNT(*) DESC LIMIT 1) AS '.qi('value').' FROM fop_form_feature a WHERE '.qi('user').' = '.intval(\FOP\User::getID()).' GROUP BY subid, '.qi('key'))->fetchAll(\PDO::FETCH_ASSOC) AS $setting) {
										if (isset($features[$setting['subid']])) {
											$features[$setting['subid']][$setting['key']] = $setting['value'];
										}
									}
									// form specific special values
									foreach (\FOP\Database::query('SELECT subid, '.qi('key').', '.qi('value').' FROM fop_form_feature a WHERE form = \'wf:aufgabeProperty:deleteConfirm\' AND '.qi('user').' = '.intval(\FOP\User::getID()).'')->fetchAll(\PDO::FETCH_ASSOC) AS $setting) {
										if (isset($features[$setting['subid']])) {
											$features[$setting['subid']][$setting['key']] = $setting['value'];
										} else if ($setting['subid'] == 'upbar' && $setting['key'] == 'collapsed') {
											$upbar_collapsed = (bool) $setting['value'];
										}
									}

									/* fill in the content of the features */
									if (true && (true)) {
										ob_start();
										\EasyEditor\FormFeature::push($features['constraints']);
										?><div class='fop-delete-constraints'><?php
	$foundProblems = false;
	
?></div><?php
										\EasyEditor\FormFeature::pop();
										$features['constraints']['html'] = ob_get_contents();
										ob_end_clean();
									}
									
									if (true && (true)) {
										ob_start();
										\EasyEditor\FormFeature::push($features['buttons']);
										?><div id='wf_aufgabeProperty_deleteConfirm_buttons' class='mdl-cell mdl-cell--12-col' style='flex-wrap: wrap;'><?php if (true) { ?><button onclick="
		var errors = $(this).closest('form').find('.fop-form-error:visible, .is-invalid').filter((i, x) => $(x).parents('.novalidate').length ? false : true);
		if (errors.length) {
			event.preventDefault();
			alert(errors.closest('.fop-form-content').prev('.fop-form-label').text() + ' Es sind noch Fehler im Formular bei Feld');
			return;
		} /* TODO: i18n */
		
	" type="submit" name="no" class="mdl-button mdl-js-button mdl-button--colored mdl-button--raised" ><i class="material-icons">cancel</i><?php echo(_('no')); ?></button><?php } ?>
									&nbsp;<?php if ((!$foundProblems)) { ?><button onclick="
		var errors = $(this).closest('form').find('.fop-form-error:visible, .is-invalid').filter((i, x) => $(x).parents('.novalidate').length ? false : true);
		if (errors.length) {
			event.preventDefault();
			alert(errors.closest('.fop-form-content').prev('.fop-form-label').text() + ' Es sind noch Fehler im Formular bei Feld');
			return;
		} /* TODO: i18n */
		
	" type="submit" name="yes" class="mdl-button mdl-js-button mdl-button--colored mdl-button--raised" ><i class="material-icons">delete</i><?php echo(_('yes')); ?></button><?php } ?>
									</div><script type='text/javascript'>
		// copy all buttons to #fop-upbar
		$(function () {
    var btn = document.getElementById("fop-bar-mainbutton");
    var upbar = $('#fop-upbar');
    var upbar_buttons = document.getElementById("fop-bar-container");

    // Check if the elements already exist
    if (!btn || !upbar_buttons) {
        if (!btn) {
            btn = $('<div id="fop-bar-mainbutton" class="mdl-button fop-button-half fop-button-margin mdl-button--raised"><i class="material-icons">keyboard_arrow_right</i></div>')
                .click(function () {
                    if (btn.find('i').text() == 'keyboard_arrow_right') {
                        upbar_buttons.fadeOut(400);
                        btn.find('i').text('keyboard_arrow_left');
                    } else {
                        upbar_buttons.fadeIn(400);
                        btn.find('i').text('keyboard_arrow_right');
                    }
                });
            upbar.append(btn);
        }

        if (!upbar_buttons) {
            upbar_buttons = $('<div id="fop-bar-container" style="max-width: 290px"></div>'); //dependant on the mdl-buttons width, caps of upbar buttons at exactly 4 buttons
            upbar.append(upbar_buttons);
        }

        var buttons = $('#wf_aufgabeProperty_deleteConfirm_buttons').find('.mdl-button');
        buttons.each(function (i, v) {
            var button = $(v);
            var newbutton = $('<div></div>');
            newbutton.attr('class', button.attr('class'));
            newbutton.attr('title', button.attr('title'));
            newbutton.append(button.find('.material-icons').clone(false));
            newbutton.click(function () {
                button[0].click();
            });
            upbar_buttons.append(newbutton);
        });
    }
});

	</script><?php
										\EasyEditor\FormFeature::pop();
										$features['buttons']['html'] = ob_get_contents();
										ob_end_clean();
									}
									
									if (true && (false || true)) {
										ob_start();
										\EasyEditor\FormFeature::push($features['main']);
										?><?php echo htmlentities(_('confirmdelete')) . ' (' . $id->count() . '× ' . _('Eigenschaft') . ')'; ?><?php
										\EasyEditor\FormFeature::pop();
										$features['main']['html'] = ob_get_contents();
										ob_end_clean();
									}
									

									uasort($features, function ($a, $b) {
										return strnatcmp($a['order'], $b['order']);
									});
									foreach ($features AS $feature) {
										\EasyEditor\FormFeature::render($feature);
									}
									?><script type='text/javascript'>
										function setCFF(id, key, value) {
											<?php if(!\FOP\User::getIsGuest()) { ?>
											$.get('FOP/Index/setCFF?form=wf%3AaufgabeProperty%3AdeleteConfirm&subid=' + encodeURIComponent(id) + '&key=' + encodeURIComponent(key) + '&value=' + encodeURIComponent(value)).then(function () {
												if (key == 'reset') {
													location.reload();
												}
											});
											<?php } /* EditAccess */ ?>
										}
										function setCFFOrder(fids) {
											<?php if(!\FOP\User::getIsGuest()) { ?>
											$.get('FOP/Index/setCFFOrder?form=wf%3AaufgabeProperty%3AdeleteConfirm&fids=' + encodeURIComponent(JSON.stringify(fids)));
											<?php } /* EditAccess */ ?>
										}
										$(function () {
											refreshTabHeaders($('#cardform-wf_aufgabeProperty_deleteConfirm')); /* provided in js/form.js */
											// preselection
											if (location.hash.startsWith('#select:')) {
												$('[name="' + window.location.hash.slice(8) + '"]').focus().select();
											} else {
												$('#cardform-wf_aufgabeProperty_deleteConfirm input[type!="hidden"],textarea,select[tabindex!="-1"]').not('.fop-disabled *').filter(':visible:first').focus().select();
											}
										});

										$(window).keydown(function(event) {
											 if (event.ctrlKey && String.fromCharCode(event.which).toLowerCase() == 's') {
												 event.preventDefault();
												 $('button[type=submit]').click();
												 return false;
											 }
										});

										
										$(document).on('keyup',function(evt) {
										   if (evt.keyCode == 27) {
												if (window.parent) {
													window.close(); // iframe:close
												} else {
													window.history.back();
												}
											}
												});
										
									</script>

							</form>
							

							</div>
							<div class="content" id="focus-supersearch">
							</div>
							<div class="content" id="~spacer"><?php if (!isset($_GET['popup'])) { ?><div style="padding-bottom: 10cm;"></div><?php } ?>
							</div>
						<?php if (!isset($_GET['popup'])) { ?>
					</div>
				</main>
				
			</div>
		<?php } else { ?></div><?php } ?>
<?php if (!isset($_GET['popup'])) { ?><div class='fop-seal'></div><?php } ?></body></html><?php
    // --- BLOCK: main-6 ---
    }
    
  }

  public static function createAction($column_parent = null ) { 
    
    
    // --- BLOCK: 0_CSRFValidate ---
    
	if ($_SERVER['REQUEST_METHOD'] === 'POST') \FOP\Session::validateCSRFToken(); else \FOP\Session::getCSRFToken();

    // --- BLOCK: 0_CSRF_ensure ---
    
	\FOP\Session::getCSRFToken();
    // --- BLOCK: access ---
    if(!((!\FOP\User::getIsGuest()))) throw new \FOP\AccessDeniedException();
    // --- BLOCK: access+validators ---
    
	if ($_SERVER['REQUEST_METHOD'] === 'POST') {
		
		/* Validatoren */
		
		if ((!isset($_POST['cancel']))) \Types\AufgabePropertyDropdown2::validate($_POST['aufgabePropertyDropdown2Value']);
		if ((!isset($_POST['cancel']))) \Types\Aufgabe::validate($_POST['parent']);
		if ((!isset($_POST['cancel']))) \Types\AufgabePropertyType::validate($_POST['type']);

		
		/* Sanitizer */

		$_POST['dateValue'] = \FOP\Sanitizers::convert_date_to_unix_timestamp($_POST['dateValue']);
		$_POST['doubleValue'] = \Types\Double::parse($_POST['doubleValue']);
		$_POST['htmlValue'] = \FOP\Sanitizers::htmlentities_decode($_POST['htmlValue']);
		if ((!isset($_POST['cancel']))) $_POST['aufgabePropertyDropdown2Value'] = \FOP\Sanitizers::null_filter($_POST['aufgabePropertyDropdown2Value']);
		if ((!isset($_POST['cancel']))) $_POST['parent'] = \FOP\Sanitizers::null_filter($_POST['parent']);
		if ((!isset($_POST['cancel']))) $_POST['type'] = \FOP\Sanitizers::null_filter($_POST['type']);

		
	}
	
    // --- BLOCK: main ---
    
		// Main block
	
    // --- BLOCK: main-1 ---
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
		if (!isset($_POST['cancel'])) {
			\FOP\Database::beginTransaction();
    // --- BLOCK: main-2:save-main ---
    
		$defaults = \Tables\AufgabeProperty::getDefaults();
		$defaults['textValue'] = $_POST['textValue'];
		$defaults['dateValue'] = $_POST['dateValue'];
		$defaults['doubleValue'] = $_POST['doubleValue'];
		$defaults['htmlValue'] = $_POST['htmlValue'];
		if ((!isset($_POST['cancel']))) $defaults['aufgabePropertyDropdown2Value'] = $_POST['aufgabePropertyDropdown2Value'];
		if ((!isset($_POST['cancel']))) $defaults['parent'] = $_POST['parent'];
		if ((!isset($_POST['cancel']))) $defaults['type'] = $_POST['type'];
		// TableItemAccess für PHP auswerten
		
		$id = \Tables\AufgabeProperty::create($defaults);
	
    // --- BLOCK: main-3 ---
    
			\FOP\Database::commitTransaction();
			
		}
		
		if (isset($_POST['cancel'])) {
			
			
			if (isset($_POST['fop-from']) && $_POST['fop-from']) {
				// Redirect zu fop-from
				header('Location: ' . (isset($id) && is_string($id) ? preg_replace('/&insert_param=(.*)$/', '&$1=' . ($id instanceof \FOP\IDList ? $id->toString() : $id), $_POST['fop-from']) : $_POST['fop-from']));
			} else {
				header('Location: ' . \TablesRouter\AufgabeProperty::indexURL2(['popup' => $_GET['popup'] ?? null]));
			}
			die();
	
		}
		if (isset($_POST['save'])) {
			
			if (isset($_POST['fop-from']) && $_POST['fop-from'] && strrpos($_POST['fop-from'], 'insert_param') !== false) {
				// Redirect zu fop-from
				header('Location: ' . preg_replace('/&insert_param=(.*)$/', '&$1=' . ($id instanceof \FOP\IDList ? $id->toString() : $id), $_POST['fop-from']));
			} else {
				if (!\TablesRouter\AufgabeProperty::viewAccess($id)) {
					if (!\TablesRouter\AufgabeProperty::indexAccess()) {
						header('Location: ' . \FOPRouter\Index::indexURL2(['popup' => $_GET['popup'] ?? null, 'from' => $_POST['fop-from'] ?? null]));
						die();
					}
					header('Location: ' . \TablesRouter\AufgabeProperty::indexURL2(['popup' => $_GET['popup'] ?? null, 'from' => $_POST['fop-from'] ?? null]));
					die();
				}
				header('Location: ' . \TablesRouter\AufgabeProperty::viewURL2(['id' => $id, 'popup' => $_GET['popup'] ?? null, 'from' => $_POST['fop-from'] ?? null]));
			}
			die();
	
		}
		die(json_encode($_POST));
	} else {
    // --- BLOCK: main-4:load-main ---
    
		$data = \Tables\AufgabeProperty::getDefaults();
	
    // --- BLOCK: main-4:load-override ---
    
		$hidden = [];
		if (isset($column_parent)) {
			
			$hidden['parent'] = $column_parent;
			$data['parent'] = $column_parent;
		}
	
    // --- BLOCK: main-4:load-~sanitize ---
    
		\Tables\AufgabeProperty::sanitizeDefaults($data, true);
	
    // --- BLOCK: main-5 ---
    ?><?php
			header('Content-Type: text/html; charset=UTF-8');
			header('X-XSS-Protection: 1; mode=block');
			header('Strict-Transport-Security: max-age=63072000');
			header('X-Content-Type-Options: nosniff');
			header("Content-Security-Policy: default-src *  data: blob: 'unsafe-inline' 'unsafe-eval'; script-src * 'unsafe-inline' 'unsafe-eval'; connect-src * 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src *; style-src * data: blob: 'unsafe-inline'; font-src * data: blob: 'unsafe-inline';");


		?><!DOCTYPE html><html><head><title><?php echo(sprintf(_('create %s'), _('Eigenschaft'))); ?></title><base href='<?php echo \FOP\Util::getCurrentBaseurl(); ?>'><meta name="google" content="notranslate"><meta http-equiv="Content-Language" content="<?php echo htmlentities(\FOP\I18n::getLocale()); ?>"><meta charset="utf-8"><link rel="stylesheet" type="text/css" href="style_dependencies.css?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"><link rel="stylesheet" type="text/css" href="style.css?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"><script type="text/javascript" src="js/script_dependencies.js?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"></script><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="mobile-web-app-capable" content="yes"><link rel="manifest" href="manifest.webmanifest"><script type="text/javascript">moment.locale('<?php echo(\FOP\I18n::getShortLocale()); ?>');</script><script type="text/javascript" src="js/form.js"></script><script type="text/javascript">window.globals = <?php
	echo json_encode(['user:superadmin' => /* TODO: resanitizer später mal */(integer) \FOP\User::getSuperadmin(), 'user:mitglied' => /* TODO: resanitizer später mal */(integer) \FOP\User::getMitglied(), 'user:gruppe' => /* TODO: resanitizer später mal */(integer) \FOP\User::getGruppe(), 'user:campaign' => /* TODO: resanitizer später mal */(integer) \FOP\User::getCampaign(), 'user:sammlung' => /* TODO: resanitizer später mal */(integer) \FOP\User::getSammlung(), 'user:protokoll' => /* TODO: resanitizer später mal */(integer) \FOP\User::getProtokoll(), 'user:ID' => /* TODO: resanitizer später mal */(integer) \FOP\User::getID(), 'user:buchhaltung' => /* TODO: resanitizer später mal */(integer) \FOP\User::getBuchhaltung()]);
?>;</script><script type="text/javascript" src="angular/<?php echo(\FOP\I18n::getShortLocale()); ?>/js/alltypes.js?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"></script><script type="text/javascript" src="angular/angular-i18n/angular-locale_<?php echo \FOP\I18n::getAngularLocale(); ?>.js"></script><script type="text/javascript" src="js/date-filter.js"></script><script type="text/javascript" src="js/dropdown.js"></script><script type="text/javascript" src="js/numeric.js"></script><script type="text/javascript" src="js/getparam.js"></script><script type="text/javascript" src="js/tables.js"></script>
		<script type="text/javascript" src="js/parsehash.js"></script><script type="text/javascript">
		window.query = <?php echo json_encode($_GET, JSON_FORCE_OBJECT); ?>;
		window.baseurl = <?php echo json_encode(\FOP\Util::getCurrentBaseurl()); ?>;

		window.i18n_weiter = <?php echo json_encode(_('Weiter'));?>;
		//Filter I18n:
		window.i18n_quartal = <?php echo json_encode(_('Quarter'));?>;
		window.i18n_alle = <?php echo json_encode(_('All'));?>;
		window.i18n_leere = <?php echo json_encode(_('Empty'));?>;
		window.i18n_tag = <?php echo json_encode(_('Tag'));?>;
		window.i18n_woche = <?php echo json_encode(_('Woche'));?>;
		window.i18n_zeitraum = <?php echo json_encode(_('Period'));?>;
		window.i18n_monat = <?php echo json_encode(_('Monat'));?>;
		window.i18n_jahr = <?php echo json_encode(_('Jahr'));?>;
		window.i18n_von = <?php echo json_encode(_('filters_from'));?>;
		window.i18n_bis = <?php echo json_encode(_('filters_to'));?>;
		window.i18n_tabButton = <?php echo json_encode(_('open_in_new_tab'));?>;
		window.i18n_closeButton = <?php echo json_encode(_('close'));?>;
		</script></head><script type="text/javascript">const fopPushPublicKey = '<?php echo(addslashes(\FOP\Configuration::getFOPPushPublicKey())); ?>';
        const fopUserID = <?php echo(intval(\FOP\User::getID())); ?>;
        var fopPushDisabled = false;
    </script><script type="text/javascript" src="js/serviceworkersetup.js"></script><body ng-app='app'>
		<div class='mdl-js-snackbar mdl-snackbar' id='snackbar'>
			<div class='mdl-snackbar__text'></div>
			<button class='mdl-snackbar__action' type='button'></button>
		</div>
		<script>
			var snackbar = document.querySelector('#snackbar');
			componentHandler.upgradeElement(snackbar, 'MaterialSnackbar');
			$(function () {
				setTimeout(function () {
					$('.fop-layout').scrollTop(0);
				}, 0);
			});
		</script>

		<?php if (isset($_GET['popup'])) { ?>
		<header class="fop-header mdl-layout__header mdl-layout__header mdl-layout__header--scroll">
				<div class="mdl-layout__header-row">
					<span class="mdl-layout-title"><?php echo(sprintf(_('create %s'), _('Eigenschaft'))); ?></span><div class="mdl-layout-spacer"></div><span class="noprint mdl-layout-title mdl-layout--large-screen-only"><div class="mdl-textfield mdl-js-textfield"><input id="supersearch" accesskey="f" class="mdl-textfield__input" type="text" onkeydown="if (event.keyCode == 13 && this.value) window.location.href = 'FOP/Index/searchURL?q=' + encodeURIComponent(this.value) + '&from=<?php echo htmlentities(urlencode(\FOP\Util::getBackUrl())); ?>';" value="<?php echo htmlentities($_GET['q'] ?? ''); ?>" style="border-bottom: 1px solid white;"/><label class="mdl-textfield__label" style="color: inherit"><?php echo(_('search')); ?> - <?php
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
			// MAC: Control+ davor
			echo 'Control + ';
		}
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) {
			// Firefox
			if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
				// MAC: Control + Alt + key
				echo 'Alt + F';
			} else {
				echo 'Alt + Shift + F';
			}
		} else {
			// Internet Explorer, Chrome, Safari, Opera
			echo 'Alt + F';
		}
	?></label></div></span><i onclick='addFav(null)' class='material-icons fop-favorites' id='favorites_button'>star_border</i>
				</div>
      	</header>
			<style>
				.content {
					margin-top: 0px !important;
				}
			</style>
			<div id='content' class='popup' >
		<?php } else { ?>
			<div class="fop-layout mdl-layout mdl-js-layout mdl-layout--fixed-drawer mdl-layout--fixed-header">
			<header class="fop-header mdl-layout__header mdl-layout__header mdl-layout__header--scroll">
				<div class="mdl-layout__header-row">
					<span class="mdl-layout-title"><?php echo(sprintf(_('create %s'), _('Eigenschaft'))); ?></span><div class="mdl-layout-spacer"></div><span class="noprint mdl-layout-title mdl-layout--large-screen-only"><div class="mdl-textfield mdl-js-textfield"><input id="supersearch" accesskey="f" class="mdl-textfield__input" type="text" onkeydown="if (event.keyCode == 13 && this.value) window.location.href = 'FOP/Index/searchURL?q=' + encodeURIComponent(this.value) + '&from=<?php echo htmlentities(urlencode(\FOP\Util::getBackUrl())); ?>';" value="<?php echo htmlentities($_GET['q'] ?? ''); ?>" style="border-bottom: 1px solid white;"/><label class="mdl-textfield__label" style="color: inherit"><?php echo(_('search')); ?> - <?php
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
			// MAC: Control+ davor
			echo 'Control + ';
		}
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) {
			// Firefox
			if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
				// MAC: Control + Alt + key
				echo 'Alt + F';
			} else {
				echo 'Alt + Shift + F';
			}
		} else {
			// Internet Explorer, Chrome, Safari, Opera
			echo 'Alt + F';
		}
	?></label></div></span><i onclick='addFav(null)' class='material-icons fop-favorites' id='favorites_button'>star_border</i>
				</div>
      		</header>


				<?php  \EasyEditor\Navigation::render(); ?>
      
				<main class="mdl-layout__content" id="content">
					<div class="fop-content">
						<?php } ?>
						
							<div class="content" id="1">
								

								<form
									
									action="<?php echo \TablesRouter\AufgabeProperty::createURL2(['popup' => $_GET['popup'] ?? null]); ?>"
									method="post"
									enctype="multipart/form-data" ng-submit='submit($event)'
									onsubmit="
										if (window.running_uploads) {
											event.preventDefault();
											alert('<?php echo htmlentities(json_encode(_('fileUploadStillActive')));?>');
										}
									"
								 
								id="cardform-wf_aufgabeProperty_create"
								style="width: 100%; height: 100%;"
								class='mdl-grid'
									ng-controller="FormWf_aufgabeProperty_create" ng-init="form = <?php echo htmlentities(json_encode(['type' => $data['type']]));
									?>;"
								>
								<?php
								 echo '<input type="hidden" name="csrftoken" value="' . htmlentities(\FOP\Session::getCSRFToken()) . '">';
								 if (isset($_GET['from'])) echo '<input type="hidden" name="fop-from" value="' . htmlentities($_GET['from']) . '">';
								 ?>
								<div id='fop-upbar'></div>
								
									<?php
									$features = [];
									if (true && (true)) {
									$feature = [
										'id' => 'buttons',
										'title' => _('Aktionen'),
										'order' => '300', // 300 (50)
										'mode' => 'area', // 
										'position' => 'full', // 
										'collapsed' => 0, // 
										'canEdit' => !\FOP\User::getIsGuest(),
										'visibility' => null
									];
									$features[$feature['id']] = $feature;
									}
									
									if (true && (false || true || true || true || true || (!isset($_POST['cancel'])) || (!isset($_POST['cancel'])) || (!isset($_POST['cancel'])))) {
									$feature = [
										'id' => 'main',
										'title' => _('Daten'),
										'order' => '100', // 100 (20)
										'mode' => 'area', // 
										'position' => 'full', // 
										'collapsed' => 0, // 
										'canEdit' => !\FOP\User::getIsGuest(),
										'visibility' => '0' .'||'. (true ? '((\'text\') == (form[\'DesVaCQB\']))' : '0')
											 .'||'. (true ? '((\'date\') == (form[\'qlmkLYxD\']))' : '0')
											 .'||'. (true ? '((\'double\') == (form[\'W8Efbkfa\']))' : '0')
											 .'||'. (true ? '((\'html\') == (form[\'GIuNXQJJ\']))' : '0')
											 .'||'. ((!isset($_POST['cancel'])) ? '((\'aufgabePropertyDropdown2\') == (form[\'zxF57KrA\']))' : '0')
											 .'||'. ((!isset($_POST['cancel'])) ? 'true' : '0')
											 .'||'. ((!isset($_POST['cancel'])) ? 'true' : '0')
											
									];
									$features[$feature['id']] = $feature;
									}
									

									
									/* load order from database
										schema: fop_form_feature(user, form, subid, key, value)
										key = (order, mode, position, collapsed)
									*/
									$upbar_collapsed = false;
									// default values
									foreach (\FOP\Database::query('SELECT subid, '.qi('key').', (SELECT '.qi('value').' FROM fop_form_feature b WHERE a.subid = b.subid AND a.'.qi('key').' = b.'.qi('key').' AND '.qi('user').' = '.intval(\FOP\User::getID()).' GROUP BY '.qi('value').' ORDER BY COUNT(*) DESC LIMIT 1) AS '.qi('value').' FROM fop_form_feature a WHERE '.qi('user').' = '.intval(\FOP\User::getID()).' GROUP BY subid, '.qi('key'))->fetchAll(\PDO::FETCH_ASSOC) AS $setting) {
										if (isset($features[$setting['subid']])) {
											$features[$setting['subid']][$setting['key']] = $setting['value'];
										}
									}
									// form specific special values
									foreach (\FOP\Database::query('SELECT subid, '.qi('key').', '.qi('value').' FROM fop_form_feature a WHERE form = \'wf:aufgabeProperty:create\' AND '.qi('user').' = '.intval(\FOP\User::getID()).'')->fetchAll(\PDO::FETCH_ASSOC) AS $setting) {
										if (isset($features[$setting['subid']])) {
											$features[$setting['subid']][$setting['key']] = $setting['value'];
										} else if ($setting['subid'] == 'upbar' && $setting['key'] == 'collapsed') {
											$upbar_collapsed = (bool) $setting['value'];
										}
									}

									/* fill in the content of the features */
									if (true && (true)) {
										ob_start();
										\EasyEditor\FormFeature::push($features['buttons']);
										?><div id='wf_aufgabeProperty_create_buttons' class='mdl-cell mdl-cell--12-col' style='flex-wrap: wrap;'><?php if (true) { ?><button onclick="
		var errors = $(this).closest('form').find('.fop-form-error:visible, .is-invalid').filter((i, x) => $(x).parents('.novalidate').length ? false : true);
		if (errors.length) {
			event.preventDefault();
			alert(errors.closest('.fop-form-content').prev('.fop-form-label').text() + ' Es sind noch Fehler im Formular bei Feld');
			return;
		} /* TODO: i18n */
		
	" type="submit" name="save" class="mdl-button mdl-js-button mdl-button--colored mdl-button--raised" ><i class="material-icons">save</i><?php echo(_('save')); ?></button><?php } ?>
									&nbsp;<?php if (true) { ?><button onclick="$(this).closest('form').find('.mdl-textfield__error:visible').hide();
		$('[required]').removeAttr('required');
	" type="submit" name="cancel" class="mdl-button mdl-js-button mdl-button--colored mdl-button--raised" ><i class="material-icons">cancel</i><?php echo(_('cancel')); ?></button><?php } ?>
									</div><script type='text/javascript'>
		// copy all buttons to #fop-upbar
		$(function () {
    var btn = document.getElementById("fop-bar-mainbutton");
    var upbar = $('#fop-upbar');
    var upbar_buttons = document.getElementById("fop-bar-container");

    // Check if the elements already exist
    if (!btn || !upbar_buttons) {
        if (!btn) {
            btn = $('<div id="fop-bar-mainbutton" class="mdl-button fop-button-half fop-button-margin mdl-button--raised"><i class="material-icons">keyboard_arrow_right</i></div>')
                .click(function () {
                    if (btn.find('i').text() == 'keyboard_arrow_right') {
                        upbar_buttons.fadeOut(400);
                        btn.find('i').text('keyboard_arrow_left');
                    } else {
                        upbar_buttons.fadeIn(400);
                        btn.find('i').text('keyboard_arrow_right');
                    }
                });
            upbar.append(btn);
        }

        if (!upbar_buttons) {
            upbar_buttons = $('<div id="fop-bar-container" style="max-width: 290px"></div>'); //dependant on the mdl-buttons width, caps of upbar buttons at exactly 4 buttons
            upbar.append(upbar_buttons);
        }

        var buttons = $('#wf_aufgabeProperty_create_buttons').find('.mdl-button');
        buttons.each(function (i, v) {
            var button = $(v);
            var newbutton = $('<div></div>');
            newbutton.attr('class', button.attr('class'));
            newbutton.attr('title', button.attr('title'));
            newbutton.append(button.find('.material-icons').clone(false));
            newbutton.click(function () {
                button[0].click();
            });
            upbar_buttons.append(newbutton);
        });
    }
});

	</script><?php
										\EasyEditor\FormFeature::pop();
										$features['buttons']['html'] = ob_get_contents();
										ob_end_clean();
									}
									
									if (true && (false || true || true || true || true || (!isset($_POST['cancel'])) || (!isset($_POST['cancel'])) || (!isset($_POST['cancel'])))) {
										ob_start();
										\EasyEditor\FormFeature::push($features['main']);
										?><?php if ((!isset($_POST['cancel']))) { ?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_parent" id="column_parent">
		<!-- Feld "Aufgabe": parent -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label<?php if (isset($hidden['parent'])) { echo ' fop-disabled'; } ?>">
		<label for="parent"><?php echo(_('Aufgabe')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content<?php
			if (isset($hidden['parent'])) { echo ' fop-disabled"><input type="hidden" name="parent" value="' . htmlentities($hidden['parent']); }
		?>">
		<div style='display: flex; flex-direction: row; align-items: center; width: 100%;'><?php
	\Tables\Aufgabe::renderEditform_wf_aufgabeProperty_create_parentAction($data['parent'], [], '');
?> &nbsp;	<?php if (\TablesRouter\Aufgabe::createAccess()) { ?>  <a tabindex='-1' class='unimportant button' href="#" onclick='var p = $(this).parent(), id = "x"+Math.round(1000000*Math.random()); p.attr("id", id); window.open_over(<?php
		echo json_encode(\TablesRouter\Aufgabe::createURL2([
			'popup' => true]
		)); ?> + "&from=<?php echo urlencode(\FOP\Util::getCurrentBaseurl()); ?>jscloser.php?action=popup%26type=aufgabe%26colinsert=parent%26el=" + encodeURIComponent(id) + "%26close%26insert_param=colvalue", "_blank", "width=739, height=395"); return false;'><i class="material-icons">add</i></a> <?php } ?> &nbsp;	<a tabindex='-1' class='unimportant button fop-ddt-search' href="#" onclick='var p = $(this).parent(), id = "x"+Math.round(1000000*Math.random()); p.attr("id", id); window.open_over(<?php
		echo json_encode(\TablesRouter\Aufgabe::indexURL2([
			'popup' => true]
		)); ?> + "&from=<?php echo urlencode(\FOP\Util::getCurrentBaseurl()); ?>jscloser.php?action=popup%26type=aufgabe%26colinsert=parent%26el=" + encodeURIComponent(id) + "%26insert_param=colvalue&select=aufgabe", "_blank", "width=739, height=395"); return false;'><i class="material-icons">search</i></a>
	</div>
	</div>
	</div><?php } ?><?php if ((!isset($_POST['cancel']))) { ?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_type" id="column_type">
		<!-- Feld "Eigenschaft": type -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label<?php if (isset($hidden['type'])) { echo ' fop-disabled'; } ?>">
		<label for="type"><?php echo(_('Eigenschaft')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content<?php
			if (isset($hidden['type'])) { echo ' fop-disabled"><input type="hidden" name="type" value="' . htmlentities($hidden['type']); }
		?>">
		<div style='display: flex; flex-direction: row; align-items: center; width: 100%;'><?php
	\Tables\AufgabePropertyType::renderEditform_wf_aufgabeProperty_create_typeAction($data['type'], [], '');
?> &nbsp;	<?php if (\TablesRouter\AufgabePropertyType::createAccess()) { ?>  <a tabindex='-1' class='unimportant button' href="#" onclick='var p = $(this).parent(), id = "x"+Math.round(1000000*Math.random()); p.attr("id", id); window.open_over(<?php
		echo json_encode(\TablesRouter\AufgabePropertyType::createURL2([
			'popup' => true]
		)); ?> + "&from=<?php echo urlencode(\FOP\Util::getCurrentBaseurl()); ?>jscloser.php?action=popup%26ng=<?php echo urlencode('form[\'type\']'); ?>%26type=aufgabePropertyType%26colinsert=type%26el=" + encodeURIComponent(id) + "%26close%26insert_param=colvalue", "_blank", "width=739, height=395"); return false;'><i class="material-icons">add</i></a> <?php } ?> &nbsp;	<a tabindex='-1' class='unimportant button fop-ddt-search' href="#" onclick='var p = $(this).parent(), id = "x"+Math.round(1000000*Math.random()); p.attr("id", id); window.open_over(<?php
		echo json_encode(\TablesRouter\AufgabePropertyType::indexURL2([
			'popup' => true]
		)); ?> + "&from=<?php echo urlencode(\FOP\Util::getCurrentBaseurl()); ?>jscloser.php?action=popup%26ng=<?php echo urlencode('form[\'type\']'); ?>%26type=aufgabePropertyType%26colinsert=type%26el=" + encodeURIComponent(id) + "%26insert_param=colvalue&select=aufgabePropertyType", "_blank", "width=739, height=395"); return false;'><i class="material-icons">search</i></a>
	</div>
	</div>
	</div><?php } ?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_textValue" id="column_textValue" ng-show='(&apos;text&apos;) == (form[&apos;DesVaCQB&apos;])'>
		<!-- Feld "Text": textValue -->
	<div ng-show='(&apos;text&apos;) == (form[&apos;DesVaCQB&apos;])'	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label<?php if (isset($hidden['textValue'])) { echo ' fop-disabled'; } ?>">
		<label for="textValue"><?php echo(_('Text')); ?>: </label>
	</div>
	<div ng-show='(&apos;text&apos;) == (form[&apos;DesVaCQB&apos;])'	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content<?php
			if (isset($hidden['textValue'])) { echo ' fop-disabled"><input type="hidden" name="textValue" value="' . htmlentities($hidden['textValue']); }
		?>">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="textValue"  value="<?php echo htmlentities($data['textValue']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_dateValue" id="column_dateValue" ng-show='(&apos;date&apos;) == (form[&apos;qlmkLYxD&apos;])'>
		<!-- Feld "Datum": dateValue -->
	<div ng-show='(&apos;date&apos;) == (form[&apos;qlmkLYxD&apos;])'	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label<?php if (isset($hidden['dateValue'])) { echo ' fop-disabled'; } ?>">
		<label for="dateValue"><?php echo(_('Datum')); ?>: </label>
	</div>
	<div ng-show='(&apos;date&apos;) == (form[&apos;qlmkLYxD&apos;])'	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content<?php
			if (isset($hidden['dateValue'])) { echo ' fop-disabled"><input type="hidden" name="dateValue" value="' . htmlentities($hidden['dateValue']); }
		?>">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	" ts-locale='<?php echo (\FOP\I18n::getShortLocale()); ?>' ts-format='<?php echo (_('dateformat_moment')); ?>' class="mdl-textfield__input picker_date" id="dateValue" type="text" name="dateValue" value="<?php echo ($data['dateValue']) ? strftime(_('dateformat_php2'), intval($data['dateValue'])) : ''; ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_doubleValue" id="column_doubleValue" ng-show='(&apos;double&apos;) == (form[&apos;W8Efbkfa&apos;])'>
		<!-- Feld "Zahl": doubleValue -->
	<div ng-show='(&apos;double&apos;) == (form[&apos;W8Efbkfa&apos;])'	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label<?php if (isset($hidden['doubleValue'])) { echo ' fop-disabled'; } ?>">
		<label for="doubleValue"><?php echo(_('Zahl')); ?>: </label>
	</div>
	<div ng-show='(&apos;double&apos;) == (form[&apos;W8Efbkfa&apos;])'	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content<?php
			if (isset($hidden['doubleValue'])) { echo ' fop-disabled"><input type="hidden" name="doubleValue" value="' . htmlentities($hidden['doubleValue']); }
		?>">
		<div class="mdl-textfield mdl-js-textfield fop-numeric">
		<input onfocus='this.select()' style='text-align: right;' type='text' pattern='<?php echo htmlentities(\Types\Double::pattern()); ?>' class="mdl-textfield__input" name="doubleValue"  value="<?php echo \Types\Double::print($data['doubleValue']); ?>" fop-numeric='-1' fop-numeric-decimal='<?php echo htmlentities(\Types\Double::decimalSeparator()); ?>' fop-numeric-thousands='<?php echo htmlentities(\Types\Double::thousandsSeparator()); ?>' /><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	<script type='text/javascript'>$(function () {bindNumericFields(); });</script>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_htmlValue" id="column_htmlValue" ng-show='(&apos;html&apos;) == (form[&apos;GIuNXQJJ&apos;])'>
		<!-- Feld "Großer Text": htmlValue -->
	<div ng-show='(&apos;html&apos;) == (form[&apos;GIuNXQJJ&apos;])'	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label<?php if (isset($hidden['htmlValue'])) { echo ' fop-disabled'; } ?>">
		<label for="htmlValue"><?php echo(_('Großer Text')); ?>: </label>
	</div>
	<div ng-show='(&apos;html&apos;) == (form[&apos;GIuNXQJJ&apos;])'	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content<?php
			if (isset($hidden['htmlValue'])) { echo ' fop-disabled"><input type="hidden" name="htmlValue" value="' . htmlentities($hidden['htmlValue']); }
		?>">
		
	<div tinymce-locale="<?php echo \FOP\I18n::getShortLocale(); ?>">
	
	<textarea ng-non-bindable rows="22" cols="50" name="htmlValue" class="html-html"><?php echo htmlentities($data['htmlValue']); ?></textarea>
	</div>
	</div>
	</div><?php if ((!isset($_POST['cancel']))) { ?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_aufgabePropertyDropdown2Value" id="column_aufgabePropertyDropdown2Value" ng-show='(&apos;aufgabePropertyDropdown2&apos;) == (form[&apos;zxF57KrA&apos;])'>
		<!-- Feld "Auswahl": aufgabePropertyDropdown2Value -->
	<div ng-show='(&apos;aufgabePropertyDropdown2&apos;) == (form[&apos;zxF57KrA&apos;])'	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label<?php if (isset($hidden['aufgabePropertyDropdown2Value'])) { echo ' fop-disabled'; } ?>">
		<label for="aufgabePropertyDropdown2Value"><?php echo(_('Auswahl')); ?>: </label>
	</div>
	<div ng-show='(&apos;aufgabePropertyDropdown2&apos;) == (form[&apos;zxF57KrA&apos;])'	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content<?php
			if (isset($hidden['aufgabePropertyDropdown2Value'])) { echo ' fop-disabled"><input type="hidden" name="aufgabePropertyDropdown2Value" value="' . htmlentities($hidden['aufgabePropertyDropdown2Value']); }
		?>">
		<div style='display: flex; flex-direction: row; align-items: center; width: 100%;'><span style="width: 100%; max-width: 300px;" value='' select-updater='{"property": form[&apos;type&apos;]}' endpoint='Tables/AufgabePropertyDropdown/renderEditform_wf_aufgabeProperty_create_aufgabePropertyDropdown2Value' condition=''><?php
	\Tables\AufgabePropertyDropdown::renderEditform_wf_aufgabeProperty_create_aufgabePropertyDropdown2ValueAction($data['aufgabePropertyDropdown2Value'], ['property' => $data['type']], '');
?></span> &nbsp;	<?php if (\TablesRouter\AufgabePropertyDropdown::createAccess()) { ?>  <a tabindex='-1' class='unimportant button' href="#" onclick='var p = $(this).parent(), id = "x"+Math.round(1000000*Math.random()); p.attr("id", id); window.open_over(<?php
		echo json_encode(\TablesRouter\AufgabePropertyDropdown::createURL2([
			'popup' => true]
		)); ?> + "&from=<?php echo urlencode(\FOP\Util::getCurrentBaseurl()); ?>jscloser.php?action=popup%26type=aufgabePropertyDropdown2%26colinsert=aufgabePropertyDropdown2Value%26el=" + encodeURIComponent(id) + "%26close%26insert_param=colvalue&column_property=" + encodeURIComponent($(this).scope().$eval("form[\&apos;type\&apos;]")) + "", "_blank", "width=739, height=395"); return false;'><i class="material-icons">add</i></a> <?php } ?> &nbsp;	<a tabindex='-1' class='unimportant button fop-ddt-search' href="#" onclick='var p = $(this).parent(), id = "x"+Math.round(1000000*Math.random()); p.attr("id", id); window.open_over(<?php
		echo json_encode(\TablesRouter\AufgabePropertyDropdown::indexURL2([
			'popup' => true]
		)); ?> + "&from=<?php echo urlencode(\FOP\Util::getCurrentBaseurl()); ?>jscloser.php?action=popup%26type=aufgabePropertyDropdown2%26colinsert=aufgabePropertyDropdown2Value%26el=" + encodeURIComponent(id) + "%26insert_param=colvalue&select=aufgabePropertyDropdown2&deps_aufgabePropertyDropdown_property=" + encodeURIComponent($(this).scope().$eval("form[\&apos;type\&apos;]")) + "", "_blank", "width=739, height=395"); return false;'><i class="material-icons">search</i></a>
	</div>
	</div>
	</div><?php } ?><?php
										\EasyEditor\FormFeature::pop();
										$features['main']['html'] = ob_get_contents();
										ob_end_clean();
									}
									

									uasort($features, function ($a, $b) {
										return strnatcmp($a['order'], $b['order']);
									});
									foreach ($features AS $feature) {
										\EasyEditor\FormFeature::render($feature);
									}
									?><script type='text/javascript'>
										$(function(){
											// bei Änderungen: prüfen, ob Form geändert wurde
											var formData = $('#cardform-wf_aufgabeProperty_create').serialize();
											document.body.onbeforeunload = function () {
												if (formData != $('#cardform-wf_aufgabeProperty_create').serialize()) {
													return 'Form data has changed - are you sure??';
												}
											};
											$('#cardform-wf_aufgabeProperty_create').on('submit', function () {
												document.body.onbeforeunload = undefined;
											});
											<?php if ($upbar_collapsed) {
												?>$('#fop-bar-mainbutton').click();<?php
											} ?>
											$('#fop-bar-mainbutton').click(function () {
												setTimeout(function () {
													setCFF('upbar', 'collapsed', $('#fop-bar-container').is(':visible') ? 0 : 1);
												}, 440); /* perfect timing for fadeOut */
											});
										});
										
										function setCFF(id, key, value) {
											<?php if(!\FOP\User::getIsGuest()) { ?>
											$.get('FOP/Index/setCFF?form=wf%3AaufgabeProperty%3Acreate&subid=' + encodeURIComponent(id) + '&key=' + encodeURIComponent(key) + '&value=' + encodeURIComponent(value)).then(function () {
												if (key == 'reset') {
													location.reload();
												}
											});
											<?php } /* EditAccess */ ?>
										}
										function setCFFOrder(fids) {
											<?php if(!\FOP\User::getIsGuest()) { ?>
											$.get('FOP/Index/setCFFOrder?form=wf%3AaufgabeProperty%3Acreate&fids=' + encodeURIComponent(JSON.stringify(fids)));
											<?php } /* EditAccess */ ?>
										}
										$(function () {
											refreshTabHeaders($('#cardform-wf_aufgabeProperty_create')); /* provided in js/form.js */
											// preselection
											if (location.hash.startsWith('#select:')) {
												$('[name="' + window.location.hash.slice(8) + '"]').focus().select();
											} else {
												$('#cardform-wf_aufgabeProperty_create input[type!="hidden"],textarea,select[tabindex!="-1"]').not('.fop-disabled *').filter(':visible:first').focus().select();
											}
										});

										$(window).keydown(function(event) {
											 if (event.ctrlKey && String.fromCharCode(event.which).toLowerCase() == 's') {
												 event.preventDefault();
												 $('button[type=submit]').click();
												 return false;
											 }
										});

										
										$(document).on('keyup',function(evt) {
										   if (evt.keyCode == 27) {
												if (window.parent) {
													window.close(); // iframe:close
												} else {
													window.history.back();
												}
											}
												});
										
									</script>

							</form>
							

							</div>
							<div class="content" id="focus-supersearch">
							</div>
							<div class="content" id="~spacer"><?php if (!isset($_GET['popup'])) { ?><div style="padding-bottom: 10cm;"></div><?php } ?>
							</div>
						<?php if (!isset($_GET['popup'])) { ?>
					</div>
				</main>
				
			</div>
		<?php } else { ?></div><?php } ?>
<?php if (!isset($_GET['popup'])) { ?><div class='fop-seal'></div><?php } ?></body></html><?php
    // --- BLOCK: main-6 ---
    }
    
  }

  public static function editAction($id = null ) { 
    
    
    // --- BLOCK: 0_CSRFValidate ---
    
	if ($_SERVER['REQUEST_METHOD'] === 'POST') \FOP\Session::validateCSRFToken(); else \FOP\Session::getCSRFToken();

    // --- BLOCK: 0_CSRF_ensure ---
    
	\FOP\Session::getCSRFToken();
    // --- BLOCK: access ---
    if(!((!\FOP\User::getIsGuest()))) throw new \FOP\AccessDeniedException();
    // --- BLOCK: access+validators ---
    
	if ($_SERVER['REQUEST_METHOD'] === 'POST') {
		
		/* Validatoren */
		
		if ((!isset($_POST['cancel']))) \Types\AufgabePropertyDropdown2::validate($_POST['aufgabePropertyDropdown2Value']);
		if ((!isset($_POST['cancel']))) \Types\Aufgabe::validate($_POST['parent']);
		if ((!isset($_POST['cancel']))) \Types\AufgabePropertyType::validate($_POST['type']);

		
		/* Sanitizer */

		$_POST['dateValue'] = \FOP\Sanitizers::convert_date_to_unix_timestamp($_POST['dateValue']);
		$_POST['doubleValue'] = \Types\Double::parse($_POST['doubleValue']);
		$_POST['htmlValue'] = \FOP\Sanitizers::htmlentities_decode($_POST['htmlValue']);
		if ((!isset($_POST['cancel']))) $_POST['aufgabePropertyDropdown2Value'] = \FOP\Sanitizers::null_filter($_POST['aufgabePropertyDropdown2Value']);
		if ((!isset($_POST['cancel']))) $_POST['parent'] = \FOP\Sanitizers::null_filter($_POST['parent']);
		if ((!isset($_POST['cancel']))) $_POST['type'] = \FOP\Sanitizers::null_filter($_POST['type']);

		
	}
	
    // --- BLOCK: access-item-aufgabeProperty-edit ---
    
		if ($id !== null && \FOP\Database::query('SELECT '.(\FOP\User::getIsGuest() ? 'false' : 'true').' FROM '.qi('aufgabeProperty').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($id))->fetchColumn() != 1) {
			throw new \FOP\AccessDeniedException();
		}
	
    // --- BLOCK: main ---
    
		// Main block
	
    // --- BLOCK: main-1 ---
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
		if (!isset($_POST['cancel'])) {
			\FOP\Database::beginTransaction();
    // --- BLOCK: main-2:save-clone-prepare ---
    
		$data = self::view($id);
	
    // --- BLOCK: main-2:save-main ---
    
		$data_edit = [];
		$data_edit['textValue'] = $_POST['textValue'];
		$data_edit['dateValue'] = $_POST['dateValue'];
		$data_edit['doubleValue'] = $_POST['doubleValue'];
		$data_edit['htmlValue'] = $_POST['htmlValue'];
		if ((!isset($_POST['cancel']))) $data_edit['aufgabePropertyDropdown2Value'] = $_POST['aufgabePropertyDropdown2Value'];
		if ((!isset($_POST['cancel']))) $data_edit['parent'] = $_POST['parent'];
		if ((!isset($_POST['cancel']))) $data_edit['type'] = $_POST['type'];
		self::edit($id, $data_edit);
		if (isset($data_edit['ID'])) {
			$id = $data_edit['ID'];
		}
	
    // --- BLOCK: main-3 ---
    
			\FOP\Database::commitTransaction();
			
		}
		
		if (isset($_POST['cancel'])) {
			
			if (isset($_POST['fop-from']) && $_POST['fop-from']) {
				// Redirect zu fop-from
				header('Location: ' . preg_replace('/&insert_param=(.*)$/', '&$1=' . ($id instanceof \FOP\IDList ? $id->toString() : $id), $_POST['fop-from']));
			} else {
				header('Location: ' . \TablesRouter\AufgabeProperty::viewURL2(['id' => $id, 'popup' => $_GET['popup'] ?? null]));
			}
			die();
	
		}
		if (isset($_POST['save'])) {
			
			if (isset($_POST['fop-from']) && $_POST['fop-from']) {
				// Redirect zu fop-from
				header('Location: ' . preg_replace('/&insert_param=(.*)$/', '&$1=' . ($id instanceof \FOP\IDList ? $id->toString() : $id), $_POST['fop-from']));
			} else {
				header('Location: ' . \TablesRouter\AufgabeProperty::viewURL2(['id' => $id, 'popup' => $_GET['popup'] ?? null]));
			}
			die();
	
		}
		die(json_encode($_POST));
	} else {
    // --- BLOCK: main-4:load-main ---
    
		$data = self::view($id); // TODO: klären, wer die Funktion bereitstellt (momentan crud/view.fop)
	
    // --- BLOCK: main-5 ---
    ?><?php
			header('Content-Type: text/html; charset=UTF-8');
			header('X-XSS-Protection: 1; mode=block');
			header('Strict-Transport-Security: max-age=63072000');
			header('X-Content-Type-Options: nosniff');
			header("Content-Security-Policy: default-src *  data: blob: 'unsafe-inline' 'unsafe-eval'; script-src * 'unsafe-inline' 'unsafe-eval'; connect-src * 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src *; style-src * data: blob: 'unsafe-inline'; font-src * data: blob: 'unsafe-inline';");


		?><!DOCTYPE html><html><head><title><?php echo(sprintf(_('edit %s'), _('Eigenschaft'))); ?></title><base href='<?php echo \FOP\Util::getCurrentBaseurl(); ?>'><meta name="google" content="notranslate"><meta http-equiv="Content-Language" content="<?php echo htmlentities(\FOP\I18n::getLocale()); ?>"><meta charset="utf-8"><link rel="stylesheet" type="text/css" href="style_dependencies.css?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"><link rel="stylesheet" type="text/css" href="style.css?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"><script type="text/javascript" src="js/script_dependencies.js?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"></script><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="mobile-web-app-capable" content="yes"><link rel="manifest" href="manifest.webmanifest"><script type="text/javascript">moment.locale('<?php echo(\FOP\I18n::getShortLocale()); ?>');</script><script type="text/javascript" src="js/form.js"></script><script type="text/javascript">window.globals = <?php
	echo json_encode(['user:superadmin' => /* TODO: resanitizer später mal */(integer) \FOP\User::getSuperadmin(), 'user:mitglied' => /* TODO: resanitizer später mal */(integer) \FOP\User::getMitglied(), 'user:gruppe' => /* TODO: resanitizer später mal */(integer) \FOP\User::getGruppe(), 'user:campaign' => /* TODO: resanitizer später mal */(integer) \FOP\User::getCampaign(), 'user:sammlung' => /* TODO: resanitizer später mal */(integer) \FOP\User::getSammlung(), 'user:protokoll' => /* TODO: resanitizer später mal */(integer) \FOP\User::getProtokoll(), 'user:ID' => /* TODO: resanitizer später mal */(integer) \FOP\User::getID(), 'user:buchhaltung' => /* TODO: resanitizer später mal */(integer) \FOP\User::getBuchhaltung()]);
?>;</script><script type="text/javascript" src="angular/<?php echo(\FOP\I18n::getShortLocale()); ?>/js/alltypes.js?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"></script><script type="text/javascript" src="angular/angular-i18n/angular-locale_<?php echo \FOP\I18n::getAngularLocale(); ?>.js"></script><script type="text/javascript" src="js/date-filter.js"></script><script type="text/javascript" src="js/dropdown.js"></script><script type="text/javascript" src="js/numeric.js"></script><script type="text/javascript" src="js/getparam.js"></script><script type="text/javascript" src="js/tables.js"></script>
		<script type="text/javascript" src="js/parsehash.js"></script><script type="text/javascript">
		window.query = <?php echo json_encode($_GET, JSON_FORCE_OBJECT); ?>;
		window.baseurl = <?php echo json_encode(\FOP\Util::getCurrentBaseurl()); ?>;

		window.i18n_weiter = <?php echo json_encode(_('Weiter'));?>;
		//Filter I18n:
		window.i18n_quartal = <?php echo json_encode(_('Quarter'));?>;
		window.i18n_alle = <?php echo json_encode(_('All'));?>;
		window.i18n_leere = <?php echo json_encode(_('Empty'));?>;
		window.i18n_tag = <?php echo json_encode(_('Tag'));?>;
		window.i18n_woche = <?php echo json_encode(_('Woche'));?>;
		window.i18n_zeitraum = <?php echo json_encode(_('Period'));?>;
		window.i18n_monat = <?php echo json_encode(_('Monat'));?>;
		window.i18n_jahr = <?php echo json_encode(_('Jahr'));?>;
		window.i18n_von = <?php echo json_encode(_('filters_from'));?>;
		window.i18n_bis = <?php echo json_encode(_('filters_to'));?>;
		window.i18n_tabButton = <?php echo json_encode(_('open_in_new_tab'));?>;
		window.i18n_closeButton = <?php echo json_encode(_('close'));?>;
		</script></head><script type="text/javascript">const fopPushPublicKey = '<?php echo(addslashes(\FOP\Configuration::getFOPPushPublicKey())); ?>';
        const fopUserID = <?php echo(intval(\FOP\User::getID())); ?>;
        var fopPushDisabled = false;
    </script><script type="text/javascript" src="js/serviceworkersetup.js"></script><body ng-app='app'>
		<div class='mdl-js-snackbar mdl-snackbar' id='snackbar'>
			<div class='mdl-snackbar__text'></div>
			<button class='mdl-snackbar__action' type='button'></button>
		</div>
		<script>
			var snackbar = document.querySelector('#snackbar');
			componentHandler.upgradeElement(snackbar, 'MaterialSnackbar');
			$(function () {
				setTimeout(function () {
					$('.fop-layout').scrollTop(0);
				}, 0);
			});
		</script>

		<?php if (isset($_GET['popup'])) { ?>
		<header class="fop-header mdl-layout__header mdl-layout__header mdl-layout__header--scroll">
				<div class="mdl-layout__header-row">
					<span class="mdl-layout-title"><?php echo(sprintf(_('edit %s'), _('Eigenschaft'))); ?></span><div class="mdl-layout-spacer"></div><span class="noprint mdl-layout-title mdl-layout--large-screen-only"><div class="mdl-textfield mdl-js-textfield"><input id="supersearch" accesskey="f" class="mdl-textfield__input" type="text" onkeydown="if (event.keyCode == 13 && this.value) window.location.href = 'FOP/Index/searchURL?q=' + encodeURIComponent(this.value) + '&from=<?php echo htmlentities(urlencode(\FOP\Util::getBackUrl())); ?>';" value="<?php echo htmlentities($_GET['q'] ?? ''); ?>" style="border-bottom: 1px solid white;"/><label class="mdl-textfield__label" style="color: inherit"><?php echo(_('search')); ?> - <?php
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
			// MAC: Control+ davor
			echo 'Control + ';
		}
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) {
			// Firefox
			if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
				// MAC: Control + Alt + key
				echo 'Alt + F';
			} else {
				echo 'Alt + Shift + F';
			}
		} else {
			// Internet Explorer, Chrome, Safari, Opera
			echo 'Alt + F';
		}
	?></label></div></span><i onclick='addFav(null)' class='material-icons fop-favorites' id='favorites_button'>star_border</i>
				</div>
      	</header>
			<style>
				.content {
					margin-top: 0px !important;
				}
			</style>
			<div id='content' class='popup' >
		<?php } else { ?>
			<div class="fop-layout mdl-layout mdl-js-layout mdl-layout--fixed-drawer mdl-layout--fixed-header">
			<header class="fop-header mdl-layout__header mdl-layout__header mdl-layout__header--scroll">
				<div class="mdl-layout__header-row">
					<span class="mdl-layout-title"><?php echo(sprintf(_('edit %s'), _('Eigenschaft'))); ?></span><div class="mdl-layout-spacer"></div><span class="noprint mdl-layout-title mdl-layout--large-screen-only"><div class="mdl-textfield mdl-js-textfield"><input id="supersearch" accesskey="f" class="mdl-textfield__input" type="text" onkeydown="if (event.keyCode == 13 && this.value) window.location.href = 'FOP/Index/searchURL?q=' + encodeURIComponent(this.value) + '&from=<?php echo htmlentities(urlencode(\FOP\Util::getBackUrl())); ?>';" value="<?php echo htmlentities($_GET['q'] ?? ''); ?>" style="border-bottom: 1px solid white;"/><label class="mdl-textfield__label" style="color: inherit"><?php echo(_('search')); ?> - <?php
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
			// MAC: Control+ davor
			echo 'Control + ';
		}
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) {
			// Firefox
			if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
				// MAC: Control + Alt + key
				echo 'Alt + F';
			} else {
				echo 'Alt + Shift + F';
			}
		} else {
			// Internet Explorer, Chrome, Safari, Opera
			echo 'Alt + F';
		}
	?></label></div></span><i onclick='addFav(null)' class='material-icons fop-favorites' id='favorites_button'>star_border</i>
				</div>
      		</header>


				<?php  \EasyEditor\Navigation::render(); ?>
      
				<main class="mdl-layout__content" id="content">
					<div class="fop-content">
						<?php } ?>
						
							<div class="content" id="1">
								

								<form
									
									action="<?php echo \TablesRouter\AufgabeProperty::editURL2(['popup' => $_GET['popup'] ?? null, 'id' => $id]); ?>"
									method="post"
									enctype="multipart/form-data" ng-submit='submit($event)'
									onsubmit="
										if (window.running_uploads) {
											event.preventDefault();
											alert('<?php echo htmlentities(json_encode(_('fileUploadStillActive')));?>');
										}
									"
								 
								id="cardform-wf_aufgabeProperty_edit"
								style="width: 100%; height: 100%;"
								class='mdl-grid'
									ng-controller="FormWf_aufgabeProperty_edit" ng-init="form = <?php echo htmlentities(json_encode(['type' => $data['type']]));
									?>;"
								>
								<?php
								 echo '<input type="hidden" name="csrftoken" value="' . htmlentities(\FOP\Session::getCSRFToken()) . '">';
								 if (isset($_GET['from'])) echo '<input type="hidden" name="fop-from" value="' . htmlentities($_GET['from']) . '">';
								 ?>
								<div id='fop-upbar'></div>
								
									<?php
									$features = [];
									if (true && (true)) {
									$feature = [
										'id' => 'buttons',
										'title' => _('Aktionen'),
										'order' => '300', // 300 (50)
										'mode' => 'area', // 
										'position' => 'full', // 
										'collapsed' => 0, // 
										'canEdit' => !\FOP\User::getIsGuest(),
										'visibility' => null
									];
									$features[$feature['id']] = $feature;
									}
									
									if (true && (false || true || true || true || true || (!isset($_POST['cancel'])) || (!isset($_POST['cancel'])) || (!isset($_POST['cancel'])))) {
									$feature = [
										'id' => 'main',
										'title' => _('Daten'),
										'order' => '100', // 100 (20)
										'mode' => 'area', // 
										'position' => 'full', // 
										'collapsed' => 0, // 
										'canEdit' => !\FOP\User::getIsGuest(),
										'visibility' => '0' .'||'. (true ? '((\'text\') == (form[\'DesVaCQB\']))' : '0')
											 .'||'. (true ? '((\'date\') == (form[\'qlmkLYxD\']))' : '0')
											 .'||'. (true ? '((\'double\') == (form[\'W8Efbkfa\']))' : '0')
											 .'||'. (true ? '((\'html\') == (form[\'GIuNXQJJ\']))' : '0')
											 .'||'. ((!isset($_POST['cancel'])) ? '((\'aufgabePropertyDropdown2\') == (form[\'zxF57KrA\']))' : '0')
											 .'||'. ((!isset($_POST['cancel'])) ? 'true' : '0')
											 .'||'. ((!isset($_POST['cancel'])) ? 'true' : '0')
											
									];
									$features[$feature['id']] = $feature;
									}
									

									
									/* load order from database
										schema: fop_form_feature(user, form, subid, key, value)
										key = (order, mode, position, collapsed)
									*/
									$upbar_collapsed = false;
									// default values
									foreach (\FOP\Database::query('SELECT subid, '.qi('key').', (SELECT '.qi('value').' FROM fop_form_feature b WHERE a.subid = b.subid AND a.'.qi('key').' = b.'.qi('key').' AND '.qi('user').' = '.intval(\FOP\User::getID()).' GROUP BY '.qi('value').' ORDER BY COUNT(*) DESC LIMIT 1) AS '.qi('value').' FROM fop_form_feature a WHERE '.qi('user').' = '.intval(\FOP\User::getID()).' GROUP BY subid, '.qi('key'))->fetchAll(\PDO::FETCH_ASSOC) AS $setting) {
										if (isset($features[$setting['subid']])) {
											$features[$setting['subid']][$setting['key']] = $setting['value'];
										}
									}
									// form specific special values
									foreach (\FOP\Database::query('SELECT subid, '.qi('key').', '.qi('value').' FROM fop_form_feature a WHERE form = \'wf:aufgabeProperty:edit\' AND '.qi('user').' = '.intval(\FOP\User::getID()).'')->fetchAll(\PDO::FETCH_ASSOC) AS $setting) {
										if (isset($features[$setting['subid']])) {
											$features[$setting['subid']][$setting['key']] = $setting['value'];
										} else if ($setting['subid'] == 'upbar' && $setting['key'] == 'collapsed') {
											$upbar_collapsed = (bool) $setting['value'];
										}
									}

									/* fill in the content of the features */
									if (true && (true)) {
										ob_start();
										\EasyEditor\FormFeature::push($features['buttons']);
										?><div id='wf_aufgabeProperty_edit_buttons' class='mdl-cell mdl-cell--12-col' style='flex-wrap: wrap;'><?php if (true) { ?><button onclick="
		var errors = $(this).closest('form').find('.fop-form-error:visible, .is-invalid').filter((i, x) => $(x).parents('.novalidate').length ? false : true);
		if (errors.length) {
			event.preventDefault();
			alert(errors.closest('.fop-form-content').prev('.fop-form-label').text() + ' Es sind noch Fehler im Formular bei Feld');
			return;
		} /* TODO: i18n */
		
	" type="submit" name="save" class="mdl-button mdl-js-button mdl-button--colored mdl-button--raised" ><i class="material-icons">save</i><?php echo(_('save')); ?></button><?php } ?>
									&nbsp;<?php if (true) { ?><button onclick="$(this).closest('form').find('.mdl-textfield__error:visible').hide();
		$('[required]').removeAttr('required');
	" type="submit" name="cancel" class="mdl-button mdl-js-button mdl-button--colored mdl-button--raised" ><i class="material-icons">cancel</i><?php echo(_('cancel')); ?></button><?php } ?>
									</div><script type='text/javascript'>
		// copy all buttons to #fop-upbar
		$(function () {
    var btn = document.getElementById("fop-bar-mainbutton");
    var upbar = $('#fop-upbar');
    var upbar_buttons = document.getElementById("fop-bar-container");

    // Check if the elements already exist
    if (!btn || !upbar_buttons) {
        if (!btn) {
            btn = $('<div id="fop-bar-mainbutton" class="mdl-button fop-button-half fop-button-margin mdl-button--raised"><i class="material-icons">keyboard_arrow_right</i></div>')
                .click(function () {
                    if (btn.find('i').text() == 'keyboard_arrow_right') {
                        upbar_buttons.fadeOut(400);
                        btn.find('i').text('keyboard_arrow_left');
                    } else {
                        upbar_buttons.fadeIn(400);
                        btn.find('i').text('keyboard_arrow_right');
                    }
                });
            upbar.append(btn);
        }

        if (!upbar_buttons) {
            upbar_buttons = $('<div id="fop-bar-container" style="max-width: 290px"></div>'); //dependant on the mdl-buttons width, caps of upbar buttons at exactly 4 buttons
            upbar.append(upbar_buttons);
        }

        var buttons = $('#wf_aufgabeProperty_edit_buttons').find('.mdl-button');
        buttons.each(function (i, v) {
            var button = $(v);
            var newbutton = $('<div></div>');
            newbutton.attr('class', button.attr('class'));
            newbutton.attr('title', button.attr('title'));
            newbutton.append(button.find('.material-icons').clone(false));
            newbutton.click(function () {
                button[0].click();
            });
            upbar_buttons.append(newbutton);
        });
    }
});

	</script><?php
										\EasyEditor\FormFeature::pop();
										$features['buttons']['html'] = ob_get_contents();
										ob_end_clean();
									}
									
									if (true && (false || true || true || true || true || (!isset($_POST['cancel'])) || (!isset($_POST['cancel'])) || (!isset($_POST['cancel'])))) {
										ob_start();
										\EasyEditor\FormFeature::push($features['main']);
										?><?php if ((!isset($_POST['cancel']))) { ?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_parent" id="column_parent">
		<!-- Feld "Aufgabe": parent -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="parent"><?php echo(_('Aufgabe')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div style='display: flex; flex-direction: row; align-items: center; width: 100%;'><?php
	\Tables\Aufgabe::renderEditform_wf_aufgabeProperty_edit_parentAction($data['parent'], [], '');
?> &nbsp;	<?php if (\TablesRouter\Aufgabe::createAccess()) { ?>  <a tabindex='-1' class='unimportant button' href="#" onclick='var p = $(this).parent(), id = "x"+Math.round(1000000*Math.random()); p.attr("id", id); window.open_over(<?php
		echo json_encode(\TablesRouter\Aufgabe::createURL2([
			'popup' => true]
		)); ?> + "&from=<?php echo urlencode(\FOP\Util::getCurrentBaseurl()); ?>jscloser.php?action=popup%26type=aufgabe%26colinsert=parent%26el=" + encodeURIComponent(id) + "%26close%26insert_param=colvalue", "_blank", "width=739, height=395"); return false;'><i class="material-icons">add</i></a> <?php } ?> &nbsp;	<a tabindex='-1' class='unimportant button fop-ddt-search' href="#" onclick='var p = $(this).parent(), id = "x"+Math.round(1000000*Math.random()); p.attr("id", id); window.open_over(<?php
		echo json_encode(\TablesRouter\Aufgabe::indexURL2([
			'popup' => true]
		)); ?> + "&from=<?php echo urlencode(\FOP\Util::getCurrentBaseurl()); ?>jscloser.php?action=popup%26type=aufgabe%26colinsert=parent%26el=" + encodeURIComponent(id) + "%26insert_param=colvalue&select=aufgabe", "_blank", "width=739, height=395"); return false;'><i class="material-icons">search</i></a>
	</div>
	</div>
	</div><?php } ?><?php if ((!isset($_POST['cancel']))) { ?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_type" id="column_type">
		<!-- Feld "Eigenschaft": type -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="type"><?php echo(_('Eigenschaft')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div style='display: flex; flex-direction: row; align-items: center; width: 100%;'><?php
	\Tables\AufgabePropertyType::renderEditform_wf_aufgabeProperty_edit_typeAction($data['type'], [], '');
?> &nbsp;	<?php if (\TablesRouter\AufgabePropertyType::createAccess()) { ?>  <a tabindex='-1' class='unimportant button' href="#" onclick='var p = $(this).parent(), id = "x"+Math.round(1000000*Math.random()); p.attr("id", id); window.open_over(<?php
		echo json_encode(\TablesRouter\AufgabePropertyType::createURL2([
			'popup' => true]
		)); ?> + "&from=<?php echo urlencode(\FOP\Util::getCurrentBaseurl()); ?>jscloser.php?action=popup%26ng=<?php echo urlencode('form[\'type\']'); ?>%26type=aufgabePropertyType%26colinsert=type%26el=" + encodeURIComponent(id) + "%26close%26insert_param=colvalue", "_blank", "width=739, height=395"); return false;'><i class="material-icons">add</i></a> <?php } ?> &nbsp;	<a tabindex='-1' class='unimportant button fop-ddt-search' href="#" onclick='var p = $(this).parent(), id = "x"+Math.round(1000000*Math.random()); p.attr("id", id); window.open_over(<?php
		echo json_encode(\TablesRouter\AufgabePropertyType::indexURL2([
			'popup' => true]
		)); ?> + "&from=<?php echo urlencode(\FOP\Util::getCurrentBaseurl()); ?>jscloser.php?action=popup%26ng=<?php echo urlencode('form[\'type\']'); ?>%26type=aufgabePropertyType%26colinsert=type%26el=" + encodeURIComponent(id) + "%26insert_param=colvalue&select=aufgabePropertyType", "_blank", "width=739, height=395"); return false;'><i class="material-icons">search</i></a>
	</div>
	</div>
	</div><?php } ?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_textValue" id="column_textValue" ng-show='(&apos;text&apos;) == (form[&apos;DesVaCQB&apos;])'>
		<!-- Feld "Text": textValue -->
	<div ng-show='(&apos;text&apos;) == (form[&apos;DesVaCQB&apos;])'	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="textValue"><?php echo(_('Text')); ?>: </label>
	</div>
	<div ng-show='(&apos;text&apos;) == (form[&apos;DesVaCQB&apos;])'	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="textValue"  value="<?php echo htmlentities($data['textValue']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_dateValue" id="column_dateValue" ng-show='(&apos;date&apos;) == (form[&apos;qlmkLYxD&apos;])'>
		<!-- Feld "Datum": dateValue -->
	<div ng-show='(&apos;date&apos;) == (form[&apos;qlmkLYxD&apos;])'	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="dateValue"><?php echo(_('Datum')); ?>: </label>
	</div>
	<div ng-show='(&apos;date&apos;) == (form[&apos;qlmkLYxD&apos;])'	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	" ts-locale='<?php echo (\FOP\I18n::getShortLocale()); ?>' ts-format='<?php echo (_('dateformat_moment')); ?>' class="mdl-textfield__input picker_date" id="dateValue" type="text" name="dateValue" value="<?php echo ($data['dateValue']) ? strftime(_('dateformat_php2'), intval($data['dateValue'])) : ''; ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_doubleValue" id="column_doubleValue" ng-show='(&apos;double&apos;) == (form[&apos;W8Efbkfa&apos;])'>
		<!-- Feld "Zahl": doubleValue -->
	<div ng-show='(&apos;double&apos;) == (form[&apos;W8Efbkfa&apos;])'	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="doubleValue"><?php echo(_('Zahl')); ?>: </label>
	</div>
	<div ng-show='(&apos;double&apos;) == (form[&apos;W8Efbkfa&apos;])'	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield fop-numeric">
		<input onfocus='this.select()' style='text-align: right;' type='text' pattern='<?php echo htmlentities(\Types\Double::pattern()); ?>' class="mdl-textfield__input" name="doubleValue"  value="<?php echo \Types\Double::print($data['doubleValue']); ?>" fop-numeric='-1' fop-numeric-decimal='<?php echo htmlentities(\Types\Double::decimalSeparator()); ?>' fop-numeric-thousands='<?php echo htmlentities(\Types\Double::thousandsSeparator()); ?>' /><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	<script type='text/javascript'>$(function () {bindNumericFields(); });</script>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_htmlValue" id="column_htmlValue" ng-show='(&apos;html&apos;) == (form[&apos;GIuNXQJJ&apos;])'>
		<!-- Feld "Großer Text": htmlValue -->
	<div ng-show='(&apos;html&apos;) == (form[&apos;GIuNXQJJ&apos;])'	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="htmlValue"><?php echo(_('Großer Text')); ?>: </label>
	</div>
	<div ng-show='(&apos;html&apos;) == (form[&apos;GIuNXQJJ&apos;])'	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<div tinymce-locale="<?php echo \FOP\I18n::getShortLocale(); ?>">
	
	<textarea ng-non-bindable rows="22" cols="50" name="htmlValue" class="html-html"><?php echo htmlentities($data['htmlValue']); ?></textarea>
	</div>
	</div>
	</div><?php if ((!isset($_POST['cancel']))) { ?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_aufgabePropertyDropdown2Value" id="column_aufgabePropertyDropdown2Value" ng-show='(&apos;aufgabePropertyDropdown2&apos;) == (form[&apos;zxF57KrA&apos;])'>
		<!-- Feld "Auswahl": aufgabePropertyDropdown2Value -->
	<div ng-show='(&apos;aufgabePropertyDropdown2&apos;) == (form[&apos;zxF57KrA&apos;])'	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="aufgabePropertyDropdown2Value"><?php echo(_('Auswahl')); ?>: </label>
	</div>
	<div ng-show='(&apos;aufgabePropertyDropdown2&apos;) == (form[&apos;zxF57KrA&apos;])'	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div style='display: flex; flex-direction: row; align-items: center; width: 100%;'><span style="width: 100%; max-width: 300px;" value='' select-updater='{"property": form[&apos;type&apos;]}' endpoint='Tables/AufgabePropertyDropdown/renderEditform_wf_aufgabeProperty_edit_aufgabePropertyDropdown2Value' condition=''><?php
	\Tables\AufgabePropertyDropdown::renderEditform_wf_aufgabeProperty_edit_aufgabePropertyDropdown2ValueAction($data['aufgabePropertyDropdown2Value'], ['property' => $data['type']], '');
?></span> &nbsp;	<?php if (\TablesRouter\AufgabePropertyDropdown::createAccess()) { ?>  <a tabindex='-1' class='unimportant button' href="#" onclick='var p = $(this).parent(), id = "x"+Math.round(1000000*Math.random()); p.attr("id", id); window.open_over(<?php
		echo json_encode(\TablesRouter\AufgabePropertyDropdown::createURL2([
			'popup' => true]
		)); ?> + "&from=<?php echo urlencode(\FOP\Util::getCurrentBaseurl()); ?>jscloser.php?action=popup%26type=aufgabePropertyDropdown2%26colinsert=aufgabePropertyDropdown2Value%26el=" + encodeURIComponent(id) + "%26close%26insert_param=colvalue&column_property=" + encodeURIComponent($(this).scope().$eval("form[\&apos;type\&apos;]")) + "", "_blank", "width=739, height=395"); return false;'><i class="material-icons">add</i></a> <?php } ?> &nbsp;	<a tabindex='-1' class='unimportant button fop-ddt-search' href="#" onclick='var p = $(this).parent(), id = "x"+Math.round(1000000*Math.random()); p.attr("id", id); window.open_over(<?php
		echo json_encode(\TablesRouter\AufgabePropertyDropdown::indexURL2([
			'popup' => true]
		)); ?> + "&from=<?php echo urlencode(\FOP\Util::getCurrentBaseurl()); ?>jscloser.php?action=popup%26type=aufgabePropertyDropdown2%26colinsert=aufgabePropertyDropdown2Value%26el=" + encodeURIComponent(id) + "%26insert_param=colvalue&select=aufgabePropertyDropdown2&deps_aufgabePropertyDropdown_property=" + encodeURIComponent($(this).scope().$eval("form[\&apos;type\&apos;]")) + "", "_blank", "width=739, height=395"); return false;'><i class="material-icons">search</i></a>
	</div>
	</div>
	</div><?php } ?><?php
										\EasyEditor\FormFeature::pop();
										$features['main']['html'] = ob_get_contents();
										ob_end_clean();
									}
									

									uasort($features, function ($a, $b) {
										return strnatcmp($a['order'], $b['order']);
									});
									foreach ($features AS $feature) {
										\EasyEditor\FormFeature::render($feature);
									}
									?><script type='text/javascript'>
										$(function(){
											// bei Änderungen: prüfen, ob Form geändert wurde
											var formData = $('#cardform-wf_aufgabeProperty_edit').serialize();
											document.body.onbeforeunload = function () {
												if (formData != $('#cardform-wf_aufgabeProperty_edit').serialize()) {
													return 'Form data has changed - are you sure??';
												}
											};
											$('#cardform-wf_aufgabeProperty_edit').on('submit', function () {
												document.body.onbeforeunload = undefined;
											});
											<?php if ($upbar_collapsed) {
												?>$('#fop-bar-mainbutton').click();<?php
											} ?>
											$('#fop-bar-mainbutton').click(function () {
												setTimeout(function () {
													setCFF('upbar', 'collapsed', $('#fop-bar-container').is(':visible') ? 0 : 1);
												}, 440); /* perfect timing for fadeOut */
											});
										});
										
										function setCFF(id, key, value) {
											<?php if(!\FOP\User::getIsGuest()) { ?>
											$.get('FOP/Index/setCFF?form=wf%3AaufgabeProperty%3Aedit&subid=' + encodeURIComponent(id) + '&key=' + encodeURIComponent(key) + '&value=' + encodeURIComponent(value)).then(function () {
												if (key == 'reset') {
													location.reload();
												}
											});
											<?php } /* EditAccess */ ?>
										}
										function setCFFOrder(fids) {
											<?php if(!\FOP\User::getIsGuest()) { ?>
											$.get('FOP/Index/setCFFOrder?form=wf%3AaufgabeProperty%3Aedit&fids=' + encodeURIComponent(JSON.stringify(fids)));
											<?php } /* EditAccess */ ?>
										}
										$(function () {
											refreshTabHeaders($('#cardform-wf_aufgabeProperty_edit')); /* provided in js/form.js */
											// preselection
											if (location.hash.startsWith('#select:')) {
												$('[name="' + window.location.hash.slice(8) + '"]').focus().select();
											} else {
												$('#cardform-wf_aufgabeProperty_edit input[type!="hidden"],textarea,select[tabindex!="-1"]').not('.fop-disabled *').filter(':visible:first').focus().select();
											}
										});

										$(window).keydown(function(event) {
											 if (event.ctrlKey && String.fromCharCode(event.which).toLowerCase() == 's') {
												 event.preventDefault();
												 $('button[type=submit]').click();
												 return false;
											 }
										});

										
										$(document).on('keyup',function(evt) {
										   if (evt.keyCode == 27) {
												if (window.parent) {
													window.close(); // iframe:close
												} else {
													window.history.back();
												}
											}
												});
										
									</script>

							</form>
							

							</div>
							<div class="content" id="focus-supersearch">
							</div>
							<div class="content" id="~spacer"><?php if (!isset($_GET['popup'])) { ?><div style="padding-bottom: 10cm;"></div><?php } ?>
							</div>
						<?php if (!isset($_GET['popup'])) { ?>
					</div>
				</main>
				
			</div>
		<?php } else { ?></div><?php } ?>
<?php if (!isset($_GET['popup'])) { ?><div class='fop-seal'></div><?php } ?></body></html><?php
    // --- BLOCK: main-6 ---
    }
    
  }

  public static function viewAction($id = null ) { 
    
    
    // --- BLOCK: 0_CSRFValidate ---
    
	if ($_SERVER['REQUEST_METHOD'] === 'POST') \FOP\Session::validateCSRFToken(); else \FOP\Session::getCSRFToken();

    // --- BLOCK: 0_CSRF_ensure ---
    
	\FOP\Session::getCSRFToken();
    // --- BLOCK: access ---
    if(!(!\FOP\User::getIsGuest())) throw new \FOP\AccessDeniedException();
    // --- BLOCK: access+validators ---
    
	if ($_SERVER['REQUEST_METHOD'] === 'POST') {
		
		/* Validatoren */
		
		

		
		/* Sanitizer */

		

		
	}
	
    // --- BLOCK: fetch ---
    
	\FOP\I18n::ensureIsLoaded();
	$row = self::view($id);

    // --- BLOCK: main ---
    
		// Main block
	
    // --- BLOCK: main-1 ---
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
		if (!isset($_POST['ok'])) {
			\FOP\Database::beginTransaction();
    // --- BLOCK: main-2:save-clone-prepare ---
    
		$data = self::view($id);
	
    // --- BLOCK: main-2:save-main ---
    /* view */
    // --- BLOCK: main-3 ---
    
			\FOP\Database::commitTransaction();
			
		}
		
		if (isset($_POST['ok'])) {
			
			
			if (isset($_POST['fop-from']) && $_POST['fop-from']) {
				// Redirect zu fop-from
				header('Location: ' . (isset($id) && is_string($id) ? preg_replace('/&insert_param=(.*)$/', '&$1=' . ($id instanceof \FOP\IDList ? $id->toString() : $id), $_POST['fop-from']) : $_POST['fop-from']));
			} else {
				if ($to = (isset($_GET['popup']) ? \FOP\Util::getCurrentBaseurl().'jscloser.php?action=popup' : \FOP\Session::getPayload('dv-aufgabeProperty')['from'] ?? null)) {
					header('Location: ' . $to);
					die();
				}
				if (!\TablesRouter\AufgabeProperty::indexAccess()) {
					if (!\FOPRouter\Index::indexAccess()) {
						header('Location: ' . \FOPRouter\Index::indexURL2(['popup' => $_GET['popup'] ?? null]));
						die();
					}
					header('Location: ' . \FOPRouter\Index::indexURL2(['popup' => $_GET['popup'] ?? null]));
					die();
				}
				header('Location: ' . \TablesRouter\AufgabeProperty::indexURL2(['popup' => $_GET['popup'] ?? null]));
			}
			die();
	
		}
		die(json_encode($_POST));
	} else {
    // --- BLOCK: main-4:load-main ---
    
		$data = self::view($id); // TODO: klären, wer die Funktion bereitstellt (momentan crud/view.fop)
	
    // --- BLOCK: main-5 ---
    ?><?php
			header('Content-Type: text/html; charset=UTF-8');
			header('X-XSS-Protection: 1; mode=block');
			header('Strict-Transport-Security: max-age=63072000');
			header('X-Content-Type-Options: nosniff');
			header("Content-Security-Policy: default-src *  data: blob: 'unsafe-inline' 'unsafe-eval'; script-src * 'unsafe-inline' 'unsafe-eval'; connect-src * 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src *; style-src * data: blob: 'unsafe-inline'; font-src * data: blob: 'unsafe-inline';");


		?><!DOCTYPE html><html><head><title><?php echo(_('view')); ?></title><base href='<?php echo \FOP\Util::getCurrentBaseurl(); ?>'><meta name="google" content="notranslate"><meta http-equiv="Content-Language" content="<?php echo htmlentities(\FOP\I18n::getLocale()); ?>"><meta charset="utf-8"><link rel="stylesheet" type="text/css" href="style_dependencies.css?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"><link rel="stylesheet" type="text/css" href="style.css?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"><script type="text/javascript" src="js/script_dependencies.js?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"></script><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="mobile-web-app-capable" content="yes"><link rel="manifest" href="manifest.webmanifest"><script type="text/javascript">moment.locale('<?php echo(\FOP\I18n::getShortLocale()); ?>');</script><script type="text/javascript" src="js/form.js"></script><script type="text/javascript">window.globals = <?php
	echo json_encode(['user:superadmin' => /* TODO: resanitizer später mal */(integer) \FOP\User::getSuperadmin(), 'user:mitglied' => /* TODO: resanitizer später mal */(integer) \FOP\User::getMitglied(), 'user:gruppe' => /* TODO: resanitizer später mal */(integer) \FOP\User::getGruppe(), 'user:campaign' => /* TODO: resanitizer später mal */(integer) \FOP\User::getCampaign(), 'user:sammlung' => /* TODO: resanitizer später mal */(integer) \FOP\User::getSammlung(), 'user:protokoll' => /* TODO: resanitizer später mal */(integer) \FOP\User::getProtokoll(), 'user:ID' => /* TODO: resanitizer später mal */(integer) \FOP\User::getID(), 'user:buchhaltung' => /* TODO: resanitizer später mal */(integer) \FOP\User::getBuchhaltung()]);
?>;</script><script type="text/javascript" src="angular/<?php echo(\FOP\I18n::getShortLocale()); ?>/js/alltypes.js?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"></script><script type="text/javascript" src="angular/angular-i18n/angular-locale_<?php echo \FOP\I18n::getAngularLocale(); ?>.js"></script><script type="text/javascript" src="js/date-filter.js"></script><script type="text/javascript" src="js/dropdown.js"></script><script type="text/javascript" src="js/numeric.js"></script><script type="text/javascript" src="js/getparam.js"></script><script type="text/javascript" src="js/tables.js"></script>
		<script type="text/javascript" src="js/parsehash.js"></script><script type="text/javascript">
		window.query = <?php echo json_encode($_GET, JSON_FORCE_OBJECT); ?>;
		window.baseurl = <?php echo json_encode(\FOP\Util::getCurrentBaseurl()); ?>;

		window.i18n_weiter = <?php echo json_encode(_('Weiter'));?>;
		//Filter I18n:
		window.i18n_quartal = <?php echo json_encode(_('Quarter'));?>;
		window.i18n_alle = <?php echo json_encode(_('All'));?>;
		window.i18n_leere = <?php echo json_encode(_('Empty'));?>;
		window.i18n_tag = <?php echo json_encode(_('Tag'));?>;
		window.i18n_woche = <?php echo json_encode(_('Woche'));?>;
		window.i18n_zeitraum = <?php echo json_encode(_('Period'));?>;
		window.i18n_monat = <?php echo json_encode(_('Monat'));?>;
		window.i18n_jahr = <?php echo json_encode(_('Jahr'));?>;
		window.i18n_von = <?php echo json_encode(_('filters_from'));?>;
		window.i18n_bis = <?php echo json_encode(_('filters_to'));?>;
		window.i18n_tabButton = <?php echo json_encode(_('open_in_new_tab'));?>;
		window.i18n_closeButton = <?php echo json_encode(_('close'));?>;
		</script></head><script type="text/javascript">const fopPushPublicKey = '<?php echo(addslashes(\FOP\Configuration::getFOPPushPublicKey())); ?>';
        const fopUserID = <?php echo(intval(\FOP\User::getID())); ?>;
        var fopPushDisabled = false;
    </script><script type="text/javascript" src="js/serviceworkersetup.js"></script><body ng-app='app'>
		<div class='mdl-js-snackbar mdl-snackbar' id='snackbar'>
			<div class='mdl-snackbar__text'></div>
			<button class='mdl-snackbar__action' type='button'></button>
		</div>
		<script>
			var snackbar = document.querySelector('#snackbar');
			componentHandler.upgradeElement(snackbar, 'MaterialSnackbar');
			$(function () {
				setTimeout(function () {
					$('.fop-layout').scrollTop(0);
				}, 0);
			});
		</script>

		<?php if (isset($_GET['popup'])) { ?>
		<header class="fop-header mdl-layout__header mdl-layout__header mdl-layout__header--scroll">
				<div class="mdl-layout__header-row">
					<?php
	if ($dv = \FOP\Session::getPayload('dv-aufgabeProperty')) { ?>
	<?php if (isset($dv['prev'])) {?><a href="<?php echo htmlentities(str_replace('XXX', urlencode($id), $dv['prev'])); ?>" class="mdl-button mdl-js-button mdl-button--icon">
		<i class="material-icons">keyboard_arrow_left</i>
	</a><?php } ?>
	<a href="<?php echo htmlentities($dv['from']); ?>" class="mdl-button mdl-js-button mdl-button--icon">
		<i class="material-icons">view_list</i>
	</a>
	<?php if (isset($dv['next'])) {?><a href="<?php echo htmlentities(str_replace('XXX', urlencode($id), $dv['next'])); ?>" class="mdl-button mdl-js-button mdl-button--icon">
		<i class="material-icons">keyboard_arrow_right</i>
	</a><?php } ?><?php } ?><span class="mdl-layout-title"><?php echo(_('view')); ?></span><div class="mdl-layout-spacer"></div><span class="noprint mdl-layout-title mdl-layout--large-screen-only"><div class="mdl-textfield mdl-js-textfield"><input id="supersearch" accesskey="f" class="mdl-textfield__input" type="text" onkeydown="if (event.keyCode == 13 && this.value) window.location.href = 'FOP/Index/searchURL?q=' + encodeURIComponent(this.value) + '&from=<?php echo htmlentities(urlencode(\FOP\Util::getBackUrl())); ?>';" value="<?php echo htmlentities($_GET['q'] ?? ''); ?>" style="border-bottom: 1px solid white;"/><label class="mdl-textfield__label" style="color: inherit"><?php echo(_('search')); ?> - <?php
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
			// MAC: Control+ davor
			echo 'Control + ';
		}
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) {
			// Firefox
			if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
				// MAC: Control + Alt + key
				echo 'Alt + F';
			} else {
				echo 'Alt + Shift + F';
			}
		} else {
			// Internet Explorer, Chrome, Safari, Opera
			echo 'Alt + F';
		}
	?></label></div></span><i onclick='addFav(null)' class='material-icons fop-favorites' id='favorites_button'>star_border</i>
				</div>
      	</header>
			<style>
				.content {
					margin-top: 0px !important;
				}
			</style>
			<div id='content' class='popup' >
		<?php } else { ?>
			<div class="fop-layout mdl-layout mdl-js-layout mdl-layout--fixed-drawer mdl-layout--fixed-header">
			<header class="fop-header mdl-layout__header mdl-layout__header mdl-layout__header--scroll">
				<div class="mdl-layout__header-row">
					<?php
	if ($dv = \FOP\Session::getPayload('dv-aufgabeProperty')) { ?>
	<?php if (isset($dv['prev'])) {?><a href="<?php echo htmlentities(str_replace('XXX', urlencode($id), $dv['prev'])); ?>" class="mdl-button mdl-js-button mdl-button--icon">
		<i class="material-icons">keyboard_arrow_left</i>
	</a><?php } ?>
	<a href="<?php echo htmlentities($dv['from']); ?>" class="mdl-button mdl-js-button mdl-button--icon">
		<i class="material-icons">view_list</i>
	</a>
	<?php if (isset($dv['next'])) {?><a href="<?php echo htmlentities(str_replace('XXX', urlencode($id), $dv['next'])); ?>" class="mdl-button mdl-js-button mdl-button--icon">
		<i class="material-icons">keyboard_arrow_right</i>
	</a><?php } ?><?php } ?><span class="mdl-layout-title"><?php echo(_('view')); ?></span><div class="mdl-layout-spacer"></div><span class="noprint mdl-layout-title mdl-layout--large-screen-only"><div class="mdl-textfield mdl-js-textfield"><input id="supersearch" accesskey="f" class="mdl-textfield__input" type="text" onkeydown="if (event.keyCode == 13 && this.value) window.location.href = 'FOP/Index/searchURL?q=' + encodeURIComponent(this.value) + '&from=<?php echo htmlentities(urlencode(\FOP\Util::getBackUrl())); ?>';" value="<?php echo htmlentities($_GET['q'] ?? ''); ?>" style="border-bottom: 1px solid white;"/><label class="mdl-textfield__label" style="color: inherit"><?php echo(_('search')); ?> - <?php
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
			// MAC: Control+ davor
			echo 'Control + ';
		}
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) {
			// Firefox
			if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
				// MAC: Control + Alt + key
				echo 'Alt + F';
			} else {
				echo 'Alt + Shift + F';
			}
		} else {
			// Internet Explorer, Chrome, Safari, Opera
			echo 'Alt + F';
		}
	?></label></div></span><i onclick='addFav(null)' class='material-icons fop-favorites' id='favorites_button'>star_border</i>
				</div>
      		</header>


				<?php  \EasyEditor\Navigation::render(); ?>
      
				<main class="mdl-layout__content" id="content">
					<div class="fop-content">
						<?php } ?>
						
							<div class="content" id="1">
								

								<form
									
									action="<?php echo \TablesRouter\AufgabeProperty::viewURL2(['popup' => $_GET['popup'] ?? null, 'id' => $id]); ?>"
									method="post"
									enctype="multipart/form-data" ng-submit='submit($event)'
									onsubmit="
										if (window.running_uploads) {
											event.preventDefault();
											alert('<?php echo htmlentities(json_encode(_('fileUploadStillActive')));?>');
										}
									"
								 
								id="cardform-wf_aufgabeProperty_view"
								style="width: 100%; height: 100%;"
								class='mdl-grid'
									ng-controller="FormWf_aufgabeProperty_view" ng-init="form = <?php echo htmlentities(json_encode(['type' => $data['type']]));
									?>;"
								>
								<?php
								 echo '<input type="hidden" name="csrftoken" value="' . htmlentities(\FOP\Session::getCSRFToken()) . '">';
								 if (isset($_GET['from'])) echo '<input type="hidden" name="fop-from" value="' . htmlentities($_GET['from']) . '">';
								 ?>
								<div id='fop-upbar'></div>
								
									<?php
									$features = [];
									if (true && (true)) {
									$feature = [
										'id' => 'buttons',
										'title' => _('Aktionen'),
										'order' => '300', // 300 (50)
										'mode' => 'area', // 
										'position' => 'full', // 
										'collapsed' => 0, // 
										'canEdit' => !\FOP\User::getIsGuest(),
										'visibility' => null
									];
									$features[$feature['id']] = $feature;
									}
									
									if (true && (false || true || true || true || true || true || true || true)) {
									$feature = [
										'id' => 'main',
										'title' => _('Daten'),
										'order' => '100', // 100 (20)
										'mode' => 'area', // 
										'position' => 'full', // 
										'collapsed' => 0, // 
										'canEdit' => !\FOP\User::getIsGuest(),
										'visibility' => '0' .'||'. (true ? '((\'double\') == (form[\'W8Efbkfa\']))' : '0')
											 .'||'. (true ? '((\'html\') == (form[\'GIuNXQJJ\']))' : '0')
											 .'||'. (true ? '((\'text\') == (form[\'DesVaCQB\']))' : '0')
											 .'||'. (true ? '((\'date\') == (form[\'qlmkLYxD\']))' : '0')
											 .'||'. (true ? '((\'aufgabePropertyDropdown2\') == (form[\'zxF57KrA\']))' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											
									];
									$features[$feature['id']] = $feature;
									}
									

									
									/* load order from database
										schema: fop_form_feature(user, form, subid, key, value)
										key = (order, mode, position, collapsed)
									*/
									$upbar_collapsed = false;
									// default values
									foreach (\FOP\Database::query('SELECT subid, '.qi('key').', (SELECT '.qi('value').' FROM fop_form_feature b WHERE a.subid = b.subid AND a.'.qi('key').' = b.'.qi('key').' AND '.qi('user').' = '.intval(\FOP\User::getID()).' GROUP BY '.qi('value').' ORDER BY COUNT(*) DESC LIMIT 1) AS '.qi('value').' FROM fop_form_feature a WHERE '.qi('user').' = '.intval(\FOP\User::getID()).' GROUP BY subid, '.qi('key'))->fetchAll(\PDO::FETCH_ASSOC) AS $setting) {
										if (isset($features[$setting['subid']])) {
											$features[$setting['subid']][$setting['key']] = $setting['value'];
										}
									}
									// form specific special values
									foreach (\FOP\Database::query('SELECT subid, '.qi('key').', '.qi('value').' FROM fop_form_feature a WHERE form = \'wf:aufgabeProperty:view\' AND '.qi('user').' = '.intval(\FOP\User::getID()).'')->fetchAll(\PDO::FETCH_ASSOC) AS $setting) {
										if (isset($features[$setting['subid']])) {
											$features[$setting['subid']][$setting['key']] = $setting['value'];
										} else if ($setting['subid'] == 'upbar' && $setting['key'] == 'collapsed') {
											$upbar_collapsed = (bool) $setting['value'];
										}
									}

									/* fill in the content of the features */
									if (true && (true)) {
										ob_start();
										\EasyEditor\FormFeature::push($features['buttons']);
										?><div id='wf_aufgabeProperty_view_buttons' class='mdl-cell mdl-cell--12-col' style='flex-wrap: wrap;'>
		<?php if (true && $data['operation::view'] == 1 && $data['operation::edit'] == 1 && (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?><a title="<?php echo(_('editbtn')); ?>" class="detailbtn mdl-button mdl-js-button mdl-button--raised mdl-button--colored" href="<?php echo htmlentities(\TablesRouter\AufgabeProperty::editURL2(['id' => $data['ID'], 'popup' => $_GET['popup'] ?? null])); ?>"><i class='material-icons'>mode_edit</i> <?php echo(_('editbtn')); ?></a><?php } ?>&nbsp;<?php if (true) { ?><button onclick="$(this).closest('form').find('.mdl-textfield__error:visible').hide();
		$('[required]').removeAttr('required');
	" type="submit" name="ok" class="mdl-button mdl-js-button mdl-button--colored mdl-button--raised" ><i class="material-icons">check</i><?php echo(_('ok')); ?></button><?php } ?>
									&nbsp;
		<?php if ($data['operation::delete'] == 1 && $data['operation::delete'] == 1 && (!\FOP\User::getIsGuest())) { ?><a title="<?php echo(_('deletebtn')); ?>" class="detailbtn mdl-button mdl-js-button mdl-button--raised mdl-button--colored" href="<?php echo htmlentities(\TablesRouter\AufgabeProperty::deleteConfirmURL2(['id' => $data['ID'], 'popup' => $_GET['popup'] ?? null, 'from' => $_GET['from'] ?? \FOP\Session::getPayload('dv-aufgabeProperty')['from'] ?? null])); ?>"><i class='material-icons'>delete</i> <?php echo(_('deletebtn')); ?></a><?php } ?></div><script type='text/javascript'>
		// copy all buttons to #fop-upbar
		$(function () {
    var btn = document.getElementById("fop-bar-mainbutton");
    var upbar = $('#fop-upbar');
    var upbar_buttons = document.getElementById("fop-bar-container");

    // Check if the elements already exist
    if (!btn || !upbar_buttons) {
        if (!btn) {
            btn = $('<div id="fop-bar-mainbutton" class="mdl-button fop-button-half fop-button-margin mdl-button--raised"><i class="material-icons">keyboard_arrow_right</i></div>')
                .click(function () {
                    if (btn.find('i').text() == 'keyboard_arrow_right') {
                        upbar_buttons.fadeOut(400);
                        btn.find('i').text('keyboard_arrow_left');
                    } else {
                        upbar_buttons.fadeIn(400);
                        btn.find('i').text('keyboard_arrow_right');
                    }
                });
            upbar.append(btn);
        }

        if (!upbar_buttons) {
            upbar_buttons = $('<div id="fop-bar-container" style="max-width: 290px"></div>'); //dependant on the mdl-buttons width, caps of upbar buttons at exactly 4 buttons
            upbar.append(upbar_buttons);
        }

        var buttons = $('#wf_aufgabeProperty_view_buttons').find('.mdl-button');
        buttons.each(function (i, v) {
            var button = $(v);
            var newbutton = $('<div></div>');
            newbutton.attr('class', button.attr('class'));
            newbutton.attr('title', button.attr('title'));
            newbutton.append(button.find('.material-icons').clone(false));
            newbutton.click(function () {
                button[0].click();
            });
            upbar_buttons.append(newbutton);
        });
    }
});

	</script><?php
										\EasyEditor\FormFeature::pop();
										$features['buttons']['html'] = ob_get_contents();
										ob_end_clean();
									}
									
									if (true && (false || true || true || true || true || true || true || true)) {
										ob_start();
										\EasyEditor\FormFeature::push($features['main']);
										?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_parent" id="column_parent">
		<!-- Feld "Aufgabe": parent -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="parent"><?php echo(_('Aufgabe')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<?php
	
	$sql = 'SELECT '.qi('ID').' AS '.qi('ID').', CONCAT(\'#\', '.qi('aufgabe').'.'.qi('ID').', \': \', '.qi('aufgabe').'.'.qi('title').') AS description, ('.(\FOP\User::getIsGuest() ? 'false' : 'true').') AS '.qi('canView').' FROM '.qi('aufgabe').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($data['parent']);
	$aufgabe_result = \FOP\Database::query($sql);
	if ($aufgabe_row = $aufgabe_result->fetch(\PDO::FETCH_ASSOC)) {
		if ($aufgabe_row['canView']) echo "<a onclick=\"event.preventDefault(); open_url(this.href, false);\" href=\"" . \TablesRouter\Aufgabe::viewURL($data['parent'], ['from' => \FOP\Util::getBackURL()]) . "\" class=\"tbl-link\" data-tbl=\"aufgabe\" data-id=\"".htmlentities($aufgabe_row['ID'])."\">";echo htmlentities($aufgabe_row['description']);if ($aufgabe_row['canView']) echo "</a>";
	} else {
		echo htmlentities(_('') ?: '-');
	}
	
?>

	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_type" id="column_type">
		<!-- Feld "Eigenschaft": type -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="type"><?php echo(_('Eigenschaft')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<?php
	
	$sql = 'SELECT '.qi('ID').' AS '.qi('ID').', '.qi('aufgabePropertyType').'.'.qi('name').' AS description, ('.(\FOP\User::getIsGuest() ? 'false' : 'true').') AS '.qi('canView').' FROM '.qi('aufgabePropertyType').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($data['type']);
	$aufgabePropertyType_result = \FOP\Database::query($sql);
	if ($aufgabePropertyType_row = $aufgabePropertyType_result->fetch(\PDO::FETCH_ASSOC)) {
		if ($aufgabePropertyType_row['canView']) echo "<a onclick=\"event.preventDefault(); open_url(this.href, false);\" href=\"" . \TablesRouter\AufgabePropertyType::viewURL($data['type'], ['from' => \FOP\Util::getBackURL()]) . "\" class=\"tbl-link\" data-tbl=\"aufgabePropertyType\" data-id=\"".htmlentities($aufgabePropertyType_row['ID'])."\">";echo htmlentities($aufgabePropertyType_row['description']);if ($aufgabePropertyType_row['canView']) echo "</a>";
	} else {
		echo htmlentities(_('') ?: '-');
	}
	
?>

	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_textValue" id="column_textValue" ng-show='(&apos;text&apos;) == (form[&apos;DesVaCQB&apos;])'>
		<!-- Feld "Text": textValue -->
	<div ng-show='(&apos;text&apos;) == (form[&apos;DesVaCQB&apos;])'	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="textValue"><?php echo(_('Text')); ?>: </label>
	</div>
	<div ng-show='(&apos;text&apos;) == (form[&apos;DesVaCQB&apos;])'	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<span class='fop-editable' style='width: 100%;<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) && $data['operation::view'] == 1 && $data['operation::edit'] == 1) {?> cursor: pointer;' onclick='
		event.preventDefault();
		event.stopPropagation();
		var cell = $(this).closest(&apos;.mdl-cell&apos;).parent(&apos;.mdl-cell&apos;);
		var div = get_overlay(this, function () {
			// submit the form in overlay
			div.find(&apos;form&apos;).submit();
		});
		$.get(&apos;Tables/AufgabeProperty/textValueEdit?id=&apos; + <?php echo htmlentities($id); ?>).then(function (html) {
			div.html(html);
			var iframe = div.find(&apos;iframe&apos;)[0];
			if (iframe) iframe.onload = function () {
				this.onload = function () {
					div.close();
					if (!window.noreload) location.reload(); // TODO: evtl. Ajax
					window.noreload = false;
				}
			};
			div.find(&apos;input[type=text], input[type=checkbox], textarea&apos;).select().focus().keydown(function (event) {
				if ([13/*, 38, 40*/, 9].includes(event.keyCode)) { // ENTER, up, down, tab
					$(this).closest(&apos;form&apos;).submit();
					event.preventDefault();
					event.stopPropagation();
					if (/*event.keyCode == 40 ||*/ event.keyCode == 9 && !event.shiftKey) {
						var n = cell.next(&apos;.mdl-cell:has(.fop-editable)&apos;).find(&apos;.fop-editable&apos;);
						if (n.length) {
							window.noreload = true;
							n.click();
						}
					}
					if (/*event.keyCode == 38 ||*/ event.keyCode == 9 && event.shiftKey) {
						var n = cell.prev(&apos;.mdl-cell:has(.fop-editable)&apos;).find(&apos;.fop-editable&apos;);
						if (n.length) {
							window.noreload = true;
							n.click();
						}
					}
				}
			});
		});
		div.text(&apos;🗘&apos;);
		return true;'<?php } else { ?>'<?php } ?>>
	<?php echo htmlentities($data['textValue']); ?></span>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_dateValue" id="column_dateValue" ng-show='(&apos;date&apos;) == (form[&apos;qlmkLYxD&apos;])'>
		<!-- Feld "Datum": dateValue -->
	<div ng-show='(&apos;date&apos;) == (form[&apos;qlmkLYxD&apos;])'	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="dateValue"><?php echo(_('Datum')); ?>: </label>
	</div>
	<div ng-show='(&apos;date&apos;) == (form[&apos;qlmkLYxD&apos;])'	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<span class='fop-editable' style='width: 100%;<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) && $data['operation::view'] == 1 && $data['operation::edit'] == 1) {?> cursor: pointer;' onclick='
		event.preventDefault();
		event.stopPropagation();
		var cell = $(this).closest(&apos;.mdl-cell&apos;).parent(&apos;.mdl-cell&apos;);
		var div = get_overlay(this, function () {
			// submit the form in overlay
			div.find(&apos;form&apos;).submit();
		});
		$.get(&apos;Tables/AufgabeProperty/dateValueEdit?id=&apos; + <?php echo htmlentities($id); ?>).then(function (html) {
			div.html(html);
			var iframe = div.find(&apos;iframe&apos;)[0];
			if (iframe) iframe.onload = function () {
				this.onload = function () {
					div.close();
					if (!window.noreload) location.reload(); // TODO: evtl. Ajax
					window.noreload = false;
				}
			};
			div.find(&apos;input[type=text], input[type=checkbox], textarea&apos;).select().focus().keydown(function (event) {
				if ([13/*, 38, 40*/, 9].includes(event.keyCode)) { // ENTER, up, down, tab
					$(this).closest(&apos;form&apos;).submit();
					event.preventDefault();
					event.stopPropagation();
					if (/*event.keyCode == 40 ||*/ event.keyCode == 9 && !event.shiftKey) {
						var n = cell.next(&apos;.mdl-cell:has(.fop-editable)&apos;).find(&apos;.fop-editable&apos;);
						if (n.length) {
							window.noreload = true;
							n.click();
						}
					}
					if (/*event.keyCode == 38 ||*/ event.keyCode == 9 && event.shiftKey) {
						var n = cell.prev(&apos;.mdl-cell:has(.fop-editable)&apos;).find(&apos;.fop-editable&apos;);
						if (n.length) {
							window.noreload = true;
							n.click();
						}
					}
				}
			});
		});
		div.text(&apos;🗘&apos;);
		return true;'<?php } else { ?>'<?php } ?>>
	<?php echo htmlentities(($data['dateValue']) ? strftime(_('dateformat_php2'), intval($data['dateValue'])) : ''); ?></span>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_doubleValue" id="column_doubleValue" ng-show='(&apos;double&apos;) == (form[&apos;W8Efbkfa&apos;])'>
		<!-- Feld "Zahl": doubleValue -->
	<div ng-show='(&apos;double&apos;) == (form[&apos;W8Efbkfa&apos;])'	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="doubleValue"><?php echo(_('Zahl')); ?>: </label>
	</div>
	<div ng-show='(&apos;double&apos;) == (form[&apos;W8Efbkfa&apos;])'	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<span class='fop-editable' style='width: 100%;<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) && $data['operation::view'] == 1 && $data['operation::edit'] == 1) {?> cursor: pointer;' onclick='
		event.preventDefault();
		event.stopPropagation();
		var cell = $(this).closest(&apos;.mdl-cell&apos;).parent(&apos;.mdl-cell&apos;);
		var div = get_overlay(this, function () {
			// submit the form in overlay
			div.find(&apos;form&apos;).submit();
		});
		$.get(&apos;Tables/AufgabeProperty/doubleValueEdit?id=&apos; + <?php echo htmlentities($id); ?>).then(function (html) {
			div.html(html);
			var iframe = div.find(&apos;iframe&apos;)[0];
			if (iframe) iframe.onload = function () {
				this.onload = function () {
					div.close();
					if (!window.noreload) location.reload(); // TODO: evtl. Ajax
					window.noreload = false;
				}
			};
			div.find(&apos;input[type=text], input[type=checkbox], textarea&apos;).select().focus().keydown(function (event) {
				if ([13/*, 38, 40*/, 9].includes(event.keyCode)) { // ENTER, up, down, tab
					$(this).closest(&apos;form&apos;).submit();
					event.preventDefault();
					event.stopPropagation();
					if (/*event.keyCode == 40 ||*/ event.keyCode == 9 && !event.shiftKey) {
						var n = cell.next(&apos;.mdl-cell:has(.fop-editable)&apos;).find(&apos;.fop-editable&apos;);
						if (n.length) {
							window.noreload = true;
							n.click();
						}
					}
					if (/*event.keyCode == 38 ||*/ event.keyCode == 9 && event.shiftKey) {
						var n = cell.prev(&apos;.mdl-cell:has(.fop-editable)&apos;).find(&apos;.fop-editable&apos;);
						if (n.length) {
							window.noreload = true;
							n.click();
						}
					}
				}
			});
		});
		div.text(&apos;🗘&apos;);
		return true;'<?php } else { ?>'<?php } ?>><span style="white-space: nowrap; width: 100%; display: inline-block; "><?php echo htmlentities(\Types\Double::print($data['doubleValue'])); ?>
	</span></span>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_htmlValue" id="column_htmlValue" ng-show='(&apos;html&apos;) == (form[&apos;GIuNXQJJ&apos;])'>
		<!-- Feld "Großer Text": htmlValue -->
	<div ng-show='(&apos;html&apos;) == (form[&apos;GIuNXQJJ&apos;])'	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="htmlValue"><?php echo(_('Großer Text')); ?>: </label>
	</div>
	<div ng-show='(&apos;html&apos;) == (form[&apos;GIuNXQJJ&apos;])'	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<span class='fop-editable' style='width: 100%;<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) && $data['operation::view'] == 1 && $data['operation::edit'] == 1) {?> cursor: pointer;' onclick='
		event.preventDefault();
		event.stopPropagation();
		var cell = $(this).closest(&apos;.mdl-cell&apos;).parent(&apos;.mdl-cell&apos;);
		var div = get_overlay(this, function () {
			// submit the form in overlay
			div.find(&apos;form&apos;).submit();
		});
		$.get(&apos;Tables/AufgabeProperty/htmlValueEdit?id=&apos; + <?php echo htmlentities($id); ?>).then(function (html) {
			div.html(html);
			var iframe = div.find(&apos;iframe&apos;)[0];
			if (iframe) iframe.onload = function () {
				this.onload = function () {
					div.close();
					if (!window.noreload) location.reload(); // TODO: evtl. Ajax
					window.noreload = false;
				}
			};
			div.find(&apos;input[type=text], input[type=checkbox], textarea&apos;).select().focus().keydown(function (event) {
				if ([13/*, 38, 40*/, 9].includes(event.keyCode)) { // ENTER, up, down, tab
					$(this).closest(&apos;form&apos;).submit();
					event.preventDefault();
					event.stopPropagation();
					if (/*event.keyCode == 40 ||*/ event.keyCode == 9 && !event.shiftKey) {
						var n = cell.next(&apos;.mdl-cell:has(.fop-editable)&apos;).find(&apos;.fop-editable&apos;);
						if (n.length) {
							window.noreload = true;
							n.click();
						}
					}
					if (/*event.keyCode == 38 ||*/ event.keyCode == 9 && event.shiftKey) {
						var n = cell.prev(&apos;.mdl-cell:has(.fop-editable)&apos;).find(&apos;.fop-editable&apos;);
						if (n.length) {
							window.noreload = true;
							n.click();
						}
					}
				}
			});
		});
		div.text(&apos;🗘&apos;);
		return true;'<?php } else { ?>'<?php } ?>>
<div ng-non-bindable class='fop-textarea' >
<?php echo \FOP\Util::SanitizeUserHtml($data['htmlValue']); ?>
</div>
</span>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_aufgabePropertyDropdown2Value" id="column_aufgabePropertyDropdown2Value" ng-show='(&apos;aufgabePropertyDropdown2&apos;) == (form[&apos;zxF57KrA&apos;])'>
		<!-- Feld "Auswahl": aufgabePropertyDropdown2Value -->
	<div ng-show='(&apos;aufgabePropertyDropdown2&apos;) == (form[&apos;zxF57KrA&apos;])'	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="aufgabePropertyDropdown2Value"><?php echo(_('Auswahl')); ?>: </label>
	</div>
	<div ng-show='(&apos;aufgabePropertyDropdown2&apos;) == (form[&apos;zxF57KrA&apos;])'	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<span class='fop-editable' style='width: 100%;<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) && $data['operation::view'] == 1 && $data['operation::edit'] == 1) {?> cursor: pointer;' onclick='
		event.preventDefault();
		event.stopPropagation();
		var cell = $(this).closest(&apos;.mdl-cell&apos;).parent(&apos;.mdl-cell&apos;);
		var div = get_overlay(this, function () {
			// submit the form in overlay
			div.find(&apos;form&apos;).submit();
		});
		$.get(&apos;Tables/AufgabeProperty/aufgabePropertyDropdown2ValueEdit?id=&apos; + <?php echo htmlentities($id); ?>).then(function (html) {
			div.html(html);
			var iframe = div.find(&apos;iframe&apos;)[0];
			if (iframe) iframe.onload = function () {
				this.onload = function () {
					div.close();
					if (!window.noreload) location.reload(); // TODO: evtl. Ajax
					window.noreload = false;
				}
			};
			div.find(&apos;input[type=text], input[type=checkbox], textarea&apos;).select().focus().keydown(function (event) {
				if ([13/*, 38, 40*/, 9].includes(event.keyCode)) { // ENTER, up, down, tab
					$(this).closest(&apos;form&apos;).submit();
					event.preventDefault();
					event.stopPropagation();
					if (/*event.keyCode == 40 ||*/ event.keyCode == 9 && !event.shiftKey) {
						var n = cell.next(&apos;.mdl-cell:has(.fop-editable)&apos;).find(&apos;.fop-editable&apos;);
						if (n.length) {
							window.noreload = true;
							n.click();
						}
					}
					if (/*event.keyCode == 38 ||*/ event.keyCode == 9 && event.shiftKey) {
						var n = cell.prev(&apos;.mdl-cell:has(.fop-editable)&apos;).find(&apos;.fop-editable&apos;);
						if (n.length) {
							window.noreload = true;
							n.click();
						}
					}
				}
			});
		});
		div.text(&apos;🗘&apos;);
		return true;'<?php } else { ?>'<?php } ?>><?php
	
	$sql = 'SELECT '.qi('ID').' AS '.qi('ID').', '.qi('aufgabePropertyDropdown').'.'.qi('name').' AS description, ('.(\FOP\User::getIsGuest() ? 'false' : 'true').') AS '.qi('canView').' FROM '.qi('aufgabePropertyDropdown').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($data['aufgabePropertyDropdown2Value']);
	$aufgabePropertyDropdown_result = \FOP\Database::query($sql);
	if ($aufgabePropertyDropdown_row = $aufgabePropertyDropdown_result->fetch(\PDO::FETCH_ASSOC)) {
		if ($aufgabePropertyDropdown_row['canView']) echo "<a onclick=\"event.preventDefault(); open_url(this.href, false);\" href=\"" . \TablesRouter\AufgabePropertyDropdown::viewURL($data['aufgabePropertyDropdown2Value'], ['from' => \FOP\Util::getBackURL()]) . "\" class=\"tbl-link\" data-tbl=\"aufgabePropertyDropdown\" data-id=\"".htmlentities($aufgabePropertyDropdown_row['ID'])."\">";echo htmlentities($aufgabePropertyDropdown_row['description']);if ($aufgabePropertyDropdown_row['canView']) echo "</a>";
	} else {
		echo htmlentities(_('-') ?: '-');
	}
	
?>
</span>
	</div>
	</div><?php
										\EasyEditor\FormFeature::pop();
										$features['main']['html'] = ob_get_contents();
										ob_end_clean();
									}
									

									uasort($features, function ($a, $b) {
										return strnatcmp($a['order'], $b['order']);
									});
									foreach ($features AS $feature) {
										\EasyEditor\FormFeature::render($feature);
									}
									?><script type='text/javascript'>
										function setCFF(id, key, value) {
											<?php if(!\FOP\User::getIsGuest()) { ?>
											$.get('FOP/Index/setCFF?form=wf%3AaufgabeProperty%3Aview&subid=' + encodeURIComponent(id) + '&key=' + encodeURIComponent(key) + '&value=' + encodeURIComponent(value)).then(function () {
												if (key == 'reset') {
													location.reload();
												}
											});
											<?php } /* EditAccess */ ?>
										}
										function setCFFOrder(fids) {
											<?php if(!\FOP\User::getIsGuest()) { ?>
											$.get('FOP/Index/setCFFOrder?form=wf%3AaufgabeProperty%3Aview&fids=' + encodeURIComponent(JSON.stringify(fids)));
											<?php } /* EditAccess */ ?>
										}
										$(function () {
											refreshTabHeaders($('#cardform-wf_aufgabeProperty_view')); /* provided in js/form.js */
											// preselection
											if (location.hash.startsWith('#select:')) {
												$('[name="' + window.location.hash.slice(8) + '"]').focus().select();
											} else {
												$('#cardform-wf_aufgabeProperty_view input[type!="hidden"],textarea,select[tabindex!="-1"]').not('.fop-disabled *').filter(':visible:first').focus().select();
											}
										});

										$(window).keydown(function(event) {
											 if (event.ctrlKey && String.fromCharCode(event.which).toLowerCase() == 's') {
												 event.preventDefault();
												 $('button[type=submit]').click();
												 return false;
											 }
										});

										
										$(document).on('keyup',function(evt) {
										   if (evt.keyCode == 27) {
												if (window.parent) {
													window.close(); // iframe:close
												} else {
													window.history.back();
												}
											}
												});
										
									</script>

							</form>
							

							</div>
							<div class="content" id="focus-supersearch">
							</div>
							<div class="content" id="focus-supersearch">
		<script type='text/javascript'>
			$(function () {
				var focusfield = $('#supersearch');
				if (focusfield.length) {
					focusfield[0].focus();
					focusfield[0].select();
				}
			});
		</script>
	
							</div>
							<div class="content" id="~spacer"><?php if (!isset($_GET['popup'])) { ?><div style="padding-bottom: 10cm;"></div><?php } ?>
							</div>
						<?php if (!isset($_GET['popup'])) { ?>
					</div>
				</main>
				
			</div>
		<?php } else { ?></div><?php } ?>
<?php if (!isset($_GET['popup'])) { ?><div class='fop-seal'></div><?php } ?></body></html><?php
    // --- BLOCK: main-6 ---
    }
    
  }

  public static function textValueEditAction($id) { 
    
    
    // --- BLOCK: access ---
    if(!((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()))) throw new \FOP\AccessDeniedException();
    // --- BLOCK: access-item-aufgabeProperty-edit ---
    
		if (\FOP\Database::query('SELECT '.(\FOP\User::getIsGuest() ? 'false' : 'true').' FROM '.qi('aufgabeProperty').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($id))->fetchColumn() != 1) {
			throw new \FOP\AccessDeniedException();
		}
	
    // --- BLOCK: main ---
    
		// abgespecktes CardForm
		if ($_SERVER['REQUEST_METHOD'] === 'POST') {
			

			

			self::edit($id, ['textValue' => $_POST['value']]);
			echo 'OK';
		} else {
			$frameid = 'temp_'.time();
			$data = self::view($id, false, true);
			?><form style="display: block; margin: 0px; padding: 0px;" method="POST" action="<?php echo \TablesRouter\AufgabeProperty::textValueEditURL($id); ?>" target="<?php echo $frameid; ?>" enctype="multipart/form-data"><div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="value"  value="<?php echo htmlentities($data['textValue']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div></form><iframe name="<?php echo $frameid; ?>" style="display: none;"></iframe><?php
		}
	
    
  }

  public static function dateValueEditAction($id) { 
    
    
    // --- BLOCK: access ---
    if(!((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()))) throw new \FOP\AccessDeniedException();
    // --- BLOCK: access-item-aufgabeProperty-edit ---
    
		if (\FOP\Database::query('SELECT '.(\FOP\User::getIsGuest() ? 'false' : 'true').' FROM '.qi('aufgabeProperty').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($id))->fetchColumn() != 1) {
			throw new \FOP\AccessDeniedException();
		}
	
    // --- BLOCK: main ---
    
		// abgespecktes CardForm
		if ($_SERVER['REQUEST_METHOD'] === 'POST') {
			

			$_POST['value'] = \FOP\Sanitizers::convert_date_to_unix_timestamp($_POST['value']);

			self::edit($id, ['dateValue' => $_POST['value']]);
			echo 'OK';
		} else {
			$frameid = 'temp_'.time();
			$data = self::view($id, false, true);
			?><form style="display: block; margin: 0px; padding: 0px;" method="POST" action="<?php echo \TablesRouter\AufgabeProperty::dateValueEditURL($id); ?>" target="<?php echo $frameid; ?>" enctype="multipart/form-data"><div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	" ts-locale='<?php echo (\FOP\I18n::getShortLocale()); ?>' ts-format='<?php echo (_('dateformat_moment')); ?>' class="mdl-textfield__input picker_date" id="value" type="text" name="value" value="<?php echo ($data['dateValue']) ? strftime(_('dateformat_php2'), intval($data['dateValue'])) : ''; ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div></form><iframe name="<?php echo $frameid; ?>" style="display: none;"></iframe><?php
		}
	
    
  }

  public static function doubleValueEditAction($id) { 
    
    
    // --- BLOCK: access ---
    if(!((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()))) throw new \FOP\AccessDeniedException();
    // --- BLOCK: access-item-aufgabeProperty-edit ---
    
		if (\FOP\Database::query('SELECT '.(\FOP\User::getIsGuest() ? 'false' : 'true').' FROM '.qi('aufgabeProperty').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($id))->fetchColumn() != 1) {
			throw new \FOP\AccessDeniedException();
		}
	
    // --- BLOCK: main ---
    
		// abgespecktes CardForm
		if ($_SERVER['REQUEST_METHOD'] === 'POST') {
			

			$_POST['value'] = \Types\Double::parse($_POST['value']);

			self::edit($id, ['doubleValue' => $_POST['value']]);
			echo 'OK';
		} else {
			$frameid = 'temp_'.time();
			$data = self::view($id, false, true);
			?><form style="display: block; margin: 0px; padding: 0px;" method="POST" action="<?php echo \TablesRouter\AufgabeProperty::doubleValueEditURL($id); ?>" target="<?php echo $frameid; ?>" enctype="multipart/form-data"><div class="mdl-textfield mdl-js-textfield fop-numeric">
		<input onfocus='this.select()' style='text-align: right;' type='text' pattern='<?php echo htmlentities(\Types\Double::pattern()); ?>' class="mdl-textfield__input" name="value"  value="<?php echo \Types\Double::print($data['doubleValue']); ?>" fop-numeric='-1' fop-numeric-decimal='<?php echo htmlentities(\Types\Double::decimalSeparator()); ?>' fop-numeric-thousands='<?php echo htmlentities(\Types\Double::thousandsSeparator()); ?>' /><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	<script type='text/javascript'>$(function () {bindNumericFields(); });</script></form><iframe name="<?php echo $frameid; ?>" style="display: none;"></iframe><?php
		}
	
    
  }

  public static function htmlValueEditAction($id) { 
    
    
    // --- BLOCK: access ---
    if(!((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()))) throw new \FOP\AccessDeniedException();
    // --- BLOCK: access-item-aufgabeProperty-edit ---
    
		if (\FOP\Database::query('SELECT '.(\FOP\User::getIsGuest() ? 'false' : 'true').' FROM '.qi('aufgabeProperty').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($id))->fetchColumn() != 1) {
			throw new \FOP\AccessDeniedException();
		}
	
    // --- BLOCK: main ---
    
		// abgespecktes CardForm
		if ($_SERVER['REQUEST_METHOD'] === 'POST') {
			

			$_POST['value'] = \FOP\Sanitizers::htmlentities_decode($_POST['value']);

			self::edit($id, ['htmlValue' => $_POST['value']]);
			echo 'OK';
		} else {
			$frameid = 'temp_'.time();
			$data = self::view($id, false, true);
			?><form style="display: block; margin: 0px; padding: 0px;" method="POST" action="<?php echo \TablesRouter\AufgabeProperty::htmlValueEditURL($id); ?>" target="<?php echo $frameid; ?>" enctype="multipart/form-data">
	<div tinymce-locale="<?php echo \FOP\I18n::getShortLocale(); ?>">
	
	<textarea ng-non-bindable rows="22" cols="50" name="value" class="html-html"><?php echo htmlentities($data['htmlValue']); ?></textarea>
	</div></form><iframe name="<?php echo $frameid; ?>" style="display: none;"></iframe><?php
		}
	
    
  }

  public static function aufgabePropertyDropdown2ValueEditAction($id) { 
    
    
    // --- BLOCK: access ---
    if(!((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()))) throw new \FOP\AccessDeniedException();
    // --- BLOCK: access-item-aufgabeProperty-edit ---
    
		if (\FOP\Database::query('SELECT '.(\FOP\User::getIsGuest() ? 'false' : 'true').' FROM '.qi('aufgabeProperty').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($id))->fetchColumn() != 1) {
			throw new \FOP\AccessDeniedException();
		}
	
    // --- BLOCK: main ---
    
		// abgespecktes CardForm
		if ($_SERVER['REQUEST_METHOD'] === 'POST') {
			\Types\AufgabePropertyDropdown2::validate($_POST['value']);

			$_POST['value'] = \FOP\Sanitizers::null_filter($_POST['value']);

			self::edit($id, ['aufgabePropertyDropdown2Value' => $_POST['value']]);
			echo 'OK';
		} else {
			$frameid = 'temp_'.time();
			$data = self::view($id, false, true);
			?><form style="display: block; margin: 0px; padding: 0px;" method="POST" action="<?php echo \TablesRouter\AufgabeProperty::aufgabePropertyDropdown2ValueEditURL($id); ?>" target="<?php echo $frameid; ?>" enctype="multipart/form-data"><div style='display: flex; flex-direction: row; align-items: center; width: 100%;'><span style="width: 100%; max-width: 300px;" value='' select-updater='{"property": null}' endpoint='Tables/AufgabePropertyDropdown/renderEditaufgabeProperty_aufgabePropertyDropdown2Value_single' condition=''><?php
	\Tables\AufgabePropertyDropdown::renderEditaufgabeProperty_aufgabePropertyDropdown2Value_singleAction($data['aufgabePropertyDropdown2Value'], ['property' => $data['type']], '');
?></span> &nbsp;	<?php if (\TablesRouter\AufgabePropertyDropdown::createAccess()) { ?>  <a tabindex='-1' class='unimportant button' href="#" onclick='var p = $(this).parent(), id = "x"+Math.round(1000000*Math.random()); p.attr("id", id); window.open_over(<?php
		echo json_encode(\TablesRouter\AufgabePropertyDropdown::createURL2([
			'popup' => true]
		)); ?> + "&from=<?php echo urlencode(\FOP\Util::getCurrentBaseurl()); ?>jscloser.php?action=popup%26type=aufgabePropertyDropdown2%26colinsert=value%26el=" + encodeURIComponent(id) + "%26close%26insert_param=colvalue&column_property=" + encodeURIComponent($(this).scope().$eval("null")) + "", "_blank", "width=739, height=395"); return false;'><i class="material-icons">add</i></a> <?php } ?> &nbsp;	<a tabindex='-1' class='unimportant button fop-ddt-search' href="#" onclick='var p = $(this).parent(), id = "x"+Math.round(1000000*Math.random()); p.attr("id", id); window.open_over(<?php
		echo json_encode(\TablesRouter\AufgabePropertyDropdown::indexURL2([
			'popup' => true]
		)); ?> + "&from=<?php echo urlencode(\FOP\Util::getCurrentBaseurl()); ?>jscloser.php?action=popup%26type=aufgabePropertyDropdown2%26colinsert=value%26el=" + encodeURIComponent(id) + "%26insert_param=colvalue&select=aufgabePropertyDropdown2&deps_aufgabePropertyDropdown_property=" + encodeURIComponent($(this).scope().$eval("null")) + "", "_blank", "width=739, height=395"); return false;'><i class="material-icons">search</i></a>
	</div></form><iframe name="<?php echo $frameid; ?>" style="display: none;"></iframe><?php
		}
	
    
  }

  public static function cloneParent($old_id, $id) { 
    
    
    // --- BLOCK: main ---
    
		$q = \FOP\Database::query('SELECT '.qi('ID').' AS '.qi('ID').' FROM '.qi('aufgabeProperty').' WHERE '.qi('aufgabeProperty').'.'.qi('parent').' = ' . \FOP\Database::quote($old_id));
		while ($oldsubid = $q->fetch(\PDO::FETCH_COLUMN)) {
			\FOP\Database::query('INSERT INTO '.qi('aufgabeProperty').' ('.qi('parent').', '.qi('type').', '.qi('aufgabePropertyDropdown2Value').', '.qi('htmlValue').', '.qi('doubleValue').', '.qi('textValue').', '.qi('dateValue').') SELECT ' . \FOP\Database::quote($id) . ', '.qi('type').', '.qi('aufgabePropertyDropdown2Value').', '.qi('htmlValue').', '.qi('doubleValue').', '.qi('textValue').', '.qi('dateValue').' FROM '.qi('aufgabeProperty').' fop_old_t WHERE fop_old_t.'.qi('ID').' = ' . \FOP\Database::quote($oldsubid));
			$newsubid = \FOP\Database::getLastInsertId();
			(function ($old_id, $id) {
				
			})($oldsubid, $newsubid);
		}
	
    
  }

  public static function delete($id, $disregardPermissions = false ) { 
    
    
    // --- BLOCK: main ---
    
			$sql = 'SELECT ' . ($disregardPermissions ? 1 : ''.(\FOP\User::getIsGuest() ? 'false' : 'true').'') . ' FROM '.qi('aufgabeProperty').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($id);
			if (\FOP\Database::query($sql)->fetchColumn() != 1) {
				return false;
			}
			
			$sql = 'DELETE FROM  '.qi('aufgabeProperty').'  WHERE '.qi('ID').' = ' . \FOP\Database::quote($id);
			$result = \FOP\Database::query($sql);
			
			return true;
	
    
  }

  public static function create($data, $disregardPermissions = false , $updateOnDuplicate = false ) { 
    
    
    // --- BLOCK: main ---
    
				$sql = 'INSERT INTO '.qi('aufgabeProperty').'(';
				
				$set = [];
				
					
					$set[qi('textValue')] = \FOP\Database::quote($data['textValue']);
					
				
					
					$set[qi('dateValue')] = \FOP\Database::quote($data['dateValue']);
					
				
					
					$set[qi('doubleValue')] = \FOP\Database::quote($data['doubleValue']);
					
				
					
					$set[qi('htmlValue')] = \FOP\Database::quote($data['htmlValue']);
					
				
					
					$set[qi('aufgabePropertyDropdown2Value')] = \FOP\Database::quote($data['aufgabePropertyDropdown2Value']);
					
				
					
					$set[qi('parent')] = \FOP\Database::quote($data['parent']);
					
				
					
					$set[qi('type')] = \FOP\Database::quote($data['type']);
					
				
				$id = 0;

				$sql = $sql . implode(', ', array_keys($set)) . ') VALUES (' . implode(', ', array_values($set)) . ')';
				if ($updateOnDuplicate){
					// TODO: Postgres ON CONFLICT(...) DO UPDATE SET ...
					$set2 = [];
					foreach ($set AS $k => $v) {
						array_push($set2, "$k = $v");
					}
					if (\FOP\Database::getDriver() == 'mysql') {
						$sql .= ' ON DUPLICATE KEY UPDATE ' . implode(', ', $set2);
					} else {
						
					}
				}

				try {
					\FOP\Database::query($sql);
					$id = \FOP\Database::getLastInsertId();
				} catch (\PDOException $e) {
					if ($e->errorInfo[1] == 1062) {
						throw new \FOP\AccessDeniedException('duplicateinsert');
					}
                    throw $e; // weiterwerfen
				}
				$data['fop-id'] = $id; // für Hooks
				
				return $id;

    
  }

  public static function view($id, $snippet = false , $ignoreAccess = false ) { 
    
    
    // --- BLOCK: main ---
    
		$sql = 'SELECT /* ID */ '.qi('ID').' AS '.qi('ID').',
									/* ID */ '.qi('aufgabeProperty').'.'.qi('ID').' AS '.qi('ID').',
									/* aufgabePropertyDropdown2Value */ '.qi('aufgabeProperty').'.'.qi('aufgabePropertyDropdown2Value').' AS '.qi('aufgabePropertyDropdown2Value').',
									/* aufgabePropertyDropdown2Value::canView */ (\'aufgabePropertyDropdown2\') = ((SELECT ('.qi('zxF57KrA').'.'.qi('type').') FROM '.qi('aufgabePropertyType').' '.qi('zxF57KrA').' WHERE '.qi('zxF57KrA').'.'.qi('ID').' = '.qi('aufgabeProperty').'.'.qi('type').' LIMIT 1)) AS '.qi('aufgabePropertyDropdown2Value::canView').',
									/* aufgabePropertyDropdown2Value::canView */ '.qi('ref:aufgabePropertyDropdown2Value').'.'.qi('aufgabePropertyDropdown2Value:canView').' AS '.qi('aufgabePropertyDropdown2Value::canView').',
									/* aufgabePropertyDropdown2Value::description */ '.qi('ref:aufgabePropertyDropdown2Value').'.'.qi('aufgabePropertyDropdown2Value:description').' AS '.qi('aufgabePropertyDropdown2Value::description').',
									/* aufgabePropertyDropdown2Value::property */ '.qi('aufgabeProperty').'.'.qi('type').' AS '.qi('aufgabePropertyDropdown2Value::property').',
									/* dateValue */ '.qi('aufgabeProperty').'.'.qi('dateValue').' AS '.qi('dateValue').',
									/* dateValue::canView */ (\'date\') = ((SELECT ('.qi('qlmkLYxD').'.'.qi('type').') FROM '.qi('aufgabePropertyType').' '.qi('qlmkLYxD').' WHERE '.qi('qlmkLYxD').'.'.qi('ID').' = '.qi('aufgabeProperty').'.'.qi('type').' LIMIT 1)) AS '.qi('dateValue::canView').',
									/* doubleValue */ '.qi('aufgabeProperty').'.'.qi('doubleValue').' AS '.qi('doubleValue').',
									/* doubleValue::canView */ (\'double\') = ((SELECT ('.qi('W8Efbkfa').'.'.qi('type').') FROM '.qi('aufgabePropertyType').' '.qi('W8Efbkfa').' WHERE '.qi('W8Efbkfa').'.'.qi('ID').' = '.qi('aufgabeProperty').'.'.qi('type').' LIMIT 1)) AS '.qi('doubleValue::canView').',
									/* htmlValue */ '.qi('aufgabeProperty').'.'.qi('htmlValue').' AS '.qi('htmlValue').',
									/* htmlValue::canView */ (\'html\') = ((SELECT ('.qi('GIuNXQJJ').'.'.qi('type').') FROM '.qi('aufgabePropertyType').' '.qi('GIuNXQJJ').' WHERE '.qi('GIuNXQJJ').'.'.qi('ID').' = '.qi('aufgabeProperty').'.'.qi('type').' LIMIT 1)) AS '.qi('htmlValue::canView').',
									/* operation::create */ '.(\FOP\User::getIsGuest() ? 'false' : 'true').' AS '.qi('operation::create').',
									/* operation::delete */ '.(\FOP\User::getIsGuest() ? 'false' : 'true').' AS '.qi('operation::delete').',
									/* operation::edit */ '.(\FOP\User::getIsGuest() ? 'false' : 'true').' AS '.qi('operation::edit').',
									/* operation::index */ ' . (!\FOP\User::getIsGuest() ? 1 : 0) . ' AS '.qi('operation::index').',
									/* operation::view */ '.(\FOP\User::getIsGuest() ? 'false' : 'true').' AS '.qi('operation::view').',
									/* parent */ '.qi('aufgabeProperty').'.'.qi('parent').' AS '.qi('parent').',
									/* parent::canView */ '.qi('ref:parent').'.'.qi('parent:canView').' AS '.qi('parent::canView').',
									/* parent::description */ '.qi('ref:parent').'.'.qi('parent:description').' AS '.qi('parent::description').',
									/* textValue */ '.qi('aufgabeProperty').'.'.qi('textValue').' AS '.qi('textValue').',
									/* textValue::canView */ (\'text\') = ((SELECT ('.qi('DesVaCQB').'.'.qi('type').') FROM '.qi('aufgabePropertyType').' '.qi('DesVaCQB').' WHERE '.qi('DesVaCQB').'.'.qi('ID').' = '.qi('aufgabeProperty').'.'.qi('type').' LIMIT 1)) AS '.qi('textValue::canView').',
									/* type */ '.qi('aufgabeProperty').'.'.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('aufgabeProperty').' '.qi('aufgabeProperty').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('type:ID').', '.qi('aufgabePropertyType').'.'.qi('name').' AS '.qi('type:description').', ('.(\FOP\User::getIsGuest() ? 'false' : 'true').') AS '.qi('type:canView').' FROM '.qi('aufgabePropertyType').') '.qi('ref:type').' ON '.qi('ref:type').'.'.qi('type:ID').' = '.qi('aufgabeProperty').'.'.qi('type').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('aufgabePropertyDropdown2Value:ID').', '.qi('aufgabePropertyDropdown').'.'.qi('name').' AS '.qi('aufgabePropertyDropdown2Value:description').', ('.(\FOP\User::getIsGuest() ? 'false' : 'true').') AS '.qi('aufgabePropertyDropdown2Value:canView').' FROM '.qi('aufgabePropertyDropdown').') '.qi('ref:aufgabePropertyDropdown2Value').' ON '.qi('ref:aufgabePropertyDropdown2Value').'.'.qi('aufgabePropertyDropdown2Value:ID').' = '.qi('aufgabeProperty').'.'.qi('aufgabePropertyDropdown2Value').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('parent:ID').', CONCAT(\'#\', '.qi('aufgabe').'.'.qi('ID').', \': \', '.qi('aufgabe').'.'.qi('title').') AS '.qi('parent:description').', ('.(\FOP\User::getIsGuest() ? 'false' : 'true').') AS '.qi('parent:canView').' FROM '.qi('aufgabe').') '.qi('ref:parent').' ON '.qi('ref:parent').'.'.qi('parent:ID').' = '.qi('aufgabeProperty').'.'.qi('parent').'
								WHERE ('.qi('ID').' = ' . \FOP\Database::quote($id) . ')';
		$result = \FOP\Database::query($sql);
		if (!$row = $result->fetch(\PDO::FETCH_ASSOC)) {
			throw new \FOP\AccessDeniedException('notfoundread');
		} else if (!$ignoreAccess && !$row['operation::view']) {
			throw new \FOP\AccessDeniedException('accessdeniedread');
		}
		
		$row['dateValue'] = intval($row['dateValue']);
		$row['doubleValue'] = \Types\Double::unpack($row['doubleValue']);
		$row['aufgabePropertyDropdown2Value'] = \FOP\Sanitizers::null_converter($row['aufgabePropertyDropdown2Value']);
		$row['parent'] = \FOP\Sanitizers::null_converter($row['parent']);
		$row['type'] = \FOP\Sanitizers::null_converter($row['type']);
		

		if($snippet){
			$row['textValue'] = ($row['textValue']);
			$row['dateValue'] = (($row['dateValue']) ? strftime(_('dateformat_php2'), intval($row['dateValue'])) : '');
			$row['doubleValue'] = (\Types\Double::print($row['doubleValue'])
	);
			$row['htmlValue'] = (mb_substr(preg_replace('/[ \t\r\n]+/', ' ', strip_tags(preg_replace('/<style.*?\/style>/s', '', html_entity_decode($row['htmlValue'])))), 0, 20) . (strlen($row['htmlValue']) >= 20 ? '...' : ''));
			$row['aufgabePropertyDropdown2Value'] = (
  \FOP\Database::query('SELECT '.qi('aufgabePropertyDropdown').'.'.qi('name').' AS description FROM '.qi('aufgabePropertyDropdown').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($row['aufgabePropertyDropdown2Value']))->fetchColumn() ?: _('-')
);
			$row['parent'] = (
  \FOP\Database::query('SELECT CONCAT(\'#\', '.qi('aufgabe').'.'.qi('ID').', \': \', '.qi('aufgabe').'.'.qi('title').') AS description FROM '.qi('aufgabe').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($row['parent']))->fetchColumn() ?: _('')
);
			$row['type'] = (
  \FOP\Database::query('SELECT '.qi('aufgabePropertyType').'.'.qi('name').' AS description FROM '.qi('aufgabePropertyType').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($row['type']))->fetchColumn() ?: _('')
);
			
		}


		return $row;

    
  }

  public static function sanitizeDefaults(&$data, $sanitizeForForms, $refcol = null , $parentdata = null ) { 
    
    
    // --- BLOCK: main ---
    
		$virginData = self::getDefaults();
		// column: dateValue
		
		// column: doubleValue
		
		// column: htmlValue
		
		// column: parent
			if (!$data['parent']) {
				// replace forbidden NULL values
				$items = \Types\Aufgabe::getItems([], null);
				$best = -INF;
				foreach ($items as $item) /* TODO: InputFieldLoadCondition: if (!$condition || $item[$condition]) */ {
					if ($item['priority'] > $best) {
						$data['parent'] = $item['ID'];
						$best = $item['priority'];
					}
				}
			}
		
		// column: textValue
		
		// column: type
			if (!$data['type']) {
				// replace forbidden NULL values
				$items = \Types\AufgabePropertyType::getItems([], null);
				$best = -INF;
				foreach ($items as $item) /* TODO: InputFieldLoadCondition: if (!$condition || $item[$condition]) */ {
					if ($item['priority'] > $best) {
						$data['type'] = $item['ID'];
						$best = $item['priority'];
					}
				}
			}
		
		// column: aufgabePropertyDropdown2Value
			if (!$data['aufgabePropertyDropdown2Value']) {
				$data['aufgabePropertyDropdown2Value'] = $sanitizeForForms ? '0' : null;
			}
		
		if ($sanitizeForForms) {
			
			$data['dateValue'] = intval($data['dateValue']);
			$data['doubleValue'] = \Types\Double::unpack($data['doubleValue']);
			$data['aufgabePropertyDropdown2Value'] = \FOP\Sanitizers::null_converter($data['aufgabePropertyDropdown2Value']);
			$data['parent'] = \FOP\Sanitizers::null_converter($data['parent']);
			$data['type'] = \FOP\Sanitizers::null_converter($data['type']);
		}
	
    
  }

  public static function edit($id, $data, $ignoreUniqueConstraints = false , $disregardPermissions = false ) { 
    
    
    // --- BLOCK: main ---
    
				
				$set = [];
				
					if ($disregardPermissions || (!\FOP\User::getIsGuest()))
					
					if (array_key_exists('textValue', $data)) {
						array_push($set, qi('textValue').' = ' . \FOP\Database::quote($data['textValue']));
					}
				
					if ($disregardPermissions || (!\FOP\User::getIsGuest()))
					
					if (array_key_exists('dateValue', $data)) {
						array_push($set, qi('dateValue').' = ' . \FOP\Database::quote($data['dateValue']));
					}
				
					if ($disregardPermissions || (!\FOP\User::getIsGuest()))
					
					if (array_key_exists('doubleValue', $data)) {
						array_push($set, qi('doubleValue').' = ' . \FOP\Database::quote($data['doubleValue']));
					}
				
					if ($disregardPermissions || (!\FOP\User::getIsGuest()))
					
					if (array_key_exists('htmlValue', $data)) {
						array_push($set, qi('htmlValue').' = ' . \FOP\Database::quote($data['htmlValue']));
					}
				
					if ($disregardPermissions || (!\FOP\User::getIsGuest()))
					
					if (array_key_exists('aufgabePropertyDropdown2Value', $data)) {
						array_push($set, qi('aufgabePropertyDropdown2Value').' = ' . \FOP\Database::quote($data['aufgabePropertyDropdown2Value']));
					}
				
					
					if (array_key_exists('parent', $data)) {
						array_push($set, qi('parent').' = ' . \FOP\Database::quote($data['parent']));
					}
				
					
					if (array_key_exists('type', $data)) {
						array_push($set, qi('type').' = ' . \FOP\Database::quote($data['type']));
					}
				;
				
				if (count($set)) {
					try {
						\FOP\Database::query('UPDATE '.qi('aufgabeProperty').' SET ' . implode(', ', $set) . ' WHERE '.qi('ID').' = ' . \FOP\Database::quote($id));
						if (isset($data['ID'])) {
							$id = $data['ID'];
						}
					} catch (\PDOException $e) {
						if ($e->errorInfo[1] == 1062) {
							if ($ignoreUniqueConstraints) {
								return false;
							}
							throw new \FOP\AccessDeniedException('duplicateupdate');
						}
						throw $e; // weiterwerfen
					}
				}
				$data['fop-id'] = $id; // für Hooks
				
				return true;

    
  }

  public static function deleteAction($id) { 
    
    
    // --- BLOCK: access ---
    if(!((!\FOP\User::getIsGuest()))) throw new \FOP\AccessDeniedException();
    // --- BLOCK: access-itemlist-aufgabeProperty-delete ---
    
		// ID-Liste neu aufbauen und nur die übrig lassen, die auch erlaubt sind
		$id_ = new \FOP\IDList($id);
		$id = new \FOP\IDList();
		foreach (\FOP\Database::query('SELECT '.qi('ID').' FROM '.qi('aufgabeProperty').' WHERE ('.(\FOP\User::getIsGuest() ? 'false' : 'true').') AND ' . $id_->toSQL(qi('ID')))->fetchAll(\PDO::FETCH_COLUMN) AS $id_sub) {
			$id->push($id_sub);
		}
	
    // --- BLOCK: main ---
    
		\FOP\Database::beginTransaction();
		$ids = new \FOP\IDList($id);
		foreach ($ids->all() AS $id) {
			try {
				$success = self::delete($id);
			} catch (\PDOException $e) {
				if (\FOP\Database::getDriver() == 'mysql' && $e->errorInfo[1] == 1451 /* mysql error code */ || \FOP\Database::getDriver() == 'pgsql' && $e->getCode() == 23503/* psql error code */) {
					// fail due to foreign key constraints (the GUI before should already handle this)
					\FOP\Database::rollbackTransaction();
					if (isset($_GET['ajax'])) {
						header('HTTP/1.0 403 Forbidden');
						die(\TablesRouter\AufgabeProperty::deleteConfirmURL($ids->toString(), ['from' => $_GET['from'] ?? null])); // open delete confirm window when something went wrong
					}
					// TODO: I18n
					header('Location: ' . \TablesRouter\AufgabeProperty::deleteConfirmURL($ids->toString(), ['from' => $_GET['from'] ?? null]) . '#snack:Eine Löschung ist noch nicht möglich'); // open delete confirm window when something went wrong
					die();
				}
				throw $e; // sonst: weiterwerfen
			}
			if (!$success) {
				// fail due to permission
				\FOP\Database::rollbackTransaction();
				if (isset($_GET['ajax'])) {
					header('HTTP/1.0 403 Forbidden');
					die(_('deletiondenied'));
				}
				throw new \FOP\AccessDeniedException('deletiondenied');
			}

			$addition = '#snack:' . _('delete successful');
		}
		\FOP\Database::commitTransaction();

		if (isset($_GET['ajax'])) die('');
		header("Location: " . (isset($_GET['from']) ? $_GET['from'] : \TablesRouter\AufgabeProperty::indexURL()) . $addition);
		die();
	
    
  }

  public static function indexAction() { 
    
    
    // --- BLOCK: access ---
    if(!((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()))) throw new \FOP\AccessDeniedException();
    // --- BLOCK: main ---
    ?><?php
			header('Content-Type: text/html; charset=UTF-8');
			header('X-XSS-Protection: 1; mode=block');
			header('Strict-Transport-Security: max-age=63072000');
			header('X-Content-Type-Options: nosniff');
			header("Content-Security-Policy: default-src *  data: blob: 'unsafe-inline' 'unsafe-eval'; script-src * 'unsafe-inline' 'unsafe-eval'; connect-src * 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src *; style-src * data: blob: 'unsafe-inline'; font-src * data: blob: 'unsafe-inline';");


		?><!DOCTYPE html><html><head><title><?php echo(_('Eigenschaften')); ?></title><base href='<?php echo \FOP\Util::getCurrentBaseurl(); ?>'><meta name="google" content="notranslate"><meta http-equiv="Content-Language" content="<?php echo htmlentities(\FOP\I18n::getLocale()); ?>"><meta charset="utf-8"><link rel="stylesheet" type="text/css" href="style_dependencies.css?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"><link rel="stylesheet" type="text/css" href="style.css?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"><script type="text/javascript" src="js/script_dependencies.js?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"></script><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="mobile-web-app-capable" content="yes"><link rel="manifest" href="manifest.webmanifest"><script type="text/javascript">moment.locale('<?php echo(\FOP\I18n::getShortLocale()); ?>');</script><script type="text/javascript" src="js/form.js"></script><script type="text/javascript">window.globals = <?php
	echo json_encode(['user:superadmin' => /* TODO: resanitizer später mal */(integer) \FOP\User::getSuperadmin(), 'user:mitglied' => /* TODO: resanitizer später mal */(integer) \FOP\User::getMitglied(), 'user:gruppe' => /* TODO: resanitizer später mal */(integer) \FOP\User::getGruppe(), 'user:campaign' => /* TODO: resanitizer später mal */(integer) \FOP\User::getCampaign(), 'user:sammlung' => /* TODO: resanitizer später mal */(integer) \FOP\User::getSammlung(), 'user:protokoll' => /* TODO: resanitizer später mal */(integer) \FOP\User::getProtokoll(), 'user:ID' => /* TODO: resanitizer später mal */(integer) \FOP\User::getID(), 'user:buchhaltung' => /* TODO: resanitizer später mal */(integer) \FOP\User::getBuchhaltung()]);
?>;</script><script type="text/javascript" src="angular/<?php echo(\FOP\I18n::getShortLocale()); ?>/js/alltypes.js?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"></script><script type="text/javascript" src="angular/angular-i18n/angular-locale_<?php echo \FOP\I18n::getAngularLocale(); ?>.js"></script><script type="text/javascript" src="js/date-filter.js"></script><script type="text/javascript" src="js/dropdown.js"></script><script type="text/javascript" src="js/numeric.js"></script><script type="text/javascript" src="js/getparam.js"></script><script type="text/javascript" src="js/tables.js"></script>
		<script type="text/javascript" src="js/parsehash.js"></script><script type="text/javascript">
		window.query = <?php echo json_encode($_GET, JSON_FORCE_OBJECT); ?>;
		window.baseurl = <?php echo json_encode(\FOP\Util::getCurrentBaseurl()); ?>;

		window.i18n_weiter = <?php echo json_encode(_('Weiter'));?>;
		//Filter I18n:
		window.i18n_quartal = <?php echo json_encode(_('Quarter'));?>;
		window.i18n_alle = <?php echo json_encode(_('All'));?>;
		window.i18n_leere = <?php echo json_encode(_('Empty'));?>;
		window.i18n_tag = <?php echo json_encode(_('Tag'));?>;
		window.i18n_woche = <?php echo json_encode(_('Woche'));?>;
		window.i18n_zeitraum = <?php echo json_encode(_('Period'));?>;
		window.i18n_monat = <?php echo json_encode(_('Monat'));?>;
		window.i18n_jahr = <?php echo json_encode(_('Jahr'));?>;
		window.i18n_von = <?php echo json_encode(_('filters_from'));?>;
		window.i18n_bis = <?php echo json_encode(_('filters_to'));?>;
		window.i18n_tabButton = <?php echo json_encode(_('open_in_new_tab'));?>;
		window.i18n_closeButton = <?php echo json_encode(_('close'));?>;
		</script></head><script type="text/javascript">const fopPushPublicKey = '<?php echo(addslashes(\FOP\Configuration::getFOPPushPublicKey())); ?>';
        const fopUserID = <?php echo(intval(\FOP\User::getID())); ?>;
        var fopPushDisabled = false;
    </script><script type="text/javascript" src="js/serviceworkersetup.js"></script><body ng-app='app'>
		<div class='mdl-js-snackbar mdl-snackbar' id='snackbar'>
			<div class='mdl-snackbar__text'></div>
			<button class='mdl-snackbar__action' type='button'></button>
		</div>
		<script>
			var snackbar = document.querySelector('#snackbar');
			componentHandler.upgradeElement(snackbar, 'MaterialSnackbar');
			$(function () {
				setTimeout(function () {
					$('.fop-layout').scrollTop(0);
				}, 0);
			});
		</script>

		<?php if (isset($_GET['popup'])) { ?>
		<header class="fop-header mdl-layout__header mdl-layout__header mdl-layout__header--scroll">
				<div class="mdl-layout__header-row">
					<span class="mdl-layout-title"><?php echo(_('Eigenschaften')); ?></span><div class="mdl-layout-spacer"></div><span class="noprint mdl-layout-title mdl-layout--large-screen-only"><div class="mdl-textfield mdl-js-textfield"><input id="supersearch" accesskey="f" class="mdl-textfield__input" type="text" onkeydown="if (event.keyCode == 13 && this.value) window.location.href = 'FOP/Index/searchURL?q=' + encodeURIComponent(this.value) + '&from=<?php echo htmlentities(urlencode(\FOP\Util::getBackUrl())); ?>';" value="<?php echo htmlentities($_GET['q'] ?? ''); ?>" style="border-bottom: 1px solid white;"/><label class="mdl-textfield__label" style="color: inherit"><?php echo(_('search')); ?> - <?php
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
			// MAC: Control+ davor
			echo 'Control + ';
		}
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) {
			// Firefox
			if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
				// MAC: Control + Alt + key
				echo 'Alt + F';
			} else {
				echo 'Alt + Shift + F';
			}
		} else {
			// Internet Explorer, Chrome, Safari, Opera
			echo 'Alt + F';
		}
	?></label></div></span><i onclick='addFav(null)' class='material-icons fop-favorites' id='favorites_button'>star_border</i>
				</div>
      	</header>
			<style>
				.content {
					margin-top: 0px !important;
				}
			</style>
			<div id='content' class='popup' >
		<?php } else { ?>
			<div class="fop-layout mdl-layout mdl-js-layout mdl-layout--fixed-drawer mdl-layout--fixed-header">
			<header class="fop-header mdl-layout__header mdl-layout__header mdl-layout__header--scroll">
				<div class="mdl-layout__header-row">
					<span class="mdl-layout-title"><?php echo(_('Eigenschaften')); ?></span><div class="mdl-layout-spacer"></div><span class="noprint mdl-layout-title mdl-layout--large-screen-only"><div class="mdl-textfield mdl-js-textfield"><input id="supersearch" accesskey="f" class="mdl-textfield__input" type="text" onkeydown="if (event.keyCode == 13 && this.value) window.location.href = 'FOP/Index/searchURL?q=' + encodeURIComponent(this.value) + '&from=<?php echo htmlentities(urlencode(\FOP\Util::getBackUrl())); ?>';" value="<?php echo htmlentities($_GET['q'] ?? ''); ?>" style="border-bottom: 1px solid white;"/><label class="mdl-textfield__label" style="color: inherit"><?php echo(_('search')); ?> - <?php
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
			// MAC: Control+ davor
			echo 'Control + ';
		}
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) {
			// Firefox
			if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
				// MAC: Control + Alt + key
				echo 'Alt + F';
			} else {
				echo 'Alt + Shift + F';
			}
		} else {
			// Internet Explorer, Chrome, Safari, Opera
			echo 'Alt + F';
		}
	?></label></div></span><i onclick='addFav(null)' class='material-icons fop-favorites' id='favorites_button'>star_border</i>
				</div>
      		</header>


				<?php  \EasyEditor\Navigation::render(); ?>
      
				<main class="mdl-layout__content" id="content">
					<div class="fop-content">
						<?php } ?>
						
							<div class="content" id="1">
								

								<div
								 
								id="cardform-aufgabeProperty"
								style="width: 100%; height: 100%;"
								class='mdl-grid'
									ng-controller="FormAufgabeProperty" ng-init="form = <?php echo htmlentities(json_encode([]));
									?>;"
								>
								<?php
								 ?>
								<div id='fop-upbar'></div>
								<?php \DataView\AufgabeProperty::renderScript(); ?>
									<?php
									$features = [];
									if (true && (true)) {
									$feature = [
										'id' => 'main_table',
										'title' => _('table'),
										'order' => '500-100', // 500-100 (50)
										'mode' => 'area', // area (51) / tab (50)
										'position' => 'full', // 
										'collapsed' => 0, // 0 (51) / 1 (50)
										'canEdit' => !\FOP\User::getIsGuest(),
										'visibility' => null
									];
									$features[$feature['id']] = $feature;
									}
									

									
									/* load order from database
										schema: fop_form_feature(user, form, subid, key, value)
										key = (order, mode, position, collapsed)
									*/
									$upbar_collapsed = false;
									// default values
									foreach (\FOP\Database::query('SELECT subid, '.qi('key').', (SELECT '.qi('value').' FROM fop_form_feature b WHERE a.subid = b.subid AND a.'.qi('key').' = b.'.qi('key').' AND '.qi('user').' = '.intval(\FOP\User::getID()).' GROUP BY '.qi('value').' ORDER BY COUNT(*) DESC LIMIT 1) AS '.qi('value').' FROM fop_form_feature a WHERE '.qi('user').' = '.intval(\FOP\User::getID()).' GROUP BY subid, '.qi('key'))->fetchAll(\PDO::FETCH_ASSOC) AS $setting) {
										if (isset($features[$setting['subid']])) {
											$features[$setting['subid']][$setting['key']] = $setting['value'];
										}
									}
									// form specific special values
									foreach (\FOP\Database::query('SELECT subid, '.qi('key').', '.qi('value').' FROM fop_form_feature a WHERE form = \'aufgabeProperty\' AND '.qi('user').' = '.intval(\FOP\User::getID()).'')->fetchAll(\PDO::FETCH_ASSOC) AS $setting) {
										if (isset($features[$setting['subid']])) {
											$features[$setting['subid']][$setting['key']] = $setting['value'];
										} else if ($setting['subid'] == 'upbar' && $setting['key'] == 'collapsed') {
											$upbar_collapsed = (bool) $setting['value'];
										}
									}

									/* fill in the content of the features */
									if (true && (true)) {
										ob_start();
										\EasyEditor\FormFeature::push($features['main_table']);
										?>
	<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
	<div id="aufgabeProperty-table" class="fop-dv"><?php
		if (\EasyEditor\FormFeature::isCollapsed()) {
			// #3198 lazy rendering:
			echo '<div class="fop-lazy-reload" onclick="reloadaufgabeProperty()"></div>'; // CSS class .fop-lazy-reload will be clicked after being showed
		} else {
			\DataView\AufgabeProperty::renderTabTableAction();
		}
	?></div>
	<?php } ?>
	<?php
										\EasyEditor\FormFeature::pop();
										$features['main_table']['html'] = ob_get_contents();
										ob_end_clean();
									}
									

									uasort($features, function ($a, $b) {
										return strnatcmp($a['order'], $b['order']);
									});
									foreach ($features AS $feature) {
										\EasyEditor\FormFeature::render($feature);
									}
									?><script type='text/javascript'>
										$(function(){
											// bei Änderungen: prüfen, ob Form geändert wurde
											var formData = $('#cardform-aufgabeProperty').serialize();
											document.body.onbeforeunload = function () {
												if (formData != $('#cardform-aufgabeProperty').serialize()) {
													return 'Form data has changed - are you sure??';
												}
											};
											$('#cardform-aufgabeProperty').on('submit', function () {
												document.body.onbeforeunload = undefined;
											});
											<?php if ($upbar_collapsed) {
												?>$('#fop-bar-mainbutton').click();<?php
											} ?>
											$('#fop-bar-mainbutton').click(function () {
												setTimeout(function () {
													setCFF('upbar', 'collapsed', $('#fop-bar-container').is(':visible') ? 0 : 1);
												}, 440); /* perfect timing for fadeOut */
											});
										});
										
										function setCFF(id, key, value) {
											<?php if(!\FOP\User::getIsGuest()) { ?>
											$.get('FOP/Index/setCFF?form=aufgabeProperty&subid=' + encodeURIComponent(id) + '&key=' + encodeURIComponent(key) + '&value=' + encodeURIComponent(value)).then(function () {
												if (key == 'reset') {
													location.reload();
												}
											});
											<?php } /* EditAccess */ ?>
										}
										function setCFFOrder(fids) {
											<?php if(!\FOP\User::getIsGuest()) { ?>
											$.get('FOP/Index/setCFFOrder?form=aufgabeProperty&fids=' + encodeURIComponent(JSON.stringify(fids)));
											<?php } /* EditAccess */ ?>
										}
										$(function () {
											refreshTabHeaders($('#cardform-aufgabeProperty')); /* provided in js/form.js */
											// preselection
											if (location.hash.startsWith('#select:')) {
												$('[name="' + window.location.hash.slice(8) + '"]').focus().select();
											} else {
												$('#cardform-aufgabeProperty input[type!="hidden"],textarea,select[tabindex!="-1"]').not('.fop-disabled *').filter(':visible:first').focus().select();
											}
										});

										$(window).keydown(function(event) {
											 if (event.ctrlKey && String.fromCharCode(event.which).toLowerCase() == 's') {
												 event.preventDefault();
												 $('button[type=submit]').click();
												 return false;
											 }
										});

										
										$(document).on('keyup',function(evt) {
										   if (evt.keyCode == 27) {
												if (window.parent) {
													window.close(); // iframe:close
												} else {
													window.history.back();
												}
											}
												});
										
									</script>

							</div>
							

							</div>
							<div class="content" id="focus-supersearch">
		<script type='text/javascript'>
			$(function () {
				var focusfield = $('#supersearch');
				
				if (focusfield.length) {
					focusfield[0].focus();
					focusfield[0].select();
				}
			});
		</script>
	
							</div>
						<?php if (!isset($_GET['popup'])) { ?>
					</div>
				</main>
				
			</div>
		<?php } else { ?></div><?php } ?>
<?php if (!isset($_GET['popup'])) { ?><div class='fop-seal'></div><?php } ?></body></html><?php
    
  }


  
  

  
  
}



