Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
14777 guerimand 1
!if $wims_user!=supervisor
14861 guerimand 2
  !bound user within $wims_user,$livingfile default $wims_user
14777 guerimand 3
!else
14861 guerimand 4
  !bound user within $ulist,$livingfile default $empty
14777 guerimand 5
!endif
6
!if $user=$empty
7
  !reset job
14861 guerimand 8
  !changeto var.proc
14777 guerimand 9
!endif
10
 
11
!bound job2 within newmsg,$empty default $empty
14976 guerimand 12
!if $cf_preview!=$empty
13
  job2=newmsg
14
!endif
14777 guerimand 15
 
14886 guerimand 16
!if $job2!=newmsg
17
  !let rd=!randint 111111,999999
14903 guerimand 18
  local_html_header=<META HTTP-EQUIV="Refresh" CONTENT="$(tchat_refreshtiming);wims.cgi?session=$wims_session&+module=adm/class/tchat&+serial=$rd&+job=$job&+user=$user">
14886 guerimand 19
!endif
20
 
14861 guerimand 21
ltfile=!sh cd $wims_home/log/classes/$wims_class/tchat; if [ -e $user.old1 ]; then ls $user.old*; fi;
14777 guerimand 22
nbfile=!linecnt $ltfile
23
 
14976 guerimand 24
!if $save!=$empty and $desc!=$empty and $cf_preview=$empty
14777 guerimand 25
  desc=!detag $desc
26
  desc=!char 1 to $msg_limit of $desc
27
  dt=!char 1 to 14 of $wims_now
28
  rcnt=!recordcnt wimshome/log/classes/$wims_class/tchat/$user
29
  !if $rcnt>=$msg_recordlimit
30
    !increase nbfile
31
    !sh mv $wims_home/log/classes/$wims_class/tchat/$user $wims_home/log/classes/$wims_class/tchat/$(user).old$nbfile;
32
  !endif
14861 guerimand 33
  !appendfile wimshome/log/classes/$wims_class/tchat/$user :$wims_user $dt\
14777 guerimand 34
$desc
14976 guerimand 35
  !reset job2 desc save
14777 guerimand 36
!endif
37
 
38
!if $nbfile=0
39
  lastmsg=!recordcnt wimshome/log/classes/$wims_class/tchat/$user
40
  nbmsg=$[min($msg_numberlimit,$lastmsg)]
41
!else
42
  nbmsg=$msg_numberlimit
43
!endif
44
!if $wims_user=supervisor
14861 guerimand 45
  !if . isin $user
46
    n=!text select 0123456789 in $user
47
    name_title=!nosubst $(livingname_$n)
48
  !else
49
    po=!positionof item $user in $ulist
50
    username=$(nlist[$po])
51
    name_title=$name_tchatwith $username
52
  !endif
14777 guerimand 53
!else
54
  username=Participant
14861 guerimand 55
  !if . isin $user
15047 guerimand 56
    n=!text select 0123456789 in $user
14861 guerimand 57
    name_title=!nosubst $(livingname_$n)
58
  !else
59
    name_title=$name_ownliving
60
  !endif
61
  otherliving=!listcomplement $user in $livingfile,$wims_user
14777 guerimand 62
!endif
14905 guerimand 63
ses=!replace internal _ by , in $wims_session
64
ses=!item 1 of $ses
14861 guerimand 65
!setdef wims_opentchat=$user in wimshome/sessions/$ses/var.stat
14777 guerimand 66
 
67
!! ------- build of userpage supervisor can look
14877 guerimand 68
!! userpage can't be view in living (only in individual tchat) : todo ?
69
!if $wims_user=supervisor and $user isitemof $wims_connectedlogin and . notin $user
14777 guerimand 70
   !readproc script/getsession.proc $user
71
!endif
14876 guerimand 72
 
14877 guerimand 73
!! ------ build of list of users
14876 guerimand 74
!if . isin $user
75
  living=!char -1 of $user
76
  !if $(livingusers_$living)!=all
77
    listnameusers=$empty
78
    !for u in $(livingusers_$living)
15047 guerimand 79
      po=!positionof item $u in $ulist
14876 guerimand 80
      !if $u!=supervisor and $u!=$wims_user and $po!=$empty
81
        listnameusers=!append item $(nlist[$po]) to $listnameusers
82
      !endif
83
    !next u
84
    !if $listnameusers!=$empty
85
      listnameusers=, $name_yourself $name_and $listnameusers
86
    !else
87
      listnameusers=$name_and $name_yourself
88
    !endif
89
  !endif
90
!else
14877 guerimand 91
  !if $wims_user=supervisor
92
    po=!positionof item $user in $ulist
93
    listnameusers=$name_and $(nlist[$po])
94
  !else
95
    listnameusers=$name_and $name_yourself
96
  !endif
14876 guerimand 97
!endif
98