Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php |
— | — | @@ -229,6 +229,7 @@ |
230 | 230 | |
231 | 231 | 'revreview-reviewlink' => 'pending edits', |
232 | 232 | 'revreview-reviewlink-title' => 'View diff of all pending changes', |
| 233 | + 'revreview-unreviewedpage' => 'unchecked page', |
233 | 234 | |
234 | 235 | 'tooltip-ca-current' => 'View this page with pending changes', |
235 | 236 | 'tooltip-ca-stable' => 'View the published version of this page', |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -1784,9 +1784,8 @@ |
1785 | 1785 | public static function addToRCQuery( &$conds, &$tables, &$join_conds, $opts ) { |
1786 | 1786 | global $wgUser; |
1787 | 1787 | if ( $wgUser->isAllowed( 'review' ) ) { |
1788 | | - $tables[] = 'flaggedpage_pending'; |
1789 | | - $join_conds['flaggedpage_pending'] = array( 'LEFT JOIN', |
1790 | | - 'fpp_page_id = rc_cur_id AND fpp_quality = ' . FR_SIGHTED ); |
| 1788 | + $tables[] = 'flaggedpages'; |
| 1789 | + $join_conds['flaggedpages'] = array( 'LEFT JOIN', 'fp_page_id = rc_cur_id' ); |
1791 | 1790 | } |
1792 | 1791 | return true; |
1793 | 1792 | } |
— | — | @@ -1794,10 +1793,9 @@ |
1795 | 1794 | public static function addToWatchlistQuery( &$conds, &$tables, &$join_conds, &$fields ) { |
1796 | 1795 | global $wgUser; |
1797 | 1796 | if ( $wgUser->isAllowed( 'review' ) ) { |
1798 | | - $fields[] = 'fpp_rev_id'; |
1799 | | - $tables[] = 'flaggedpage_pending'; |
1800 | | - $join_conds['flaggedpage_pending'] = array( 'LEFT JOIN', |
1801 | | - 'fpp_page_id = rc_cur_id AND fpp_quality = ' . FR_SIGHTED ); |
| 1797 | + $fields[] = 'fp_stable'; |
| 1798 | + $tables[] = 'flaggedpages'; |
| 1799 | + $join_conds['flaggedpages'] = array( 'LEFT JOIN', 'fp_page_id = rc_cur_id' ); |
1802 | 1800 | } |
1803 | 1801 | return true; |
1804 | 1802 | } |
— | — | @@ -1920,20 +1918,33 @@ |
1921 | 1919 | public static function addToChangeListLine( |
1922 | 1920 | &$list, &$articlelink, &$s, &$rc, $unpatrolled, $watched |
1923 | 1921 | ) { |
1924 | | - if ( empty( $rc->mAttribs['fpp_rev_id'] ) ) { |
1925 | | - return true; // page is not listed in pending edit table |
1926 | | - } |
1927 | | - if ( !FlaggedRevs::inReviewNamespace( $rc->getTitle() ) ) { |
| 1922 | + $title = $rc->getTitle(); // convenience |
| 1923 | + if ( !FlaggedRevs::inReviewNamespace( $title ) |
| 1924 | + || empty( $rc->mAttribs['rc_this_oldid'] ) ) |
| 1925 | + { |
1928 | 1926 | return true; // confirm that page is in reviewable namespace |
1929 | 1927 | } |
1930 | | - $rlink = $list->skin->link( |
1931 | | - $rc->getTitle(), |
1932 | | - wfMsgHtml( 'revreview-reviewlink' ), |
1933 | | - array( 'title' => wfMsg( 'revreview-reviewlink-title' ) ), |
1934 | | - array( 'oldid' => $rc->mAttribs['fpp_rev_id'], 'diff' => 'cur' ) |
1935 | | - ); |
1936 | | - $rlink = wfMsgHtml( 'parentheses', $rlink ); |
1937 | | - $articlelink .= " <span class=\"mw-fr-reviewlink\">$rlink</span>"; |
| 1928 | + $rlink = ''; |
| 1929 | + // page is not reviewed |
| 1930 | + if ( empty( $rc->mAttribs['fp_stable'] ) ) { |
| 1931 | + // Is this a config were pages start off reviewable? |
| 1932 | + if ( !FlaggedRevs::stableOnlyIfConfigured() ) { |
| 1933 | + $rlink = wfMsgHtml( 'revreview-unreviewedpage' ); |
| 1934 | + $css = 'flaggedrevs-unreviewed'; |
| 1935 | + } |
| 1936 | + // page is reviewed and has pending edits |
| 1937 | + } elseif ( $rc->mAttribs['fp_stable'] < $rc->mAttribs['rc_this_oldid'] ) { |
| 1938 | + $rlink = $list->skin->link( |
| 1939 | + $title, |
| 1940 | + wfMsgHtml( 'revreview-reviewlink' ), |
| 1941 | + array( 'title' => wfMsg( 'revreview-reviewlink-title' ) ), |
| 1942 | + array( 'oldid' => $rc->mAttribs['fp_stable'], 'diff' => 'cur' ) |
| 1943 | + ); |
| 1944 | + $css = 'flaggedrevs-pending'; |
| 1945 | + } |
| 1946 | + if ( $rlink != '' ) { |
| 1947 | + $articlelink .= " <span class=\"mw-fr-reviewlink $css\">[$rlink]</span>"; |
| 1948 | + } |
1938 | 1949 | return true; |
1939 | 1950 | } |
1940 | 1951 | |