r104904 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104903‎ | r104904 | r104905 >
Date:22:26, 1 December 2011
Author:kaldari
Status:ok
Tags:
Comment:
fixing bad module definition, restoring some of Reedys changes that didnt break things
Modified paths:
  • /trunk/extensions/ContributionReporting/ContributionReporting.php (modified) (history)
  • /trunk/extensions/ContributionReporting/ContributionTrackingStatistics_body.php (modified) (history)
  • /trunk/extensions/ContributionReporting/FundraiserStatistics_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ContributionReporting/ContributionReporting.php
@@ -134,7 +134,7 @@
135135 ) + $commonModuleInfo;
136136
137137 $wgResourceModules['ext.fundraiserstatistics'] = array(
138 - 'scripts' => 'ext.fundraiserstatistics.edit.js',
 138+ 'scripts' => 'ext.fundraiserstatistics.js',
139139 'styles' => 'ext.fundraiserstatistics.css',
140140 ) + $commonModuleInfo;
141141
@@ -145,17 +145,29 @@
146146 $wgHooks['ParserFirstCallInit'][] = 'efContributionReportingSetup';
147147 $wgHooks['LanguageGetMagic'][] = 'efContributionReportingTotal_Magic';
148148
 149+/**
 150+ * @param $parser Parser
 151+ * @return bool
 152+ */
149153 function efContributionReportingSetup( $parser ) {
150154 $parser->setFunctionHook( 'contributiontotal', 'efContributionReportingTotal_Render' );
151155 return true;
152156 }
153157
 158+/**
 159+ * @param $magicWords array
 160+ * @param $langCode string
 161+ * @return bool
 162+ */
154163 function efContributionReportingTotal_Magic( &$magicWords, $langCode ) {
155164 $magicWords['contributiontotal'] = array( 0, 'contributiontotal' );
156165 return true;
157166 }
158167
159 -// Automatically use a local or special database connection
 168+/**
 169+ * Automatically use a local or special database connection for reporting
 170+ * @return DatabaseMysql
 171+ */
160172 function efContributionReportingConnection() {
161173 global $wgContributionReportingDBserver, $wgContributionReportingDBname;
162174 global $wgContributionReportingDBuser, $wgContributionReportingDBpassword;
@@ -174,6 +186,10 @@
175187 return $db;
176188 }
177189
 190+/**
 191+ * Automatically use a local or special database connection for tracking
 192+ * @return DatabaseMysql
 193+ */
178194 function efContributionTrackingConnection() {
179195 global $wgContributionTrackingDBserver, $wgContributionTrackingDBname;
180196 global $wgContributionTrackingDBuser, $wgContributionTrackingDBpassword;
@@ -192,6 +208,12 @@
193209 return $db;
194210 }
195211
 212+/**
 213+ * Get the total amount of money raised since the start of the fundraiser
 214+ * @param $start
 215+ * @param $fudgeFactor
 216+ * @return string
 217+ */
196218 function efContributionReportingTotal( $start, $fudgeFactor ) {
197219 $db = efContributionReportingConnection();
198220
@@ -213,6 +235,9 @@
214236 return $output;
215237 }
216238
 239+/**
 240+ * @return string
 241+ */
217242 function efContributionReportingTotal_Render() {
218243 $args = func_get_args();
219244 array_shift( $args );
Index: trunk/extensions/ContributionReporting/ContributionTrackingStatistics_body.php
@@ -205,7 +205,12 @@
206206
207207 /* Query Functions */
208208
209 - // Totals for today
 209+ /**
 210+ * Totals for today
 211+ *
 212+ * @param $timestamp string
 213+ * @return array
 214+ */
210215 public function getDayTotals( $timestamp = 0 ) {
211216 $range = array();
212217 $end_format = 'Ymd235959';
@@ -250,15 +255,21 @@
251256
252257 );
253258
 259+ $result = array();
254260 foreach ( $res as $row ) {
255 - foreach( $row as $key => $value ) {
 261+ foreach( $row as $value ) {
256262 $result[] = $value;
257263 }
258264 }
259265 return $result;
260266 }
261267
262 - // Given a day figure out what its week bounds are
 268+ /**
 269+ * Given a day figure out what its week bounds are
 270+ *
 271+ * @param $day
 272+ * @return array
 273+ */
263274 public function weekRange( $day ) {
264275 $day = wfTimestamp( TS_UNIX, $day );
265276 $start = ( date( 'w', $day ) == 0) ? $day : strtotime('last sunday', $day ); // Use current Sunday
Index: trunk/extensions/ContributionReporting/FundraiserStatistics_body.php
@@ -15,7 +15,7 @@
1616 }
1717
1818 public function execute( $sub ) {
19 - global $wgRequest, $wgOut, $wgUser, $wgLang, $wgScriptPath, $egFundraiserStatisticsFundraisers;
 19+ global $wgRequest, $wgOut, $wgLang, $wgScriptPath, $egFundraiserStatisticsFundraisers;
2020
2121 $showYear = array();
2222 foreach ( $egFundraiserStatisticsFundraisers as $fundraiser ) {
@@ -242,7 +242,7 @@
243243 Xml::tags(
244244 'table',
245245 array( 'cellpadding' => 0, 'cellspacing' => 0, 'border' => 0 ),
246 - Xml::tags( 'tr', null, implode( $chart['data'] ) )
 246+ Xml::tags( 'tr', null, implode( $chart['data'] ) ) // FIXME: Missing parameter to implode
247247 )
248248 );
249249 $first = false;
@@ -364,6 +364,10 @@
365365 return null;
366366 }
367367
 368+ /**
 369+ * @param $values
 370+ * @return string
 371+ */
368372 private function dropDownList ( $values ) {
369373 $dropDown = '';
370374 foreach ( $values as $value ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r104921MFT r104904awjrichards23:51, 1 December 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r104889Revert r104370awjrichards19:55, 1 December 2011

Status & tagging log