Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 14... Línea 14...
14
// You should have received a copy of the GNU General Public License
14
// You should have received a copy of the GNU General Public License
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
Línea 16... Línea 16...
16
 
16
 
Línea -... Línea 17...
-
 
17
declare(strict_types=1);
17
declare(strict_types=1);
18
 
18
 
19
use core\{clock, di};
19
use core_reportbuilder\manager;
20
use core_reportbuilder\manager;
20
use core_reportbuilder\local\helpers\report as helper;
21
use core_reportbuilder\local\helpers\report as helper;
21
use core_reportbuilder\local\helpers\schedule as schedule_helper;
22
use core_reportbuilder\local\helpers\schedule as schedule_helper;
Línea 58... Línea 59...
58
        }
59
        }
Línea 59... Línea 60...
59
 
60
 
60
        // Include default setup unless specifically disabled in passed record.
61
        // Include default setup unless specifically disabled in passed record.
Línea -... Línea 62...
-
 
62
        $default = (bool) ($record['default'] ?? true);
-
 
63
 
-
 
64
        // Report custom fields.
61
        $default = (bool) ($record['default'] ?? true);
65
        \core_reportbuilder\customfield\report_handler::create()->instance_form_before_set_data((object)$record);
62
 
66
 
63
        // If setting up default report, purge caches to ensure any default attributes are always loaded in tests.
67
        // If setting up default report, purge caches to ensure any default attributes are always loaded in tests.
64
        $report = helper::create_report((object) $record, $default);
68
        $report = helper::create_report((object) $record, $default);
65
        if ($default) {
69
        if ($default) {
Línea 206... Línea 210...
206
        }
210
        }
207
        if (!array_key_exists('message', $record)) {
211
        if (!array_key_exists('message', $record)) {
208
            $record['message'] = $record['name'] . ' message';
212
            $record['message'] = $record['name'] . ' message';
209
        }
213
        }
210
        if (!array_key_exists('timescheduled', $record)) {
214
        if (!array_key_exists('timescheduled', $record)) {
211
            $record['timescheduled'] = usergetmidnight(time() + DAYSECS);
215
            $record['timescheduled'] = usergetmidnight(di::get(clock::class)->time() + DAYSECS);
212
        }
216
        }
Línea 213... Línea -...
213
 
-
 
214
        // Time to use as comparison against current date (null means current time).
-
 
215
        $timenow = $record['timenow'] ?? null;
-
 
216
 
217
 
217
        return schedule_helper::create_schedule((object) $record, $timenow);
218
        return schedule_helper::create_schedule((object) $record);
218
    }
219
    }