Revision: 5937
          
http://languagetool.svn.sourceforge.net/languagetool/?rev=5937&view=rev
Author:   dnaber
Date:     2011-11-19 00:12:58 +0000 (Sat, 19 Nov 2011)
Log Message:
-----------
fix pagination

Modified Paths:
--------------
    
trunk/ltcommunity/grails-app/controllers/org/languagetool/CorpusMatchController.groovy

Modified: 
trunk/ltcommunity/grails-app/controllers/org/languagetool/CorpusMatchController.groovy
===================================================================
--- 
trunk/ltcommunity/grails-app/controllers/org/languagetool/CorpusMatchController.groovy
      2011-11-19 00:04:10 UTC (rev 5936)
+++ 
trunk/ltcommunity/grails-app/controllers/org/languagetool/CorpusMatchController.groovy
      2011-11-19 00:12:58 UTC (rev 5937)
@@ -70,9 +70,16 @@
         firstResult(params.int('offset'))
         maxResults(params.int('max'))
       }
-      int totalMatches = CorpusMatch.countByLanguageCodeAndIsVisible(langCode, 
true)
+      def allMatchesCriteria = CorpusMatch.createCriteria()
+      def allMatchesCount = allMatchesCriteria.count {
+        if (params.filter) {
+          eq('ruleID', params.filter)
+        }
+        eq('languageCode', langCode)
+        eq('isVisible', true)
+      }
       [ corpusMatchList: matches,
-        languages: Language.REAL_LANGUAGES, lang: langCode, totalMatches: 
totalMatches,
+        languages: Language.REAL_LANGUAGES, lang: langCode, totalMatches: 
allMatchesCount,
         matchesByRule: matchesByRule]
     }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Languagetool-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-cvs

Reply via email to