r59045 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59044‎ | r59045 | r59046 >
Date:01:40, 14 November 2009
Author:nimishg
Status:deferred
Tags:
Comment:
daily max
Modified paths:
  • /trunk/extensions/ContributionReporting/ContributionReporting.i18n.php (modified) (history)
  • /trunk/extensions/ContributionReporting/ContributionTrackingStatistics_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ContributionReporting/ContributionTrackingStatistics_body.php
@@ -62,7 +62,7 @@
6363 // Html out for the days total
6464 public function showDayTotals( $is_now = true, $timestamp = 0 ) {
6565 global $wgOut,$wgLang;
66 - global $wgAllowedTemplates;
 66+ global $wgAllowedTemplates, $wgAllowedSupport, $wgAllowedPaymentMethod;
6767
6868 $totals = $this->getDayTotals($is_now, $timestamp);
6969
@@ -91,17 +91,24 @@
9292 $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-conversion' ) );
9393
9494 foreach( $totals as $template ) {
95 - if ( ! in_array($template[0], $wgAllowedTemplates ) )
96 - continue;
97 - // Pull together templates, clicks, donations, conversion rate
98 - $conversion_rate = ( $template[1] == 0 ) ? 0 : ( $template[2] / $template[1] ) * 100;
99 - $amount = ( $template[3] == 0 ) ? 0 : $template[3];
10095
10196 //grab info from utm_src, 'unpack' template, landing page, donation page thus far
10297 $expanded_template = explode(".", $template[0]);
10398 if(!isset($expanded_template[1])){ $expanded_template[1] = "";}
10499 if(!isset($expanded_template[2])){ $expanded_template[2] = "";}
105100
 101+ if ( ! in_array($expanded_template[0], $wgAllowedTemplates ) )
 102+ continue;
 103+ if( ($expanded_template[1] != "") && (! in_array($expanded_template[1], $wgAllowedSupport)) ){
 104+ continue;
 105+ }
 106+ if( ($expanded_template[2] != "") && (! in_array($expanded_template[2], $wgAllowedPaymentMethod)) ){
 107+ continue;
 108+ }
 109+ // Pull together templates, clicks, donations, conversion rate
 110+ $conversion_rate = ( $template[1] == 0 ) ? 0 : ( $template[2] / $template[1] ) * 100;
 111+ $amount = ( $template[3] == 0 ) ? 0 : $template[3];
 112+
106113 //if the template has a URL associated, create a href to it
107114 $template_link = $expanded_template[0];
108115 if(isset(SpecialContributionTrackingStatistics::$templateURLs["{$expanded_template[0]}"])){
@@ -183,6 +190,7 @@
184191 $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-clicks' ) );
185192 $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-donations' ) );
186193 $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-amount' ) );
 194+ $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-max' ) );
187195 $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-conversion' ) );
188196
189197 foreach( $totals as $template ) {
@@ -197,6 +205,7 @@
198206 Xml::element( 'td', array( 'align' => 'right'), $template[1] ) .
199207 Xml::element( 'td', array( 'align' => 'right'), $template[2] ) .
200208 Xml::element( 'td', array( 'align' => 'right'), $amount ) .
 209+ Xml::element( 'td', array( 'align' => 'right'), $template[4] ) .
201210 Xml::element( 'td', array( 'align' => 'right'), $wgLang->formatNum( number_format( $conversion_rate, 2 ) ) )
202211 );
203212 }
@@ -250,6 +259,7 @@
251260 'sum(isnull(contribution_tracking.contribution_id)) as miss',
252261 'sum(not isnull(contribution_tracking.contribution_id)) as hit',
253262 'sum(converted_amount) as converted_amount',
 263+ 'max(converted_amount) as max_converted_amt'
254264 ),
255265 $conds,
256266 __METHOD__,
@@ -272,6 +282,7 @@
273283 $row[1],
274284 $row[2],
275285 $row[3],
 286+ $row[4]
276287 );
277288 }
278289
Index: trunk/extensions/ContributionReporting/ContributionReporting.i18n.php
@@ -67,6 +67,7 @@
6868 'contribstats-landingpage' => 'Landing page',
6969 'contribstats-donatepage' => 'Donate page',
7070 'contribstats-average' => 'Average',
 71+ 'contribstats-max' => 'Highest Donation',
7172
7273 // Fundraiser statistics
7374 'fundraiserstatistics' => 'Fundraiser statistics',

Follow-up revisions

RevisionCommit summaryAuthorDate
r59047pulling in r59045, r59046tomasz01:52, 14 November 2009

Status & tagging log