Added capital works blank section. Synced calling screen.
[capital-apms-progress.git] / compliance / b-inspectors.w
blob62e445a0ab706f30e7340febc20d7cf3bb328a4d
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI
2 &ANALYZE-RESUME
3 /* Connected Databases
4 ttpl PROGRESS
5 */
6 &Scoped-define WINDOW-NAME CURRENT-WINDOW
7 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS B-table-Win
8 /*------------------------------------------------------------------------
9 File:
10 Description:
12 ------------------------------------------------------------------------*/
14 CREATE WIDGET-POOL.
16 /* *************************** Definitions ************************** */
18 /* _UIB-CODE-BLOCK-END */
19 &ANALYZE-RESUME
22 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
24 /* ******************** Preprocessor Definitions ******************** */
26 &Scoped-define PROCEDURE-TYPE SmartBrowser
28 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
30 /* Name of first Frame and/or Browse and/or first Query */
31 &Scoped-define FRAME-NAME F-Main
32 &Scoped-define BROWSE-NAME br_table
34 /* Internal Tables (found by Frame, Query & Browse Queries) */
35 &Scoped-define INTERNAL-TABLES Inspector Person
37 /* Define KEY-PHRASE in case it is used by any query. */
38 &Scoped-define KEY-PHRASE TRUE
40 /* Definitions for BROWSE br_table */
41 &Scoped-define FIELDS-IN-QUERY-br_table Inspector.InspectorCode ~
42 Inspector.CreditorCode Person.FirstName Person.LastName Person.Company
43 &Scoped-define ENABLED-FIELDS-IN-QUERY-br_table
44 &Scoped-define FIELD-PAIRS-IN-QUERY-br_table
45 &Scoped-define OPEN-QUERY-br_table OPEN QUERY br_table FOR EACH Inspector WHERE ~{&KEY-PHRASE} NO-LOCK, ~
46 EACH Person OF Inspector NO-LOCK ~
47 ~{&SORTBY-PHRASE}.
48 &Scoped-define TABLES-IN-QUERY-br_table Inspector Person
49 &Scoped-define FIRST-TABLE-IN-QUERY-br_table Inspector
52 /* Definitions for FRAME F-Main */
54 /* Standard List Definitions */
55 &Scoped-Define ENABLED-OBJECTS br_table
57 /* Custom List Definitions */
58 /* List-1,List-2,List-3,List-4,List-5,List-6 */
60 /* _UIB-PREPROCESSOR-BLOCK-END */
61 &ANALYZE-RESUME
64 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Foreign Keys" B-table-Win _INLINE
65 /* Actions: ? adm/support/keyedit.w ? ? ? */
66 /* STRUCTURED-DATA
67 <KEY-OBJECT>
68 &BROWSE-NAME
69 </KEY-OBJECT>
70 <FOREIGN-KEYS>
71 PersonCode||y|TTPL.Inspector.PersonCode
72 CreditorCode||y|TTPL.Inspector.CreditorCode
73 InspectorCode||y|TTPL.Inspector.InspectorCode
74 InspectorIQP||y|TTPL.Inspector.InspectorCode
75 InspectorOwner||y|TTPL.Inspector.InspectorCode
76 EntityCode||y|TTPL.Inspector.CreditorCode
77 </FOREIGN-KEYS>
78 <EXECUTING-CODE>
79 **************************
80 * Set attributes related to FOREIGN KEYS
82 RUN set-attribute-list (
83 'Keys-Accepted = ,
84 Keys-Supplied = "PersonCode,CreditorCode,InspectorCode,InspectorIQP,InspectorOwner,EntityCode"':U).
86 /* Tell the ADM to use the OPEN-QUERY-CASES. */
87 &Scoped-define OPEN-QUERY-CASES RUN dispatch ('open-query-cases':U).
88 /**************************
89 </EXECUTING-CODE> */
90 /* _UIB-CODE-BLOCK-END */
91 &ANALYZE-RESUME
93 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Advanced Query Options" B-table-Win _INLINE
94 /* Actions: ? adm/support/advqedit.w ? ? ? */
95 /* STRUCTURED-DATA
96 <KEY-OBJECT>
97 &BROWSE-NAME
98 </KEY-OBJECT>
99 <SORTBY-OPTIONS>
100 </SORTBY-OPTIONS>
101 <SORTBY-RUN-CODE>
102 ************************
103 * Set attributes related to SORTBY-OPTIONS */
104 RUN set-attribute-list (
105 'SortBy-Options = ""':U).
106 /************************
107 </SORTBY-RUN-CODE>
108 <FILTER-ATTRIBUTES>
109 </FILTER-ATTRIBUTES> */
111 /* _UIB-CODE-BLOCK-END */
112 &ANALYZE-RESUME
115 /* *********************** Control Definitions ********************** */
118 /* Definitions of the field level widgets */
119 /* Query definitions */
120 &ANALYZE-SUSPEND
121 DEFINE QUERY br_table FOR
122 Inspector,
123 Person SCROLLING.
124 &ANALYZE-RESUME
126 /* Browse definitions */
127 DEFINE BROWSE br_table
128 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _DISPLAY-FIELDS br_table B-table-Win _STRUCTURED
129 QUERY br_table NO-LOCK DISPLAY
130 Inspector.InspectorCode COLUMN-LABEL "Code" FORMAT ">>>9"
131 Inspector.CreditorCode
132 Person.FirstName FORMAT "X(12)"
133 Person.LastName FORMAT "X(12)"
134 Person.Company
135 /* _UIB-CODE-BLOCK-END */
136 &ANALYZE-RESUME
137 WITH NO-ASSIGN SEPARATORS SIZE 83.43 BY 13.8
138 FONT 10.
141 /* ************************ Frame Definitions *********************** */
143 DEFINE FRAME F-Main
144 br_table AT ROW 1 COL 1
145 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
146 SIDE-LABELS NO-UNDERLINE THREE-D
147 AT COL 1 ROW 1 SCROLLABLE
148 BGCOLOR 16 FGCOLOR 0 FONT 10.
151 /* *********************** Procedure Settings ************************ */
153 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
154 /* Settings for THIS-PROCEDURE
155 Type: SmartBrowser
156 Allow: Basic,Browse
157 Frames: 1
158 Add Fields to: EXTERNAL-TABLES
159 Other Settings: PERSISTENT-ONLY COMPILE
162 /* This procedure should always be RUN PERSISTENT. Report the error, */
163 /* then cleanup and return. */
164 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
165 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
166 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
167 RETURN.
168 END.
170 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
172 /* ************************* Create Window ************************** */
174 &ANALYZE-SUSPEND _CREATE-WINDOW
175 /* DESIGN Window definition (used by the UIB)
176 CREATE WINDOW B-table-Win ASSIGN
177 HEIGHT = 14.4
178 WIDTH = 83.72.
179 /* END WINDOW DEFINITION */
181 &ANALYZE-RESUME
184 /* *************** Runtime Attributes and UIB Settings ************** */
186 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
187 /* SETTINGS FOR WINDOW B-table-Win
188 NOT-VISIBLE,,RUN-PERSISTENT */
189 /* SETTINGS FOR FRAME F-Main
190 NOT-VISIBLE Size-to-Fit */
191 /* BROWSE-TAB br_table 1 F-Main */
192 ASSIGN
193 FRAME F-Main:SCROLLABLE = FALSE
194 FRAME F-Main:HIDDEN = TRUE.
196 /* _RUN-TIME-ATTRIBUTES-END */
197 &ANALYZE-RESUME
200 /* Setting information for Queries and Browse Widgets fields */
202 &ANALYZE-SUSPEND _QUERY-BLOCK BROWSE br_table
203 /* Query rebuild information for BROWSE br_table
204 _TblList = "TTPL.Inspector,TTPL.Person OF TTPL.Inspector"
205 _Options = "NO-LOCK KEY-PHRASE SORTBY-PHRASE"
206 _FldNameList[1] > TTPL.Inspector.InspectorCode
207 "Inspector.InspectorCode" "Code" ">>>9" "integer" ? ? ? ? ? ? no ?
208 _FldNameList[2] = TTPL.Inspector.CreditorCode
209 _FldNameList[3] > TTPL.Person.FirstName
210 "Person.FirstName" ? "X(12)" "character" ? ? ? ? ? ? no ?
211 _FldNameList[4] > TTPL.Person.LastName
212 "Person.LastName" ? "X(12)" "character" ? ? ? ? ? ? no ?
213 _FldNameList[5] = TTPL.Person.Company
214 _Query is NOT OPENED
215 */ /* BROWSE br_table */
216 &ANALYZE-RESUME
218 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
219 /* Query rebuild information for FRAME F-Main
220 _Options = "NO-LOCK"
221 _Query is NOT OPENED
222 */ /* FRAME F-Main */
223 &ANALYZE-RESUME
228 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB B-table-Win
229 /* ************************* Included-Libraries *********************** */
231 {src/adm/method/browser.i}
232 {inc/method/m-drlvwr.i}
234 /* _UIB-CODE-BLOCK-END */
235 &ANALYZE-RESUME
240 /* ************************ Control Triggers ************************ */
242 &Scoped-define BROWSE-NAME br_table
243 &Scoped-define SELF-NAME br_table
244 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
245 ON ROW-ENTRY OF br_table IN FRAME F-Main
247 /* This code displays initial values for newly added or copied rows. */
248 {src/adm/template/brsentry.i}
249 END.
251 /* _UIB-CODE-BLOCK-END */
252 &ANALYZE-RESUME
255 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
256 ON ROW-LEAVE OF br_table IN FRAME F-Main
258 /* Do not disable this code or no updates will take place except
259 by pressing the Save button on an Update SmartPanel. */
260 {src/adm/template/brsleave.i}
261 END.
263 /* _UIB-CODE-BLOCK-END */
264 &ANALYZE-RESUME
267 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
268 ON VALUE-CHANGED OF br_table IN FRAME F-Main
270 /* This ADM trigger code must be preserved in order to notify other
271 objects when the browser's current row changes. */
272 {src/adm/template/brschnge.i}
273 END.
275 /* _UIB-CODE-BLOCK-END */
276 &ANALYZE-RESUME
279 &UNDEFINE SELF-NAME
281 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK B-table-Win
284 /* *************************** Main Block *************************** */
286 &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
287 RUN dispatch IN THIS-PROCEDURE ('initialize':U).
288 &ENDIF
290 /* _UIB-CODE-BLOCK-END */
291 &ANALYZE-RESUME
294 /* ********************** Internal Procedures *********************** */
296 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-open-query-cases B-table-Win adm/support/_adm-opn.p
297 PROCEDURE adm-open-query-cases :
298 /*------------------------------------------------------------------------------
299 Purpose: Opens different cases of the query based on attributes
300 such as the 'Key-Name', or 'SortBy-Case'
301 Parameters: <none>
302 ------------------------------------------------------------------------------*/
304 /* No Foreign keys are accepted by this SmartObject. */
306 {&OPEN-QUERY-{&BROWSE-NAME}}
308 END PROCEDURE.
310 /* _UIB-CODE-BLOCK-END */
311 &ANALYZE-RESUME
314 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available B-table-Win _ADM-ROW-AVAILABLE
315 PROCEDURE adm-row-available :
316 /*------------------------------------------------------------------------------
317 Purpose: Dispatched to this procedure when the Record-
318 Source has a new row available. This procedure
319 tries to get the new row (or foriegn keys) from
320 the Record-Source and process it.
321 Parameters: <none>
322 ------------------------------------------------------------------------------*/
324 /* Define variables needed by this internal procedure. */
325 {src/adm/template/row-head.i}
327 /* Process the newly available records (i.e. display fields,
328 open queries, and/or pass records on to any RECORD-TARGETS). */
329 {src/adm/template/row-end.i}
331 END PROCEDURE.
333 /* _UIB-CODE-BLOCK-END */
334 &ANALYZE-RESUME
337 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE delete-inspector B-table-Win
338 PROCEDURE delete-inspector :
339 /*------------------------------------------------------------------------------
340 Purpose:
341 ------------------------------------------------------------------------------*/
342 IF NOT AVAILABLE(Inspector) THEN RETURN.
344 DEF VAR do-it AS LOGI NO-UNDO INITIAL No.
346 MESSAGE "Really? Delete this inspector?" VIEW-AS ALERT-BOX QUESTION
347 BUTTONS OK-CANCEL
348 TITLE "Confirm Deletion"
349 UPDATE do-it.
351 FIND CURRENT Inspector EXCLUSIVE-LOCK.
352 DELETE Inspector.
354 RUN dispatch( 'open-query':U ).
356 END PROCEDURE.
358 /* _UIB-CODE-BLOCK-END */
359 &ANALYZE-RESUME
362 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI B-table-Win _DEFAULT-DISABLE
363 PROCEDURE disable_UI :
364 /*------------------------------------------------------------------------------
365 Purpose: DISABLE the User Interface
366 Parameters: <none>
367 Notes: Here we clean-up the user-interface by deleting
368 dynamic widgets we have created and/or hide
369 frames. This procedure is usually called when
370 we are ready to "clean-up" after running.
371 ------------------------------------------------------------------------------*/
372 /* Hide all frames. */
373 HIDE FRAME F-Main.
374 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
375 END PROCEDURE.
377 /* _UIB-CODE-BLOCK-END */
378 &ANALYZE-RESUME
381 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-key B-table-Win adm/support/_key-snd.p
382 PROCEDURE send-key :
383 /*------------------------------------------------------------------------------
384 Purpose: Sends a requested KEY value back to the calling
385 SmartObject.
386 Parameters: <see adm/template/sndkytop.i>
387 ------------------------------------------------------------------------------*/
389 /* Define variables needed by this internal procedure. */
390 {src/adm/template/sndkytop.i}
392 /* Return the key value associated with each key case. */
393 {src/adm/template/sndkycas.i "PersonCode" "Inspector" "PersonCode"}
394 {src/adm/template/sndkycas.i "CreditorCode" "Inspector" "CreditorCode"}
395 {src/adm/template/sndkycas.i "InspectorCode" "Inspector" "InspectorCode"}
396 {src/adm/template/sndkycas.i "InspectorIQP" "Inspector" "InspectorCode"}
397 {src/adm/template/sndkycas.i "InspectorOwner" "Inspector" "InspectorCode"}
398 {src/adm/template/sndkycas.i "EntityCode" "Inspector" "CreditorCode"}
400 /* Close the CASE statement and end the procedure. */
401 {src/adm/template/sndkyend.i}
403 END PROCEDURE.
405 /* _UIB-CODE-BLOCK-END */
406 &ANALYZE-RESUME
409 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records B-table-Win _ADM-SEND-RECORDS
410 PROCEDURE send-records :
411 /*------------------------------------------------------------------------------
412 Purpose: Send record ROWID's for all tables used by
413 this file.
414 Parameters: see template/snd-head.i
415 ------------------------------------------------------------------------------*/
417 /* Define variables needed by this internal procedure. */
418 {src/adm/template/snd-head.i}
420 /* For each requested table, put it's ROWID in the output list. */
421 {src/adm/template/snd-list.i "Inspector"}
422 {src/adm/template/snd-list.i "Person"}
424 /* Deal with any unexpected table requests before closing. */
425 {src/adm/template/snd-end.i}
427 END PROCEDURE.
429 /* _UIB-CODE-BLOCK-END */
430 &ANALYZE-RESUME
433 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed B-table-Win
434 PROCEDURE state-changed :
435 /* -----------------------------------------------------------
436 Purpose:
437 Parameters: <none>
438 Notes:
439 -------------------------------------------------------------*/
440 DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
441 DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
443 CASE p-state:
444 /* Object instance CASEs can go here to replace standard behavior
445 or add new cases. */
446 {src/adm/template/bstates.i}
447 END CASE.
448 END PROCEDURE.
450 /* _UIB-CODE-BLOCK-END */
451 &ANALYZE-RESUME