Subversion Repositories wimsdev

Rev

Rev 12595 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
12569 bpr 1
!! add glose in a glossary
2
max_glossary=!defof MAX_SHEETS in wimshome/public_html/bases/sys/define.conf
3
title_limit=50
4
desc_limit=25
5
!if $cmd=new or $cmd=resume
6
  glossary=
7
  !for i=1 to $glossarytot
8
    gl=!record $i of wimshome/log/classes/$wims_class/tool/.glossaryindex
9
    !distribute lines $gl into a_,t_
10
    glossarys=!append line $i,$t_ to $glossarys
11
  !next i
12
!endif
13
!if $cmd=reply
14
  !if $pickglossary=$empty
15
    error=no_pick
16
    !exit
17
  !endif
18
  !if $iniparm=$empty
19
    error=no_parm
20
    !exit
21
  !endif
22
  pickglossary=$[floor($pickglossary)]
23
  !if $pickglossary=NaN or $pickglossary<1 or $pickglossary>min($max_glossary,$glossarytot+1)
24
    error=bad_glossary
25
    !exit
26
  !endif
27
  ititle=!singlespace $title
28
  ititle=!char 1 to $title_limit of $ititle
29
  !if $pickglossary=$[$glossarytot+1]
30
    !set iglosstitle=!singlespace $new_glossary
31
    !appendfile $gloss_dir/.glossary$pickglossary :$iniparm\
32
$ititle
33
    !appendfile $gloss_dir/.glossaryindex :0\
34
$iglosstitle
35
  !else
36
  !!!! FIXME mettre dans l'ordre alphabetique des titres. Cela évitera
37
  !!!! de proposer de changer l'ordre !
38
  !!! on peut supposer qu'ils le sont quand on en ajoute un
39
  !!! mais pas quand on modifie
40
    sh=!record $pickglossary of wimshome/log/classes/$wims_class/tool/.glossaryindex
41
    glosscnt=!recordcnt $gloss_dir/.glossary$pickglossary
42
    !if $glosscnt>=$max_glossary
43
      error=too_many_gloss
44
      !exit
45
    !endif
46
    !for i=1 to $glosscnt
47
      e=!record $i of $gloss_dir/.glossary$pickglossary
48
      !distribute lines $e into wdi,win
49
      !if $iniparm=$wdi
50
        test=$pickglossary
51
        error=already_exist
52
        !exit
53
      !endif
54
    !next i
55
    !appendfile $gloss_dir/.glossary$pickglossary :$iniparm\
56
$ititle
57
  !endif
58
 
59
  wims_module_log=class $class: add No$glosscnt to glossary $pickglossary
60
!endif