When processing by company, list in creditor/voucher sequence.
[capital-apms-progress.git] / workflow / b-flow-step.w
blobfd421e084a9a7be15ba3c50f58b5cea0b9a57815
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 /*------------------------------------------------------------------------
10 File: workflow/b-flow-task.w
12 Description: Browser for work flow tasks
14 Input Parameters:
15 <none>
17 Output Parameters:
18 <none>
20 ------------------------------------------------------------------------*/
22 CREATE WIDGET-POOL.
24 /* *************************** Definitions ************************** */
26 {inc/topic/tpflwtsk.i}
28 DEF VAR entity-type-filter AS CHAR NO-UNDO INITIAL "".
30 /* _UIB-CODE-BLOCK-END */
31 &ANALYZE-RESUME
34 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
36 /* ******************** Preprocessor Definitions ******************** */
38 &Scoped-define PROCEDURE-TYPE SmartBrowser
40 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
42 /* Name of first Frame and/or Browse and/or first Query */
43 &Scoped-define FRAME-NAME F-Main
44 &Scoped-define BROWSE-NAME br_table
46 /* External Tables */
47 &Scoped-define EXTERNAL-TABLES FlowTask
48 &Scoped-define FIRST-EXTERNAL-TABLE FlowTask
51 /* Need to scope the external tables to this procedure */
52 DEFINE QUERY external_tables FOR FlowTask.
53 /* Internal Tables (found by Frame, Query & Browse Queries) */
54 &Scoped-define INTERNAL-TABLES FlowStep
56 /* Define KEY-PHRASE in case it is used by any query. */
57 &Scoped-define KEY-PHRASE TRUE
59 /* Definitions for BROWSE br_table */
60 &Scoped-define FIELDS-IN-QUERY-br_table FlowStep.StepDueDate ~
61 FlowStep.NotifyDate FlowStep.Priority FlowStep.ActivityStatus ~
62 FlowStep.FlowTaskType FlowStep.FlowStepType FlowStep.EntityType ~
63 FlowStep.EntityCode FlowStep.Description
64 &Scoped-define ENABLED-FIELDS-IN-QUERY-br_table
65 &Scoped-define FIELD-PAIRS-IN-QUERY-br_table
66 &Scoped-define OPEN-QUERY-br_table OPEN QUERY br_table FOR EACH FlowStep OF FlowTask WHERE ~{&KEY-PHRASE} NO-LOCK ~
67 ~{&SORTBY-PHRASE}.
68 &Scoped-define TABLES-IN-QUERY-br_table FlowStep
69 &Scoped-define FIRST-TABLE-IN-QUERY-br_table FlowStep
72 /* Definitions for FRAME F-Main */
74 /* Standard List Definitions */
75 &Scoped-Define ENABLED-OBJECTS br_table
77 /* Custom List Definitions */
78 /* List-1,List-2,List-3,List-4,List-5,List-6 */
80 /* _UIB-PREPROCESSOR-BLOCK-END */
81 &ANALYZE-RESUME
84 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Foreign Keys" B-table-Win _INLINE
85 /* Actions: ? adm/support/keyedit.w ? ? ? */
86 /* STRUCTURED-DATA
87 <KEY-OBJECT>
88 &BROWSE-NAME
89 </KEY-OBJECT>
90 <FOREIGN-KEYS>
91 Joblogno|y|y|TTPL.FlowTask.Joblogno
92 EntityCode|y|y|TTPL.FlowTask.EntityCode
93 ProjectCode|y|y|TTPL.FlowTask.EntityCode
94 TenantCode|y|y|TTPL.FlowTask.EntityCode
95 CompanyCode|y|y|TTPL.FlowTask.EntityCode
96 PropertyCode|y|y|TTPL.FlowTask.EntityCode
97 EntityType|y|y|TTPL.FlowTask.EntityType
98 PersonCode|y|y|TTPL.FlowTask.AllocatedTo
99 FlowTaskType|y|y|TTPL.FlowTask.FlowTaskType
100 </FOREIGN-KEYS>
101 <EXECUTING-CODE>
102 **************************
103 * Set attributes related to FOREIGN KEYS
105 RUN set-attribute-list (
106 'Keys-Accepted = "Joblogno,EntityCode,ProjectCode,TenantCode,CompanyCode,PropertyCode,EntityType,PersonCode,FlowTaskType",
107 Keys-Supplied = "Joblogno,EntityCode,ProjectCode,TenantCode,CompanyCode,PropertyCode,EntityType,PersonCode,FlowTaskType"':U).
109 /* Tell the ADM to use the OPEN-QUERY-CASES. */
110 &Scoped-define OPEN-QUERY-CASES RUN dispatch ('open-query-cases':U).
111 /**************************
112 </EXECUTING-CODE> */
113 /* _UIB-CODE-BLOCK-END */
114 &ANALYZE-RESUME
116 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Advanced Query Options" B-table-Win _INLINE
117 /* Actions: ? adm/support/advqedit.w ? ? ? */
118 /* STRUCTURED-DATA
119 <KEY-OBJECT>
120 &BROWSE-NAME
121 </KEY-OBJECT>
122 <SORTBY-OPTIONS>
123 Due Date|y||TTPL.FlowTask.DueDate|yes
124 Entity|||TTPL.FlowTask.EntityType|yes,TTPL.FlowTask.EntityCode|yes
125 </SORTBY-OPTIONS>
126 <SORTBY-RUN-CODE>
127 ************************
128 * Set attributes related to SORTBY-OPTIONS */
129 RUN set-attribute-list (
130 'SortBy-Options = "Due Date,Entity",
131 SortBy-Case = Due Date':U).
133 /* Tell the ADM to use the OPEN-QUERY-CASES. */
134 &Scoped-define OPEN-QUERY-CASES RUN dispatch ('open-query-cases':U).
136 /* This SmartObject is a valid SortBy-Target. */
137 &IF '{&user-supported-links}':U ne '':U &THEN
138 &Scoped-define user-supported-links {&user-supported-links},SortBy-Target
139 &ELSE
140 &Scoped-define user-supported-links SortBy-Target
141 &ENDIF
143 /************************
144 </SORTBY-RUN-CODE>
145 <FILTER-ATTRIBUTES>
146 </FILTER-ATTRIBUTES> */
148 /* _UIB-CODE-BLOCK-END */
149 &ANALYZE-RESUME
152 /* *********************** Control Definitions ********************** */
155 /* Definitions of the field level widgets */
156 /* Query definitions */
157 &ANALYZE-SUSPEND
158 DEFINE QUERY br_table FOR
159 FlowStep SCROLLING.
160 &ANALYZE-RESUME
162 /* Browse definitions */
163 DEFINE BROWSE br_table
164 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _DISPLAY-FIELDS br_table B-table-Win _STRUCTURED
165 QUERY br_table NO-LOCK DISPLAY
166 FlowStep.StepDueDate COLUMN-LABEL "Step Due On"
167 FlowStep.NotifyDate COLUMN-LABEL " Notify After"
168 FlowStep.Priority COLUMN-LABEL "Pri"
169 FlowStep.ActivityStatus COLUMN-LABEL "Status"
170 FlowStep.FlowTaskType COLUMN-LABEL " Task"
171 FlowStep.FlowStepType COLUMN-LABEL "Step Type"
172 FlowStep.EntityType COLUMN-LABEL "T"
173 FlowStep.EntityCode COLUMN-LABEL " Entity" FORMAT "99999"
174 FlowStep.Description
175 /* _UIB-CODE-BLOCK-END */
176 &ANALYZE-RESUME
177 WITH NO-ASSIGN SEPARATORS SIZE 85.72 BY 12.4
178 BGCOLOR 16 .
181 /* ************************ Frame Definitions *********************** */
183 DEFINE FRAME F-Main
184 br_table AT ROW 1 COL 1
185 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
186 SIDE-LABELS NO-UNDERLINE THREE-D
187 AT COL 1 ROW 1 SCROLLABLE
188 BGCOLOR 8 FGCOLOR 0 .
191 /* *********************** Procedure Settings ************************ */
193 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
194 /* Settings for THIS-PROCEDURE
195 Type: SmartBrowser
196 External Tables: TTPL.FlowTask
197 Allow: Basic,Browse
198 Frames: 1
199 Add Fields to: EXTERNAL-TABLES
200 Other Settings: PERSISTENT-ONLY COMPILE
203 /* This procedure should always be RUN PERSISTENT. Report the error, */
204 /* then cleanup and return. */
205 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
206 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
207 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
208 RETURN.
209 END.
211 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
213 /* ************************* Create Window ************************** */
215 &ANALYZE-SUSPEND _CREATE-WINDOW
216 /* DESIGN Window definition (used by the UIB)
217 CREATE WINDOW B-table-Win ASSIGN
218 HEIGHT = 19.05
219 WIDTH = 89.
220 /* END WINDOW DEFINITION */
222 &ANALYZE-RESUME
225 /* *************** Runtime Attributes and UIB Settings ************** */
227 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
228 /* SETTINGS FOR WINDOW B-table-Win
229 NOT-VISIBLE,,RUN-PERSISTENT */
230 /* SETTINGS FOR FRAME F-Main
231 NOT-VISIBLE Size-to-Fit */
232 /* BROWSE-TAB br_table 1 F-Main */
233 ASSIGN
234 FRAME F-Main:SCROLLABLE = FALSE
235 FRAME F-Main:HIDDEN = TRUE.
237 /* _RUN-TIME-ATTRIBUTES-END */
238 &ANALYZE-RESUME
241 /* Setting information for Queries and Browse Widgets fields */
243 &ANALYZE-SUSPEND _QUERY-BLOCK BROWSE br_table
244 /* Query rebuild information for BROWSE br_table
245 _TblList = "TTPL.FlowStep OF TTPL.FlowTask"
246 _Options = "NO-LOCK KEY-PHRASE SORTBY-PHRASE"
247 _TblOptList = ", OUTER"
248 _FldNameList[1] > TTPL.FlowStep.StepDueDate
249 "FlowStep.StepDueDate" "Step Due On" ? "date" ? ? ? ? ? ? no ?
250 _FldNameList[2] > TTPL.FlowStep.NotifyDate
251 "FlowStep.NotifyDate" " Notify After" ? "date" ? ? ? ? ? ? no ?
252 _FldNameList[3] > TTPL.FlowStep.Priority
253 "FlowStep.Priority" "Pri" ? "integer" ? ? ? ? ? ? no ?
254 _FldNameList[4] > TTPL.FlowStep.ActivityStatus
255 "FlowStep.ActivityStatus" "Status" ? "character" ? ? ? ? ? ? no ?
256 _FldNameList[5] > TTPL.FlowStep.FlowTaskType
257 "FlowStep.FlowTaskType" " Task" ? "character" ? ? ? ? ? ? no ?
258 _FldNameList[6] > TTPL.FlowStep.FlowStepType
259 "FlowStep.FlowStepType" "Step Type" ? "character" ? ? ? ? ? ? no ?
260 _FldNameList[7] > TTPL.FlowStep.EntityType
261 "FlowStep.EntityType" "T" ? "character" ? ? ? ? ? ? no ?
262 _FldNameList[8] > TTPL.FlowStep.EntityCode
263 "FlowStep.EntityCode" " Entity" "99999" "integer" ? ? ? ? ? ? no ?
264 _FldNameList[9] = TTPL.FlowStep.Description
265 _Query is NOT OPENED
266 */ /* BROWSE br_table */
267 &ANALYZE-RESUME
269 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
270 /* Query rebuild information for FRAME F-Main
271 _Options = "NO-LOCK"
272 _Query is NOT OPENED
273 */ /* FRAME F-Main */
274 &ANALYZE-RESUME
279 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB B-table-Win
280 /* ************************* Included-Libraries *********************** */
282 {src/adm/method/browser.i}
283 {inc/method/m-drlvwr.i}
285 /* _UIB-CODE-BLOCK-END */
286 &ANALYZE-RESUME
291 /* ************************ Control Triggers ************************ */
293 &Scoped-define BROWSE-NAME br_table
294 &Scoped-define SELF-NAME br_table
295 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
296 ON ROW-ENTRY OF br_table IN FRAME F-Main
298 /* This code displays initial values for newly added or copied rows. */
299 {src/adm/template/brsentry.i}
300 END.
302 /* _UIB-CODE-BLOCK-END */
303 &ANALYZE-RESUME
306 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
307 ON ROW-LEAVE OF br_table IN FRAME F-Main
309 /* Do not disable this code or no updates will take place except
310 by pressing the Save button on an Update SmartPanel. */
311 {src/adm/template/brsleave.i}
312 END.
314 /* _UIB-CODE-BLOCK-END */
315 &ANALYZE-RESUME
318 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
319 ON VALUE-CHANGED OF br_table IN FRAME F-Main
321 /* This ADM trigger code must be preserved in order to notify other
322 objects when the browser's current row changes. */
323 {src/adm/template/brschnge.i}
324 END.
326 /* _UIB-CODE-BLOCK-END */
327 &ANALYZE-RESUME
330 &UNDEFINE SELF-NAME
332 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK B-table-Win
335 /* *************************** Main Block *************************** */
337 RUN set-attribute-list( 'SortBy-Options = Due Date|Entity, SortBy-Case = Due Date':U ).
338 RUN set-attribute-list( 'FilterBy-Options = All|To do|Completed, FilterBy-Case = To do':U ).
339 RUN set-attribute-list( 'SearchBy-Case = ':U ).
341 /* _UIB-CODE-BLOCK-END */
342 &ANALYZE-RESUME
345 /* ********************** Internal Procedures *********************** */
347 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-open-query-cases B-table-Win adm/support/_adm-opn.p
348 PROCEDURE adm-open-query-cases :
349 /*------------------------------------------------------------------------------
350 Purpose: Opens different cases of the query based on attributes
351 such as the 'Key-Name', or 'SortBy-Case'
352 Parameters: <none>
353 ------------------------------------------------------------------------------*/
354 DEF VAR key-value AS CHAR NO-UNDO.
356 /* Look up the current key-value. */
357 RUN get-attribute ('Key-Value':U).
358 key-value = RETURN-VALUE.
360 /* Find the current record using the current Key-Name. */
361 RUN get-attribute ('Key-Name':U).
362 CASE RETURN-VALUE:
363 WHEN 'Joblogno':U THEN DO:
364 &Scope KEY-PHRASE FlowTask.Joblogno eq INTEGER(key-value)
365 RUN get-attribute ('SortBy-Case':U).
366 CASE RETURN-VALUE:
367 WHEN 'Due Date':U THEN DO:
368 &Scope SORTBY-PHRASE BY FlowTask.DueDate
369 {&OPEN-QUERY-{&BROWSE-NAME}}
370 END.
371 WHEN 'Entity':U THEN DO:
372 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
373 {&OPEN-QUERY-{&BROWSE-NAME}}
374 END.
375 OTHERWISE DO:
376 &Undefine SORTBY-PHRASE
377 {&OPEN-QUERY-{&BROWSE-NAME}}
378 END. /* OTHERWISE...*/
379 END CASE.
380 END. /* Joblogno */
381 WHEN 'EntityCode':U THEN DO:
382 &Scope KEY-PHRASE FlowTask.EntityCode eq INTEGER(key-value)
383 RUN get-attribute ('SortBy-Case':U).
384 CASE RETURN-VALUE:
385 WHEN 'Due Date':U THEN DO:
386 &Scope SORTBY-PHRASE BY FlowTask.DueDate
387 {&OPEN-QUERY-{&BROWSE-NAME}}
388 END.
389 WHEN 'Entity':U THEN DO:
390 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
391 {&OPEN-QUERY-{&BROWSE-NAME}}
392 END.
393 OTHERWISE DO:
394 &Undefine SORTBY-PHRASE
395 {&OPEN-QUERY-{&BROWSE-NAME}}
396 END. /* OTHERWISE...*/
397 END CASE.
398 END. /* EntityCode */
399 WHEN 'ProjectCode':U THEN DO:
400 &Scope KEY-PHRASE FlowTask.EntityCode eq INTEGER(key-value)
401 RUN get-attribute ('SortBy-Case':U).
402 CASE RETURN-VALUE:
403 WHEN 'Due Date':U THEN DO:
404 &Scope SORTBY-PHRASE BY FlowTask.DueDate
405 {&OPEN-QUERY-{&BROWSE-NAME}}
406 END.
407 WHEN 'Entity':U THEN DO:
408 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
409 {&OPEN-QUERY-{&BROWSE-NAME}}
410 END.
411 OTHERWISE DO:
412 &Undefine SORTBY-PHRASE
413 {&OPEN-QUERY-{&BROWSE-NAME}}
414 END. /* OTHERWISE...*/
415 END CASE.
416 END. /* ProjectCode */
417 WHEN 'TenantCode':U THEN DO:
418 &Scope KEY-PHRASE FlowTask.EntityCode eq INTEGER(key-value)
419 RUN get-attribute ('SortBy-Case':U).
420 CASE RETURN-VALUE:
421 WHEN 'Due Date':U THEN DO:
422 &Scope SORTBY-PHRASE BY FlowTask.DueDate
423 {&OPEN-QUERY-{&BROWSE-NAME}}
424 END.
425 WHEN 'Entity':U THEN DO:
426 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
427 {&OPEN-QUERY-{&BROWSE-NAME}}
428 END.
429 OTHERWISE DO:
430 &Undefine SORTBY-PHRASE
431 {&OPEN-QUERY-{&BROWSE-NAME}}
432 END. /* OTHERWISE...*/
433 END CASE.
434 END. /* TenantCode */
435 WHEN 'CompanyCode':U THEN DO:
436 &Scope KEY-PHRASE FlowTask.EntityCode eq INTEGER(key-value)
437 RUN get-attribute ('SortBy-Case':U).
438 CASE RETURN-VALUE:
439 WHEN 'Due Date':U THEN DO:
440 &Scope SORTBY-PHRASE BY FlowTask.DueDate
441 {&OPEN-QUERY-{&BROWSE-NAME}}
442 END.
443 WHEN 'Entity':U THEN DO:
444 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
445 {&OPEN-QUERY-{&BROWSE-NAME}}
446 END.
447 OTHERWISE DO:
448 &Undefine SORTBY-PHRASE
449 {&OPEN-QUERY-{&BROWSE-NAME}}
450 END. /* OTHERWISE...*/
451 END CASE.
452 END. /* CompanyCode */
453 WHEN 'PropertyCode':U THEN DO:
454 &Scope KEY-PHRASE FlowTask.EntityCode eq INTEGER(key-value)
455 RUN get-attribute ('SortBy-Case':U).
456 CASE RETURN-VALUE:
457 WHEN 'Due Date':U THEN DO:
458 &Scope SORTBY-PHRASE BY FlowTask.DueDate
459 {&OPEN-QUERY-{&BROWSE-NAME}}
460 END.
461 WHEN 'Entity':U THEN DO:
462 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
463 {&OPEN-QUERY-{&BROWSE-NAME}}
464 END.
465 OTHERWISE DO:
466 &Undefine SORTBY-PHRASE
467 {&OPEN-QUERY-{&BROWSE-NAME}}
468 END. /* OTHERWISE...*/
469 END CASE.
470 END. /* PropertyCode */
471 WHEN 'EntityType':U THEN DO:
472 &Scope KEY-PHRASE FlowTask.EntityType eq key-value
473 RUN get-attribute ('SortBy-Case':U).
474 CASE RETURN-VALUE:
475 WHEN 'Due Date':U THEN DO:
476 &Scope SORTBY-PHRASE BY FlowTask.DueDate
477 {&OPEN-QUERY-{&BROWSE-NAME}}
478 END.
479 WHEN 'Entity':U THEN DO:
480 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
481 {&OPEN-QUERY-{&BROWSE-NAME}}
482 END.
483 OTHERWISE DO:
484 &Undefine SORTBY-PHRASE
485 {&OPEN-QUERY-{&BROWSE-NAME}}
486 END. /* OTHERWISE...*/
487 END CASE.
488 END. /* EntityType */
489 WHEN 'PersonCode':U THEN DO:
490 &Scope KEY-PHRASE FlowTask.AllocatedTo eq INTEGER(key-value)
491 RUN get-attribute ('SortBy-Case':U).
492 CASE RETURN-VALUE:
493 WHEN 'Due Date':U THEN DO:
494 &Scope SORTBY-PHRASE BY FlowTask.DueDate
495 {&OPEN-QUERY-{&BROWSE-NAME}}
496 END.
497 WHEN 'Entity':U THEN DO:
498 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
499 {&OPEN-QUERY-{&BROWSE-NAME}}
500 END.
501 OTHERWISE DO:
502 &Undefine SORTBY-PHRASE
503 {&OPEN-QUERY-{&BROWSE-NAME}}
504 END. /* OTHERWISE...*/
505 END CASE.
506 END. /* PersonCode */
507 WHEN 'FlowTaskType':U THEN DO:
508 &Scope KEY-PHRASE FlowTask.FlowTaskType eq key-value
509 RUN get-attribute ('SortBy-Case':U).
510 CASE RETURN-VALUE:
511 WHEN 'Due Date':U THEN DO:
512 &Scope SORTBY-PHRASE BY FlowTask.DueDate
513 {&OPEN-QUERY-{&BROWSE-NAME}}
514 END.
515 WHEN 'Entity':U THEN DO:
516 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
517 {&OPEN-QUERY-{&BROWSE-NAME}}
518 END.
519 OTHERWISE DO:
520 &Undefine SORTBY-PHRASE
521 {&OPEN-QUERY-{&BROWSE-NAME}}
522 END. /* OTHERWISE...*/
523 END CASE.
524 END. /* FlowTaskType */
525 OTHERWISE DO:
526 &Scope KEY-PHRASE TRUE
527 RUN get-attribute ('SortBy-Case':U).
528 CASE RETURN-VALUE:
529 WHEN 'Due Date':U THEN DO:
530 &Scope SORTBY-PHRASE BY FlowTask.DueDate
531 {&OPEN-QUERY-{&BROWSE-NAME}}
532 END.
533 WHEN 'Entity':U THEN DO:
534 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
535 {&OPEN-QUERY-{&BROWSE-NAME}}
536 END.
537 OTHERWISE DO:
538 &Undefine SORTBY-PHRASE
539 {&OPEN-QUERY-{&BROWSE-NAME}}
540 END. /* OTHERWISE...*/
541 END CASE.
542 END. /* OTHERWISE...*/
543 END CASE.
545 END PROCEDURE.
547 /* _UIB-CODE-BLOCK-END */
548 &ANALYZE-RESUME
551 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available B-table-Win _ADM-ROW-AVAILABLE
552 PROCEDURE adm-row-available :
553 /*------------------------------------------------------------------------------
554 Purpose: Dispatched to this procedure when the Record-
555 Source has a new row available. This procedure
556 tries to get the new row (or foriegn keys) from
557 the Record-Source and process it.
558 Parameters: <none>
559 ------------------------------------------------------------------------------*/
561 /* Define variables needed by this internal procedure. */
562 {src/adm/template/row-head.i}
564 /* Create a list of all the tables that we need to get. */
565 {src/adm/template/row-list.i "FlowTask"}
567 /* Get the record ROWID's from the RECORD-SOURCE. */
568 {src/adm/template/row-get.i}
570 /* FIND each record specified by the RECORD-SOURCE. */
571 {src/adm/template/row-find.i "FlowTask"}
573 /* Process the newly available records (i.e. display fields,
574 open queries, and/or pass records on to any RECORD-TARGETS). */
575 {src/adm/template/row-end.i}
577 END PROCEDURE.
579 /* _UIB-CODE-BLOCK-END */
580 &ANALYZE-RESUME
583 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI B-table-Win _DEFAULT-DISABLE
584 PROCEDURE disable_UI :
585 /*------------------------------------------------------------------------------
586 Purpose: DISABLE the User Interface
587 Parameters: <none>
588 Notes: Here we clean-up the user-interface by deleting
589 dynamic widgets we have created and/or hide
590 frames. This procedure is usually called when
591 we are ready to "clean-up" after running.
592 ------------------------------------------------------------------------------*/
593 /* Hide all frames. */
594 HIDE FRAME F-Main.
595 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
596 END PROCEDURE.
598 /* _UIB-CODE-BLOCK-END */
599 &ANALYZE-RESUME
602 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE mark-as-completed B-table-Win
603 PROCEDURE mark-as-completed :
604 /*------------------------------------------------------------------------------
605 Purpose:
606 ------------------------------------------------------------------------------*/
607 DEF VAR due-date AS DATE NO-UNDO.
608 DEF VAR task-no AS INT NO-UNDO.
609 DEF VAR results AS CHAR NO-UNDO.
611 IF NOT AVAILABLE(FlowTask) THEN RETURN.
612 due-date = FlowTask.DueDate.
613 task-no = FlowTask.FlowTaskNo.
614 RUN workflow/update-task.p( INPUT-OUTPUT due-date, INPUT-OUTPUT task-no, "TaskDone",
615 "", OUTPUT results ).
617 {&BROWSE-NAME}:REFRESH() IN FRAME {&FRAME-NAME}.
619 END PROCEDURE.
621 /* _UIB-CODE-BLOCK-END */
622 &ANALYZE-RESUME
625 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE mark-as-todo B-table-Win
626 PROCEDURE mark-as-todo :
627 /*------------------------------------------------------------------------------
628 Purpose:
629 ------------------------------------------------------------------------------*/
630 IF NOT AVAILABLE(FlowTask) THEN RETURN.
632 DO TRANSACTION:
633 FIND CURRENT FlowTask EXCLUSIVE-LOCK NO-ERROR.
634 FOR EACH FlowStep OF FlowTask WHERE FlowStep.ActivityStatus = "DONE" EXCLUSIVE-LOCK:
635 FlowStep.ActivityStatus = "TODO".
636 FlowStep.StatusUpdateDate = TODAY.
637 END.
638 FlowTask.ActivityStatus = "TODO".
639 FlowTask.StatusUpdateDate = TODAY.
640 FIND CURRENT FlowTask NO-LOCK.
641 END.
643 {&BROWSE-NAME}:REFRESH() IN FRAME {&FRAME-NAME}.
645 END PROCEDURE.
647 /* _UIB-CODE-BLOCK-END */
648 &ANALYZE-RESUME
651 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-key B-table-Win adm/support/_key-snd.p
652 PROCEDURE send-key :
653 /*------------------------------------------------------------------------------
654 Purpose: Sends a requested KEY value back to the calling
655 SmartObject.
656 Parameters: <see adm/template/sndkytop.i>
657 ------------------------------------------------------------------------------*/
659 /* Define variables needed by this internal procedure. */
660 {src/adm/template/sndkytop.i}
662 /* Return the key value associated with each key case. */
663 {src/adm/template/sndkycas.i "Joblogno" "FlowTask" "Joblogno"}
664 {src/adm/template/sndkycas.i "EntityCode" "FlowTask" "EntityCode"}
665 {src/adm/template/sndkycas.i "ProjectCode" "FlowTask" "EntityCode"}
666 {src/adm/template/sndkycas.i "TenantCode" "FlowTask" "EntityCode"}
667 {src/adm/template/sndkycas.i "CompanyCode" "FlowTask" "EntityCode"}
668 {src/adm/template/sndkycas.i "PropertyCode" "FlowTask" "EntityCode"}
669 {src/adm/template/sndkycas.i "EntityType" "FlowTask" "EntityType"}
670 {src/adm/template/sndkycas.i "PersonCode" "FlowTask" "AllocatedTo"}
671 {src/adm/template/sndkycas.i "FlowTaskType" "FlowTask" "FlowTaskType"}
673 /* Close the CASE statement and end the procedure. */
674 {src/adm/template/sndkyend.i}
676 END PROCEDURE.
678 /* _UIB-CODE-BLOCK-END */
679 &ANALYZE-RESUME
682 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records B-table-Win _ADM-SEND-RECORDS
683 PROCEDURE send-records :
684 /*------------------------------------------------------------------------------
685 Purpose: Send record ROWID's for all tables used by
686 this file.
687 Parameters: see template/snd-head.i
688 ------------------------------------------------------------------------------*/
690 /* Define variables needed by this internal procedure. */
691 {src/adm/template/snd-head.i}
693 /* For each requested table, put it's ROWID in the output list. */
694 {src/adm/template/snd-list.i "FlowTask"}
695 {src/adm/template/snd-list.i "FlowStep"}
697 /* Deal with any unexpected table requests before closing. */
698 {src/adm/template/snd-end.i}
700 END PROCEDURE.
702 /* _UIB-CODE-BLOCK-END */
703 &ANALYZE-RESUME
706 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed B-table-Win
707 PROCEDURE state-changed :
708 /* -----------------------------------------------------------
709 Purpose:
710 Parameters: <none>
711 Notes:
712 -------------------------------------------------------------*/
713 DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
714 DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
716 CASE p-state:
717 /* Object instance CASEs can go here to replace standard behavior
718 or add new cases. */
719 {src/adm/template/bstates.i}
720 END CASE.
721 END PROCEDURE.
723 /* _UIB-CODE-BLOCK-END */
724 &ANALYZE-RESUME
727 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-Key-Name B-table-Win
728 PROCEDURE use-Key-Name :
729 /*------------------------------------------------------------------------------
730 Purpose:
731 ------------------------------------------------------------------------------*/
732 DEF INPUT PARAMETER new-key-name AS CHAR NO-UNDO.
734 IF new-key-name = "ProjectCode" THEN entity-type-filter = "J".
735 ELSE IF new-key-name = "TenantCode" THEN entity-type-filter = "T".
736 ELSE IF new-key-name = "CompanyCode" THEN entity-type-filter = "L".
737 ELSE IF new-key-name = "PropertyCode" THEN entity-type-filter = "P".
738 ELSE IF new-key-name = "EntityCode" THEN
739 entity-type-filter = find-parent-key( "EntityType" ).
740 ELSE
741 entity-type-filter = "".
743 END PROCEDURE.
745 /* _UIB-CODE-BLOCK-END */
746 &ANALYZE-RESUME