1 | XUTMQ0 ;SEA/RDS - TaskMan: Option, ZTMINQ, Part 2 (Modules) ;4/20/95 10:33
|
---|
2 | ;;8.0;KERNEL;;Jul 10, 1995
|
---|
3 | ;
|
---|
4 | ENTRY G ^XUTMQ
|
---|
5 | ;
|
---|
6 | ALL ;BRANCH^XUTMQ--all of one user's tasks.
|
---|
7 | ;input: ZTKEY,ZTNAME,XUTMUCI
|
---|
8 | N DIR,DIRUT,DTOUT,DUOUT,X,ZT1,ZT2,ZT3,ZTC,ZTDUZ,ZTF,ZTH,ZTI,ZTOUT
|
---|
9 | N ZTREC,ZTS,ZTUSER K ^TMP($J)
|
---|
10 | S ZTC=0,ZTF=1,ZTH="All tasks created by ",ZTOUT=0
|
---|
11 | D KEY I ZTOUT Q
|
---|
12 | A1 ;
|
---|
13 | S ZTS=0 F ZTI=1:1 S ZTS=$O(^%ZTSK(ZTS)) Q:'ZTS D
|
---|
14 | .I '(ZTI#100) W "."
|
---|
15 | .I ZTI=10000 D
|
---|
16 | ..W !!,$C(7),$C(7)
|
---|
17 | ..W "You need to run XUTMQCLEAN more often or keep fewer tasks each run."
|
---|
18 | ..W !,"Still searching..."
|
---|
19 | ..Q
|
---|
20 | .I $$MATCH(ZTS,ZTDUZ,ZTUSER) D SORT(+$P($G(^%ZTSK(ZTS,0)),U,6),ZTS)
|
---|
21 | .Q
|
---|
22 | A2 ;
|
---|
23 | S ZTS=0 F S ZTS=$O(^%ZTSCH("TASK",ZTS)) Q:'ZTS D
|
---|
24 | .I $D(^%ZTSK(ZTS,0))#2 Q
|
---|
25 | .S ZTREC=$G(^%ZTSCH("TASK",ZTS))
|
---|
26 | .I ZTREC="" Q
|
---|
27 | .I $P(ZTREC,U,9)'=ZTDUZ,$P(ZTREC,U,9)'=ZTUSER Q
|
---|
28 | .D SORT($H,ZTS)
|
---|
29 | .Q
|
---|
30 | A3 ;
|
---|
31 | W "finished!",!
|
---|
32 | G:$O(^TMP($J,0))="" A4
|
---|
33 | S ZTSAVE("^TMP($J,")="" D EN^XUTMDEVQ("LIST^XUTMQ","TASK LIST",.ZTSAVE)
|
---|
34 | K ^TMP($J)
|
---|
35 | Q
|
---|
36 | S ZT1="" F S ZT1=$O(^TMP($J,ZT1),-1) Q:ZT1="" D I ZTOUT Q
|
---|
37 | . S ZTS=0 F S ZTS=$O(^TMP($J,ZT1,ZTS)) Q:'ZTS D I ZTOUT Q
|
---|
38 | .. D PRINT
|
---|
39 | .Q
|
---|
40 | I ZTOUT Q
|
---|
41 | A4 ;
|
---|
42 | I 'ZTC W !! D W " no tasks in this volume set's Task file.",!
|
---|
43 | .I ZTKEY W ZTUSER," has"
|
---|
44 | .E W "You have"
|
---|
45 | W !
|
---|
46 | S DIR(0)="E"
|
---|
47 | S DIR("A")="Press RETURN to continue" I ZTC D
|
---|
48 | .S DIR("A")="End of listing. "_DIR("A")
|
---|
49 | D ^DIR K ^TMP($J) Q
|
---|
50 | ;
|
---|
51 | FUT ;BRANCH^XUTMQ--one user's future tasks.
|
---|
52 | ;input: ZTKEY,ZTNAME,XUTMUCI
|
---|
53 | N DIR,DIRUT,DTOUT,DUOUT,X,ZT,ZT1,ZT2,ZT3,ZTC,ZTDUZ,ZTF,ZTH,ZTOUT
|
---|
54 | N ZTREC,ZTS,ZTUSER K ^TMP($J)
|
---|
55 | S X=0,ZTC=0,ZTF=1,ZTH="Scheduled and waiting tasks created by ",ZTOUT=0
|
---|
56 | D KEY I ZTOUT Q
|
---|
57 | ;
|
---|
58 | F1 S ZT1=0 F S ZT1=$O(^%ZTSCH("JOB",ZT1)) Q:ZT1'>0 D
|
---|
59 | .S ZTS=0 F S ZTS=$O(^%ZTSCH("JOB",ZT1,ZTS)) Q:ZTS="" D
|
---|
60 | ..I $$MATCH(ZTS,ZTDUZ,ZTUSER) D SORT(ZT1,ZTS)
|
---|
61 | .Q
|
---|
62 | ;
|
---|
63 | F2 S ZT1=0 F S ZT1=$O(^%ZTSCH(ZT1)) Q:'ZT1 D
|
---|
64 | .S ZTS=0 F S ZTS=$O(^%ZTSCH(ZT1,ZTS)) Q:'ZTS D
|
---|
65 | ..I $$MATCH(ZTS,ZTDUZ,ZTUSER) D SORT(ZT1,ZTS)
|
---|
66 | .Q
|
---|
67 | ;
|
---|
68 | F3 S ZT1="" F S ZT1=$O(^%ZTSCH("IO",ZT1)) Q:ZT1="" D
|
---|
69 | .S ZT2="" F S ZT2=$O(^%ZTSCH("IO",ZT1,ZT2)) Q:'ZT2 D
|
---|
70 | ..S ZTS="" F S ZTS=$O(^%ZTSCH("IO",ZT1,ZT2,ZTS)) Q:ZTS="" D
|
---|
71 | ...I $$MATCH(ZTS,ZTDUZ,ZTUSER) D SORT(ZT2,ZTS)
|
---|
72 | .Q
|
---|
73 | ;
|
---|
74 | F4 S ZT1="" F S ZT1=$O(^%ZTSCH("LINK",ZT1)) Q:ZT1="" D
|
---|
75 | .S ZT2="" F S ZT2=$O(^%ZTSCH("LINK",ZT1,ZT2)) Q:'ZT2 D
|
---|
76 | ..S ZTS=0 F S ZTS=$O(^%ZTSCH("LINK",ZT1,ZT2,ZTS)) Q:'ZTS D
|
---|
77 | ...I $$MATCH(ZTS,ZTDUZ,ZTUSER) D SORT(ZT2,ZTS)
|
---|
78 | .Q
|
---|
79 | W "finished!",!
|
---|
80 | ;
|
---|
81 | F5 ;
|
---|
82 | G:$O(^TMP($J,0))="" F6
|
---|
83 | S ZTSAVE("^TMP($J,")="" D EN^XUTMDEVQ("LIST^XUTMQ","TASK LIST",.ZTSAVE)
|
---|
84 | K ^TMP($J)
|
---|
85 | Q
|
---|
86 | S ZT1="" F S ZT1=$O(^TMP($J,ZT1),-1) Q:ZT1="" D I ZTOUT Q
|
---|
87 | . S ZTS=0 F S ZTS=$O(^TMP($J,ZT1,ZTS)) Q:'ZTS D I ZTOUT Q
|
---|
88 | .. D PRINT
|
---|
89 | . Q
|
---|
90 | I ZTOUT Q
|
---|
91 | ;
|
---|
92 | F6 I 'ZTC W !! D
|
---|
93 | .I ZTKEY W ZTUSER," has"
|
---|
94 | .E W "You have"
|
---|
95 | .W " no scheduled or waiting tasks in this volume set's Task File.",!
|
---|
96 | W ! S DIR(0)="E"
|
---|
97 | S DIR("A")="Press RETURN to continue" I ZTC D
|
---|
98 | .S DIR("A")="End of listing. "_DIR("A")
|
---|
99 | D ^DIR K ^TMP($J) Q
|
---|
100 | ;
|
---|
101 | KEY ;ALL/FUT--set up variables for chosen user
|
---|
102 | ;input: ZTKEY,ZTNAME
|
---|
103 | ;input/output: ZTH,ZTOUT
|
---|
104 | ;output: ZTDUZ,ZTUSER
|
---|
105 | N DIR,DIRUT,DTOUT,DUOUT,X,Y
|
---|
106 | I 'ZTKEY S ZTDUZ=DUZ,ZTUSER=ZTNAME,ZTH=ZTH_"you." Q
|
---|
107 | W !!,"Select the user whose tasks you wish to see.",!!
|
---|
108 | S DIR(0)="P^200:AEMNQ"
|
---|
109 | S DIR("B")=ZTNAME
|
---|
110 | S DIR("?")="Select the user whose tasks you wish to see."
|
---|
111 | K D ^DIR K DIR
|
---|
112 | I $D(DTOUT) W " ** TIMEOUT **",$C(7)
|
---|
113 | I $D(DUOUT) W " ** ^ ESCAPE **"
|
---|
114 | I $D(DIRUT) S ZTOUT=1 Q
|
---|
115 | W !!,"Please wait while I search for the tasks...searching..."
|
---|
116 | S ZTDUZ=$P(Y,U),ZTUSER=$P(Y,U,2)
|
---|
117 | I ZTUSER'=ZTNAME S ZTH=ZTH_$P(ZTUSER,",",2,999)_" "_$P(ZTUSER,",")_"."
|
---|
118 | E S ZTH=ZTH_"you."
|
---|
119 | Q
|
---|
120 | ;
|
---|
121 | MATCH(ZTS,ZTDUZ,ZTREC) ;
|
---|
122 | ;ALL/FUT--determine whether task was created by user
|
---|
123 | ;input: task #, user #, user name
|
---|
124 | ;output: Boolean, does task belong to user?
|
---|
125 | S ZTREC=$G(^%ZTSK(ZTS,0))
|
---|
126 | I ZTREC="" Q 0
|
---|
127 | I $P(ZTREC,U,3)'=ZTDUZ Q 0
|
---|
128 | I $P(ZTREC,U,10)="" Q 1
|
---|
129 | Q $P(ZTREC,U,10)=ZTUSER
|
---|
130 | ;
|
---|
131 | SORT(ZTDTH,ZTSK) ;
|
---|
132 | ;ALL/FUT--sort task by start time.
|
---|
133 | ;input: start time, task number
|
---|
134 | ;output: ^TMP($J) node
|
---|
135 | I ZTDTH["," S ZTDTH=$$H3^%ZTM(ZTDTH)
|
---|
136 | S ^TMP($J,ZTDTH,ZTSK)=""
|
---|
137 | Q
|
---|
138 | ;
|
---|
139 | PRINT ;ALL/FUT--print a task
|
---|
140 | ;input: ZTH,ZTKEY,ZTNAME,ZTS,XUTMUCI
|
---|
141 | ;input/output: ZTC,ZTF
|
---|
142 | ;output: ZTOUT
|
---|
143 | N DIR,DIRUT,DTOUT,DUOUT,X,Y,ZTSK
|
---|
144 | I 'ZTC W @IOF,!,ZTH,!
|
---|
145 | I 'ZTF W !,"-------------------------------------------------------------------------------"
|
---|
146 | S ZTF=0
|
---|
147 | D EN^XUTMTP(ZTS)
|
---|
148 | I $Y'>18 S ZTC=ZTC+1 Q
|
---|
149 | W ! S ZTF=1,DIR(0)="E" D ^DIR
|
---|
150 | S ZTOUT=$D(DTOUT)!$D(DUOUT) I ZTOUT Q
|
---|
151 | W @IOF Q
|
---|
152 | ;
|
---|