Index: trunk/extensions/ContributionReporting/ContributionReporting.php |
— | — | @@ -145,29 +145,17 @@ |
146 | 146 | $wgHooks['ParserFirstCallInit'][] = 'efContributionReportingSetup'; |
147 | 147 | $wgHooks['LanguageGetMagic'][] = 'efContributionReportingTotal_Magic'; |
148 | 148 | |
149 | | -/** |
150 | | - * @param $parser Parser |
151 | | - * @return bool |
152 | | - */ |
153 | 149 | function efContributionReportingSetup( $parser ) { |
154 | 150 | $parser->setFunctionHook( 'contributiontotal', 'efContributionReportingTotal_Render' ); |
155 | 151 | return true; |
156 | 152 | } |
157 | 153 | |
158 | | -/** |
159 | | - * @param $magicWords array |
160 | | - * @param $langCode string |
161 | | - * @return bool |
162 | | - */ |
163 | 154 | function efContributionReportingTotal_Magic( &$magicWords, $langCode ) { |
164 | 155 | $magicWords['contributiontotal'] = array( 0, 'contributiontotal' ); |
165 | 156 | return true; |
166 | 157 | } |
167 | 158 | |
168 | 159 | // Automatically use a local or special database connection |
169 | | -/** |
170 | | - * @return DatabaseMysql |
171 | | - */ |
172 | 160 | function efContributionReportingConnection() { |
173 | 161 | global $wgContributionReportingDBserver, $wgContributionReportingDBname; |
174 | 162 | global $wgContributionReportingDBuser, $wgContributionReportingDBpassword; |
— | — | @@ -186,9 +174,6 @@ |
187 | 175 | return $db; |
188 | 176 | } |
189 | 177 | |
190 | | -/** |
191 | | - * @return DatabaseMysql |
192 | | - */ |
193 | 178 | function efContributionTrackingConnection() { |
194 | 179 | global $wgContributionTrackingDBserver, $wgContributionTrackingDBname; |
195 | 180 | global $wgContributionTrackingDBuser, $wgContributionTrackingDBpassword; |
— | — | @@ -207,11 +192,6 @@ |
208 | 193 | return $db; |
209 | 194 | } |
210 | 195 | |
211 | | -/** |
212 | | - * @param $start |
213 | | - * @param $fudgeFactor |
214 | | - * @return string |
215 | | - */ |
216 | 196 | function efContributionReportingTotal( $start, $fudgeFactor ) { |
217 | 197 | $db = efContributionReportingConnection(); |
218 | 198 | |
— | — | @@ -233,9 +213,6 @@ |
234 | 214 | return $output; |
235 | 215 | } |
236 | 216 | |
237 | | -/** |
238 | | - * @return string |
239 | | - */ |
240 | 217 | function efContributionReportingTotal_Render() { |
241 | 218 | $args = func_get_args(); |
242 | 219 | array_shift( $args ); |
Index: trunk/extensions/ContributionReporting/ContributionTrackingStatistics_body.php |
— | — | @@ -205,12 +205,7 @@ |
206 | 206 | |
207 | 207 | /* Query Functions */ |
208 | 208 | |
209 | | - /** |
210 | | - * Totals for today |
211 | | - * |
212 | | - * @param $timestamp string |
213 | | - * @return array |
214 | | - */ |
| 209 | + // Totals for today |
215 | 210 | public function getDayTotals( $timestamp = 0 ) { |
216 | 211 | $range = array(); |
217 | 212 | $end_format = 'Ymd235959'; |
— | — | @@ -255,21 +250,15 @@ |
256 | 251 | |
257 | 252 | ); |
258 | 253 | |
259 | | - $result = array(); |
260 | 254 | foreach ( $res as $row ) { |
261 | | - foreach( $row as $value ) { |
| 255 | + foreach( $row as $key => $value ) { |
262 | 256 | $result[] = $value; |
263 | 257 | } |
264 | 258 | } |
265 | 259 | return $result; |
266 | 260 | } |
267 | 261 | |
268 | | - /** |
269 | | - * Given a day figure out what its week bounds are |
270 | | - * |
271 | | - * @param $day |
272 | | - * @return array |
273 | | - */ |
| 262 | + // Given a day figure out what its week bounds are |
274 | 263 | public function weekRange( $day ) { |
275 | 264 | $day = wfTimestamp( TS_UNIX, $day ); |
276 | 265 | $start = ( date( 'w', $day ) == 0) ? $day : strtotime('last sunday', $day ); // Use current Sunday |
Index: trunk/extensions/ContributionReporting/FundraiserStatistics_body.php |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | } |
17 | 17 | |
18 | 18 | public function execute( $sub ) { |
19 | | - global $wgRequest, $wgOut, $wgLang, $wgScriptPath, $egFundraiserStatisticsFundraisers; |
| 19 | + global $wgRequest, $wgOut, $wgUser, $wgLang, $wgScriptPath, $egFundraiserStatisticsFundraisers; |
20 | 20 | |
21 | 21 | $showYear = array(); |
22 | 22 | foreach ( $egFundraiserStatisticsFundraisers as $fundraiser ) { |
— | — | @@ -242,7 +242,7 @@ |
243 | 243 | Xml::tags( |
244 | 244 | 'table', |
245 | 245 | array( 'cellpadding' => 0, 'cellspacing' => 0, 'border' => 0 ), |
246 | | - Xml::tags( 'tr', null, implode( $chart['data'] ) ) // FIXME: Missing parameter to implode |
| 246 | + Xml::tags( 'tr', null, implode( $chart['data'] ) ) |
247 | 247 | ) |
248 | 248 | ); |
249 | 249 | $first = false; |
— | — | @@ -300,7 +300,7 @@ |
301 | 301 | ); |
302 | 302 | $result = array(); |
303 | 303 | $ytd = 0; |
304 | | - foreach( $select as $row ) { |
| 304 | + while ( $row = $dbr->fetchRow( $select ) ) { |
305 | 305 | $row[] = $ytd += $row[1]; // YTD |
306 | 306 | $result[] = $row; |
307 | 307 | } |
— | — | @@ -364,10 +364,6 @@ |
365 | 365 | return null; |
366 | 366 | } |
367 | 367 | |
368 | | - /** |
369 | | - * @param $values |
370 | | - * @return string |
371 | | - */ |
372 | 368 | private function dropDownList ( $values ) { |
373 | 369 | $dropDown = ''; |
374 | 370 | foreach ( $values as $value ) { |
Index: trunk/extensions/ContributionReporting/ContributionHistory_body.php |
— | — | @@ -11,6 +11,7 @@ |
12 | 12 | $wgOut->redirect( SpecialPage::getTitleFor( 'FundraiserStatistics' )->getFullURL() ); |
13 | 13 | return; |
14 | 14 | |
| 15 | + |
15 | 16 | if ( !preg_match( '/^[a-z-]+$/', $language ) ) { |
16 | 17 | $language = 'en'; |
17 | 18 | } |
Index: trunk/extensions/ContributionReporting/ContributionStatistics_body.php |
— | — | @@ -274,10 +274,6 @@ |
275 | 275 | |
276 | 276 | /* Query Functions */ |
277 | 277 | |
278 | | - /** |
279 | | - * @param $limit int |
280 | | - * @return array |
281 | | - */ |
282 | 278 | public function getDailyTotals( $limit = 30 ) { |
283 | 279 | // Get connection |
284 | 280 | $dbr = efContributionReportingConnection(); |
— | — | @@ -373,9 +369,6 @@ |
374 | 370 | return $totals; |
375 | 371 | } |
376 | 372 | |
377 | | - /** |
378 | | - * @return array |
379 | | - */ |
380 | 373 | public function getCurrencyTotals() { |
381 | 374 | // Get connection |
382 | 375 | $dbr = efContributionReportingConnection(); |
— | — | @@ -505,10 +498,6 @@ |
506 | 499 | ); |
507 | 500 | } |
508 | 501 | |
509 | | - /** |
510 | | - * @param $dbr DatabaseBase |
511 | | - * @return array |
512 | | - */ |
513 | 502 | protected function dateConds( $dbr ) { |
514 | 503 | return |
515 | 504 | array( |