Changeset 209


Ignore:
Timestamp:
Feb 22, 2010, 6:35:37 PM (13 years ago)
Author:
duh
Message:
  • added events, eventDescriptions, etc
Location:
trunk
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/studycapturing/WizardController.groovy

    r204 r209  
    4747                        flow.page = 0
    4848                        flow.pages = [
    49                                 [title: 'Templates'],   // templates
    50                                 [title: 'Study'],               // study
    51                                 [title: 'Subjects'],    // subjects
    52                                 [title: 'Groups'],              // groups
    53                                 [title: 'Events'],              // events
    54                                 [title: 'Samples'],             // samples
    55                                 [title: 'Protocols'],   // protocols
    56                                 [title: 'Assays'],              // assays
    57                                 [title: 'Done']                 // finish page
     49                                [title: 'Templates'],                   // templates
     50                                [title: 'Study'],                               // study
     51                                [title: 'Subjects'],                    // subjects
     52                                [title: 'Event Descriptions'],  // event descriptions
     53                                [title: 'Events'],                              // groups
     54                                [title: '---'],                         // events
     55                                [title: '---'],                         // samples
     56                                [title: '---'],                 // protocols
     57                                [title: '---'],                         // assays
     58                                [title: 'Done']                                 // finish page
    5859                        ]
    5960
     
    170171                                        success()
    171172                                }
    172                         }.to "groups"
     173                        }.to "eventDescriptions"
    173174                        on("previous") {
    174175                                flash.errors = new LinkedHashMap()
     
    181182                                }
    182183                        }.to "study"
     184                }
     185
     186                // render page three
     187                eventDescriptions {
     188                        render(view: "_eventDescriptions")
     189                        onRender {
     190                                flow.page = 4
     191
     192                                if (!flow.eventDescriptions) {
     193                                        flow.eventDescriptions = []
     194                                }
     195                        }
     196                        on("add") {
     197                                // fetch classification by name (as posted by the form)
     198                                params.classification = Term.findByName(params.classification)
     199
     200                                // transform checkbox form value to boolean
     201                                params.isSamplingEvent = (params.containsKey('isSamplingEvent'))
     202
     203                                // instantiate EventDescription with parameters
     204                                def eventDescription = new EventDescription(params)
     205
     206                                // validate
     207                                if (eventDescription.validate()) {
     208                                        def increment = flow.eventDescriptions.size()
     209                                        flow.eventDescriptions[increment] = eventDescription
     210                                        success()
     211                                } else {
     212                                        // validation failed, feedback errors
     213                                        flash.errors = new LinkedHashMap()
     214                                        this.appendErrors(eventDescription, flash.errors)
     215                                        error()
     216                                }
     217                        }.to "eventDescriptions"
     218                        on("previous") {
     219                                flash.errors = new LinkedHashMap()
     220
     221                                // handle form data
     222                                if (!this.handleEventDescriptions(flow, flash, params)) {
     223                                        error()
     224                                } else {
     225                                        success()
     226                                }
     227                        }.to "subjects"
     228                        on("next") {
     229                                flash.errors = new LinkedHashMap()
     230
     231                                // check if we have at least one subject
     232                                // and check form data
     233                                if (flow.eventDescriptions.size() < 1) {
     234                                        // append error map
     235                                        this.appendErrorMap(['eventDescriptions': 'You need at least to create one eventDescription for your study'], flash.errors)
     236                                        error()
     237                                } else if (!this.handleEventDescriptions(flow, flash, params)) {
     238                                        error()
     239                                } else {
     240                                        success()
     241                                }
     242                        }.to "events"
     243                }
     244
     245                // render events page
     246                events {
     247                        render(view: "_events")
     248                        onRender {
     249                                flow.page = 5
     250
     251                                if (!flow.events) {
     252                                        flow.events = []
     253                                }
     254
     255                                if (!flow.eventGroups) {
     256                                        flow.eventGroups = []
     257                                }
     258                        }
     259                        on("add") {
     260                                // create date instances from date string?
     261                                // @see WizardTagLibrary::timeElement{...}
     262                                if (params.get('startTime')) {
     263                                        println params.get('startTime').toString()
     264                                        params.startTime = new Date().parse("d/M/yyyy HH:mm", params.get('startTime').toString())
     265                                }
     266                                if (params.get('endTime')) {
     267                                        params.get('endTime').toString()
     268                                        params.endTime = new Date().parse("d/M/yyyy HH:mm", params.get('endTime').toString())
     269                                }
     270
     271                                // get eventDescription instance by name
     272                                params.eventDescription = this.getObjectByName(params.get('eventDescription'),flow.eventDescriptions)
     273
     274                                // instantiate Event with parameters
     275                                def event = new Event(params)
     276
     277                                // validate event
     278                                if (event.validate()) {
     279                                        def increment = flow.events.size()
     280                                        flow.events[increment] = event
     281                                        success()
     282                                } else {
     283                                        // validation failed, feedback errors
     284                                        flash.errors = new LinkedHashMap()
     285                                        this.appendErrors(event, flash.errors)
     286
     287                                        flash.startTime                 = params.startTime
     288                                        flash.endTime                   = params.endTime
     289                                        flash.eventDescription  = params.eventDescription
     290                                       
     291                                        error()
     292                                }
     293                        }.to "events"
     294                        on("addEventGroup") {
     295                                def increment = flow.eventGroups.size()
     296                                flow.eventGroups[ increment ] = new EventGroup(name: "group "+(increment+1))
     297                        }.to "events"
     298                        on("previous") {
     299                                // TODO
     300                        }.to "eventDescriptions"
     301                        on("next") {
     302                                // TODO
     303                        }.to "events"
    183304                }
    184305
     
    187308                        render(view: "_groups")
    188309                        onRender {
    189                                 flow.page = 4
     310                                flow.page = 6
    190311
    191312                                if (!flow.groups) {
     
    206327
    207328                // render page three
    208                 events {
    209                         render(view: "_events")
    210                         onRender {
    211                                 flow.page = 5
    212                         }
    213                         on("previous") {
    214                                 // TODO
    215                         }.to "subjects"
    216                         on("next") {
    217                                 // TODO
    218                         }.to "samples"
    219                 }
    220 
    221                 // render page three
    222329                samples {
    223330                        render(view: "_samples")
    224331                        onRender {
    225                                 flow.page = 6
     332                                flow.page = 7
    226333                        }
    227334                        on("previous") {
     
    237344                        render(view: "_protocols")
    238345                        onRender {
    239                                 flow.page = 7
     346                                flow.page = 8
    240347                        }
    241348                        on("previous") {
     
    251358                        render(view: "_assays")
    252359                        onRender {
    253                                 flow.page = 8
     360                                flow.page = 9
    254361                        }
    255362                        on("previous") {
     
    265372                        render(view: "_done")
    266373                        onRender {
    267                                 flow.page = 9
     374                                flow.page = 10
    268375                        }
    269376                        on("previous") {
     
    310417                        this.appendErrors(flow.study, flash.errors)
    311418                        return false
     419                }
     420        }
     421
     422        /**
     423         * re-usable code for handling eventDescription form data in a web flow
     424         * @param Map LocalAttributeMap (the flow scope)
     425         * @param Map localAttributeMap (the flash scope)
     426         * @param Map GrailsParameterMap (the flow parameters = form data)
     427         * @returns boolean
     428         */
     429        def handleEventDescriptions(flow, flash, params) {
     430                def names = new LinkedHashMap();
     431                def errors = false;
     432                def id = 0;
     433
     434                flow.eventDescriptions.each() {
     435                        it.name                 = params.get('eventDescription_' + id + '_name')
     436                        it.description          = params.get('eventDescription_' + id + '_description')
     437                        it.classification       = Term.findByName(params.get('eventDescription_' + id + '_classification'))
     438                        it.isSamplingEvent      = (params.containsKey('eventDescription_' + id + '_isSamplingEvent'))
     439
     440                        // validate eventDescription
     441                        if (!it.validate()) {
     442                                errors = true
     443                                println id + ' :: ' + it.errors.getAllErrors()
     444                                this.appendErrors(it, flash.errors)
     445                        }
     446
     447                        id++
    312448                }
    313449        }
     
    403539        }
    404540
     541
     542        /**
     543         * return the object from a map of objects by searching for a name
     544         * @param String        name
     545         * @param Map           map of objects
     546         * @return Object
     547         */
     548        def getObjectByName(name, map) {
     549                def result = null
     550                map.each() {
     551                        if (it.name == name) {
     552                                result = it
     553                        }
     554                }
     555
     556                return result
     557        }
     558
    405559        /**
    406560         * transform domain class validation errors into a human readable
  • trunk/grails-app/domain/dbnp/studycapturing/Event.groovy

    r201 r209  
    77 * to multiple subjects at the same time. That is why the actual description of the event is factored out into a more
    88 * general EventDescription class. Events that also lead to sample(s) should be instantiated as SamplingEvents.
     9 *
     10 * Revision information:
     11 * $Rev$
     12 * $Author$
     13 * $Date$
    914 */
    10 class Event {
    11 
     15class Event implements Serializable {
    1216        Subject subject
    1317        EventDescription eventDescription
     
    1923
    2024        static hasMany = [
    21                 parameterStringValues : String, // stores both STRING and STRINGLIST items (latter should be checked against the list)
    22                 parameterIntegerValues : int,
    23                 parameterFloatValues : float
     25                parameterStringValues: String, // stores both STRING and STRINGLIST items (latter should be checked against the list)
     26                parameterIntegerValues: int,
     27                parameterFloatValues: float,
    2428        ]
    2529
     30        static constraints = {
     31                subject(nullable: true, blank: true)    // TODO: subject is to be removed from Event, and into EventGroup
     32                startTime(nullable:false)
     33                endTime(validator: {val, obj ->
     34           if (val && val.before(obj.startTime)) {
     35                return 'endTimeshouldbegreater'
     36           }
     37        })
     38        }
    2639
    2740        // time diff between end and start date
    2841        // thus, do this manually as follows
    29         def getDuration( date1, date2 ) {
     42
     43        def getDuration(date1, date2) {
    3044                def timeMillis = (date2.getTime() - date1.getTime()).abs()
    3145                def days = (timeMillis / (1000 * 60 * 60 * 24)).toInteger()
     
    3852        }
    3953
    40 
    4154        def getDuration() {
    4255                return getDuration(startTime, endTime)
    4356        }
    4457
    45 
    4658        // return a string that prints the duration sensibly.
    4759        // the largest date unit (sec, min, h, day, week, month, or year)
    4860        // is output
    49         def getPrettyDuration( duration ) {
    50              def handleNumerus = { number ,string ->
    51                      return number.toString() + (number==1 ? string : string + 's' )
    52              }
    53              if( duration.getYears()   > 0 ) return handleNumerus( duration.getYears(), " year" )
    54              if( duration.getMonths()  > 0 ) return handleNumerus( duration.getMonths(), " month" )
    55              if( duration.getDays()    > 0 ) return handleNumerus( duration.getDays(), " day" )
    56              if( duration.getHours()   > 0 ) return handleNumerus( duration.getHours(), " hour" )
    57              if( duration.getMinutes() > 0 ) return handleNumerus( duration.getMinutes(), " minute" )
    58                                              return handleNumerus( duration.getSeconds(), " second" )
     61
     62        def getPrettyDuration(duration) {
     63                def handleNumerus = {number, string ->
     64                        return number.toString() + (number == 1 ? string : string + 's')
     65                }
     66                if (duration.getYears() > 0) return handleNumerus(duration.getYears(), " year")
     67                if (duration.getMonths() > 0) return handleNumerus(duration.getMonths(), " month")
     68                if (duration.getDays() > 0) return handleNumerus(duration.getDays(), " day")
     69                if (duration.getHours() > 0) return handleNumerus(duration.getHours(), " hour")
     70                if (duration.getMinutes() > 0) return handleNumerus(duration.getMinutes(), " minute")
     71                return handleNumerus(duration.getSeconds(), " second")
    5972        }
    60 
    6173
    6274        // convenience method. gives formatted string output for a duration
    6375        def getPrettyDuration() {
    64              getPrettyDuration( getDuration() )
     76                getPrettyDuration(getDuration())
    6577        }
    6678
    67 
    6879        // convenience method. gives formatted string output for a duration
    69         def getPrettyDuration( date1, date2 )
    70         {
    71              return  getPrettyDuration( getDuration( date1, date2 ) )
     80        def getPrettyDuration(date1, date2) {
     81                return getPrettyDuration(getDuration(date1, date2))
    7282        }
    73 
    7483
    7584        def getDurationString() {
     
    7887        }
    7988
     89        def getShortDuration() {
     90                def d = getDuration()
     91                def days = d.days
     92                def hours = d.hours - (24 * days)
     93                def minutes = d.minutes - (24 * 60 * days) - (60 * hours)
     94                return "${days}d ${hours}:${minutes}"
     95        }
    8096
    8197        def isSamplingEvent() {
    82                 return ( this instanceof SamplingEvent )
    83         }
    84 
     98                return (this instanceof SamplingEvent)
     99        }
    85100
    86101        def String toString() {
    87102                return eventDescription ? eventDescription.name : ""
    88103        }
    89 
    90104}
  • trunk/grails-app/domain/dbnp/studycapturing/EventDescription.groovy

    r190 r209  
    2121
    2222        static constraints = {
     23                name(nullable: false, blank: false)
     24                description(nullable: false, blank: false)
    2325                classification(nullable: true, blank: true)
     26                protocol(nullable: true, blank: true)
     27        }
     28
     29        def String toString() {
     30                return name
    2431        }
    2532}
  • trunk/grails-app/domain/dbnp/studycapturing/EventGroup.groovy

    r208 r209  
    11package dbnp.studycapturing
    22
    3 class EventGroup {
    4 
     3/**
     4 * EventGroup groups events
     5 *
     6 * Revision information:
     7 * $Rev$
     8 * $Author$
     9 * $Date$
     10 */
     11class EventGroup implements Serializable {
    512        String name
    613
    714        static hasMany = [
    8                 subjects : Subject,
    9                 events : Event
     15                subjects: Subject,
     16                events: Event
    1017        ]
    1118
    12     static constraints = {
    13     }
     19        static constraints = {
     20        }
    1421}
  • trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy

    r189 r209  
    185185                def description = attrs.remove('description')
    186186                def addExampleElement = attrs.remove('addExampleElement')
     187                def addExample2Element  = attrs.remove('addExample2Element')
    187188
    188189                // render a form element
     
    208209                }
    209210
     211                // add an disabled input box for feedback purposes
     212                // @see dateElement(...)
     213                if (addExample2Element) {
     214                        def exampleAttrs = new LinkedHashMap()
     215                        exampleAttrs.name = attrs.get('name')+'Example2'
     216                        exampleAttrs.class  = 'isExample'
     217                        exampleAttrs.disabled = 'disabled'
     218                        exampleAttrs.size = 30
     219                        out << textField(exampleAttrs)
     220                }
     221
    210222                out << ' </div>'
    211223
     
    243255        }
    244256
     257
     258        /**
     259         * render a select form element
     260         * @param Map attrs
     261         * @param Closure body  (help text)
     262         */
     263        def selectElement = { attrs, body ->
     264                baseElement.call(
     265                        'select',
     266                        attrs,
     267                        body
     268                )
     269        }
     270
     271        /**
     272         * render a checkBox form element
     273         * @param Map attrs
     274         * @param Closure body  (help text)
     275         */
     276        def checkBoxElement = { attrs, body ->
     277                baseElement.call(
     278                        'checkBox',
     279                        attrs,
     280                        body
     281                )
     282        }
     283
    245284        /**
    246285         * render a dateElement
     
    257296               
    258297                // set some textfield values
    259                 attrs.maxlength = 10
     298                attrs.maxlength = (attrs.maxlength) ? attrs.maxlength : 10
    260299                attrs.addExampleElement = true
    261300               
     
    267306                )
    268307        }
     308
     309        /**
     310         * render a dateElement
     311         * NOTE: datepicker is attached through wizard.js!
     312         * @param Map attrs
     313         * @param Closure body  (help text)
     314         */
     315        def timeElement = { attrs, body ->
     316                // transform value?
     317                if (attrs.value instanceof Date) {
     318                        // transform date instance to formatted string (dd/mm/yyyy)
     319                        attrs.value = String.format('%td/%<tm/%<tY %<tH:%<tM', attrs.value)
     320                }
     321
     322                attrs.addExampleElement = true
     323                attrs.addExample2Element = true
     324                attrs.maxlength = 16
     325
     326                // render a normal text field
     327                //out << textFieldElement(attrs,body)
     328                textFieldElement.call(
     329                        attrs,
     330                        body
     331                )
     332        }
    269333       
    270334        /**
     
    283347
    284348        /**
     349         * Button form element
     350         * @param Map           attributes
     351         * @param Closure       help content
     352         */
     353        def buttonElement = { attrs, body ->
     354                // render template element
     355                baseElement.call(
     356                        'ajaxButton',
     357                        attrs,
     358                        body
     359                )
     360        }
     361
     362        /**
    285363         * render a species select element
    286364         * @param Map attrs
     
    289367                // fetch the speciesOntology
    290368                // note that this is a bit nasty, probably the ontologyName should
    291                 // be configured in a configuration file... --> TODO
     369                // be configured in a configuration file... --> TODO: centralize species configuration
    292370                def speciesOntology = Ontology.findByName('NCBI Taxonomy')
    293371
     
    331409                }
    332410               
     411                out << select(attrs)
     412        }
     413
     414        /**
     415         * Term form element
     416         * @param Map           attributes
     417         * @param Closure       help content
     418         */
     419        def termElement = { attrs, body ->
     420                // render term element
     421                baseElement.call(
     422                        'termSelect',
     423                        attrs,
     424                        body
     425                )
     426        }
     427
     428        /**
     429         * render a term select element
     430         * @param Map attrs
     431         */
     432        def termSelect = { attrs ->
     433                // fetch all terms
     434                attrs.from = Term.findAll()     // for now, all terms as we cannot identify terms as being treatment terms...
     435
     436                // got a name?
     437                if (!attrs.name) {
     438                        attrs.name = 'term'
     439                }
     440
    333441                out << select(attrs)
    334442        }
  • trunk/grails-app/views/wizard/index.gsp

    r172 r209  
    2424        <script type="text/javascript" src="${resource(dir: 'js', file: 'grouping.js')}"></script>
    2525        <script type="text/javascript" src="${resource(dir: 'js', file: 'table-editor.js')}"></script>
     26        <script type="text/javascript" src="${resource(dir: 'js', file: 'timepicker-0.2.1.js')}"></script>
    2627        <script type="text/javascript" src="${resource(dir: 'js', file: 'wizard.js')}"></script>
    2728</head>
  • trunk/grails-app/views/wizard/pages/_events.gsp

    r195 r209  
    1616%>
    1717<wizard:pageContent>
    18 todo...
     18        <wizard:selectElement name="eventDescription" description="Event Description" error="eventDescription" from="${eventDescriptions}" value="${eventDescription}">
     19                The event description for this event
     20        </wizard:selectElement>
     21        <wizard:timeElement name="startTime" description="Start Time" error="startTime" value="${startTime}">
     22                The start time of the study
     23        </wizard:timeElement>
     24        <wizard:timeElement name="endTime" description="End time" error="endTimee" value="${endTime}">
     25                The end time of the study
     26        </wizard:timeElement>
     27        <wizard:buttonElement name="add" value="Add" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()"/>
     28<g:if test="${events}">
     29        <div class="table">
     30                <div class="header">
     31                        <div class="firstColumn">#</div>
     32                        <div class="column">eventDescription</div>
     33                        <div class="column">startTime</div>
     34                        <div class="column">endTime</div>
     35                        <div class="column">duration</div>
     36                        <g:if test="${eventGroups}"><g:each var="eventGroup" status="i" in="${eventGroups}">
     37                        <div class="column"><g:textField name="eventGroup_${i}_name" value="${eventGroup.name}" /></div>
     38                        </g:each></g:if>
     39                        <div class="column"><wizard:ajaxButton name="addEventGroup" value="+" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()" /></div>
     40                </div>
     41        <g:each var="event" status="i" in="${events}">
     42                <div class="row">
     43                        <div class="firstColumn">${i+1}</div>
     44                        <div class="column">${event.eventDescription}</div>
     45                        <div class="column"><g:formatDate format="dd/MM/yyyy hh:mm" date="${event.startTime}" /></div>
     46                        <div class="column"><g:formatDate format="dd/MM/yyyy hh:mm" date="${event.endTime}" /></div>
     47                        <div class="column">${event.getShortDuration()}</div>
     48                        <g:if test="${eventGroups}"><g:each var="eventGroup" status="j" in="${eventGroups}">
     49                        <div class="column"><input type="checkbox" name="event_${i}_group_${j}"/></div>
     50                        </g:each></g:if>
     51                        <div class="column"></div>
     52                </div>
     53        </g:each>
     54        </div>
     55</g:if>
    1956</wizard:pageContent>
  • trunk/grails-app/views/wizard/pages/_subjects.gsp

    r180 r209  
    1616%>
    1717<wizard:pageContent>
    18 <wizard:ajaxButton name="add" value="Add" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()" />
    19 <input name="addNumber" size="4" maxlength="4" value="1">
    20 subjects of species
    21 <wizard:speciesSelect name="addSpecies" />
     18        <wizard:ajaxButton name="add" value="Add" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()" />
     19        <input name="addNumber" size="4" maxlength="4" value="1">
     20        subjects of species
     21        <wizard:speciesSelect name="addSpecies" />
    2222<g:if test="${subjects}">
    23 <div class="table">
    24         <div class="header">
    25                 <div class="firstColumn">#</div>
    26                 <div class="column">name</div>
    27                 <div class="column">species</div>
    28                 <wizard:templateColumnHeaders template="${study.template}" class="column" />
     23        <div class="table">
     24                <div class="header">
     25                        <div class="firstColumn">#</div>
     26                        <div class="column">name</div>
     27                        <div class="column">species</div>
     28                        <wizard:templateColumnHeaders template="${study.template}" class="column" />
     29                </div>
     30        <g:each var="subject" status="i" in="${subjects}">
     31                <div class="row">
     32                        <div class="firstColumn">${i}</div>
     33                        <div class="column"><g:textField name="subject_${i}_name" value="${subject.name}" size="12" maxlength="12" /></div>
     34                        <div class="column">
     35                                <wizard:speciesSelect value="${subject.species}" name="subject_${i}_species" />
     36                        </div>
     37                        <wizard:templateColumns id="${i}" template="${study.template}" name="subject_${i}" class="column" subject="${subject}" />
     38                </div>
     39        </g:each>
    2940        </div>
    30 <g:each var="subject" status="i" in="${subjects}">
    31         <div class="row">
    32                 <div class="firstColumn">${i}</div>
    33                 <div class="column"><g:textField name="subject_${i}_name" value="${subject.name}" size="12" maxlength="12" /></div>
    34                 <div class="column">
    35                         <wizard:speciesSelect value="${subject.species}" name="subject_${i}_species" />
    36                 </div>
    37                 <wizard:templateColumns id="${i}" template="${study.template}" name="subject_${i}" class="column" subject="${subject}" />
     41        <div class="sliderContainer">
     42                <div class="slider"/>
    3843        </div>
    39 </g:each>
    40 </div>
    41 <div class="sliderContainer">
    42         <div class="slider"/>
    43 </div>
    4444</g:if>
    4545</wizard:pageContent>
  • trunk/web-app/css/wizard.css

    r204 r209  
    140140    font-size: 11px;
    141141    overflow: hidden;
     142    white-space: nowrap;
    142143}
    143144
  • trunk/web-app/js/table-editor.js

    r172 r209  
    5454        $(this.columnIdentifier, $(row)).each(function() {
    5555            var input = $(':input', $(this));
    56 
    5756            // does this column contain an input field
     57console.log(input)
    5858            if (input) {
    5959                var type = $(input).attr('type');
     60console.log(input)
     61console.log('type: '+type)
    6062
    6163                switch (type) {
     
    7375                            that.updateSingleInputElements(input, columnNumber, 'select');
    7476                        })
     77                        break;
     78                    case 'hidden':
     79                        // hidden is hidden :)
    7580                        break;
    7681                    case null:
  • trunk/web-app/js/wizard.js

    r204 r209  
    2121        var wizard = $('div#wizard')
    2222        if (wizard.find("#warning").length == 0) {
    23             wizard.html('<span id="warning" style="color:red;font-size:8px;">Firefox 3.6 contains <a href="http://code.google.com/p/fbug/issues/detail?id=2746" target="_new">a bug</a> in combination with Firebug\'s XMLHttpRequest spy which causes the wizard to not function anymore. Please make sure you have firebug\'s XMLHttpRequest spy disabled use use Firefox 3.5.7 instead...</span>' + wizard.html())
     23            wizard.html('<span id="warning" style="color:red;font-size:8px;">Firefox 3.6 contains <a href="http://code.google.com/p/fbug/issues/detail?id=2746" target="_new">a bug</a> in combination with Firebug\'s XMLHttpRequest spy which causes the wizard to not function anymore. Please make sure you have Firebug\'s XMLHttpRequest spy disabled or use Firefox 3.5.7 instead...</span>' + wizard.html())
    2424        }
    2525    }
     
    3535    attachHelpTooltips();
    3636    attachDatePickers();
     37    attachDateTimePickers();
    3738
    3839    // SUBJECT PAGE
     
    126127}
    127128
     129// add datetimepickers to date fields
     130function attachDateTimePickers() {
     131    $('div#wizard').find("input[type=text][name$='Time']").each(function() {
     132        $(this).datepicker({
     133            dateFormat      : 'dd/mm/yy',
     134            altField        : '#' + $(this).attr('name') + 'Example',
     135            altTimeField    : '#' + $(this).attr('name') + 'Example2',
     136            altFormat       : 'DD, d MM, yy',
     137            showTime        : true,
     138            time24h         : true
     139        });
     140    })
     141}
     142
    128143// attach subject events
    129144function attachTableEvents() {
Note: See TracChangeset for help on using the changeset viewer.