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.
133 lines
4.6 KiB
133 lines
4.6 KiB
48410^Spaltenlayout kopieren^--freemarker template\ |
|
<#include "SQL_lingua_franca"/>\ |
|
<#include "SuperX_general"/>\ |
|
<sqlvars>\ |
|
<sqlvar name="start_serial">\ |
|
select max(tid)+1 from rpta_column2layout;\ |
|
</sqlvar>\ |
|
<sqlvar name="layout_exists">\ |
|
select count(*) from rpta_column_layout where uniquename=<<Neuer Schlüssel>>;\ |
|
</sqlvar>\ |
|
</sqlvars>\ |
|
--Autor: D. Quathamer\ |
|
--Datum: 2.4.2002\ |
|
\ |
|
<#assign zeichen1="<"> \ |
|
<#assign zeichen2=">"> \ |
|
<#assign zeichen3="/"> \ |
|
<#if SQLdialect='Postgres'>\ |
|
begin work;\ |
|
</#if>\ |
|
\ |
|
create temp table tmp_rpta_column_layout \ |
|
(\ |
|
tid integer NOT NULL, --vorher serial\ |
|
uniquename varchar(255) NOT NULL,\ |
|
caption varchar(255),\ |
|
resultset_id integer,\ |
|
whereclause text,\ |
|
description text,\ |
|
userinfo_id integer,\ |
|
sortnr integer,\ |
|
sortclause text,\ |
|
is_virtual smallint DEFAULT 1 NOT NULL\ |
|
);\ |
|
\ |
|
create temp table tmp_rpta_column2layout \ |
|
(\ |
|
tid serial NOT NULL, \ |
|
column_id integer,\ |
|
layout_id integer,\ |
|
sortnr smallint,\ |
|
is_visible smallint DEFAULT 1,\ |
|
visible_size smallint,\ |
|
format_code_id integer,\ |
|
targetfieldname varchar(255),\ |
|
caption varchar(255),\ |
|
description text\ |
|
);\ |
|
ALTER SEQUENCE tmp_rpta_column2layout_tid_seq RESTART with ${start_serial};\ |
|
insert into tmp_rpta_column_layout select * from rpta_column_layout where tid=<<zu kopierendes Spaltenlayout>>;\ |
|
\ |
|
insert into tmp_rpta_column2layout \ |
|
(\ |
|
column_id,\ |
|
layout_id,\ |
|
sortnr,\ |
|
is_visible,\ |
|
visible_size,\ |
|
format_code_id,\ |
|
targetfieldname,\ |
|
caption,\ |
|
description\ |
|
)\ |
|
select \ |
|
column_id,\ |
|
layout_id,\ |
|
sortnr,\ |
|
is_visible,\ |
|
visible_size,\ |
|
format_code_id,\ |
|
targetfieldname,\ |
|
caption,\ |
|
description\ |
|
from rpta_column2layout where layout_id=<<zu kopierendes Spaltenlayout>>;\ |
|
\ |
|
update tmp_rpta_column_layout set uniquename=<<Neuer Schlüssel>>;\ |
|
update tmp_rpta_column_layout set caption=<<Neuer Name>>; \ |
|
update tmp_rpta_column_layout set userinfo_id=<<UserID>>;\ |
|
/*update tmp_rpta_column_layout set description=<<Erläuterung>>;*/\ |
|
\ |
|
<#if <<vorh. Layout überschreiben?>> ='J' || layout_exists=0 >\ |
|
--Falls das neue Layout bereits existiert, wird es gelöscht:\ |
|
delete from rpta_column2layout where layout_id = (select tid from rpta_column_layout where uniquename=<<Neuer Schlüssel>>)\ |
|
and (select administration from userinfo where tid=<<UserID>>)= 1;\ |
|
delete from rpta_column_layout where uniquename=<<Neuer Schlüssel>>\ |
|
and (select administration from userinfo where tid=<<UserID>>)= 1;\ |
|
\ |
|
update tmp_rpta_column_layout set tid = (select (max(tid)+1) from rpta_column_layout);\ |
|
update tmp_rpta_column2layout set layout_id = (select tid from tmp_rpta_column_layout);\ |
|
\ |
|
\ |
|
insert into rpta_column_layout select * from tmp_rpta_column_layout \ |
|
where (select administration from userinfo where tid=<<UserID>>)= 1;\ |
|
insert into rpta_column2layout select * from tmp_rpta_column2layout \ |
|
where (select administration from userinfo where tid=<<UserID>>)= 1;\ |
|
select sp_update_sequence('rpta_column_layout');\ |
|
select sp_update_sequence('rpta_column2layout');\ |
|
\ |
|
\ |
|
<#if SQLdialect='Postgres'>\ |
|
commit;\ |
|
</#if>\ |
|
</#if>\ |
|
\ |
|
create temp table tmp_ergebnis \ |
|
(sp1 varchar(150),\ |
|
sp2 varchar(150), sp3 varchar(150)); \ |
|
\ |
|
insert into tmp_ergebnis (sp1,sp2)\ |
|
select 'Ergebnis', 'Benutzerrechte reichen nicht aus. Spaltenlayout wurde nicht kopiert' from xdummy where (select administration from userinfo where tid=<<UserID>>)!= 1;\ |
|
<#if <<vorh. Layout überschreiben?>> ='J' || layout_exists=0 >\ |
|
insert into tmp_ergebnis (sp1,sp2,sp3)\ |
|
select 'Neues Spaltenlayout:',uniquename || '- ' || caption,'../edit/rpta/rpta_column_layout_edit.jsp|tid=' || tid from rpta_column_layout where tid = (select tid from tmp_rpta_column_layout);\ |
|
<#else>\ |
|
insert into tmp_ergebnis (sp1,sp2)\ |
|
select 'Ergebnis', 'kein Überschreiben gewünscht!' from xdummy ;\ |
|
</#if>\ |
|
\ |
|
\ |
|
select sp1,sp2,sp3 as nextedit from tmp_ergebnis ;^XIL List\ |
|
drop_and_delete movable_columns sizable_columns horizontal_scrolling\ |
|
white_space_color=COLOR_WHITE fixed_columns=2\ |
|
min_heading_height=35\ |
|
Column CID=0 heading_text="Ergebnis " center_heading\ |
|
row_selectable col_selectable heading_platform readonly\ |
|
width=50 text_size=100\ |
|
Column CID=1 heading_text=" Wert " center_heading\ |
|
row_selectable col_selectable heading_platform readonly\ |
|
width=50 text_size=100\ |
|
Column CID=2 heading_text=" Bearbeiten" center_heading\ |
|
row_selectable col_selectable heading_platform readonly\ |
|
width=50 text_size=100\ |
|
@@@^ ^ ^Eine neue Maske kopieren^drop table tmp_ergebnis;drop table tmp_rpta_column_layout;drop table tmp_rpta_column2layout;^^2^440^360^^1^^
|
|
|