diff --git a/classes/sessions_page_params.php b/classes/sessions_page_params.php index 3d3e974..cce5f55 100644 --- a/classes/sessions_page_params.php +++ b/classes/sessions_page_params.php @@ -61,6 +61,9 @@ class mod_attendance_sessions_page_params { */ const ACTION_DELETE_HIDDEN = 6; + + const ACTION_ILB_SYNC = 90; + /** @var int view mode of taking attendance page*/ public $action; } diff --git a/manage.php b/manage.php index 468cdfe..0aef2a8 100644 --- a/manage.php +++ b/manage.php @@ -31,6 +31,7 @@ $id = required_param('id', PARAM_INT); $from = optional_param('from', null, PARAM_ALPHANUMEXT); $pageparams->view = optional_param('view', null, PARAM_INT); $pageparams->curdate = optional_param('curdate', null, PARAM_INT); +$ilbsync = optional_param('ilbsync', null, PARAM_ALPHANUMEXT); $pageparams->perpage = get_config('attendance', 'resultsperpage'); $cm = get_coursemodule_from_id('attendance', $id, 0, false, MUST_EXIST); @@ -70,7 +71,7 @@ if ($from === 'block') { $att->view = ATT_VIEW_DAYS; } } - + $PAGE->set_url($att->url_manage()); $PAGE->set_title($course->shortname. ": ".$att->name); $PAGE->set_heading($course->fullname); @@ -78,6 +79,10 @@ $PAGE->set_cacheable(true); $PAGE->force_settings_menu(true); $PAGE->navbar->add($att->name); +if($ilbsync) { + echo html_writer::tag('p', 'ILB SYNC foi chamado', array()); +} + $output = $PAGE->get_renderer('mod_attendance'); $tabs = new attendance_tabs($att, attendance_tabs::TAB_SESSIONS); $filtercontrols = new attendance_filter_controls($att); @@ -96,5 +101,18 @@ echo $output->render($tabs); echo $output->render($filtercontrols); echo $output->render($sesstable); -echo $output->footer(); +echo html_writer::start_div(); +echo html_writer::start_tag('form', array()); +echo html_writer::tag('input', '', array('type' => 'hidden', 'name' => 'id', 'value' => $id)); +echo html_writer::tag('input', '', + array( + 'type'=>'submit', + 'value' => 'Sincronizar frequĂȘncias', + 'name' => 'ilbsync' + )); +echo html_writer::end_tag('form'); +echo html_writer::end_div(); + + +echo $output->footer();