Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
14876 guerimand 1
!! ------- display list of user of the living
15261 obado 2
<div id="living_props">
14876 guerimand 3
  <strong>$name_regusers</strong>: $name_teacher
4
  !if $(livingusers_$living)=all
5
    $name_and $(name_all).
6
  !else
7
    $(listnameusers).
8
  !endif
9
</div>
14861 guerimand 10
 
15636 guerimand 11
!if $tchat_configfilesize>0 and . notin $user
12
!! html interface to upload a file + show actual file
13
  !if $wims_user!=supervisor
14
    !set wims_form_method=file
15
    !form reply
16
      <div class="field box">
17
        <input type="hidden" name="job" value="uploadfile" />
18
        <label for="deposit">$name_depos:</label>
16671 guerimand 19
        <input type="file" size="35" name="wims_deposit" id="deposit" onchange="document.getElementById('msgerror').style.display='none'" />
20
        <input type="submit" value="$wims_name_submit" class="wims_button" />
15636 guerimand 21
        !if $usertmpfile!=$empty
22
          $name_actualfile:
23
  !!        !getfile tchat/$usertmpfile $usertmpfile
24
          <a href="$wims_protocol://$httpd_HTTP_HOST/wims/getfile/tchat/$usertmpfile?session=$wims_session" download="$usertmpfile">$usertmpfile</a>
25
        !endif
26
        <div class="formHelp">$name_usertmpfiledesc</div>
27
      </div>
28
  !else
29
    !let nb=!linecnt $list_tmpfile
30
    !if $nb>0
31
      <div class="field box">
32
        $name_depos2:
33
        !let nb=!linecnt $list_tmpfile
34
        !for k=1 to $nb
35
  !!        !getfile tchat/$user/$(list_tmpfile[$k;2]) $(list_tmpfile[$k;2])
36
          <a href="$wims_protocol://$httpd_HTTP_HOST/wims/getfile/tchat/$user/$(list_tmpfile[$k;2])?session=$wims_session" download="$(list_tmpfile[$k;2])">$(list_tmpfile[$k;2])</a>
37
        !next k
38
      </div>
39
    !endif
40
  !endif
41
!endif
42
 
14777 guerimand 43
!if $job2=newmsg
15055 obado 44
  !form reply
45
    <fieldset class="property_fields blockcenter">
14777 guerimand 46
      <input type="hidden" name="job" value="edit"/>
47
      <div class="field box fullwidth">
15117 guerimand 48
        <label for="desc">$wims_name_newmsg</label>
14976 guerimand 49
        !let insmath_rawmath=no
50
        !let wims_backslash_insmath=no
15055 obado 51
        <textarea id="desc" name="desc" rows="6" maxlength="$msg_limit" required>$desc</textarea>
14976 guerimand 52
        !let insmath_rawmath=yes
53
        !let wims_backslash_insmath=yes
14777 guerimand 54
      </div>
14976 guerimand 55
      !if $desc!=$empty
56
        <div class="field box fullwidth">
57
          <strong>$name_Message</strong>: $desc
58
        </div>
59
      !endif
14777 guerimand 60
      <div class="wimscenter">
61
        <input type="submit" name="save" value="$wims_name_tosave"/>
14783 guerimand 62
        &nbsp;
15055 obado 63
        !set wims_ref_class=wims_button wims_secondary_button
64
        !href module=adm/class/tchat $wims_name_giveup
14976 guerimand 65
        &nbsp;
66
        <input type="submit" name="cf_preview" value="$name_preview" class="wims_secondary_button" />
14777 guerimand 67
      </div>
15055 obado 68
    </fieldset>
69
  !formend
14777 guerimand 70
!else
15117 guerimand 71
  !let wims_menu_items=!append line newmsg,1,cmd=reply&+job=edit&+job2=newmsg to $wims_menu_items
14777 guerimand 72
!endif
14877 guerimand 73
 
15117 guerimand 74
 
14877 guerimand 75
!! display for viewsession (list for supervisor and warning for user)
76
!if . notin $user
14777 guerimand 77
  !if $wims_user=supervisor
15261 obado 78
    !if $list_window!=$empty
79
      $name_viewpage
80
        !let nbses=!itemcnt $list_window
81
        !for k=1 to $nbses
82
          !if $(list_window[$k])!=$empty
83
              &nbsp;
84
              !set wims_ref_class=wims_button
85
              !set rd=!randint 111111,999999
16364 guerimand 86
              !set tmp=!line $k of $list_title
87
              !href target=wims_check module=adm/class/tchat&+job=viewpage&+numberses=$k&+user=$user&+serial=$rd $tmp
15261 obado 88
          !endif
89
        !next k
90
    !else
91
      <div class="wims_msg info">
15117 guerimand 92
        !if $userconnected=no
93
          $name_partnotconnected
94
        !else
95
          !if $sharescreen=no
96
            $name_nosharingscreen
97
          !else
98
            $name_nopagetoview
99
          !endif
100
        !endif
15261 obado 101
      </div>
102
    !endif
14777 guerimand 103
  !endif
14877 guerimand 104
!endif
14777 guerimand 105
 
