]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-16844, making choose very old stats data possible, merged from 1.9"
authordongsheng <dongsheng>
Sun, 12 Oct 2008 05:47:35 +0000 (05:47 +0000)
committerdongsheng <dongsheng>
Sun, 12 Oct 2008 05:47:35 +0000 (05:47 +0000)
lib/statslib.php

index 8b0960629919c806e1477afd6b44cb905aff8a90..42d08a2e7eaaf9d4f8b44d7f569426a0a4fbf273 100644 (file)
@@ -1318,6 +1318,13 @@ function stats_get_time_options($now,$lastweekend,$lastmonthend,$earliestday,$ea
         $timeoptions[STATS_TIME_LASTYEAR] = get_string('lastyear');
     }
 
+    $years = (int)date('y', $now) - (int)date('y', $earliestmonth);
+    if ($years > 1) {
+        for($i = 2; $i <= $years; $i++) {
+            $timeoptions[$i*12+20] = get_string('numyears', 'moodle', $i);
+        }
+    }
+
     return $timeoptions;
 }