x
1
declare
2
r_table RECORD;
3
history TEXT;
4
summary text;
5
user_created text;
6
date_created text;
7
8
begin
9
history := '<span style="white-space: pre-line">';
10
11
12
13
FOR r_table in
14
select u.name, cof_getreflistvalue('R_RequestUpdate', 'ConfidentialTypeEntry', ru.confidentialtypeentry) as confidentialtypeentry, ru."result", to_char(ru.created,'dd/MM/YY HH12:MI:SS') as data_hora from r_requestupdate ru
15
left join ad_user u on u.ad_user_id = ru.createdby where ru.r_request_id = request_id and (internaluser or ru.confidentialtypeentry != 'I') order by ru.created desc
16
LOOP
17
history := history || '<b>Usuário:</b> ' || r_table.name || ' - <b>Data:</b> ' || r_table.data_hora || ' - <b>Visibilidade:</b> ' || r_table.confidentialtypeentry || ' - <b>Resultado:</b> <br/>' || r_table.result || '<hr/>';
18
END LOOP;
19
20
select coalesce(r.summary,''), u.name, to_char(r.created,'dd/MM/YY HH12:MI:SS') into summary,user_created,date_created from r_request r
21
left join ad_user u on u.ad_user_id = r.createdby where r.r_request_id = request_id ;
22
23
history := history || '<b>Usuário:</b> ' || user_created|| ' - <b> Data:</b> ' || date_created || ' - <b>Resumo:</b> <br/> ' || summary || '</span>';
24
25
RETURN history;
26
END;