!if $(module_description_$moduclass_lang)!=$empty
  !set module_description=$(module_description_$moduclass_lang)
!endif
!read adm/title.phtml 1\
$classname\
$module_description\
$wims_name_sequence $seq

$name_addseq

!! Read some translation vars (like $C_A)
!readproc adm/search_engine/names.$lang

!set data=!record 1 of wimshome/log/classes/$wims_class/seq/.sequence$seq
!form reply
  <label for="seq_title">$wims_name_title</label>: <input id="seq_title" name="seq_title" size="12" value="$(data[1;])">
  $
  <label for="seq_desc"> $wims_name_Description</label>: <input id="seq_desc" name="seq_desc" size="20" value="$(data[2;])">
  $
  <label for="visible">$wims_name_Status</label>:
  !set visible=$(data[4;])
  !formselect visible list 0,1 prompt $wims_name_shstatus[0..1]
  $table_header
    <caption>$wims_name_Docs, $wims_name_Votes & $C_A</caption>

    $table_hdtr<th scope="col">$wims_name_title</th>
    <th scope="col">$wims_name_Status</th>
    <th scope="col">$wims_name_Position</th></tr>

    !set listc=!filelist $wims_home/log/classes/$wims_class/doc
    !set listc=!replace internal c by in $listc
    !set listc=!lines2items $listc
    !set listc=!sort numeric items $listc

!for i=1 to $doccnt
  !set ci_=!item $(wims_sort_order[$i]) of $listc
  !set sh=!record $ci_ of wimshome/log/classes/$wims_class/doc/.index
  !distribute lines $sh into s_,t_,bidon,bidon,bidon,o_
  !set ss_=!replace internal c by c$ $ in $s_
  !set c_$i=!positionof item $ss_ in $(data[3;])
  !set ss_=!replace internal c by c_ in $s_
  !if $s_!=
    $table_tr
      <td>
        <label for="$ss_">
        !set wims_ref_class=wims_doc_item
        !href module=adm/doc&job=read&doc=$s_&block=main $t_
        </label>
      </td><td class="wims_status_$o_">
        !item $[$o_+1] of $wims_name_status
        !set wims_ref_class=wims_button
        !href module=adm/doc&job=prop&doc=$s_ $wims_name_change
      </td><td>
        <input type="number" name="$ss_" size="5" value="$(c_$i)" id="$ss_">
      </td>
    </tr>
  !endif
!next i

!for i=1 to $docpubliccnt
  !set sh=!record $i of wimshome/log/classes/$wims_class/doc/.docindex
  !distribute lines $sh into s_,t_,ti,d_,o_
  $table_tr
    <td>
      !set wims_ref_class=wims_doc_item
      <label for="doc_$i">
        !href module=$s_&$t_ $ti
      </label>
    </td><td class="wims_status_$o_">
      !item $[$o_+1] of $wims_name_status
      !set wims_ref_class=wims_button
      !href module=adm/class/adddoc&job=prop&doc=$i $wims_name_change
    </td><td>
      !set doc_$i=!positionof item doc $i in $(data[3;])
      <input type="number" name="doc_$i" size="5" value="$(doc_$i)" id="doc_$i">
    </td>
  </tr>
!next i

!for i=1 to $sheetcnt
  !set sh=!record $i of wimshome/log/classes/$wims_class/sheets/.sheets
  !distribute lines $sh into ac,t_,ti
  $table_tr
    <td>
      !set wims_ref_class=wims_sheet_item
      <label for="sheet_$i">
        !href module=adm/class/sheet&sheet=$i $ti
      </label>
    </td><td class="wims_status_$ac">
      $(wims_name_shstatus[$ac+1])
    </td><td>
      !set sheet_$i=!positionof item sheet $i in $(data[3;])
      <input type="number" name="sheet_$i" size="5" value="$(sheet_$i)" id="sheet_$i">
    </td>
  </tr>
!next i

