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 "".
29 DEF VAR filter-status
AS CHAR NO-UNDO INITIAL "TODO".
31 /* _UIB-CODE-BLOCK-END
*/
35 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
37 /* ******************** Preprocessor Definitions
******************** */
39 &Scoped-define PROCEDURE-TYPE SmartBrowser
41 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
43 /* Name of first Frame and
/or Browse and
/or first Query
*/
44 &Scoped-define FRAME-NAME F-Main
45 &Scoped-define BROWSE-NAME br_table
47 /* Internal Tables
(found by Frame
, Query
& Browse Queries) */
48 &Scoped-define INTERNAL-TABLES FlowTask
50 /* Define KEY-PHRASE in case it is used by any query.
*/
51 &Scoped-define KEY-PHRASE TRUE
53 /* Definitions for
BROWSE br_table
*/
54 &Scoped-define FIELDS-IN-QUERY-br_table FlowTask.DueDate ~
55 FlowTask.FlowTaskType FlowTask.Description FlowTask.EntityType ~
56 FlowTask.EntityCode FlowTask.Priority FlowTask.ActivityStatus
57 &Scoped-define ENABLED-FIELDS-IN-QUERY-br_table
58 &Scoped-define FIELD-PAIRS-IN-QUERY-br_table
59 &Scoped-define OPEN-QUERY-br_table OPEN QUERY br_table FOR EACH FlowTask WHERE ~{&KEY-PHRASE} ~
60 AND FlowTask.ActivityStatus
BEGINS filter-status
AND ~
61 FlowTask.EntityType
BEGINS entity-type-filter ~
64 &Scoped-define TABLES-IN-QUERY-br_table FlowTask
65 &Scoped-define FIRST-TABLE-IN-QUERY-br_table FlowTask
68 /* Definitions for
FRAME F-Main
*/
70 /* Standard List Definitions
*/
71 &Scoped-Define ENABLED-OBJECTS br_table
73 /* Custom List Definitions
*/
74 /* List-1
,List-2
,List-3
,List-4
,List-5
,List-6
*/
76 /* _UIB-PREPROCESSOR-BLOCK-END
*/
80 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Foreign Keys" B-table-Win _INLINE
81 /* Actions
: ? adm
/support
/keyedit.w ? ? ?
*/
87 Joblogno|y|y|TTPL.FlowTask.Joblogno
88 EntityCode|y|y|TTPL.FlowTask.EntityCode
89 ProjectCode|y|y|TTPL.FlowTask.EntityCode
90 TenantCode|y|y|TTPL.FlowTask.EntityCode
91 CompanyCode|y|y|TTPL.FlowTask.EntityCode
92 PropertyCode|y|y|TTPL.FlowTask.EntityCode
93 EntityType|y|y|TTPL.FlowTask.EntityType
94 PersonCode|y|y|TTPL.FlowTask.AllocatedTo
95 FlowTaskType|y|y|TTPL.FlowTask.FlowTaskType
98 **************************
99 * Set attributes related to FOREIGN
KEYS
101 RUN set-attribute-list
(
102 'Keys-Accepted
= "Joblogno,EntityCode,ProjectCode,TenantCode,CompanyCode,PropertyCode,EntityType,PersonCode,FlowTaskType",
103 Keys-Supplied
= "Joblogno,EntityCode,ProjectCode,TenantCode,CompanyCode,PropertyCode,EntityType,PersonCode,FlowTaskType"'
:U
).
105 /* Tell the ADM to use the OPEN-QUERY-CASES.
*/
106 &Scoped-define OPEN-QUERY-CASES RUN dispatch ('open-query-cases':U).
107 /**************************
109 /* _UIB-CODE-BLOCK-END
*/
112 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Advanced Query Options" B-table-Win _INLINE
113 /* Actions
: ? adm
/support
/advqedit.w ? ? ?
*/
119 Due Date|y||TTPL.FlowTask.DueDate|yes
120 Type|||TTPL.FlowTask.FlowTaskType|yes
,TTPL.FlowTask.DueDate|yes
121 Entity|||TTPL.FlowTask.EntityType|yes
,TTPL.FlowTask.EntityCode|yes
124 ************************
125 * Set attributes related to SORTBY-OPTIONS
*/
126 RUN set-attribute-list
(
127 'SortBy-Options
= "Due Date,Type,Entity",
128 SortBy-Case
= Due Date'
:U
).
130 /* Tell the ADM to use the OPEN-QUERY-CASES.
*/
131 &Scoped-define OPEN-QUERY-CASES RUN dispatch ('open-query-cases':U).
133 /* This SmartObject is a valid SortBy-Target.
*/
134 &IF '{&user-supported-links}':U ne '':U &THEN
135 &Scoped-define user-supported-links {&user-supported-links},SortBy-Target
137 &Scoped-define user-supported-links SortBy-Target
140 /************************
143 </FILTER-ATTRIBUTES
> */
145 /* _UIB-CODE-BLOCK-END
*/
149 /* *********************** Control Definitions
********************** */
152 /* Definitions of the field level widgets
*/
153 /* Query definitions
*/
155 DEFINE QUERY br_table
FOR
159 /* Browse definitions
*/
160 DEFINE BROWSE br_table
161 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _DISPLAY-FIELDS br_table B-table-Win _STRUCTURED
162 QUERY br_table
NO-LOCK DISPLAY
163 FlowTask.DueDate
COLUMN-LABEL "Due Before"
164 FlowTask.FlowTaskType
COLUMN-LABEL "Type"
165 FlowTask.Description
COLUMN-LABEL "Task Description"
166 FlowTask.EntityType
COLUMN-LABEL "T"
167 FlowTask.EntityCode
COLUMN-LABEL " Entity"
168 FlowTask.Priority
COLUMN-LABEL "Pri"
169 FlowTask.ActivityStatus
170 /* _UIB-CODE-BLOCK-END
*/
172 WITH NO-ASSIGN SEPARATORS SIZE 74.29 BY 16.2
176 /* ************************ Frame Definitions
*********************** */
179 br_table
AT ROW 1 COL 1
180 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
181 SIDE-LABELS NO-UNDERLINE THREE-D
182 AT COL 1 ROW 1 SCROLLABLE
183 BGCOLOR 8 FGCOLOR 0 .
186 /* *********************** Procedure Settings
************************ */
188 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
189 /* Settings for
THIS-PROCEDURE
193 Add Fields to
: EXTERNAL-TABLES
194 Other Settings
: PERSISTENT-ONLY
COMPILE
197 /* This procedure should always be
RUN PERSISTENT. Report the error
, */
198 /* then cleanup and return.
*/
199 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
200 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
201 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
205 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
207 /* ************************* Create Window
************************** */
209 &ANALYZE-SUSPEND _CREATE-WINDOW
210 /* DESIGN Window definition
(used by the UIB
)
211 CREATE WINDOW B-table-Win
ASSIGN
214 /* END WINDOW DEFINITION
*/
219 /* *************** Runtime Attributes and UIB Settings
************** */
221 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
222 /* SETTINGS
FOR WINDOW B-table-Win
223 NOT-VISIBLE
,,RUN-PERSISTENT
*/
224 /* SETTINGS
FOR FRAME F-Main
225 NOT-VISIBLE Size-to-Fit
*/
226 /* BROWSE-TAB br_table
1 F-Main
*/
228 FRAME F-Main
:SCROLLABLE = FALSE
229 FRAME F-Main
:HIDDEN = TRUE.
231 /* _RUN-TIME-ATTRIBUTES-END
*/
235 /* Setting information for Queries and Browse Widgets fields
*/
237 &ANALYZE-SUSPEND _QUERY-BLOCK BROWSE br_table
238 /* Query rebuild information for
BROWSE br_table
239 _TblList
= "TTPL.FlowTask"
240 _Options
= "NO-LOCK KEY-PHRASE SORTBY-PHRASE"
241 _TblOptList
= ", OUTER"
242 _Where
[1] = "FlowTask.ActivityStatus BEGINS filter-status AND
243 FlowTask.EntityType BEGINS entity-type-filter
245 _FldNameList
[1] > TTPL.FlowTask.DueDate
246 "FlowTask.DueDate" "Due Before" ?
"date" ? ? ? ? ? ? no ?
247 _FldNameList
[2] > TTPL.FlowTask.FlowTaskType
248 "FlowTask.FlowTaskType" "Type" ?
"character" ? ? ? ? ? ? no ?
249 _FldNameList
[3] > TTPL.FlowTask.Description
250 "FlowTask.Description" "Task Description" ?
"character" ? ? ? ? ? ? no ?
251 _FldNameList
[4] > TTPL.FlowTask.EntityType
252 "FlowTask.EntityType" "T" ?
"character" ? ? ? ? ? ? no ?
253 _FldNameList
[5] > TTPL.FlowTask.EntityCode
254 "FlowTask.EntityCode" " Entity" ?
"integer" ? ? ? ? ? ? no ?
255 _FldNameList
[6] > TTPL.FlowTask.Priority
256 "FlowTask.Priority" "Pri" ?
"integer" ? ? ? ? ? ? no ?
257 _FldNameList
[7] = TTPL.FlowTask.ActivityStatus
259 */ /* BROWSE br_table
*/
262 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
263 /* Query rebuild information for
FRAME F-Main
266 */ /* FRAME F-Main
*/
272 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB B-table-Win
273 /* ************************* Included-Libraries
*********************** */
275 {src
/adm
/method
/browser.i
}
276 {inc
/method
/m-drlvwr.i
}
278 /* _UIB-CODE-BLOCK-END
*/
284 /* ************************ Control Triggers
************************ */
286 &Scoped-define BROWSE-NAME br_table
287 &Scoped-define SELF-NAME br_table
288 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
289 ON ROW-ENTRY
OF br_table
IN FRAME F-Main
291 /* This code displays initial values for newly added or copied rows.
*/
292 {src
/adm
/template
/brsentry.i
}
295 /* _UIB-CODE-BLOCK-END
*/
299 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
300 ON ROW-LEAVE
OF br_table
IN FRAME F-Main
302 /* Do not disable this code or no updates will take place except
303 by pressing the Save button on an Update SmartPanel.
*/
304 {src
/adm
/template
/brsleave.i
}
307 /* _UIB-CODE-BLOCK-END
*/
311 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
312 ON VALUE-CHANGED
OF br_table
IN FRAME F-Main
314 /* This ADM trigger code must be preserved in order to notify other
315 objects when the browser's current row changes.
*/
316 {src
/adm
/template
/brschnge.i
}
319 /* _UIB-CODE-BLOCK-END
*/
325 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK B-table-Win
328 /* *************************** Main Block
*************************** */
330 RUN set-attribute-list
( 'SortBy-Options
= Due Date|Entity|Type
, SortBy-Case
= Due Date'
:U
).
331 RUN set-attribute-list
( 'FilterBy-Options
= All|To do|Completed
, FilterBy-Case
= To do'
:U
).
332 RUN set-attribute-list
( 'SearchBy-Case
= '
:U
).
334 /* _UIB-CODE-BLOCK-END
*/
338 /* ********************** Internal Procedures
*********************** */
340 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-open-query-cases B-table-Win adm/support/_adm-opn.p
341 PROCEDURE adm-open-query-cases
:
342 /*------------------------------------------------------------------------------
343 Purpose
: Opens different cases of the query based on attributes
344 such as the 'Key-Name'
, or 'SortBy-Case'
346 ------------------------------------------------------------------------------*/
347 DEF VAR key-value
AS CHAR NO-UNDO.
349 /* Look up the current key-value.
*/
350 RUN get-attribute
('Key-Value'
:U
).
351 key-value
= RETURN-VALUE.
353 /* Find the current record using the current Key-Name.
*/
354 RUN get-attribute
('Key-Name'
:U
).
356 WHEN 'Joblogno'
:U
THEN DO:
357 &Scope KEY-PHRASE FlowTask.Joblogno eq INTEGER(key-value)
358 RUN get-attribute
('SortBy-Case'
:U
).
360 WHEN 'Due Date'
:U
THEN DO:
361 &Scope SORTBY-PHRASE BY FlowTask.DueDate
362 {&OPEN-QUERY-{&BROWSE-NAME}}
364 WHEN 'Type'
:U
THEN DO:
365 &Scope SORTBY-PHRASE BY FlowTask.FlowTaskType BY FlowTask.DueDate
366 {&OPEN-QUERY-{&BROWSE-NAME}}
368 WHEN 'Entity'
:U
THEN DO:
369 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
370 {&OPEN-QUERY-{&BROWSE-NAME}}
373 &Undefine SORTBY-PHRASE
374 {&OPEN-QUERY-{&BROWSE-NAME}}
375 END.
/* OTHERWISE...
*/
378 WHEN 'EntityCode'
:U
THEN DO:
379 &Scope KEY-PHRASE FlowTask.EntityCode eq INTEGER(key-value)
380 RUN get-attribute
('SortBy-Case'
:U
).
382 WHEN 'Due Date'
:U
THEN DO:
383 &Scope SORTBY-PHRASE BY FlowTask.DueDate
384 {&OPEN-QUERY-{&BROWSE-NAME}}
386 WHEN 'Type'
:U
THEN DO:
387 &Scope SORTBY-PHRASE BY FlowTask.FlowTaskType BY FlowTask.DueDate
388 {&OPEN-QUERY-{&BROWSE-NAME}}
390 WHEN 'Entity'
:U
THEN DO:
391 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
392 {&OPEN-QUERY-{&BROWSE-NAME}}
395 &Undefine SORTBY-PHRASE
396 {&OPEN-QUERY-{&BROWSE-NAME}}
397 END.
/* OTHERWISE...
*/
399 END.
/* EntityCode
*/
400 WHEN 'ProjectCode'
:U
THEN DO:
401 &Scope KEY-PHRASE FlowTask.EntityCode eq INTEGER(key-value)
402 RUN get-attribute
('SortBy-Case'
:U
).
404 WHEN 'Due Date'
:U
THEN DO:
405 &Scope SORTBY-PHRASE BY FlowTask.DueDate
406 {&OPEN-QUERY-{&BROWSE-NAME}}
408 WHEN 'Type'
:U
THEN DO:
409 &Scope SORTBY-PHRASE BY FlowTask.FlowTaskType BY FlowTask.DueDate
410 {&OPEN-QUERY-{&BROWSE-NAME}}
412 WHEN 'Entity'
:U
THEN DO:
413 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
414 {&OPEN-QUERY-{&BROWSE-NAME}}
417 &Undefine SORTBY-PHRASE
418 {&OPEN-QUERY-{&BROWSE-NAME}}
419 END.
/* OTHERWISE...
*/
421 END.
/* ProjectCode
*/
422 WHEN 'TenantCode'
:U
THEN DO:
423 &Scope KEY-PHRASE FlowTask.EntityCode eq INTEGER(key-value)
424 RUN get-attribute
('SortBy-Case'
:U
).
426 WHEN 'Due Date'
:U
THEN DO:
427 &Scope SORTBY-PHRASE BY FlowTask.DueDate
428 {&OPEN-QUERY-{&BROWSE-NAME}}
430 WHEN 'Type'
:U
THEN DO:
431 &Scope SORTBY-PHRASE BY FlowTask.FlowTaskType BY FlowTask.DueDate
432 {&OPEN-QUERY-{&BROWSE-NAME}}
434 WHEN 'Entity'
:U
THEN DO:
435 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
436 {&OPEN-QUERY-{&BROWSE-NAME}}
439 &Undefine SORTBY-PHRASE
440 {&OPEN-QUERY-{&BROWSE-NAME}}
441 END.
/* OTHERWISE...
*/
443 END.
/* TenantCode
*/
444 WHEN 'CompanyCode'
:U
THEN DO:
445 &Scope KEY-PHRASE FlowTask.EntityCode eq INTEGER(key-value)
446 RUN get-attribute
('SortBy-Case'
:U
).
448 WHEN 'Due Date'
:U
THEN DO:
449 &Scope SORTBY-PHRASE BY FlowTask.DueDate
450 {&OPEN-QUERY-{&BROWSE-NAME}}
452 WHEN 'Type'
:U
THEN DO:
453 &Scope SORTBY-PHRASE BY FlowTask.FlowTaskType BY FlowTask.DueDate
454 {&OPEN-QUERY-{&BROWSE-NAME}}
456 WHEN 'Entity'
:U
THEN DO:
457 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
458 {&OPEN-QUERY-{&BROWSE-NAME}}
461 &Undefine SORTBY-PHRASE
462 {&OPEN-QUERY-{&BROWSE-NAME}}
463 END.
/* OTHERWISE...
*/
465 END.
/* CompanyCode
*/
466 WHEN 'PropertyCode'
:U
THEN DO:
467 &Scope KEY-PHRASE FlowTask.EntityCode eq INTEGER(key-value)
468 RUN get-attribute
('SortBy-Case'
:U
).
470 WHEN 'Due Date'
:U
THEN DO:
471 &Scope SORTBY-PHRASE BY FlowTask.DueDate
472 {&OPEN-QUERY-{&BROWSE-NAME}}
474 WHEN 'Type'
:U
THEN DO:
475 &Scope SORTBY-PHRASE BY FlowTask.FlowTaskType BY FlowTask.DueDate
476 {&OPEN-QUERY-{&BROWSE-NAME}}
478 WHEN 'Entity'
:U
THEN DO:
479 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
480 {&OPEN-QUERY-{&BROWSE-NAME}}
483 &Undefine SORTBY-PHRASE
484 {&OPEN-QUERY-{&BROWSE-NAME}}
485 END.
/* OTHERWISE...
*/
487 END.
/* PropertyCode
*/
488 WHEN 'EntityType'
:U
THEN DO:
489 &Scope KEY-PHRASE FlowTask.EntityType eq key-value
490 RUN get-attribute
('SortBy-Case'
:U
).
492 WHEN 'Due Date'
:U
THEN DO:
493 &Scope SORTBY-PHRASE BY FlowTask.DueDate
494 {&OPEN-QUERY-{&BROWSE-NAME}}
496 WHEN 'Type'
:U
THEN DO:
497 &Scope SORTBY-PHRASE BY FlowTask.FlowTaskType BY FlowTask.DueDate
498 {&OPEN-QUERY-{&BROWSE-NAME}}
500 WHEN 'Entity'
:U
THEN DO:
501 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
502 {&OPEN-QUERY-{&BROWSE-NAME}}
505 &Undefine SORTBY-PHRASE
506 {&OPEN-QUERY-{&BROWSE-NAME}}
507 END.
/* OTHERWISE...
*/
509 END.
/* EntityType
*/
510 WHEN 'PersonCode'
:U
THEN DO:
511 &Scope KEY-PHRASE FlowTask.AllocatedTo eq INTEGER(key-value)
512 RUN get-attribute
('SortBy-Case'
:U
).
514 WHEN 'Due Date'
:U
THEN DO:
515 &Scope SORTBY-PHRASE BY FlowTask.DueDate
516 {&OPEN-QUERY-{&BROWSE-NAME}}
518 WHEN 'Type'
:U
THEN DO:
519 &Scope SORTBY-PHRASE BY FlowTask.FlowTaskType BY FlowTask.DueDate
520 {&OPEN-QUERY-{&BROWSE-NAME}}
522 WHEN 'Entity'
:U
THEN DO:
523 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
524 {&OPEN-QUERY-{&BROWSE-NAME}}
527 &Undefine SORTBY-PHRASE
528 {&OPEN-QUERY-{&BROWSE-NAME}}
529 END.
/* OTHERWISE...
*/
531 END.
/* PersonCode
*/
532 WHEN 'FlowTaskType'
:U
THEN DO:
533 &Scope KEY-PHRASE FlowTask.FlowTaskType eq key-value
534 RUN get-attribute
('SortBy-Case'
:U
).
536 WHEN 'Due Date'
:U
THEN DO:
537 &Scope SORTBY-PHRASE BY FlowTask.DueDate
538 {&OPEN-QUERY-{&BROWSE-NAME}}
540 WHEN 'Type'
:U
THEN DO:
541 &Scope SORTBY-PHRASE BY FlowTask.FlowTaskType BY FlowTask.DueDate
542 {&OPEN-QUERY-{&BROWSE-NAME}}
544 WHEN 'Entity'
:U
THEN DO:
545 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
546 {&OPEN-QUERY-{&BROWSE-NAME}}
549 &Undefine SORTBY-PHRASE
550 {&OPEN-QUERY-{&BROWSE-NAME}}
551 END.
/* OTHERWISE...
*/
553 END.
/* FlowTaskType
*/
555 &Scope KEY-PHRASE TRUE
556 RUN get-attribute
('SortBy-Case'
:U
).
558 WHEN 'Due Date'
:U
THEN DO:
559 &Scope SORTBY-PHRASE BY FlowTask.DueDate
560 {&OPEN-QUERY-{&BROWSE-NAME}}
562 WHEN 'Type'
:U
THEN DO:
563 &Scope SORTBY-PHRASE BY FlowTask.FlowTaskType BY FlowTask.DueDate
564 {&OPEN-QUERY-{&BROWSE-NAME}}
566 WHEN 'Entity'
:U
THEN DO:
567 &Scope SORTBY-PHRASE BY FlowTask.EntityType BY FlowTask.EntityCode
568 {&OPEN-QUERY-{&BROWSE-NAME}}
571 &Undefine SORTBY-PHRASE
572 {&OPEN-QUERY-{&BROWSE-NAME}}
573 END.
/* OTHERWISE...
*/
575 END.
/* OTHERWISE...
*/
580 /* _UIB-CODE-BLOCK-END
*/
584 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available B-table-Win _ADM-ROW-AVAILABLE
585 PROCEDURE adm-row-available
:
586 /*------------------------------------------------------------------------------
587 Purpose
: Dispatched to this procedure when the Record-
588 Source has a new row available. This procedure
589 tries to get the new row
(or foriegn keys
) from
590 the Record-Source and process it.
592 ------------------------------------------------------------------------------*/
594 /* Define variables needed by this internal procedure.
*/
595 {src
/adm
/template
/row-head.i
}
597 /* Process the newly available records
(i.e. display fields
,
598 open queries
, and
/or pass records on to any RECORD-TARGETS
).
*/
599 {src
/adm
/template
/row-end.i
}
603 /* _UIB-CODE-BLOCK-END
*/
607 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE delete-current-task B-table-Win
608 PROCEDURE delete-current-task
:
609 /*------------------------------------------------------------------------------
611 ------------------------------------------------------------------------------*/
612 IF NOT AVAILABLE(FlowTask
) THEN RETURN.
613 DEF VAR do-it
AS LOGI
NO-UNDO INITIAL No.
615 MESSAGE "Are you sure you want to delete this task?" SKIP(1)
616 "All steps will also be deleted and this" SKIP
617 "action cannot be undone."
618 VIEW-AS ALERT-BOX QUESTION BUTTONS OK-CANCEL
619 TITLE "Confirm Deletion"
622 IF do-it
THEN DO TRANSACTION:
623 FIND CURRENT FlowTask
EXCLUSIVE-LOCK.
626 RUN dispatch
( 'open-query'
:U
).
630 /* _UIB-CODE-BLOCK-END
*/
634 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI B-table-Win _DEFAULT-DISABLE
635 PROCEDURE disable_UI
:
636 /*------------------------------------------------------------------------------
637 Purpose
: DISABLE the User Interface
639 Notes
: Here we clean-up the user-interface by deleting
640 dynamic widgets we have created and
/or hide
641 frames. This procedure is usually called when
642 we are ready to
"clean-up" after running.
643 ------------------------------------------------------------------------------*/
644 /* Hide all frames.
*/
646 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
649 /* _UIB-CODE-BLOCK-END
*/
653 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE mark-as-completed B-table-Win
654 PROCEDURE mark-as-completed
:
655 /*------------------------------------------------------------------------------
657 ------------------------------------------------------------------------------*/
658 DEF VAR due-date
AS DATE NO-UNDO.
659 DEF VAR task-no
AS INT NO-UNDO.
660 DEF VAR results
AS CHAR NO-UNDO.
662 IF NOT AVAILABLE(FlowTask
) THEN RETURN.
663 due-date
= FlowTask.DueDate.
664 task-no
= FlowTask.FlowTaskNo.
665 RUN workflow
/update-task.p
( INPUT-OUTPUT due-date
, INPUT-OUTPUT task-no
, "TaskDone",
666 "", OUTPUT results
).
668 {&BROWSE-NAME}:REFRESH() IN FRAME {&FRAME-NAME}.
672 /* _UIB-CODE-BLOCK-END
*/
676 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE mark-as-todo B-table-Win
677 PROCEDURE mark-as-todo
:
678 /*------------------------------------------------------------------------------
680 ------------------------------------------------------------------------------*/
681 IF NOT AVAILABLE(FlowTask
) THEN RETURN.
684 FIND CURRENT FlowTask
EXCLUSIVE-LOCK NO-ERROR.
685 FOR EACH FlowStep
OF FlowTask
WHERE FlowStep.ActivityStatus
= "DONE" EXCLUSIVE-LOCK:
686 FlowStep.ActivityStatus
= "TODO".
687 FlowStep.StatusUpdateDate
= TODAY.
689 FlowTask.ActivityStatus
= "TODO".
690 FlowTask.StatusUpdateDate
= TODAY.
691 FIND CURRENT FlowTask
NO-LOCK.
694 {&BROWSE-NAME}:REFRESH() IN FRAME {&FRAME-NAME}.
698 /* _UIB-CODE-BLOCK-END
*/
702 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-key B-table-Win adm/support/_key-snd.p
704 /*------------------------------------------------------------------------------
705 Purpose
: Sends a requested
KEY value back to the calling
707 Parameters
: <see adm
/template
/sndkytop.i
>
708 ------------------------------------------------------------------------------*/
710 /* Define variables needed by this internal procedure.
*/
711 {src
/adm
/template
/sndkytop.i
}
713 /* Return the key value associated with each key case.
*/
714 {src
/adm
/template
/sndkycas.i
"Joblogno" "FlowTask" "Joblogno"}
715 {src
/adm
/template
/sndkycas.i
"EntityCode" "FlowTask" "EntityCode"}
716 {src
/adm
/template
/sndkycas.i
"ProjectCode" "FlowTask" "EntityCode"}
717 {src
/adm
/template
/sndkycas.i
"TenantCode" "FlowTask" "EntityCode"}
718 {src
/adm
/template
/sndkycas.i
"CompanyCode" "FlowTask" "EntityCode"}
719 {src
/adm
/template
/sndkycas.i
"PropertyCode" "FlowTask" "EntityCode"}
720 {src
/adm
/template
/sndkycas.i
"EntityType" "FlowTask" "EntityType"}
721 {src
/adm
/template
/sndkycas.i
"PersonCode" "FlowTask" "AllocatedTo"}
722 {src
/adm
/template
/sndkycas.i
"FlowTaskType" "FlowTask" "FlowTaskType"}
724 /* Close the
CASE statement and end the procedure.
*/
725 {src
/adm
/template
/sndkyend.i
}
729 /* _UIB-CODE-BLOCK-END
*/
733 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records B-table-Win _ADM-SEND-RECORDS
734 PROCEDURE send-records
:
735 /*------------------------------------------------------------------------------
736 Purpose
: Send record
ROWID's for all tables used by
738 Parameters
: see template
/snd-head.i
739 ------------------------------------------------------------------------------*/
741 /* Define variables needed by this internal procedure.
*/
742 {src
/adm
/template
/snd-head.i
}
744 /* For each requested table
, put it's
ROWID in the output list.
*/
745 {src
/adm
/template
/snd-list.i
"FlowTask"}
747 /* Deal with any unexpected table requests before closing.
*/
748 {src
/adm
/template
/snd-end.i
}
752 /* _UIB-CODE-BLOCK-END
*/
756 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed B-table-Win
757 PROCEDURE state-changed
:
758 /* -----------------------------------------------------------
762 -------------------------------------------------------------*/
763 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
764 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
767 /* Object instance CASEs can go here to replace standard behavior
769 {src
/adm
/template
/bstates.i
}
773 /* _UIB-CODE-BLOCK-END
*/
777 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-FilterBy-Case B-table-Win
778 PROCEDURE use-FilterBy-Case
:
779 /*------------------------------------------------------------------------------
781 ------------------------------------------------------------------------------*/
782 DEF INPUT PARAMETER new-filter
AS CHAR NO-UNDO.
785 WHEN "To Do" THEN filter-status
= "TODO".
786 WHEN "Completed" THEN filter-status
= "DONE".
787 OTHERWISE filter-status
= "".
792 /* _UIB-CODE-BLOCK-END
*/
796 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-Key-Name B-table-Win
797 PROCEDURE use-Key-Name
:
798 /*------------------------------------------------------------------------------
800 ------------------------------------------------------------------------------*/
801 DEF INPUT PARAMETER new-key-name
AS CHAR NO-UNDO.
803 IF new-key-name
= "ProjectCode" THEN entity-type-filter
= "J".
804 ELSE IF new-key-name
= "TenantCode" THEN entity-type-filter
= "T".
805 ELSE IF new-key-name
= "CompanyCode" THEN entity-type-filter
= "L".
806 ELSE IF new-key-name
= "PropertyCode" THEN entity-type-filter
= "P".
807 ELSE IF new-key-name
= "EntityCode" THEN
808 entity-type-filter
= find-parent-key
( "EntityType" ).
810 entity-type-filter
= "".
814 /* _UIB-CODE-BLOCK-END
*/