#
#		ITSV GmbH
#	CCDB - Command and Control Database
#
#	FILE:			dquermfile_SHOWTYPE.txt
#	DESCRIPTION:	DQUERY definition for CCDB DQUERY "SHOWTYPE"
#
@querytitle				Einen Datentyp anzeigen
@querydescription		Zeigt einen Datentyp aus dem Regelwerk mit seinen Parametern an
@paramnames				typname:typename:{{typnameoptions}}
@group					TYPES
@querytype				dbselect
@sql					SELECT RWNAME as TYPNAME, 'TYPNAME' as ATTRIBNAME, RWNAME as ATTRIBVALUE, '' as ATTRIBDESC, '' as SAVE, '' as "DELETE", '' as "ACTRESULT"
						  from CCRW
						 where (RWTYP='TYPE' and RWPARENT='TYPES' and RWNAME=::typname::)
						UNION ALL
						SELECT RWNAME as TYPNAME, 'TYPETITLE' as ATTRIBNAME, RWVALUE as ATTRIBVALUE, '' as ATTRIBDESC, '' as SAVE, '' as "DELETE", '' as "ACTRESULT"
						  from CCRW
						 where (RWTYP='TYPE' and RWPARENT='TYPES' and RWNAME=::typname::)
						UNION ALL
						SELECT RWNAME as TYPNAME, 'TYPEDESC' as ATTRIBNAME, RWDESC as ATTRIBVALUE, '' as ATTRIBDESC, '' as SAVE, '' as "DELETE", '' as "ACTRESULT"
						  from CCRW
						 where (RWTYP='TYPE' and RWPARENT='TYPES' and RWNAME=::typname::)
						UNION ALL
						SELECT RWPARENT as TYPNAME,RWNAME as ATTRIBNAME, RWVALUE as ATTRIBVALUE,RWDESC as ATTRIBDESC, '' as "SAVE", '' as "DELETE", '' as "ACTRESULT"
						  from CCRW 
						 where (RWTYP='TYPEATTRIB' and RWPARENT=::typname::)
						UNION ALL
						SELECT RWNAME as TYPNAME, '' as ATTRIBNAME, '' as ATTRIBVALUE, '' as ATTRIBDESC, '' as "SAVE", '' as "DELETE", 'neues Attribut' as "ACTRESULT"
						  from CCRW
						 where (RWTYP='TYPE' and RWPARENT='TYPES' and RWNAME=::typname::)						
@typnameoptions			{"labeltext":"Name des Typs","typedesc":"Eindeutiger Kurzname des Typs, der angezeigt werden soll"}
@title					Eigenschaften des CCDB-Datentyps <code>{{typname}}</code>
@toptext				<ul>
							<li><a id="SHOWTYPE_ACT_AHL" href="/dquery?dataname=SHOWTYPE&typname={{typname}}">Aktualisieren</a></li>
						</ul>
@decoration {
		decorate_colcell:	{
			TYPNAME:		"$IDCELL",
			ATTRIBNAME:		"$TEXTINPUT",
			ATTRIBVALUE:	{	cmds:	[	{	token:	"$TEXTAREA",
												name:	"RWVALUE",
												options:	{	style:	"font-family: monospace;",
																rows:	1,
																cols:	15
															}
											}
									]
							},
			ATTRIBDESC:		{	cmds:	[	{	token:	"$TEXTAREA",
												name:	"RWDESC",
												options:	{	rows:	1,
																cols:	15
															}
											}
										]
							},
			SAVE:			{	cmds:	[	{	token:	"$BUTTON",
												name:	"Speichern",
												options:	{	action:						"execrest",
																dataname:					"updatetypeattribute",
																parameters:					"action,typname,attribname,attribvalue,attribdesc",
																action_parametername:		"action",
																action_value:				"update",
																typname_parametername:		"typname",
																typname_fromcol:			0,
																attribname_parametername:	"attribname",
																attribname_fromcol:			1,
																attribvalue_parametername:	"attribvalue",
																attribvalue_fromcol:		2,
																attribdesc_parametername:	"attribdesc",
																attribdesc_fromcol:			3,
																resulttocol:				6
															}
											}
										]
							},
			DELETE:			{	cmds:	[	{	token:		"$BUTTON",
												name:		"Löschen",
												options:	{	action:						"execrest",
																dataname:					"updatetypeattribute",
																parameters:					"action,typname,attribname",
																action_parametername:		"action",
																action_value:				"delete",
																typname_parametername:		"typname",
																typname_fromcol:			0,
																attribname_parametername:	"attribname",
																attribname_fromcol:			1,
																resulttocol:				6
															}
											}
										]
							},
			ACTRESULT:		{	cmds:	[	{	token:		"$IDCELL",
												options:	{	style:					"font-family: monospace;"
															}
											}
										]
							}
		}
	}