!!set examcnt=!recordcnt wimshome/log/classes/$wims_class/exams/.exams
!for i=1 to $examcnt
  !set sh=!record $i of wimshome/log/classes/$wims_class/exams/.exams
  !distribute lines $sh into ac,t_,d_,ti
  $table_tr
    <td>
      <label for="exam_$i">
        !set wims_ref_class=wims_exam_item
        !href module=adm/class/exam&exam=$i $ti
      </label>
    </td><td class="wims_status_$ac">
      $(wims_name_shstatus[$ac+1])
    </td><td>
      !set exam_$i=!positionof item exam $i in $(data[3;])
      <input type="number" name="exam_$i" size="5" value="$(exam_$i)" id="exam_$i">
    </td>
  </tr>
!next i

!!set votecnt=!recordcnt wimshome/log/classes/$wims_class/vote/.votes
!for i=1 to $votecnt
  !set sh=!record $i of wimshome/log/classes/$wims_class/vote/.votes
  !distribute lines $sh into st_,ti_,op_,re_
  $table_tr
    <td>
      <label for="vote_$i">
        !set wims_ref_class=wims_vote_item
        !href module=adm/vote&job=read&vote=$i $ti_
      </label>
    </td><td class="wims_status_$st_">
      $(wims_name_status[$st_+1])
    </td><td>
      !set vote_$i=!positionof item vote $i in $(data[3;])
      <input type="number" name="vote_$i" size="5" value="$(vote_$i)" id="vote_$i">
    </td>
  </tr>
!next i

!for i=1 to $toolcnt
  !set sh=!record $i of wimshome/log/classes/$wims_class/tool/.toolindex
  !distribute lines $sh into s_,t_,ti,d_,o_
  $table_tr
    <td>
      <label for="tool_$i">
        !set wims_ref_class=wims_tool_item
        !href module=$s_&$t_ $ti
      </label>
    </td><td class="wims_status_$o_">
      !item $[$o_+1] of $wims_name_status
      !set wims_ref_class=wims_button
      !href module=adm/class/adddoc&job=prop&tool=$i $wims_name_change
    </td><td>
      !set doc_$i=!positionof item tool $i in $(data[3;])
      <input type="number" name="tool_$i" size="5" value="$(tool_$i)" id="tool_$i">
    </td>
  </tr>
!next i

!for i=1 to $glossarycnt
  !set sh=!record $i of wimshome/log/classes/$wims_class/tool/.glossaryindex
  !distribute lines $sh into o_,ti
  $table_tr
    <td>
      <label for="glossary_$i">
        !set wims_ref_class=wims_glossary_item
        !href module=adm/tool/glossary&gl=$i $ti
      </label>
    </td><td class="wims_status_$o_">
      !item $[$o_+1] of $wims_name_status
      !set wims_ref_class=wims_button
      !href module=adm/class/glossary&job=chstatus&gl=$i $wims_name_change
    </td><td>
      !set glossary_$i=!positionof item glossary $i in $(data[3;])
      <input type="number" name="glossary_$i" size="5" value="$(glossary_$i)" id="glossary_$i">
    </td>
  </tr>
!next i

!for i=1 to $freeworkcnt
  !set sh=!record $i of wimshome/log/classes/$wims_class/freeworks/.freeworks
  !distribute lines $sh into o_,bl,ti
  $table_tr
    <td>
      <label for="freework_$i">
        !set wims_ref_class=wims_freework_item
        !href module=adm/class/freework/&freework=$i $ti
      </label>
    </td><td class="wims_status_$o_">
      $(wims_name_shstatus[$o_+1])
    </td><td>
      !set freework_$i=!positionof item freework $i in $(data[3;])
      <input type="number" name="freework_$i" size="5" value="$(freework_$i)" id="freework_$i">
    </td>
  </tr>
!next i


$table_end
<div class="wimscenter wimsform"><input type="submit" value="$wims_name_tosave"></div>
!formend
