@ -8,7 +8,7 @@ require_once($CFG->libdir . '/gradelib.php');
define('VIEW_DAYS', 1);
define('VIEW_DAYS', 1);
define('VIEW_WEEKS', 2);
define('VIEW_WEEKS', 2);
define('VIEW_MONTHS', 3);
define('VIEW_MONTHS', 3);
define('VIEW_ALLTAKEN ', 4);
define('VIEW_ALLPAST ', 4);
define('VIEW_ALL', 5);
define('VIEW_ALL', 5);
define('SORT_LASTNAME', 1);
define('SORT_LASTNAME', 1);
@ -89,7 +89,6 @@ class attforblock_permissions {
require_capability('mod/attforblock:changepreferences', $this->context);
require_capability('mod/attforblock:changepreferences', $this->context);
}
}
public function can_export() {
public function can_export() {
if (is_null($this->canexport))
if (is_null($this->canexport))
$this->canexport = has_capability('mod/attforblock:export', $this->context);
$this->canexport = has_capability('mod/attforblock:export', $this->context);
@ -97,6 +96,10 @@ class attforblock_permissions {
return $this->canexport;
return $this->canexport;
}
}
public function require_export_capability() {
require_capability('mod/attforblock:export', $this->context);
}
public function can_be_listed() {
public function can_be_listed() {
if (is_null($this->canbelisted))
if (is_null($this->canbelisted))
$this->canbelisted = has_capability('mod/attforblock:canbelisted', $this->context);
$this->canbelisted = has_capability('mod/attforblock:canbelisted', $this->context);
@ -190,7 +193,7 @@ class att_page_with_filter_controls {
$this->startdate = make_timestamp($year, $mon);
$this->startdate = make_timestamp($year, $mon);
$this->enddate = make_timestamp($year, $mon + 1);
$this->enddate = make_timestamp($year, $mon + 1);
break;
break;
case VIEW_ALLTAKEN :
case VIEW_ALLPAST :
$this->startdate = 1;
$this->startdate = 1;
$this->enddate = time();
$this->enddate = time();
break;
break;