--
htp.tableRowOpen(cvalign=>'Baseline');
htp.tableData(cvalue=>wf_core.translate('SUBJECT'),
calign=>'right', cattributes=>'id=""');
--make colspan 1 less than col because 1 col is taken up by "subject"
htp.tableHeader(cvalue=>l_subject,
calign=>'left',
ccolspan=>col-1,
cattributes=>'BGCOLOR=WHITE id=""');
htp.tableRowClose;
htp.tableClose;
--
-- COMMENTS
--
if (notrec.user_comment is not null) then
htp.p(wf_core.translate('COMMENTS')||':');
htp.tableOpen(cattributes=>'WIDTH=100% BGCOLOR=WHITE summary=""');
htp.tableRowOpen;
htp.p('');
htp.tableRowClose;
htp.tableClose;
end if;
--
-- BODY
--
htp.hr;
htp.tableOpen(cattributes=>'WIDTH=100% BGCOLOR=WHITE summary=""');
htp.tableRowOpen;
end_of_text:=FALSE;
-- print message body. This may be in sections.
htp.p('');
while not (end_of_text) loop
wf_notification.getfullbody(to_number(nid),msgbody,end_of_text,
wf_notification.doc_html);
htp.prn(msgbody);
end loop;
htp.p(' | ');
htp.tableRowClose;
htp.tableClose;
htp.br;
for not_attr_row in notification_attrs_cursor(nid) loop
if (first_doc = TRUE) then
htp.hr;
htp.br;
htp.tableopen(cattributes=>'BORDER=0 cellpadding=0 cellspacing=0 summary=""');
htp.tablerowopen;
first_doc := FALSE;
end if;
if (not_attr_row.type = 'DOCUMENT') then
if (UPPER(SUBSTR(not_attr_row.text_value, 1, 2)) = 'DM') then
/*
** Get the HTML text for displaying the document
*/
fnd_document_management.get_launch_document_url (
username,
not_attr_row.text_value,
FALSE,
link_text);
link_text := ''||
'';
elsif (UPPER(SUBSTR(not_attr_row.text_value, 1, 5)) = 'PLSQL') then
if (nkey is null) then
link_text := ''||
'';
else
link_text := ''||
'';
end if;
end if;
elsif (not_attr_row.type = 'URL') then
link_text := wf_notification.geturltext(not_attr_row.text_value, nid);
--### debug
htp.p('');
htp.p('');
link_text := wf_notification.SetFrameworkAgent(link_text);
htp.p('');
link_text := ''||
'';
end if;
htp.tabledata(cvalue=>link_text, calign=>'CENTER', cattributes=>'id=""');
htp.tabledata(cvalue=>' ', calign=>'CENTER', cattributes=>'id=""');
end loop;
if (showforms is not null) then
for not_attr_row in ntf_forms_attrs_cursor(nid) loop
if (first_doc = TRUE) then
htp.hr;
htp.br;
htp.tableopen(cattributes=>'BORDER=0 cellpadding=0 cellspacing=0 summary=""');
htp.tablerowopen;
first_doc := FALSE;
end if;
--Check the SOCKET_LISTENER_PORT profile option.
l_forms_port :=
Wfa_Sec.Get_Profile_Value('SOCKET_LISTENER_PORT',username);
htp.p('');
Wf_Forms.Applet(
fname=>Wf_Notification.GetShortText(not_attr_row.text_value, nid),
status=>l_status,
dispname=>not_attr_row.display_name,
port=>nvl(l_forms_port, '0'));
htp.p(' | ');
htp.tabledata(cvalue=>' ', calign=>'CENTER', cattributes=>'id=""');
if (not l_status) then
cnt := cnt + 1;
end if;
end loop;
end if;
-- If you found a row then close the table row you opened and open a new
-- one for the document title
if (first_doc = FALSE) then
htp.tableRowClose;
htp.tablerowopen;
end if;
for not_attr_row in notification_attrs_cursor(nid) loop
if (not_attr_row.type = 'DOCUMENT') then
if (UPPER(SUBSTR(not_attr_row.text_value, 1, 2)) = 'DM') then
/*
** Get the HTML text for displaying the document
*/
fnd_document_management.get_launch_document_url (
username,
not_attr_row.text_value,
FALSE,
link_text);
link_text := ''||
not_attr_row.display_name||
'';
elsif (UPPER(SUBSTR(not_attr_row.text_value, 1, 5)) = 'PLSQL') then
if (nkey is null) then
link_text := ''||
not_attr_row.display_name||'';
else
link_text := ''||
not_attr_row.display_name||'';
end if;
end if;
elsif (not_attr_row.type = 'URL') then
link_text := wf_notification.geturltext(not_attr_row.text_value, nid);
link_text := wf_notification.SetFrameworkAgent(link_text);
link_text := ''||
not_attr_row.display_name||'';
end if;
htp.tabledata(cvalue=>link_text, calign=>'CENTER', cattributes=>'id=""');
htp.tabledata(cvalue=>' ', calign=>'CENTER', cattributes=>'id=""');
end loop;
if (showforms is not null) then
for not_attr_row in ntf_forms_attrs_cursor(nid) loop
htp.p('');
htp.p(not_attr_row.display_name);
htp.p(' | ');
htp.tabledata(cvalue=>' ', calign=>'CENTER',
cattributes=>'id=""');
end loop;
end if;
-- If you found a row then close the table row you opened and open a new
-- one for the document title
if (first_doc = FALSE) then
htp.tableRowClose;
htp.tableClose;
end if;
--
-- Print warning message
--
if (cnt > 0) then
htp.p(''||wf_core.translate('WF_EXECUTE_FORM_FAILED'));
htp.br;
end if;
--
-- Page footer
--
Wfa_Sec.Footer;
htp.htmlClose;
exception
when others then
rollback;
wf_core.context('Wfa_Html', 'DetailFrame', nid, nkey);
wfa_html.Error;
end DetailFrame;
--
-- ResponseFrame
-- generate response frame contents
-- IN
-- nid - notification id
-- nkey - notification access key (for mailed html only)
-- agent - web agent (OBSOLETE - for back compatibility only)
-- showforms - show form attributes
--
procedure ResponseFrame(
nid in varchar2,
nkey in varchar2,
agent in varchar2,
showforms in varchar2)
as
username varchar2(320);
recipient varchar2(320);
realname varchar2(360);
status varchar2(8);
s0 varchar2(2000);
-- url_str varchar2(240);
l_status boolean := FALSE;
cnt pls_integer := 0;
pseudo_login boolean := FALSE;
l_forms_port varchar2(120);
cursor attrs(resultflag in varchar2, typeflag in varchar2) is
select MA.NAME,
MA.DISPLAY_NAME,
MA.DESCRIPTION,
-- remove quotes for onmouse over java func
replace(MA.DESCRIPTION,'''') description2,
NA.TEXT_VALUE,
NA.NUMBER_VALUE,
NA.DATE_VALUE,
MA.TYPE,
MA.FORMAT
from WF_NOTIFICATION_ATTRIBUTES NA,
WF_MESSAGE_ATTRIBUTES_VL MA,
WF_NOTIFICATIONS N
where N.NOTIFICATION_ID = to_number(ResponseFrame.nid)
and NA.NOTIFICATION_ID = N.NOTIFICATION_ID
and MA.MESSAGE_NAME = N.MESSAGE_NAME
and MA.MESSAGE_TYPE = N.MESSAGE_TYPE
and MA.NAME = NA.NAME
and MA.SUBTYPE = 'RESPOND'
and MA.TYPE <> 'FORM'
and ((resultflag = 'RESULT' and MA.NAME = 'RESULT') or
(resultflag <> 'RESULT' and MA.NAME <> 'RESULT'))
and MA.TYPE = decode(typeflag, '', MA.TYPE, typeflag)
order by MA.SEQUENCE;
cursor forms_attrs is
select MA.NAME,
MA.DISPLAY_NAME,
MA.DESCRIPTION,
-- remove quotes for onmouse over java func
replace(MA.DESCRIPTION,'''') description2,
NA.TEXT_VALUE
from WF_NOTIFICATION_ATTRIBUTES NA,
WF_MESSAGE_ATTRIBUTES_VL MA,
WF_NOTIFICATIONS N
where N.NOTIFICATION_ID = to_number(ResponseFrame.nid)
and NA.NOTIFICATION_ID = N.NOTIFICATION_ID
and MA.MESSAGE_NAME = N.MESSAGE_NAME
and MA.MESSAGE_TYPE = N.MESSAGE_TYPE
and MA.NAME = NA.NAME
and MA.SUBTYPE = 'RESPOND'
and MA.TYPE = 'FORM'
order by MA.SEQUENCE;
result attrs%rowtype;
dvalue varchar2(2000);
respcnt pls_integer;
urlcount pls_integer;
urlstring varchar2(4000);
result_count pls_integer;
resp_lbl varchar2(80);
colon pls_integer;
dmstype varchar2(30) := '';
document varchar2(32000) := '';
hide_button varchar2(1);
sess_username varchar2(320);
begin
-- Authenticate user
username := Wfa_Html.Authenticate(to_number(nid), nkey);
Wf_Notification.GetInfo(to_number(nid), recipient, s0, s0, s0, s0, status);
Wf_Directory.GetRoleInfo(recipient, realname, s0, s0, s0, s0);
-- if nkey is not null, it is from email, and we need to create a pseudo
-- session for it.
if (nkey is not null) then
begin
wfa_sec.validate_only := TRUE;
wfa_sec.GetSession(sess_username);
if (sess_username <> 'ANONYMOUS' and sess_username <> '-1'
and sess_username is not null) then
-- there is a valid session already, just use it
username := sess_username;
else
-- username -1 meant user had logged out. Do this to reset the page.
if (sess_username = '-1') then
owa_util.showpage;
end if;
-- create a pseudo session for user
owa_util.mime_header('text/html', FALSE);
wfa_sec.PseudoSession(FALSE, username);
end if;
exception
when OTHERS then
-- this is the first attempt to see a detached notfication
wf_core.clear;
owa_util.mime_header('text/html', FALSE);
wfa_sec.PseudoSession(FALSE, username);
end;
wfa_sec.validate_only := FALSE;
end if;
wfa_html_util.GetUrlCount(to_number(nid),urlcount,urlstring);
-- If there is just one url then replace the response frame with the url
if (urlcount = 1) then
-- GoToUrl(wf_notification.GetURLText(urlstring, nid),'_self');
owa_util.redirect_url(wf_notification.GetURLText(urlstring, nid));
return;
end if;
-- bug 2167012 JWSMITH moved header_close to after owa_util.redirect
owa_util.http_header_close;
--
-- Header and Page Title
--
htp.htmlOpen;
htp.headOpen;
if (status = 'OPEN') then
htp.title(wf_core.translate('WFA_DTITLE')||' '||realname);
else
htp.title(wf_core.translate('WFA_CDTITLE')||' '||realname);
end if;
-- Add the java script to the header to open the dm window for
-- any DM function that is executed.
fnd_document_management.get_open_dm_attach_window;
fnd_document_management.get_open_dm_display_window;
htp.headClose;
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
--
-- Response body content
--
wfa_sec.header(background_only=>TRUE);
-- Add the Return to Worklist link before other attributes.
-- We shows it regardless if we have open response or not.
-- Fix bug #785206. We don't show the WorkList link if is coming from
-- email attachment
if (nkey is null) then
htp.center(htf.anchor(
curl => owa_util.get_owa_service_path||'wfa_html.WorkList',
ctext => wf_core.translate('WFA_WORKLIST_RETURN'),
cattributes=>'TARGET="_top"'));
else
pseudo_login := TRUE;
end if;
--
-- Handle Response Forms Attributes
-- Note that similar to URL, it is mutally exclusive to other attributes
--
-- Do not allow any response if notification is not opened
--
if (status = 'OPEN') then
if (showforms is not null) then
htp.tableOpen(cattributes=>'summary=""');
respcnt := 0;
for rec in forms_attrs loop
htp.tableRowOpen;
htp.p('
');
if (rec.description is not null) then
htp.p(rec.description);
else
htp.br;
end if;
htp.p(' | ');
--Check the SOCKET_LISTENER_PORT profile option.
l_forms_port :=
Wfa_Sec.Get_Profile_Value('SOCKET_LISTENER_PORT',username);
htp.p('');
Wf_Forms.Applet(fname=>Wf_Notification.GetShortText(rec.text_value,
to_number(ResponseFrame.nid)),
status=>l_status,
port=>nvl(l_forms_port, '0'));
htp.p(' | ');
htp.tableRowClose;
htp.tableRowOpen;
htp.tableData(rec.display_name, 'CENTER', cattributes=>'id=""');
htp.tableRowClose;
if (not l_status) then
cnt := cnt + 1;
end if;
respcnt := respcnt + 1;
end loop;
htp.tableClose;
--
-- Print warning message
--
if (cnt > 0) then
htp.p(''||wf_core.translate('WF_EXECUTE_FORM_FAILED'));
htp.br;
end if;
if (respcnt >= 1) then
Wfa_Sec.Footer;
htp.htmlClose;
return;
end if;
end if;
end if;
--
-- Check for response URLs. If more than one is found, display a list of
-- URL links instead of the standard response frame. If only one is found
-- then the main response frame function will be replaced in the detail
-- procedure
--
if (urlcount > 1) then
htp.tableOpen(cattributes=>'summary=""');
for rec in attrs('NORESULT', 'URL') loop
htp.tableRowOpen;
wfa_html_util.GetUrl(nid, rec.description, rec.text_value);
htp.tableRowClose;
end loop;
htp.tableClose;
Wfa_Sec.Footer;
htp.htmlClose;
return;
end if;
if (status = 'OPEN') then
htp.p('