15261 obado 106
<div class="msg_list">
14777 guerimand 107
!if $nbmsg>0
15261 obado 108
  !let nblastrecord=!recordcnt wimshome/log/classes/$wims_class/tchat/$user
109
  !for k=1 to $nbmsg
110
    <div class="tchat-item">
14777 guerimand 111
      !if $k<=$nblastrecord
15068 guerimand 112
        !let mem_file=$user
113
        !let mem_rec=-$k
14777 guerimand 114
      !else
15068 guerimand 115
        !let mem_file=$(user).old$nbfile
116
        !let mem_rec=-$[$k-$nblastrecord]
14777 guerimand 117
      !endif
15068 guerimand 118
      !let data=!record $mem_rec of wimshome/log/classes/$wims_class/tchat/$mem_file
14777 guerimand 119
      !let tmp=!line 1 of $data
120
      !let msg=!line 2 to -1 of $data
121
      !let msg=!detag $msg
15068 guerimand 122
      !distribute word $tmp into muser,date,hide
14861 guerimand 123
      !if $muser!=supervisor
124
        !let type=user
125
        !let p=!positionof item $muser in $ulist
126
        !let username=$(nlist[$p])
127
      !else
128
        !let type=supervisor
129
      !endif
15068 guerimand 130
      !if $hide!=hide or $wims_user=supervisor
15261 obado 131
        <div class="tchat-msg tchat-$type
132
        !if $hide=hide
133
          tchat-hidden
134
        !endif
135
        ">
15068 guerimand 136
          <div class="tchat-date">
137
            !let dt1=!char 1 to 8 of $date
138
            !let dt2=!char 10 to 14 of $date
139
            !readproc adm/date.phtml $dt1
140
            $l_date_out $wims_name_at
141
            !replace internal : by H in $dt2
142
          </div>
15261 obado 143
          <div class="tchat-username">
144
            !if $type=supervisor
145
              $wims_name_nameteacher
146
            !else
147
              $username
148
            !endif
149
          </div>
150
          !if $hide=hide
151
            <span class="tchat-status">($(wims_name_status[1]))</span>
152
          !endif
153
          <div class="tchat-text">$msg</div>
15068 guerimand 154
        </div>
155
        !if $wims_user=supervisor
15261 obado 156
          <div class="tchat-actions">
15068 guerimand 157
            !let wims_ref_class=wims_button
158
            !if $hide=hide
15261 obado 159
              !href cmd=reply&+module=$module&+job=showhide&+mem_file=$mem_file&+mem_rec=$mem_rec&+user=$user#living_props $wims_name_Show
15068 guerimand 160
            !else
15261 obado 161
              !href cmd=reply&+module=$module&+job=showhide&+mem_file=$mem_file&+mem_rec=$mem_rec&+user=$user#living_props $wims_name_hide
15068 guerimand 162
            !endif
15261 obado 163
          </div>
14777 guerimand 164
        !endif
15068 guerimand 165
      !endif
15261 obado 166
    </div>
167
  !next k
14777 guerimand 168
!else
169
  $name_nomsg
170
!endif
15261 obado 171
</div>
14783 guerimand 172
 
15144 guerimand 173
!! ---------- make list of living and make link in the wims_menu_items
174
!if $wims_user!=supervisor and $otherliving!=$empty
175
    !let wims_menu_items=!append line itemsep,0,$name_living to $wims_menu_items
176
    !for k in $otherliving
177
      &nbsp;
178
      !if $k=$wims_user
179
        !let name=$name_ownliving
15166 bpr 180
        !let wims_name_livingown=$name_ownliving
181
        !let etiq=livingown
15144 guerimand 182
      !else
183
        !let name=!text select 0123456789 in $k
184
        !let name=$(livingname_$name)
185
        !let etiq=!char 2 to -1 of $k
186
        !let wims_name_$etiq=$name
187
      !endif
188
      !let wims_menu_items=!append line $etiq,1,module=$module&job=edit&user=$k to $wims_menu_items
189
    !next k
190
!endif
191
 
192
!! ------ wims_menu_item for user
193
!if $wims_user!=supervisor
15166 bpr 194
  !set wims_menu_items=!append line ,0,$wims_name_setup to $wims_menu_items
15144 guerimand 195
  !if $wims_sharescreen=yes
15171 obado 196
    !set wims_menu_items=!append line living_stopshare,1,cmd=reply&+module=$module&+job=sharescreen\
15166 bpr 197
      to $wims_menu_items
15144 guerimand 198
  !else
15171 obado 199
    !set wims_menu_items=!append line living_activeshare,1,cmd=reply&+module=$module&+job=sharescreen\
15166 bpr 200
      to $wims_menu_items
15144 guerimand 201
  !endif
202
  !if $autorefresh=yes
15166 bpr 203
    !set wims_menu_items=!append line living_stoprefresh,1,cmd=resume&+module=$module&+job=edit&+mautorefresh=no\
204
      to $wims_menu_items
15144 guerimand 205
  !else
15166 bpr 206
    !set wims_menu_items=!append line living_activerefresh,1,cmd=resume&+module=$module&+job=edit&+mautorefresh=yes\
207
      to $wims_menu_items
15144 guerimand 208
  !endif
209
!endif
210
 
14976 guerimand 211
!reset job2,save,cf_abandon,cf_preview,desc