You are on page 1of 27

/* Modification History -------------------Done by : Megasoft L.L.C.

(Contractor), 07/16/1999 On : 07/16/1999 Purpose : Change certain messages to appear not as alerts */ procedure alert_message(opt1 in number, str in char) is al_id Alert; Button_no number; e_type char(4) := error_type; e_code number := error_code; m_type char(4) := message_type; m_code number := message_code; s_level number ; opt number := substr(to_char(opt1),1,1); str1 varchar2(200); function check_severe1 return number is begin if e_code in (40010,40100,40101,40102,40110,40111, 40400,40401,41000,41001,40405,42100,40659,40200) then return 1; end if; end ; function check_severe2 return number is begin if e_code in (40101,40103,40201,40204,40206,40513, 41007,40312,41824) or e_code between 41002 and 41004 or e_code between 41802 and 41803 then return 1; end if; end ; function check_severe3 return number is begin if e_code in (40202,40203,40205,40207,40208, 40652,40702,40744,40745) or e_code between 50001 and 50020 or e_code between 91109 and 91119 then return 1; end if; end; function check_severe4 return number is begin if e_code in (40514,40602,40654,40700,40703,40704, 40705,40714,40743,40800,41048,41062,41063,41065,41066,41067, 41104,40212,41308,41900,47107) or e_code between 41050 and 41060 or e_code between 41068 and 41080 or e_code between 41083 and 41093 or e_code between 41201 and 41210 or e_code between 47109 and 47111 then return 1; end if; end; function check_severe5 return number is begin if e_code in (40801,40919,40908,41049) then

return 1; end if; end; procedure maintain_status is begin if e_type in ('ORA','FRM') and substr(to_char(opt1),1,1) = '1' then str1 := e_type||'-'||to_char(e_code)||': '||str; message(str1); bell; raise form_trigger_failure; else return; end if; end; begin /* below if block is used to check if it is a message */ if opt = 1 and e_code = 0 and m_code != 0 then opt := 2; end if; if length(to_char(opt1)) < 2 then s_level := 0; else s_level := substr(to_char(opt1),2); /* below if block added to set the severity default to 5 */ if s_level = 0 then s_level := 5; end if; end if; default_value('0','global.button'); if name_in('global.button') = 0 then if opt = 1 then if e_type = 'FRM' then if s_level = 5 then if check_severe1 = 1 then maintain_status; end if; elsif s_level = 10 then if check_severe1 = 1 then maintain_status; end if; if check_severe2 = 1 then maintain_status; end if; elsif s_level = 15 then if check_severe1 = 1 then maintain_status; end if; if check_severe2 = 1 then maintain_status; end if; if check_severe3 = 1 then maintain_status; end if; elsif s_level = 20 then if check_severe1 = 1 then maintain_status; end if; if check_severe2 = 1 then maintain_status; end if; if check_severe3 = 1 then maintain_status; end if; if check_severe4 = 1 then maintain_status; end if; elsif s_level = 25 then if check_severe1 = 1 then maintain_status; end if; if check_severe2 = 1 then maintain_status; end if; if check_severe3 = 1 then maintain_status; end if; if check_severe4 = 1 then maintain_status; end if; if check_severe5 = 1 then maintain_status; end if; end if; end if; str1 := e_type||'-'||to_char(e_code)||': '||str; elsif opt = 2 then str1 := m_type||'-'||to_char(m_code)||': '||str;

elsif opt IN (3, 4) then str1 := str; end if; IF OPT = 4 AND GET_APPLICATION_PROPERTY(USER_INTERFACE)= 'CHARMODE' THEN MESSAGE(STR1); ELSIF OPT = 2 THEN MESSAGE(STR1); BELL; ELSE al_id := Find_Alert('Alert1'); if Id_Null(al_id) then Message('Alert Object missing call MegaSoft'); Raise Form_Trigger_Failure; end if; Change_Alert_Message('alert1', str1); Button_no := show_alert('alert1'); if Button_no = ALERT_BUTTON1 then change_alert_message('alert1','MegaSoft''s Default Message'); end if; maintain_status; END IF; else copy ('2', 'global.button'); end if; end alert_message; PROCEDURE BLOCK_TO_EDITOR_COPY IS -- cur_pos number := 1; -lchar number := 0; -c_len number := 0; -temp_char char(1):= null; -- ecnt number := 0; -cflag char := 'Y'; copy_str varchar2(100) := NULL; c_val varchar2(10000); flag varchar2(10) := ' '; recordno number :=0; blockname varchar2(50) := ' '; BEGIN --alert_message(1,'cval is ' || c_val); --alert_message(1,'cur_item - ' || name_in('global.cur_item')); go_item(name_in('global.cur_item')); blockname := name_in('system.cursor_block'); -- alert_message(1,blockname); flag := get_record_property(1,blockname,STATUS); -alert_message(1,'flag is - ' || flag); if flag = 'NEW' then go_item('BLK_COPY.ITEM_COPY'); else first_record; copy_str := ' '; recordno := 1; loop copy_str := name_in(name_in('global.cur_item')); -alert_message(1,'cur_item - ' || name_in('global.cur_item')); -alert_message(1,'copy_str is - ' || copy_str); if recordno > 1 then

c_val := c_val || chr(10) || copy_str; else c_val := c_val || copy_str; end if; -alert_message(1,'cval is - ' || c_val); next_record; recordno := recordno + 1; flag := get_record_property(recordno,blockname,STATUS); -alert_message(1,'flag is - ' || flag); exit when flag = 'NEW'; end loop; if flag = 'NEW' then delete_record; end if; --alert_message(1,'out of record'); first_record; copy('YES','global.block_to_editor'); go_block('BLK_COPY'); copy(c_val,'BLK_COPY.ITEM_COPY'); --alert_message(1,c_val); end if; END; PROCEDURE copy_proc IS cur_pos number := 1; lchar number := 0; copy_str varchar2(10000) := NULL; temp_char char(1):= null; ecnt number := 0; cflag char := 'Y'; c_val varchar2(10000); c_len number := 0; begin c_val := name_in('global.cur_val') || name_in('BLK_COPY.ITEM_COPY'); -c_len := length(c_val); go_item('long.cause_cmnt'); go_item(name_in('global.cur_item'));

loop temp_char := substr(c_val,cur_pos,1); ecnt := ecnt + 1; cur_pos := cur_pos + 1; if ascii(temp_char) != 10 then copy_str := copy_str || temp_char; lchar := lchar + 1; end if; if (ascii(temp_char) = 10 or lchar = 65) and copy_str is not null then copy(copy_str,name_in('global.cur_item')); -:long.cause_cmnt := copy_str; create_record; copy_str := null; lchar := 0; cflag := 'N'; end if; cflag := 'Y'; exit when ecnt > c_len; end loop;

if cflag = 'Y' then copy(copy_str,name_in('global.cur_item')); -- :long.cause_cmnt := copy_str; end if; end; PROCEDURE copy_proc_seq IS cur_pos number := 1; lchar number := 0; copy_str varchar2(10000) := NULL; temp_char char(1):= null; ecnt number := 0; cflag char := 'Y'; c_val varchar2(10000); c_len number := 0; begin c_val := name_in('global.cur_val') || name_in('BLK_COPY.ITEM_COPY'); -c_len := length(c_val); go_item('long.cause_cmnt'); go_item(name_in('global.cur_item'));

