1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI ADM1
6 &Scoped-define WINDOW-NAME CURRENT-WINDOW
7 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS V-table-Win
8 /*------------------------------------------------------------------------
11 ------------------------------------------------------------------------*/
13 /* *************************** Definitions
************************** */
15 DEF VAR user-name
AS CHAR NO-UNDO.
16 DEF VAR contact-list
AS CHAR INITIAL "" NO-UNDO.
17 DEF VAR my-delim
AS CHAR INITIAL "|" NO-UNDO.
19 /* _UIB-CODE-BLOCK-END
*/
23 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
25 /* ******************** Preprocessor Definitions
******************** */
27 &Scoped-define PROCEDURE-TYPE SmartViewer
28 &Scoped-define DB-AWARE no
30 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
32 /* Name of first Frame and
/or Browse and
/or first Query
*/
33 &Scoped-define FRAME-NAME F-Main
36 &Scoped-define EXTERNAL-TABLES RP
37 &Scoped-define FIRST-EXTERNAL-TABLE RP
40 /* Need to scope the external tables to this procedure
*/
41 DEFINE QUERY external_tables
FOR RP.
42 /* Standard List Definitions
*/
43 &Scoped-Define ENABLED-FIELDS RP.Int1 RP.Int2 RP.Log2 RP.Log1
44 &Scoped-define ENABLED-TABLES RP
45 &Scoped-define FIRST-ENABLED-TABLE RP
46 &Scoped-define DISPLAYED-TABLES RP
47 &Scoped-define FIRST-DISPLAYED-TABLE RP
48 &Scoped-Define ENABLED-OBJECTS cmb_AddressType cmb_EcType Btn_OK RECT-1
49 &Scoped-Define DISPLAYED-FIELDS RP.Int1 RP.Int2 RP.Log2 RP.Log1
50 &Scoped-Define DISPLAYED-OBJECTS fil_prop1 fil_prop2 cmb_AddressType ~
53 /* Custom List Definitions
*/
54 /* ADM-CREATE-FIELDS
,ADM-ASSIGN-FIELDS
,List-3
,List-4
,List-5
,List-6
*/
55 &Scoped-define ADM-CREATE-FIELDS RP.Log1
56 &Scoped-define ADM-ASSIGN-FIELDS RP.Log1
58 /* _UIB-PREPROCESSOR-BLOCK-END
*/
63 /* *********************** Control Definitions
********************** */
66 /* Definitions of the field level widgets
*/
67 DEFINE BUTTON Btn_OK
AUTO-GO DEFAULT
72 DEFINE VARIABLE cmb_AddressType
AS CHARACTER FORMAT "X(50)"
74 VIEW-AS COMBO-BOX INNER-LINES 10
75 LIST-ITEMS "POST","COUR","HOME"
80 DEFINE VARIABLE fil_prop1
AS CHARACTER FORMAT "X(256)":U
85 DEFINE VARIABLE fil_prop2
AS CHARACTER FORMAT "X(256)":U
90 DEFINE RECTANGLE RECT-1
91 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
94 DEFINE VARIABLE cmb_EcType
AS CHARACTER
95 VIEW-AS SELECTION-LIST MULTIPLE SCROLLBAR-VERTICAL
96 SIZE 37.72 BY 8 NO-UNDO.
99 /* ************************ Frame Definitions
*********************** */
102 RP.Int1
AT ROW 1.2 COL 5.86 COLON-ALIGNED
103 LABEL "Property" FORMAT "99999"
106 fil_prop1
AT ROW 1.2 COL 15.57 COLON-ALIGNED NO-LABEL
107 RP.Int2
AT ROW 2.2 COL 5.86 COLON-ALIGNED
108 LABEL "to" FORMAT "99999"
111 fil_prop2
AT ROW 2.2 COL 15.57 COLON-ALIGNED NO-LABEL
112 RP.Log2
AT ROW 4 COL 18
113 LABEL "One page per tenant"
116 cmb_AddressType
AT ROW 5 COL 8.43
117 cmb_EcType
AT ROW 6.25 COL 18 NO-LABEL
118 Btn_OK
AT ROW 14.7 COL 50.14
119 RP.Log1
AT ROW 14.9 COL 4.72 HELP
125 RECT-1
AT ROW 1 COL 1
126 "Contact types:" VIEW-AS TEXT
127 SIZE 10 BY .8 AT ROW 6.25 COL 8
128 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
129 SIDE-LABELS NO-UNDERLINE THREE-D
130 AT COL 1 ROW 1 SCROLLABLE
132 DEFAULT-BUTTON Btn_OK.
135 /* *********************** Procedure Settings
************************ */
137 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
138 /* Settings for
THIS-PROCEDURE
140 External Tables
: ttpl.RP
141 Allow
: Basic
,DB-Fields
143 Add Fields to
: EXTERNAL-TABLES
144 Other Settings
: PERSISTENT-ONLY
COMPILE
147 /* This procedure should always be
RUN PERSISTENT. Report the error
, */
148 /* then cleanup and return.
*/
149 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
150 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
151 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
155 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
157 /* ************************* Create Window
************************** */
159 &ANALYZE-SUSPEND _CREATE-WINDOW
160 /* DESIGN Window definition
(used by the UIB
)
161 CREATE WINDOW V-table-Win
ASSIGN
164 /* END WINDOW DEFINITION
*/
168 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
169 /* ************************* Included-Libraries
*********************** */
171 {src
/adm
/method
/viewer.i
}
172 {inc
/method
/m-mntvwr.i
}
174 /* _UIB-CODE-BLOCK-END
*/
180 /* *********** Runtime Attributes and AppBuilder Settings
*********** */
182 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
183 /* SETTINGS
FOR WINDOW V-table-Win
184 VISIBLE,,RUN-PERSISTENT
*/
185 /* SETTINGS
FOR FRAME F-Main
186 NOT-VISIBLE Size-to-Fit
*/
188 FRAME F-Main
:SCROLLABLE = FALSE
189 FRAME F-Main
:HIDDEN = TRUE.
191 /* SETTINGS
FOR COMBO-BOX cmb_AddressType
IN FRAME F-Main
193 /* SETTINGS
FOR FILL-IN fil_prop1
IN FRAME F-Main
195 /* SETTINGS
FOR FILL-IN fil_prop2
IN FRAME F-Main
197 /* SETTINGS
FOR FILL-IN RP.Int1
IN FRAME F-Main
198 EXP-LABEL EXP-FORMAT
*/
199 /* SETTINGS
FOR FILL-IN RP.Int2
IN FRAME F-Main
200 EXP-LABEL EXP-FORMAT
*/
201 /* SETTINGS
FOR TOGGLE-BOX RP.Log1
IN FRAME F-Main
202 1 2 EXP-LABEL EXP-HELP
*/
203 /* SETTINGS
FOR TOGGLE-BOX RP.Log2
IN FRAME F-Main
205 /* _RUN-TIME-ATTRIBUTES-END
*/
209 /* Setting information for Queries and Browse Widgets fields
*/
211 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
212 /* Query rebuild information for
FRAME F-Main
215 */ /* FRAME F-Main
*/
222 /* ************************ Control Triggers
************************ */
224 &Scoped-define SELF-NAME Btn_OK
225 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_OK V-table-Win
226 ON CHOOSE OF Btn_OK
IN FRAME F-Main
/* OK */
228 RUN notify
( 'set-busy
, CONTAINER-SOURCE'
:U
).
231 SELF:SENSITIVE = Yes.
232 RUN notify
( 'set-idle
, CONTAINER-SOURCE'
:U
).
235 /* _UIB-CODE-BLOCK-END
*/
239 &Scoped-define SELF-NAME cmb_AddressType
240 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_AddressType V-table-Win
241 ON U1
OF cmb_AddressType
IN FRAME F-Main
/* Address type
*/
243 {inc
/selcmb
/scpdt1.i
"RP" "Char2"}
246 /* _UIB-CODE-BLOCK-END
*/
250 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_AddressType V-table-Win
251 ON U2
OF cmb_AddressType
IN FRAME F-Main
/* Address type
*/
253 {inc
/selcmb
/scpdt2.i
"RP" "Char2"}
256 /* _UIB-CODE-BLOCK-END
*/
260 &Scoped-define SELF-NAME cmb_EcType
261 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_EcType V-table-Win
262 ON U1
OF cmb_EcType
IN FRAME F-Main
264 {inc
/selcmb
/sel-ectyp1.i
"RP" "Char6"}
267 /* _UIB-CODE-BLOCK-END
*/
271 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_EcType V-table-Win
272 ON U2
OF cmb_EcType
IN FRAME F-Main
274 {inc
/selcmb
/sel-ectyp2.i
"RP" "Char6"}
277 /* _UIB-CODE-BLOCK-END
*/
281 &Scoped-define SELF-NAME fil_prop1
282 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_prop1 V-table-Win
283 ON U1
OF fil_prop1
IN FRAME F-Main
285 {inc
/selfil
/sfpro1.i
"RP" "Int1"}
288 /* _UIB-CODE-BLOCK-END
*/
292 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_prop1 V-table-Win
293 ON U2
OF fil_prop1
IN FRAME F-Main
295 {inc
/selfil
/sfpro2.i
"RP" "Int1"}
298 /* _UIB-CODE-BLOCK-END
*/
302 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_prop1 V-table-Win
303 ON U3
OF fil_prop1
IN FRAME F-Main
305 {inc
/selfil
/sfpro3.i
"RP" "Int1"}
308 /* _UIB-CODE-BLOCK-END
*/
312 &Scoped-define SELF-NAME fil_prop2
313 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_prop2 V-table-Win
314 ON U1
OF fil_prop2
IN FRAME F-Main
316 {inc
/selfil
/sfpro1.i
"RP" "Int2"}
319 /* _UIB-CODE-BLOCK-END
*/
323 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_prop2 V-table-Win
324 ON U2
OF fil_prop2
IN FRAME F-Main
326 {inc
/selfil
/sfpro2.i
"RP" "Int2"}
329 /* _UIB-CODE-BLOCK-END
*/
333 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_prop2 V-table-Win
334 ON U3
OF fil_prop2
IN FRAME F-Main
336 {inc
/selfil
/sfpro3.i
"RP" "Int2"}
339 /* _UIB-CODE-BLOCK-END
*/
343 &Scoped-define SELF-NAME RP.Int1
344 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int1 V-table-Win
345 ON LEAVE OF RP.Int1
IN FRAME F-Main
/* Property
*/
347 {inc
/selcde
/cdpro.i
"fil_prop1"}
350 /* _UIB-CODE-BLOCK-END
*/
354 &Scoped-define SELF-NAME RP.Int2
355 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int2 V-table-Win
356 ON LEAVE OF RP.Int2
IN FRAME F-Main
/* to
*/
358 {inc
/selcde
/cdpro.i
"fil_prop2"}
361 /* _UIB-CODE-BLOCK-END
*/
367 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
370 /* *************************** Main Block
*************************** */
372 /* _UIB-CODE-BLOCK-END
*/
376 /* ********************** Internal Procedures
*********************** */
378 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
379 PROCEDURE adm-row-available
:
380 /*------------------------------------------------------------------------------
381 Purpose
: Dispatched to this procedure when the Record-
382 Source has a new row available. This procedure
383 tries to get the new row
(or foriegn keys
) from
384 the Record-Source and process it.
386 ------------------------------------------------------------------------------*/
388 /* Define variables needed by this internal procedure.
*/
389 {src
/adm
/template
/row-head.i
}
391 /* Create a list of all the tables that we need to get.
*/
392 {src
/adm
/template
/row-list.i
"RP"}
394 /* Get the record
ROWID's from the RECORD-SOURCE.
*/
395 {src
/adm
/template
/row-get.i
}
397 /* FIND each record specified by the RECORD-SOURCE.
*/
398 {src
/adm
/template
/row-find.i
"RP"}
400 /* Process the newly available records
(i.e. display fields
,
401 open queries
, and
/or pass records on to any RECORD-TARGETS
).
*/
402 {src
/adm
/template
/row-end.i
}
406 /* _UIB-CODE-BLOCK-END
*/
409 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
410 PROCEDURE disable_UI
:
411 /*------------------------------------------------------------------------------
412 Purpose
: DISABLE the User Interface
414 Notes
: Here we clean-up the user-interface by deleting
415 dynamic widgets we have created and
/or hide
416 frames. This procedure is usually called when
417 we are ready to
"clean-up" after running.
418 ------------------------------------------------------------------------------*/
419 /* Hide all frames.
*/
421 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
424 /* _UIB-CODE-BLOCK-END
*/
427 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable-appropriate-fields V-table-Win
428 PROCEDURE enable-appropriate-fields
:
429 /*------------------------------------------------------------------------------
430 Purpose
: As its name
!
431 ------------------------------------------------------------------------------*/
433 DO WITH FRAME {&FRAME-NAME}:
438 /* _UIB-CODE-BLOCK-END
*/
441 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
442 PROCEDURE inst-initialize
:
443 /*------------------------------------------------------------------------------
444 Purpose
: Initialise the necessary bits and pieces
445 ------------------------------------------------------------------------------*/
447 RUN get-username
IN sec-mgr
( OUTPUT user-name
).
448 FIND RP
WHERE RP.ReportID
= "ctlst"
449 AND RP.UserName
= user-name
452 IF NOT AVAILABLE( RP
) THEN DO:
455 RP.ReportID
= "pctlst"
456 RP.UserName
= user-name
460 RUN dispatch
( 'display-fields'
:U
).
461 RUN dispatch
( 'enable-fields'
:U
).
462 RUN enable-appropriate-fields.
466 /* _UIB-CODE-BLOCK-END
*/
469 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
470 PROCEDURE pre-destroy
:
471 /*------------------------------------------------------------------------------
475 ------------------------------------------------------------------------------*/
476 RUN check-modified
( 'clear'
:U
).
479 /* _UIB-CODE-BLOCK-END
*/
482 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE run-report V-table-Win
483 PROCEDURE run-report
:
484 /*------------------------------------------------------------------------------
485 Purpose
: Actually run the report program.
486 ------------------------------------------------------------------------------*/
488 DO WITH FRAME {&FRAME-NAME}:
490 DEF VAR contact-types
AS CHAR NO-UNDO.
491 DEF VAR sv
AS CHAR NO-UNDO.
492 DEF VAR delim
AS CHAR NO-UNDO.
493 DEF VAR i
AS INT NO-UNDO.
494 DEF VAR report-options
AS CHAR NO-UNDO.
497 IF RETURN-VALUE = "FAIL" THEN RETURN.
499 RUN dispatch
( 'update-record'
:U
).
501 report-options
= "PostalTypes," + RP.Char2
502 + "~nExclude," + ( IF RP.Char3
= "EXC" THEN "Yes" ELSE "No" )
503 + "~nEntity,P" + "," + STRING( RP.Int1
) + "," + STRING( RP.Int2
)
504 + (IF RP.Log1
THEN "~nPreview,Yes" ELSE "")
505 + (IF RP.Log2
THEN "~nPagePerTenant" ELSE "")
506 + "~nContactTypes," + RP.Char6.
508 {inc
/bq-do.i
"process/report/contacts.p" "report-options" "(NOT RP.Log1)"}
514 /* _UIB-CODE-BLOCK-END
*/
517 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
518 PROCEDURE send-records
:
519 /*------------------------------------------------------------------------------
520 Purpose
: Send record
ROWID's for all tables used by
522 Parameters
: see template
/snd-head.i
523 ------------------------------------------------------------------------------*/
525 /* Define variables needed by this internal procedure.
*/
526 {src
/adm
/template
/snd-head.i
}
528 /* For each requested table
, put it's
ROWID in the output list.
*/
529 {src
/adm
/template
/snd-list.i
"RP"}
531 /* Deal with any unexpected table requests before closing.
*/
532 {src
/adm
/template
/snd-end.i
}
536 /* _UIB-CODE-BLOCK-END
*/
539 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
540 PROCEDURE state-changed
:
541 /* -----------------------------------------------------------
545 -------------------------------------------------------------*/
546 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
547 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
550 /* Object instance CASEs can go here to replace standard behavior
552 {src
/adm
/template
/vstates.i
}
556 /* _UIB-CODE-BLOCK-END
*/
559 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE verify-report V-table-Win
560 PROCEDURE verify-report
:
561 /*------------------------------------------------------------------------------
565 ------------------------------------------------------------------------------*/
567 DO WITH FRAME {&FRAME-NAME}:
573 /* _UIB-CODE-BLOCK-END
*/