public function tabularasa_action($timestamp = null) { $institutes = MyRealmModel::getMyInstitutes(); foreach ($institutes as $index => $institut) { MyRealmModel::setObjectVisits($institutes[$index], $institut['institut_id'], $GLOBALS['user']->id, $timestamp); } PageLayout::postMessage(MessageBox::success(_('Alles als gelesen markiert!'))); $this->redirect('my_institutes/index'); }
/** * TODO: Caching * @param string $type * @param string $sem */ public function tabularasa_action($sem = 'all', $timestamp = null) { NotificationCenter::postNotification('OverviewWillClear', $GLOBALS['user']->id); $timestamp = $timestamp ?: time(); $deputies_enabled = Config::get()->DEPUTIES_ENABLE; $semesters = MyRealmModel::getSelectedSemesters($sem); $min_sem_key = min($semesters); $max_sem_key = max($semesters); $courses = MyRealmModel::getCourses($min_sem_key, $max_sem_key, compact('deputies_enabled')); $courses = $courses->toArray('seminar_id modules status'); $modules = new Modules(); foreach ($courses as $index => $course) { $courses[$index]['modules'] = $modules->getLocalModules($course['seminar_id'], 'sem', $course['modules'], $course['status']); $courses[$index]['obj_type'] = 'sem'; MyRealmModel::setObjectVisits($courses[$index], $course['seminar_id'], $GLOBALS['user']->id, $timestamp); } NotificationCenter::postNotification('OverviewDidClear', $GLOBALS['user']->id); $this->flash['tabularasa'] = $timestamp; $this->redirect('my_courses/index'); }