Really, this should be it, for the passing income.
[capital-apms-progress.git] / vwr / mnt / v-entsel.w
blob935154b033e528efebe6db4b7efc3249eab04d6c
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI
2 &ANALYZE-RESUME
3 &Scoped-define WINDOW-NAME CURRENT-WINDOW
4 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS V-table-Win
5 /*------------------------------------------------------------------------
6 ------------------------------------------------------------------------*/
8 CREATE WIDGET-POOL.
10 /* *************************** Definitions ************************** */
12 /* Parameters Definitions --- */
14 /* Local Variable Definitions --- */
16 DEF VAR sub-li AS CHAR NO-UNDO.
17 DEF VAR sub-sv AS CHAR NO-UNDO.
18 DEF VAR sub-pd AS CHAR NO-UNDO.
19 DEF VAR sub-all AS LOGI NO-UNDO.
20 DEF VAR list-delim AS CHAR NO-UNDO INIT "~~".
21 DEF VAR entity-selection AS CHAR NO-UNDO.
23 DEF VAR src-et AS CHAR NO-UNDO INITIAL "".
24 DEF VAR src-esub AS CHAR NO-UNDO INITIAL "".
27 DEF WORK-TABLE EntSel NO-UNDO
28 FIELD EntityType AS CHAR
29 FIELD SelectionID AS CHAR
30 FIELD LI AS CHAR
31 FIELD SV AS CHAR
32 FIELD PD AS CHAR
33 FIELD SelAll AS LOGI.
35 DEF VAR rec-src AS HANDLE NO-UNDO.
37 /* _UIB-CODE-BLOCK-END */
38 &ANALYZE-RESUME
41 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
43 /* ******************** Preprocessor Definitions ******************** */
45 &Scoped-define PROCEDURE-TYPE SmartViewer
47 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
49 /* Name of first Frame and/or Browse and/or first Query */
50 &Scoped-define FRAME-NAME F-Main
52 /* Standard List Definitions */
53 &Scoped-Define ENABLED-OBJECTS rad_etype cmb_esub tgl_Inactive tgl_all ~
54 sel_selection btn_ok btn_cancel
55 &Scoped-Define DISPLAYED-OBJECTS rad_etype cmb_esub tgl_Inactive tgl_all ~
56 sel_selection
58 /* Custom List Definitions */
59 /* ADM-CREATE-FIELDS,ADM-ASSIGN-FIELDS,List-3,List-4,List-5,List-6 */
61 /* _UIB-PREPROCESSOR-BLOCK-END */
62 &ANALYZE-RESUME
65 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Foreign Keys" V-table-Win _INLINE
66 /* Actions: ? adm/support/keyedit.w ? ? ? */
67 /* STRUCTURED-DATA
68 <KEY-OBJECT>
69 THIS-PROCEDURE
70 </KEY-OBJECT>
71 <FOREIGN-KEYS>
72 </FOREIGN-KEYS>
73 <EXECUTING-CODE>
74 **************************
75 * Set attributes related to FOREIGN KEYS
77 RUN set-attribute-list (
78 'Keys-Accepted = "",
79 Keys-Supplied = ""':U).
80 /**************************
81 </EXECUTING-CODE> */
83 /* _UIB-CODE-BLOCK-END */
84 &ANALYZE-RESUME
86 /* ************************ Function Prototypes ********************** */
88 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD retrieve-attribute V-table-Win
89 FUNCTION retrieve-attribute RETURNS CHARACTER
90 ( INPUT selection-id AS CHAR ) FORWARD.
92 /* _UIB-CODE-BLOCK-END */
93 &ANALYZE-RESUME
96 /* *********************** Control Definitions ********************** */
99 /* Definitions of the field level widgets */
100 DEFINE BUTTON btn_cancel
101 LABEL "&Cancel"
102 SIZE 6.29 BY 1.15.
104 DEFINE BUTTON btn_ok
105 LABEL "&OK"
106 SIZE 4 BY 1.15.
108 DEFINE VARIABLE cmb_esub AS CHARACTER FORMAT "X(256)":U
109 VIEW-AS COMBO-BOX SORT INNER-LINES 5
110 LIST-ITEMS " "
111 SIZE 36 BY 1 NO-UNDO.
113 DEFINE VARIABLE rad_etype AS CHARACTER
114 VIEW-AS RADIO-SET HORIZONTAL
115 RADIO-BUTTONS
116 "Properties", "P",
117 "Ledgers", "L",
118 "Projects", "J"
119 SIZE 37.72 BY 1 NO-UNDO.
121 DEFINE VARIABLE sel_selection AS CHARACTER
122 VIEW-AS SELECTION-LIST MULTIPLE SCROLLBAR-VERTICAL
123 SIZE 54.29 BY 10.6 NO-UNDO.
125 DEFINE VARIABLE tgl_all AS LOGICAL INITIAL no
126 LABEL "All"
127 VIEW-AS TOGGLE-BOX
128 SIZE 5.14 BY 1 NO-UNDO.
130 DEFINE VARIABLE tgl_Inactive AS LOGICAL INITIAL no
131 LABEL "Inactives"
132 VIEW-AS TOGGLE-BOX
133 SIZE 9.14 BY 1 NO-UNDO.
136 /* ************************ Frame Definitions *********************** */
138 DEFINE FRAME F-Main
139 rad_etype AT ROW 1 COL 11.29 NO-LABEL
140 cmb_esub AT ROW 2 COL 1 NO-LABEL
141 tgl_Inactive AT ROW 2 COL 38.14
142 tgl_all AT ROW 2 COL 49.57
143 sel_selection AT ROW 3 COL 1 NO-LABEL
144 btn_ok AT ROW 13.8 COL 1.57
145 btn_cancel AT ROW 13.8 COL 6.14
146 "Selection for:" VIEW-AS TEXT
147 SIZE 9.14 BY 1 AT ROW 1 COL 1.57
148 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
149 SIDE-LABELS NO-UNDERLINE THREE-D
150 AT COL 1 ROW 1 SCROLLABLE
151 FONT 10.
154 /* *********************** Procedure Settings ************************ */
156 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
157 /* Settings for THIS-PROCEDURE
158 Type: SmartViewer
159 Allow: Basic,DB-Fields
160 Frames: 1
161 Add Fields to: EXTERNAL-TABLES
162 Other Settings: PERSISTENT-ONLY COMPILE
165 /* This procedure should always be RUN PERSISTENT. Report the error, */
166 /* then cleanup and return. */
167 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
168 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
169 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
170 RETURN.
171 END.
173 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
175 /* ************************* Create Window ************************** */
177 &ANALYZE-SUSPEND _CREATE-WINDOW
178 /* DESIGN Window definition (used by the UIB)
179 CREATE WINDOW V-table-Win ASSIGN
180 HEIGHT = 13.95
181 WIDTH = 54.29.
182 /* END WINDOW DEFINITION */
184 &ANALYZE-RESUME
187 /* *************** Runtime Attributes and UIB Settings ************** */
189 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
190 /* SETTINGS FOR WINDOW V-table-Win
191 VISIBLE,,RUN-PERSISTENT */
192 /* SETTINGS FOR FRAME F-Main
193 NOT-VISIBLE Size-to-Fit */
194 ASSIGN
195 FRAME F-Main:SCROLLABLE = FALSE
196 FRAME F-Main:HIDDEN = TRUE.
198 /* SETTINGS FOR COMBO-BOX cmb_esub IN FRAME F-Main
199 ALIGN-L */
200 /* _RUN-TIME-ATTRIBUTES-END */
201 &ANALYZE-RESUME
204 /* Setting information for Queries and Browse Widgets fields */
206 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
207 /* Query rebuild information for FRAME F-Main
208 _Options = "NO-LOCK"
209 _Query is NOT OPENED
210 */ /* FRAME F-Main */
211 &ANALYZE-RESUME
216 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
217 /* ************************* Included-Libraries *********************** */
219 {src/adm/method/viewer.i}
220 {inc/method/m-mntvwr.i}
221 {inc/string.i}
223 /* _UIB-CODE-BLOCK-END */
224 &ANALYZE-RESUME
229 /* ************************ Control Triggers ************************ */
231 &Scoped-define SELF-NAME btn_cancel
232 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_cancel V-table-Win
233 ON CHOOSE OF btn_cancel IN FRAME F-Main /* Cancel */
235 RUN cancel-changes.
236 END.
238 /* _UIB-CODE-BLOCK-END */
239 &ANALYZE-RESUME
242 &Scoped-define SELF-NAME btn_ok
243 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_ok V-table-Win
244 ON CHOOSE OF btn_ok IN FRAME F-Main /* OK */
246 RUN confirm-changes.
247 END.
249 /* _UIB-CODE-BLOCK-END */
250 &ANALYZE-RESUME
253 &Scoped-define SELF-NAME cmb_esub
254 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_esub V-table-Win
255 ON VALUE-CHANGED OF cmb_esub IN FRAME F-Main
257 RUN get-selection( ?, ? ).
258 END.
260 /* _UIB-CODE-BLOCK-END */
261 &ANALYZE-RESUME
264 &Scoped-define SELF-NAME rad_etype
265 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL rad_etype V-table-Win
266 ON VALUE-CHANGED OF rad_etype IN FRAME F-Main
268 RUN entity-type-changed.
269 END.
271 /* _UIB-CODE-BLOCK-END */
272 &ANALYZE-RESUME
275 &Scoped-define SELF-NAME sel_selection
276 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL sel_selection V-table-Win
277 ON VALUE-CHANGED OF sel_selection IN FRAME F-Main
279 IF AVAILABLE EntSel THEN EntSel.SV = SELF:SCREEN-VALUE.
280 END.
282 /* _UIB-CODE-BLOCK-END */
283 &ANALYZE-RESUME
286 &Scoped-define SELF-NAME tgl_all
287 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL tgl_all V-table-Win
288 ON VALUE-CHANGED OF tgl_all IN FRAME F-Main /* All */
290 RUN all-changed.
291 END.
293 /* _UIB-CODE-BLOCK-END */
294 &ANALYZE-RESUME
297 &Scoped-define SELF-NAME tgl_Inactive
298 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL tgl_Inactive V-table-Win
299 ON VALUE-CHANGED OF tgl_Inactive IN FRAME F-Main /* Inactives */
301 ASSIGN FRAME {&FRAME-NAME} tgl_Inactive .
302 DELETE EntSel.
303 RUN get-selection( ?, ? ).
304 END.
306 /* _UIB-CODE-BLOCK-END */
307 &ANALYZE-RESUME
310 &UNDEFINE SELF-NAME
312 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
315 /* *************************** Main Block *************************** */
317 &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
318 RUN dispatch IN THIS-PROCEDURE ('initialize':U).
319 &ENDIF
321 /************************ INTERNAL PROCEDURES ********************/
323 /* _UIB-CODE-BLOCK-END */
324 &ANALYZE-RESUME
327 /* ********************** Internal Procedures *********************** */
329 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
330 PROCEDURE adm-row-available :
331 /*------------------------------------------------------------------------------
332 Purpose: Dispatched to this procedure when the Record-
333 Source has a new row available. This procedure
334 tries to get the new row (or foriegn keys) from
335 the Record-Source and process it.
336 Parameters: <none>
337 ------------------------------------------------------------------------------*/
339 /* Define variables needed by this internal procedure. */
340 {src/adm/template/row-head.i}
342 /* Process the newly available records (i.e. display fields,
343 open queries, and/or pass records on to any RECORD-TARGETS). */
344 {src/adm/template/row-end.i}
346 END PROCEDURE.
348 /* _UIB-CODE-BLOCK-END */
349 &ANALYZE-RESUME
352 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE all-changed V-table-Win
353 PROCEDURE all-changed :
354 /*------------------------------------------------------------------------------
355 Purpose:
356 Parameters: <none>
357 Notes:
358 ------------------------------------------------------------------------------*/
360 DO WITH FRAME {&FRAME-NAME}:
361 IF AVAILABLE EntSel THEN EntSel.SelAll = INPUT tgl_all.
362 sel_selection:SENSITIVE = NOT INPUT tgl_all.
363 END.
365 END PROCEDURE.
367 /* _UIB-CODE-BLOCK-END */
368 &ANALYZE-RESUME
371 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE cancel-changes V-table-Win
372 PROCEDURE cancel-changes :
373 /*------------------------------------------------------------------------------
374 Purpose:
375 Parameters: <none>
376 Notes:
377 ------------------------------------------------------------------------------*/
379 RUN dispatch( 'exit':u ).
381 END PROCEDURE.
383 /* _UIB-CODE-BLOCK-END */
384 &ANALYZE-RESUME
387 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE confirm-changes V-table-Win
388 PROCEDURE confirm-changes :
389 /*------------------------------------------------------------------------------
390 Purpose:
391 Parameters: <none>
392 Notes:
393 ------------------------------------------------------------------------------*/
395 DO WITH FRAME {&FRAME-NAME}:
397 DEF VAR i AS INT NO-UNDO.
399 FIND FIRST EntSel WHERE EntSel.EntityType = INPUT rad_etype
400 AND EntSel.SelectionID = REPLACE(INPUT cmb_esub, " ", "-")
401 NO-ERROR.
402 IF NOT AVAILABLE(EntSel) THEN DO:
403 MESSAGE INPUT rad_etype SKIP INPUT cmb_esub .
404 FOR EACH EntSel:
405 MESSAGE EntSel.EntityType EntSel.SelectionID .
406 END.
407 END.
409 entity-selection = EntSel.EntityType + "," + INPUT cmb_esub.
410 IF EntSel.SelALL THEN
411 entity-selection = entity-selection + ",ALL".
412 ELSE DO i = 1 TO NUM-ENTRIES( EntSel.SV, list-delim ):
413 entity-selection = entity-selection + ","
414 + ENTRY( LOOKUP( ENTRY( i, EntSel.SV, list-delim ), EntSel.LI, list-delim ), EntSel.PD ).
415 END.
417 RUN get-rec-src.
418 RUN update-entity-selection IN rec-src ( entity-selection ) NO-ERROR.
419 RUN dispatch( 'exit':U ).
421 END.
423 END PROCEDURE.
425 /* _UIB-CODE-BLOCK-END */
426 &ANALYZE-RESUME
429 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
430 PROCEDURE disable_UI :
431 /*------------------------------------------------------------------------------
432 Purpose: DISABLE the User Interface
433 Parameters: <none>
434 Notes: Here we clean-up the user-interface by deleting
435 dynamic widgets we have created and/or hide
436 frames. This procedure is usually called when
437 we are ready to "clean-up" after running.
438 ------------------------------------------------------------------------------*/
439 /* Hide all frames. */
440 HIDE FRAME F-Main.
441 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
442 END PROCEDURE.
444 /* _UIB-CODE-BLOCK-END */
445 &ANALYZE-RESUME
448 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE entity-type-changed V-table-Win
449 PROCEDURE entity-type-changed :
450 /*------------------------------------------------------------------------------
451 Purpose:
452 Parameters: <none>
453 Notes:
454 ------------------------------------------------------------------------------*/
456 DEF VAR entity-type AS CHAR NO-UNDO.
457 DEF VAR i AS INT NO-UNDO.
458 DEF VAR id-list AS CHAR NO-UNDO.
459 DEF VAR proc-id AS CHAR NO-UNDO.
460 DEF VAR ie AS CHAR NO-UNDO.
461 DEF VAR proc-entry AS CHAR NO-UNDO.
463 ie = THIS-PROCEDURE:INTERNAL-ENTRIES.
464 entity-type = INPUT FRAME {&FRAME-NAME} rad_etype.
466 DO i = 1 TO NUM-ENTRIES( ie ):
467 proc-entry = ENTRY( i, ie ).
468 IF ENTRY( 1, proc-entry, '-' ) = 'get' AND
469 ENTRY( NUM-ENTRIES( proc-entry, '-' ), proc-entry, '-' ) = entity-type THEN
471 proc-id = REPLACE( SUBSTR( proc-entry, 5 ), "-" + entity-type, "" ).
472 proc-id = REPLACE( proc-id, '-', ' ' ).
473 add-to-list( id-list, proc-id ).
474 END.
475 END.
477 cmb_esub:LIST-ITEMS IN FRAME {&FRAME-NAME} = id-list.
479 IF src-et = entity-type AND cmb_esub:LOOKUP(src-esub) > 0 THEN
480 cmb_esub:SCREEN-VALUE = src-esub.
481 ELSE
482 cmb_esub:SCREEN-VALUE = cmb_esub:ENTRY(1).
484 RUN get-selection( entity-type, REPLACE( cmb_esub:SCREEN-VALUE, " ", "-" ) ).
486 END PROCEDURE.
488 /* _UIB-CODE-BLOCK-END */
489 &ANALYZE-RESUME
492 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-Companies-L V-table-Win
493 PROCEDURE get-Companies-L :
494 /*------------------------------------------------------------------------------
495 Purpose:
496 Parameters: <none>
497 Notes:
498 ------------------------------------------------------------------------------*/
500 FOR EACH Company WHERE Company.Active OR tgl_Inactive
501 NO-LOCK:
502 add-to-list-delim( sub-li, STRING( Company.CompanyCode, "9999" ) + " - " + Company.LegalName, list-delim ).
503 add-to-list( sub-pd, STRING( Company.CompanyCode ) ).
504 END.
506 END PROCEDURE.
508 /* _UIB-CODE-BLOCK-END */
509 &ANALYZE-RESUME
512 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-Portfolios-P V-table-Win
513 PROCEDURE get-Portfolios-P :
514 /*------------------------------------------------------------------------------
515 Purpose:
516 Parameters: <none>
517 Notes:
518 ------------------------------------------------------------------------------*/
520 FOR EACH Property WHERE Property.Active OR tgl_Inactive
521 NO-LOCK BREAK BY Property.Manager:
523 IF FIRST-OF( Property.Manager ) THEN
525 FIND Person WHERE Person.PersonCode = Property.Manager NO-LOCK NO-ERROR.
526 add-to-list-delim( sub-li, IF AVAILABLE Person
527 THEN TRIM( Person.FirstName + ' ' + Person.LastName )
528 ELSE 'Not in a Portfolio', list-delim ).
529 add-to-list( sub-pd, STRING( Property.Administrator ) ).
530 END.
532 END.
534 END PROCEDURE.
536 /* _UIB-CODE-BLOCK-END */
537 &ANALYZE-RESUME
540 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-Projects-J V-table-Win
541 PROCEDURE get-Projects-J :
542 /*------------------------------------------------------------------------------
543 Purpose:
544 Parameters: <none>
545 Notes:
546 ------------------------------------------------------------------------------*/
548 FOR EACH Project NO-LOCK:
549 add-to-list-delim( sub-li, STRING( Project.ProjectCode, "99999" ) + " - " + Project.Name, list-delim ).
550 add-to-list( sub-pd, STRING( Project.ProjectCode ) ).
551 END.
553 END PROCEDURE.
555 /* _UIB-CODE-BLOCK-END */
556 &ANALYZE-RESUME
559 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-Properties-P V-table-Win
560 PROCEDURE get-Properties-P :
561 /*------------------------------------------------------------------------------
562 Purpose:
563 Parameters: <none>
564 Notes:
565 ------------------------------------------------------------------------------*/
567 FOR EACH Property WHERE Property.Active OR tgl_Inactive
568 NO-LOCK:
569 add-to-list-delim( sub-li, STRING( Property.PropertyCode, "99999" ) + " - " + ( IF Property.Name = ? THEN "?" ELSE Property.Name ), list-delim ).
570 add-to-list( sub-pd, STRING( Property.PropertyCode ) ).
571 END.
573 END PROCEDURE.
575 /* _UIB-CODE-BLOCK-END */
576 &ANALYZE-RESUME
579 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-Property-Managers-P V-table-Win
580 PROCEDURE get-Property-Managers-P :
581 /*------------------------------------------------------------------------------
582 Purpose:
583 Parameters: <none>
584 Notes:
585 ------------------------------------------------------------------------------*/
587 FOR EACH Property WHERE Property.Active OR tgl_Inactive
588 NO-LOCK BREAK BY Property.Administrator:
590 IF FIRST-OF( Property.Administrator ) THEN DO:
591 FIND Person WHERE Person.PersonCode = Property.Administrator NO-LOCK NO-ERROR.
592 add-to-list-delim( sub-li, IF AVAILABLE Person
593 THEN TRIM( Person.FirstName + ' ' + Person.LastName )
594 ELSE 'Not managed', list-delim ).
595 add-to-list( sub-pd, STRING( Property.Administrator ) ).
596 END.
598 END.
600 END PROCEDURE.
602 /* _UIB-CODE-BLOCK-END */
603 &ANALYZE-RESUME
606 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-rec-src V-table-Win
607 PROCEDURE get-rec-src :
608 /*------------------------------------------------------------------------------
609 Purpose:
610 Parameters: <none>
611 Notes:
612 ------------------------------------------------------------------------------*/
614 DEF VAR c-rec-src AS CHAR NO-UNDO.
616 IF VALID-HANDLE( rec-src ) THEN RETURN.
617 RUN get-link-handle IN adm-broker-hdl( THIS-PROCEDURE, 'RECORD-SOURCE', OUTPUT c-rec-src ).
618 ASSIGN rec-src = WIDGET-HANDLE( c-rec-src ) NO-ERROR.
620 END PROCEDURE.
622 /* _UIB-CODE-BLOCK-END */
623 &ANALYZE-RESUME
626 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-Regions-P V-table-Win
627 PROCEDURE get-Regions-P :
628 /*------------------------------------------------------------------------------
629 Purpose:
630 Parameters: <none>
631 Notes:
632 ------------------------------------------------------------------------------*/
634 FOR EACH Region NO-LOCK:
635 add-to-list-delim( sub-li, Region.Region + " - " + Region.Name, list-delim ).
636 add-to-list( sub-pd, Region.Region ).
637 END.
639 END PROCEDURE.
641 /* _UIB-CODE-BLOCK-END */
642 &ANALYZE-RESUME
645 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-selection V-table-Win
646 PROCEDURE get-selection :
647 /*------------------------------------------------------------------------------
648 Purpose:
649 Parameters: <none>
650 Notes:
651 ------------------------------------------------------------------------------*/
652 DEF INPUT PARAMETER entity-type AS CHAR NO-UNDO.
653 DEF INPUT PARAMETER selection-id AS CHAR NO-UNDO.
655 DO WITH FRAME {&FRAME-NAME}:
657 IF entity-type = ? THEN entity-type = INPUT rad_etype.
658 IF selection-id = ? THEN selection-id = REPLACE( cmb_esub:SCREEN-VALUE, " ", "-" ).
660 FIND FIRST EntSel WHERE EntSel.EntityType = entity-type
661 AND EntSel.SelectionID = selection-id NO-ERROR.
663 IF NOT AVAILABLE EntSel THEN DO:
664 sub-sv = "". sub-pd = "". sub-li = "". sub-all = No.
665 RUN VALUE( "get-" + selection-id + "-" + entity-type ) IN THIS-PROCEDURE NO-ERROR.
666 IF NOT ERROR-STATUS:ERROR THEN DO:
667 RUN get-sv( selection-id ).
668 CREATE EntSel.
669 ASSIGN
670 EntSel.EntityType = entity-type
671 EntSel.SelectionID = selection-id
672 EntSel.LI = sub-li
673 EntSel.SV = sub-sv
674 EntSel.PD = sub-pd
675 EntSel.SelAll = sub-all.
676 END.
677 END.
679 sel_selection:DELIMITER = list-delim.
680 sel_selection:LIST-ITEMS = EntSel.LI.
681 sel_selection:PRIVATE-DATA = EntSel.PD.
682 sel_selection:SCREEN-VALUE = EntSel.SV.
683 tgl_all:SCREEN-VALUE = STRING( EntSel.SelAll ).
685 RUN all-changed.
687 END.
689 END PROCEDURE.
691 /* _UIB-CODE-BLOCK-END */
692 &ANALYZE-RESUME
695 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-sv V-table-Win
696 PROCEDURE get-sv :
697 /*------------------------------------------------------------------------------
698 Purpose:
699 Parameters: <none>
700 Notes:
701 ------------------------------------------------------------------------------*/
702 DEF INPUT PARAMETER selection-id AS CHAR NO-UNDO.
704 DEF VAR options AS CHAR NO-UNDO.
705 DEF VAR option-id AS CHAR NO-UNDO.
706 DEF VAR option-et AS CHAR NO-UNDO.
707 DEF VAR option-val AS CHAR NO-UNDO.
708 DEF VAR option-idx AS INT NO-UNDO.
709 DEF VAR i AS INT NO-UNDO.
710 DEF VAR found AS LOGI NO-UNDO INIT No.
712 sub-sv = "".
714 option-et = ENTRY( 1, entity-selection).
715 options = SUBSTRING( entity-selection, LENGTH(option-et) + 2 ).
717 option-id = ENTRY( 1, options).
718 found = (REPLACE(option-id, " ", "-") = selection-id).
719 IF NOT found THEN RETURN.
721 options = SUBSTRING( options, LENGTH(option-id) + 2 ).
722 sub-all = options = "ALL".
723 IF sub-all THEN RETURN.
725 DO i = 1 TO NUM-ENTRIES( options ):
726 option-val = ENTRY( i, options ).
727 option-idx = LOOKUP( option-val, sub-pd ).
728 IF option-idx > 0 THEN add-to-list-delim( sub-sv, ENTRY( option-idx, sub-li, list-delim ), list-delim ).
729 END.
731 END PROCEDURE.
733 /* _UIB-CODE-BLOCK-END */
734 &ANALYZE-RESUME
737 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-display-fields V-table-Win
738 PROCEDURE inst-display-fields :
739 /*------------------------------------------------------------------------------
740 Purpose:
741 Parameters: <none>
742 Notes:
743 ------------------------------------------------------------------------------*/
745 RUN entity-type-changed.
747 END PROCEDURE.
749 /* _UIB-CODE-BLOCK-END */
750 &ANALYZE-RESUME
753 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
754 PROCEDURE pre-destroy :
755 /*------------------------------------------------------------------------------
756 Purpose:
757 Parameters: <none>
758 Notes:
759 ------------------------------------------------------------------------------*/
761 IF LAST-EVENT:FUNCTION = "WINDOW-CLOSE" THEN RUN cancel-changes.
763 END PROCEDURE.
765 /* _UIB-CODE-BLOCK-END */
766 &ANALYZE-RESUME
769 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-initialize V-table-Win
770 PROCEDURE pre-initialize :
771 /*------------------------------------------------------------------------------
772 Purpose:
773 Parameters: <none>
774 Notes:
775 ------------------------------------------------------------------------------*/
777 RUN retrieve-entities.
779 END PROCEDURE.
781 /* _UIB-CODE-BLOCK-END */
782 &ANALYZE-RESUME
785 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE retrieve-entities V-table-Win
786 PROCEDURE retrieve-entities :
787 /*------------------------------------------------------------------------------
788 Purpose: Get the entity desctiption string from the record source.
789 Parameters: <none>
790 Notes:
791 ------------------------------------------------------------------------------*/
792 RUN get-rec-src.
793 RUN send-entity-selection IN rec-src( OUTPUT entity-selection ) NO-ERROR.
795 src-et = ENTRY( 1, entity-selection ).
796 IF NUM-ENTRIES( entity-selection ) > 1 THEN
797 src-esub = ENTRY( 2, entity-selection ).
799 IF TRIM(src-et) <> "" THEN DO:
800 rad_etype = src-et.
801 DISPLAY rad_etype WITH FRAME {&FRAME-NAME}.
802 END.
804 END PROCEDURE.
806 /* _UIB-CODE-BLOCK-END */
807 &ANALYZE-RESUME
810 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
811 PROCEDURE send-records :
812 /*------------------------------------------------------------------------------
813 Purpose: Send record ROWID's for all tables used by
814 this file.
815 Parameters: see template/snd-head.i
816 ------------------------------------------------------------------------------*/
818 /* SEND-RECORDS does nothing because there are no External
819 Tables specified for this SmartViewer, and there are no
820 tables specified in any contained Browse, Query, or Frame. */
822 END PROCEDURE.
824 /* _UIB-CODE-BLOCK-END */
825 &ANALYZE-RESUME
828 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
829 PROCEDURE state-changed :
830 /* -----------------------------------------------------------
831 Purpose:
832 Parameters: <none>
833 Notes:
834 -------------------------------------------------------------*/
835 DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
836 DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
838 CASE p-state:
839 /* Object instance CASEs can go here to replace standard behavior
840 or add new cases. */
841 {src/adm/template/vstates.i}
842 END CASE.
843 END PROCEDURE.
845 /* _UIB-CODE-BLOCK-END */
846 &ANALYZE-RESUME
849 /* ************************ Function Implementations ***************** */
851 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION retrieve-attribute V-table-Win
852 FUNCTION retrieve-attribute RETURNS CHARACTER
853 ( INPUT selection-id AS CHAR ) :
854 /*------------------------------------------------------------------------------
855 Purpose:
856 Notes:
857 ------------------------------------------------------------------------------*/
860 END FUNCTION.
862 /* _UIB-CODE-BLOCK-END */
863 &ANALYZE-RESUME