#
#		ITSV GmbH
#	CCDB - Command and Control Database
#
#	FILE:			dquerymfile_kfoqsdbreports.txt
#	DESCRIPTION:	DQUERY definition for CCDB DQUERY "kfoqsdbreports"
#
@querytitle				Auswertungen in der KFOQSDB-Datenbank
@querydescription		Zeigt eine Liste aller Auswertungen in einer KFOQSDB-Instanz, optional gefiltert durch ein Auswahlkriterium
@group					KFOQSDBREP
@attributenames			cfgname:kfodbconfigname:{{cfgnameoptions}},whereclause:string:{{whereclauseoptions}}
@formpagetitle			Auswahl-Parameter für KFOQSDB-Auswertungen
@cfgnameoptions			{"labeltext":"Datenbank","typedesc":"Name der Datenbank-Zugriffs-Konfiguration, in der abgefragt werden soll"}
@whereclauseoptions		{"labeltext":"Auswahlbedingungen","typedesc":"SQL-where Ausdruck zur Einschränkung der Auswahl"}
@dbconfigname			{{cfgname}}
@querytype				dbselect
@sql_postgresql			select "ID","DokumentId","Mandant","Produkt","Titel","TraegerId","version","File","Erstelldatum","ID" as "Auswahl" from "Auswertung" {{whereclause}}
@title					Auswertungen in der KFO QS-Datenbank {{cfgname}}
@post_query
		for (var i=0; i<that.result.rows.length; i++) { 
			that.result.rows[i].filedata = that.result.rows[i][7]; 
			that.result.rows[i][7] = that.result.rows[i][0];
		}
@decoration.decorate_colcell.0.hyperlink.href			/dquery?dataname=kfoshowreport&cfgname=@@cfgname@@&id=@@celldata@@
@decoration.decorate_colcell.0.hyperlink.title			Zeige Auswertung mit der ID @@celldata@@ an
@decoration.decorate_colcell.0.value					@@celldata@@
@decoration.decorate_colcell.7.hyperlink.href			/dquery?dataname=kfodownloadreport&cfgname=@@cfgname@@&id=@@celldata@@
@decoration.decorate_colcell.7.hyperlink.title			Download von Auswertung mit der ID @@celldata@@ aus der KFOQSDB @@cfgname@@
@decoration.decorate_colcell.7.value					Download
@decoration.decorate_colcell.9							$SELECTBOX
@toptext
	<script>
		function deleteSelection() {
			let sel = $("body :checked");
			let ids = new Array();
			for (let ei=0; ei<sel.length; ei++) {
				ids.push(sel[ei].getAttribute("select_id"));
			}
			window.location.replace("/dquery?dataname=kfodelreport&cfgname=[[cfgname]]&repid="+ids.join(",")+"&chain_dataname=kfoqsreports");
		}
	</script>
	<h3>Aktionen</h3>
	<ul>
		<li><button onClick="deleteSelection();">Auswahl löschen</button></li>
	</ul>