
	var app = angular.module('app', []);
	
	app.controller('dummy', function($scope){});

	function exportURIValues (x) {
		return encodeURIComponent(((Array.isArray(x)) ? x.join(',') : x))
	}

	
      app.directive('lxDragModel', function () {
         return {
            restrict: 'A',
            scope: {'lxDragModel': '&', 'lxDragStart': '&', 'lxDragEnd': '&'},
            link: function (scope, element, attr) {
               element[0].draggable = 'true';
               element[0].addEventListener('dragstart', function (ev) {
                  var model = scope.lxDragModel();
                  if (scope.lxDragStart) {
                     ev.stopPropagation();
                     scope.lxDragStart({model: model});
                     scope.$apply();
                  }
                  window.lxDragModel = model;
               });
               element[0].addEventListener('dragend', function (ev) {
                  var model = scope.lxDragModel();
                  if (scope.lxDragEnd) {
                     ev.stopPropagation();
                     scope.lxDragEnd({model: model});
                     scope.$apply();
                  }
               });
            }
         }
      });
      app.directive('lxDragAllow', function () {
         return {
            restrict: 'A',
            scope: {'lxDragAllow': '&', lxDragPreview: '&', 'lxDragDrop': '&', lxDragAbort: '&'},
            link: function (scope, element, attr) {
               var state = 0;
               element[0].addEventListener('dragenter', function (ev) {
					  	ev.preventDefault();
						state = state + 1;
                  if (state > 1) return;
                  var model = window.lxDragModel;
                  if (!scope.lxDragAllow || scope.lxDragAllow({model: model})) {
                     scope.lxDragPreview({model: model});
                     scope.$apply();
                  }
               });
               element[0].addEventListener('dragleave', function (ev) {
						ev.preventDefault();
						state = state - 1;
                 	if (state > 0) return;
                  var model = window.lxDragModel;
                  if (!scope.lxDragAllow || scope.lxDragAllow({model: model})) {
                     scope.lxDragAbort({model: model}); 
                     scope.$apply();
                  }
               });
               element[0].addEventListener('dragover', function (ev) {
                  ev.preventDefault();
               });
               element[0].addEventListener('drop', function (ev) {
                  ev.preventDefault();
						state = state - 1;
                  if (state > 1) return;
						var model = window.lxDragModel;
                  if (!scope.lxDragAllow || scope.lxDragAllow({model: model})) {
                     scope.lxDragDrop({model: model});
                     scope.$apply();
                  }
               });
            }
         }
      });
   
	app.filter('intbytesreadable', function() {
		return function(x) {
			if (!(x <= 0)) {
				const size = ['Bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'];
				var factor = Math.min(Math.floor((String(x).length - 1) / 3), 6);
				return Math.pow(1024, factor).toFixed(1) + size[factor];
			}
		}
	});
	app.directive('ngTriggerChange', function () {
		return {
			restrict: 'A',
			scope: { ngTriggerChange: '=', fopType: '@' },
			link: function ($scope, $element) {
				$scope.$watch('ngTriggerChange', function (newval) {
					// Nachbau der Angular-2w-binding-Logik, da Angular bei select zu buggy ist
					newval = newval || '0'; // select correct value when angular value is null
					var sel = $element[0].parentNode.firstElementChild;
					var found = false;
					for (var i = 0; i < sel.options.length; i++) {
						if (sel.options[i].value == newval) {
							sel.selectedIndex = i;
							found = true
							$element.val(sel.options[sel.selectedIndex].text);
							if (!$(sel.options[i]).hasClass('fop-remove-after-change')) {
								// first non-forbidden option
								$($element[0].parentElement).find('.fop-remove-after-change').remove();
							}
							break;
						}
					}
					if (!found) {
						$.get('Types/'+$scope.fopType+'/description?id='+encodeURIComponent(newval)).then(function (result) {
							var newOption = document.createElement('option');
							newOption.value = newval;
							newOption.text = result;
							sel.options.add(newOption);
							sel.selectedIndex = sel.options.length - 1;
							$element.val(sel.options[sel.selectedIndex].text);
							$($element[0].parentElement).find('.fop-remove-after-change').remove();
						});
					}
				});
			}
		}
	});
	app.directive('tinymceLocale', function () {
		return {
			restrict: 'A',
			scope: {
				'tinymceModel': '=?',
				'tinymceLocale': '@',
				'tinymceSuggest': '=?',
				'tinymceHeight': '@',
				'tinymceEmoticons': '@'
			},
			link: function ($scope, $element) {
				// TODO: Language anhand vorhandener Dateien
				$(function () { setTimeout(function reinit() {
					if (!document.contains($element[0])) {
						// zu spät: Element wurde wieder entfernt
						return;
					}
					tinymce.base_url = 'tinymce/';
					tinymce.baseURL = 'tinymce/';
					tinymce.baseURI = new tinymce.util.URI(document.baseURI + 'tinymce/');
					tinymce.init({
						language: $scope.tinymceLocale,
						content_css: document.baseURI + 'style.css',
						height: $scope.tinymceHeight,
						target: $element.find('textarea')[0],
						invalid_styles: 'font-family',
						plugins: 'image table searchreplace autolink fullscreen link charmap lists media code' + ($scope.tinymceEmoticons ? ' emoticons' : ''),
						extended_valid_elements: 'pagebreak,placeholder',
						custom_elements: '~pagebreak,~placeholder',
						menubar: 'edit table view insert format',
						toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify  | numlist bullist outdent indent  | removeformat | image table media | ai' + ($scope.tinymceEmoticons ? ' emoticons' : ''),
						toolbar2: $scope.tinymceSuggest ? Object.keys($scope.tinymceSuggest).map(key => key.replaceAll(' ','_')).join(' ') : undefined,
						browser_spellcheck: true,
						toolbar_groups: $scope.tinymceSuggest ? Object.fromEntries(Object.entries($scope.tinymceSuggest).filter(([menu, entries]) => typeof entries !== 'string').map(([menu, entries]) => [menu.replaceAll(' ','_'), Object({text: menu, items: Object.keys(entries).map((x, i) => menu + i).join(' ')})])) : undefined,
						setup: function (editor) {
							
							editor.ui.registry.addButton('ai', {
								title: 'AI',
								icon: 'accessibility-check',
								onAction: function () {
									
		window.open_over('FOP/Index/ai&popup&pre='+encodeURIComponent($element[0].dataset.pre || '')+'&command='+encodeURIComponent($element[0].dataset.command || ''));
	
								}
							});
							if ($scope.tinymceSuggest) {
								for (let menu in $scope.tinymceSuggest) {
									if (typeof $scope.tinymceSuggest[menu] === 'string') {
										editor.ui.registry.addButton(menu.replaceAll(' ','_'), {
											text: menu,
											onAction: function (_) {
												editor.insertContent($scope.tinymceSuggest[menu] + ' ');
											}
										});
									} else {
										let b = 0;
										for (var key in $scope.tinymceSuggest[menu]) (function (key) {
											editor.ui.registry.addButton(menu + b, {
												text: key,
												onAction: function (_) {
													editor.insertContent($scope.tinymceSuggest[menu][key] + ' ');
												}
											});
											b++;
										})(key);
									}
								}
							}
							var lastSuggest = JSON.stringify($scope.tinymceSuggest);
							var unregister = $scope.$watch('tinymceSuggest', function (_new, _old) {
								if (JSON.stringify(_new) == lastSuggest) return;
								editor.remove();
								unregister();
								reinit();
							}, true);

							editor.on('Change', function () {
								$scope.tinymceModel = editor.getContent();
								$scope.$apply();
							});
							$scope.$watch('tinymceModel', function (_new, _old) {
								if (_new && _new != editor.getContent()) {
									editor.setContent(_new);
								}
							});
							$element[0].insertContent = function (text) {
								editor.insertContent(text);
							}
						},
						paste_data_images: true,
						relative_urls: false,
						images_upload_handler: function (blobInfo) {
							return new Promise(function (success, failure) {
								// Issue für Upload: #395
								
								// deaktivieren - das buggt zu sehr rum und versucht, auch existierende data-URLs zu ersetzen; images_dataimg_filter scheint nicht zu feuern (ist seit 6.0 abgeschafft)
								// if (blobInfo.blob().size > 32768) return failure('Momentan sind Bilder auf 32kb begrenzt. Bitte fragen Sie bei Ihrem Software-Hersteller nach der Freischaltung von großen Datei-Uploads.');
								success('data:' + blobInfo.blob().type + ';base64,' + blobInfo.base64());
							});
						}
					});
				}, 0); /* Achtung! Früher gab es hier eine Race Condition (manchmal klappt es, manchmal nicht) - da konnte man als Workaround anstatt 0 200 oder 2000 eintragen; das hat aber wiederum Glitches beim Formular-Rendern erzeugt */ });
			}
		};
	});
		app.directive('tsFormat', function () {
			return {
				restrict: 'A',
				scope: {'tsModel': '=?', 'tsFormat': '@', 'tsLocale': '@'},
				controller: function ($scope, $element) {
					var viewToolbar = $element[0].hasAttribute('viewToolbar');
					var notBySide = $element[0].hasAttribute('notBySide');
					document.body.style.position = 'relative'; // hack to allow datetimepicker placement inside iframe
					document.body.parentNode.style.position = 'relative'; // hack to allow datetimepicker placement inside iframe
        			$element.datetimepicker({
						locale: $scope.tsLocale,
						format: $scope.tsFormat,
						sideBySide: !notBySide,
						date: $scope.tsModel ? new Date(1000 * $scope.tsModel) : ($element.val() ? moment($element.val(), $scope.tsFormat) : null),
						toolbarPlacement: viewToolbar ? 'bottom' : 'default',
						showTodayButton: viewToolbar,
						showClear: viewToolbar,
						showClose: viewToolbar,
						widgetParent: '#content',
						tooltips: {
							today: 'zum heutigen Datum',
							clear: 'Auswahl löschen',
							close: 'Schließen',
							selectMonth: 'Monat wählen',
							prevMonth: 'Vorheriger Monat',
							nextMonth: 'Nächster Monat',
							selectYear: 'Jahr wählen',
							prevYear: 'Vorheriges Jahr',
							nextYear: 'Nächstes Jahr',
							selectDecade: 'Dekade wählen',
							prevDecade: 'Vorherige Dekade',
							nextDecade: 'Nächste Dekade',
							prevCentury: 'Vorheriges Jahrhundert',
							nextCentury: 'Nächstes Jahrhundert',
							pickHour: 'Stunde wählen',
							incrementHour: 'Stunde später',
							decrementHour: 'Stunde früher',
							pickMinute: 'Minute wählen',
							incrementMinute: 'Minute später',
							decrementMinute: 'Minute früher',
							pickSecond: 'Sekunde wählen',
							incrementSecond: 'Sekunde später',
							decrementSecond: 'Sekunde früher',
							togglePeriod: 'Umschalten 12h/24h',
							selectTime: 'Zeit festlegen'
						}
					}).on('dp.change', function (e) {
						if (e.target.parentElement.MaterialTextfield) {
							e.target.parentElement.MaterialTextfield.checkValidity();
						}
						$scope.tsModel = Math.floor($element.data('DateTimePicker').date() / 1000);
						setTimeout(function () {
							$scope.$apply();
						});
					}).on('dp.show', function (e) {
						var rectTarget = e.target.getBoundingClientRect();
						var rectParent = $element.data('DateTimePicker').widgetParent()[0].getBoundingClientRect();
						var rect = $('.bootstrap-datetimepicker-widget')[0].getBoundingClientRect();
						$('.bootstrap-datetimepicker-widget')[0].style.inset =
							(rectTarget.top - rectParent.top + rectTarget.height) + 'px auto auto ' +
							Math.min(rectTarget.left - rectParent.left, rectParent.width - rect.width) + 'px';
					});
					$scope.$watch('tsModel', function (newvalue, oldvalue) {
							if (newvalue === undefined) return;
					      $element.data('DateTimePicker').date(newvalue ? new Date(1000 * newvalue) : null);
					});
				}
			};
		});
	
	app.controller('FormGroupWf_campaign_cloneCampaignAttachment_campaign', function($scope, $http, $element){
		// watchers
		
		$scope.$watch('form["ID"]', function(newVal) {
			if (typeof $scope.item !== 'undefined') $scope.item['campaign'] = newVal;
		});
	});
	
	app.controller('FormGroupWf_campaign_createCampaignAttachment_campaign', function($scope, $http, $element){
		// watchers
		
		$scope.$watch('form["ID"]', function(newVal) {
			if (typeof $scope.item !== 'undefined') $scope.item['campaign'] = newVal;
		});
	});
	
	app.controller('FormGroupWf_campaign_editCampaignAttachment_campaign', function($scope, $http, $element){
		// watchers
		
		$scope.$watch('form["ID"]', function(newVal) {
			if (typeof $scope.item !== 'undefined') $scope.item['campaign'] = newVal;
		});
	});
	
	app.controller('FormGroupWf_gruppe_createGruppeVerantwortlich_gruppe', function($scope, $http, $element){
		// watchers
		
		$scope.$watch('form["ID"]', function(newVal) {
			if (typeof $scope.item !== 'undefined') $scope.item['gruppe'] = newVal;
		});
	});
	
	app.controller('FormGroupWf_mitglied_createMitgliedPassnummer_mitglied', function($scope, $http, $element){
		// watchers
		
		$scope.$watch('form["ID"]', function(newVal) {
			if (typeof $scope.item !== 'undefined') $scope.item['mitglied'] = newVal;
		});
	});
	
	app.controller('FormGroupWf_mitglied_createAnsprechpartner_mitglied', function($scope, $http, $element){
		// watchers
		
		$scope.$watch('form["ID"]', function(newVal) {
			if (typeof $scope.item !== 'undefined') $scope.item['mitglied'] = newVal;
		});
	});
	
	app.controller('FormGroupWf_protokoll_createProtokollPunkt_protokoll', function($scope, $http, $element){
		// watchers
		
		$scope.$watch('form["ID"]', function(newVal) {
			if (typeof $scope.item !== 'undefined') $scope.item['protokoll'] = newVal;
		});
	});
	
	app.controller('FormGroupWf_gruppe_createGruppeItem_list', function($scope, $http, $element){
		// watchers
		
	$scope.$watchGroup(['item[\'list\']', 'item[\'item\']'], function (newval) {
	   $http.get('Tables/GruppeItem/listitemUnique?context=' + encodeURIComponent(newval[0]) + '&value=' + encodeURIComponent(newval[1]) + '&id=' + encodeURIComponent($scope.item['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.item['list:item::isUnique'] = req.data;
	   }).catch(function () {
		 $scope.item['list:item::isUnique'] = true;
		});
	});
		$scope.$watch('form["ID"]', function(newVal) {
			if (typeof $scope.item !== 'undefined') $scope.item['list'] = newVal;
		});
	});
	
	app.controller('FormGroupWf_aufgabePropertyType_createAufgabePropertyDropdown_property', function($scope, $http, $element){
		// watchers
		
	$scope.$watch('item[\'name\']', function (newval) {
	   $http.get('Tables/AufgabePropertyDropdown/nameUnique?value=' + encodeURIComponent(newval) + '&id=' + encodeURIComponent($scope.item['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.item['name::isUnique'] = req.data;
	   });
	});
	});
	
	app.controller('FormGroupWf_gruppe_editGruppeVerantwortlich_gruppe', function($scope, $http, $element){
		// watchers
		
		$scope.$watch('form["ID"]', function(newVal) {
			if (typeof $scope.item !== 'undefined') $scope.item['gruppe'] = newVal;
		});
	});
	
	app.controller('FormGroupWf_mitglied_editMitgliedPassnummer_mitglied', function($scope, $http, $element){
		// watchers
		
		$scope.$watch('form["ID"]', function(newVal) {
			if (typeof $scope.item !== 'undefined') $scope.item['mitglied'] = newVal;
		});
	});
	
	app.controller('FormGroupWf_mitglied_editAnsprechpartner_mitglied', function($scope, $http, $element){
		// watchers
		
		$scope.$watch('form["ID"]', function(newVal) {
			if (typeof $scope.item !== 'undefined') $scope.item['mitglied'] = newVal;
		});
	});
	
	app.controller('FormGroupWf_protokoll_editProtokollPunkt_protokoll', function($scope, $http, $element){
		// watchers
		
		$scope.$watch('form["ID"]', function(newVal) {
			if (typeof $scope.item !== 'undefined') $scope.item['protokoll'] = newVal;
		});
	});
	
	app.controller('FormGroupWf_gruppe_editGruppeItem_list', function($scope, $http, $element){
		// watchers
		
	$scope.$watchGroup(['item[\'list\']', 'item[\'item\']'], function (newval) {
	   $http.get('Tables/GruppeItem/listitemUnique?context=' + encodeURIComponent(newval[0]) + '&value=' + encodeURIComponent(newval[1]) + '&id=' + encodeURIComponent($scope.item['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.item['list:item::isUnique'] = req.data;
	   }).catch(function () {
		 $scope.item['list:item::isUnique'] = true;
		});
	});
		$scope.$watch('form["ID"]', function(newVal) {
			if (typeof $scope.item !== 'undefined') $scope.item['list'] = newVal;
		});
	});
	
	app.controller('FormGroupWf_aufgabePropertyType_editAufgabePropertyDropdown_property', function($scope, $http, $element){
		// watchers
		
	$scope.$watch('item[\'name\']', function (newval) {
	   $http.get('Tables/AufgabePropertyDropdown/nameUnique?value=' + encodeURIComponent(newval) + '&id=' + encodeURIComponent($scope.item['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.item['name::isUnique'] = req.data;
	   });
	});
	});
	
	app.controller('FormGroupWf_aufgabeType_createAufgabePropertyType_restrict', function($scope, $http, $element){
		// watchers
		
	$scope.$watch('item[\'name\']', function (newval) {
	   $http.get('Tables/AufgabePropertyType/nameUnique?value=' + encodeURIComponent(newval) + '&id=' + encodeURIComponent($scope.item['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.item['name::isUnique'] = req.data;
	   });
	});
	});
	
	app.controller('FormGroupWf_aufgabeType_editAufgabePropertyType_restrict', function($scope, $http, $element){
		// watchers
		
	$scope.$watch('item[\'name\']', function (newval) {
	   $http.get('Tables/AufgabePropertyType/nameUnique?value=' + encodeURIComponent(newval) + '&id=' + encodeURIComponent($scope.item['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.item['name::isUnique'] = req.data;
	   });
	});
	});
	
	app.controller('FormGroupWf_mitglied_createMatrix_campaignTarget_target_campaign', function($scope, $http, $element){
		// watchers
		
	$scope.$watchGroup(['item[\'campaign\']', 'item[\'target\']'], function (newval) {
	   $http.get('Tables/CampaignTarget/campaigntargetUnique?context=' + encodeURIComponent(newval[0]) + '&value=' + encodeURIComponent(newval[1]) + '&id=' + encodeURIComponent($scope.item['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.item['campaign:target::isUnique'] = req.data;
	   }).catch(function () {
		 $scope.item['campaign:target::isUnique'] = true;
		});
	});
		$scope.$watchGroup(['item[\'campaign\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Campaign/fetch6c87eaeb3f27fd76105907c05088f0d75b563f0afda50359d692790806c0b7ed_fetchformarray_wf_mitglied_create_matrix_campaignTarget_target_campaign?id=' + encodeURIComponent($scope.$eval('item[\'campaign\']'))).then(function (req) {
				if (typeof $scope.item !== 'undefined') $scope.item['CkHlp5PE'] = req.data;
			});
		});
	});
	
	app.controller('FormGroupWf_mitglied_editMatrix_campaignTarget_target_campaign', function($scope, $http, $element){
		// watchers
		
	$scope.$watchGroup(['item[\'campaign\']', 'item[\'target\']'], function (newval) {
	   $http.get('Tables/CampaignTarget/campaigntargetUnique?context=' + encodeURIComponent(newval[0]) + '&value=' + encodeURIComponent(newval[1]) + '&id=' + encodeURIComponent($scope.item['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.item['campaign:target::isUnique'] = req.data;
	   }).catch(function () {
		 $scope.item['campaign:target::isUnique'] = true;
		});
	});
		$scope.$watchGroup(['item[\'campaign\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Campaign/fetch6c87eaeb3f27fd76105907c05088f0d75b563f0afda50359d692790806c0b7ed_fetchformarray_wf_mitglied_edit_matrix_campaignTarget_target_campaign?id=' + encodeURIComponent($scope.$eval('item[\'campaign\']'))).then(function (req) {
				if (typeof $scope.item !== 'undefined') $scope.item['CkHlp5PE'] = req.data;
			});
		});
	});
	
	app.controller('FormGroupWf_mitglied_createMatrix_gruppeItem_item_list', function($scope, $http, $element){
		// watchers
		
	$scope.$watchGroup(['item[\'list\']', 'item[\'item\']'], function (newval) {
	   $http.get('Tables/GruppeItem/listitemUnique?context=' + encodeURIComponent(newval[0]) + '&value=' + encodeURIComponent(newval[1]) + '&id=' + encodeURIComponent($scope.item['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.item['list:item::isUnique'] = req.data;
	   }).catch(function () {
		 $scope.item['list:item::isUnique'] = true;
		});
	});
		$scope.$watchGroup(['item[\'list\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Gruppe/fetch9978b4ed21e69d8d8f26cf52904827a6d2619130026e4387ec597b5e81027c66_fetchformarray_wf_mitglied_create_matrix_gruppeItem_item_list?id=' + encodeURIComponent($scope.$eval('item[\'list\']'))).then(function (req) {
				if (typeof $scope.item !== 'undefined') $scope.item['WoNKw4Oa'] = req.data;
			});
		});
		$scope.$watchGroup(['item[\'list\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Gruppe/fetchB5771ec66c94e73c0910ffa7ae34724ba269575117e6e3d7f7b20e7383244ba0_fetchformarray_wf_mitglied_create_matrix_gruppeItem_item_list?id=' + encodeURIComponent($scope.$eval('item[\'list\']'))).then(function (req) {
				if (typeof $scope.item !== 'undefined') $scope.item['GM2ROBSz'] = req.data;
			});
		});
	});
	
	app.controller('FormGroupWf_mitglied_editMatrix_gruppeItem_item_list', function($scope, $http, $element){
		// watchers
		
	$scope.$watchGroup(['item[\'list\']', 'item[\'item\']'], function (newval) {
	   $http.get('Tables/GruppeItem/listitemUnique?context=' + encodeURIComponent(newval[0]) + '&value=' + encodeURIComponent(newval[1]) + '&id=' + encodeURIComponent($scope.item['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.item['list:item::isUnique'] = req.data;
	   }).catch(function () {
		 $scope.item['list:item::isUnique'] = true;
		});
	});
		$scope.$watchGroup(['item[\'list\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Gruppe/fetch9978b4ed21e69d8d8f26cf52904827a6d2619130026e4387ec597b5e81027c66_fetchformarray_wf_mitglied_edit_matrix_gruppeItem_item_list?id=' + encodeURIComponent($scope.$eval('item[\'list\']'))).then(function (req) {
				if (typeof $scope.item !== 'undefined') $scope.item['WoNKw4Oa'] = req.data;
			});
		});
		$scope.$watchGroup(['item[\'list\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Gruppe/fetchB5771ec66c94e73c0910ffa7ae34724ba269575117e6e3d7f7b20e7383244ba0_fetchformarray_wf_mitglied_edit_matrix_gruppeItem_item_list?id=' + encodeURIComponent($scope.$eval('item[\'list\']'))).then(function (req) {
				if (typeof $scope.item !== 'undefined') $scope.item['GM2ROBSz'] = req.data;
			});
		});
	});
	app.controller('DynamicImport', function ($scope) {
	var filters = {
		'': function (x) { return x; },
		'number49': (function (x) {
		if (x) {
			x = x.replace(/[^0-9+]/g, ''); // alles außer Ziffern und + weg
			x = x.replace(/^00/, '+'); // Ländervorwahl international
			x = x.replace(/^0/, '+49'); // Ländervorwahl national
			if (x[0] !== '+') {
				x = '+49' + x;
			}
		}
		return x;
	}),
		'number43': (function (x) {
		if (x) {
			x = x.replace(/[^0-9+]/g, ''); // alles außer Ziffern und + weg
			x = x.replace(/^00/, '+'); // Ländervorwahl international
			x = x.replace(/^0/, '+43'); // Ländervorwahl national
			if (x[0] !== '+') {
				x = '+43' + x;
			}
		}
		return x;
	}),
		'number41': (function (x) {
		if (x) {
			x = x.replace(/[^0-9+]/g, ''); // alles außer Ziffern und + weg
			x = x.replace(/^00/, '+'); // Ländervorwahl international
			x = x.replace(/^0/, '+41'); // Ländervorwahl national
			if (x[0] !== '+') {
				x = '+41' + x;
			}
		}
		return x;
	}),
		'vname': function (x) {
		if (x) {
			var matches;
			if ((matches = /(.+) [^ ]+/m.exec(x))) {
				x = matches[1];
			}
		}
		return x;
	},
		'nname': function (x) {
		if (x) {
			var matches;
			if ((matches = /.+ ([^ ]+)/m.exec(x))) {
				x = matches[1];
			}
		}
		return x;
	},
		'plz': function (x) {
		if (x) {
			var matches;
			if ((matches = /([0-9]{4-5})/m.exec(x))) {
				x = matches[1];
			}
		}
		return x;
	},
		'ort': function (x) {
		if (x) {
			var matches;
			if ((matches = /[0-9]{4-5}\s+(.*)/m.exec(x))) {
				x = matches[1];
			}
		}
		return x;
	},
		'strasse': function (x) {
		if (x) {
			var matches;
			if ((matches = /(.*)\s*[0-9]{4-5}/m.exec(x))) {
				x = matches[1];
			}
		}
		return x;
	}
	};
	$scope.renderData = function (data, filter) {
		return data ? data.map(filters[filter] || filters['']).join(', ') : '';
	}
});
app.filter('separatorFilter', function () {
	return function (input) {
		var match = /^[0-9]+:(.*)$/.exec(input);
		if (match) return match[1]; // column name
		return '"' + input + '"'; // separator
	};
});app.directive('selectUpdater', function () {
		return {
			restrict: 'A',
			scope: { selectUpdater: '=', endpoint: '@', value: '=', condition: '@', fieldName: '@' },
			link: function ($scope, $element) {
				$scope.$watch('selectUpdater', function (newval, oldval) {
					if (oldval === undefined) return;
					if (JSON.stringify(oldval) == JSON.stringify(newval)) return;
					// Ajax reload
					$.get($scope.endpoint + '?value=' + encodeURIComponent($scope.value || $element.find('select').val()) + '&deps=' + encodeURIComponent(JSON.stringify($scope.selectUpdater)) + '&condition=' + encodeURIComponent($scope.condition) + '&fop_field_name=' + encodeURIComponent($scope.fieldName)).then(function (html) {
						$element.children().remove();
						$element.html(html);
						upgradeDOM($element);
					});
				}, true);
			}
		};
	});
		app.directive('ngRevalidate', function () {
			return {
				restrict: 'A',
				link: function (scope, element, attrs) {
					scope.$watch(attrs.ngModel, function () {
						var el = element[0].parentNode;
						if (el.MaterialTextfield) el.MaterialTextfield.updateClasses_();
						if (el.MaterialCheckbox) el.MaterialCheckbox.updateClasses_();
						if (el.MaterialRadio) el.MaterialRadio.updateClasses_();
						$(element[0]).change();
					});
				}
			}
		});
	
		app.directive('comparePassword', function () {
			return {
				restrict: 'A',
				scope: {comparePassword: '='},
				link: function (scope, element) {
					function recompare() {
						if (scope.comparePassword != element.find('input').val()) {
							element.addClass('is-invalid');
							element.find('input').attr('pattern', '§§§');
						} else {
							element.removeClass('is-invalid');
							element.find('input').attr('pattern', '.*');
						}
					}
					scope.$watch('comparePassword', recompare);
					element.find('input').on('change keydown keyup leave', recompare).val(scope.comparePassword);
				}
			}
		});
	
	// Hilfsfunktion zum Objektvergleich
	fop_equals = function(a, b) {
		if (a === null && b === '' || a === '' && b === null) return true; // workaround for NULL-based text types (ng-model does not allow sanitizers)
		if (typeof a === 'object') return angular.equals(a, b);
		if (Number.isNaN(a) && Number.isNaN(b)) return true;
		return a == b;
	};
	app.service('globals', function () {
		return window.globals;
	});
	
	app.controller('FormFop_ai', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormIndex', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormPayout', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_mitglied_assignIban', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_fints_file_sendSepa', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_fints_konto_selectTanMode', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_fints_konto_tanerror', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_fints_konto_activate', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_fints_konto_tan', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_campaignTarget_multistatus', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_campaignTarget_multistatus2', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_campaignTarget_multiadd', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'campaign\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Campaign/fetch6c87eaeb3f27fd76105907c05088f0d75b563f0afda50359d692790806c0b7ed_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'campaign\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['CkHlp5PE'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if (!$scope.$eval('(form[\'CkHlp5PE\']) === null || (form[\'CkHlp5PE\']) === \'0\' ? (false) : (form[\'CkHlp5PE\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_doc_fastupload', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_doc_merge', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_draft_answer', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'mailbox\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Fop_mail_host_box/fetchFop_mail_host_box_draft_answer_contentSignature_defaultDynamicwf_fop_mail_host_box_draft_answer_contentSignature_defaultDynamic?id=' + encodeURIComponent($scope.$eval('form[\'mailbox\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['ZUE0GMqE'] = req.data;
			});
		});
		var contentSignatureVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'contentSignature\']', 'form[\'ZUE0GMqE\']'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && contentSignatureVirgin)
				scope.form['contentSignature'] = angular.copy(newValues[1]);
			if (newValues[1] !== undefined)
				contentSignatureVirgin = fop_equals(scope.form['contentSignature'], newValues[1]);
		});
	

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_draft_forward', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'mailbox\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Fop_mail_host_box/fetchFop_mail_host_box_draft_forward_contentSignature_defaultDynamicwf_fop_mail_host_box_draft_forward_contentSignature_defaultDynamic?id=' + encodeURIComponent($scope.$eval('form[\'mailbox\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['6vQEMwXW'] = req.data;
			});
		});
		var contentSignatureVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'contentSignature\']', 'form[\'6vQEMwXW\']'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && contentSignatureVirgin)
				scope.form['contentSignature'] = angular.copy(newValues[1]);
			if (newValues[1] !== undefined)
				contentSignatureVirgin = fop_equals(scope.form['contentSignature'], newValues[1]);
		});
	

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_aufgabe_assign', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_chat_chatflow', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_doc_archive', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_brief_copy', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_gruppeItem_multiadd', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'list\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Gruppe/fetch9978b4ed21e69d8d8f26cf52904827a6d2619130026e4387ec597b5e81027c66_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'list\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['WoNKw4Oa'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'list\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Gruppe/fetchB5771ec66c94e73c0910ffa7ae34724ba269575117e6e3d7f7b20e7383244ba0_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'list\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['GM2ROBSz'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if (!$scope.$eval('(form[\'WoNKw4Oa\']) === null || (form[\'WoNKw4Oa\']) === \'0\' ? (false) : (form[\'WoNKw4Oa\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'GM2ROBSz\']) === null || (form[\'GM2ROBSz\']) === \'0\' ? (false) : (form[\'GM2ROBSz\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_mitgliedBuchung_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_sammlung_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_sammlungMitglied_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_gruppeVerantwortlich_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_mitgliedPassnummer_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_mitglied_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_ansprechpartner_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_protokoll_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_protokollPunkt_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_protokollVorlage_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_tarif_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_fints_bank_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_fints_file_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_fints_konto_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_fints_tanMode_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_fints_buchung_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_campaign_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_campaignState_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_campaignTarget_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_campaignFollow_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_brief_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_briefVorlage_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_doc_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_doc_revision_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_draft_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_draft_recipient_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_draft_attachment_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_dir_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_dir_email_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_dir_email_thread_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_dir_email_recipient_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_dir_email_attachment_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_share_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_mail_host_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_aufgabeEvent_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_aufgabe_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_fop_chat_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_aufgabeAnhang_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_gruppe_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_gruppeItem_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_sammlung_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_gruppeVerantwortlich_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_mitgliedPassnummer_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_mitglied_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_ansprechpartner_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_protokoll_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_protokollPunkt_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_protokollVorlage_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_tarif_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_fop_fints_bank_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_fop_fints_file_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_fop_fints_konto_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_fop_fints_tanMode_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_fop_fints_buchung_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_campaign_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_campaignState_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_campaignTarget_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_brief_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_briefVorlage_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_doc_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/DocType/fetchC1dbb97daa5acf3e000388494be04666586344caeb89cb9f6c0f1149df437f91form_doc?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['6GSnIHxl'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/DocType/fetchC28eef9509deea64636d94990f3ede3aaeb3c72aa983dce42773d76f10af6aaaform_doc?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['51Tp3gKR'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/DocType/fetchDfaec2dbd409b00248fa2454261d66db2accbfdcad1a05c6acef408f18809bb2form_doc?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['lBXFiXqU'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_doc_revision_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_draft_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_draft_recipient_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_draft_attachment_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_dir_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_dir_email_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_dir_email_thread_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_dir_email_recipient_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_dir_email_attachment_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_share_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_aufgabeEvent_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_aufgabe_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_fop_chat_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_aufgabeAnhang_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_gruppe_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_gruppeItem_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_mitglied_editNotificationSettings', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormRecovery_form', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormRecovery_form2', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormLogin_form', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormMitgliedBuchung', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormSammlung', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormSammlungMitglied', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormGruppeVerantwortlich', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormMitgliedPassnummer', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormMitglied', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormAnsprechpartner', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormProtokoll', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormProtokollPunkt', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormProtokollVorlage', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormTarif', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormFop_fints_bank', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormFop_fints_file', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormFop_fints_konto', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormFop_fints_tanMode', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormFop_fints_buchung', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormCampaign', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormCampaignState', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormCampaignTarget', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormCampaignFollow', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormBrief', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormBriefVorlage', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormDoc', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormDoc_revision', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormFop_mail_host_box_draft', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormFop_mail_host_box_draft_recipient', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormFop_mail_host_box_draft_attachment', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormFop_mail_host_box', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormFop_mail_host_box_dir', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormFop_mail_host_box_dir_email', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormFop_mail_host_box_dir_email_thread', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormFop_mail_host_box_dir_email_recipient', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormFop_mail_host_box_dir_email_attachment', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormFop_mail_host_box_share', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormFop_mail_host', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormAufgabeEvent', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormAufgabe', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormFop_chat', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormAufgabeAnhang', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormGruppe', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormGruppeItem', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormAufgabeProperty', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormDocType', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormAufgabeType', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormAufgabeState', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormAufgabePropertyDropdown', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormAufgabePropertyType', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormReminderMitgliedMitglied_gebtag', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormReminderMitgliedForderungen', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormReminderFop_fints_buchungForderungen', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormFop_chat__chatflow', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_campaign_singleMail', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_gruppe_lifecycleEnd', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_gruppeItem_lifecycleEnd', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_mitglied_lifecycleEnd', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		var austrittsdatumVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'austrittsdatum\']', 'form[\'verstorben\']'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && austrittsdatumVirgin)
				scope.form['austrittsdatum'] = angular.copy(newValues[1]);
			if (newValues[1] !== undefined)
				austrittsdatumVirgin = fop_equals(scope.form['austrittsdatum'], newValues[1]);
		});
	

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_campaignAttachment_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_mitgliedDynamicMonthyear_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_tarifDynamicMonthyear_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_aufgabeProperty_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_docType_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_aufgabeType_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_aufgabeState_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_aufgabePropertyDropdown_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_aufgabePropertyType_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_sammlung_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		$scope.globals = globals;
		function updateCheckboxes_matrix_sammlungMitglied_sammlung_mitglied() {
			$('.cm-matrix_sammlungMitglied_sammlung_mitglied').find('.mdl-checkbox').each(function (i, x) {
				x.MaterialCheckbox.updateClasses_();
			});
		}

		$scope.matrixCheckboxMatrix_sammlungMitglied_sammlung_mitglied = {}; // items
		

		$scope.matrixRegisterMatrix_sammlungMitglied_sammlung_mitglied = function (id, item) {
			setTimeout(function () {
				$scope.matrixCheckboxMatrix_sammlungMitglied_sammlung_mitglied[id] = item;
				$scope.$apply();
			}, 0);
		}

		$scope.getMatrix_sammlungMitglied_sammlung_mitgliedValues = function () {
				  let values = [];
				  $('tbody.cm-matrix_sammlungMitglied_sammlung_mitglied tr').each(function (i, x) {
							 let checked = $(x).find('.matrix_checkbox:checked').length != 0;
							 if (checked || $(x).find('[name="matrix_sammlungMitglied_sammlung_mitglied_ID[]"]').val()) {
								 var item = {
									 'mitglied': $(x).find('input[type=hidden][name=matrix_sammlungMitglied_sammlung_mitglied_mitglied]').val(),
								 };
								 if (checked) item._checked = true; // wenn nicht, darf es NICHT gesetzt sein
								 $(x).find('[name]').each(function (i, x) {
											var match = /matrix_sammlungMitglied_sammlung_mitglied_(.*)\[\]/.exec(x.name);
											if (match) {
													  item[match[1]] = $(x).val() || $(x).text(); // TODO: auf Datentyp-Ebene eine Extraktionsmethode bauen! komplexere Numeric-Typen klappen hiermit nicht; Dropdowns können mit NULL Probleme haben; noch einfacher wäre einfach die Nutzung des Original-ng-Models
											}
								 });
								 values.push(item);
							 }
				  });
				  return values;
		};

		$scope.$watch('matrixCheckboxMatrix_sammlungMitglied_sammlung_mitglied', function (newval, oldval) {
			// Binding aktualisieren
			

			for (var key in newval) {
				if (!newval.hasOwnProperty(key)) continue;

				let item = newval[key];
				element = $('input[name="matrix_sammlungMitglied_sammlung_mitglied__' + key.replace(/[^a-zA-Z0-9_]/g) + '"]').parent()[0];

				if (element != undefined && element.MaterialCheckbox != undefined) {
					if (item.checked) {
						element.MaterialCheckbox.check();
					} else {
						element.MaterialCheckbox.uncheck();
					}
				} else {
					delete newval[key];
				}
			}
			let lengthTotal = Object.keys(newval).length;
			let lengthChecked = Object.keys(newval).filter((x) => {return newval[x].checked}).length;

			
			let el = $('#cm-matrix_sammlungMitglied_sammlung_mitglied-allselect').parent()[0];
			if (el.MaterialCheckbox) {
				if (lengthTotal == lengthChecked) {
					el.MaterialCheckbox.check();
				} else {
					el.MaterialCheckbox.uncheck();
				}
			}
		}, true);

		
		$scope.cmMatrix_sammlungMitglied_sammlung_mitgliedAllSelectToggle = function () {
			let value = $('#cm-matrix_sammlungMitglied_sammlung_mitglied-allselect').prop('checked');

			for (key in $scope.matrixCheckboxMatrix_sammlungMitglied_sammlung_mitglied) {
				if (!$scope.matrixCheckboxMatrix_sammlungMitglied_sammlung_mitglied.hasOwnProperty(key)) continue;

				let item = $scope.matrixCheckboxMatrix_sammlungMitglied_sammlung_mitglied[key];
				item.checked = value;
			};

			setTimeout(updateCheckboxes_matrix_sammlungMitglied_sammlung_mitglied, 0);
		}


		
	

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_sammlung_createMatrix_sammlungMitglied_sammlung_mitglied"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(globals[\'user:sammlung\']) === null || (globals[\'user:sammlung\']) === \'0\' ? (false) : (globals[\'user:sammlung\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		}
	});
	
	app.controller('FormWf_gruppeVerantwortlich_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'gruppe\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Gruppe/fetch475d97ee612072af97289bb9dd35989f41e90659cf7f8392e95132536176445f_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'gruppe\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['fBbeiLnC'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'gruppe\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Gruppe/fetch2747a0996069a86648328e7fdb2c91ca600d10fb286d0ea79aaee5d9d027bdfc_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'gruppe\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['wyrUOtPx'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'fBbeiLnC\']) === null || (form[\'fBbeiLnC\']) === \'0\' ? (false) : (form[\'fBbeiLnC\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'wyrUOtPx\']) === null || (form[\'wyrUOtPx\']) === \'0\' ? (false) : (form[\'wyrUOtPx\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_mitgliedPassnummer_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetchE769306a2b4fbb0689e923b14fbc78fe3dca5f6993212644bf24313bc2a4c66a_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['0Sju7gXS'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch3e6af08e75cc408645a91847036faecdae7fa1b38dfea79d65b02adbaca271d4_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['jVTTiriC'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetchB71bf46989f12939bd76a709489df6abc1b1bda456765fad8896b4a3cb6cdeb8_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['NMfpLDuB'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'jVTTiriC\']) === null || (form[\'jVTTiriC\']) === \'0\' ? (false) : (form[\'jVTTiriC\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'NMfpLDuB\']) === null || (form[\'NMfpLDuB\']) === \'0\' ? (false) : (form[\'NMfpLDuB\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'0Sju7gXS\']) === null || (form[\'0Sju7gXS\']) === \'0\' ? (false) : (form[\'0Sju7gXS\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_ansprechpartner_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetchB66f96f88699c8b4179d79f2d26504870dd9bb08b414f3b57f09ec0093248f5d_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['KRTKa3PB'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch323ecd8885146a279378a39cd7ff54bc5f5837cbe99da0e2785f6f4a2568bb44_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['7mTqtpk9'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch3d54e9f0036357317fab3cb33650bfd7ff0cd5d651774554bdd1f31a4c00dae2_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['gKmZLtRS'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'gKmZLtRS\']) === null || (form[\'gKmZLtRS\']) === \'0\' ? (false) : (form[\'gKmZLtRS\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'7mTqtpk9\']) === null || (form[\'7mTqtpk9\']) === \'0\' ? (false) : (form[\'7mTqtpk9\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'KRTKa3PB\']) === null || (form[\'KRTKa3PB\']) === \'0\' ? (false) : (form[\'KRTKa3PB\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_protokoll_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		$scope.globals = globals;

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_protokoll_createProtokollPunkt_protokoll"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(globals[\'user:protokoll\']) === null || (globals[\'user:protokoll\']) === \'0\' ? (false) : (globals[\'user:protokoll\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="protokollPunkt_protokoll[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		}
	});
	
	app.controller('FormWf_protokollPunkt_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'protokoll\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Protokoll/fetchFb4cbfcbf6d3b793d6ddf5b6c1c11ee1053ba6e0778ef8f3955d4f418f2a6536_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'protokoll\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['O3t2RXGP'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'O3t2RXGP\']) === null || (form[\'O3t2RXGP\']) === \'0\' ? (false) : (form[\'O3t2RXGP\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_protokollVorlage_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_tarif_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_fints_bank_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
	$scope.$watch('form[\'blz\']', function (newval) {
	   $http.get('Tables/Fop_fints_bank/blzUnique?value=' + encodeURIComponent(newval) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['blz::isUnique'] = req.data;
	   });
	});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('form[\'blz::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_fop_fints_file_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_fints_tanMode_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_fints_buchung_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
	$scope.$watchGroup(['form[\'hash\']', 'form[\'konto\']'], function (newval) {
	   $http.get('Tables/Fop_fints_buchung/hashkontoUnique?context=' + encodeURIComponent(newval[0]) + '&value=' + encodeURIComponent(newval[1]) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['hash:konto::isUnique'] = req.data;
	   }).catch(function () {
		 $scope.form['hash:konto::isUnique'] = true;
		});
	});
		$scope.$watchGroup(['form[\'konto\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Fop_fints_konto/fetchBe4e517bcab327042669d75d9e676b9f5f5a9a843d9e57e3f4b4cd3fbb948c22_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'konto\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['2ZJnnPGF'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'2ZJnnPGF\']) === null || (form[\'2ZJnnPGF\']) === \'0\' ? (false) : (form[\'2ZJnnPGF\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('form[\'hash:konto::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_campaignState_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_campaignTarget_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
	$scope.$watchGroup(['form[\'campaign\']', 'form[\'target\']'], function (newval) {
	   $http.get('Tables/CampaignTarget/campaigntargetUnique?context=' + encodeURIComponent(newval[0]) + '&value=' + encodeURIComponent(newval[1]) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['campaign:target::isUnique'] = req.data;
	   }).catch(function () {
		 $scope.form['campaign:target::isUnique'] = true;
		});
	});
		$scope.$watchGroup(['form[\'campaign\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Campaign/fetch6c87eaeb3f27fd76105907c05088f0d75b563f0afda50359d692790806c0b7ed_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'campaign\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['CkHlp5PE'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'target\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch88cf9919f703ad0057b87736d14ecb31e9db0fb50c4f6cde55baaa36bb5af625_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'target\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['gamUdXIr'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'target\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch5f3359c11668deac25a4d45137caa29a416637e0de1e06884fad3ad8c538cfe8_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'target\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['PW9rw6As'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'target\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch4f39b0d23932e247f462535fea9ee95e28937e996247ab473e49af31193b1405_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'target\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['CoxcrW6l'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'CkHlp5PE\']) === null || (form[\'CkHlp5PE\']) === \'0\' ? (false) : (form[\'CkHlp5PE\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'CoxcrW6l\']) === null || (form[\'CoxcrW6l\']) === \'0\' ? (false) : (form[\'CoxcrW6l\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'PW9rw6As\']) === null || (form[\'PW9rw6As\']) === \'0\' ? (false) : (form[\'PW9rw6As\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'gamUdXIr\']) === null || (form[\'gamUdXIr\']) === \'0\' ? (false) : (form[\'gamUdXIr\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('form[\'campaign:target::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_brief_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_briefVorlage_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_doc_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'to-mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch33682e8723b3cd8b498e3a6159829621f77b9e56d893e1f1f25004c6bbbc3df9_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'to-mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['Lz3GkDZU'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'to-mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch865172ed5768c242d6b45e5ff377351532fd3bc8c82279a12d976c55f56fff3b_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'to-mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['NZmTwx0z'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'to-protokoll\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Protokoll/fetch90a970a85288f06c92e34926b2f5b53f07be6328cf66691de41ccccb9b01670a_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'to-protokoll\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['S0UBR3pi'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'to-mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetchF71986f7b3a9dafab8aaa15c1a3c801bb7f4afc6ecdd7755e359372112ead8e0_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'to-mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['kXMUqzLH'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'to-gruppe\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Gruppe/fetchA761039152588d38de8934a8ef9cd3ef65093cda444a340e07f86ce069fb99b8_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'to-gruppe\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['7zme5GbR'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/DocType/fetchC1dbb97daa5acf3e000388494be04666586344caeb89cb9f6c0f1149df437f91form_doc?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['6GSnIHxl'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/DocType/fetchC28eef9509deea64636d94990f3ede3aaeb3c72aa983dce42773d76f10af6aaaform_doc?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['51Tp3gKR'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/DocType/fetchDfaec2dbd409b00248fa2454261d66db2accbfdcad1a05c6acef408f18809bb2form_doc?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['lBXFiXqU'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'7zme5GbR\']) === null || (form[\'7zme5GbR\']) === \'0\' ? (true) : (form[\'7zme5GbR\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'Lz3GkDZU\']) === null || (form[\'Lz3GkDZU\']) === \'0\' ? (true) : (form[\'Lz3GkDZU\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'NZmTwx0z\']) === null || (form[\'NZmTwx0z\']) === \'0\' ? (true) : (form[\'NZmTwx0z\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'kXMUqzLH\']) === null || (form[\'kXMUqzLH\']) === \'0\' ? (true) : (form[\'kXMUqzLH\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'S0UBR3pi\']) === null || (form[\'S0UBR3pi\']) === \'0\' ? (true) : (form[\'S0UBR3pi\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_doc_revision_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_draft_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'mailbox\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Fop_mail_host_box/fetchFop_mail_host_box_draft_create_contentSignature_defaultDynamicwf_fop_mail_host_box_draft_create_contentSignature_defaultDynamic?id=' + encodeURIComponent($scope.$eval('form[\'mailbox\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['bSmounP7'] = req.data;
			});
		});
		var contentSignatureVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'contentSignature\']', 'form[\'bSmounP7\']'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && contentSignatureVirgin)
				scope.form['contentSignature'] = angular.copy(newValues[1]);
			if (newValues[1] !== undefined)
				contentSignatureVirgin = fop_equals(scope.form['contentSignature'], newValues[1]);
		});
	

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_draft_recipient_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_draft_attachment_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		var from_nameVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'from_name\']', 'form[\'user\']'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && from_nameVirgin)
				scope.form['from_name'] = angular.copy(newValues[1]);
			if (newValues[1] !== undefined)
				from_nameVirgin = fop_equals(scope.form['from_name'], newValues[1]);
		});
	
		var from_addressVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'from_address\']', 'form[\'user\']'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && from_addressVirgin)
				scope.form['from_address'] = angular.copy(newValues[1]);
			if (newValues[1] !== undefined)
				from_addressVirgin = fop_equals(scope.form['from_address'], newValues[1]);
		});
	

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_dir_email_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'directory\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Fop_mail_host_box_dir/fetch68cb1cba2d73fab194f58a813537b5285ce9422da3990dfa5f902fff759dd706_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'directory\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['PXLLPZCy'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'PXLLPZCy\']) === null || (form[\'PXLLPZCy\']) === \'0\' ? (false) : (form[\'PXLLPZCy\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_dir_email_thread_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
	$scope.$watchGroup(['form[\'email\']', 'form[\'threadedemail\']'], function (newval) {
	   $http.get('Tables/Fop_mail_host_box_dir_email_thread/emailthreadedemailUnique?context=' + encodeURIComponent(newval[0]) + '&value=' + encodeURIComponent(newval[1]) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['email:threadedemail::isUnique'] = req.data;
	   }).catch(function () {
		 $scope.form['email:threadedemail::isUnique'] = true;
		});
	});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('form[\'email:threadedemail::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_dir_email_recipient_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_dir_email_attachment_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_share_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		var smtp_hostVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'smtp_host\']', 'form[\'imap_host\']'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && smtp_hostVirgin)
				scope.form['smtp_host'] = angular.copy(newValues[1]);
			if (newValues[1] !== undefined)
				smtp_hostVirgin = fop_equals(scope.form['smtp_host'], newValues[1]);
		});
	

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_aufgabeEvent_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'ticket\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Aufgabe/fetchAufgabeEvent_create_state_defaultDynamicwf_aufgabeEvent_create_state_defaultDynamic?id=' + encodeURIComponent($scope.$eval('form[\'ticket\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['uPJ9nAoQ'] = req.data;
			});
		});
		var stateVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'state\']', 'form[\'uPJ9nAoQ\']'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && stateVirgin)
				scope.form['state'] = angular.copy(newValues[1] ?? '0');
			if (newValues[1] !== undefined)
				stateVirgin = fop_equals(scope.form['state'], newValues[1] ?? '0');
		});
	

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_chat_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_aufgabeAnhang_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_gruppeItem_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
	$scope.$watchGroup(['form[\'list\']', 'form[\'item\']'], function (newval) {
	   $http.get('Tables/GruppeItem/listitemUnique?context=' + encodeURIComponent(newval[0]) + '&value=' + encodeURIComponent(newval[1]) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['list:item::isUnique'] = req.data;
	   }).catch(function () {
		 $scope.form['list:item::isUnique'] = true;
		});
	});
		$scope.$watchGroup(['form[\'list\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Gruppe/fetch9978b4ed21e69d8d8f26cf52904827a6d2619130026e4387ec597b5e81027c66_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'list\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['WoNKw4Oa'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'list\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Gruppe/fetchB5771ec66c94e73c0910ffa7ae34724ba269575117e6e3d7f7b20e7383244ba0_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'list\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['GM2ROBSz'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('form[\'list:item::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'WoNKw4Oa\']) === null || (form[\'WoNKw4Oa\']) === \'0\' ? (false) : (form[\'WoNKw4Oa\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'GM2ROBSz\']) === null || (form[\'GM2ROBSz\']) === \'0\' ? (false) : (form[\'GM2ROBSz\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_docType_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watch('form[\'name\']', function (newval) {
			$.get('Tables/DocType/nameDuplicates?to=' + encodeURIComponent(newval), function (results) {
				$scope.duplicates_name = results;
				$scope.$apply();
			});
		});
	
	$scope.$watch('form[\'name\']', function (newval) {
	   $http.get('Tables/DocType/nameUnique?value=' + encodeURIComponent(newval) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['name::isUnique'] = req.data;
	   });
	});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('form[\'name::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_aufgabeType_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watch('form[\'name\']', function (newval) {
			$.get('Tables/AufgabeType/nameDuplicates?to=' + encodeURIComponent(newval), function (results) {
				$scope.duplicates_name = results;
				$scope.$apply();
			});
		});
	
	$scope.$watch('form[\'name\']', function (newval) {
	   $http.get('Tables/AufgabeType/nameUnique?value=' + encodeURIComponent(newval) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['name::isUnique'] = req.data;
	   });
	});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_aufgabeType_createAufgabePropertyType_restrict"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('item[\'name::isUnique\']', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="aufgabePropertyType_restrict[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
			if (!$scope.$eval('form[\'name::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_aufgabeState_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watch('form[\'name\']', function (newval) {
			$.get('Tables/AufgabeState/nameDuplicates?to=' + encodeURIComponent(newval), function (results) {
				$scope.duplicates_name = results;
				$scope.$apply();
			});
		});
	
	$scope.$watch('form[\'name\']', function (newval) {
	   $http.get('Tables/AufgabeState/nameUnique?value=' + encodeURIComponent(newval) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['name::isUnique'] = req.data;
	   });
	});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('form[\'name::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_aufgabePropertyDropdown_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watch('form[\'name\']', function (newval) {
			$.get('Tables/AufgabePropertyDropdown/nameDuplicates?to=' + encodeURIComponent(newval), function (results) {
				$scope.duplicates_name = results;
				$scope.$apply();
			});
		});
	
	$scope.$watch('form[\'name\']', function (newval) {
	   $http.get('Tables/AufgabePropertyDropdown/nameUnique?value=' + encodeURIComponent(newval) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['name::isUnique'] = req.data;
	   });
	});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('form[\'name::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_sammlung_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		$scope.globals = globals;
		function updateCheckboxes_matrix_sammlungMitglied_sammlung_mitglied() {
			$('.cm-matrix_sammlungMitglied_sammlung_mitglied').find('.mdl-checkbox').each(function (i, x) {
				x.MaterialCheckbox.updateClasses_();
			});
		}

		$scope.matrixCheckboxMatrix_sammlungMitglied_sammlung_mitglied = {}; // items
		

		$scope.matrixRegisterMatrix_sammlungMitglied_sammlung_mitglied = function (id, item) {
			setTimeout(function () {
				$scope.matrixCheckboxMatrix_sammlungMitglied_sammlung_mitglied[id] = item;
				$scope.$apply();
			}, 0);
		}

		$scope.getMatrix_sammlungMitglied_sammlung_mitgliedValues = function () {
				  let values = [];
				  $('tbody.cm-matrix_sammlungMitglied_sammlung_mitglied tr').each(function (i, x) {
							 let checked = $(x).find('.matrix_checkbox:checked').length != 0;
							 if (checked || $(x).find('[name="matrix_sammlungMitglied_sammlung_mitglied_ID[]"]').val()) {
								 var item = {
									 'mitglied': $(x).find('input[type=hidden][name=matrix_sammlungMitglied_sammlung_mitglied_mitglied]').val(),
								 };
								 if (checked) item._checked = true; // wenn nicht, darf es NICHT gesetzt sein
								 $(x).find('[name]').each(function (i, x) {
											var match = /matrix_sammlungMitglied_sammlung_mitglied_(.*)\[\]/.exec(x.name);
											if (match) {
													  item[match[1]] = $(x).val() || $(x).text(); // TODO: auf Datentyp-Ebene eine Extraktionsmethode bauen! komplexere Numeric-Typen klappen hiermit nicht; Dropdowns können mit NULL Probleme haben; noch einfacher wäre einfach die Nutzung des Original-ng-Models
											}
								 });
								 values.push(item);
							 }
				  });
				  return values;
		};

		$scope.$watch('matrixCheckboxMatrix_sammlungMitglied_sammlung_mitglied', function (newval, oldval) {
			// Binding aktualisieren
			

			for (var key in newval) {
				if (!newval.hasOwnProperty(key)) continue;

				let item = newval[key];
				element = $('input[name="matrix_sammlungMitglied_sammlung_mitglied__' + key.replace(/[^a-zA-Z0-9_]/g) + '"]').parent()[0];

				if (element != undefined && element.MaterialCheckbox != undefined) {
					if (item.checked) {
						element.MaterialCheckbox.check();
					} else {
						element.MaterialCheckbox.uncheck();
					}
				} else {
					delete newval[key];
				}
			}
			let lengthTotal = Object.keys(newval).length;
			let lengthChecked = Object.keys(newval).filter((x) => {return newval[x].checked}).length;

			
			let el = $('#cm-matrix_sammlungMitglied_sammlung_mitglied-allselect').parent()[0];
			if (el.MaterialCheckbox) {
				if (lengthTotal == lengthChecked) {
					el.MaterialCheckbox.check();
				} else {
					el.MaterialCheckbox.uncheck();
				}
			}
		}, true);

		
		$scope.cmMatrix_sammlungMitglied_sammlung_mitgliedAllSelectToggle = function () {
			let value = $('#cm-matrix_sammlungMitglied_sammlung_mitglied-allselect').prop('checked');

			for (key in $scope.matrixCheckboxMatrix_sammlungMitglied_sammlung_mitglied) {
				if (!$scope.matrixCheckboxMatrix_sammlungMitglied_sammlung_mitglied.hasOwnProperty(key)) continue;

				let item = $scope.matrixCheckboxMatrix_sammlungMitglied_sammlung_mitglied[key];
				item.checked = value;
			};

			setTimeout(updateCheckboxes_matrix_sammlungMitglied_sammlung_mitglied, 0);
		}


		
	

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_sammlung_editMatrix_sammlungMitglied_sammlung_mitglied"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(globals[\'user:sammlung\']) === null || (globals[\'user:sammlung\']) === \'0\' ? (false) : (globals[\'user:sammlung\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		}
	});
	
	app.controller('FormWf_gruppeVerantwortlich_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'gruppe\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Gruppe/fetch475d97ee612072af97289bb9dd35989f41e90659cf7f8392e95132536176445f_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'gruppe\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['fBbeiLnC'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'gruppe\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Gruppe/fetch2747a0996069a86648328e7fdb2c91ca600d10fb286d0ea79aaee5d9d027bdfc_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'gruppe\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['wyrUOtPx'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'fBbeiLnC\']) === null || (form[\'fBbeiLnC\']) === \'0\' ? (false) : (form[\'fBbeiLnC\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'wyrUOtPx\']) === null || (form[\'wyrUOtPx\']) === \'0\' ? (false) : (form[\'wyrUOtPx\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_mitgliedPassnummer_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetchE769306a2b4fbb0689e923b14fbc78fe3dca5f6993212644bf24313bc2a4c66a_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['0Sju7gXS'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch3e6af08e75cc408645a91847036faecdae7fa1b38dfea79d65b02adbaca271d4_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['jVTTiriC'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetchB71bf46989f12939bd76a709489df6abc1b1bda456765fad8896b4a3cb6cdeb8_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['NMfpLDuB'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'jVTTiriC\']) === null || (form[\'jVTTiriC\']) === \'0\' ? (false) : (form[\'jVTTiriC\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'NMfpLDuB\']) === null || (form[\'NMfpLDuB\']) === \'0\' ? (false) : (form[\'NMfpLDuB\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'0Sju7gXS\']) === null || (form[\'0Sju7gXS\']) === \'0\' ? (false) : (form[\'0Sju7gXS\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_ansprechpartner_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetchB66f96f88699c8b4179d79f2d26504870dd9bb08b414f3b57f09ec0093248f5d_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['KRTKa3PB'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch323ecd8885146a279378a39cd7ff54bc5f5837cbe99da0e2785f6f4a2568bb44_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['7mTqtpk9'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch3d54e9f0036357317fab3cb33650bfd7ff0cd5d651774554bdd1f31a4c00dae2_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['gKmZLtRS'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'gKmZLtRS\']) === null || (form[\'gKmZLtRS\']) === \'0\' ? (false) : (form[\'gKmZLtRS\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'7mTqtpk9\']) === null || (form[\'7mTqtpk9\']) === \'0\' ? (false) : (form[\'7mTqtpk9\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'KRTKa3PB\']) === null || (form[\'KRTKa3PB\']) === \'0\' ? (false) : (form[\'KRTKa3PB\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_protokoll_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		$scope.globals = globals;

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_protokoll_editProtokollPunkt_protokoll"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(globals[\'user:protokoll\']) === null || (globals[\'user:protokoll\']) === \'0\' ? (false) : (globals[\'user:protokoll\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="protokollPunkt_protokoll[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		}
	});
	
	app.controller('FormWf_protokollPunkt_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'protokoll\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Protokoll/fetchFb4cbfcbf6d3b793d6ddf5b6c1c11ee1053ba6e0778ef8f3955d4f418f2a6536_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'protokoll\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['O3t2RXGP'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'O3t2RXGP\']) === null || (form[\'O3t2RXGP\']) === \'0\' ? (false) : (form[\'O3t2RXGP\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_protokollVorlage_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_tarif_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_fints_bank_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
	$scope.$watch('form[\'blz\']', function (newval) {
	   $http.get('Tables/Fop_fints_bank/blzUnique?value=' + encodeURIComponent(newval) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['blz::isUnique'] = req.data;
	   });
	});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('form[\'blz::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_fop_fints_file_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_fints_tanMode_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_fints_buchung_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
	$scope.$watchGroup(['form[\'hash\']', 'form[\'konto\']'], function (newval) {
	   $http.get('Tables/Fop_fints_buchung/hashkontoUnique?context=' + encodeURIComponent(newval[0]) + '&value=' + encodeURIComponent(newval[1]) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['hash:konto::isUnique'] = req.data;
	   }).catch(function () {
		 $scope.form['hash:konto::isUnique'] = true;
		});
	});
		$scope.$watchGroup(['form[\'konto\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Fop_fints_konto/fetchBe4e517bcab327042669d75d9e676b9f5f5a9a843d9e57e3f4b4cd3fbb948c22_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'konto\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['2ZJnnPGF'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'2ZJnnPGF\']) === null || (form[\'2ZJnnPGF\']) === \'0\' ? (false) : (form[\'2ZJnnPGF\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('form[\'hash:konto::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_campaignState_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_campaignTarget_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
	$scope.$watchGroup(['form[\'campaign\']', 'form[\'target\']'], function (newval) {
	   $http.get('Tables/CampaignTarget/campaigntargetUnique?context=' + encodeURIComponent(newval[0]) + '&value=' + encodeURIComponent(newval[1]) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['campaign:target::isUnique'] = req.data;
	   }).catch(function () {
		 $scope.form['campaign:target::isUnique'] = true;
		});
	});
		$scope.$watchGroup(['form[\'campaign\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Campaign/fetch6c87eaeb3f27fd76105907c05088f0d75b563f0afda50359d692790806c0b7ed_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'campaign\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['CkHlp5PE'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'target\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch88cf9919f703ad0057b87736d14ecb31e9db0fb50c4f6cde55baaa36bb5af625_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'target\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['gamUdXIr'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'target\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch5f3359c11668deac25a4d45137caa29a416637e0de1e06884fad3ad8c538cfe8_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'target\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['PW9rw6As'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'target\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch4f39b0d23932e247f462535fea9ee95e28937e996247ab473e49af31193b1405_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'target\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['CoxcrW6l'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'CkHlp5PE\']) === null || (form[\'CkHlp5PE\']) === \'0\' ? (false) : (form[\'CkHlp5PE\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'CoxcrW6l\']) === null || (form[\'CoxcrW6l\']) === \'0\' ? (false) : (form[\'CoxcrW6l\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'PW9rw6As\']) === null || (form[\'PW9rw6As\']) === \'0\' ? (false) : (form[\'PW9rw6As\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'gamUdXIr\']) === null || (form[\'gamUdXIr\']) === \'0\' ? (false) : (form[\'gamUdXIr\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('form[\'campaign:target::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_brief_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_briefVorlage_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_doc_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'to-mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch33682e8723b3cd8b498e3a6159829621f77b9e56d893e1f1f25004c6bbbc3df9_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'to-mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['Lz3GkDZU'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'to-mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch865172ed5768c242d6b45e5ff377351532fd3bc8c82279a12d976c55f56fff3b_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'to-mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['NZmTwx0z'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'to-protokoll\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Protokoll/fetch90a970a85288f06c92e34926b2f5b53f07be6328cf66691de41ccccb9b01670a_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'to-protokoll\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['S0UBR3pi'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'to-mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetchF71986f7b3a9dafab8aaa15c1a3c801bb7f4afc6ecdd7755e359372112ead8e0_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'to-mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['kXMUqzLH'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'to-gruppe\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Gruppe/fetchA761039152588d38de8934a8ef9cd3ef65093cda444a340e07f86ce069fb99b8_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'to-gruppe\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['7zme5GbR'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/DocType/fetchC1dbb97daa5acf3e000388494be04666586344caeb89cb9f6c0f1149df437f91form_doc?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['6GSnIHxl'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/DocType/fetchC28eef9509deea64636d94990f3ede3aaeb3c72aa983dce42773d76f10af6aaaform_doc?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['51Tp3gKR'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/DocType/fetchDfaec2dbd409b00248fa2454261d66db2accbfdcad1a05c6acef408f18809bb2form_doc?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['lBXFiXqU'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'7zme5GbR\']) === null || (form[\'7zme5GbR\']) === \'0\' ? (true) : (form[\'7zme5GbR\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'Lz3GkDZU\']) === null || (form[\'Lz3GkDZU\']) === \'0\' ? (true) : (form[\'Lz3GkDZU\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'NZmTwx0z\']) === null || (form[\'NZmTwx0z\']) === \'0\' ? (true) : (form[\'NZmTwx0z\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'kXMUqzLH\']) === null || (form[\'kXMUqzLH\']) === \'0\' ? (true) : (form[\'kXMUqzLH\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'S0UBR3pi\']) === null || (form[\'S0UBR3pi\']) === \'0\' ? (true) : (form[\'S0UBR3pi\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_doc_revision_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_draft_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'mailbox\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Fop_mail_host_box/fetchFop_mail_host_box_draft_edit_contentSignature_defaultDynamicwf_fop_mail_host_box_draft_edit_contentSignature_defaultDynamic?id=' + encodeURIComponent($scope.$eval('form[\'mailbox\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['R83zLShh'] = req.data;
			});
		});
		var contentSignatureVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'contentSignature\']', 'form[\'R83zLShh\']'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && contentSignatureVirgin)
				scope.form['contentSignature'] = angular.copy(newValues[1]);
			if (newValues[1] !== undefined)
				contentSignatureVirgin = fop_equals(scope.form['contentSignature'], newValues[1]);
		});
	

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_draft_recipient_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_draft_attachment_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		var from_nameVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'from_name\']', 'form[\'user\']'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && from_nameVirgin)
				scope.form['from_name'] = angular.copy(newValues[1]);
			if (newValues[1] !== undefined)
				from_nameVirgin = fop_equals(scope.form['from_name'], newValues[1]);
		});
	
		var from_addressVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'from_address\']', 'form[\'user\']'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && from_addressVirgin)
				scope.form['from_address'] = angular.copy(newValues[1]);
			if (newValues[1] !== undefined)
				from_addressVirgin = fop_equals(scope.form['from_address'], newValues[1]);
		});
	

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_dir_email_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'directory\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Fop_mail_host_box_dir/fetch68cb1cba2d73fab194f58a813537b5285ce9422da3990dfa5f902fff759dd706_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'directory\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['PXLLPZCy'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'PXLLPZCy\']) === null || (form[\'PXLLPZCy\']) === \'0\' ? (false) : (form[\'PXLLPZCy\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_dir_email_thread_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
	$scope.$watchGroup(['form[\'email\']', 'form[\'threadedemail\']'], function (newval) {
	   $http.get('Tables/Fop_mail_host_box_dir_email_thread/emailthreadedemailUnique?context=' + encodeURIComponent(newval[0]) + '&value=' + encodeURIComponent(newval[1]) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['email:threadedemail::isUnique'] = req.data;
	   }).catch(function () {
		 $scope.form['email:threadedemail::isUnique'] = true;
		});
	});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('form[\'email:threadedemail::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_dir_email_recipient_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_dir_email_attachment_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_share_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_mail_host_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		var smtp_hostVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'smtp_host\']', 'form[\'imap_host\']'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && smtp_hostVirgin)
				scope.form['smtp_host'] = angular.copy(newValues[1]);
			if (newValues[1] !== undefined)
				smtp_hostVirgin = fop_equals(scope.form['smtp_host'], newValues[1]);
		});
	

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_aufgabeEvent_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'ticket\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Aufgabe/fetchAufgabeEvent_edit_state_defaultDynamicwf_aufgabeEvent_edit_state_defaultDynamic?id=' + encodeURIComponent($scope.$eval('form[\'ticket\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['5jK8D6LL'] = req.data;
			});
		});
		var stateVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'state\']', 'form[\'5jK8D6LL\']'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && stateVirgin)
				scope.form['state'] = angular.copy(newValues[1] ?? '0');
			if (newValues[1] !== undefined)
				stateVirgin = fop_equals(scope.form['state'], newValues[1] ?? '0');
		});
	

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_chat_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_aufgabeAnhang_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_gruppeItem_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
	$scope.$watchGroup(['form[\'list\']', 'form[\'item\']'], function (newval) {
	   $http.get('Tables/GruppeItem/listitemUnique?context=' + encodeURIComponent(newval[0]) + '&value=' + encodeURIComponent(newval[1]) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['list:item::isUnique'] = req.data;
	   }).catch(function () {
		 $scope.form['list:item::isUnique'] = true;
		});
	});
		$scope.$watchGroup(['form[\'list\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Gruppe/fetch9978b4ed21e69d8d8f26cf52904827a6d2619130026e4387ec597b5e81027c66_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'list\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['WoNKw4Oa'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'list\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Gruppe/fetchB5771ec66c94e73c0910ffa7ae34724ba269575117e6e3d7f7b20e7383244ba0_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'list\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['GM2ROBSz'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('form[\'list:item::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'WoNKw4Oa\']) === null || (form[\'WoNKw4Oa\']) === \'0\' ? (false) : (form[\'WoNKw4Oa\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'GM2ROBSz\']) === null || (form[\'GM2ROBSz\']) === \'0\' ? (false) : (form[\'GM2ROBSz\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_docType_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watch('form[\'name\']', function (newval) {
			$.get('Tables/DocType/nameDuplicates?to=' + encodeURIComponent(newval), function (results) {
				$scope.duplicates_name = results;
				$scope.$apply();
			});
		});
	
	$scope.$watch('form[\'name\']', function (newval) {
	   $http.get('Tables/DocType/nameUnique?value=' + encodeURIComponent(newval) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['name::isUnique'] = req.data;
	   });
	});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('form[\'name::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_aufgabeType_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watch('form[\'name\']', function (newval) {
			$.get('Tables/AufgabeType/nameDuplicates?to=' + encodeURIComponent(newval), function (results) {
				$scope.duplicates_name = results;
				$scope.$apply();
			});
		});
	
	$scope.$watch('form[\'name\']', function (newval) {
	   $http.get('Tables/AufgabeType/nameUnique?value=' + encodeURIComponent(newval) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['name::isUnique'] = req.data;
	   });
	});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_aufgabeType_editAufgabePropertyType_restrict"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('item[\'name::isUnique\']', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="aufgabePropertyType_restrict[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
			if (!$scope.$eval('form[\'name::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_aufgabeState_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watch('form[\'name\']', function (newval) {
			$.get('Tables/AufgabeState/nameDuplicates?to=' + encodeURIComponent(newval), function (results) {
				$scope.duplicates_name = results;
				$scope.$apply();
			});
		});
	
	$scope.$watch('form[\'name\']', function (newval) {
	   $http.get('Tables/AufgabeState/nameUnique?value=' + encodeURIComponent(newval) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['name::isUnique'] = req.data;
	   });
	});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('form[\'name::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_aufgabePropertyDropdown_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watch('form[\'name\']', function (newval) {
			$.get('Tables/AufgabePropertyDropdown/nameDuplicates?to=' + encodeURIComponent(newval), function (results) {
				$scope.duplicates_name = results;
				$scope.$apply();
			});
		});
	
	$scope.$watch('form[\'name\']', function (newval) {
	   $http.get('Tables/AufgabePropertyDropdown/nameUnique?value=' + encodeURIComponent(newval) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['name::isUnique'] = req.data;
	   });
	});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('form[\'name::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_campaignAttachment_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_mitgliedDynamicMonthyear_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_tarifDynamicMonthyear_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_docType_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_aufgabeType_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_aufgabeState_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_aufgabePropertyDropdown_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_aufgabePropertyType_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormCampaignAttachment', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormMitgliedDynamicMonthyear', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormTarifDynamicMonthyear', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormUserconfig', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormReminderAufgabeAssigned', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormReminderAufgabeNot_assigned', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_userconfig_deleteConfirm', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_campaignAttachment_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'campaign\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Campaign/fetchB3bfb3b26e060a46c3be6517e62f85559c85e610384acfa0bf88acfa9b851dd3_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'campaign\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['H4ulQMbq'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'H4ulQMbq\']) === null || (form[\'H4ulQMbq\']) === \'0\' ? (false) : (form[\'H4ulQMbq\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_mitgliedDynamicMonthyear_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
	$scope.$watchGroup(['form[\'dynamic:parent\']', 'form[\'dynamic:time\']'], function (newval) {
	   $http.get('Tables/MitgliedDynamicMonthyear/dynamic_parentdynamic_timeUnique?context=' + encodeURIComponent(newval[0]) + '&value=' + encodeURIComponent(newval[1]) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['dynamic:parent:dynamic:time::isUnique'] = req.data;
	   }).catch(function () {
		 $scope.form['dynamic:parent:dynamic:time::isUnique'] = true;
		});
	});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('form[\'dynamic:parent:dynamic:time::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_tarifDynamicMonthyear_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
	$scope.$watchGroup(['form[\'dynamic:parent\']', 'form[\'dynamic:time\']'], function (newval) {
	   $http.get('Tables/TarifDynamicMonthyear/dynamic_parentdynamic_timeUnique?context=' + encodeURIComponent(newval[0]) + '&value=' + encodeURIComponent(newval[1]) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['dynamic:parent:dynamic:time::isUnique'] = req.data;
	   }).catch(function () {
		 $scope.form['dynamic:parent:dynamic:time::isUnique'] = true;
		});
	});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('form[\'dynamic:parent:dynamic:time::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_userconfig_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_campaignAttachment_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'campaign\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Campaign/fetchB3bfb3b26e060a46c3be6517e62f85559c85e610384acfa0bf88acfa9b851dd3_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'campaign\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['H4ulQMbq'] = req.data;
			});
		});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'H4ulQMbq\']) === null || (form[\'H4ulQMbq\']) === \'0\' ? (false) : (form[\'H4ulQMbq\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_mitgliedDynamicMonthyear_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
	$scope.$watchGroup(['form[\'dynamic:parent\']', 'form[\'dynamic:time\']'], function (newval) {
	   $http.get('Tables/MitgliedDynamicMonthyear/dynamic_parentdynamic_timeUnique?context=' + encodeURIComponent(newval[0]) + '&value=' + encodeURIComponent(newval[1]) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['dynamic:parent:dynamic:time::isUnique'] = req.data;
	   }).catch(function () {
		 $scope.form['dynamic:parent:dynamic:time::isUnique'] = true;
		});
	});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('form[\'dynamic:parent:dynamic:time::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_tarifDynamicMonthyear_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
	$scope.$watchGroup(['form[\'dynamic:parent\']', 'form[\'dynamic:time\']'], function (newval) {
	   $http.get('Tables/TarifDynamicMonthyear/dynamic_parentdynamic_timeUnique?context=' + encodeURIComponent(newval[0]) + '&value=' + encodeURIComponent(newval[1]) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['dynamic:parent:dynamic:time::isUnique'] = req.data;
	   }).catch(function () {
		 $scope.form['dynamic:parent:dynamic:time::isUnique'] = true;
		});
	});

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('form[\'dynamic:parent:dynamic:time::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_userconfig_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_userconfig_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormChangepw', function($scope, $http, $element, globals) {
		// Watchers etc.
		$scope.Number = Number;

		// Submitting
		$scope.submit = function ($event) {
			
			if (!$scope.$eval('(form[\'oldpw\']) != (form[\'newpw\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormImportDynamicmitglied_Import', function($scope, $http, $element, globals) {
		// Watchers etc.
		

		// Submitting
		$scope.submit = function ($event) {
			
		}
	});
	
	app.controller('FormWf_mitgliedBuchung_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		$scope.Number = Number;

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_sammlungMitglied_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		$scope.Number = Number;

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_sammlungMitglied_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'sammlung\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Sammlung/fetchCa8cb255e8a2a13dd6125fc7843613b49000d7ec23a8ceff65e9e3600c4598b2_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'sammlung\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['NIB3KzyA'] = req.data;
			});
		});$scope.Number = Number;

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'NIB3KzyA\']) === null || (form[\'NIB3KzyA\']) === \'0\' ? (false) : (form[\'NIB3KzyA\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_sammlungMitglied_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'sammlung\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Sammlung/fetchCa8cb255e8a2a13dd6125fc7843613b49000d7ec23a8ceff65e9e3600c4598b2_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'sammlung\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['NIB3KzyA'] = req.data;
			});
		});$scope.Number = Number;

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'NIB3KzyA\']) === null || (form[\'NIB3KzyA\']) === \'0\' ? (false) : (form[\'NIB3KzyA\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormGroupWf_sammlung_createMatrix_sammlungMitglied_sammlung_mitglied', function($scope, $http, $element){
		// watchers
		$scope.Number = Number;
	});
	
	app.controller('FormGroupWf_sammlung_editMatrix_sammlungMitglied_sammlung_mitglied', function($scope, $http, $element){
		// watchers
		$scope.Number = Number;
	});
	
	app.controller('FormWf_aufgabePropertyType_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watch('form[\'name\']', function (newval) {
			$.get('Tables/AufgabePropertyType/nameDuplicates?to=' + encodeURIComponent(newval), function (results) {
				$scope.duplicates_name = results;
				$scope.$apply();
			});
		});
	
	$scope.$watch('form[\'name\']', function (newval) {
	   $http.get('Tables/AufgabePropertyType/nameUnique?value=' + encodeURIComponent(newval) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['name::isUnique'] = req.data;
	   });
	});$scope.Number = Number;

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_aufgabePropertyType_createAufgabePropertyDropdown_property"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('item[\'name::isUnique\']', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="aufgabePropertyDropdown_property[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
			if (!$scope.$eval('form[\'name::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_aufgabePropertyType_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watch('form[\'name\']', function (newval) {
			$.get('Tables/AufgabePropertyType/nameDuplicates?to=' + encodeURIComponent(newval), function (results) {
				$scope.duplicates_name = results;
				$scope.$apply();
			});
		});
	
	$scope.$watch('form[\'name\']', function (newval) {
	   $http.get('Tables/AufgabePropertyType/nameUnique?value=' + encodeURIComponent(newval) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['name::isUnique'] = req.data;
	   });
	});$scope.Number = Number;

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_aufgabePropertyType_editAufgabePropertyDropdown_property"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('item[\'name::isUnique\']', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="aufgabePropertyDropdown_property[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
			if (!$scope.$eval('form[\'name::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_campaignFollow_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		$scope.Number = Number;

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormWf_campaignFollow_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		$scope.Number = Number;

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_gruppe_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'ID\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/GruppeVerantwortlich/fetch352c8f11836dedcd28038b25f3195a3123576f497044d958412f198933bb76ba_23_ebnf_Expression6_117_ebnf_anchorsymbol_118_27formarray_wf_gruppe_create_gruppeVerantwortlich_gruppe_a_fBbeiLnC?id=' + encodeURIComponent($scope.$eval('form[\'ID\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['Wk3yjwJT'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'ID\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/GruppeVerantwortlich/fetch352c8f11836dedcd28038b25f3195a3123576f497044d958412f198933bb76ba_23_ebnf_Expression6_117_ebnf_anchorsymbol_118_27formarray_wf_gruppe_create_gruppeItem_list_a_WoNKw4Oa?id=' + encodeURIComponent($scope.$eval('form[\'ID\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['Wk3yjwJT'] = req.data;
			});
		});$scope.globals = globals;

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_gruppe_createGruppeItem_list"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('item[\'list:item::isUnique\']', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="gruppeItem_list[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_gruppe_createGruppeItem_list"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('((globals[\'user:mitglied\']) ? (true) : (! (! (form[\'Wk3yjwJT\'])))) === null || ((globals[\'user:mitglied\']) ? (true) : (! (! (form[\'Wk3yjwJT\'])))) === \'0\' ? (false) : ((globals[\'user:mitglied\']) ? (true) : (! (! (form[\'Wk3yjwJT\']))))', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="gruppeItem_list[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_gruppe_createGruppeItem_list"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(globals[\'user:gruppe\']) === null || (globals[\'user:gruppe\']) === \'0\' ? (false) : (globals[\'user:gruppe\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="gruppeItem_list[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_gruppe_createGruppeVerantwortlich_gruppe"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('((globals[\'user:mitglied\']) ? (true) : (! (! (form[\'Wk3yjwJT\'])))) === null || ((globals[\'user:mitglied\']) ? (true) : (! (! (form[\'Wk3yjwJT\'])))) === \'0\' ? (false) : ((globals[\'user:mitglied\']) ? (true) : (! (! (form[\'Wk3yjwJT\']))))', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="gruppeVerantwortlich_gruppe[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_gruppe_createGruppeVerantwortlich_gruppe"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(globals[\'user:gruppe\']) === null || (globals[\'user:gruppe\']) === \'0\' ? (false) : (globals[\'user:gruppe\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="gruppeVerantwortlich_gruppe[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		}
	});
	
	app.controller('FormWf_aufgabeProperty_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetch35e23690b66398879270c51d124ec1860537e7989071057498eb4b453606450c_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41form_aufgabeProperty?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['DesVaCQB'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetch227b88d364ced78cd00df32c6ddb159ea8b71bffe8f4815e62cad9f26bb0bb44_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41form_aufgabeProperty?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['qlmkLYxD'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetch36920dc5291a6cbf6ec78f6ce8c74442925ad33523731aeec25bdf84697aa9a8_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41form_aufgabeProperty?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['W8Efbkfa'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetchBaa903eda2625ec4d53894fb2aa12594bbf60e510692bde7ab2f789971dc0cc8_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41form_aufgabeProperty?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['GIuNXQJJ'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetch823e17eebe13a6c03f44d3e10f1da4285abaf2f4c9a26a662f20d3c83d218f88_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41form_aufgabeProperty?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['zxF57KrA'] = req.data;
			});
		});$scope.Number = Number;

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_campaignFollow_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		$scope.Number = Number;

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_gruppe_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'ID\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/GruppeVerantwortlich/fetch352c8f11836dedcd28038b25f3195a3123576f497044d958412f198933bb76ba_23_ebnf_Expression6_117_ebnf_anchorsymbol_118_27formarray_wf_gruppe_edit_gruppeVerantwortlich_gruppe_a_fBbeiLnC?id=' + encodeURIComponent($scope.$eval('form[\'ID\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['Wk3yjwJT'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'ID\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/GruppeVerantwortlich/fetch352c8f11836dedcd28038b25f3195a3123576f497044d958412f198933bb76ba_23_ebnf_Expression6_117_ebnf_anchorsymbol_118_27formarray_wf_gruppe_edit_gruppeItem_list_a_WoNKw4Oa?id=' + encodeURIComponent($scope.$eval('form[\'ID\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['Wk3yjwJT'] = req.data;
			});
		});$scope.globals = globals;

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_gruppe_editGruppeItem_list"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('item[\'list:item::isUnique\']', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="gruppeItem_list[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_gruppe_editGruppeItem_list"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('((globals[\'user:mitglied\']) ? (true) : (! (! (form[\'Wk3yjwJT\'])))) === null || ((globals[\'user:mitglied\']) ? (true) : (! (! (form[\'Wk3yjwJT\'])))) === \'0\' ? (false) : ((globals[\'user:mitglied\']) ? (true) : (! (! (form[\'Wk3yjwJT\']))))', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="gruppeItem_list[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_gruppe_editGruppeItem_list"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(globals[\'user:gruppe\']) === null || (globals[\'user:gruppe\']) === \'0\' ? (false) : (globals[\'user:gruppe\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="gruppeItem_list[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_gruppe_editGruppeVerantwortlich_gruppe"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('((globals[\'user:mitglied\']) ? (true) : (! (! (form[\'Wk3yjwJT\'])))) === null || ((globals[\'user:mitglied\']) ? (true) : (! (! (form[\'Wk3yjwJT\'])))) === \'0\' ? (false) : ((globals[\'user:mitglied\']) ? (true) : (! (! (form[\'Wk3yjwJT\']))))', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="gruppeVerantwortlich_gruppe[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_gruppe_editGruppeVerantwortlich_gruppe"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(globals[\'user:gruppe\']) === null || (globals[\'user:gruppe\']) === \'0\' ? (false) : (globals[\'user:gruppe\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="gruppeVerantwortlich_gruppe[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		}
	});
	
	app.controller('FormWf_aufgabeProperty_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetch35e23690b66398879270c51d124ec1860537e7989071057498eb4b453606450c_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41form_aufgabeProperty?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['DesVaCQB'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetch227b88d364ced78cd00df32c6ddb159ea8b71bffe8f4815e62cad9f26bb0bb44_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41form_aufgabeProperty?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['qlmkLYxD'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetch36920dc5291a6cbf6ec78f6ce8c74442925ad33523731aeec25bdf84697aa9a8_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41form_aufgabeProperty?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['W8Efbkfa'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetchBaa903eda2625ec4d53894fb2aa12594bbf60e510692bde7ab2f789971dc0cc8_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41form_aufgabeProperty?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['GIuNXQJJ'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetch823e17eebe13a6c03f44d3e10f1da4285abaf2f4c9a26a662f20d3c83d218f88_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41form_aufgabeProperty?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['zxF57KrA'] = req.data;
			});
		});$scope.Number = Number;

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_aufgabeProperty_view', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetch35e23690b66398879270c51d124ec1860537e7989071057498eb4b453606450c_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41form_aufgabeProperty?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['DesVaCQB'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetch227b88d364ced78cd00df32c6ddb159ea8b71bffe8f4815e62cad9f26bb0bb44_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41form_aufgabeProperty?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['qlmkLYxD'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetch36920dc5291a6cbf6ec78f6ce8c74442925ad33523731aeec25bdf84697aa9a8_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41form_aufgabeProperty?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['W8Efbkfa'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetchBaa903eda2625ec4d53894fb2aa12594bbf60e510692bde7ab2f789971dc0cc8_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41form_aufgabeProperty?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['GIuNXQJJ'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetch823e17eebe13a6c03f44d3e10f1da4285abaf2f4c9a26a662f20d3c83d218f88_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41form_aufgabeProperty?id=' + encodeURIComponent($scope.$eval('form[\'type\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['zxF57KrA'] = req.data;
			});
		});$scope.Number = Number;

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'ok') return;
		}
	});
	
	app.controller('FormGroupWf_campaign_cloneMatrix_campaignFollow_campaign_state', function($scope, $http, $element){
		// watchers
		$scope.Number = Number;
	});
	
	app.controller('FormGroupWf_campaign_createMatrix_campaignFollow_campaign_state', function($scope, $http, $element){
		// watchers
		$scope.Number = Number;
	});
	
	app.controller('FormGroupWf_campaign_editMatrix_campaignFollow_campaign_state', function($scope, $http, $element){
		// watchers
		$scope.Number = Number;
	});
	
	app.controller('FormGroupWf_aufgabe_createMatrix_aufgabeProperty_parent_type', function($scope, $http, $element){
		// watchers
		$scope.Number = Number;
		$scope.$watchGroup(['item[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetch35e23690b66398879270c51d124ec1860537e7989071057498eb4b453606450c_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41formarray_wf_aufgabe_create_matrix_aufgabeProperty_parent_type?id=' + encodeURIComponent($scope.$eval('item[\'type\']'))).then(function (req) {
				if (typeof $scope.item !== 'undefined') $scope.item['DesVaCQB'] = req.data;
			});
		});
		$scope.$watchGroup(['item[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetch227b88d364ced78cd00df32c6ddb159ea8b71bffe8f4815e62cad9f26bb0bb44_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41formarray_wf_aufgabe_create_matrix_aufgabeProperty_parent_type?id=' + encodeURIComponent($scope.$eval('item[\'type\']'))).then(function (req) {
				if (typeof $scope.item !== 'undefined') $scope.item['qlmkLYxD'] = req.data;
			});
		});
		$scope.$watchGroup(['item[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetch36920dc5291a6cbf6ec78f6ce8c74442925ad33523731aeec25bdf84697aa9a8_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41formarray_wf_aufgabe_create_matrix_aufgabeProperty_parent_type?id=' + encodeURIComponent($scope.$eval('item[\'type\']'))).then(function (req) {
				if (typeof $scope.item !== 'undefined') $scope.item['W8Efbkfa'] = req.data;
			});
		});
		$scope.$watchGroup(['item[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetchBaa903eda2625ec4d53894fb2aa12594bbf60e510692bde7ab2f789971dc0cc8_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41formarray_wf_aufgabe_create_matrix_aufgabeProperty_parent_type?id=' + encodeURIComponent($scope.$eval('item[\'type\']'))).then(function (req) {
				if (typeof $scope.item !== 'undefined') $scope.item['GIuNXQJJ'] = req.data;
			});
		});
		$scope.$watchGroup(['item[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetch823e17eebe13a6c03f44d3e10f1da4285abaf2f4c9a26a662f20d3c83d218f88_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41formarray_wf_aufgabe_create_matrix_aufgabeProperty_parent_type?id=' + encodeURIComponent($scope.$eval('item[\'type\']'))).then(function (req) {
				if (typeof $scope.item !== 'undefined') $scope.item['zxF57KrA'] = req.data;
			});
		});
	});
	
	app.controller('FormGroupWf_aufgabe_editMatrix_aufgabeProperty_parent_type', function($scope, $http, $element){
		// watchers
		$scope.Number = Number;
		$scope.$watchGroup(['item[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetch35e23690b66398879270c51d124ec1860537e7989071057498eb4b453606450c_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41formarray_wf_aufgabe_edit_matrix_aufgabeProperty_parent_type?id=' + encodeURIComponent($scope.$eval('item[\'type\']'))).then(function (req) {
				if (typeof $scope.item !== 'undefined') $scope.item['DesVaCQB'] = req.data;
			});
		});
		$scope.$watchGroup(['item[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetch227b88d364ced78cd00df32c6ddb159ea8b71bffe8f4815e62cad9f26bb0bb44_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41formarray_wf_aufgabe_edit_matrix_aufgabeProperty_parent_type?id=' + encodeURIComponent($scope.$eval('item[\'type\']'))).then(function (req) {
				if (typeof $scope.item !== 'undefined') $scope.item['qlmkLYxD'] = req.data;
			});
		});
		$scope.$watchGroup(['item[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetch36920dc5291a6cbf6ec78f6ce8c74442925ad33523731aeec25bdf84697aa9a8_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41formarray_wf_aufgabe_edit_matrix_aufgabeProperty_parent_type?id=' + encodeURIComponent($scope.$eval('item[\'type\']'))).then(function (req) {
				if (typeof $scope.item !== 'undefined') $scope.item['W8Efbkfa'] = req.data;
			});
		});
		$scope.$watchGroup(['item[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetchBaa903eda2625ec4d53894fb2aa12594bbf60e510692bde7ab2f789971dc0cc8_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41formarray_wf_aufgabe_edit_matrix_aufgabeProperty_parent_type?id=' + encodeURIComponent($scope.$eval('item[\'type\']'))).then(function (req) {
				if (typeof $scope.item !== 'undefined') $scope.item['GIuNXQJJ'] = req.data;
			});
		});
		$scope.$watchGroup(['item[\'type\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabePropertyType/fetch823e17eebe13a6c03f44d3e10f1da4285abaf2f4c9a26a662f20d3c83d218f88_14_ebnf_Expression3_267_ebnf_anchorsymbol_268_41formarray_wf_aufgabe_edit_matrix_aufgabeProperty_parent_type?id=' + encodeURIComponent($scope.$eval('item[\'type\']'))).then(function (req) {
				if (typeof $scope.item !== 'undefined') $scope.item['zxF57KrA'] = req.data;
			});
		});
	});
	
	app.controller('FormWf_mitglied_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
	$scope.$watch('form[\'email\']', function (newval) {
	   $http.get('Tables/Mitglied/emailUnique?value=' + encodeURIComponent(newval) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['email::isUnique'] = req.data;
	   });
	});
	$scope.$watch('form[\'mnr\']', function (newval) {
	   $http.get('Tables/Mitglied/mnrUnique?value=' + encodeURIComponent(newval) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['mnr::isUnique'] = req.data;
	   });
	});
		$scope.$watchGroup(['form[\'ID\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/GruppeItem/fetch5275ae77df8d1e8296df20df7e4e11c3ef5356bdc5fd01b933e870a8cf1a800a_93_ebnf_Expression6_117_ebnf_anchorsymbol_118_97formarray_wf_mitglied_create_mitgliedPassnummer_mitglied_a_0Sju7gXS?id=' + encodeURIComponent($scope.$eval('form[\'ID\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['7sncgH3z'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'ID\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/GruppeItem/fetch5275ae77df8d1e8296df20df7e4e11c3ef5356bdc5fd01b933e870a8cf1a800a_93_ebnf_Expression6_117_ebnf_anchorsymbol_118_97formarray_wf_mitglied_create_ansprechpartner_mitglied_a_KRTKa3PB?id=' + encodeURIComponent($scope.$eval('form[\'ID\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['7sncgH3z'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'ID\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/GruppeItem/fetch5275ae77df8d1e8296df20df7e4e11c3ef5356bdc5fd01b933e870a8cf1a800a_93_ebnf_Expression6_117_ebnf_anchorsymbol_118_97formarray_wf_mitglied_create_matrix_campaignTarget_target_campaign_a_PW9rw6As?id=' + encodeURIComponent($scope.$eval('form[\'ID\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['7sncgH3z'] = req.data;
			});
		});$scope.globals = globals;$scope.Number = Number;
		var austrittsdatumVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'austrittsdatum\']', 'form[\'verstorben\']'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && austrittsdatumVirgin)
				scope.form['austrittsdatum'] = angular.copy(newValues[1]);
			if (newValues[1] !== undefined)
				austrittsdatumVirgin = fop_equals(scope.form['austrittsdatum'], newValues[1]);
		});
	
		var austrittsgrundVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'austrittsgrund\']', '(!(form[\'verstorben\']) || (form[\'verstorben\']) == 0) ? (\'\') : (\'verstorben\')'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && austrittsgrundVirgin)
				scope.form['austrittsgrund'] = angular.copy(newValues[1]);
			if (newValues[1] !== undefined)
				austrittsgrundVirgin = fop_equals(scope.form['austrittsgrund'], newValues[1]);
		});
	
		function updateCheckboxes_matrix_campaignTarget_target_campaign() {
			$('.cm-matrix_campaignTarget_target_campaign').find('.mdl-checkbox').each(function (i, x) {
				x.MaterialCheckbox.updateClasses_();
			});
		}

		$scope.matrixCheckboxMatrix_campaignTarget_target_campaign = {}; // items
		

		$scope.matrixRegisterMatrix_campaignTarget_target_campaign = function (id, item) {
			setTimeout(function () {
				$scope.matrixCheckboxMatrix_campaignTarget_target_campaign[id] = item;
				$scope.$apply();
			}, 0);
		}

		$scope.getMatrix_campaignTarget_target_campaignValues = function () {
				  let values = [];
				  $('tbody.cm-matrix_campaignTarget_target_campaign tr').each(function (i, x) {
							 let checked = $(x).find('.matrix_checkbox:checked').length != 0;
							 if (checked || $(x).find('[name="matrix_campaignTarget_target_campaign_ID[]"]').val()) {
								 var item = {
									 'campaign': $(x).find('input[type=hidden][name=matrix_campaignTarget_target_campaign_campaign]').val(),
								 };
								 if (checked) item._checked = true; // wenn nicht, darf es NICHT gesetzt sein
								 $(x).find('[name]').each(function (i, x) {
											var match = /matrix_campaignTarget_target_campaign_(.*)\[\]/.exec(x.name);
											if (match) {
													  item[match[1]] = $(x).val() || $(x).text(); // TODO: auf Datentyp-Ebene eine Extraktionsmethode bauen! komplexere Numeric-Typen klappen hiermit nicht; Dropdowns können mit NULL Probleme haben; noch einfacher wäre einfach die Nutzung des Original-ng-Models
											}
								 });
								 values.push(item);
							 }
				  });
				  return values;
		};

		$scope.$watch('matrixCheckboxMatrix_campaignTarget_target_campaign', function (newval, oldval) {
			// Binding aktualisieren
			

			for (var key in newval) {
				if (!newval.hasOwnProperty(key)) continue;

				let item = newval[key];
				element = $('input[name="matrix_campaignTarget_target_campaign__' + key.replace(/[^a-zA-Z0-9_]/g) + '"]').parent()[0];

				if (element != undefined && element.MaterialCheckbox != undefined) {
					if (item.checked) {
						element.MaterialCheckbox.check();
					} else {
						element.MaterialCheckbox.uncheck();
					}
				} else {
					delete newval[key];
				}
			}
			let lengthTotal = Object.keys(newval).length;
			let lengthChecked = Object.keys(newval).filter((x) => {return newval[x].checked}).length;

			
			let el = $('#cm-matrix_campaignTarget_target_campaign-allselect').parent()[0];
			if (el.MaterialCheckbox) {
				if (lengthTotal == lengthChecked) {
					el.MaterialCheckbox.check();
				} else {
					el.MaterialCheckbox.uncheck();
				}
			}
		}, true);

		
		$scope.cmMatrix_campaignTarget_target_campaignAllSelectToggle = function () {
			let value = $('#cm-matrix_campaignTarget_target_campaign-allselect').prop('checked');

			for (key in $scope.matrixCheckboxMatrix_campaignTarget_target_campaign) {
				if (!$scope.matrixCheckboxMatrix_campaignTarget_target_campaign.hasOwnProperty(key)) continue;

				let item = $scope.matrixCheckboxMatrix_campaignTarget_target_campaign[key];
				item.checked = value;
			};

			setTimeout(updateCheckboxes_matrix_campaignTarget_target_campaign, 0);
		}


		
	
		function updateCheckboxes_matrix_gruppeItem_item_list() {
			$('.cm-matrix_gruppeItem_item_list').find('.mdl-checkbox').each(function (i, x) {
				x.MaterialCheckbox.updateClasses_();
			});
		}

		$scope.matrixCheckboxMatrix_gruppeItem_item_list = {}; // items
		

		$scope.matrixRegisterMatrix_gruppeItem_item_list = function (id, item) {
			setTimeout(function () {
				$scope.matrixCheckboxMatrix_gruppeItem_item_list[id] = item;
				$scope.$apply();
			}, 0);
		}

		$scope.getMatrix_gruppeItem_item_listValues = function () {
				  let values = [];
				  $('tbody.cm-matrix_gruppeItem_item_list tr').each(function (i, x) {
							 let checked = $(x).find('.matrix_checkbox:checked').length != 0;
							 if (checked || $(x).find('[name="matrix_gruppeItem_item_list_ID[]"]').val()) {
								 var item = {
									 'list': $(x).find('input[type=hidden][name=matrix_gruppeItem_item_list_list]').val(),
								 };
								 if (checked) item._checked = true; // wenn nicht, darf es NICHT gesetzt sein
								 $(x).find('[name]').each(function (i, x) {
											var match = /matrix_gruppeItem_item_list_(.*)\[\]/.exec(x.name);
											if (match) {
													  item[match[1]] = $(x).val() || $(x).text(); // TODO: auf Datentyp-Ebene eine Extraktionsmethode bauen! komplexere Numeric-Typen klappen hiermit nicht; Dropdowns können mit NULL Probleme haben; noch einfacher wäre einfach die Nutzung des Original-ng-Models
											}
								 });
								 values.push(item);
							 }
				  });
				  return values;
		};

		$scope.$watch('matrixCheckboxMatrix_gruppeItem_item_list', function (newval, oldval) {
			// Binding aktualisieren
			

			for (var key in newval) {
				if (!newval.hasOwnProperty(key)) continue;

				let item = newval[key];
				element = $('input[name="matrix_gruppeItem_item_list__' + key.replace(/[^a-zA-Z0-9_]/g) + '"]').parent()[0];

				if (element != undefined && element.MaterialCheckbox != undefined) {
					if (item.checked) {
						element.MaterialCheckbox.check();
					} else {
						element.MaterialCheckbox.uncheck();
					}
				} else {
					delete newval[key];
				}
			}
			let lengthTotal = Object.keys(newval).length;
			let lengthChecked = Object.keys(newval).filter((x) => {return newval[x].checked}).length;

			
			let el = $('#cm-matrix_gruppeItem_item_list-allselect').parent()[0];
			if (el.MaterialCheckbox) {
				if (lengthTotal == lengthChecked) {
					el.MaterialCheckbox.check();
				} else {
					el.MaterialCheckbox.uncheck();
				}
			}
		}, true);

		
		$scope.cmMatrix_gruppeItem_item_listAllSelectToggle = function () {
			let value = $('#cm-matrix_gruppeItem_item_list-allselect').prop('checked');

			for (key in $scope.matrixCheckboxMatrix_gruppeItem_item_list) {
				if (!$scope.matrixCheckboxMatrix_gruppeItem_item_list.hasOwnProperty(key)) continue;

				let item = $scope.matrixCheckboxMatrix_gruppeItem_item_list[key];
				item.checked = value;
			};

			setTimeout(updateCheckboxes_matrix_gruppeItem_item_list, 0);
		}


		
	

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_createAnsprechpartner_mitglied"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('((globals[\'user:superadmin\']) ? (true) : (! (form[\'superadmin\']))) === null || ((globals[\'user:superadmin\']) ? (true) : (! (form[\'superadmin\']))) === \'0\' ? (false) : ((globals[\'user:superadmin\']) ? (true) : (! (form[\'superadmin\'])))', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="ansprechpartner_mitglied[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_createAnsprechpartner_mitglied"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(globals[\'user:gruppe\']) === null || (globals[\'user:gruppe\']) === \'0\' ? (false) : (globals[\'user:gruppe\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="ansprechpartner_mitglied[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_createAnsprechpartner_mitglied"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('((globals[\'user:mitglied\']) ? (true) : (! (((form[\'ID\']) != (globals[\'user:ID\'])) && (! (form[\'7sncgH3z\']))))) === null || ((globals[\'user:mitglied\']) ? (true) : (! (((form[\'ID\']) != (globals[\'user:ID\'])) && (! (form[\'7sncgH3z\']))))) === \'0\' ? (false) : ((globals[\'user:mitglied\']) ? (true) : (! (((form[\'ID\']) != (globals[\'user:ID\'])) && (! (form[\'7sncgH3z\'])))))', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="ansprechpartner_mitglied[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
			if (!$scope.$eval('form[\'email::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_createMatrix_campaignTarget_target_campaign"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(item[\'CkHlp5PE\']) === null || (item[\'CkHlp5PE\']) === \'0\' ? (false) : (item[\'CkHlp5PE\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_createMatrix_campaignTarget_target_campaign"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('((globals[\'user:superadmin\']) ? (true) : (! (form[\'superadmin\']))) === null || ((globals[\'user:superadmin\']) ? (true) : (! (form[\'superadmin\']))) === \'0\' ? (false) : ((globals[\'user:superadmin\']) ? (true) : (! (form[\'superadmin\'])))', {globals})) continue; // wenn erlaubt, nicht preventen
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_createMatrix_campaignTarget_target_campaign"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('((globals[\'user:mitglied\']) ? (true) : (! (((form[\'ID\']) != (globals[\'user:ID\'])) && (! (form[\'7sncgH3z\']))))) === null || ((globals[\'user:mitglied\']) ? (true) : (! (((form[\'ID\']) != (globals[\'user:ID\'])) && (! (form[\'7sncgH3z\']))))) === \'0\' ? (false) : ((globals[\'user:mitglied\']) ? (true) : (! (((form[\'ID\']) != (globals[\'user:ID\'])) && (! (form[\'7sncgH3z\'])))))', {globals})) continue; // wenn erlaubt, nicht preventen
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_createMatrix_campaignTarget_target_campaign"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('((globals[\'user:gruppe\']) ? (true) : (! ((form[\'ID\']) != (globals[\'user:ID\'])))) === null || ((globals[\'user:gruppe\']) ? (true) : (! ((form[\'ID\']) != (globals[\'user:ID\'])))) === \'0\' ? (false) : ((globals[\'user:gruppe\']) ? (true) : (! ((form[\'ID\']) != (globals[\'user:ID\']))))', {globals})) continue; // wenn erlaubt, nicht preventen
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_createMatrix_campaignTarget_target_campaign"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('item[\'campaign:target::isUnique\']', {globals})) continue; // wenn erlaubt, nicht preventen
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_createMatrix_gruppeItem_item_list"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('item[\'list:item::isUnique\']', {globals})) continue; // wenn erlaubt, nicht preventen
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_createMatrix_gruppeItem_item_list"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(item[\'WoNKw4Oa\']) === null || (item[\'WoNKw4Oa\']) === \'0\' ? (false) : (item[\'WoNKw4Oa\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_createMatrix_gruppeItem_item_list"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(item[\'GM2ROBSz\']) === null || (item[\'GM2ROBSz\']) === \'0\' ? (false) : (item[\'GM2ROBSz\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_createMitgliedPassnummer_mitglied"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(globals[\'user:gruppe\']) === null || (globals[\'user:gruppe\']) === \'0\' ? (false) : (globals[\'user:gruppe\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="mitgliedPassnummer_mitglied[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_createMitgliedPassnummer_mitglied"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('((globals[\'user:superadmin\']) ? (true) : (! (form[\'superadmin\']))) === null || ((globals[\'user:superadmin\']) ? (true) : (! (form[\'superadmin\']))) === \'0\' ? (false) : ((globals[\'user:superadmin\']) ? (true) : (! (form[\'superadmin\'])))', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="mitgliedPassnummer_mitglied[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_createMitgliedPassnummer_mitglied"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('((globals[\'user:mitglied\']) ? (true) : (! (((form[\'ID\']) != (globals[\'user:ID\'])) && (! (form[\'7sncgH3z\']))))) === null || ((globals[\'user:mitglied\']) ? (true) : (! (((form[\'ID\']) != (globals[\'user:ID\'])) && (! (form[\'7sncgH3z\']))))) === \'0\' ? (false) : ((globals[\'user:mitglied\']) ? (true) : (! (((form[\'ID\']) != (globals[\'user:ID\'])) && (! (form[\'7sncgH3z\'])))))', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="mitgliedPassnummer_mitglied[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
			if (!$scope.$eval('form[\'mnr::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(! (form[\'sepa\'])) || (form[\'sepaDate\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(globals[\'user:superadmin\']) ? (true) : (! (form[\'superadmin\']))')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_mitglied_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
	$scope.$watch('form[\'email\']', function (newval) {
	   $http.get('Tables/Mitglied/emailUnique?value=' + encodeURIComponent(newval) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['email::isUnique'] = req.data;
	   });
	});
	$scope.$watch('form[\'mnr\']', function (newval) {
	   $http.get('Tables/Mitglied/mnrUnique?value=' + encodeURIComponent(newval) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['mnr::isUnique'] = req.data;
	   });
	});
		$scope.$watchGroup(['form[\'ID\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/GruppeItem/fetch5275ae77df8d1e8296df20df7e4e11c3ef5356bdc5fd01b933e870a8cf1a800a_93_ebnf_Expression6_117_ebnf_anchorsymbol_118_97formarray_wf_mitglied_edit_mitgliedPassnummer_mitglied_a_0Sju7gXS?id=' + encodeURIComponent($scope.$eval('form[\'ID\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['7sncgH3z'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'ID\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/GruppeItem/fetch5275ae77df8d1e8296df20df7e4e11c3ef5356bdc5fd01b933e870a8cf1a800a_93_ebnf_Expression6_117_ebnf_anchorsymbol_118_97formarray_wf_mitglied_edit_ansprechpartner_mitglied_a_KRTKa3PB?id=' + encodeURIComponent($scope.$eval('form[\'ID\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['7sncgH3z'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'ID\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/GruppeItem/fetch5275ae77df8d1e8296df20df7e4e11c3ef5356bdc5fd01b933e870a8cf1a800a_93_ebnf_Expression6_117_ebnf_anchorsymbol_118_97formarray_wf_mitglied_edit_matrix_campaignTarget_target_campaign_a_PW9rw6As?id=' + encodeURIComponent($scope.$eval('form[\'ID\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['7sncgH3z'] = req.data;
			});
		});$scope.globals = globals;$scope.Number = Number;
		var austrittsdatumVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'austrittsdatum\']', 'form[\'verstorben\']'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && austrittsdatumVirgin)
				scope.form['austrittsdatum'] = angular.copy(newValues[1]);
			if (newValues[1] !== undefined)
				austrittsdatumVirgin = fop_equals(scope.form['austrittsdatum'], newValues[1]);
		});
	
		var austrittsgrundVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'austrittsgrund\']', '(!(form[\'verstorben\']) || (form[\'verstorben\']) == 0) ? (\'\') : (\'verstorben\')'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && austrittsgrundVirgin)
				scope.form['austrittsgrund'] = angular.copy(newValues[1]);
			if (newValues[1] !== undefined)
				austrittsgrundVirgin = fop_equals(scope.form['austrittsgrund'], newValues[1]);
		});
	
		function updateCheckboxes_matrix_campaignTarget_target_campaign() {
			$('.cm-matrix_campaignTarget_target_campaign').find('.mdl-checkbox').each(function (i, x) {
				x.MaterialCheckbox.updateClasses_();
			});
		}

		$scope.matrixCheckboxMatrix_campaignTarget_target_campaign = {}; // items
		

		$scope.matrixRegisterMatrix_campaignTarget_target_campaign = function (id, item) {
			setTimeout(function () {
				$scope.matrixCheckboxMatrix_campaignTarget_target_campaign[id] = item;
				$scope.$apply();
			}, 0);
		}

		$scope.getMatrix_campaignTarget_target_campaignValues = function () {
				  let values = [];
				  $('tbody.cm-matrix_campaignTarget_target_campaign tr').each(function (i, x) {
							 let checked = $(x).find('.matrix_checkbox:checked').length != 0;
							 if (checked || $(x).find('[name="matrix_campaignTarget_target_campaign_ID[]"]').val()) {
								 var item = {
									 'campaign': $(x).find('input[type=hidden][name=matrix_campaignTarget_target_campaign_campaign]').val(),
								 };
								 if (checked) item._checked = true; // wenn nicht, darf es NICHT gesetzt sein
								 $(x).find('[name]').each(function (i, x) {
											var match = /matrix_campaignTarget_target_campaign_(.*)\[\]/.exec(x.name);
											if (match) {
													  item[match[1]] = $(x).val() || $(x).text(); // TODO: auf Datentyp-Ebene eine Extraktionsmethode bauen! komplexere Numeric-Typen klappen hiermit nicht; Dropdowns können mit NULL Probleme haben; noch einfacher wäre einfach die Nutzung des Original-ng-Models
											}
								 });
								 values.push(item);
							 }
				  });
				  return values;
		};

		$scope.$watch('matrixCheckboxMatrix_campaignTarget_target_campaign', function (newval, oldval) {
			// Binding aktualisieren
			

			for (var key in newval) {
				if (!newval.hasOwnProperty(key)) continue;

				let item = newval[key];
				element = $('input[name="matrix_campaignTarget_target_campaign__' + key.replace(/[^a-zA-Z0-9_]/g) + '"]').parent()[0];

				if (element != undefined && element.MaterialCheckbox != undefined) {
					if (item.checked) {
						element.MaterialCheckbox.check();
					} else {
						element.MaterialCheckbox.uncheck();
					}
				} else {
					delete newval[key];
				}
			}
			let lengthTotal = Object.keys(newval).length;
			let lengthChecked = Object.keys(newval).filter((x) => {return newval[x].checked}).length;

			
			let el = $('#cm-matrix_campaignTarget_target_campaign-allselect').parent()[0];
			if (el.MaterialCheckbox) {
				if (lengthTotal == lengthChecked) {
					el.MaterialCheckbox.check();
				} else {
					el.MaterialCheckbox.uncheck();
				}
			}
		}, true);

		
		$scope.cmMatrix_campaignTarget_target_campaignAllSelectToggle = function () {
			let value = $('#cm-matrix_campaignTarget_target_campaign-allselect').prop('checked');

			for (key in $scope.matrixCheckboxMatrix_campaignTarget_target_campaign) {
				if (!$scope.matrixCheckboxMatrix_campaignTarget_target_campaign.hasOwnProperty(key)) continue;

				let item = $scope.matrixCheckboxMatrix_campaignTarget_target_campaign[key];
				item.checked = value;
			};

			setTimeout(updateCheckboxes_matrix_campaignTarget_target_campaign, 0);
		}


		
	
		function updateCheckboxes_matrix_gruppeItem_item_list() {
			$('.cm-matrix_gruppeItem_item_list').find('.mdl-checkbox').each(function (i, x) {
				x.MaterialCheckbox.updateClasses_();
			});
		}

		$scope.matrixCheckboxMatrix_gruppeItem_item_list = {}; // items
		

		$scope.matrixRegisterMatrix_gruppeItem_item_list = function (id, item) {
			setTimeout(function () {
				$scope.matrixCheckboxMatrix_gruppeItem_item_list[id] = item;
				$scope.$apply();
			}, 0);
		}

		$scope.getMatrix_gruppeItem_item_listValues = function () {
				  let values = [];
				  $('tbody.cm-matrix_gruppeItem_item_list tr').each(function (i, x) {
							 let checked = $(x).find('.matrix_checkbox:checked').length != 0;
							 if (checked || $(x).find('[name="matrix_gruppeItem_item_list_ID[]"]').val()) {
								 var item = {
									 'list': $(x).find('input[type=hidden][name=matrix_gruppeItem_item_list_list]').val(),
								 };
								 if (checked) item._checked = true; // wenn nicht, darf es NICHT gesetzt sein
								 $(x).find('[name]').each(function (i, x) {
											var match = /matrix_gruppeItem_item_list_(.*)\[\]/.exec(x.name);
											if (match) {
													  item[match[1]] = $(x).val() || $(x).text(); // TODO: auf Datentyp-Ebene eine Extraktionsmethode bauen! komplexere Numeric-Typen klappen hiermit nicht; Dropdowns können mit NULL Probleme haben; noch einfacher wäre einfach die Nutzung des Original-ng-Models
											}
								 });
								 values.push(item);
							 }
				  });
				  return values;
		};

		$scope.$watch('matrixCheckboxMatrix_gruppeItem_item_list', function (newval, oldval) {
			// Binding aktualisieren
			

			for (var key in newval) {
				if (!newval.hasOwnProperty(key)) continue;

				let item = newval[key];
				element = $('input[name="matrix_gruppeItem_item_list__' + key.replace(/[^a-zA-Z0-9_]/g) + '"]').parent()[0];

				if (element != undefined && element.MaterialCheckbox != undefined) {
					if (item.checked) {
						element.MaterialCheckbox.check();
					} else {
						element.MaterialCheckbox.uncheck();
					}
				} else {
					delete newval[key];
				}
			}
			let lengthTotal = Object.keys(newval).length;
			let lengthChecked = Object.keys(newval).filter((x) => {return newval[x].checked}).length;

			
			let el = $('#cm-matrix_gruppeItem_item_list-allselect').parent()[0];
			if (el.MaterialCheckbox) {
				if (lengthTotal == lengthChecked) {
					el.MaterialCheckbox.check();
				} else {
					el.MaterialCheckbox.uncheck();
				}
			}
		}, true);

		
		$scope.cmMatrix_gruppeItem_item_listAllSelectToggle = function () {
			let value = $('#cm-matrix_gruppeItem_item_list-allselect').prop('checked');

			for (key in $scope.matrixCheckboxMatrix_gruppeItem_item_list) {
				if (!$scope.matrixCheckboxMatrix_gruppeItem_item_list.hasOwnProperty(key)) continue;

				let item = $scope.matrixCheckboxMatrix_gruppeItem_item_list[key];
				item.checked = value;
			};

			setTimeout(updateCheckboxes_matrix_gruppeItem_item_list, 0);
		}


		
	

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_editAnsprechpartner_mitglied"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('((globals[\'user:superadmin\']) ? (true) : (! (form[\'superadmin\']))) === null || ((globals[\'user:superadmin\']) ? (true) : (! (form[\'superadmin\']))) === \'0\' ? (false) : ((globals[\'user:superadmin\']) ? (true) : (! (form[\'superadmin\'])))', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="ansprechpartner_mitglied[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_editAnsprechpartner_mitglied"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(globals[\'user:gruppe\']) === null || (globals[\'user:gruppe\']) === \'0\' ? (false) : (globals[\'user:gruppe\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="ansprechpartner_mitglied[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_editAnsprechpartner_mitglied"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('((globals[\'user:mitglied\']) ? (true) : (! (((form[\'ID\']) != (globals[\'user:ID\'])) && (! (form[\'7sncgH3z\']))))) === null || ((globals[\'user:mitglied\']) ? (true) : (! (((form[\'ID\']) != (globals[\'user:ID\'])) && (! (form[\'7sncgH3z\']))))) === \'0\' ? (false) : ((globals[\'user:mitglied\']) ? (true) : (! (((form[\'ID\']) != (globals[\'user:ID\'])) && (! (form[\'7sncgH3z\'])))))', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="ansprechpartner_mitglied[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
			if (!$scope.$eval('form[\'email::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_editMatrix_campaignTarget_target_campaign"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(item[\'CkHlp5PE\']) === null || (item[\'CkHlp5PE\']) === \'0\' ? (false) : (item[\'CkHlp5PE\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_editMatrix_campaignTarget_target_campaign"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('((globals[\'user:superadmin\']) ? (true) : (! (form[\'superadmin\']))) === null || ((globals[\'user:superadmin\']) ? (true) : (! (form[\'superadmin\']))) === \'0\' ? (false) : ((globals[\'user:superadmin\']) ? (true) : (! (form[\'superadmin\'])))', {globals})) continue; // wenn erlaubt, nicht preventen
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_editMatrix_campaignTarget_target_campaign"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('((globals[\'user:mitglied\']) ? (true) : (! (((form[\'ID\']) != (globals[\'user:ID\'])) && (! (form[\'7sncgH3z\']))))) === null || ((globals[\'user:mitglied\']) ? (true) : (! (((form[\'ID\']) != (globals[\'user:ID\'])) && (! (form[\'7sncgH3z\']))))) === \'0\' ? (false) : ((globals[\'user:mitglied\']) ? (true) : (! (((form[\'ID\']) != (globals[\'user:ID\'])) && (! (form[\'7sncgH3z\'])))))', {globals})) continue; // wenn erlaubt, nicht preventen
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_editMatrix_campaignTarget_target_campaign"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('((globals[\'user:gruppe\']) ? (true) : (! ((form[\'ID\']) != (globals[\'user:ID\'])))) === null || ((globals[\'user:gruppe\']) ? (true) : (! ((form[\'ID\']) != (globals[\'user:ID\'])))) === \'0\' ? (false) : ((globals[\'user:gruppe\']) ? (true) : (! ((form[\'ID\']) != (globals[\'user:ID\']))))', {globals})) continue; // wenn erlaubt, nicht preventen
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_editMatrix_campaignTarget_target_campaign"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('item[\'campaign:target::isUnique\']', {globals})) continue; // wenn erlaubt, nicht preventen
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_editMatrix_gruppeItem_item_list"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('item[\'list:item::isUnique\']', {globals})) continue; // wenn erlaubt, nicht preventen
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_editMatrix_gruppeItem_item_list"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(item[\'WoNKw4Oa\']) === null || (item[\'WoNKw4Oa\']) === \'0\' ? (false) : (item[\'WoNKw4Oa\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_editMatrix_gruppeItem_item_list"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(item[\'GM2ROBSz\']) === null || (item[\'GM2ROBSz\']) === \'0\' ? (false) : (item[\'GM2ROBSz\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_editMitgliedPassnummer_mitglied"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(globals[\'user:gruppe\']) === null || (globals[\'user:gruppe\']) === \'0\' ? (false) : (globals[\'user:gruppe\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="mitgliedPassnummer_mitglied[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_editMitgliedPassnummer_mitglied"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('((globals[\'user:superadmin\']) ? (true) : (! (form[\'superadmin\']))) === null || ((globals[\'user:superadmin\']) ? (true) : (! (form[\'superadmin\']))) === \'0\' ? (false) : ((globals[\'user:superadmin\']) ? (true) : (! (form[\'superadmin\'])))', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="mitgliedPassnummer_mitglied[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_mitglied_editMitgliedPassnummer_mitglied"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('((globals[\'user:mitglied\']) ? (true) : (! (((form[\'ID\']) != (globals[\'user:ID\'])) && (! (form[\'7sncgH3z\']))))) === null || ((globals[\'user:mitglied\']) ? (true) : (! (((form[\'ID\']) != (globals[\'user:ID\'])) && (! (form[\'7sncgH3z\']))))) === \'0\' ? (false) : ((globals[\'user:mitglied\']) ? (true) : (! (((form[\'ID\']) != (globals[\'user:ID\'])) && (! (form[\'7sncgH3z\'])))))', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="mitgliedPassnummer_mitglied[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
			if (!$scope.$eval('form[\'mnr::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(! (form[\'sepa\'])) || (form[\'sepaDate\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(globals[\'user:superadmin\']) ? (true) : (! (form[\'superadmin\']))')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_fop_fints_konto_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['((form[\'iban\']).replaceAll(\' \', \'\')).substr((4), 8)'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Fop_fints_bank/fetchFop_fints_konto_create_bank_defaultDynamic_5_ebnf_Expression_106_ebnf_anchorsymbol_107_172wf_fop_fints_konto_create_bank_defaultDynamic?id=' + encodeURIComponent($scope.$eval('((form[\'iban\']).replaceAll(\' \', \'\')).substr((4), 8)'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['q0Y2qq9I'] = req.data;
			});
		});$scope.Number = Number;
		var bankVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'bank\']', '(((form[\'iban\']).substr((0), 2)) == (\'DE\')) ? (form[\'q0Y2qq9I\']) : (\'0\')'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && bankVirgin)
				scope.form['bank'] = angular.copy(newValues[1] ?? '0');
			if (newValues[1] !== undefined)
				bankVirgin = fop_equals(scope.form['bank'], newValues[1] ?? '0');
		});
	

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_fop_fints_konto_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['((form[\'iban\']).replaceAll(\' \', \'\')).substr((4), 8)'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Fop_fints_bank/fetchFop_fints_konto_edit_bank_defaultDynamic_5_ebnf_Expression_106_ebnf_anchorsymbol_107_172wf_fop_fints_konto_edit_bank_defaultDynamic?id=' + encodeURIComponent($scope.$eval('((form[\'iban\']).replaceAll(\' \', \'\')).substr((4), 8)'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['JFiJ5wyi'] = req.data;
			});
		});$scope.Number = Number;
		var bankVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'bank\']', '(((form[\'iban\']).substr((0), 2)) == (\'DE\')) ? (form[\'JFiJ5wyi\']) : (\'0\')'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && bankVirgin)
				scope.form['bank'] = angular.copy(newValues[1] ?? '0');
			if (newValues[1] !== undefined)
				bankVirgin = fop_equals(scope.form['bank'], newValues[1] ?? '0');
		});
	

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_campaign_clone', function($scope, $http, $element, globals) {
		// Watchers etc.
		$scope.globals = globals;
		function updateCheckboxes_matrix_campaignFollow_campaign_state() {
			$('.cm-matrix_campaignFollow_campaign_state').find('.mdl-checkbox').each(function (i, x) {
				x.MaterialCheckbox.updateClasses_();
			});
		}

		$scope.matrixCheckboxMatrix_campaignFollow_campaign_state = {}; // items
		

		$scope.matrixRegisterMatrix_campaignFollow_campaign_state = function (id, item) {
			setTimeout(function () {
				$scope.matrixCheckboxMatrix_campaignFollow_campaign_state[id] = item;
				$scope.$apply();
			}, 0);
		}

		$scope.getMatrix_campaignFollow_campaign_stateValues = function () {
				  let values = [];
				  $('tbody.cm-matrix_campaignFollow_campaign_state tr').each(function (i, x) {
							 let checked = $(x).find('.matrix_checkbox:checked').length != 0;
							 if (checked || $(x).find('[name="matrix_campaignFollow_campaign_state_ID[]"]').val()) {
								 var item = {
									 'state': $(x).find('input[type=hidden][name=matrix_campaignFollow_campaign_state_state]').val(),
								 };
								 if (checked) item._checked = true; // wenn nicht, darf es NICHT gesetzt sein
								 $(x).find('[name]').each(function (i, x) {
											var match = /matrix_campaignFollow_campaign_state_(.*)\[\]/.exec(x.name);
											if (match) {
													  item[match[1]] = $(x).val() || $(x).text(); // TODO: auf Datentyp-Ebene eine Extraktionsmethode bauen! komplexere Numeric-Typen klappen hiermit nicht; Dropdowns können mit NULL Probleme haben; noch einfacher wäre einfach die Nutzung des Original-ng-Models
											}
								 });
								 values.push(item);
							 }
				  });
				  return values;
		};

		$scope.$watch('matrixCheckboxMatrix_campaignFollow_campaign_state', function (newval, oldval) {
			// Binding aktualisieren
			

			for (var key in newval) {
				if (!newval.hasOwnProperty(key)) continue;

				let item = newval[key];
				element = $('input[name="matrix_campaignFollow_campaign_state__' + key.replace(/[^a-zA-Z0-9_]/g) + '"]').parent()[0];

				if (element != undefined && element.MaterialCheckbox != undefined) {
					if (item.checked) {
						element.MaterialCheckbox.check();
					} else {
						element.MaterialCheckbox.uncheck();
					}
				} else {
					delete newval[key];
				}
			}
			let lengthTotal = Object.keys(newval).length;
			let lengthChecked = Object.keys(newval).filter((x) => {return newval[x].checked}).length;

			
			let el = $('#cm-matrix_campaignFollow_campaign_state-allselect').parent()[0];
			if (el.MaterialCheckbox) {
				if (lengthTotal == lengthChecked) {
					el.MaterialCheckbox.check();
				} else {
					el.MaterialCheckbox.uncheck();
				}
			}
		}, true);

		
		$scope.cmMatrix_campaignFollow_campaign_stateAllSelectToggle = function () {
			let value = $('#cm-matrix_campaignFollow_campaign_state-allselect').prop('checked');

			for (key in $scope.matrixCheckboxMatrix_campaignFollow_campaign_state) {
				if (!$scope.matrixCheckboxMatrix_campaignFollow_campaign_state.hasOwnProperty(key)) continue;

				let item = $scope.matrixCheckboxMatrix_campaignFollow_campaign_state[key];
				item.checked = value;
			};

			setTimeout(updateCheckboxes_matrix_campaignFollow_campaign_state, 0);
		}


		
	

		// Submitting
		$scope.submit = function ($event) {
			
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_campaign_cloneCampaignAttachment_campaign"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(globals[\'user:campaign\']) === null || (globals[\'user:campaign\']) === \'0\' ? (false) : (globals[\'user:campaign\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="campaignAttachment_campaign[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
			if (!$scope.$eval('(form[\'email_subject\']) || (! ((form[\'email_campaign\']) || ((form[\'post_campaign\']) && ([\'1\', \'true\', \'3\'].indexOf((form[\'pdf_type\']).toString()) != -1))))')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_mitgliedBuchung_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch7393e28ddbc08ce73592b4a6deb835f93503bca0281d731dd72ac3e3ffc8bc67_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['ThzxkNJg'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch32095a3349d17e5f1601976fdf62789461bb0a81a95933dc539c85551d7fb9ce_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['Z3kysnKg'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch084ae7f3b5cc88f7adac5eaee995b9710c63a5c48dfb1b41d60d4132870cdf70_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['akGyuC03'] = req.data;
			});
		});$scope.Number = Number;$scope.globals = globals;

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'akGyuC03\']) === null || (form[\'akGyuC03\']) === \'0\' ? (false) : (form[\'akGyuC03\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'ThzxkNJg\']) === null || (form[\'ThzxkNJg\']) === \'0\' ? (false) : (form[\'ThzxkNJg\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'Z3kysnKg\']) === null || (form[\'Z3kysnKg\']) === \'0\' ? (false) : (form[\'Z3kysnKg\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(globals[\'user:buchhaltung\']) ? (true) : (! ((form[\'mitglied\']) != (globals[\'user:ID\'])))')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_campaign_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		$scope.globals = globals;
		function updateCheckboxes_matrix_campaignFollow_campaign_state() {
			$('.cm-matrix_campaignFollow_campaign_state').find('.mdl-checkbox').each(function (i, x) {
				x.MaterialCheckbox.updateClasses_();
			});
		}

		$scope.matrixCheckboxMatrix_campaignFollow_campaign_state = {}; // items
		

		$scope.matrixRegisterMatrix_campaignFollow_campaign_state = function (id, item) {
			setTimeout(function () {
				$scope.matrixCheckboxMatrix_campaignFollow_campaign_state[id] = item;
				$scope.$apply();
			}, 0);
		}

		$scope.getMatrix_campaignFollow_campaign_stateValues = function () {
				  let values = [];
				  $('tbody.cm-matrix_campaignFollow_campaign_state tr').each(function (i, x) {
							 let checked = $(x).find('.matrix_checkbox:checked').length != 0;
							 if (checked || $(x).find('[name="matrix_campaignFollow_campaign_state_ID[]"]').val()) {
								 var item = {
									 'state': $(x).find('input[type=hidden][name=matrix_campaignFollow_campaign_state_state]').val(),
								 };
								 if (checked) item._checked = true; // wenn nicht, darf es NICHT gesetzt sein
								 $(x).find('[name]').each(function (i, x) {
											var match = /matrix_campaignFollow_campaign_state_(.*)\[\]/.exec(x.name);
											if (match) {
													  item[match[1]] = $(x).val() || $(x).text(); // TODO: auf Datentyp-Ebene eine Extraktionsmethode bauen! komplexere Numeric-Typen klappen hiermit nicht; Dropdowns können mit NULL Probleme haben; noch einfacher wäre einfach die Nutzung des Original-ng-Models
											}
								 });
								 values.push(item);
							 }
				  });
				  return values;
		};

		$scope.$watch('matrixCheckboxMatrix_campaignFollow_campaign_state', function (newval, oldval) {
			// Binding aktualisieren
			

			for (var key in newval) {
				if (!newval.hasOwnProperty(key)) continue;

				let item = newval[key];
				element = $('input[name="matrix_campaignFollow_campaign_state__' + key.replace(/[^a-zA-Z0-9_]/g) + '"]').parent()[0];

				if (element != undefined && element.MaterialCheckbox != undefined) {
					if (item.checked) {
						element.MaterialCheckbox.check();
					} else {
						element.MaterialCheckbox.uncheck();
					}
				} else {
					delete newval[key];
				}
			}
			let lengthTotal = Object.keys(newval).length;
			let lengthChecked = Object.keys(newval).filter((x) => {return newval[x].checked}).length;

			
			let el = $('#cm-matrix_campaignFollow_campaign_state-allselect').parent()[0];
			if (el.MaterialCheckbox) {
				if (lengthTotal == lengthChecked) {
					el.MaterialCheckbox.check();
				} else {
					el.MaterialCheckbox.uncheck();
				}
			}
		}, true);

		
		$scope.cmMatrix_campaignFollow_campaign_stateAllSelectToggle = function () {
			let value = $('#cm-matrix_campaignFollow_campaign_state-allselect').prop('checked');

			for (key in $scope.matrixCheckboxMatrix_campaignFollow_campaign_state) {
				if (!$scope.matrixCheckboxMatrix_campaignFollow_campaign_state.hasOwnProperty(key)) continue;

				let item = $scope.matrixCheckboxMatrix_campaignFollow_campaign_state[key];
				item.checked = value;
			};

			setTimeout(updateCheckboxes_matrix_campaignFollow_campaign_state, 0);
		}


		
	

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_campaign_createCampaignAttachment_campaign"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(globals[\'user:campaign\']) === null || (globals[\'user:campaign\']) === \'0\' ? (false) : (globals[\'user:campaign\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="campaignAttachment_campaign[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
			if (!$scope.$eval('(form[\'email_subject\']) || (! ((form[\'email_campaign\']) || ((form[\'post_campaign\']) && ([\'1\', \'true\', \'3\'].indexOf((form[\'pdf_type\']).toString()) != -1))))')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_dir_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
	$scope.$watchGroup(['form[\'mailbox\']', 'form[\'imap_name\']'], function (newval) {
	   $http.get('Tables/Fop_mail_host_box_dir/mailboximap_nameUnique?context=' + encodeURIComponent(newval[0]) + '&value=' + encodeURIComponent(newval[1]) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['mailbox:imap_name::isUnique'] = req.data;
	   }).catch(function () {
		 $scope.form['mailbox:imap_name::isUnique'] = true;
		});
	});$scope.Number = Number;

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('form[\'mailbox:imap_name::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('((form[\'name\']) != (\'INBOX\')) && ((form[\'name\']) != (\'Sent\'))')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_mitgliedBuchung_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch7393e28ddbc08ce73592b4a6deb835f93503bca0281d731dd72ac3e3ffc8bc67_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['ThzxkNJg'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch32095a3349d17e5f1601976fdf62789461bb0a81a95933dc539c85551d7fb9ce_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['Z3kysnKg'] = req.data;
			});
		});
		$scope.$watchGroup(['form[\'mitglied\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/Mitglied/fetch084ae7f3b5cc88f7adac5eaee995b9710c63a5c48dfb1b41d60d4132870cdf70_fetchform?id=' + encodeURIComponent($scope.$eval('form[\'mitglied\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['akGyuC03'] = req.data;
			});
		});$scope.Number = Number;$scope.globals = globals;

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('(form[\'akGyuC03\']) === null || (form[\'akGyuC03\']) === \'0\' ? (false) : (form[\'akGyuC03\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'ThzxkNJg\']) === null || (form[\'ThzxkNJg\']) === \'0\' ? (false) : (form[\'ThzxkNJg\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(form[\'Z3kysnKg\']) === null || (form[\'Z3kysnKg\']) === \'0\' ? (false) : (form[\'Z3kysnKg\'])')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('(globals[\'user:buchhaltung\']) ? (true) : (! ((form[\'mitglied\']) != (globals[\'user:ID\'])))')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_campaign_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		$scope.globals = globals;
		function updateCheckboxes_matrix_campaignFollow_campaign_state() {
			$('.cm-matrix_campaignFollow_campaign_state').find('.mdl-checkbox').each(function (i, x) {
				x.MaterialCheckbox.updateClasses_();
			});
		}

		$scope.matrixCheckboxMatrix_campaignFollow_campaign_state = {}; // items
		

		$scope.matrixRegisterMatrix_campaignFollow_campaign_state = function (id, item) {
			setTimeout(function () {
				$scope.matrixCheckboxMatrix_campaignFollow_campaign_state[id] = item;
				$scope.$apply();
			}, 0);
		}

		$scope.getMatrix_campaignFollow_campaign_stateValues = function () {
				  let values = [];
				  $('tbody.cm-matrix_campaignFollow_campaign_state tr').each(function (i, x) {
							 let checked = $(x).find('.matrix_checkbox:checked').length != 0;
							 if (checked || $(x).find('[name="matrix_campaignFollow_campaign_state_ID[]"]').val()) {
								 var item = {
									 'state': $(x).find('input[type=hidden][name=matrix_campaignFollow_campaign_state_state]').val(),
								 };
								 if (checked) item._checked = true; // wenn nicht, darf es NICHT gesetzt sein
								 $(x).find('[name]').each(function (i, x) {
											var match = /matrix_campaignFollow_campaign_state_(.*)\[\]/.exec(x.name);
											if (match) {
													  item[match[1]] = $(x).val() || $(x).text(); // TODO: auf Datentyp-Ebene eine Extraktionsmethode bauen! komplexere Numeric-Typen klappen hiermit nicht; Dropdowns können mit NULL Probleme haben; noch einfacher wäre einfach die Nutzung des Original-ng-Models
											}
								 });
								 values.push(item);
							 }
				  });
				  return values;
		};

		$scope.$watch('matrixCheckboxMatrix_campaignFollow_campaign_state', function (newval, oldval) {
			// Binding aktualisieren
			

			for (var key in newval) {
				if (!newval.hasOwnProperty(key)) continue;

				let item = newval[key];
				element = $('input[name="matrix_campaignFollow_campaign_state__' + key.replace(/[^a-zA-Z0-9_]/g) + '"]').parent()[0];

				if (element != undefined && element.MaterialCheckbox != undefined) {
					if (item.checked) {
						element.MaterialCheckbox.check();
					} else {
						element.MaterialCheckbox.uncheck();
					}
				} else {
					delete newval[key];
				}
			}
			let lengthTotal = Object.keys(newval).length;
			let lengthChecked = Object.keys(newval).filter((x) => {return newval[x].checked}).length;

			
			let el = $('#cm-matrix_campaignFollow_campaign_state-allselect').parent()[0];
			if (el.MaterialCheckbox) {
				if (lengthTotal == lengthChecked) {
					el.MaterialCheckbox.check();
				} else {
					el.MaterialCheckbox.uncheck();
				}
			}
		}, true);

		
		$scope.cmMatrix_campaignFollow_campaign_stateAllSelectToggle = function () {
			let value = $('#cm-matrix_campaignFollow_campaign_state-allselect').prop('checked');

			for (key in $scope.matrixCheckboxMatrix_campaignFollow_campaign_state) {
				if (!$scope.matrixCheckboxMatrix_campaignFollow_campaign_state.hasOwnProperty(key)) continue;

				let item = $scope.matrixCheckboxMatrix_campaignFollow_campaign_state[key];
				item.checked = value;
			};

			setTimeout(updateCheckboxes_matrix_campaignFollow_campaign_state, 0);
		}


		
	

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		var items = $element.find('.wfl-item[ng-controller="FormGroupWf_campaign_editCampaignAttachment_campaign"]');
		for (var i = 0; i < items.length; i++) {
			var inner_scope = $(items[i]).scope();
			if (inner_scope.$eval('(globals[\'user:campaign\']) === null || (globals[\'user:campaign\']) === \'0\' ? (false) : (globals[\'user:campaign\'])', {globals})) continue; // wenn erlaubt, nicht preventen
			if ($(items[i]).find('[name="campaignAttachment_campaign[]"]').val() == 0) continue; // bereits gelöscht
			// verbotener Wert für Spalte
			return $event.preventDefault();
		}
	
			if (!$scope.$eval('(form[\'email_subject\']) || (! ((form[\'email_campaign\']) || ((form[\'post_campaign\']) && ([\'1\', \'true\', \'3\'].indexOf((form[\'pdf_type\']).toString()) != -1))))')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_fop_mail_host_box_dir_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
	$scope.$watchGroup(['form[\'mailbox\']', 'form[\'imap_name\']'], function (newval) {
	   $http.get('Tables/Fop_mail_host_box_dir/mailboximap_nameUnique?context=' + encodeURIComponent(newval[0]) + '&value=' + encodeURIComponent(newval[1]) + '&id=' + encodeURIComponent($scope.form['ID'])).then(function (req) {
	  	 // evtl. noch zusammenfassen???
		 $scope.form['mailbox:imap_name::isUnique'] = req.data;
	   }).catch(function () {
		 $scope.form['mailbox:imap_name::isUnique'] = true;
		});
	});$scope.Number = Number;

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
			if (!$scope.$eval('form[\'mailbox:imap_name::isUnique\']')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
			if (!$scope.$eval('((form[\'name\']) != (\'INBOX\')) && ((form[\'name\']) != (\'Sent\'))')) {
				// verbotener Wert für Spalte
				return $event.preventDefault();
			}
	
		}
	});
	
	app.controller('FormWf_aufgabe_create', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'typ\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabeType/fetchAufgabe_create_deadline_defaultDynamic_47_ebnf_Expression3_267_ebnf_anchorsymbol_268_72wf_aufgabe_create_deadline_defaultDynamic?id=' + encodeURIComponent($scope.$eval('form[\'typ\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['JnzSPwhr'] = req.data;
			});
		});$scope.time = function () {return Math.round((new Date()).getTime() / 1000); };
		$scope.$watchGroup(['form[\'typ\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabeType/fetchAufgabe_create_deadline_defaultDynamic_291_ebnf_Expression5_132_ebnf_anchorsymbol_133_361wf_aufgabe_create_deadline_defaultDynamic?id=' + encodeURIComponent($scope.$eval('form[\'typ\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['8OISXR82'] = req.data;
			});
		});$scope.Number = Number;$scope.Math = window.Math;
		var deadlineVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'deadline\']', '((0) == (form[\'JnzSPwhr\'])) ? (\'0\') : (Number(Math.round((time()) / 86400) * 86400) + Number(Number(Number(Number(24) * Number(60)) * Number(60)) * Number(form[\'8OISXR82\'])))'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && deadlineVirgin)
				scope.form['deadline'] = angular.copy(newValues[1]);
			if (newValues[1] !== undefined)
				deadlineVirgin = fop_equals(scope.form['deadline'], newValues[1]);
		});
	
		function updateCheckboxes_matrix_aufgabeProperty_parent_type() {
			$('.cm-matrix_aufgabeProperty_parent_type').find('.mdl-checkbox').each(function (i, x) {
				x.MaterialCheckbox.updateClasses_();
			});
		}

		$scope.matrixCheckboxMatrix_aufgabeProperty_parent_type = {}; // items
		

		$scope.matrixRegisterMatrix_aufgabeProperty_parent_type = function (id, item) {
			setTimeout(function () {
				$scope.matrixCheckboxMatrix_aufgabeProperty_parent_type[id] = item;
				$scope.$apply();
			}, 0);
		}

		$scope.getMatrix_aufgabeProperty_parent_typeValues = function () {
				  let values = [];
				  $('tbody.cm-matrix_aufgabeProperty_parent_type tr').each(function (i, x) {
							 let checked = $(x).find('.matrix_checkbox:checked').length != 0;
							 if (checked || $(x).find('[name="matrix_aufgabeProperty_parent_type_ID[]"]').val()) {
								 var item = {
									 'type': $(x).find('input[type=hidden][name=matrix_aufgabeProperty_parent_type_type]').val(),
								 };
								 if (checked) item._checked = true; // wenn nicht, darf es NICHT gesetzt sein
								 $(x).find('[name]').each(function (i, x) {
											var match = /matrix_aufgabeProperty_parent_type_(.*)\[\]/.exec(x.name);
											if (match) {
													  item[match[1]] = $(x).val() || $(x).text(); // TODO: auf Datentyp-Ebene eine Extraktionsmethode bauen! komplexere Numeric-Typen klappen hiermit nicht; Dropdowns können mit NULL Probleme haben; noch einfacher wäre einfach die Nutzung des Original-ng-Models
											}
								 });
								 values.push(item);
							 }
				  });
				  return values;
		};

		$scope.$watch('matrixCheckboxMatrix_aufgabeProperty_parent_type', function (newval, oldval) {
			// Binding aktualisieren
			

			for (var key in newval) {
				if (!newval.hasOwnProperty(key)) continue;

				let item = newval[key];
				element = $('input[name="matrix_aufgabeProperty_parent_type__' + key.replace(/[^a-zA-Z0-9_]/g) + '"]').parent()[0];

				if (element != undefined && element.MaterialCheckbox != undefined) {
					if (item.checked) {
						element.MaterialCheckbox.check();
					} else {
						element.MaterialCheckbox.uncheck();
					}
				} else {
					delete newval[key];
				}
			}
			let lengthTotal = Object.keys(newval).length;
			let lengthChecked = Object.keys(newval).filter((x) => {return newval[x].checked}).length;

			
		}, true);

		


		
	
		$scope.$watch('form[\'typ\']', function () {
			$.post('Tables/Aufgabe/createMatrixMatrix_aufgabeProperty_parent_type?id='+encodeURIComponent($scope.form['ID'])+'&values=_post&typ='+exportURIValues($scope.$eval('form[\'typ\']'))+'', {values: JSON.stringify($scope.getMatrix_aufgabeProperty_parent_typeValues())}, function (html) {
				var el = $('.cm-matrix_aufgabeProperty_parent_type');
				el.children().remove();
				upgradeDOM(el.html(html));
				setTimeout(updateCheckboxes_matrix_aufgabeProperty_parent_type, 0);
			});
		});
	

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	app.controller('FormWf_aufgabe_edit', function($scope, $http, $element, globals) {
		// Watchers etc.
		
		$scope.$watchGroup(['form[\'typ\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabeType/fetchAufgabe_edit_deadline_defaultDynamic_47_ebnf_Expression3_267_ebnf_anchorsymbol_268_72wf_aufgabe_edit_deadline_defaultDynamic?id=' + encodeURIComponent($scope.$eval('form[\'typ\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['BZGm6VfR'] = req.data;
			});
		});$scope.time = function () {return Math.round((new Date()).getTime() / 1000); };
		$scope.$watchGroup(['form[\'typ\']'], function (newval) {
			if (newval.includes(undefined)) return;
			$http.get('Tables/AufgabeType/fetchAufgabe_edit_deadline_defaultDynamic_291_ebnf_Expression5_132_ebnf_anchorsymbol_133_361wf_aufgabe_edit_deadline_defaultDynamic?id=' + encodeURIComponent($scope.$eval('form[\'typ\']'))).then(function (req) {
				if (typeof $scope.form !== 'undefined') $scope.form['0596OqSu'] = req.data;
			});
		});$scope.Number = Number;$scope.Math = window.Math;
		var deadlineVirgin = false; // if set to true, just follow the default value
		$scope.$watchGroup(['form[\'deadline\']', '((0) == (form[\'BZGm6VfR\'])) ? (\'0\') : (Number(Math.round((time()) / 86400) * 86400) + Number(Number(Number(Number(24) * Number(60)) * Number(60)) * Number(form[\'0596OqSu\'])))'], function (newValues, oldValues, scope) {
			if (newValues[1] !== undefined && !fop_equals(newValues[1], oldValues[1]) && deadlineVirgin)
				scope.form['deadline'] = angular.copy(newValues[1]);
			if (newValues[1] !== undefined)
				deadlineVirgin = fop_equals(scope.form['deadline'], newValues[1]);
		});
	
		function updateCheckboxes_matrix_aufgabeProperty_parent_type() {
			$('.cm-matrix_aufgabeProperty_parent_type').find('.mdl-checkbox').each(function (i, x) {
				x.MaterialCheckbox.updateClasses_();
			});
		}

		$scope.matrixCheckboxMatrix_aufgabeProperty_parent_type = {}; // items
		

		$scope.matrixRegisterMatrix_aufgabeProperty_parent_type = function (id, item) {
			setTimeout(function () {
				$scope.matrixCheckboxMatrix_aufgabeProperty_parent_type[id] = item;
				$scope.$apply();
			}, 0);
		}

		$scope.getMatrix_aufgabeProperty_parent_typeValues = function () {
				  let values = [];
				  $('tbody.cm-matrix_aufgabeProperty_parent_type tr').each(function (i, x) {
							 let checked = $(x).find('.matrix_checkbox:checked').length != 0;
							 if (checked || $(x).find('[name="matrix_aufgabeProperty_parent_type_ID[]"]').val()) {
								 var item = {
									 'type': $(x).find('input[type=hidden][name=matrix_aufgabeProperty_parent_type_type]').val(),
								 };
								 if (checked) item._checked = true; // wenn nicht, darf es NICHT gesetzt sein
								 $(x).find('[name]').each(function (i, x) {
											var match = /matrix_aufgabeProperty_parent_type_(.*)\[\]/.exec(x.name);
											if (match) {
													  item[match[1]] = $(x).val() || $(x).text(); // TODO: auf Datentyp-Ebene eine Extraktionsmethode bauen! komplexere Numeric-Typen klappen hiermit nicht; Dropdowns können mit NULL Probleme haben; noch einfacher wäre einfach die Nutzung des Original-ng-Models
											}
								 });
								 values.push(item);
							 }
				  });
				  return values;
		};

		$scope.$watch('matrixCheckboxMatrix_aufgabeProperty_parent_type', function (newval, oldval) {
			// Binding aktualisieren
			

			for (var key in newval) {
				if (!newval.hasOwnProperty(key)) continue;

				let item = newval[key];
				element = $('input[name="matrix_aufgabeProperty_parent_type__' + key.replace(/[^a-zA-Z0-9_]/g) + '"]').parent()[0];

				if (element != undefined && element.MaterialCheckbox != undefined) {
					if (item.checked) {
						element.MaterialCheckbox.check();
					} else {
						element.MaterialCheckbox.uncheck();
					}
				} else {
					delete newval[key];
				}
			}
			let lengthTotal = Object.keys(newval).length;
			let lengthChecked = Object.keys(newval).filter((x) => {return newval[x].checked}).length;

			
		}, true);

		


		
	
		$scope.$watch('form[\'typ\']', function () {
			$.post('Tables/Aufgabe/editMatrixMatrix_aufgabeProperty_parent_type?id='+encodeURIComponent($scope.form['ID'])+'&values=_post&typ='+exportURIValues($scope.$eval('form[\'typ\']'))+'', {values: JSON.stringify($scope.getMatrix_aufgabeProperty_parent_typeValues())}, function (html) {
				var el = $('.cm-matrix_aufgabeProperty_parent_type');
				el.children().remove();
				upgradeDOM(el.html(html));
				setTimeout(updateCheckboxes_matrix_aufgabeProperty_parent_type, 0);
			});
		});
	

		// Submitting
		$scope.submit = function ($event) {
			
			if ($event.originalEvent.submitter.attributes.name.value == 'cancel') return;
		}
	});
	
	