Subversion Repositories wimsdev

Rev

Rev 16484 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
16479 guerimand 1
 
2
!! ------ check method
3
!bound method within all,select,login,filter default all
16482 guerimand 4
!bound selfsend within 0,1 default 0
5
!bound sendotherteacher within 0,1 default 0
16479 guerimand 6
 
16482 guerimand 7
save_selfsend=$selfsend
8
save_sendotherteacher=$sendotherteacher
16512 guerimand 9
save_subject=!char 1 to 100 of $subject
10
save_subject=!detag $save_subject
11
!!  -------- for the moment use detag
12
!!  script_data_input=!char 1 to 1000 of $msg
13
!!!readproc adm/partialdetag.proc variable
14
!! save_subject=$script_data_output
15
save_msg=!char 1 to 1000 of $msg
16
save_msg=!detag $save_msg
16482 guerimand 17
 
16479 guerimand 18
all_list=!values v for v=1 to $nb_user
19
!if $method=all
20
  sending_mail=$all_list
21
!endif
22
 
23
!if $method=select
24
  sending_mail=!listintersect $all_list and $select_user
25
!endif
26
 
27
!if $method=filter
28
  !reset sending_mail sending_nomail
29
  !for lu=1 to $nb_user
30
    us=!record $lu of wimshome/sessions/$wims_session/.userlist_mail
31
    !distribute item $us_ into l_name_,f_name_,login
32
    !read adm/vfilter/testfilter $(us[3])\
33
$varfilter_
34
    !if $var_filter_test=1
35
      sending_mail=!append item $lu to $sending_mail
36
    !endif
37
  !next lu
38
  nbbad=0
39
  !if $nbw_user>0
40
    !for lu=1 to $nbw_user
41
      us=!record $lu of wimshome/sessions/$wims_session/.userlist_nomail
42
      !distribute item $us_ into l_name_,f_name_,login
43
      !read adm/vfilter/testfilter $(us[3])\
44
$varfilter_
45
      !if $var_filter_test=1
46
        sending_nomail=!append item $lu to $sending_nomail
47
        !increase nbbad
48
      !endif
49
    !next lu
50
  !endif
51
!endif
52
 
53
!if $method=login
54
  !reset sending_mail valid_login
55
  !for lu=1 to $nb_user
56
    us=!record $lu of wimshome/sessions/$wims_session/.userlist_mail
57
    !distribute item $us into l_name_,f_name_,login
58
    !if $login isitemof $loginlist
59
      sending_mail=!append item $lu to $sending_mail
60
      valid_login=!append item $login to $valid_login
61
    !endif
62
  !next lu
63
  bad_list=!listcomplement $valid_login in $loginlist
64
  nbbad=!itemcnt $bad_list
65
!endif
66
 
67
nbsend=!itemcnt $sending_mail
68
!if $nbsend=0
69
  error=nousermail
70
  !reset job
71
  !exit
72
!endif
73
nbteacher=!recordcnt wimshome/sessions/$wims_session/.teacherlist_mail
74