Rev 15117 | Rev 15636 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 15117 | Rev 15144 | ||
---|---|---|---|
Line 10... | Line 10... | ||
10 | 10 | ||
11 | !bound job2 within newmsg,$empty default $empty |
11 | !bound job2 within newmsg,$empty default $empty |
12 | !if $cf_preview!=$empty |
12 | !if $cf_preview!=$empty |
13 | job2=newmsg |
13 | job2=newmsg |
14 | !endif |
14 | !endif |
15 | - | ||
16 | - | ||
17 | 15 | ||
18 | ltfile=!sh cd $wims_home/log/classes/$wims_class/tchat; if [ -e $user.old1 ]; then ls $user.old*; fi; |
16 | ltfile=!sh cd $wims_home/log/classes/$wims_class/tchat; if [ -e $user.old1 ]; then ls $user.old*; fi; |
19 | nbfile=!linecnt $ltfile |
17 | nbfile=!linecnt $ltfile |
20 | 18 | ||
21 | !if $save!=$empty and $desc!=$empty and $cf_preview=$empty |
19 | !if $save!=$empty and $desc!=$empty and $cf_preview=$empty |
Line 24... | Line 22... | ||
24 | dt=!char 1 to 14 of $wims_now |
22 | dt=!char 1 to 14 of $wims_now |
25 | rcnt=!recordcnt wimshome/log/classes/$wims_class/tchat/$user |
23 | rcnt=!recordcnt wimshome/log/classes/$wims_class/tchat/$user |
26 | !if $rcnt>=$msg_recordlimit |
24 | !if $rcnt>=$msg_recordlimit |
27 | !increase nbfile |
25 | !increase nbfile |
28 | !sh mv $wims_home/log/classes/$wims_class/tchat/$user $wims_home/log/classes/$wims_class/tchat/$(user).old$nbfile; |
26 | !sh mv $wims_home/log/classes/$wims_class/tchat/$user $wims_home/log/classes/$wims_class/tchat/$(user).old$nbfile; |
29 | !endif |
27 | !endif |
30 | !appendfile wimshome/log/classes/$wims_class/tchat/$user :$wims_user $dt\ |
28 | !appendfile wimshome/log/classes/$wims_class/tchat/$user :$wims_user $dt\ |
31 | $desc |
29 | $desc |
32 | !reset job2 desc save |
30 | !reset job2 desc save |
33 | !endif |
31 | !endif |
34 | 32 | ||
35 | !if $nbfile=0 |
33 | !if $nbfile=0 |
36 | lastmsg=!recordcnt wimshome/log/classes/$wims_class/tchat/$user |
34 | lastmsg=!recordcnt wimshome/log/classes/$wims_class/tchat/$user |
37 | nbmsg=$[min($msg_numberlimit,$lastmsg)] |
35 | nbmsg=$[min($msg_numberlimit,$lastmsg)] |
38 | !else |
36 | !else |
39 | nbmsg=$msg_numberlimit |
37 | nbmsg=$msg_numberlimit |
40 | !endif |
38 | !endif |
41 | !if $wims_user=supervisor |
39 | !if $wims_user=supervisor |
42 | !if . isin $user |
40 | !if . isin $user |
43 | n=!text select 0123456789 in $user |
41 | n=!text select 0123456789 in $user |
44 | name_title=!nosubst $(livingname_$n) |
42 | name_title=!nosubst $(livingname_$n) |
45 | !else |
43 | !else |
Line 58... | Line 56... | ||
58 | otherliving=!listcomplement $user in $livingfile,$wims_user |
56 | otherliving=!listcomplement $user in $livingfile,$wims_user |
59 | !endif |
57 | !endif |
60 | ses=!replace internal _ by , in $wims_session |
58 | ses=!replace internal _ by , in $wims_session |
61 | ses=!item 1 of $ses |
59 | ses=!item 1 of $ses |
62 | !setdef wims_opentchat=$user in wimshome/sessions/$ses/var.stat |
60 | !setdef wims_opentchat=$user in wimshome/sessions/$ses/var.stat |
63 | 61 | ||
64 | !! ------- build of userpage supervisor can look |
62 | !! ------- build of userpage supervisor can look |
65 | !! userpage can't be view in living (only in individual tchat) : todo ? |
63 | !! userpage can't be view in living (only in individual tchat) : todo ? |
66 | !if $wims_user=supervisor and $user isitemof $wims_connectedlogin and . notin $user |
64 | !if $wims_user=supervisor and $user isitemof $wims_connectedlogin and . notin $user |
67 | !readproc script/getsession.proc $user |
65 | !readproc script/getsession.proc $user |
68 | !endif |
66 | !endif |
Line 81... | Line 79... | ||
81 | !if $listnameusers!=$empty |
79 | !if $listnameusers!=$empty |
82 | listnameusers=, $name_yourself $name_and $listnameusers |
80 | listnameusers=, $name_yourself $name_and $listnameusers |
83 | !else |
81 | !else |
84 | listnameusers=$name_and $name_yourself |
82 | listnameusers=$name_and $name_yourself |
85 | !endif |
83 | !endif |
86 | !endif |
84 | !endif |
87 | !else |
85 | !else |
88 | !if $wims_user=supervisor |
86 | !if $wims_user=supervisor |
89 | po=!positionof item $user in $ulist |
87 | po=!positionof item $user in $ulist |
90 | listnameusers=$name_and $(nlist[$po]) |
88 | listnameusers=$name_and $(nlist[$po]) |
91 | !else |
89 | !else |
92 | listnameusers=$name_and $name_yourself |
90 | listnameusers=$name_and $name_yourself |
93 | !endif |
91 | !endif |
94 | !endif |
92 | !endif |
95 | - | ||
96 | 93 | ||
97 | !! ------- manage of autorefresh |
94 | !! ------- manage of autorefresh |
98 | !if $job2!=newmsg |
95 | !if $job2!=newmsg |
99 | !if $wims_user=supervisor |
96 | !if $wims_user=supervisor |
100 | autorefresh=yes |
97 | autorefresh=yes |
101 | !else |
98 | !else |
- | 99 | !! variable autorefresh is the status of autorefresh yes on ; no : off |
|
- | 100 | !! variable mautorefresh is the type of autorefresh user want. |
|
- | 101 | !! if mautorefresh is empty then autorefresh is automatically fixed. Two case |
|
- | 102 | !! in personnal living : to yes if last message is user and no if last message is supervisor |
|
- | 103 | !! in case of mautorefresh give same status as autorefresh, mautorefresh |
|
- | 104 | !! is reset to come back to automatically manage |
|
- | 105 | !! other : always yes |
|
- | 106 | !! if mautorefresh=0 then autorefresh is fixed to no |
|
- | 107 | !! if mautorefresh=1 then autorefresh is fixed to yes |
|
- | 108 | !bound mautorefresh within yes,no default $empty |
|
102 | lastauth=!record -1 of wimshome/log/classes/$wims_class/tchat/$user |
109 | lastauth=!record -1 of wimshome/log/classes/$wims_class/tchat/$user |
103 | lastauth=!line 1 of $lastauth |
110 | lastauth=!line 1 of $lastauth |
104 | lastauth=!word 1 of $lastauth |
111 | lastauth=!word 1 of $lastauth |
105 | !if $lastauth=$wims_user or $user!=$wims_user |
112 | !if $lastauth=$wims_user or $user!=$wims_user |
106 |
|
113 | wautorefresh=yes |
107 | !else |
114 | !else |
108 |
|
115 | wautorefresh=no |
- | 116 | !endif |
|
- | 117 | !if $wautorefresh=$mautorefresh |
|
109 |
|
118 | !reset mautorefresh |
110 |
|
119 | !endif |
111 |
|
120 | !if $mautorefresh=$empty |
- | 121 | autorefresh=$wautorefresh |
|
112 |
|
122 | !else |
- | 123 | autorefresh=$mautorefresh |
|
113 | !endif |
124 | !endif |
114 | !endif |
125 | !endif |
115 | !if $autorefresh=yes |
126 | !if $autorefresh=yes |
116 | !let rd=!randint 111111,999999 |
127 | !let rd=!randint 111111,999999 |
117 | 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"> |
128 | 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&+mautorefresh=$mautorefresh"> |
118 | !endif |
129 | !endif |
119 | !endif |
130 | !endif |
120 | 131 | ||
121 | 132 | ||
122 | 133 |