1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI
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
20 ------------------------------------------------------------------------*/
24 /* *************************** Definitions
************************** */
26 {inc
/topic
/tpflwtsk.i
}
28 DEF VAR entity-type-filter
AS CHAR NO-UNDO INITIAL "".
30 /* _UIB-CODE-BLOCK-END
*/
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
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 ~
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
*/
84 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Foreign Keys" B-table-Win _INLINE
85 /* Actions
: ? adm
/support
/keyedit.w ? ? ?
*/
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
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 /**************************
113 /* _UIB-CODE-BLOCK-END
*/
116 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Advanced Query Options" B-table-Win _INLINE
117 /* Actions
: ? adm
/support
/advqedit.w ? ? ?
*/
123 Due Date|y||TTPL.FlowTask.DueDate|yes
124 Entity|||TTPL.FlowTask.EntityType|yes
,TTPL.FlowTask.EntityCode|yes
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
140 &Scoped-define user-supported-links SortBy-Target
143 /************************
146 </FILTER-ATTRIBUTES
> */
148 /* _UIB-CODE-BLOCK-END
*/
152 /* *********************** Control Definitions
********************** */
155 /* Definitions of the field level widgets
*/
156 /* Query definitions
*/
158 DEFINE QUERY br_table
FOR
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"
175 /* _UIB-CODE-BLOCK-END
*/
177 WITH NO-ASSIGN SEPARATORS SIZE 85.72 BY 12.4
181 /* ************************ Frame Definitions
*********************** */
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
196 External Tables
: TTPL.FlowTask
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.
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
220 /* END WINDOW DEFINITION
*/
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
*/
234 FRAME F-Main
:SCROLLABLE = FALSE
235 FRAME F-Main
:HIDDEN = TRUE.
237 /* _RUN-TIME-ATTRIBUTES-END
*/
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
266 */ /* BROWSE br_table
*/
269 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
270 /* Query rebuild information for
FRAME F-Main
273 */ /* FRAME F-Main
*/
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
*/
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
}
302 /* _UIB-CODE-BLOCK-END
*/
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
}
314 /* _UIB-CODE-BLOCK-END
*/
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
}
326 /* _UIB-CODE-BLOCK-END
*/
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
*/
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'
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
).
363 WHEN 'Joblogno'
:U
THEN DO:
364 &Scope KEY-PHRASE FlowTask.Joblogno eq INTEGER(key-value)
365 RUN get-attribute
('SortBy-Case'
:U
).
367 WHEN 'Due Date'
:U
THEN DO:
368 &Scope SORTBY-PHRASE BY FlowTask.DueDate
369 {&OPEN-QUERY-{&BROWSE-NAME}}
371 WHEN 'Entity'
:U
THEN DO:
372 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
373 {&OPEN-QUERY-{&BROWSE-NAME}}
376 &Undefine SORTBY-PHRASE
377 {&OPEN-QUERY-{&BROWSE-NAME}}
378 END.
/* OTHERWISE...
*/
381 WHEN 'EntityCode'
:U
THEN DO:
382 &Scope KEY-PHRASE FlowTask.EntityCode eq INTEGER(key-value)
383 RUN get-attribute
('SortBy-Case'
:U
).
385 WHEN 'Due Date'
:U
THEN DO:
386 &Scope SORTBY-PHRASE BY FlowTask.DueDate
387 {&OPEN-QUERY-{&BROWSE-NAME}}
389 WHEN 'Entity'
:U
THEN DO:
390 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
391 {&OPEN-QUERY-{&BROWSE-NAME}}
394 &Undefine SORTBY-PHRASE
395 {&OPEN-QUERY-{&BROWSE-NAME}}
396 END.
/* OTHERWISE...
*/
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
).
403 WHEN 'Due Date'
:U
THEN DO:
404 &Scope SORTBY-PHRASE BY FlowTask.DueDate
405 {&OPEN-QUERY-{&BROWSE-NAME}}
407 WHEN 'Entity'
:U
THEN DO:
408 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
409 {&OPEN-QUERY-{&BROWSE-NAME}}
412 &Undefine SORTBY-PHRASE
413 {&OPEN-QUERY-{&BROWSE-NAME}}
414 END.
/* OTHERWISE...
*/
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
).
421 WHEN 'Due Date'
:U
THEN DO:
422 &Scope SORTBY-PHRASE BY FlowTask.DueDate
423 {&OPEN-QUERY-{&BROWSE-NAME}}
425 WHEN 'Entity'
:U
THEN DO:
426 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
427 {&OPEN-QUERY-{&BROWSE-NAME}}
430 &Undefine SORTBY-PHRASE
431 {&OPEN-QUERY-{&BROWSE-NAME}}
432 END.
/* OTHERWISE...
*/
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
).
439 WHEN 'Due Date'
:U
THEN DO:
440 &Scope SORTBY-PHRASE BY FlowTask.DueDate
441 {&OPEN-QUERY-{&BROWSE-NAME}}
443 WHEN 'Entity'
:U
THEN DO:
444 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
445 {&OPEN-QUERY-{&BROWSE-NAME}}
448 &Undefine SORTBY-PHRASE
449 {&OPEN-QUERY-{&BROWSE-NAME}}
450 END.
/* OTHERWISE...
*/
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
).
457 WHEN 'Due Date'
:U
THEN DO:
458 &Scope SORTBY-PHRASE BY FlowTask.DueDate
459 {&OPEN-QUERY-{&BROWSE-NAME}}
461 WHEN 'Entity'
:U
THEN DO:
462 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
463 {&OPEN-QUERY-{&BROWSE-NAME}}
466 &Undefine SORTBY-PHRASE
467 {&OPEN-QUERY-{&BROWSE-NAME}}
468 END.
/* OTHERWISE...
*/
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
).
475 WHEN 'Due Date'
:U
THEN DO:
476 &Scope SORTBY-PHRASE BY FlowTask.DueDate
477 {&OPEN-QUERY-{&BROWSE-NAME}}
479 WHEN 'Entity'
:U
THEN DO:
480 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
481 {&OPEN-QUERY-{&BROWSE-NAME}}
484 &Undefine SORTBY-PHRASE
485 {&OPEN-QUERY-{&BROWSE-NAME}}
486 END.
/* OTHERWISE...
*/
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
).
493 WHEN 'Due Date'
:U
THEN DO:
494 &Scope SORTBY-PHRASE BY FlowTask.DueDate
495 {&OPEN-QUERY-{&BROWSE-NAME}}
497 WHEN 'Entity'
:U
THEN DO:
498 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
499 {&OPEN-QUERY-{&BROWSE-NAME}}
502 &Undefine SORTBY-PHRASE
503 {&OPEN-QUERY-{&BROWSE-NAME}}
504 END.
/* OTHERWISE...
*/
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
).
511 WHEN 'Due Date'
:U
THEN DO:
512 &Scope SORTBY-PHRASE BY FlowTask.DueDate
513 {&OPEN-QUERY-{&BROWSE-NAME}}
515 WHEN 'Entity'
:U
THEN DO:
516 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
517 {&OPEN-QUERY-{&BROWSE-NAME}}
520 &Undefine SORTBY-PHRASE
521 {&OPEN-QUERY-{&BROWSE-NAME}}
522 END.
/* OTHERWISE...
*/
524 END.
/* FlowTaskType
*/
526 &Scope KEY-PHRASE TRUE
527 RUN get-attribute
('SortBy-Case'
:U
).
529 WHEN 'Due Date'
:U
THEN DO:
530 &Scope SORTBY-PHRASE BY FlowTask.DueDate
531 {&OPEN-QUERY-{&BROWSE-NAME}}
533 WHEN 'Entity'
:U
THEN DO:
534 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
535 {&OPEN-QUERY-{&BROWSE-NAME}}
538 &Undefine SORTBY-PHRASE
539 {&OPEN-QUERY-{&BROWSE-NAME}}
540 END.
/* OTHERWISE...
*/
542 END.
/* OTHERWISE...
*/
547 /* _UIB-CODE-BLOCK-END
*/
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.
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
}
579 /* _UIB-CODE-BLOCK-END
*/
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
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.
*/
595 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
598 /* _UIB-CODE-BLOCK-END
*/
602 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE mark-as-completed B-table-Win
603 PROCEDURE mark-as-completed
:
604 /*------------------------------------------------------------------------------
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}.
621 /* _UIB-CODE-BLOCK-END
*/
625 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE mark-as-todo B-table-Win
626 PROCEDURE mark-as-todo
:
627 /*------------------------------------------------------------------------------
629 ------------------------------------------------------------------------------*/
630 IF NOT AVAILABLE(FlowTask
) THEN RETURN.
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.
638 FlowTask.ActivityStatus
= "TODO".
639 FlowTask.StatusUpdateDate
= TODAY.
640 FIND CURRENT FlowTask
NO-LOCK.
643 {&BROWSE-NAME}:REFRESH() IN FRAME {&FRAME-NAME}.
647 /* _UIB-CODE-BLOCK-END
*/
651 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-key B-table-Win adm/support/_key-snd.p
653 /*------------------------------------------------------------------------------
654 Purpose
: Sends a requested
KEY value back to the calling
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
}
678 /* _UIB-CODE-BLOCK-END
*/
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
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
}
702 /* _UIB-CODE-BLOCK-END
*/
706 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed B-table-Win
707 PROCEDURE state-changed
:
708 /* -----------------------------------------------------------
712 -------------------------------------------------------------*/
713 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
714 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
717 /* Object instance CASEs can go here to replace standard behavior
719 {src
/adm
/template
/bstates.i
}
723 /* _UIB-CODE-BLOCK-END
*/
727 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-Key-Name B-table-Win
728 PROCEDURE use-Key-Name
:
729 /*------------------------------------------------------------------------------
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" ).
741 entity-type-filter
= "".
745 /* _UIB-CODE-BLOCK-END
*/