mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
MDL-28283-master Completion Future dates can now be set as completion criteria
This commit is contained in:
parent
5fc420e2ed
commit
a1b9872209
@ -53,7 +53,7 @@ class completion_criteria_date extends completion_criteria {
|
|||||||
public function config_form_display(&$mform, $data = null)
|
public function config_form_display(&$mform, $data = null)
|
||||||
{
|
{
|
||||||
$mform->addElement('checkbox', 'criteria_date', get_string('enable'));
|
$mform->addElement('checkbox', 'criteria_date', get_string('enable'));
|
||||||
$mform->addElement('date', 'criteria_date_value', get_string('afterspecifieddate', 'completion'));
|
$mform->addElement('date_selector', 'criteria_date_value', get_string('afterspecifieddate', 'completion'));
|
||||||
|
|
||||||
// If instance of criteria exists
|
// If instance of criteria exists
|
||||||
if ($this->id) {
|
if ($this->id) {
|
||||||
@ -74,8 +74,7 @@ class completion_criteria_date extends completion_criteria {
|
|||||||
|
|
||||||
if (!empty($data->criteria_date)) {
|
if (!empty($data->criteria_date)) {
|
||||||
$this->course = $data->id;
|
$this->course = $data->id;
|
||||||
$date = $data->criteria_date_value;
|
$this->timeend = $data->criteria_date_value;
|
||||||
$this->timeend = strtotime($date['Y'].'-'.$date['M'].'-'.$date['d']);
|
|
||||||
$this->insert();
|
$this->insert();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user