loop temp_char := substr(c_val,cur_pos,1); ecnt := ecnt + 1; cur_pos := cur_pos + 1; if ascii(temp_char) != 10 then copy_str := copy_str || temp_char; lchar := lchar + 1; end if; if (ascii(temp_char) = 10 or lchar = 65) and copy_str is not null then copy(copy_str,name_in('global.cur_item')); -:long.cause_cmnt := copy_str; execute_trigger('SET_SEQ_NBR'); create_record; copy_str := null; lchar := 0; cflag := 'N'; end if; cflag := 'Y'; exit when ecnt > c_len; end loop; if cflag = 'Y' then copy(copy_str,name_in('global.cur_item')); -- :long.cause_cmnt := copy_str; end if; end; PROCEDURE disp_edit IS can_width number; can_height number; can_name varchar2(25); win_x number; win_y number;

set_x number; set_y number; temp number; BEGIN can_name := get_item_property(name_in('system.cursor_item'),item_canvas); can_width := get_canvas_property(can_name,width); can_height := get_canvas_property(can_name,height); win_x := get_window_property('PAGE_1',x_pos); win_y := get_window_property('PAGE_1',y_pos); set_x := win_x ; set_y := win_y + floor((can_height - 7)/2) ; set_window_property('PAGE_COPY',X_POS,set_x); set_window_property('PAGE_COPY',Y_POS,set_y); if can_width <= 72 then temp := get_canvas_property(can_name,width); set_item_property('BLK_COPY.ITEM_COPY',WIDTH,temp-2); set_window_property('PAGE_COPY',WIDTH,can_width); else temp := floor((can_width - 72)/2); if temp > 2 then set_window_property('PAGE_COPY',X_POS,set_x+temp); else set_window_property('PAGE_COPY',X_POS,set_x+1); end if; end if; END; PROCEDURE fa_err_msg (msg_txt in char, action in char) IS /* Description: This is the interface between application forms and the message popup form by the same name. Usage: Called with the msg_txt as parameter #1. Call with msg_txt = '0' for default SQL error messages. Call with any other number, displays that specified SQL error. Parameter #2 tells whether to raise a trigger failure or not and also passes the text to the error form for display on line 1. Values are 'FAIL' (which translates to ERROR!!! on the screen and raises a form_trigger_failure) or anything else (which is no-fail condition, and which is also passed to the error screen for display on line 1.) Returns no values. Revisions: Michael Miller, 11-Sep-92 First Version. Michael Miller, 10-Nov-92 Added feature to pass parameter 2 to the error form. Modification History -------------------Done by : Megasoft L.L.C. (Contractor), 01/15/1999 On : 01/15/1999 Purpose : Upgraded to Forms 4.5 version (CHAR mode) as part of S erver Consolidation Modifications were done to achieve the same using an A LERT instead of calling the FA_ERR_MSG form. */ al_id Alert; Button_no number; msg_nbr number; msg_str VARCHAR2(255);

begin default_value('0','global.button'); if name_in('global.button') = 0 then begin select to_number(msg_txt) into msg_nbr from dual; if msg_nbr = 0 then COPY(to_char(SQLCODE),'GLOBAL.MSG_NBR'); COPY('ORACLE ERROR #','GLOBAL.MSG_TYP'); COPY(SQLERRM(SQLCODE),'GLOBAL.MSG_TXT'); else COPY(name_in('MSG_NBR'),'GLOBAL.MSG_NBR'); COPY('ORACLE ERROR #','GLOBAL.MSG_TYP'); COPY(SQLERRM(MSG_NBR),'GLOBAL.MSG_TXT'); end if; exception when others then if action = 'FAIL' then COPY('ERROR!!!','GLOBAL.MSG_TYP'); else COPY(ACTION,'GLOBAL.MSG_TYP'); end if; COPY(NULL,'GLOBAL.MSG_NBR'); COPY(MSG_TXT,'GLOBAL.MSG_TXT'); end; -- call ('$relfa/fa_err_msg', NO_HIDE); -- call_form ('$relfa/fa_err_msg', NO_HIDE,DO_REPLACE); al_id := Find_Alert('ERR_MSG_ALERT'); if Id_Null(al_id) then Message('Alert Object missing call MegaSoft'); Raise Form_Trigger_Failure; end if; msg_str := NAME_IN('global.msg_typ')||' '||NAME_IN('global.msg_nbr')||' : '||N AME_IN('global.msg_txt'); Change_Alert_Message('ERR_MSG_ALERT', msg_str); Button_no := show_alert('ERR_MSG_ALERT'); if Button_no = ALERT_BUTTON1 then change_alert_message('ERR_MSG_ALERT','MegaSoft''s Default Message'); end if; else copy ('2', 'global.button'); end if; erase ('GLOBAL.MSG_NBR'); erase ('GLOBAL.MSG_TXT'); erase ('GLOBAL.MSG_TYP'); if action = 'FAIL' then raise form_trigger_failure; end if; end; PROCEDURE FA_PROC_BOLD IS /* Procedure to set a field characteristics to BOLD-INVERSE format. Used in conjunction with PRE-FIELD triggers to bold a field as the cursor enters it (see procedure FA_PROC_NOBOLD). . Input Variables: none Output Variables: none

. Maintenance Performed By Date ------------------------------------------ ---------------- -------Swiped from Insight & made into a proc Jerry Klima 4/3/91 Modification History -------------------Done by : Megasoft L.L.C. (Contractor), 01/15/1999 On : 01/15/1999 Purpose : Upgraded to Forms 4.5 version (CHAR mode) as part of S erver Consolidation */ BEGIN -- IF FIELD_CHARACTERISTIC(:SYSTEM.TRIGGER_FIELD,ENTERABLE) = 'TRUE' THEN -DISPLAY_FIELD(:SYSTEM.TRIGGER_FIELD,'BOLD-INVERSE'); IF GET_ITEM_PROPERTY(NAME_IN('SYSTEM.TRIGGER_ITEM'),INSERT_ALLOWED) = 'TRUE' O R GET_ITEM_PROPERTY(NAME_IN('SYSTEM.TRIGGER_ITEM'),UPDATEABLE) = 'TRUE' THEN DISPLAY_ITEM(NAME_IN('SYSTEM.TRIGGER_ITEM'),'BOLD-INVERSE'); END IF; END; PROCEDURE FA_PROC_CMNT IS /* Procedure to calculate a CMNT_SEQ_NBR for keeping comments in the appropriate sequence. Primarily does an interpolation between two existing CMNT_SEQ_NBRs to get the new number. . Input Variables: none NOTE: any screen which calls this procedure Output Variables: none must have a field called CMNT_SEQ_NBR! . Maintenance Performed By Date ------------------------------------------ ---------------- -------Originally written for the HDA version Jerry Klima 7/1/90 Converted to a procedure Jerry Klima 4/27/91 Modification History -------------------Done by : Megasoft L.L.C. (Contractor), 01/15/1999 On : 01/15/1999 Purpose : Upgraded to Forms 4.5 version (CHAR mode) as part of S erver Consolidation */ BEGIN DECLARE PREV_SEQ_NBR NUMBER; NEXT_SEQ_NBR NUMBER; CUR_REC NUMBER; -TEMP NUMBER; BEGIN CUR_REC := TO_NUMBER(NAME_IN('SYSTEM.CURSOR_RECORD')); IF CUR_REC = 1 THEN -TEMP := 1; COPY('1','CMNT_SEQ_NBR'); ELSE GO_RECORD(CUR_REC - 1); PREV_SEQ_NBR := NAME_IN('CMNT_SEQ_NBR'); GO_RECORD(CUR_REC); IF NAME_IN('SYSTEM.LAST_RECORD') = 'TRUE' THEN

--

-');

