From 9f1ed41f141ebfb519d446be31feb11b539d3f96 Mon Sep 17 00:00:00 2001 From: David Siegfried Date: Thu, 30 Jun 2022 10:59:49 +0000 Subject: use correct case for classes, closes #1233 Closes #1233 Merge request studip/studip!747 --- app/controllers/calendar/single.php | 10 ++++++---- app/controllers/course/enrolment.php | 2 +- app/controllers/course/lvgselector.php | 6 +++--- app/controllers/course/studygroup.php | 4 ++-- app/controllers/ical.php | 3 ++- app/controllers/messages.php | 2 +- app/controllers/oer/mymaterial.php | 4 ++-- app/controllers/studiengaenge/informationen.php | 22 +++++++++++----------- app/routes/Events.php | 4 ++-- app/views/blubber/compose.php | 2 +- app/views/my_studygroups/_course.php | 2 +- .../studiengaenge/stgteil_bezeichnungen.php | 2 +- .../studiengaenge/studiengangteile.php | 6 +++--- db/migrations/1.155_tic_5170_clean_up.php | 2 +- .../1.156_tic_5204_add_datafield_type.php | 2 +- lib/calendar/CalendarWriterICalendar.class.php | 2 +- lib/classes/FilesSearch/Result.php | 4 ++-- lib/classes/ForumAbo.php | 1 - .../JsonApi/Routes/Events/UserEventsIcal.php | 4 ++-- .../JsonApi/Routes/Events/UserEventsIndex.php | 3 --- lib/classes/ModulesNotification.class.php | 2 +- lib/classes/SemBrowse.class.php | 4 ++-- lib/classes/StudygroupModel.php | 2 +- lib/classes/admission/CourseSet.class.php | 2 +- lib/classes/admission/RandomAlgorithm.class.php | 2 +- .../coursewizardsteps/LVGroupsWizardStep.php | 2 +- lib/cronjobs/check_admission.class.php | 2 +- lib/elearning/ELearningUtils.class.php | 4 ++-- lib/elearning/Ilias4ConnectedLink.class.php | 2 +- lib/functions.php | 2 +- lib/models/AdmissionApplication.class.php | 4 ++-- lib/models/Message.class.php | 2 +- lib/models/MvvCourse.php | 2 +- lib/models/User.class.php | 8 ++++---- lib/models/UserStudyCourse.class.php | 2 +- public/show_bereich.php | 2 +- .../ConsultationsBookingCreateBySlotIndexTest.php | 2 +- tests/jsonapi/ConsultationsBookingCreateTest.php | 4 ++-- 38 files changed, 68 insertions(+), 69 deletions(-) diff --git a/app/controllers/calendar/single.php b/app/controllers/calendar/single.php index 48c04da..e2ea4c7 100644 --- a/app/controllers/calendar/single.php +++ b/app/controllers/calendar/single.php @@ -197,7 +197,8 @@ class Calendar_SingleController extends Calendar_CalendarController $calendar = new SingleCalendar($this->range_id); $event = $calendar->getEvent($event_id); if (!$event->isNew()) { - $export = new CalendarExportFile(new CalendarWriterICalendar()); + $calender_writer = new CalendarWriterICalendar(); + $export = new CalendarExportFile($calender_writer); $export->exportFromObjects($event); $export->sendFile(); } @@ -210,7 +211,8 @@ class Calendar_SingleController extends Calendar_CalendarController $this->calendar = new SingleCalendar($this->range_id); if (Request::submitted('export')) { - $export = new CalendarExportFile(new CalendarWriterICalendar()); + $calender_writer = new CalendarWriterICalendar(); + $export = new CalendarExportFile($calender_writer); if (Request::get('event_type') == 'user') { $types = ['CalendarEvent']; } else if (Request::get('event_type') == 'course') { @@ -245,8 +247,8 @@ class Calendar_SingleController extends Calendar_CalendarController if ($this->calendar->havePermission(Calendar::PERMISSION_OWN)) { if (Request::submitted('import')) { CSRFProtection::verifySecurityToken(); - $import = new CalendarImportFile(new CalendarParserICalendar(), - $_FILES['importfile']); + $calender_parser = new CalendarParserICalendar(); + $import = new CalendarImportFile($calender_parser, $_FILES['importfile']); if (Request::get('import_as_private_imp')) { $import->changePublicToPrivate(); } diff --git a/app/controllers/course/enrolment.php b/app/controllers/course/enrolment.php index 8914522..16038ff 100644 --- a/app/controllers/course/enrolment.php +++ b/app/controllers/course/enrolment.php @@ -46,7 +46,7 @@ class Course_EnrolmentController extends AuthenticatedController (in_array($enrolment_info['cause'], words('root courseadmin member')) || ($enrolment_info['cause'] == 'free_access' && $GLOBALS['user']->id == 'nobody')) ) { - $redirect_url = UrlHelper::getUrl('seminar_main.php', ['auswahl' => $this->course_id]); + $redirect_url = URLHelper::getUrl('seminar_main.php', ['auswahl' => $this->course_id]); if (Request::isXhr()) { $this->response->add_header('X-Location', $redirect_url); $this->render_nothing(); diff --git a/app/controllers/course/lvgselector.php b/app/controllers/course/lvgselector.php index 9624c70..6fcb658 100644 --- a/app/controllers/course/lvgselector.php +++ b/app/controllers/course/lvgselector.php @@ -276,9 +276,9 @@ class Course_LvgselectorController extends AuthenticatedController if ($this->is_locked($course_id)) { throw new AccessDeniedException(); } - + $lv_group_ids = $selection->getLvgruppenIDs(); - + // check whether at least one lv-group or study area is required $study_areas_combined_enabled = CourseWizardStepRegistry::findOneBySQL(" `classname` = 'StudyAreasLVGroupsCombinedWizardStep' @@ -291,7 +291,7 @@ class Course_LvgselectorController extends AuthenticatedController } } // write the new lvgruppen to the db - LvGruppe::setLvgruppen($course_id, $lv_group_ids); + Lvgruppe::setLvgruppen($course_id, $lv_group_ids); PageLayout::postMessage(MessageBox::success(_('Die Zuordnung der LV-Gruppen wurde übernommen.'))); } diff --git a/app/controllers/course/studygroup.php b/app/controllers/course/studygroup.php index d2d3478..bdf43de 100644 --- a/app/controllers/course/studygroup.php +++ b/app/controllers/course/studygroup.php @@ -775,7 +775,7 @@ class Course_StudygroupController extends AuthenticatedController // save invite in database StudygroupModel::inviteMember($receiver, $id); // send invite message to user - $msg = new Messaging(); + $msg = new messaging(); $sem = new Seminar($id); $message = sprintf(_("%s möchte Sie auf die Studiengruppe %s aufmerksam machen. Klicken Sie auf den untenstehenden Link, um direkt zur Studiengruppe zu gelangen.\n\n %s"), get_fullname(), $sem->name, URLHelper::getlink("dispatch.php/course/studygroup/details/" . $id, ['cid' => null])); @@ -795,7 +795,7 @@ class Course_StudygroupController extends AuthenticatedController $addedUsers )); } else if ($count >= 1) { - pageLayout::postSuccess(sprintf( + PageLayout::postSuccess(sprintf( _('%s wurden in die Studiengruppe eingeladen.'), $addedUsers )); diff --git a/app/controllers/ical.php b/app/controllers/ical.php index 06afc4d..4ecdc13 100644 --- a/app/controllers/ical.php +++ b/app/controllers/ical.php @@ -52,7 +52,8 @@ class iCalController extends StudipController $GLOBALS['perm'] = new Seminar_Perm(); $extype = 'ALL_EVENTS'; - $export = new CalendarExport(new CalendarWriterICalendar()); + $calender_writer = new CalendarWriterICalendar(); + $export = new CalendarExport($calender_writer); $export->exportFromDatabase($user_id, strtotime('-4 week'), 2114377200, 'ALL_EVENTS'); if ($GLOBALS['_calendar_error']->getMaxStatus(ErrorHandler::ERROR_CRITICAL)) { diff --git a/app/controllers/messages.php b/app/controllers/messages.php index dc0de21..836c4bd 100644 --- a/app/controllers/messages.php +++ b/app/controllers/messages.php @@ -943,7 +943,7 @@ class MessagesController extends AuthenticatedController { public function delete_tag_action() { CSRFProtection::verifyUnsafeRequest(); - DbManager::get()->execute("DELETE FROM message_tags WHERE user_id=? AND tag LIKE ?", [$GLOBALS['user']->id, Request::get('tag')]); + DBManager::get()->execute("DELETE FROM message_tags WHERE user_id=? AND tag LIKE ?", [$GLOBALS['user']->id, Request::get('tag')]); PageLayout::postMessage(MessageBox::success(_('Schlagwort gelöscht!'))); $this->redirect('messages/overview'); } diff --git a/app/controllers/oer/mymaterial.php b/app/controllers/oer/mymaterial.php index 6f6f4c3..bcabeac 100755 --- a/app/controllers/oer/mymaterial.php +++ b/app/controllers/oer/mymaterial.php @@ -21,7 +21,7 @@ class Oer_MymaterialController extends AuthenticatedController public function edit_action(OERMaterial $material = null) { - Pagelayout::setTitle($material->isNew() ? _('Neues Material hochladen') : _('Material bearbeiten')); + PageLayout::setTitle($material->isNew() ? _('Neues Material hochladen') : _('Material bearbeiten')); if ($material->id && !$material->isMine() && !$GLOBALS['perm']->have_perm('root')) { throw new AccessDeniedException(); } @@ -198,7 +198,7 @@ class Oer_MymaterialController extends AuthenticatedController public function statistics_action(OERMaterial $material) { - Pagelayout::setTitle(sprintf( + PageLayout::setTitle(sprintf( _('Zugriffszahlen für %s'), $material->name )); diff --git a/app/controllers/studiengaenge/informationen.php b/app/controllers/studiengaenge/informationen.php index 0515f87..4bbdd01 100644 --- a/app/controllers/studiengaenge/informationen.php +++ b/app/controllers/studiengaenge/informationen.php @@ -1,7 +1,7 @@ - * @author + * @author * @license GPL2 or any later version * @since 4.6 */ @@ -11,7 +11,7 @@ class Studiengaenge_InformationenController extends MVVController public function before_filter(&$action, &$args) { parent::before_filter($action, $args); - + if (!($GLOBALS['perm']->have_perm('root') || RolePersistence::isAssignedRole( $GLOBALS['user']->id, 'MVVAdmin'))) { throw new AccessDeniedException(); @@ -21,7 +21,7 @@ class Studiengaenge_InformationenController extends MVVController Navigation::activateItem('mvv/studiengaenge/informationen'); } } - + public function index_action() { $this->createSidebar(); @@ -38,13 +38,13 @@ class Studiengaenge_InformationenController extends MVVController [':inst_ids' => $inst_ids]); } } - + public function degree_action () { $this->createSidebar('degrees'); $this->degree = Degree::findBySQL('abschluss_id IN (SELECT DISTINCT(abschluss_id) FROM user_studiengang) ORDER BY name'); } - + public function showdegree_action($studycourse_id, $nr = 0) { $this->studycourse = Fach::find($studycourse_id); @@ -55,7 +55,7 @@ class Studiengaenge_InformationenController extends MVVController ['studycourse_id' => $studycourse_id, 'abschluss_ids' => $this->studycourse->degrees->pluck('abschluss_id')]); } - + public function showstudycourse_action($degree_id, $nr = 0) { $this->nr = $nr; @@ -75,7 +75,7 @@ class Studiengaenge_InformationenController extends MVVController [':inst_ids' => $inst_ids]); } } - + public function messagehelper_action() { $fach_id = Request::get('fach_id'); @@ -96,7 +96,7 @@ class Studiengaenge_InformationenController extends MVVController [':abschluss_id' => $degree_id]); } if (empty($user)) { - Pagelayout::postError(_('Keine Studierenden zu den gewählten Angaben gefunden')); + PageLayout::postError(_('Keine Studierenden zu den gewählten Angaben gefunden')); $this->redirect('index'); return; } @@ -114,7 +114,7 @@ class Studiengaenge_InformationenController extends MVVController ['default_subject' => $subject, 'emailrequest' => 1] )); } - + private function createSidebar($view = 'subject' ) { $widget = new ViewsWidget(); @@ -124,7 +124,7 @@ class Studiengaenge_InformationenController extends MVVController ->setActive($view == 'degrees'); Sidebar::Get()->addWidget($widget); } - + public static function getStudyCount($degree_id) { if ($GLOBALS['perm']->have_perm('root', $GLOBALS['user']->id)) { @@ -142,5 +142,5 @@ class Studiengaenge_InformationenController extends MVVController } } - + } \ No newline at end of file diff --git a/app/routes/Events.php b/app/routes/Events.php index 7ad0f1b..38caa14 100644 --- a/app/routes/Events.php +++ b/app/routes/Events.php @@ -83,8 +83,8 @@ class Events extends \RESTAPI\RouteMap if ($user_id !== $GLOBALS['user']->id) { $this->error(401); } - - $export = new CalendarExport(new CalendarWriterICalendar()); + $calender_writer = new CalendarWriterICalendar(); + $export = new CalendarExport($calender_writer); $export->exportFromDatabase($user_id, 0, 2114377200, 'ALL_EVENTS'); if ($GLOBALS['_calendar_error']->getMaxStatus(\ErrorHandler::ERROR_CRITICAL)) { diff --git a/app/views/blubber/compose.php b/app/views/blubber/compose.php index e23487a..23b1c21 100644 --- a/app/views/blubber/compose.php +++ b/app/views/blubber/compose.php @@ -48,7 +48,7 @@