You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.7 KiB
48 lines
1.7 KiB
50070^Nutzungsantrag Genehmigung1 Verarbeitung^--freemarker template\ |
|
<sqlvars>\ |
|
<sqlvar name="genehmigung1count">select count(*) from user_antrag where tid=<<AntragId>> </sqlvar>\ |
|
<sqlvar name="genehmigung1ok">select count(*) from user_antrag A left outer join user_antrag_genehmigung G\ |
|
on (G.antrag_id=A.tid)\ |
|
where A.tid=<<AntragId>> \ |
|
and G.genehmigung1_userid is null; </sqlvar>\ |
|
</sqlvars>\ |
|
begin work;\ |
|
\ |
|
<#if genehmigung1count!=1>\ |
|
select 'Kein Antrag mit Id <<AntragId>> gefunden' from xdummy;\ |
|
<#elseif genehmigung1ok=0>\ |
|
select 'Fehler: Antrag mit Id <<AntragId>> wurde bereits vorher genehmigt' from xdummy;\ |
|
<#else>\ |
|
insert into user_antrag_genehmigung(antrag_id,\ |
|
antragsempfaenger_id,\ |
|
genehmigung1_userid,\ |
|
genehmigung1_zeitpunkt,\ |
|
genehmigung1_titel,\ |
|
genehmigung1_vorname,\ |
|
genehmigung1_nachname,\ |
|
genehmigung1_notiz)\ |
|
select <<AntragId>>,\ |
|
A.antragsempfaenger_id,\ |
|
<<UserID>> as genehmigung1_userid,\ |
|
now() as genehmigung1_zeitpunkt,\ |
|
'${Genehmigung1_Titel}',\ |
|
'${Genehmigung1_Vorname}',\ |
|
'${Genehmigung1_Nachname}',\ |
|
'${Notiz}'\ |
|
from user_antrag A left outer join user_antrag_genehmigung G\ |
|
on (G.antrag_id=A.tid)\ |
|
where A.tid=<<AntragId>> \ |
|
--sicherheitshalber\ |
|
and G.genehmigung1_userid is null;\ |
|
select 'Genehmigung für Antrag <<AntragId>> gespeichert' from xdummy;\ |
|
</#if>\ |
|
\ |
|
commit;^XIL List\ |
|
drop_and_delete movable_columns sizable_columns horizontal_scrolling\ |
|
white_space_color=COLOR_WHITE fixed_columns=1\ |
|
min_heading_height=35\ |
|
Column CID=0 heading_text="Ergebnis " center_heading\ |
|
row_selectable col_selectable heading_platform readonly\ |
|
width=50 text_size=100\ |
|
\ |
|
@@@^ ^ ^^ ^^2^440^360^^1^^
|
|
|