public function active_actual_user_records($userid, $praxeid = null, $order = null)
 {
     $ret = array();
     if (is_null($praxeid)) {
         $praxeid = praxe_record::getData('id');
     }
     $all = praxe_get_praxe_records($praxeid, $order, null, null, true);
     if (is_array($all)) {
         foreach ($all as $k => $rec) {
             if ($rec->teacherid == $userid) {
                 $ret[] = $rec;
             }
         }
     }
     return $ret;
 }
 public function show_all_students_records()
 {
     global $CFG;
     if ($records = praxe_get_praxe_records(praxe_record::getData('id'), null, null, null, true, false)) {
         require_once $CFG->dirroot . '/mod/praxe/view_extteacher.php';
         $this->content .= praxe_view_extteacher::show_records($records);
     } else {
         $this->content .= get_string('no_praxe_records', 'praxe');
     }
 }
Example #3
0
     }
     break;
 case PRAXE_TAB_VIEW_EDITTEACHER:
     $viewschool = optional_param('schoolid', null, PARAM_INT);
     /// filter for schools and subtabs
     $filteractualloc = optional_param('factualloc', 0, PARAM_INT);
     ///filter for locations actual
     $filteryearloc = optional_param('fyearloc', 0, PARAM_INT);
     $viewtabrows[] = new tabobject(PRAXE_TAB_EDITTEACHER_HOME, $CFG->wwwroot . '/mod/praxe/view.php?id=' . $cm->id . '&mode=' . $tab_modes['editteacher'][PRAXE_TAB_EDITTEACHER_HOME], get_string('records_list', 'praxe'));
     $viewtabrows[] = new tabobject(PRAXE_TAB_EDITTEACHER_SCHOOLS, $CFG->wwwroot . '/mod/praxe/view.php?id=' . $cm->id . '&mode=' . $tab_modes['editteacher'][PRAXE_TAB_EDITTEACHER_SCHOOLS], get_string('schools', 'praxe'));
     if (praxe_has_capability('manageallincourse')) {
         $viewtabrows[] = new tabobject(PRAXE_TAB_EDITTEACHER_ADDSCHOOL, $CFG->wwwroot . '/mod/praxe/view.php?id=' . $cm->id . '&mode=' . $tab_modes['editteacher'][PRAXE_TAB_EDITTEACHER_ADDSCHOOL], get_string('addschool', 'praxe'));
     }
     if ($tab == PRAXE_TAB_EDITTEACHER_HOME) {
         $recordid = optional_param('recordid', 0, PARAM_INT);
         $records = praxe_get_praxe_records(praxe_record::getData('id'));
         if ($records) {
             $options = array();
             $options[0] = get_string('all');
             foreach ($records as $rec) {
                 $options[$rec->id] = $rec->schoolname . " - " . praxe_get_user_fullname($rec->teacherid) . " - " . $rec->subject . " - " . praxe_get_user_fullname($rec->student);
             }
             $sel = new single_select(praxe_get_base_url(array('mode' => $mode)), 'recordid', $options, $recordid, null, 'praxepop_recorddetail');
             $sel->label = get_string('praxe', 'praxe');
             $tab_content .= $OUTPUT->render($sel);
         }
     }
     if ($tab == PRAXE_TAB_EDITTEACHER_SCHOOLS || !is_null($viewschool)) {
         $activated[] = PRAXE_TAB_EDITTEACHER_SCHOOLS;
         /// school list exists ///
         if (is_array($schools = praxe_get_schools())) {