(bug 37263) better handling of minor/bot in enhanced changelist
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 1 Dec 2012 19:51:09 +0000 (20:51 +0100)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 5 Dec 2012 10:01:49 +0000 (10:01 +0000)
It makes more sense, to have the whole group as minor/bot, when all of
the group are minor or bot edits, not when only one of the group is
minor/bot.

Change-Id: I62bf1099f2e3fb73e9b50374cbb7ba8bfd8a009e

includes/ChangesList.php

index 6b7e99c..9ca64c5 100644 (file)
@@ -862,6 +862,8 @@ class EnhancedChangesList extends ChangesList {
                # Other properties
                $unpatrolled = false;
                $isnew = false;
+               $allBots = true;
+               $allMinors = true;
                $curId = $currentRevision = 0;
                # Some catalyst variables...
                $namehidden = true;
@@ -895,7 +897,13 @@ class EnhancedChangesList extends ChangesList {
                                $currentRevision = $rcObj->mAttribs['rc_this_oldid'];
                        }
 
-                       $bot = $rcObj->mAttribs['rc_bot'];
+                       if( !$rcObj->mAttribs['rc_bot'] ) {
+                               $allBots = false;
+                       }
+                       if( !$rcObj->mAttribs['rc_minor'] ) {
+                               $allMinors = false;
+                       }
+
                        $userlinks[$u]++;
                }
 
@@ -922,10 +930,10 @@ class EnhancedChangesList extends ChangesList {
 
                # Main line
                $r .= '<td class="mw-enhanced-rc">' . $this->recentChangesFlags( array(
-                       'newpage' => $isnew,
-                       'minor' => false,
-                       'unpatrolled' => $unpatrolled,
-                       'bot' => $bot ,
+                       'newpage' => $isnew, # show, when one have this flag
+                       'minor' => $allMinors, # show only, when all have this flag
+                       'unpatrolled' => $unpatrolled, # show, when one have this flag
+                       'bot' => $allBots, # show only, when all have this flag
                ) );
 
                # Timestamp