1
|
|
|
<?php |
2
|
|
|
/************************************************************************** |
3
|
|
|
********** English Wikipedia Account Request Interface ********** |
4
|
|
|
*************************************************************************** |
5
|
|
|
** Wikipedia Account Request Graphic Design by Charles Melbye, ** |
6
|
|
|
** which is licensed under a Creative Commons ** |
7
|
|
|
** Attribution-Noncommercial-Share Alike 3.0 United States License. ** |
8
|
|
|
** ** |
9
|
|
|
** All other code are released under the Public Domain ** |
10
|
|
|
** by the ACC Development Team. ** |
11
|
|
|
** ** |
12
|
|
|
** See CREDITS for the list of developers. ** |
13
|
|
|
***************************************************************************/ |
14
|
|
|
|
15
|
|
|
class StatsFastCloses extends StatisticsPage |
16
|
|
|
{ |
17
|
|
|
protected function execute() |
18
|
|
|
{ |
19
|
|
|
$query = <<<SQL |
20
|
|
|
SELECT |
21
|
|
|
log_closed.objectid AS Request, |
22
|
|
|
user.username AS User, |
23
|
|
|
log_closed.user AS UserID, |
24
|
|
|
TIMEDIFF(log_closed.timestamp, log_reserved.timestamp) AS 'Time Taken', |
25
|
|
|
closes.mail_desc AS 'Close Type', |
26
|
|
|
log_closed.timestamp AS 'Date' |
27
|
|
|
|
28
|
|
|
FROM log log_closed |
29
|
|
|
INNER JOIN log log_reserved ON log_closed.objectid = log_reserved.objectid |
30
|
|
|
AND log_closed.objecttype = log_reserved.objecttype |
31
|
|
|
INNER JOIN closes ON closes.`closes` = log_closed.action |
32
|
|
|
LEFT JOIN user ON log_closed.user = user.id |
33
|
|
|
|
34
|
|
|
WHERE log_closed.action LIKE 'Closed%' |
35
|
|
|
AND log_reserved.action = 'Reserved' |
36
|
|
|
AND TIMEDIFF(log_closed.timestamp, log_reserved.timestamp) < '00:00:30' |
37
|
|
|
AND log_closed.user = log_reserved.user |
38
|
|
|
AND TIMEDIFF(log_closed.timestamp, log_reserved.timestamp) > '00:00:00' |
39
|
|
|
AND DATE(log_closed.timestamp) > DATE(NOW()-INTERVAL 3 MONTH) |
40
|
|
|
|
41
|
|
|
ORDER BY TIMEDIFF(log_closed.timestamp, log_reserved.timestamp) ASC |
42
|
|
|
; |
43
|
|
|
SQL; |
44
|
|
|
|
45
|
|
|
$qb = new QueryBrowser(); |
46
|
|
|
$qb->tableCallbackFunction = "statsFastClosesRowCallback"; |
|
|
|
|
47
|
|
|
$qb->overrideTableTitles = |
48
|
|
|
array("Request", "User", "Time Taken", "Close Type", "Date"); |
49
|
|
|
$qb->rowFetchMode = PDO::FETCH_NUM; |
50
|
|
|
$r = $qb->executeQueryToTable($query); |
51
|
|
|
|
52
|
|
|
return $r; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function getPageName() |
56
|
|
|
{ |
57
|
|
|
return "FastCloses"; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
public function getPageTitle() |
61
|
|
|
{ |
62
|
|
|
return "Requests closed less than 30 seconds after reservation in the past 3 months"; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
public function isProtected() |
66
|
|
|
{ |
67
|
|
|
return true; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
public function requiresWikiDatabase() |
71
|
|
|
{ |
72
|
|
|
return false; |
73
|
|
|
} |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
function statsFastClosesRowCallback($row, $currentreq) |
|
|
|
|
77
|
|
|
{ |
78
|
|
|
$out = '<tr>'; |
79
|
|
|
|
80
|
|
|
global $baseurl; |
81
|
|
|
|
82
|
|
|
$rowCount = count($row); |
83
|
|
|
|
84
|
|
|
for ($colid = 0; $colid < $rowCount; $colid++) { |
85
|
|
|
$cell = $row[$colid]; |
86
|
|
|
|
87
|
|
|
$out .= "<td>"; |
88
|
|
|
|
89
|
|
|
if ($colid == 0) { |
90
|
|
|
$out .= "<a href=\"" . $baseurl . "/acc.php?action=zoom&id=" . $cell . "\">"; |
91
|
|
|
} |
92
|
|
|
if ($colid == 1) { |
93
|
|
|
$out .= "<a href=\"" . $baseurl . "/statistics.php/Users?user=" . $row[++$colid] . "\">"; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
$out .= $cell; |
97
|
|
|
|
98
|
|
|
if ($colid == 0 || $colid == 2) { |
99
|
|
|
$out .= "</a>"; // colid is now 2 if triggered from above due to postinc |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
$out .= "</td>"; |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
$out .= "</tr>"; |
106
|
|
|
|
107
|
|
|
return $out; |
108
|
|
|
} |
109
|
|
|
|
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..