Rev 16926 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
16903 | guerimand | 1 | !if $wims_show_stat!=yes |
2 | error=nostat |
||
3 | notallowed=1 |
||
4 | !exit |
||
5 | !endif |
||
6 | !if $wims_user!=supervisor |
||
7 | user=$wims_user |
||
8 | !else |
||
9 | !if $ulist=$empty |
||
10 | !! --- check for list of user |
||
11 | nbuser=!recordcnt wimshome/log/classes/$wims_class/.userlist |
||
12 | !reset ulist,flist,llist,uulist |
||
13 | !for i=1 to $nbuser |
||
14 | u_=!record $i of wimshome/log/classes/$wims_class/.userlist |
||
15 | !distribute item $u_ into l_,f_,n_ |
||
16 | ulist=!append item $n_ to $ulist |
||
17 | flist=!append item $f_ to $flist |
||
18 | llist=!append item $l_ to $llist |
||
19 | !next i |
||
20 | !endif |
||
21 | !bound user within $ulist,$empty default $empty |
||
22 | !endif |
||
23 | |||
24 | job_title=!nosubst $name_workingtime |
||
25 | !if $user=$empty |
||
26 | !exit |
||
27 | !endif |
||
28 | |||
29 | !read wimshome/log/classes/$wims_class/.def |
||
30 | older=!sh date +%Y%m%d -d "1 year ago"; |
||
31 | date=$[max($class_creation,$older)] |
||
32 | now=!char 1 to 8 of $wims_now |
||
33 | !readproc adm/calendar.proc prevday $now |
||
34 | enddate=$[min($class_expiration,$output)] |
||
35 | mois=!char 5 to 6 of $date |
||
36 | !readproc adm/calendar.proc whatday $date |
||
37 | dnum=!word 1 of $output |
||
38 | !readproc adm/calendar.proc endmonth $date |
||
39 | wnum=$[ceil(($output-(7-$dnum+1))/7)+1] |
||
40 | test=!fileexists wimshome/sessions/$wims_session/$user.st |
||
41 | !if $test!=yes |
||
42 | test=!sh awk -F" " 'BEGIN {d=0;v=0} {if (substr($$1,1,8)==d) {v+=$$2} else {if (d!=0) print ":"d","v;d=substr($$1,1,8);v=$$2}}' $wims_home/log/ccaccount/$wims_class/$user > $wims_home/sessions/$wims_session/$user.st; |
||
43 | !endif |
||
44 | nbactivity=!recordcnt wimshome/sessions/$wims_session/$user.st |
||
45 | !if $nbactivity>0 |
||
46 | cpta=0 |
||
47 | activity=0,0 |
||
48 | !while $cpta<$nbactivity and $(activity[1])<$date |
||
49 | !increase cpta |
||
50 | activity=!record $cpta of wimshome/sessions/$wims_session/$user.st |
||
51 | !endwhile |
||
52 | !endif |
||
53 | !! ----- first item is color for 0 activity (maybe zone number and color can be paramétrizable ?) |
||
54 | ltcolor=white,red,yellow,orange,green |
||
55 | !! ------ time for each zone |
||
56 | utime=$class_utime |
||
57 | !default utime=15 |
||
58 | |||
59 | !! make data for the student |
||
60 | !reset data,lt_month |
||
61 | !while $date<$enddate |
||
62 | !increase wcount |
||
63 | !if $wcount=1 |
||
64 | lt_month=!append line $wnum,$mois to $lt_month |
||
65 | !endif |
||
66 | !reset ligne |
||
67 | !for k=1 to 7 |
||
68 | !ifval $k=$dnum and $date<$enddate |
||
69 | !if $(activity[1])=$date |
||
70 | col=$[min(ceil($(activity[2])/$utime),4)+1] |
||
71 | ligne=!append item $col $date $(activity[2]) to $ligne |
||
72 | !increase cpta |
||
73 | !if $cpta<=$nbactivity |
||
74 | activity=!record $cpta of wimshome/sessions/$wims_session/$user.st |
||
75 | !endif |
||
76 | !else |
||
77 | ligne=!append item 1 $date to $ligne |
||
78 | !endif |
||
79 | !readproc adm/calendar.proc nextday $date |
||
80 | date=$output |
||
81 | month=!char 5 to 6 of $date |
||
82 | !if $dnum=7 |
||
83 | dnum=1 |
||
84 | !else |
||
85 | !increase dnum |
||
86 | !endif |
||
87 | !ifval $month!=$mois |
||
88 | wcount=0 |
||
89 | mois=$month |
||
90 | !readproc adm/calendar.proc endmonth $date |
||
91 | wnum=$[ceil(($output-(7-$dnum+1))/7)+1] |
||
92 | !if $dnum!=1 |
||
93 | flag=$dnum |
||
94 | !reset dnum |
||
95 | !endif |
||
96 | !endif |
||
97 | !else |
||
98 | ligne=$ligne, |
||
99 | !if $flag!=$empty |
||
100 | dnum=$flag |
||
101 | !reset flag |
||
102 | !endif |
||
103 | !endif |
||
104 | !next k |
||
105 | data=!append line $ligne to $data |
||
106 | !endwhile |
||
107 | nb_dtl=!linecnt $data |
||
108 |