X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FLogEventsList.php;h=bf65d940119ebb3761bfe283e2c459907a48374b;hb=68ed90f748978d2fc941a01ca3081664da0df8e5;hp=d49f636b4c703547891b90a3cdcc290840bf80d0;hpb=779b716bac729b4ca38abe29f00f8768f02731f5;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index d49f636b4c..bf65d94011 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -409,7 +409,7 @@ class LogEventsList { * @ingroup Pager */ class LogPager extends ReverseChronologicalPager { - private $type = '', $user = '', $title = '', $pattern = '', $year = '', $month = ''; + private $type = '', $user = '', $title = '', $pattern = ''; public $mLogEventsList; /** * constructor @@ -429,14 +429,14 @@ class LogPager extends ReverseChronologicalPager { $this->limitType( $type ); $this->limitUser( $user ); $this->limitTitle( $title, $pattern ); - $this->limitDate( $y, $m ); + $this->getDateCond( $y, $m ); } function getDefaultQuery() { $query = parent::getDefaultQuery(); $query['type'] = $this->type; - $query['month'] = $this->month; - $query['year'] = $this->year; + $query['month'] = $this->mMonth; + $query['year'] = $this->mYear; return $query; } @@ -527,45 +527,6 @@ class LogPager extends ReverseChronologicalPager { } } - /** - * Set the log reader to return only entries from given date. - * @param int $year - * @param int $month - * @private - */ - function limitDate( $year, $month ) { - $year = intval($year); - $month = intval($month); - - $this->year = ($year > 0 && $year < 10000) ? $year : ''; - $this->month = ($month > 0 && $month < 13) ? $month : ''; - - if( $this->year || $this->month ) { - // Assume this year if only a month is given - if( $this->year ) { - $year_start = $this->year; - } else { - $year_start = substr( wfTimestampNow(), 0, 4 ); - $thisMonth = gmdate( 'n' ); - if( $this->month > $thisMonth ) { - // Future contributions aren't supposed to happen. :) - $year_start--; - } - } - - if( $this->month ) { - $month_end = str_pad($this->month + 1, 2, '0', STR_PAD_LEFT); - $year_end = $year_start; - } else { - $month_end = 0; - $year_end = $year_start + 1; - } - $ts_end = str_pad($year_end . $month_end, 14, '0' ); - - $this->mOffset = $ts_end; - } - } - function getQueryInfo() { $this->mConds[] = 'user_id = log_user'; # Don't use the wrong logging index @@ -627,11 +588,11 @@ class LogPager extends ReverseChronologicalPager { } public function getYear() { - return $this->year; + return $this->mYear; } public function getMonth() { - return $this->month; + return $this->mMonth; } }