Subversion Repositories wimsdev

Rev

Rev 5181 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
23 reyssat 1
# Variable calculations should be done in this file.
2
# It is read and interpreted by wims for all valid calls to the module.
5181 guerimand 3
!read adm/language lang/names.phtml
13135 obado 4
 
23 reyssat 5
max_modules=50
6
 
7
!if $cmd=new or $cmd=renew
13135 obado 8
  sitestart=!mexec getstart.sh
23 reyssat 9
!endif
10
 
11
!bound style within day,week,month,year,beginning default week
12
!bound plot_type within 2,3,4 default 2
13
 
14
start_year=!char 1,2,3,4 of $sitestart
15
start_month=!char 5,6 of $sitestart
16
start_day=!char 7,8 of $sitestart
1059 bpr 17
insplot_set=timefmt "%Y%m%d"; xdata time; tmargin 1; nomxtics; nox2tics; size 0.7,0.7
23 reyssat 18
insplot_transparent=white
19
module_type=!item $plot_type of 1,1,2,3
20
!read tabletheme
21
!read adm/class/stat
22
 
23
!if $cmd=reply
13135 obado 24
  show=yes
25
  !read date
26
  !if $date1<$start_year$start_month$start_day
27
    date1=$start_year$start_month$start_day
28
  !endif
29
  stat_out=!mexec stat.sh
30
  !read stat
31
  wims_module_log=$cnt $style modules=$modules
23 reyssat 32
!endif
33
 
34
!for i in 1,2
13135 obado 35
  year$i=!char 1 to 4 of $(date$i)
36
  month$i=!char 5,6 of $(date$i)
37
  day$i=!char 7,8 of $(date$i)
38
  date_$i=!date -d $(date$i) '+%j'
23 reyssat 39
!next i
40
 
41
laps=!eval ($year2-$year1)*365+$date_2-$date_1+1
42
!ifval floor($year1/4)<floor($year2/4) and floor($year1/100)=floor($year2/100)
13135 obado 43
  laps=!eval $laps+1
23 reyssat 44
!endif
45
 
46
# plotting data
47
!if $cmd=reply
13135 obado 48
  !if $laps<20
49
    step=1
50
    dateformat=$format1
23 reyssat 51
  !else
13135 obado 52
    !if $laps<36
53
      step=2
54
      dateformat=$format1
55
    !else
56
      !if $laps<70
57
        step=4
58
        dateformat=$format2
59
      !else
60
        step=!eval 7*ceil($laps/(7*50))
61
        dateformat=$format3
62
      !endif
63
    !endif
23 reyssat 64
  !endif
13135 obado 65
  insplot_set=$insplot_set;format x "$dateformat"
66
  insplot_data=!mexec plotdata.sh
23 reyssat 67
!endif