1: PACKAGE BODY icx_questions_admin AS
2: /* $Header: ICXQUADB.pls 115.2 1999/12/09 22:54:02 pkm ship $ */
3:
4: /*
5: ** We need need to fetch URL prefix from WF_WEB_AGENT in wf_resources
129:
130: l_question := substrb(l_temp_str, l_colon+1);
131:
132:
133: return (wfa_html.base_url||'/icx_questions_admin.display_questions'||
134: '?p_application_short_name='||wfa_html.conv_special_url_chars(l_application_short_name)||
135: '&p_question_code='||wfa_html.conv_special_url_chars(l_question_code)||
136: '&p_question='||wfa_html.conv_special_url_chars(l_question));
137:
506: htp.tableopen(calign=>'CENTER');
507:
508: if (P_INSERT = 'FALSE') THEN
509:
510: htp.p('
512: else
513:
514: htp.p('
510: htp.p('
528: -- the proper escape sequence.
529: l_url := 'javascript:fnd_open_dm_display_window('||''''||
530: REPLACE('wf_lov.display_lov?p_lov_name='||'questions'||
531: '&p_display_name='||wf_core.translate('ICX_APPLICATION')||
532: '&p_validation_callback=icx_questions_admin.application_lov'||
533: '&p_dest_hidden_field=top.opener.document.ICX_EDIT_QUESTION.p_application_short_name.value'||
534: '&p_current_value=top.opener.document.ICX_EDIT_QUESTION.p_application_short_name.value'||
535: '&p_dest_display_field=top.opener.document.ICX_EDIT_QUESTION.p_application_short_name.value',
536: ' ', '%20')||''''||',400,500)';
604: wf_pref.create_reg_button (l_url, l_onmouseover, l_media, l_icon, l_text);
605:
606: htp.p('');
607:
608: l_url := icx_questions_admin.get_display_syntax (p_find_criteria);
609: l_icon := 'FNDJLFCN.gif';
610: l_text := wf_core.translate ('CANCEL');
611: l_onmouseover := wf_core.translate ('CANCEL');
612:
627:
628:
629: exception
630: when others then
631: wf_core.context('icx_questions_admin', 'edit_question');
632: icx_questions_admin.error;
633:
634: END edit_question;
635:
628:
629: exception
630: when others then
631: wf_core.context('icx_questions_admin', 'edit_question');
632: icx_questions_admin.error;
633:
634: END edit_question;
635:
636: --
666: end if;
667:
668: SELECT count(*)
669: INTO l_count
670: FROM ICX_QUESTIONS ICX
671: WHERE ICX.QUESTION_CODE = UPPER(P_QUESTION_CODE);
672:
673: if (l_count > 0) THEN
674:
684:
685:
686: if (l_error_msg IS NOT NULL) THEN
687:
688: owa_util.redirect_url(curl=>wfa_html.base_url||'/'||'icx_questions_admin.edit_question'||
689: '?p_application_id='||p_application_id||
690: '&p_error_message='||l_error_msg||
691: '&p_application_short_name='||UPPER(p_application_short_name)||
692: '&p_question_code='||wfa_html.conv_special_url_chars(UPPER(p_question_code))||
701: INTO L_APPLICATION_ID
702: FROM FND_APPLICATION_VL FND
703: WHERE FND.APPLICATION_SHORT_NAME = UPPER(P_APPLICATION_SHORT_NAME);
704:
705: ICX_QUESTIONS_PKG.INSERT_ROW (
706: L_ROWID,
707: UPPER(P_QUESTION_CODE),
708: L_APPLICATION_ID,
709: 'QUESTION',
714: 1,
715: 1);
716:
717: -- use owa_util.redirect_url to redirect the URL to the home page
718: owa_util.redirect_url(curl=>icx_questions_admin.get_display_syntax (p_find_criteria),
719: bclose_header=>TRUE);
720:
721: END IF;
722:
723:
724:
725: exception
726: when others then
727: wf_core.context('icx_questions_admin', 'insert_question');
728: icx_questions_admin.error;
729:
730: END insert_question;
731:
724:
725: exception
726: when others then
727: wf_core.context('icx_questions_admin', 'insert_question');
728: icx_questions_admin.error;
729:
730: END insert_question;
731:
732: --
767:
768:
769: if (l_error_msg IS NOT NULL) THEN
770:
771: owa_util.redirect_url(curl=>wfa_html.base_url||'/'||'icx_questions_admin.edit_question'||
772: '?p_application_id='||p_application_id||
773: '&p_error_message='||l_error_msg||
774: '&p_application_short_name='||UPPER(p_application_short_name)||
775: '&p_question_code='||wfa_html.conv_special_url_chars(p_question_code)||
779: bclose_header=>TRUE);
780:
781: else
782:
783: ICX_QUESTIONS_PKG.UPDATE_ROW (
784: P_QUESTION_CODE,
785: P_APPLICATION_ID,
786: 'QUESTION',
787: P_QUESTION,
789: 1,
790: 1);
791:
792: -- use owa_util.redirect_url to redirect the URL to the home page
793: owa_util.redirect_url(curl=>icx_questions_admin.get_display_syntax (p_find_criteria),
794: bclose_header=>TRUE);
795:
796: end if;
797:
796: end if;
797:
798: exception
799: when others then
800: wf_core.context('icx_questions_admin', 'update_question');
801: icx_questions_admin.error;
802:
803: END update_question;
804:
797:
798: exception
799: when others then
800: wf_core.context('icx_questions_admin', 'update_question');
801: icx_questions_admin.error;
802:
803: END update_question;
804:
805: /*===========================================================================
833: htp.p('
834: htp.title(wf_core.translate('ICX_CONFIRMTITLE'));
835: wfa_html.create_help_function('wf/links/dmn.htm?DMND');
836: htp.headClose;
837: wfa_sec.Header(FALSE, 'icx_questions_admin.find_questions',wf_core.translate('ICX_CONFIRMTITLE'), FALSE);
838: htp.br;
839:
840: htp.bodyOpen(cattributes=>'bgcolor="#CCCCCC"');
841: htp.tableOpen(calign=>'CENTER');
848: htp.br;
849: htp.tableopen(calign=>'CENTER');
850: --Submit Button
851: htp.tableRowOpen;
852: l_url := wfa_html.base_url||'/icx_questions_admin.delete_question'||
853: '?p_application_id='||p_application_id||
854: '&p_question_code='||wfa_html.conv_special_url_chars(p_question_code)||
855: '&p_find_criteria='||wfa_html.conv_special_url_chars(p_find_criteria);
856: l_icon := 'FNDJLFOK.gif';
860: htp.p('
878:
879: exception
880: when others then
881: rollback;
882: wf_core.context('icx_questions_admin', 'question_confirm_delete');
883: icx_questions_admin.Error;
884: END Question_Confirm_Delete;
885:
886:
879: exception
880: when others then
881: rollback;
882: wf_core.context('icx_questions_admin', 'question_confirm_delete');
883: icx_questions_admin.Error;
884: END Question_Confirm_Delete;
885:
886:
887: --
898:
899: BEGIN
900:
901: delete from icx_question_functions where question_code = p_question_code;
902: delete from icx_questions_tl where question_code = p_question_code;
903: delete from icx_questions where question_code = p_question_code;
904:
905: -- use owa_util.redirect_url to redirect the URL to the home page
906: owa_util.redirect_url(curl=>icx_questions_admin.get_display_syntax (p_find_criteria),
899: BEGIN
900:
901: delete from icx_question_functions where question_code = p_question_code;
902: delete from icx_questions_tl where question_code = p_question_code;
903: delete from icx_questions where question_code = p_question_code;
904:
905: -- use owa_util.redirect_url to redirect the URL to the home page
906: owa_util.redirect_url(curl=>icx_questions_admin.get_display_syntax (p_find_criteria),
907: bclose_header=>TRUE);
902: delete from icx_questions_tl where question_code = p_question_code;
903: delete from icx_questions where question_code = p_question_code;
904:
905: -- use owa_util.redirect_url to redirect the URL to the home page
906: owa_util.redirect_url(curl=>icx_questions_admin.get_display_syntax (p_find_criteria),
907: bclose_header=>TRUE);
908:
909: exception
910: when others then
907: bclose_header=>TRUE);
908:
909: exception
910: when others then
911: wf_core.context('icx_questions_admin', 'delete_question');
912: icx_questions_admin.error;
913:
914: END delete_question;
915:
908:
909: exception
910: when others then
911: wf_core.context('icx_questions_admin', 'delete_question');
912: icx_questions_admin.error;
913:
914: END delete_question;
915:
916: --
1058: htp.p('
1059: htp.title(wf_core.translate('ICX_FUNCTIONS_TITLE'));
1060: wfa_html.create_help_function('wf/links/dmr.htm?DMREP');
1061: htp.headClose;
1062: wfa_sec.Header(FALSE, 'icx_questions_admin.find_questions',wf_core.translate('ICX_FUNCTIONS_TITLE'), FALSE);
1063: htp.br;
1064:
1065: -- Column headers
1066: htp.tableOpen('border=1 cellpadding=3 bgcolor=white width="100%"');
1090: htp.tableData(p_question_code, 'left');
1091:
1092: htp.tableData(htf.anchor2(
1093: curl=>wfa_html.base_url||
1094: '/icx_questions_admin.edit_function'||
1095: '?p_question_code='||wfa_html.conv_special_url_chars(p_question_code)||
1096: '&p_function_id='||functions.function_id||
1097: '&p_function_name='||wfa_html.conv_special_url_chars(functions.function_name)||
1098: '&p_insert=FALSE'||
1102:
1103: htp.tableData(functions.user_function_name, 'left');
1104:
1105: htp.tableData(htf.anchor2(curl=>wfa_html.base_url||
1106: '/icx_questions_admin.delete_function'||
1107: '?p_question_code='||wfa_html.conv_special_url_chars(p_question_code)||
1108: '&p_function_name='||wfa_html.conv_special_url_chars(functions.function_name)||
1109: '&p_find_criteria='||wfa_html.conv_special_url_chars(p_find_criteria),
1110: ctext=>''),
1120:
1121: --Add new node Button
1122: htp.tableRowOpen;
1123:
1124: l_url := wfa_html.base_url||'/icx_questions_admin.edit_function'||
1125: '?p_question_code='||wfa_html.conv_special_url_chars(p_question_code)||
1126: '&p_insert=TRUE'||
1127: '&p_find_criteria='||wfa_html.conv_special_url_chars(p_find_criteria);
1128: l_icon := 'FNDADD11.gif';
1134: wf_pref.create_reg_button (l_url, l_onmouseover, l_media, l_icon, l_text);
1135:
1136: htp.p('');
1137:
1138: l_url := icx_questions_admin.get_display_syntax (p_find_criteria);
1139: l_icon := 'FNDJLFCN.gif';
1140: l_text := wf_core.translate ('ICX_RETURN_TO_QUESTIONS');
1141: l_onmouseover := wf_core.translate ('ICX_RETURN_TO_QUESTIONS');
1142:
1154: htp.htmlClose;
1155:
1156: exception
1157: when others then
1158: wf_core.context('icx_questions_admin', 'DISPLAY_FUNCTIONS');
1159: icx_questions_admin.error;
1160: end DISPLAY_FUNCTIONS;
1161:
1162:
1155:
1156: exception
1157: when others then
1158: wf_core.context('icx_questions_admin', 'DISPLAY_FUNCTIONS');
1159: icx_questions_admin.error;
1160: end DISPLAY_FUNCTIONS;
1161:
1162:
1163: --
1220:
1221: htp.headClose;
1222:
1223: -- Page header
1224: wfa_sec.Header(FALSE, 'icx_questions_admin.find_questions', wf_core.translate('ICX_EDIT_FUNCTION_TITLE'), TRUE);
1225:
1226: -- Print the error message if there is one
1227: if (P_ERROR_MESSAGE IS NOT NULL) THEN
1228:
1235: htp.tableopen(calign=>'CENTER');
1236:
1237: if (P_INSERT = 'FALSE') THEN
1238:
1239: htp.p('
1241: else
1242:
1243: htp.p('
1239: htp.p('
1271: -- the proper escape sequence.
1272: l_url := 'javascript:fnd_open_dm_display_window('||''''||
1273: REPLACE('wf_lov.display_lov?p_lov_name='||'functions'||
1274: '&p_display_name='||wf_core.translate('ICX_FUNCTION')||
1275: '&p_validation_callback=icx_questions_admin.function_lov'||
1276: '&p_dest_hidden_field=top.opener.document.ICX_EDIT_FUNCTION.p_function_name.value'||
1277: '&p_current_value=top.opener.document.ICX_EDIT_FUNCTION.p_function_name.value'||
1278: '&p_dest_display_field=top.opener.document.ICX_EDIT_FUNCTION.p_function_name.value',
1279: ' ', '%20')||''''||',400,500)';
1317: wf_pref.create_reg_button (l_url, l_onmouseover, l_media, l_icon, l_text);
1318:
1319: htp.p('');
1320:
1321: l_url := wfa_html.base_url||'/'||'icx_questions_admin.display_functions'||
1322: '?p_question_code='||wfa_html.conv_special_url_chars(p_question_code)||
1323: '&p_find_criteria='||wfa_html.conv_special_url_chars(p_find_criteria);
1324: l_icon := 'FNDJLFCN.gif';
1325: l_text := wf_core.translate ('CANCEL');
1342:
1343:
1344: exception
1345: when others then
1346: wf_core.context('icx_questions_admin', 'edit_function');
1347: icx_questions_admin.error;
1348:
1349: END edit_function;
1350:
1343:
1344: exception
1345: when others then
1346: wf_core.context('icx_questions_admin', 'edit_function');
1347: icx_questions_admin.error;
1348:
1349: END edit_function;
1350:
1351:
1495:
1496:
1497: if (l_error_msg IS NOT NULL) THEN
1498:
1499: owa_util.redirect_url(curl=>wfa_html.base_url||'/'||'icx_questions_admin.edit_function'||
1500: '?p_question_code='||wfa_html.conv_special_url_chars(p_question_code)||
1501: '&p_function_id='||p_function_id||
1502: '&p_function_name='||wfa_html.conv_special_url_chars(p_function_name)||
1503: '&p_insert=TRUE'||
1524: 1
1525: );
1526:
1527: -- use owa_util.redirect_url to redirect the URL to the home page
1528: owa_util.redirect_url(curl=>wfa_html.base_url||'/'||'icx_questions_admin.display_functions'||
1529: '?p_question_code='||wfa_html.conv_special_url_chars(p_question_code)||
1530: '&p_find_criteria='||wfa_html.conv_special_url_chars(p_find_criteria),
1531: bclose_header=>TRUE);
1532:
1533: end if;
1534:
1535: exception
1536: when others then
1537: wf_core.context('icx_questions_admin', 'insert_function');
1538: icx_questions_admin.error;
1539:
1540: END insert_function;
1541:
1534:
1535: exception
1536: when others then
1537: wf_core.context('icx_questions_admin', 'insert_function');
1538: icx_questions_admin.error;
1539:
1540: END insert_function;
1541:
1542: --
1584: end if;
1585:
1586: if (l_error_msg IS NOT NULL) THEN
1587:
1588: owa_util.redirect_url(curl=>wfa_html.base_url||'/'||'icx_questions_admin.edit_function'||
1589: '?p_question_code='||wfa_html.conv_special_url_chars(p_question_code)||
1590: '&p_function_id='||p_function_id||
1591: '&p_function_name='||wfa_html.conv_special_url_chars(p_function_name)||
1592: '&p_insert=TRUE'||
1605: AND FUNCTION_NAME = P_OLD_FUNCTION_NAME;
1606:
1607: -- use owa_util.redirect_url to redirect the URL to the home page
1608:
1609: owa_util.redirect_url(curl=>wfa_html.base_url||'/'||'icx_questions_admin.display_functions'||
1610: '?p_question_code='||wfa_html.conv_special_url_chars(p_question_code)||
1611: '&p_find_criteria='||wfa_html.conv_special_url_chars(p_find_criteria),
1612: bclose_header=>TRUE);
1613:
1614: end if;
1615:
1616: exception
1617: when others then
1618: wf_core.context('icx_questions_admin', 'update_function');
1619: icx_questions_admin.error;
1620:
1621: END update_function;
1622:
1615:
1616: exception
1617: when others then
1618: wf_core.context('icx_questions_admin', 'update_function');
1619: icx_questions_admin.error;
1620:
1621: END update_function;
1622:
1623:
1642: WHERE QUESTION_CODE = P_QUESTION_CODE
1643: AND FUNCTION_NAME = P_FUNCTION_NAME;
1644:
1645: -- use owa_util.redirect_url to redirect the URL to the home page
1646: owa_util.redirect_url(curl=>wfa_html.base_url||'/'||'icx_questions_admin.display_functions'||
1647: '?p_question_code='||wfa_html.conv_special_url_chars(p_question_code)||
1648: '&p_find_criteria='||wfa_html.conv_special_url_chars(p_find_criteria),
1649: bclose_header=>TRUE);
1650:
1649: bclose_header=>TRUE);
1650:
1651: exception
1652: when others then
1653: wf_core.context('icx_questions_admin', 'delete_function');
1654: icx_questions_admin.error;
1655:
1656: END delete_function;
1657:
1650:
1651: exception
1652: when others then
1653: wf_core.context('icx_questions_admin', 'delete_function');
1654: icx_questions_admin.error;
1655:
1656: END delete_function;
1657:
1658: END icx_questions_admin;
1654: icx_questions_admin.error;
1655:
1656: END delete_function;
1657:
1658: END icx_questions_admin;
1659: