Added capital works blank section. Synced calling screen.
[capital-apms-progress.git] / process / one-off / amcmil.p
blob660c89da3d1758b2db763ca4dc7cd1ae60e878c7
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
2 &ANALYZE-RESUME
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
5 File :
6 Purpose :
8 Syntax :
10 Description :
12 Author(s) :
13 Created :
14 Notes :
15 ------------------------------------------------------------------------*/
16 /* This .W file was created with the Progress UIB. */
17 /*----------------------------------------------------------------------*/
19 /* *************************** Definitions ************************** */
21 /* _UIB-CODE-BLOCK-END */
22 &ANALYZE-RESUME
25 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
27 /* ******************** Preprocessor Definitions ******************** */
29 &Scoped-define PROCEDURE-TYPE Procedure
33 /* _UIB-PREPROCESSOR-BLOCK-END */
34 &ANALYZE-RESUME
38 /* *********************** Procedure Settings ************************ */
40 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
41 /* Settings for THIS-PROCEDURE
42 Type: Procedure
43 Allow:
44 Frames: 0
45 Add Fields to: Neither
46 Other Settings: CODE-ONLY COMPILE
48 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
50 /* ************************* Create Window ************************** */
52 &ANALYZE-SUSPEND _CREATE-WINDOW
53 /* DESIGN Window definition (used by the UIB)
54 CREATE WINDOW Procedure ASSIGN
55 HEIGHT = 2
56 WIDTH = 40.
57 /* END WINDOW DEFINITION */
59 &ANALYZE-RESUME
64 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
67 /* *************************** Main Block *************************** */
69 RUN copy-user( "Andrew", "amcmil" ).
71 /* _UIB-CODE-BLOCK-END */
72 &ANALYZE-RESUME
75 /* ********************** Internal Procedures *********************** */
77 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE copy-groups Procedure
78 PROCEDURE copy-groups :
79 /*------------------------------------------------------------------------------
80 Purpose:
81 ------------------------------------------------------------------------------*/
82 DEF INPUT PARAMETER old-user AS CHAR NO-UNDO.
83 DEF INPUT PARAMETER new-user AS CHAR NO-UNDO.
85 DEF BUFFER NewUGM FOR UsrGroupMember.
87 FOR EACH UsrGroupMember WHERE UsrGroupMember.UserName = old-user
88 AND UsrGroupMember.GroupName <> "Everyone" NO-LOCK:
89 CREATE NewUGM.
90 ASSIGN NewUGM.UserName = new-user
91 newUGM.GroupName = UsrGroupMember.GroupName .
92 END.
94 END PROCEDURE.
96 /* _UIB-CODE-BLOCK-END */
97 &ANALYZE-RESUME
100 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE copy-user Procedure
101 PROCEDURE copy-user :
102 /*------------------------------------------------------------------------------
103 Purpose:
104 ------------------------------------------------------------------------------*/
105 DEF INPUT PARAMETER old-name AS CHAR NO-UNDO.
106 DEF INPUT PARAMETER new-name AS CHAR NO-UNDO.
108 DEF BUFFER old-u FOR Usr.
110 FIND Usr WHERE Usr.UserName = new-name NO-ERROR.
111 IF NOT AVAILABLE(Usr) THEN DO:
112 FIND old-u WHERE old-u.UserName = old-name NO-LOCK.
113 CREATE Usr.
114 ASSIGN Usr.UserName = new-name
115 Usr.PersonCode = old-u.PersonCode + 1
116 Usr.Abbreviation = old-u.Abbreviation + "X".
117 END.
119 RUN copy-groups( old-name, new-name ).
121 END PROCEDURE.
123 /* _UIB-CODE-BLOCK-END */
124 &ANALYZE-RESUME