Ignore:
Timestamp:
Jan 24, 2012, 5:30:45 PM (11 years ago)
Author:
work@…
Message:

added more ajax calls, and improved first study compare wizard page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/generic/AjaxController.groovy

    r2149 r2150  
    9292
    9393        def studyCount = {
    94                 def result = [0:"0 studies found based on your criteria"];
     94                println params
     95                println params.containsKey('data')
     96//              println params['data']['uniqueSpecies']
     97
     98                def matched     = false
     99                def user        = authenticationService.getLoggedInUser()
     100                def studies     = Study.giveReadableStudies(user)
     101                def matchedStudies = []
     102
     103                // parameters
     104/*
     105                def uniqueSpecies =     (params['data']['uniqueSpecies']) ? params['data']['uniqueSpecies'] : []
     106                println uniqueSpecies.class
     107                println uniqueSpecies.size()
     108
     109                // iterate through studies
     110                studies.each { study ->
     111matched = false
     112//                      matched = (study.subjects.find{uniqueSpecies.contains(it.species.id)}) ? true : false;
     113println "study: ${study} -> matched: ${matched}"
     114
     115                        if (matched) matchedStudies.add(study)
     116                }
     117*/
     118println "------"
     119
     120                def result = ['count':matchedStudies.size()];
    95121
    96122                // set output header to json
Note: See TracChangeset for help on using the changeset viewer.