Subversion Repositories wimsdev

Rev

Rev 13495 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. !! this process allow to generate a list (echoose) of series of exercices taken in active sheet
  2. !!
  3. !! to work this script need
  4. !! variables defined :
  5. !! asheets : list of active sheets
  6. !! echoose : list of actual series selected
  7. !! language variable to be defined
  8. !! name_All, name_selectsheet
  9. !! add to main.phtml before header
  10. !! !let js=!record 0 of js/chooselist.js
  11. !! !let wims_html_header=!append line $js to $wims_html_header
  12. !! in var.def echoose and ltsheets need to be define to any
  13. !!
  14. !! output
  15. !! variable echoose contain list of series selected format $sheet.$exo
  16. !!
  17.  
  18.  
  19. !let checked=$empty
  20. !set  select_option=style="width: 400px;" multiple="multiple" size="15"
  21. <table class="wimscenter wimstable">
  22.   <thead>
  23.     <tr>
  24.       <th>$name_Availables</th>
  25.       <th> </th>
  26.       <th>$name_Selected</th>
  27.     </tr>
  28.   </thead>
  29.   <tbody>
  30.   <tr>
  31.     <td style="vertical-align:top">
  32.  
  33.       !! list of available sheets
  34.       <div>
  35.         <label for="ltsheets">$name_selectsheet</label>
  36.         <select id="ltsheets" name="ltsheets"  value="$ltsheets"
  37.                 onchange="filterSelectExoSheet(this.form.elements['select_sheet1'], this.form.elements['ltsheets'])"
  38.                 >
  39.           !let ltsheets=!listintersect $asheets and $ltsheets
  40.           !if $ltsheets=$empty
  41.             !let ltsheets=$asheets
  42.           !endif
  43.           !if $ltsheets=$asheets
  44.             <option value="$asheets" selected="selected">$name_All</option>
  45.           !else
  46.             <option value="$asheets">$name_All</option>
  47.           !endif
  48.           !for k in $asheets
  49.             !if $ltsheets=$k
  50.               <option value="$k" selected="selected">
  51.             !else
  52.               <option value="$k">
  53.             !endif
  54.             !let t=!record $k of wimshome/log/classes/$wims_class/sheets/.sheets
  55.             $k :
  56.             !line 3 of $t
  57.             </option>
  58.           !next k
  59.         </select>
  60.       </div>
  61.  
  62.       !! Available exercices
  63.       <select $select_option name="select_sheet1" id="select_sheet1"
  64.               ondblclick="moveSelections(this.form.elements['select_sheet1'], this.form.elements['select_sheet2'], this.form.elements['echoose'], 'add')">
  65.       !for i in $asheets
  66.         !set t=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$i
  67.         !for j=1 to $t
  68.           !if $i.$j isitemof $echoose
  69.             !set r=!record $j of wimshome/log/classes/$wims_class/sheets/.sheet$i
  70.             !distribute line $r into r1,r2,r3,r4,r5,r6
  71.             !let checked=!append line <option value="$i.$j" data-sheetId="$i">$i.$j : $r5</option> to $checked
  72.           !else
  73.               !set r=!record $j of wimshome/log/classes/$wims_class/sheets/.sheet$i
  74.               !distribute line $r into r1,r2,r3,r4,r5,r6
  75.               <option value="$i.$j" data-sheetId="$i"
  76.               !if $i notitemof $ltsheets
  77.                 style="display:none;"
  78.               !endif
  79.               >$i.$j : $r5</option>
  80.           !endif
  81.         !next j
  82.       !next i
  83.       </select>
  84.     </td>
  85.     <td>
  86.       <input class="wims_button" name="add" title="$wims_name_append" value=" &rarr; " type="button" onclick="moveSelections(this.form.elements['select_sheet1'], this.form.elements['select_sheet2'], this.form.elements['echoose'], 'add'); return false;">
  87.       <br>
  88.       <input class="wims_button" name="remove" title="$wims_name_Remove" value=" &larr; " type="button" onclick="moveSelections(this.form.elements['select_sheet1'], this.form.elements['select_sheet2'], this.form.elements['echoose'], 'remove'); return false;">
  89.     </td>
  90.     <td style="vertical-align:top">
  91.       !! Selected exercices
  92.       <select $select_option name="select_sheet2" ondblclick="moveSelections(this.form.elements['select_sheet1'], this.form.elements['select_sheet2'], this.form.elements['echoose'], 'remove')">$checked</select>
  93.       <select style="overflow: hidden; visibility: hidden; width: 1px; height: 0;" name="echoose" multiple="multiple" size="10">$checked</select>
  94.     </td>
  95.   </tr>
  96.   </tbody>
  97. </table>
  98.