TEMP := PREV_SEQ_NBR + 1; COPY(TO_CHAR(PREV_SEQ_NBR + 1),'CMNT_SEQ_NBR'); ELSE GO_RECORD(CUR_REC + 1); NEXT_SEQ_NBR := NAME_IN('CMNT_SEQ_NBR'); GO_RECORD(CUR_REC); TEMP := PREV_SEQ_NBR+((NEXT_SEQ_NBR-PREV_SEQ_NBR)/2); COPY(TO_CHAR(PREV_SEQ_NBR+((NEXT_SEQ_NBR-PREV_SEQ_NBR)/2)),'CMNT_SEQ_NBR

END IF; END IF; END; END; PROCEDURE FA_PROC_DISPTN IS /* This procedure updates the FA_PART table with the latest dispostion for that part. It does this in one of two ways: If GLOBAL.DISPTN_FA_DISPTN_DT is NULL (the calling form had a deletion) Rebuilds the date by looking at table FA_PART_DISPTN. If GLOBAL.DISPTN_FA_DISPTN_DT is NOT NULL (the calling form had an add) Updates the table using the parameters passed to it. . Input Variables: GLOBAL.DISPTN_PART_CTL_NBR GLOBAL.DISPTN_FA_DISPTN_DT GLOBAL.DISPTN_TO_FA_AREA_CD . Output Variables: None . Maintenance Performed By Date ------------------------------------- -------------------------Initial Procedure Development Jerry Klima 6/1/91 Modification History -------------------Done by : Megasoft L.L.C. (Contractor), 01/15/1999 On : 01/15/1999 Purpose : Upgraded to Forms 4.5 version (CHAR mode) as part of S erver Consolidation Also changes were made to achieve YR2000 compliance by changing it to 4-digit year format */ BEGIN DECLARE CNT NUMBER; FA_DISPTN_DT CHAR(20); TO_FA_AREA_CD CHAR(6); G_DISPTN_PART_CTL_NBR VARCHAR2(255) := NAME_IN('GLOBAL.DISPTN_PART_CTL _NBR'); G_DISPTN_TO_FA_AREA_CD VARCHAR2(255) := NAME_IN('GLOBAL.DISPTN_TO_FA_AR EA_CD'); G_DISPTN_FA_DISPTN_DT VARCHAR2(255) := NAME_IN('GLOBAL.DISPTN_FA_DISPT N_DT'); CURSOR FA_PROC_DISPTN IS -SELECT TO_CHAR(FA_DISPTN_DT,'DD-MON-YY'), TO_FA_AREA_CD SELECT TO_CHAR(FA_DISPTN_DT,'DD-MON-YYYY'), TO_FA_AREA_CD FROM FA_PART_DISPTN WHERE PART_CTL_NBR = G_DISPTN_PART_CTL_NBR AND FA_DISPTN_DT = (SELECT MAX(FA_DISPTN_DT) FROM FA_PART_DISPTN

WHERE PART_CTL_NBR = G_DISPTN_PART_CTL_NBR); BEGIN -IF NAME_IN('GLOBAL.DISPTN_FA_DISPTN_DT') IS NULL THEN IF G_DISPTN_FA_DISPTN_DT IS NULL THEN SELECT COUNT(*) INTO CNT FROM FA_PART_DISPTN WHERE PART_CTL_NBR = G_DISPTN_PART_CTL_NBR; IF CNT = 0 THEN UPDATE FA_PART SET CURR_FA_AREA_CD = NULL, CURR_FA_DISPTN_DT = NULL WHERE PART_CTL_NBR = G_DISPTN_PART_CTL_NBR; ELSE OPEN FA_PROC_DISPTN; FETCH FA_PROC_DISPTN INTO FA_DISPTN_DT, TO_FA_AREA_CD; CLOSE FA_PROC_DISPTN; UPDATE FA_PART SET CURR_FA_AREA_CD = TO_FA_AREA_CD, -CURR_FA_DISPTN_DT = TO_DATE(FA_DISPTN_DT,'DD-MON-YY') CURR_FA_DISPTN_DT = TO_DATE(FA_DISPTN_DT,'DD-MON-YYYY') WHERE PART_CTL_NBR = G_DISPTN_PART_CTL_NBR; END IF; ELSE UPDATE FA_PART SET CURR_FA_AREA_CD = G_DISPTN_TO_FA_AREA_CD, -CURR_FA_DISPTN_DT = TO_DATE(:GLOBAL.DISPTN_FA_DISPTN_DT,'DD-MON-YY' ) CURR_FA_DISPTN_DT = TO_DATE(G_DISPTN_FA_DISPTN_DT,'DD-MON-YYYY') WHERE PART_CTL_NBR = G_DISPTN_PART_CTL_NBR -AND (TO_DATE(TO_CHAR(CURR_FA_DISPTN_DT,'DD-MON-YY')) < -TO_DATE(:GLOBAL.DISPTN_FA_DISPTN_DT,'DD-MON-YY') OR AND (TO_DATE(TO_CHAR(CURR_FA_DISPTN_DT,'DD-MON-YYYY'),'DD-MON-YYYY') < TO_DATE(G_DISPTN_FA_DISPTN_DT,'DD-MON-YYYY') OR CURR_FA_DISPTN_DT IS NULL); END IF; END; END; PROCEDURE FA_PROC_FA_NBR IS /* Procedure to tell the calling form whether or not it is save to delete an F/A Request. It does so by checking each table which has FA_RQST_NBR and FA_GROUP_CD as a field for the FA# of the request to be deleted. . Input Variables: GLOBAL.FA_NBR_FA_RQST_NBR Output Variables: GLOBAL.FA_NBR_DELETE_INDIC (Y=ok to delete; N=do not delete) GLOBAL.FA_NBR_MGMT_SPCL_INSTR (# of rows in FA_MGMT_SPCL_INSTR) GLOBAL.FA_NBR_CAUSE_CMNT (# of rows in FA_CAUSE_CMNT) GLOBAL.FA_NBR_PART_DISPTN (# of rows in FA_PART_DISPTN) GLOBAL.FA_NBR_PART_DISPTN_OBSRV (# of rows in FA_PART_DISPTN_OBSRV) GLOBAL.FA_NBR_PART_RQST_XREF (# of rows in FA_PART_RQST_XREF) GLOBAL.FA_NBR_SPCL_TEST_INSTR (# of rows in FA_SPCL_TEST_INSTR) GLOBAL.FA_NBR_TEST (# of rows in FA_TEST) GLOBAL.FA_NBR_TEST_OBSRV (# of rows in FA_TEST_OBSRV) GLOBAL.CA_NBR (Y = Request has a C/A Tie; N=No) .

Maintenance -----------------------------------------Initial Procedure Development New table structure changes

Performed By ---------------Jerry Klima Diana Noirot

Date -------4/8/91 11/10/92

Modification History -------------------Done by : Megasoft L.L.C. (Contractor), 01/15/1999 On : 01/15/1999 Purpose : Upgraded to Forms 4.5 version (CHAR mode) as part of S erver Consolidation */ BEGIN DECLARE G_FA_NBR_FA_RQST_NBR VARCHAR2(255) := NAME_IN('GLOBAL.FA_NBR_FA_RQST_NBR'); G_FA_GROUP_CD VARCHAR2(255) := NAME_IN('GLOBAL.FA_GROUP_CD'); CNT NUMBER := 0; temp NUMBER; BEGIN COPY('Y','GLOBAL.FA_NBR_DELETE_INDIC'); SELECT COUNT(*) /* Spcl Mgmt Instr */ INTO TEMP FROM FA_MGMT_SPCL_INSTR WHERE FA_RQST_NBR = G_FA_NBR_FA_RQST_NBR AND FA_GROUP_CD = G_FA_GROUP_CD; COPY(TO_CHAR(TEMP),'GLOBAL.FA_NBR_MGMT_SPCL_INSTR'); SELECT COUNT(*) /* Cause Comments */ INTO TEMP FROM FA_CAUSE_CMNT WHERE FA_RQST_NBR = G_FA_NBR_FA_RQST_NBR AND FA_GROUP_CD = G_FA_GROUP_CD; COPY(TO_CHAR(TEMP),'GLOBAL.FA_NBR_CAUSE_CMNT'); SELECT COUNT(*) /* Part Disposition*/ INTO TEMP FROM FA_PART_DISPTN WHERE FA_RQST_NBR = G_FA_NBR_FA_RQST_NBR AND FA_GROUP_CD = G_FA_GROUP_CD; COPY(TO_CHAR(TEMP),'GLOBAL.FA_NBR_PART_DISPTN'); SELECT COUNT(*) /* Part Disp Observ*/ INTO TEMP FROM FA_PART_DISPTN_OBSRV WHERE FA_RQST_NBR = G_FA_NBR_FA_RQST_NBR AND FA_GROUP_CD = G_FA_GROUP_CD; COPY(TO_CHAR(TEMP),'GLOBAL.FA_NBR_PART_DISPTN_OBSRV'); SELECT COUNT(*) /* Part/Rqst Xref */ INTO TEMP FROM FA_PART_RQST_XREF WHERE FA_RQST_NBR = G_FA_NBR_FA_RQST_NBR AND FA_GROUP_CD = G_FA_GROUP_CD; COPY(TO_CHAR(TEMP),'GLOBAL.FA_NBR_PART_RQST_XREF'); SELECT INTO FROM WHERE AND COUNT(*) TEMP FA_SPCL_TEST_INSTR FA_RQST_NBR = G_FA_NBR_FA_RQST_NBR FA_GROUP_CD = G_FA_GROUP_CD; /*Spcl Test Instruc*/

COPY(TO_CHAR(TEMP),'GLOBAL.FA_NBR_SPCL_TEST_INSTR'); SELECT COUNT(*) INTO TEMP FROM FA_TEST WHERE FA_RQST_NBR = G_FA_NBR_FA_RQST_NBR AND FA_GROUP_CD = G_FA_GROUP_CD; COPY(TO_CHAR(TEMP),'GLOBAL.FA_NBR_TEST'); /* Tests */

SELECT COUNT(*) /* Test Observatns*/ INTO TEMP FROM FA_TEST_OBSRV WHERE FA_RQST_NBR = G_FA_NBR_FA_RQST_NBR AND FA_GROUP_CD = G_FA_GROUP_CD; COPY(TO_CHAR(TEMP),'GLOBAL.FA_NBR_TEST_OBSRV'); IF CNT = SELECT INTO FROM 0 THEN COUNT(*) /* C/A Check */ CNT FA_PART_RQST_XREF XREF, FA_PART PART XREF.PART_CTL_NBR = PART.PART_CTL_NBR XREF.FA_RQST_NBR = G_FA_NBR_FA_RQST_NBR XREF.FA_GROUP_CD = G_FA_GROUP_CD PART.CA_NBR IS NOT NULL;

WHERE AND AND AND END IF; IF CNT = 0 THEN COPY('N','GLOBAL.CA_NBR'); ELSE COPY('Y','GLOBAL.CA_NBR'); COPY('N','GLOBAL.FA_NBR_DELETE_INDIC'); END IF; END; END;

PROCEDURE FA_PROC_NOBOLD IS /* Procedure to set a field characteristics to INVERSE format. Used in conjunction with POST-FIELD triggers to un-bold a field once the cursor leaves it (see procedure FA_PROC_BOLD). . Input Variables: none Output Variables: none . Maintenance Performed By Date ------------------------------------------ ---------------- -------Swiped from Insight & made into a proc Jerry Klima 4/3/91 Modification History -------------------Done by : Megasoft L.L.C. (Contractor), 01/15/1999 On : 01/15/1999 Purpose : Upgraded to Forms 4.5 version (CHAR mode) as part of S erver Consolidation */ BEGIN -- IF FIELD_CHARACTERISTIC(:SYSTEM.TRIGGER_FIELD,ENTERABLE) = 'TRUE' THEN -DISPLAY_FIELD(:SYSTEM.TRIGGER_FIELD,'INVERSE'); IF GET_ITEM_PROPERTY(NAME_IN('SYSTEM.TRIGGER_ITEM'),INSERT_ALLOWED) = 'TRUE' OR

GET_ITEM_PROPERTY(NAME_IN('SYSTEM.TRIGGER_ITEM'),UPDATEABLE) = 'TRUE' THEN IF GET_BLOCK_PROPERTY(NAME_IN('SYSTEM.CURSOR_BLOCK'),RECORDS_DISPLAYED) <= 1 THEN DISPLAY_ITEM(NAME_IN('SYSTEM.TRIGGER_ITEM'),'INVERSE'); ELSE DISPLAY_ITEM(NAME_IN('SYSTEM.TRIGGER_ITEM'),''); END IF; END IF; END; PROCEDURE FA_PROC_PDS IS /* This procedure is used primarily to translate Employee Names into Employee Numbers. A secondary function is to validate Employee Numbers if they are specified in the first 5 positions of the Employee Last Name. . Input Variables GLOBAL.PDS_EMPL_NBR (may be null or not match new name) GLOBAL.PDS_EMPL_NAME_LAST (may contain Empl# in pos(1-5)) GLOBAL.PDS_EMPL_NAME_FIRST (may be null) Output Variables GLOBAL.PDS_EMPL_NAME_LAST (replaces Empl# with last name) GLOBAL.PDS_EMPL_NAME_FIRST (contains first name from the PDS) GLOBAL.PDS_EMPL_NBR (contains Empl# if the name passed) GLOBAL.PDS_PASS_FAIL (P=valid Empl; F=Invalid Empl; N=No Chg) . Maintenance Performed By Date ------------------------------------------ ---------------- -------Initial Procedure Development Jerry Klima 8/90? Moved to FA_UTIL_LIB & add Empl # Feature Jerry Klima 4/5/91 On no change function, added another if to Diana Noirot 8/17/92 look at just empl # and last name. Modification History -------------------Done by : Megasoft L.L.C. (Contractor), 01/15/1999 On : 01/15/1999 Purpose : Upgraded to Forms 4.5 version (CHAR mode) as part of S erver Consolidation */ BEGIN DECLARE G_PDS_EMPL_NBR VARCHAR2(255) ; G_PDS_EMPL_NAME_LAST VARCHAR2(255) ; G_PDS_EMPL_NAME_FIRST VARCHAR2(255) ; t1 varchar2(25); TMP NUMBER; TNAME1 VARCHAR2(15); TNAME2 VARCHAR2(15); CNT NUMBER; /* Number of rows found in a Select Stmt */ PASS EXCEPTION; /* Sets GLOBAL.PDS_PASS_FAIL to "P" */ FAIL EXCEPTION; /* Sets GLOBAL.PDS_PASS_FAIL to "F" */ NOCHG EXCEPTION; /* Empl Nbr matched Empl Name (no change)*/ BEGIN COPY(NULL,'GLOBAL.PDS_PASS_FAIL'); IF NVL(NAME_IN('GLOBAL.PDS_EMPL_NAME_LAST'),' ') = ' ' AND NVL(NAME_IN('GLOBAL.PDS_EMPL_NAME_FIRST'),' ') = ' ' THEN COPY(NULL,'GLOBAL.PDS_EMPL_NBR');

RAISE PASS; END IF; G_PDS_EMPL_NBR := NAME_IN('GLOBAL.PDS_EMPL_NBR'); G_PDS_EMPL_NAME_LAST := NAME_IN('GLOBAL.PDS_EMPL_NAME_LAST'); G_PDS_EMPL_NAME_FIRST := NAME_IN('GLOBAL.PDS_EMPL_NAME_FIRST'); IF NVL(NAME_IN('GLOBAL.PDS_EMPL_NBR'),0) != 0 AND NVL(NAME_IN('GLOBAL.PDS_EMPL_NAME_LAST'),' ') != ' ' THEN IF NVL(NAME_IN('GLOBAL.PDS_EMPL_NAME_FIRST'),' ') != ' ' THEN SELECT COUNT(*) /* This is a check to see if the name & empl# */ INTO CNT /* match and is found in the PDS i.e. no chg */ FROM SPQR_PDS WHERE EMPL_NAME_LAST = G_PDS_EMPL_NAME_LAST AND EMPL_NAME_FIRST = G_PDS_EMPL_NAME_FIRST AND EMPL_NBR = G_PDS_EMPL_NBR; ELSIF NVL(NAME_IN('GLOBAL.PDS_EMPL_NAME_FIRST'),' ') = ' ' THEN SELECT COUNT(*) /* This is a check for last name & empl# */ INTO CNT /* match and found in the PDS i.e. no chg */ FROM SPQR_PDS WHERE EMPL_NAME_LAST = G_PDS_EMPL_NAME_LAST AND EMPL_NBR = G_PDS_EMPL_NBR; END IF; IF CNT = 1 THEN RAISE NOCHG; END IF; END IF; IF SUBSTR(NAME_IN('GLOBAL.PDS_EMPL_NAME_LAST'),1,1) BETWEEN '0' AND '9' THEN TMP := TO_NUMBER(SUBSTR(NAME_IN('GLOBAL.PDS_EMPL_NAME_LAST'),1,6)); COPY(TO_CHAR(TMP),'GLOBAL.PDS_EMPL_NBR'); G_PDS_EMPL_NBR := NAME_IN('GLOBAL.PDS_EMPL_NBR'); SELECT EMPL_NAME_LAST, EMPL_NAME_FIRST INTO tname1,tname2 FROM SPQR_PDS WHERE EMPL_NBR = G_PDS_EMPL_NBR; COPY(tname1,'GLOBAL.PDS_EMPL_NAME_LAST'); COPY(tname2,'GLOBAL.PDS_EMPL_NAME_FIRST'); G_PDS_EMPL_NAME_LAST := NAME_IN('GLOBAL.PDS_EMPL_NAME_LAST'); G_PDS_EMPL_NAME_FIRST := NAME_IN('GLOBAL.PDS_EMPL_NAME_FIRST'); RAISE PASS; END IF; IF NVL(NAME_IN('GLOBAL.PDS_EMPL_NAME_FIRST'),' ') = ' ' THEN CNT := 0; ELSE SELECT COUNT(*) INTO CNT FROM SPQR_PDS WHERE EMPL_NAME_LAST = G_PDS_EMPL_NAME_LAST AND EMPL_NAME_FIRST = G_PDS_EMPL_NAME_FIRST; END IF; IF CNT = 0 THEN SELECT COUNT(*) INTO CNT FROM SPQR_PDS WHERE EMPL_NAME_LAST = G_PDS_EMPL_NAME_LAST; IF CNT = 0 THEN RAISE FAIL; ELSIF CNT = 1 THEN

SELECT EMPL_NBR,EMPL_NAME_FIRST INTO tmp,tname1 FROM SPQR_PDS WHERE EMPL_NAME_LAST = G_PDS_EMPL_NAME_LAST; COPY(TO_CHAR(tmp),'GLOBAL.PDS_EMPL_NBR'); G_PDS_EMPL_NBR := NAME_IN('GLOBAL.PDS_EMPL_NBR'); COPY(tname1,'GLOBAL.PDS_EMPL_NAME_FIRST'); G_PDS_EMPL_NAME_FIRST := NAME_IN('GLOBAL.PDS_EMPL_NAME_FIRST'); RAISE PASS; ELSE RAISE FAIL; END IF; ELSIF CNT = 1 THEN SELECT EMPL_NBR INTO tmp FROM SPQR_PDS WHERE EMPL_NAME_LAST = G_PDS_EMPL_NAME_LAST AND EMPL_NAME_FIRST = G_PDS_EMPL_NAME_FIRST; copy(TO_CHAR(tmp),'GLOBAL.PDS_EMPL_NBR'); G_PDS_EMPL_NBR := NAME_IN('GLOBAL.PDS_EMPL_NBR'); RAISE PASS; ELSE RAISE FAIL; END IF; EXCEPTION WHEN PASS THEN COPY('P','GLOBAL.PDS_PASS_FAIL') ; WHEN NOCHG THEN COPY('N','GLOBAL.PDS_PASS_FAIL'); WHEN FAIL THEN COPY('F','GLOBAL.PDS_PASS_FAIL'); BELL; MESSAGE('Invalid Employee Name - Press [Ctrl-l] for a list of Employee Nam es'); WHEN NO_DATA_FOUND THEN COPY('F','GLOBAL.PDS_PASS_FAIL'); BELL; MESSAGE('Invalid Employee Name - Press [Ctrl-l] for a list of Employee Nam es'); WHEN OTHERS THEN BELL; MESSAGE ('Procedure FA_PROC_PDS Internal Error(' ||TO_CHAR(SQLCODE) || ') - Call IS'); SYNCHRONIZE; RAISE FORM_TRIGGER_FAILURE; END; END; PROCEDURE FA_PROC_TDATE IS /* Procedure to validate a character field to ensure it contains a valid date (in the default format) or a "T" in column 1. If the field contains a "T" in column 1, SYSDATE is substituted. . Input Variables: GLOBAL.TDATE (on input, may contain a "T") Output Variables: GLOBAL.TDATE (on output, may be changed to SYSDATE) . Maintenance Performed By Date ------------------------------------------ ---------------- --------

Initial Procedure Development

Jerry Klima

4/3/91

Modification History -------------------Done by : Megasoft L.L.C. (Contractor), 01/15/1999 On : 01/15/1999 Purpose : Upgraded to Forms 4.5 version (CHAR mode) as part of S erver Consolidation Also changes were made to achieve YR2000 compliance by changing it to 4-digit year format */ BEGIN DECLARE DTE DATE; temp CHAR(11) := TO_CHAR(SYSDATE,'DD-MON-YYYY'); BEGIN IF NAME_IN('GLOBAL.TDATE') IS NOT NULL THEN IF UPPER(SUBSTR(NAME_IN('GLOBAL.TDATE'),1,1)) = 'T' THEN COPY(temp,'GLOBAL.TDATE'); ELSE DTE := TO_DATE(NAME_IN('GLOBAL.TDATE'),'DD-MON-YYYY'); END IF; END IF; EXCEPTION WHEN OTHERS THEN BELL; MESSAGE ('Date Format should be DD-MON-YYYY or T for today''s date'); RAISE FORM_TRIGGER_FAILURE; END; END; PROCEDURE FA_PROC_TIME IS /* This procedure calculates the number of and the stop date. . Input Variables: GLOBAL.START_DT GLOBAL.STOP_DT . Output Variables: GLOBAL.TURN_AROUND . Maintenance ------------------------------------Initial Procedure Development

days between the start date

Performed By -------------------Diana Noirot

Date ------4/16/91

Modification History -------------------Done by : Megasoft L.L.C. (Contractor), 01/15/1999 On : 01/15/1999 Purpose : Upgraded to Forms 4.5 version (CHAR mode) as part of S erver Consolidation Also changes were made to achieve YR2000 compliance by changing it to 4-digit year format */ BEGIN DECLARE STRT DATE; STP DATE; DAY CHAR(1);

TURN_AROUND NUMBER; BEGIN IF NAME_IN('GLOBAL.STOP_DT') IS NOT NULL AND NAME_IN('GLOBAL.START_DT') IS NOT NULL THEN STRT := TO_DATE(NAME_IN('GLOBAL.START_DT'),'DD-MON-YYYY'); STP := TO_DATE(NAME_IN('GLOBAL.STOP_DT'),'DD-MON-YYYY'); TURN_AROUND := 0; LOOP DAY := TO_CHAR(STRT, 'D'); IF DAY NOT IN ('1','7') THEN /* THIS EXCLUDES SUN & SAT */ TURN_AROUND := TURN_AROUND + 1; END IF; STRT := STRT + 1; EXIT WHEN STRT > STP; END LOOP; /* THIS PART OF THE PROGRAM CALCULATES TURN AROUND TIME IF STARTED AND FINISHED ON A WEEKEND. HOWEVER, IF STARTED ON A WEEKEND AND FINISHED ON A WEEKDAY, IT WILL ONLY CALCULATE THE WEEKDAYS TURN AROUND TIME */ IF TURN_AROUND = 0 AND STP - STRT = 1 THEN TURN_AROUND := 2; ELSIF TURN_AROUND = 0 THEN TURN_AROUND := 1; END IF; COPY(TO_CHAR(TURN_AROUND),'GLOBAL.TURN_AROUND'); ELSE COPY(NULL,'GLOBAL.TURN_AROUND') ; END IF; END; END; PROCEDURE FA_PROC_TTIME IS /* Procedure to validate a character field to ensure it contains a valid time (in the default format) or a "T" in column 1. If the field contains a "T" in column 1, the current time is substituted. . Input Variables: GLOBAL.TTIME (on input, may contain a "T") Output Variables: GLOBAL.TTIME (on output, may be changed to current time) . Maintenance Performed By Date ------------------------------------------ ---------------- -------Initial Procedure Development Jerry Klima 4/3/91 Copied & modified from above TDATE proc Vickie Morgan 10/16/94 Modification History -------------------Done by : Megasoft L.L.C. (Contractor), 01/15/1999 On : 01/15/1999 Purpose : Upgraded to Forms 4.5 version (CHAR mode) as part of S erver Consolidation */ BEGIN DECLARE TME DATE; BEGIN IF NAME_IN('GLOBAL.TTIME') IS NOT NULL THEN

IF UPPER(SUBSTR(NAME_IN('GLOBAL.TTIME'),1,1)) = 'T' THEN COPY(TO_CHAR(SYSDATE,'HH24:MI'),'GLOBAL.TTIME'); ELSE TME := TO_DATE(NAME_IN('GLOBAL.TTIME'),'HH24:MI'); END IF; END IF; EXCEPTION WHEN OTHERS THEN BELL; MESSAGE('Time Format should be HH:MI (military time) or T for today''s dat e'); RAISE FORM_TRIGGER_FAILURE; END; END; PROCEDURE FA_THREE_BUTTON (s1 in char, s2 in char, defalt in char, answer out char) is /* Description: this is the interface between a three button yes/no/cancel type of alert box that pops up in the middle of the screen, you must call it with four string parameters, one that is the general alert msg, such as "STOP", "WARNING" etc, the second is your message to the user and the third is the default answer and the fourth is the answer returned. Usage: fa_three_button(s1, s2, s3, s4); Returns s3 as a parameter in the form of "Y", "N" or "C". Revisions: George Laframboise, 05-May-92: First version. George Laframboise, 17-jun-92: modified to position the cursor on a default answer. Michael Miller, 07-Dec-92: adapted to FA. Modification History -------------------Done by : Megasoft L.L.C. (Contractor), 01/15/1999 On : 01/15/1999 Purpose : Upgraded to Forms 4.5 version (CHAR mode) as part of S erver Consolidation Also changes were made to achieve YR2000 compliance by changing it to 4-digit year format */ THREE_BUTTON_ALERT ALERT; RESULT NUMBER; l1 NUMBER := length(s1); l2 NUMBER := length(s2); s2_padded VARCHAR2(255); begin COPY(s1,'global.fa_three_button_msg1'); COPY(s2,'global.fa_three_button_msg2'); if l1 > l2 then s2_padded := s2 || rpad(' ',(l1-l2)*2); else s2_padded := s2; end if;

COPY(upper(defalt),'global.fa_three_button_defalt'); COPY(NULL,'GLOBAL.FA_THREE_BUTTON_ANSWER'); -- call ('$relfa/fa_three_button',NO_HIDE); -- call_form ('$relfa/fa_three_button',NO_HIDE,NO_REPLACE); THREE_BUTTON_ALERT := FIND_ALERT('THREE_BUTTON'); IF ID_NULL(THREE_BUTTON_ALERT) THEN MESSAGE('ALERT MISSING! CALL MEGASOFT'); ELSE -- :GLOBAL.FA_THREE_BUTTON_ANSWER := ''; -- COPY('','GLOBAL.FA_THREE_BUTTON_ANSWER'); SET_ALERT_PROPERTY('THREE_BUTTON',TITLE,S1); -- SET_ALERT_PROPERTY('THREE_BUTTON',ALERT_MESSAGE_TEXT,S2); SET_ALERT_PROPERTY('THREE_BUTTON',ALERT_MESSAGE_TEXT,S2_padded); RESULT := SHOW_ALERT('THREE_BUTTON'); IF RESULT = ALERT_BUTTON1 THEN -:GLOBAL.FA_THREE_BUTTON_ANSWER := 'Y'; COPY('Y','GLOBAL.FA_THREE_BUTTON_ANSWER'); ELSIF RESULT = ALERT_BUTTON2 THEN -:GLOBAL.FA_THREE_BUTTON_ANSWER := 'N'; COPY('N','GLOBAL.FA_THREE_BUTTON_ANSWER'); ELSIF RESULT = ALERT_BUTTON3 THEN -:GLOBAL.FA_THREE_BUTTON_ANSWER := 'C'; COPY('C','GLOBAL.FA_THREE_BUTTON_ANSWER'); END IF; END IF; answer := name_in('global.fa_three_button_answer'); erase ('global.fa_three_button_msg1'); erase ('global.fa_three_button_msg2'); erase ('global.fa_three_button_answer'); erase ('global.fa_three_button_defalt'); end; PROCEDURE fa_three_button_old (s1 in char, s2 in char, defalt in char, answer out char) is /* Description: this is the interface between a three button yes/no/cancel type of alert box that pops up in the middle of the screen, you must call it with four string parameters, one that is the general alert msg, such as "STOP", "WARNING" etc, the second is your message to the user and the third is the default answer and the fourth is the answer returned. Usage: fa_three_button(s1, s2, s3, s4); Returns s3 as a parameter in the form of "Y", "N" or "C". Revisions: George Laframboise, 05-May-92: First version. George Laframboise, 17-jun-92: modified to position the cursor on a default answer. Michael Miller, 07-Dec-92: adapted to FA. Modification History -------------------Done by : Megasoft L.L.C. (Contractor), 01/15/1999 On : 01/15/1999 Purpose : Upgraded to Forms 4.5 version (CHAR mode) as part of S erver Consolidation Also changes were made to achieve YR2000 compliance by changing it to 4-digit year format

Renamed this to have a backup copy as it has now been changed to an ALERT. */ begin COPY(s1,'global.fa_three_button_msg1'); COPY(s2,'global.fa_three_button_msg2'); COPY(upper(defalt),'global.fa_three_button_defalt'); -- call ('$relfa/fa_three_button',NO_HIDE); call_form ('$relfa/fa_three_button',NO_HIDE,NO_REPLACE); answer := name_in('global.fa_three_button_answer'); erase ('global.fa_three_button_msg1'); erase ('global.fa_three_button_msg2'); erase ('global.fa_three_button_answer'); erase ('global.fa_three_button_defalt'); end; PROCEDURE FA_TWO_BUTTON (s1 in char, s2 in char, defalt in char, answer out char) IS /* Description: this is the interface between a two button yes/no type of alert box that pops up in the middle of the screen, you must call it with four string parameters, one that is the general alert msg, such as "STOP", "WARNING", etc a second that is your message to the user and a third that will be the default answer and the fourth is the answer to be returned by the procedure. obviously the third parameter should be a local one declared in your form. for example: fa_two_button('Stop', 'Are You Sure ?', 'Y', answer_return); Usage: fa_two_button(s1, s2, s3); Returns: answer as a parameter in the form of "Y" or "N". Revisions: George Laframboise, 05-May-92: First version. George Laframboise, 07-jun-92: modified to position the cursor on a default answer. Michael Miller, 08-Nov-92: adapted to FA. Modification History -------------------Done by : Megasoft L.L.C. (Contractor), 01/15/1999 On : 01/15/1999 Purpose : Upgraded to Forms 4.5 version (CHAR mode) as part of S erver Consolidation */ TWO_BUTTON_ALERT ALERT; RESULT NUMBER; MSG VARCHAR2(255); l1 NUMBER := length(s1); l2 NUMBER := length(s2); s2_padded VARCHAR2(255); begin copy(s1,'global.fa_two_button_msg1'); copy(s2,'global.fa_two_button_msg2'); copy(upper(defalt),'global.fa_two_button_defalt'); if l1 > l2 then

s2_padded := s2 || rpad(' ',(l1-l2)*2); else s2_padded := s2; end if; COPY(NULL,'GLOBAL.FA_TWO_BUTTON_ANSWER'); --call ('$relfa/fa_two_button', NO_HIDE); -- call_form ('$relfa/fa_two_button', NO_HIDE,NO_REPLACE); TWO_BUTTON_ALERT := FIND_ALERT('TWO_BUTTON'); IF ID_NULL(TWO_BUTTON_ALERT) THEN MESSAGE('ALERT MISSING'); ELSE -- COPY('','GLOBAL.FA_TWO_BUTTON_ANSWER'); set_alert_property('TWO_BUTTON',TITLE,S1); SET_ALERT_PROPERTY('TWO_BUTTON',ALERT_MESSAGE_TEXT,S2_padded); RESULT := SHOW_ALERT('TWO_BUTTON'); IF RESULT = ALERT_BUTTON1 THEN -:GLOBAL.FA_TWO_BUTTON_ANSWER := 'Y'; COPY('Y','GLOBAL.FA_TWO_BUTTON_ANSWER'); ELSIF RESULT = ALERT_BUTTON2 THEN -:GLOBAL.FA_TWO_BUTTON_ANSWER := 'N'; COPY('N','GLOBAL.FA_TWO_BUTTON_ANSWER'); END IF; END IF; answer := name_in('global.fa_two_button_answer'); erase ('global.fa_two_button_msg1'); erase ('global.fa_two_button_msg2'); erase ('global.fa_two_button_answer'); erase ('global.fa_two_button_defalt'); end; PROCEDURE fa_two_button_old (s1 in char, s2 in char, defalt in char, answer out char) IS /* Description: this is the interface between a two button yes/no type of alert box that pops up in the middle of the screen, you must call it with four string parameters, one that is the general alert msg, such as "STOP", "WARNING", etc a second that is your message to the user and a third that will be the default answer and the fourth is the answer to be returned by the procedure. obviously the third parameter should be a local one declared in your form. for example: fa_two_button('Stop', 'Are You Sure ?', 'Y', answer_return); Usage: fa_two_button(s1, s2, s3); Returns: answer as a parameter in the form of "Y" or "N". Revisions: George Laframboise, 05-May-92: First version. George Laframboise, 07-jun-92: modified to position the cursor on a default answer. Michael Miller, 08-Nov-92: adapted to FA. Modification History -------------------Done by : Megasoft L.L.C. (Contractor), 01/15/1999 On : 01/15/1999 Purpose : Upgraded to Forms 4.5 version (CHAR mode) as part of S erver Consolidation

Renamed this to have a backup copy as it has now been changed to an ALERT. */ begin copy(s1,'global.fa_two_button_msg1'); copy(s2,'global.fa_two_button_msg2'); copy(upper(defalt),'global.fa_two_button_defalt'); --call ('$relfa/fa_two_button', NO_HIDE); call_form ('$relfa/fa_two_button', NO_HIDE,NO_REPLACE); answer := name_in('global.fa_two_button_answer'); erase ('global.fa_two_button_msg1'); erase ('global.fa_two_button_msg2'); erase ('global.fa_two_button_answer'); erase ('global.fa_two_button_defalt'); end; /* Creation History ---------------Created by : Megasoft L.L.C. (Contractor) On : 23-FEB-1999 Purpose : Created to assign the header block values with Heading as i nput. Also changes were made to achieve Y2K. */ PROCEDURE head_on_clear(str in char) IS form_desc VARCHAR2(80) := str; d date; len_desc NUMBER := LENGTH(form_desc); begin -- :head_blk.form_name := get_application_property(CURRENT_FORM_NAME); copy(get_application_property(CURRENT_FORM_NAME),'head_blk.form_name'); select to_date(to_char(SYSDATE,'DD-MON-YYYY'),'DD-MON-YYYY') into d from dual; copy(to_char(d,'DD-MON-YYYY'),'head_blk.sys_head_date'); copy(form_desc,'head_blk.form_desc'); set_item_property('HEAD_BLK.FORM_DESC',WIDTH,len_desc); set_item_property('HEAD_BLK.FORM_DESC',X_POS,(80-len_desc)/2+2); END; PACKAGE HINT IS PROCEDURE ShowButtonHelp( timedelay NUMBER := 500); PROCEDURE ShowButtonHelpHandler; PROCEDURE HideButtonHelp; END HINT; PACKAGE BODY HINT IS --- SMUENCH/DNAVAS, 1994 -BUTTONHELPTIMER CONSTANT VARCHAR2(80) := 'SHOWBUTTONHELP__X'; hint_is_displayed BOOLEAN := FALSE; on_windows_flag BOOLEAN := NULL; rc PLS_INTEGER; mouse_item VARCHAR2(80);

mouse_canvas mouse_item_hint appInst HWind lh_SHOWHINT fh_DisplayHint

VARCHAR2(80); VARCHAR2(200); PLS_INTEGER; PLS_INTEGER; ora_ffi.libHandleType; ora_ffi.funcHandleType;

FUNCTION i_DisplayHint(funcHandle IN ora_ffi.funcHandleType, AppInstance IN PLS_INTEGER, HWnd IN PLS_INTEGER, PosSq IN PLS_INTEGER, x IN PLS_INTEGER, y IN PLS_INTEGER, message IN OUT VARCHAR2) RETURN PLS_INTEGER; PRAGMA INTERFACE(C,i_DisplayHint,11265); FUNCTION DisplayHint (AppInstance IN PLS_INTEGER, HWnd IN PLS_INTEGER, PosSq IN PLS_INTEGER, x IN PLS_INTEGER, y IN PLS_INTEGER, message IN VARCHAR2) RETURN PLS_INTEGER IS AppInstance_l PLS_INTEGER := AppInstance; HWnd_l PLS_INTEGER := HWnd; PosSq_l PLS_INTEGER := PosSq; x_l PLS_INTEGER := x; y_l PLS_INTEGER := y; message_l VARCHAR2(512) := message; BEGIN rc := i_DisplayHint(fh_DisplayHint, AppInstance_l, HWnd_l, PosSq_l, x_l, y_l, message_l); RETURN (rc); END ; FUNCTION on_windows RETURN BOOLEAN IS ui varchar2(255); BEGIN IF on_windows_flag IS NULL THEN ui := Get_Application_Property(USER_INTERFACE); on_windows_flag := ui ='MSWINDOWS' or ui ='MSWINDOWS32' ; --19JAN96 CZ END IF; RETURN on_windows_flag; END; PROCEDURE sync_mouse_info IS BEGIN mouse_item := Name_In('SYSTEM.MOUSE_ITEM'); mouse_canvas := Name_In('SYSTEM.MOUSE_CANVAS');

:= TO_PLS_INTEGER( Get_Application_Property(APPLICATION_INSTANCE)); IF mouse_item IS NOT NULL THEN hWind := TO_PLS_INTEGER( Get_Item_Property(mouse_item,WINDOW_HANDLE)); mouse_item_hint := Get_Item_Property(mouse_item,HINT_TEXT); IF SUBSTR(mouse_item_hint,1,1) = CHR(0) THEN mouse_item_hint := NULL; END IF; ELSE hWind := NULL; END IF; END; FUNCTION mouse_item_label RETURN VARCHAR2 IS tmp VARCHAR(200) := Get_Item_Property(mouse_item,LABEL); BEGIN IF SUBSTR(tmp,1,1) = CHR(0) THEN RETURN NULL; ELSE RETURN tmp; END IF; END; FUNCTION mouse_item_is_iconic_button RETURN BOOLEAN IS BEGIN RETURN Get_Item_Property(mouse_item,ITEM_TYPE) LIKE '%BUTTON%' AND Get_Item_Property(mouse_item,ICON_NAME) IS NOT NULL; END; FUNCTION mouse_window RETURN VARCHAR2 IS BEGIN RETURN Get_View_Property(mouse_canvas,WINDOW_NAME); END; FUNCTION relative_hint_pos RETURN PLS_INTEGER IS left NUMBER; right NUMBER; win VARCHAR2(80); BEGIN left := Get_Item_Property(mouse_item,X_POS); right := left + TO_NUMBER(Get_Item_Property(mouse_item,WIDTH)); win := Get_Window_Property(mouse_window,WIDTH); IF left/win < 0.05 THEN RETURN 16; ELSIF right/win > .95 THEN RETURN -16; ELSE RETURN 0; END IF; END; PROCEDURE HideButtonHelp IS t Timer := Find_Timer(BUTTONHELPTIMER); BEGIN IF NOT on_windows THEN RETURN; END IF; IF NOT Id_Null(t) THEN Delete_Timer(t);

appInst

END IF; IF hint_is_displayed THEN rc := DisplayHint(NULL,NULL,7,0,0,NULL); Clear_Message; hint_is_displayed := FALSE; END IF; END; PROCEDURE ShowButtonHelp( timedelay NUMBER := 500) IS t Timer := Find_Timer(BUTTONHELPTIMER); BEGIN IF NOT on_windows THEN RETURN; END IF; IF NOT Id_Null(t) THEN Delete_Timer(t); END IF; sync_mouse_info; IF mouse_item IS NOT NULL AND mouse_item_is_iconic_button THEN IF mouse_item_label IS NOT NULL THEN t := Create_Timer(BUTTONHELPTIMER,timedelay,NO_REPEAT); END IF; ELSE HideButtonHelp; END IF; END; PROCEDURE ShowButtonHelpHandler IS t Timer := Find_Timer(BUTTONHELPTIMER); tn VARCHAR2(80) := Get_Application_Property(TIMER_NAME); BEGIN IF NVL(tn,'x') = BUTTONHELPTIMER THEN IF NOT on_windows THEN RETURN; END IF; IF NOT Id_Null(t) THEN Delete_Timer(t); END IF; if name_in('system.mouse_canvas') in ('VERT_TOOL_BAR') then rc := DisplayHint(appInst,HWind,7,relative_hint_pos+20,-19, mouse_item_label); elsif name_in('system.mouse_canvas') in ('TOOL_BLK','SAMPLE1') then rc := DisplayHint(appInst,HWind,7,relative_hint_pos+5,-19, mouse_item_label); else rc := DisplayHint(appInst,HWind,7,relative_hint_pos+3,0, mouse_item_label); end if; IF mouse_item_hint IS NOT NULL THEN Message(mouse_item_hint,NO_ACKNOWLEDGE); END IF; hint_is_displayed := TRUE; END IF; END; BEGIN IF on_windows THEN BEGIN

IF Get_Application_Property(USER_INTERFACE) ='MSWINDOWS' THEN lh_SHOWHINT := ora_ffi.find_library('SHOWHINT.DLL'); ELSE lh_SHOWHINT := ora_ffi.find_library('SHWHNT32.DLL'); --19JAN96 CZ END IF; EXCEPTION WHEN ora_ffi.FFI_ERROR THEN IF Get_Application_Property(USER_INTERFACE) ='MSWINDOWS' THEN lh_SHOWHINT := ora_ffi.load_library(NULL, 'SHOWHINT.DLL'); ELSE lh_SHOWHINT := ora_ffi.load_library(NULL, 'SHWHNT32.DLL'); CZ END IF; END ; fh_DisplayHint := ora_ffi.register_function(lh_SHOWHINT, 'DisplayHint',ora_ffi.C_STD); ora_ffi.register_parameter(fh_DisplayHint,ORA_FFI.C_INT); ora_ffi.register_parameter(fh_DisplayHint,ORA_FFI.C_INT); ora_ffi.register_parameter(fh_DisplayHint,ORA_FFI.C_INT); ora_ffi.register_parameter(fh_DisplayHint,ORA_FFI.C_INT); ora_ffi.register_parameter(fh_DisplayHint,ORA_FFI.C_INT); ora_ffi.register_parameter(fh_DisplayHint,ORA_FFI.C_CHAR_PTR); ora_ffi.register_return(fh_DisplayHint,ORA_FFI.C_INT); END IF; END HINT; procedure messagebox(str in Varchar) is al_id Alert; Alert_no number; Begin al_id := Find_Alert('Alert1'); if Id_Null(al_id) then Message('Alert Object missing call MegaSoft'); Raise Form_Trigger_Failure; end if; change_alert_message('alert1',str); Alert_no := show_alert('alert1'); End messagebox; PROCEDURE proc_help (form_name in char, col_name in char) IS tmpname varchar2(40); /* Description: This procedure is used to call the help screen. Usage: Form_name is the first parameter passed. This is the actual name of the form that is calling the Help screen. Col_name is the second parameter passed. The :system.cursor_field is what is passed to this paramter that is calling the Help screen. Modification History -------------------Done by : Megasoft L.L.C. (Contractor), 01/15/1999 On : 01/15/1999 Purpose : Upgraded to Forms 4.5 version (CHAR mode) as part of S erver Consolidation

--19JAN96

*/ begin tmpname := upper(form_name) || '.' ||substr(col_name,(instr(col_name,'.')+1)) ; copy(TMPNAME,'global.form_column_name') ; -- call('$relca/ca_win_help'); call_form('$relca/ca_win_help',HIDE,NO_REPLACE); erase('global.form_column_name'); end; PROCEDURE window_title(win_title in char) IS BEGIN set_window_property('MAIN_WINDOW',title,win_title); set_window_property('MAIN_WINDOW',WINDOW_STATE,MAXIMIZE); END;

You might also like