Index: trunk/extensions/ContributionReporting/ContributionTrackingStatistics_body.php |
— | — | @@ -62,7 +62,7 @@ |
63 | 63 | // Html out for the days total |
64 | 64 | public function showDayTotals( $is_now = true, $timestamp = 0 ) { |
65 | 65 | global $wgOut,$wgLang; |
66 | | - global $wgAllowedTemplates; |
| 66 | + global $wgAllowedTemplates, $wgAllowedSupport, $wgAllowedPaymentMethod; |
67 | 67 | |
68 | 68 | $totals = $this->getDayTotals($is_now, $timestamp); |
69 | 69 | |
— | — | @@ -91,17 +91,24 @@ |
92 | 92 | $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-conversion' ) ); |
93 | 93 | |
94 | 94 | 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]; |
100 | 95 | |
101 | 96 | //grab info from utm_src, 'unpack' template, landing page, donation page thus far |
102 | 97 | $expanded_template = explode(".", $template[0]); |
103 | 98 | if(!isset($expanded_template[1])){ $expanded_template[1] = "";} |
104 | 99 | if(!isset($expanded_template[2])){ $expanded_template[2] = "";} |
105 | 100 | |
| 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 | + |
106 | 113 | //if the template has a URL associated, create a href to it |
107 | 114 | $template_link = $expanded_template[0]; |
108 | 115 | if(isset(SpecialContributionTrackingStatistics::$templateURLs["{$expanded_template[0]}"])){ |
— | — | @@ -183,6 +190,7 @@ |
184 | 191 | $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-clicks' ) ); |
185 | 192 | $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-donations' ) ); |
186 | 193 | $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-amount' ) ); |
| 194 | + $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-max' ) ); |
187 | 195 | $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-conversion' ) ); |
188 | 196 | |
189 | 197 | foreach( $totals as $template ) { |
— | — | @@ -197,6 +205,7 @@ |
198 | 206 | Xml::element( 'td', array( 'align' => 'right'), $template[1] ) . |
199 | 207 | Xml::element( 'td', array( 'align' => 'right'), $template[2] ) . |
200 | 208 | Xml::element( 'td', array( 'align' => 'right'), $amount ) . |
| 209 | + Xml::element( 'td', array( 'align' => 'right'), $template[4] ) . |
201 | 210 | Xml::element( 'td', array( 'align' => 'right'), $wgLang->formatNum( number_format( $conversion_rate, 2 ) ) ) |
202 | 211 | ); |
203 | 212 | } |
— | — | @@ -250,6 +259,7 @@ |
251 | 260 | 'sum(isnull(contribution_tracking.contribution_id)) as miss', |
252 | 261 | 'sum(not isnull(contribution_tracking.contribution_id)) as hit', |
253 | 262 | 'sum(converted_amount) as converted_amount', |
| 263 | + 'max(converted_amount) as max_converted_amt' |
254 | 264 | ), |
255 | 265 | $conds, |
256 | 266 | __METHOD__, |
— | — | @@ -272,6 +282,7 @@ |
273 | 283 | $row[1], |
274 | 284 | $row[2], |
275 | 285 | $row[3], |
| 286 | + $row[4] |
276 | 287 | ); |
277 | 288 | } |
278 | 289 | |
Index: trunk/extensions/ContributionReporting/ContributionReporting.i18n.php |
— | — | @@ -67,6 +67,7 @@ |
68 | 68 | 'contribstats-landingpage' => 'Landing page', |
69 | 69 | 'contribstats-donatepage' => 'Donate page', |
70 | 70 | 'contribstats-average' => 'Average', |
| 71 | + 'contribstats-max' => 'Highest Donation', |
71 | 72 | |
72 | 73 | // Fundraiser statistics |
73 | 74 | 'fundraiserstatistics' => 'Fundraiser statistics', |