Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
11731 guerimand 1
!! create a datepicker form with some option (in line) in wims_read_parm
2
!!line 1 : default value
3
!!line 2 : name form
4
!!line 3 : minDate,maxDate (use datepicker format)
5
!!
14719 obado 6
!! example call :
7
!! !read adm/datepickerform.phtml $expirydate\
8
!! expirydate\
9
!! "-1d","+1y"
11731 guerimand 10
 
11
!distribute line $wims_read_parm into default_,name_,date_
12
!distribute item $date_ into mdate_,Mdate_
14293 guerimand 13
!if $jquery_defined=yes
14
  !set option_=dateFormat:"yymmdd"
15
  !if $mdate_!=$empty
16
    !set option_=$option_,minDate:$mdate_
17
  !endif
18
  !if $Mdate_!=$empty
19
    !set option_=$option_,maxDate:$Mdate_
20
  !endif
11731 guerimand 21
 
14293 guerimand 22
  !set name_=!nospace $name_
12801 obado 23
 
14293 guerimand 24
  !set js_lang=$lang
25
  !if $lang=cn
26
    !set js_lang=zh-CN
27
  !endif
28
  !if $lang=tw
29
    !set js_lang=zh-TW
30
  !endif
31
  !if $lang=si
32
    !set js_lang=sl
33
  !endif
34
  !if $lang=en
35
    !set js_lang=en-GB
36
  !endif
14719 obado 37
  <script charset="UTF-8" src="scripts/js/external/jquery-ui/ui/i18n/datepicker-$js_lang.js"></script>
14293 guerimand 38
 
17186 bpr 39
  <input type="text" name="$name_" id="$name_" value="$default_">
14293 guerimand 40
  <script>
14719 obado 41
    jQuery(function($$) {$$( "#$name_" ).datepicker({$option_});});
14293 guerimand 42
  </script>
43
 
44
!else
45
  !if $months=$empty
14298 guerimand 46
    !read adm/class/classlang adm/lang/date.phtml
14293 guerimand 47
  !endif
14299 guerimand 48
  !set year$(name_)=!char 1 to 4 of $default_
49
  !set month$(name_)=!char 5 to 6 of $default_
50
  !set month$(name_)=$[$(month$(name_))]
51
  !set day$(name_)=!char 7 to 8 of $default_
52
  !set day$(name_)=$[$(day$(name_))]
14298 guerimand 53
  !set creyear=!char 2 to 5 of $(date_[1])
54
  !set expyear=!char 2 to 5 of $(date_[2])
14299 guerimand 55
  !read adm/lang/datemenu.phtml.$moduclass_lang 1,day$(name_),month$(name_),year$(name_)
11731 guerimand 56
!endif