Index: branches/wmf/1.18wmf1/extensions/ContributionReporting/ContributionStatistics_body.php |
— | — | @@ -58,8 +58,7 @@ |
59 | 59 | if( $this->mEndDate > time() && $this->mStartDate < time() ) { |
60 | 60 | $this->showDailyTotals( $egContributionStatisticsViewDays ); |
61 | 61 | } |
62 | | - |
63 | | - // Show daily totals |
| 62 | + // Show monthly totals |
64 | 63 | $this->showMonthlyTotals( ); |
65 | 64 | |
66 | 65 | // Show currency totals |
— | — | @@ -99,16 +98,20 @@ |
100 | 99 | |
101 | 100 | // Days |
102 | 101 | foreach ( $days as $data ) { |
| 102 | + $stats = array(); |
| 103 | + foreach( $data as $key => $value ) { |
| 104 | + $stats[] = $value; |
| 105 | + } |
103 | 106 | $htmlOut .= Xml::tags( 'tr', null, |
104 | | - Xml::element( 'td', array( 'align' => 'left' ), $data[0] ) . |
105 | | - Xml::element( 'td', array( 'align' => 'left' ), $wgLang->formatNum( $data[1] ) ) . |
106 | | - Xml::element( 'td', array( 'align' => 'right' ), $wgLang->formatNum( number_format( $data[2], 2 ) ) ) . |
107 | | - Xml::element( 'td', array( 'align' => 'right' ), $wgLang->formatNum( number_format( $data[3], 2 ) ) ) . |
108 | | - /*Xml::element( 'td', array( 'align' => 'right' ), $wgLang->formatNum( number_format( $data[5], 2 ) ) ) .*/ |
109 | | - Xml::element( 'td', array( 'align' => 'right' ), $wgLang->formatNum( number_format( $data[4], 2 ) ) ) . |
| 107 | + Xml::element( 'td', array( 'align' => 'left' ), $stats[0] ) . |
| 108 | + Xml::element( 'td', array( 'align' => 'left' ), $wgLang->formatNum( $stats[1] ) ) . |
| 109 | + Xml::element( 'td', array( 'align' => 'right' ), $wgLang->formatNum( number_format( $stats[2], 2 ) ) ) . |
| 110 | + Xml::element( 'td', array( 'align' => 'right' ), $wgLang->formatNum( number_format( $stats[3], 2 ) ) ) . |
| 111 | + /*Xml::element( 'td', array( 'align' => 'right' ), $wgLang->formatNum( number_format( $stats[5], 2 ) ) ) .*/ |
| 112 | + Xml::element( 'td', array( 'align' => 'right' ), $wgLang->formatNum( number_format( $stats[4], 2 ) ) ) . |
110 | 113 | Xml::element( 'td', array( 'align' => 'right' ), $wgLang->formatNum( number_format( $total, 2 ) ) ) |
111 | 114 | ); |
112 | | - $total -= $data[2]; |
| 115 | + $total -= $stats[2]; |
113 | 116 | } |
114 | 117 | |
115 | 118 | $htmlOut .= Xml::closeElement( 'table' ); |
— | — | @@ -343,20 +346,24 @@ |
344 | 347 | // Build day/value array |
345 | 348 | $totals = array(); |
346 | 349 | foreach ( $res as $row ) { |
| 350 | + $stats = array(); |
| 351 | + foreach( $row as $key => $value ) { |
| 352 | + $stats[] = $value; |
| 353 | + } |
347 | 354 | $median = $dbr->selectField( 'public_reporting', |
348 | 355 | array( 'converted_amount' ), |
349 | 356 | array( |
350 | | - "FROM_UNIXTIME(received, '%Y-%m')" => $row[0] |
| 357 | + "FROM_UNIXTIME(received, '%Y-%m')" => $stats[0] |
351 | 358 | ), |
352 | 359 | __METHOD__, |
353 | 360 | array( |
354 | 361 | 'ORDER BY' => 'converted_amount DESC', |
355 | | - 'OFFSET' => round( $row[1] / 2 ), |
| 362 | + 'OFFSET' => round( $stats[1] / 2 ), |
356 | 363 | 'LIMIT' => 1 |
357 | 364 | ) |
358 | 365 | ); |
359 | | - $row[] = $median; |
360 | | - $totals[] = $row; |
| 366 | + $stats[] = $median; |
| 367 | + $totals[] = $stats; |
361 | 368 | } |
362 | 369 | |
363 | 370 | // Return results |
— | — | @@ -386,23 +393,27 @@ |
387 | 394 | |
388 | 395 | $totals = array(); |
389 | 396 | foreach ( $res as $row ) { |
| 397 | + $stats = array(); |
| 398 | + foreach( $row as $key => $value ) { |
| 399 | + $stats[] = $value; |
| 400 | + } |
390 | 401 | $median = $dbr->selectField( 'public_reporting', |
391 | 402 | array( 'converted_amount' ), |
392 | 403 | array_merge( |
393 | 404 | $this->dateConds( $dbr ), |
394 | 405 | array( |
395 | | - 'original_currency' => $row[0] |
| 406 | + 'original_currency' => $stats[0] |
396 | 407 | ) |
397 | 408 | ), |
398 | 409 | __METHOD__, |
399 | 410 | array( |
400 | 411 | 'ORDER BY' => 'converted_amount DESC', |
401 | | - 'OFFSET' => round( $row[1] / 2 ), |
| 412 | + 'OFFSET' => round( $stats[1] / 2 ), |
402 | 413 | 'LIMIT' => 1, |
403 | 414 | ) |
404 | 415 | ); |
405 | | - $row[] = $median; |
406 | | - $totals[$row[0]] = $row; |
| 416 | + $stats[] = $median; |
| 417 | + $totals[$stats[0]] = $stats; |
407 | 418 | } |
408 | 419 | |
409 | 420 | if ( isset( $totals[null] ) ) { |
Property changes on: branches/wmf/1.18wmf1/extensions/ContributionReporting/ContributionStatistics_body.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
410 | 421 | Merged /trunk/extensions/ContributionReporting/ContributionStatistics_body.php:r102713 |
Property changes on: branches/wmf/1.18wmf1/extensions/ContributionReporting |
___________________________________________________________________ |
Modified: svn:mergeinfo |
411 | 422 | Merged /trunk/extensions/ContributionReporting:r102713 |