From 48960208784586e8ad9bde75626dc4e631e18711 Mon Sep 17 00:00:00 2001 From: Moritz Strohm Date: Wed, 28 Sep 2022 09:50:22 +0000 Subject: fix for BIESt #1016 Merge request studip/studip!625 --- app/controllers/admin/courseplanning.php | 1 + app/controllers/admin/overlapping.php | 2 +- app/controllers/calendar/contentbox.php | 20 +++-- app/controllers/course/admission.php | 14 +++- app/controllers/course/basicdata.php | 35 +++++--- app/controllers/course/block_appointments.php | 5 +- app/controllers/course/lvgselector.php | 5 +- app/controllers/course/overview.php | 8 +- app/controllers/course/room_requests.php | 35 +++++--- app/controllers/course/study_areas.php | 2 +- app/controllers/course/timesrooms.php | 17 ++-- app/controllers/evaluation.php | 4 +- app/controllers/my_courses.php | 2 +- app/controllers/my_institutes.php | 2 +- app/controllers/questionnaire.php | 3 + app/controllers/studip_controller.php | 4 +- app/views/admin/overlapping/selection.php | 2 +- app/views/calendar/contentbox/display.php | 5 +- app/views/course/basicdata/_input.php | 22 ++--- app/views/course/basicdata/view.php | 10 +-- app/views/course/block_appointments/index.php | 20 ++--- app/views/course/lvgselector/index.php | 28 +++---- .../room_requests/request_select_properties.php | 12 +-- .../course/room_requests/request_select_room.php | 4 +- app/views/course/timesrooms/_cancel_form.php | 38 ++++----- app/views/course/timesrooms/_regularEvents.php | 2 +- app/views/course/timesrooms/editDate.php | 6 +- app/views/course/wizard/steps/lvgroups/index.php | 2 +- app/views/course/wizard/steps/studyareas/index.php | 30 ++++--- app/views/questionnaire/evaluate.php | 2 +- .../question_types/freetext/freetext_answer.php | 2 +- .../questionnaire/question_types/test/_answer.php | 4 +- .../question_types/test/test_edit.php | 2 +- .../questionnaire/question_types/vote/_answer.php | 2 +- .../templates/configure.php | 4 +- lib/bootstrap.php | 1 + lib/calendar_functions.inc.php | 1 + lib/classes/Assets.class.php | 14 ++-- lib/classes/DataFieldEntry.class.php | 3 +- lib/classes/DbSnapshot.class.php | 2 +- lib/classes/DbView.class.php | 6 +- lib/classes/I18N.php | 2 +- lib/classes/QuickSearch.class.php | 55 ++++++++----- lib/classes/Seminar.class.php | 5 +- lib/classes/StudipSemSearchHelper.class.php | 25 +++--- lib/classes/admission/CourseSet.class.php | 17 ++-- .../coursewizardsteps/LVGroupsWizardStep.php | 2 +- .../coursewizardsteps/StudyAreasWizardStep.php | 4 +- lib/classes/searchtypes/SeminarSearch.class.php | 9 +- lib/export/export_choose_xslt.inc.php | 7 +- lib/export/export_start.inc.php | 2 +- lib/export/export_studipdata_func.inc.php | 4 +- lib/export/export_xml.inc.php | 4 +- lib/export/export_xml_func.inc.php | 36 ++++---- lib/models/AbschlussKategorie.php | 4 +- lib/models/CourseDate.class.php | 4 +- lib/models/Semester.class.php | 2 +- lib/models/SimpleORMap.class.php | 2 +- lib/models/StudipStudyArea.class.php | 4 +- lib/models/resources/Building.class.php | 95 +++++++++++----------- lib/modules/CoreScm.class.php | 2 +- lib/raumzeit/SeminarDB.class.php | 1 + lib/raumzeit/raumzeit_functions.inc.php | 2 +- lib/resources/RoomManager.class.php | 2 +- public/export.php | 6 +- templates/dates/seminar_html.php | 1 + templates/quicksearch/inputfield.php | 2 +- vendor/trails/src/response.php | 4 +- vendor/trails/trails.php | 4 +- 69 files changed, 386 insertions(+), 304 deletions(-) diff --git a/app/controllers/admin/courseplanning.php b/app/controllers/admin/courseplanning.php index 47c181d..c07d6d9 100644 --- a/app/controllers/admin/courseplanning.php +++ b/app/controllers/admin/courseplanning.php @@ -38,6 +38,7 @@ class Admin_CourseplanningController extends AuthenticatedController if (in_array($action, ['index', 'weekday'])) { PageLayout::allowFullscreenMode(); } + $this->selected_weekday = ''; } private function getPlanTitle() diff --git a/app/controllers/admin/overlapping.php b/app/controllers/admin/overlapping.php index 97efe4e..8072ff5 100644 --- a/app/controllers/admin/overlapping.php +++ b/app/controllers/admin/overlapping.php @@ -69,7 +69,7 @@ class Admin_OverlappingController extends AuthenticatedController } $this->conflicts = MvvOverlappingSelection::getConflictsBySelection( $this->selection_id, - !$_SESSION['MVV_OVL_HIDDEN'] + empty($_SESSION['MVV_OVL_HIDDEN']) ); } diff --git a/app/controllers/calendar/contentbox.php b/app/controllers/calendar/contentbox.php index 134fe0c..f2689bf 100644 --- a/app/controllers/calendar/contentbox.php +++ b/app/controllers/calendar/contentbox.php @@ -12,17 +12,22 @@ * @category Stud.IP * @package calender */ -class Calendar_ContentboxController extends StudipController { - +class Calendar_ContentboxController extends StudipController +{ /** * Widget controller to produce the formally known show_dates() * * @param String $range_id range id (or array of range ids) of the news to get displayed */ - public function display_action($range_id, $timespan = 604800, $start = null) - { + public function display_action($range_id, $timespan = 604800, $start = null) + { + $this->admin = false; + $this->single = false; + $this->userRange = false; + $this->termine = []; + // Fetch time if needed - $this->start = $start ? : strtotime('today'); + $this->start = $start ?: strtotime('today'); $this->timespan = $timespan; // To array fallback of $range_id @@ -55,7 +60,7 @@ class Calendar_ContentboxController extends StudipController { } // Forge title - if ($this->termine) { + if (!empty($this->termine)) { $this->title = sprintf( _('Termine für die Zeit vom %s bis zum %s'), strftime('%d. %B %Y', $this->start), @@ -75,6 +80,7 @@ class Calendar_ContentboxController extends StudipController { { $course = Course::find($id); $dates = $course->getDatesWithExdates()->findBy('end_time', [$this->start, $this->start + $this->timespan], '><'); + foreach ($dates as $courseDate) { // Build info $info = []; @@ -116,8 +122,6 @@ class Calendar_ContentboxController extends StudipController { ); // Prepare termine - $this->termine = []; - foreach ($events as $termin) { // Exclude events that begin after the given time range if ($termin->getStart() > $this->start + $this->timespan) { diff --git a/app/controllers/course/admission.php b/app/controllers/course/admission.php index 80e084a..1e8832e 100644 --- a/app/controllers/course/admission.php +++ b/app/controllers/course/admission.php @@ -24,7 +24,7 @@ class Course_AdmissionController extends AuthenticatedController parent::before_filter($action, $args); - $course_id = $args[0]; + $course_id = $args[0] ?? ''; $this->course_id = Request::option('cid', $course_id); @@ -111,7 +111,7 @@ class Course_AdmissionController extends AuthenticatedController } } $lockdata = LockRules::getObjectRule($this->course_id); - if ($lockdata['description'] && LockRules::CheckLockRulePermission($this->course_id, $lockdata['permission'])) { + if (!empty($lockdata['description']) && LockRules::CheckLockRulePermission($this->course_id)) { PageLayout::postMessage(MessageBox::info(formatLinks($lockdata['description']))); } } @@ -400,8 +400,14 @@ class Course_AdmissionController extends AuthenticatedController { PageLayout::setTitle(_('Neue Anmelderegel')); - list($type, $another_type) = explode('_', Request::option('type')); - list($rule_id, $another_rule_id) = explode('_', Request::option('rule_id')); + $types = explode('_', Request::option('type')); + $type = $types[0] ?? ''; + $another_type = $types[1] ?? null; + + $rule_ids = explode('_', Request::option('rule_id')); + $rule_id = $rule_ids[0] ?? ''; + $another_rule_id = $rule_ids[1] ?? null; + $rule_types = AdmissionRule::getAvailableAdmissionRules(true); if (isset($rule_types[$type])) { $rule = new $type($rule_id); diff --git a/app/controllers/course/basicdata.php b/app/controllers/course/basicdata.php index bc20ed5..efff192 100644 --- a/app/controllers/course/basicdata.php +++ b/app/controllers/course/basicdata.php @@ -230,22 +230,23 @@ class Course_BasicdataController extends AuthenticatedController private function instituteChoices($institutes) { $faculty_id = null; - $result = []; + $result = []; foreach ($institutes as $inst) { + $key = $inst['fakultaets_id'] ?? $faculty_id; if ($inst['is_fak']) { $result[$inst['Institut_id']] = [ 'label' => $inst['Name'], 'children' => [], ]; $faculty_id = $inst['Institut_id']; - } elseif (!isset($result[$inst['fakultaets_id'] ?: $faculty_id])) { + } elseif (!isset($result[$key])) { $result[] = [ 'label' => false, 'children' => [$inst['Institut_id'] => $inst['Name']], ]; } else { - $result[$inst['fakultaets_id'] ?: $faculty_id]['children'][$inst['Institut_id']] = $inst['Name']; + $result[$key]['children'][$inst['Institut_id']] = $inst['Name']; } } @@ -257,7 +258,7 @@ class Course_BasicdataController extends AuthenticatedController * Action wie Set ausgeführt wurde, von der hierher weitergeleitet worden ist. * Wichtige Daten dazu wurden dann über $this->flash übertragen. * - * @param md5 $course_id + * @param string $course_id */ public function view_action($course_id = null) { @@ -356,27 +357,37 @@ class Course_BasicdataController extends AuthenticatedController $this->mkstring = $data['mkdate'] ? date("d.m.Y, H:i", $data['mkdate']) : _("unbekannt"); $this->chstring = $data['chdate'] ? date("d.m.Y, H:i", $data['chdate']) : _("unbekannt"); $lockdata = LockRules::getObjectRule($this->course_id); - if ($lockdata['description'] && LockRules::CheckLockRulePermission($this->course_id, $lockdata['permission'])){ + if (!empty($lockdata['description']) && LockRules::CheckLockRulePermission($this->course_id, $lockdata['permission'])){ $this->flash['msg'] = array_merge((array)$this->flash['msg'], [["info", formatLinks($lockdata['description'])]]); } $this->flash->discard(); //schmeißt ab jetzt unnötige Variablen aus der Session. $sidebar = Sidebar::get(); $widget = new ActionsWidget(); - $widget->addLink(_('Bild ändern'), - $this->url_for('avatar/update/course', $course_id), - Icon::create('edit', 'clickable')); + $widget->addLink( + _('Bild ändern'), + $this->url_for('avatar/update/course', $course_id), + Icon::create('edit') + ); if ($this->deputies_enabled) { + $newstatus = null; + $text = null; + if (Deputy::isDeputy($user->id, $this->course_id)) { $newstatus = 'dozent'; $text = _('Lehrende werden'); - } else if (in_array($user->id, array_keys($this->dozenten)) && sizeof($this->dozenten) > 1) { + } else if (in_array($user->id, array_keys($this->dozenten)) && count($this->dozenten) > 1) { $newstatus = 'deputy'; $text = _('Vertretung werden'); } - $widget->addLink($text, - $this->url_for('course/basicdata/switchdeputy', $this->course_id, $newstatus), - Icon::create('persons', 'clickable')); + + if ($text) { + $widget->addLink( + $text, + $this->url_for('course/basicdata/switchdeputy', $this->course_id, $newstatus), + Icon::create('persons') + ); + } } $sidebar->addWidget($widget); // Entry list for admin upwards. diff --git a/app/controllers/course/block_appointments.php b/app/controllers/course/block_appointments.php index f45ac10..67035fa 100644 --- a/app/controllers/course/block_appointments.php +++ b/app/controllers/course/block_appointments.php @@ -42,6 +42,8 @@ class Course_BlockAppointmentsController extends AuthenticatedController protected function setAvailableRooms() { + $this->room_search = null; + $this->selectable_rooms = []; if (Config::get()->RESOURCES_ENABLE) { //Check for how many rooms the user has booking permissions. //In case these permissions exist for more than 50 rooms @@ -54,7 +56,6 @@ class Course_BlockAppointmentsController extends AuthenticatedController 'admin' ); - $this->selectable_rooms = []; $rooms_with_booking_permissions = 0; if ($current_user_is_resource_admin) { $rooms_with_booking_permissions = Room::countAll(); @@ -99,7 +100,7 @@ class Course_BlockAppointmentsController extends AuthenticatedController } $this->linkAttributes = ['fromDialog' => Request::int('fromDialog') ? 1 : 0]; $this->start_ts = strtotime('this monday'); - $this->request = $this->flash['request'] ?: $_SESSION['block_appointments']; + $this->request = $this->flash['request'] ?? $_SESSION['block_appointments'] ?? []; $this->confirm_many = isset($this->flash['confirm_many']) ? $this->flash['confirm_many'] : false; $this->lecturers = CourseMember::findByCourseAndStatus( $this->course_id, diff --git a/app/controllers/course/lvgselector.php b/app/controllers/course/lvgselector.php index 541ff27..101bee0 100644 --- a/app/controllers/course/lvgselector.php +++ b/app/controllers/course/lvgselector.php @@ -46,6 +46,7 @@ class Course_LvgselectorController extends AuthenticatedController */ public function index_action() { + $this->url_params = []; if (Request::get('from')) { $this->url_params['from'] = Request::get('from'); } @@ -117,6 +118,7 @@ class Course_LvgselectorController extends AuthenticatedController } $this->ajax_url = $this->url_for('course/lvgselector/ajax'); + $this->no_js_url = ''; $this->url = $this->action_url('index'); } @@ -132,7 +134,8 @@ class Course_LvgselectorController extends AuthenticatedController $stepNumber = Request::int('step'); $method = Request::get('method'); $parameters = Request::getArray('parameter'); - $result = call_user_func_array(['LVGroupsWizardStep', $method], $parameters); + $wizard_step = new LVGroupsWizardStep(); + $result = call_user_func_array([$wizard_step, $method], $parameters); if (is_array($result) || is_object($result)) { $this->render_json($result); } else { diff --git a/app/controllers/course/overview.php b/app/controllers/course/overview.php index 966c0ca..0994d54 100644 --- a/app/controllers/course/overview.php +++ b/app/controllers/course/overview.php @@ -16,8 +16,6 @@ class Course_OverviewController extends AuthenticatedController public function before_filter(&$action, &$args) { - global $SEM_TYPE, $SEM_CLASS; - parent::before_filter($action, $args); checkObject(); @@ -74,16 +72,16 @@ class Course_OverviewController extends AuthenticatedController $this->dates = $response->body; $this->next_date = $this->sem->getNextDate(); $this->first_date = $this->sem->getFirstDate(); - $show_link = ($GLOBALS["perm"]->have_studip_perm('autor', $this->course_id) && $this->modules['schedule']); + $show_link = $GLOBALS["perm"]->have_studip_perm('autor', $this->course_id) && $this->course->isToolActive('schedule'); $this->times_rooms = $this->sem->getDatesTemplate('dates/seminar_html', ['link_to_dates' => $show_link, 'show_room' => true]); // Fettch teachers $dozenten = $this->sem->getMembers('dozent'); - $num_dozenten = count($dozenten); + $this->num_dozenten = count($dozenten); $show_dozenten = []; foreach ($dozenten as $dozent) { $show_dozenten[] = '' - . htmlready($num_dozenten > 10 ? get_fullname($dozent['user_id'], 'no_title_short') : $dozent['fullname']) + . htmlready($this->num_dozenten > 10 ? get_fullname($dozent['user_id'], 'no_title_short') : $dozent['fullname']) . ''; } $this->show_dozenten = $show_dozenten; diff --git a/app/controllers/course/room_requests.php b/app/controllers/course/room_requests.php index 8747e9b..d23b5c7 100644 --- a/app/controllers/course/room_requests.php +++ b/app/controllers/course/room_requests.php @@ -28,9 +28,8 @@ class Course_RoomRequestsController extends AuthenticatedController parent::before_filter($action, $args); - $course_id = $args[0]; $this->current_user = User::findCurrent(); - $this->course_id = Request::option('cid', $course_id); + $this->course_id = Request::option('cid', $args[0] ?? null); $pagetitle = ''; //Navigation in der Veranstaltung: if (Navigation::hasItem('/course/admin/room_requests')) { @@ -206,6 +205,17 @@ class Course_RoomRequestsController extends AuthenticatedController */ protected function loadData($session_data, $step = 1) { + $this->available_room_categories = []; + $this->room_name = ''; + $this->category_id = ''; + $this->category = null; + $this->available_properties = []; + $this->selected_properties = []; + $this->seats = ''; + $this->comment = ''; + $this->reply_lecturers = false; + $this->preparation_time = 0; + $this->course_id = Context::getId(); $this->user_is_global_resource_admin = ResourceManager::userHasGlobalPermission( $this->current_user, @@ -220,19 +230,19 @@ class Course_RoomRequestsController extends AuthenticatedController ); } if ($step >= 2) { - if ($session_data['category_id']) { + if (!empty($session_data['category_id'])) { $this->category = ResourceCategory::find($session_data['category_id']); - if ($this->category instanceof ResourceCategory) { + if ($this->category) { //Get all available properties for the category: $this->available_properties = $this->category->getRequestableProperties(); } } - $this->room_name = $session_data['room_name']; - $this->category_id = $session_data['category_id']; - $this->preparation_time = $session_data['preparation_time'] ?: '0'; + $this->room_name = $session_data['room_name'] ?? ''; + $this->category_id = $session_data['category_id'] ?? ''; + $this->preparation_time = $session_data['preparation_time'] ?? '0'; } if ($step >= 3) { - if ($this->category instanceof ResourceCategory) { + if ($this->category) { $this->selected_properties = $session_data['selected_properties']; } } @@ -442,7 +452,7 @@ class Course_RoomRequestsController extends AuthenticatedController $this->available_properties = $this->category->getRequestableProperties(); - if (!$session_data['selected_properties']['seats']) { + if (empty($session_data['selected_properties']['seats'])) { $this->course = Course::find($this->course_id); $admission_turnout = $this->course->admission_turnout; $this->selected_properties['seats'] = $admission_turnout @@ -590,11 +600,11 @@ class Course_RoomRequestsController extends AuthenticatedController $this->reply_lecturers = $this->request->reply_recipients == 'lecturer'; } - $search_properties = $this->selected_properties; - if ($session_data['category_id']) { + $search_properties = $this->selected_properties ?? []; + if (!empty($session_data['category_id'])) { $search_properties['room_category_id'] = $session_data['category_id']; } - if ($search_properties['seats']) { + if (!empty($search_properties['seats'])) { //The seats property value is a minimum. $search_properties['seats'] = [ $search_properties['seats'], @@ -625,7 +635,6 @@ class Course_RoomRequestsController extends AuthenticatedController } $this->available_room_icons = []; $request_time_intervals = $this->request->getTimeIntervals(); - $request_date_amount = count($request_time_intervals); foreach ($this->matching_rooms as $room) { $request_dates_booked = 0; foreach ($request_time_intervals as $interval) { diff --git a/app/controllers/course/study_areas.php b/app/controllers/course/study_areas.php index d1fa13e..fcb6440 100644 --- a/app/controllers/course/study_areas.php +++ b/app/controllers/course/study_areas.php @@ -130,7 +130,7 @@ class Course_StudyAreasController extends AuthenticatedController } $params = []; - if(Request::get('open_node')) { + if (Request::get('open_node')) { $params['open_node'] = Request::get('open_node'); } if (Request::get('from')) { diff --git a/app/controllers/course/timesrooms.php b/app/controllers/course/timesrooms.php index cd9d001..4ae955f 100644 --- a/app/controllers/course/timesrooms.php +++ b/app/controllers/course/timesrooms.php @@ -168,9 +168,8 @@ class Course_TimesroomsController extends AuthenticatedController if (($val->room_booking instanceof ResourceBooking) && !$cycle_has_multiple_rooms) { $date_room = $val->room_booking->resource->name; - if ($this->cycle_room_names[$cycle->id]) { - if ($date_room - && ($date_room != $this->cycle_room_names[$cycle->id])) { + if (isset($this->cycle_room_names[$cycle->id])) { + if ($date_room && $date_room != $this->cycle_room_names[$cycle->id]) { $cycle_has_multiple_rooms = true; } } elseif ($date_room) { @@ -225,8 +224,11 @@ class Course_TimesroomsController extends AuthenticatedController } $this->single_dates = $single_dates; - $this->checked_dates = $_SESSION['_checked_dates']; - unset($_SESSION['_checked_dates']); + $this->checked_dates = []; + if (!empty($_SESSION['_checked_dates'])) { + $this->checked_dates = $_SESSION['_checked_dates']; + unset($_SESSION['_checked_dates']); + } } /** @@ -1115,6 +1117,8 @@ class Course_TimesroomsController extends AuthenticatedController words('day start_time end_time description cycle startWeek teacher_sws fromDialog course_type') ); + $this->linkAttributes = ['fromDialog' => Request::isXhr() ? 1 : 0]; + $this->cycle = new SeminarCycleDate($cycle_id); if ($this->cycle->isNew()) { @@ -1604,6 +1608,8 @@ class Course_TimesroomsController extends AuthenticatedController protected function setAvailableRooms($dates, $date_booking_ids = [], $only_bookable_rooms = false) { + $this->room_search = null; + $this->selectable_rooms = []; if (Config::get()->RESOURCES_ENABLE) { //Check for how many rooms the user has booking permissions. //In case these permissions exist for more than 50 rooms @@ -1629,7 +1635,6 @@ class Course_TimesroomsController extends AuthenticatedController ]; } } - $this->selectable_rooms = []; $rooms_with_booking_permissions = 0; if ($current_user_is_resource_admin) { $rooms_with_booking_permissions = Room::countAll(); diff --git a/app/controllers/evaluation.php b/app/controllers/evaluation.php index 7ed30df..4a157a9 100644 --- a/app/controllers/evaluation.php +++ b/app/controllers/evaluation.php @@ -38,9 +38,7 @@ class EvaluationController extends AuthenticatedController $this->evaluations = array_merge($this->evaluations, StudipEvaluation::findMany($eval_db->getEvaluationIDs($range_id, EVAL_STATE_STOPPED))); } } - - // Special case: from widget and no data -> no output - if (count($this->evaluations) === 0) { + if (!empty($this->suppress_empty_output) && count($this->evaluations) === 0) { $this->render_nothing(); } else { $this->visit(); diff --git a/app/controllers/my_courses.php b/app/controllers/my_courses.php index 21943fe..da32107 100644 --- a/app/controllers/my_courses.php +++ b/app/controllers/my_courses.php @@ -955,7 +955,7 @@ class MyCoursesController extends AuthenticatedController $extra_navigation = [ 'url' => URLHelper::getURL($adminnavigation->getURL(), ['cid' => $course['seminar_id']]), 'icon' => $adminnavigation->getImage()->getShape(), - 'label' => $adminnavigation->getLinkAttributes()['title'] ?: _('Verwaltung'), + 'label' => $adminnavigation->getLinkAttributes()['title'] ?? _('Verwaltung'), ]; } } diff --git a/app/controllers/my_institutes.php b/app/controllers/my_institutes.php index 514fd66..a17862f 100644 --- a/app/controllers/my_institutes.php +++ b/app/controllers/my_institutes.php @@ -84,7 +84,7 @@ class MyInstitutesController extends AuthenticatedController protected function check_institute($institute): bool { if ($institute['visitdate'] || $institute['last_modified']) { - if ($institute['visitdate'] <= $institute["chdate"] || $institute['last_modified'] > 0) { + if ($institute['visitdate'] <= $institute["chdate"] || (!empty($institute['last_modified']) && $institute['last_modified'] > 0)) { $last_modified = ($institute['visitdate'] <= $institute["chdate"] && $institute["chdate"] > $institute['last_modified'] ? $institute["chdate"] : $institute['last_modified']); if ($last_modified) { diff --git a/app/controllers/questionnaire.php b/app/controllers/questionnaire.php index d886be2..dd11521 100644 --- a/app/controllers/questionnaire.php +++ b/app/controllers/questionnaire.php @@ -399,6 +399,9 @@ class QuestionnaireController extends AuthenticatedController if (!$this->questionnaire->isEditable()) { throw new AccessDeniedException(_('Der Fragebogen ist nicht bearbeitbar.')); } + $this->profile = null; + $this->public = null; + $this->start = null; foreach ($this->questionnaire->assignments as $relation) { if ($relation['range_type'] === "user") { $this->profile = $relation; diff --git a/app/controllers/studip_controller.php b/app/controllers/studip_controller.php index f2eb023..2e93d05 100644 --- a/app/controllers/studip_controller.php +++ b/app/controllers/studip_controller.php @@ -263,10 +263,10 @@ abstract class StudipController extends Trails_Controller // Try to create route if none given if ($to === '') { - $args[0] = $this->parent_controller + $to = isset($this->parent_controller) ? $this->parent_controller->current_action : $this->current_action; - return $this->action_url(...$args); + return $this->action_url($to); } // Create url for a specific action diff --git a/app/views/admin/overlapping/selection.php b/app/views/admin/overlapping/selection.php index e970732..1c27c79 100644 --- a/app/views/admin/overlapping/selection.php +++ b/app/views/admin/overlapping/selection.php @@ -58,7 +58,7 @@ diff --git a/app/views/calendar/contentbox/display.php b/app/views/calendar/contentbox/display.php index 6791670..41498f4 100644 --- a/app/views/calendar/contentbox/display.php +++ b/app/views/calendar/contentbox/display.php @@ -19,14 +19,13 @@ - - + render_partial('calendar/contentbox/_termin.php', ['termin' => $termin]); ?>
- + diff --git a/app/views/course/basicdata/_input.php b/app/views/course/basicdata/_input.php index ffaad5e..60f6b60 100644 --- a/app/views/course/basicdata/_input.php +++ b/app/views/course/basicdata/_input.php @@ -2,35 +2,35 @@ # Lifter010: TODO $is_locked = $input['locked'] ? 'disabled readonly' : ''; $is_locked_array = $input['locked'] ? ['disabled' => true, 'readonly' => true] : []; -$is_required_array = $input['must'] ? ['required' => true] : []; -$is_pattern_array = $input['pattern'] ? ['pattern' => $input['pattern']] : []; +$is_required_array = !empty($input['must']) ? ['required' => true] : []; +$is_pattern_array = !empty($input['pattern']) ? ['pattern' => $input['pattern']] : []; if ($input['type'] === "text") : ?> - + - type="text" name="" value="" pattern=""> + type="text" name="" value="" > - type="number" name="" value="" min="" > + type="number" name="" value="" min="" > - + - - + - name="" > $choice_name): ?> @@ -51,7 +51,7 @@ if ($input['type'] === "select") : ?> - name="" multiple class="nested-select" > $choice_name) : ?>