Index: trunk/extensions/ContributionReporting/ContributionStatistics_body.php |
— | — | @@ -240,8 +240,11 @@ |
241 | 241 | $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-percentage-ytd' ) ); |
242 | 242 | $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-avg' ) ); |
243 | 243 | |
244 | | - $factor = $this->getNumContributions() > 0 ? 100.0 / $this->getNumContributions() : 0; |
| 244 | + $numContributions = $this->getNumContributions(); |
| 245 | + $factor = $numContributions > 0 ? 100.0 / $numContributions : 0; |
245 | 246 | |
| 247 | + $htmlOut .= $numContributions; |
| 248 | + |
246 | 249 | $list = array( |
247 | 250 | 'Exactly 30.00' => array( 30 ), |
248 | 251 | 'Exactly 75.00' => array( 75 ), |
— | — | @@ -384,15 +387,17 @@ |
385 | 388 | $dbr = efContributionReportingConnection(); |
386 | 389 | |
387 | 390 | // Return average contribution amount |
| 391 | + $sizes = array( |
| 392 | + 'converted_amount >= ' . $dbr->addQuotes( $min ), |
| 393 | + 'converted_amount <= ' . $dbr->addQuotes( $max ), |
| 394 | + ); |
| 395 | + $dates = $this->dateConds( $dbr ); |
388 | 396 | $res = $dbr->select( 'public_reporting', |
389 | 397 | array( |
390 | 398 | 'count(*)', |
391 | 399 | 'avg(converted_amount)' |
392 | 400 | ), |
393 | | - array( |
394 | | - 'converted_amount > ' . $dbr->addQuotes( $min ), |
395 | | - 'converted_amount < ' . $dbr->addQuotes( $max ), |
396 | | - ) + $this->dateConds( $dbr ), |
| 401 | + array_merge( $sizes, $dates ), |
397 | 402 | __METHOD__ |
398 | 403 | ); |
399 | 404 | |