diff options
| author | Moritz Strohm <strohm@data-quest.de> | 2024-03-14 17:08:26 +0000 |
|---|---|---|
| committer | Moritz Strohm <strohm@data-quest.de> | 2024-03-14 17:08:26 +0000 |
| commit | 0fb33e2e8ea3a40bd45f72dc16f65419e82a656c (patch) | |
| tree | bb3eff329cd9719c20030ab9d09427f755b9f898 /lib/models | |
| parent | f2f70529462f10f08d7a0ca57bfb50c80e645fa4 (diff) | |
replaced getFullname with getFullName, re #3499
Merge request studip/studip!2660
Diffstat (limited to 'lib/models')
| -rw-r--r-- | lib/models/AdmissionApplication.class.php | 4 | ||||
| -rw-r--r-- | lib/models/ConsultationBlock.php | 2 | ||||
| -rw-r--r-- | lib/models/Course.class.php | 2 | ||||
| -rw-r--r-- | lib/models/CourseDate.class.php | 8 | ||||
| -rw-r--r-- | lib/models/CourseExDate.class.php | 4 | ||||
| -rw-r--r-- | lib/models/CourseMember.class.php | 2 | ||||
| -rw-r--r-- | lib/models/Courseware/BlockTypes/BlockType.php | 2 | ||||
| -rw-r--r-- | lib/models/Courseware/StructuralElement.php | 2 | ||||
| -rw-r--r-- | lib/models/Deputy.php | 12 | ||||
| -rw-r--r-- | lib/models/Institute.class.php | 2 | ||||
| -rw-r--r-- | lib/models/InstituteMember.class.php | 2 | ||||
| -rw-r--r-- | lib/models/Message.class.php | 2 | ||||
| -rw-r--r-- | lib/models/NewsRange.class.php | 2 | ||||
| -rw-r--r-- | lib/models/OERMaterial.php | 2 | ||||
| -rw-r--r-- | lib/models/StatusgruppeUser.php | 4 | ||||
| -rw-r--r-- | lib/models/calendar/CalendarDateAssignment.class.php | 2 | ||||
| -rw-r--r-- | lib/models/resources/ResourceBooking.class.php | 6 | ||||
| -rw-r--r-- | lib/models/resources/ResourceProperty.class.php | 4 | ||||
| -rw-r--r-- | lib/models/resources/ResourceRequest.class.php | 20 |
19 files changed, 42 insertions, 42 deletions
diff --git a/lib/models/AdmissionApplication.class.php b/lib/models/AdmissionApplication.class.php index 2901455..d1f2cba 100644 --- a/lib/models/AdmissionApplication.class.php +++ b/lib/models/AdmissionApplication.class.php @@ -81,7 +81,7 @@ class AdmissionApplication extends SimpleORMap implements PrivacyObject public function getUserFullname($format = 'full') { - return User::build(array_merge(['motto' => ''], $this->toArray('vorname nachname username title_front title_rear')))->getFullname($format); + return User::build(array_merge(['motto' => ''], $this->toArray('vorname nachname username title_front title_rear')))->getFullName($format); } /** @@ -123,7 +123,7 @@ class AdmissionApplication extends SimpleORMap implements PrivacyObject foreach (AdmissionPriority::getPrioritiesByCourse($cs->getId(), $course_id) as $user_id => $p) { $user = User::find($user_id); $data = $user->toArray('user_id username vorname nachname email'); - $data['fullname'] = $user->getFullname('full_rev'); + $data['fullname'] = $user->getFullName('full_rev'); $data['position'] = $cs->hasAdmissionRule('LimitedAdmission') ? $p : '-'; $data['visible'] = 'unknown'; $data['status'] = 'claiming'; diff --git a/lib/models/ConsultationBlock.php b/lib/models/ConsultationBlock.php index a4d1579..e42daaf 100644 --- a/lib/models/ConsultationBlock.php +++ b/lib/models/ConsultationBlock.php @@ -76,7 +76,7 @@ class ConsultationBlock extends SimpleORMap implements PrivacyObject } if ($block->range instanceof Institute) { - return sprintf(_('Einrichtung: %s'), $block->range->getFullname()); + return sprintf(_('Einrichtung: %s'), $block->range->getFullName()); } throw new Exception('Not implemented yet'); diff --git a/lib/models/Course.class.php b/lib/models/Course.class.php index 75dad33..98f2fec 100644 --- a/lib/models/Course.class.php +++ b/lib/models/Course.class.php @@ -589,7 +589,7 @@ class Course extends SimpleORMap implements Range, PrivacyObject, StudipItem, Fe * @param string formatting template name * @return string Fullname */ - public function getFullname($format = 'default') + public function getFullName($format = 'default') { $template = [ 'name' => '%1$s', diff --git a/lib/models/CourseDate.class.php b/lib/models/CourseDate.class.php index 2a5b77e..21ef00e 100644 --- a/lib/models/CourseDate.class.php +++ b/lib/models/CourseDate.class.php @@ -262,7 +262,7 @@ class CourseDate extends SimpleORMap implements PrivacyObject, Event * 'verbose' are supported by now) * @return String containing the full name of this date. */ - public function getFullname($format = 'default') + public function getFullName($format = 'default') { if (!$this->date || !in_array($format, ['default', 'verbose', 'include-room'])) { return ''; @@ -388,11 +388,11 @@ class CourseDate extends SimpleORMap implements PrivacyObject, Event { if (!$this->metadate_id) { if ($type == 'after_create') { - StudipLog::log('SEM_ADD_SINGLEDATE', $this->range_id, $this->getFullname()); + StudipLog::log('SEM_ADD_SINGLEDATE', $this->range_id, $this->getFullName()); } if ($type == 'before_store' && !$this->isNew() && ($this->isFieldDirty('date') || $this->isFieldDirty('end_time'))) { $old_entry = self::build($this->content_db); - StudipLog::log('SINGLEDATE_CHANGE_TIME', $this->range_id, $this->getFullname(), $old_entry->getFullname() . ' -> ' . $this->getFullname()); + StudipLog::log('SINGLEDATE_CHANGE_TIME', $this->range_id, $this->getFullName(), $old_entry->getFullName() . ' -> ' . $this->getFullName()); } } } @@ -572,7 +572,7 @@ class CourseDate extends SimpleORMap implements PrivacyObject, Event { $descriptions = []; if (count($this->dozenten) > 0) { - $descriptions[_('Durchführende Lehrende')] = implode(', ', $this->dozenten->getFullname()); + $descriptions[_('Durchführende Lehrende')] = implode(', ', $this->dozenten->getFullName()); } if (count($this->statusgruppen) > 0) { $descriptions[_('Beteiligte Gruppen')] = implode(', ', $this->statusgruppen->getValue('name')); diff --git a/lib/models/CourseExDate.class.php b/lib/models/CourseExDate.class.php index ce50e31..2d3afea 100644 --- a/lib/models/CourseExDate.class.php +++ b/lib/models/CourseExDate.class.php @@ -129,7 +129,7 @@ class CourseExDate extends SimpleORMap implements PrivacyObject, Event * 'verbose' are supported by now) * @return String containing the full name of this date. */ - public function getFullname($format = 'default') + public function getFullName($format = 'default') { if (!$this->date || !in_array($format, ['default', 'verbose'])) { return ''; @@ -337,7 +337,7 @@ class CourseExDate extends SimpleORMap implements PrivacyObject, Event { $descriptions = []; if (count($this->dozenten) > 0) { - $descriptions[_('Durchführende Lehrende')] = implode(', ', $this->dozenten->getFullname()); + $descriptions[_('Durchführende Lehrende')] = implode(', ', $this->dozenten->getFullName()); } if (count($this->statusgruppen) > 0) { $descriptions[_('Beteiligte Gruppen')] = implode(', ', $this->statusgruppen->getValue('name')); diff --git a/lib/models/CourseMember.class.php b/lib/models/CourseMember.class.php index a8a900b..91256a9 100644 --- a/lib/models/CourseMember.class.php +++ b/lib/models/CourseMember.class.php @@ -146,7 +146,7 @@ class CourseMember extends SimpleORMap implements PrivacyObject return User::build(array_merge( ['motto' => ''], $this->toArray('vorname nachname username title_front title_rear') - ))->getFullname($format); + ))->getFullName($format); } public function cbRemoveNotifications() diff --git a/lib/models/Courseware/BlockTypes/BlockType.php b/lib/models/Courseware/BlockTypes/BlockType.php index de69161..b3d5abf 100644 --- a/lib/models/Courseware/BlockTypes/BlockType.php +++ b/lib/models/Courseware/BlockTypes/BlockType.php @@ -279,7 +279,7 @@ abstract class BlockType $feedbacks = []; foreach ($this->block['feedback'] as $item) { if ($item['user_id']) { - $item['user_name'] = \User::find($item['user_id'])->getFullname(); + $item['user_name'] = \User::find($item['user_id'])->getFullName(); $item['user_avatar'] = \Avatar::getAvatar($item['user_id'])->getImageTag(\Avatar::SMALL); } array_push($feedbacks, $item); diff --git a/lib/models/Courseware/StructuralElement.php b/lib/models/Courseware/StructuralElement.php index 35a0184..9b68ea2 100644 --- a/lib/models/Courseware/StructuralElement.php +++ b/lib/models/Courseware/StructuralElement.php @@ -1063,7 +1063,7 @@ SQL; $doc->setHeaderTitle(sprintf(_('Courseware aus %s'), $this->course->name)); } if ($this->user) { - $doc->setHeaderTitle(sprintf(_('Courseware von %s'), $this->user->getFullname())); + $doc->setHeaderTitle(sprintf(_('Courseware von %s'), $this->user->getFullName())); } if (!self::canVisit($user)) { diff --git a/lib/models/Deputy.php b/lib/models/Deputy.php index f433e22..e2917e7 100644 --- a/lib/models/Deputy.php +++ b/lib/models/Deputy.php @@ -70,25 +70,25 @@ class Deputy extends SimpleORMap /** * Gets the full deputy name (in fact just redirecting to User class) - * @see User::getFullname + * @see User::getFullName * @param string $format one of full,full_rev,no_title,no_title_rev,no_title_short,no_title_motto,full_rev_username * @return string The deputy's full name, like "John Doe" or "Doe, John" */ public function getDeputyFullname($format = 'full') { - return $this->deputy->getFullname($format); + return $this->deputy->getFullName($format); } /** * Gets the full boss name (in fact just redirecting to User class) - * @see User::getFullname + * @see User::getFullName * @param string $format one of full,full_rev,no_title,no_title_rev,no_title_short,no_title_motto,full_rev_username * @return string The bosses full name, like "John Doe" or "Doe, John" */ public function getBossFullname($format = 'full') { if ($this->boss) { - return $this->boss->getFullname($format); + return $this->boss->getFullName($format); } else { return null; } @@ -96,7 +96,7 @@ class Deputy extends SimpleORMap /** * Gets the full course name (in fact just redirecting to Course class) - * @see Course::getFullname + * @see Course::getFullName * @param string $format one of default, type-name, number-type-name, number-name, * number-name-semester, sem-duration-name * @return string The courses' full name, like "1234 Lecture: Databases" @@ -104,7 +104,7 @@ class Deputy extends SimpleORMap public function getCourseFullname($format = 'default') { if ($this->course) { - return $this->course->getFullname($format); + return $this->course->getFullName($format); } else { return null; } diff --git a/lib/models/Institute.class.php b/lib/models/Institute.class.php index ece1e13..47cf271 100644 --- a/lib/models/Institute.class.php +++ b/lib/models/Institute.class.php @@ -236,7 +236,7 @@ class Institute extends SimpleORMap implements Range * @param string formatting template name * @return string Fullname */ - public function getFullname($format = 'default'): string + public function getFullName($format = 'default'): string { $template['type-name'] = '%2$s: %1$s'; if ($format === 'default' || !isset($template[$format])) { diff --git a/lib/models/InstituteMember.class.php b/lib/models/InstituteMember.class.php index 3a513fe..ec1c026 100644 --- a/lib/models/InstituteMember.class.php +++ b/lib/models/InstituteMember.class.php @@ -159,7 +159,7 @@ class InstituteMember extends SimpleORMap implements PrivacyObject return User::build(array_merge( ['motto' => ''], $this->toArray('vorname nachname username title_front title_rear') - ))->getFullname($format); + ))->getFullName($format); } /** diff --git a/lib/models/Message.class.php b/lib/models/Message.class.php index e4f938b..46493d6 100644 --- a/lib/models/Message.class.php +++ b/lib/models/Message.class.php @@ -164,7 +164,7 @@ class Message extends SimpleORMap implements PrivacyObject unset($data['user_id']); $user = User::build($data); $ret = $user->toArray('username vorname nachname'); - $ret['fullname'] = $user->getFullname(); + $ret['fullname'] = $user->getFullName(); $ret['user_id'] = $user_id; return $ret; }) diff --git a/lib/models/NewsRange.class.php b/lib/models/NewsRange.class.php index d780b55..7785214 100644 --- a/lib/models/NewsRange.class.php +++ b/lib/models/NewsRange.class.php @@ -60,7 +60,7 @@ class NewsRange extends SimpleORMap return $this->course->name; break; case 'user': - return $this->user->getFullname(); + return $this->user->getFullName(); break; case 'inst': case 'fak': diff --git a/lib/models/OERMaterial.php b/lib/models/OERMaterial.php index a023ad1..9de4298 100644 --- a/lib/models/OERMaterial.php +++ b/lib/models/OERMaterial.php @@ -695,7 +695,7 @@ class OERMaterial extends SimpleORMap if ($this->users[0]) { $user_name = $this->users[0]['external_contact'] ? $this->users[0]['oeruser']['name'] - : User::find($this->users[0]['user_id'])->getFullname(); + : User::find($this->users[0]['user_id'])->getFullName(); } else { $user_name = _("unbekannt"); } diff --git a/lib/models/StatusgruppeUser.php b/lib/models/StatusgruppeUser.php index 7bd3133..a36dcdc 100644 --- a/lib/models/StatusgruppeUser.php +++ b/lib/models/StatusgruppeUser.php @@ -88,12 +88,12 @@ class StatusgruppeUser extends SimpleORMap implements PrivacyObject */ public function name($format = 'full_rev') { - return $this->user->getFullname($format); + return $this->user->getFullName($format); } public function getUserFullname($format = "full") { - return User::build(array_merge(['motto' => ''], $this->toArray('vorname nachname username title_front title_rear')))->getFullname($format); + return User::build(array_merge(['motto' => ''], $this->toArray('vorname nachname username title_front title_rear')))->getFullName($format); } /** diff --git a/lib/models/calendar/CalendarDateAssignment.class.php b/lib/models/calendar/CalendarDateAssignment.class.php index ba0f387..6caae9e 100644 --- a/lib/models/calendar/CalendarDateAssignment.class.php +++ b/lib/models/calendar/CalendarDateAssignment.class.php @@ -681,7 +681,7 @@ class CalendarDateAssignment extends SimpleORMap implements Event public function getRangeName() : string { if ($this->course instanceof Course) { - return $this->course->getFullname(); + return $this->course->getFullName(); } elseif ($this->user instanceof User) { return $this->user->getFullName(); } diff --git a/lib/models/resources/ResourceBooking.class.php b/lib/models/resources/ResourceBooking.class.php index 84fc9c7..f55b3b3 100644 --- a/lib/models/resources/ResourceBooking.class.php +++ b/lib/models/resources/ResourceBooking.class.php @@ -1464,13 +1464,13 @@ class ResourceBooking extends SimpleORMap implements PrivacyObject, Studip\Calen { $name = ''; if ($this->getAssignedUserType() === 'course') { - $name = $this->assigned_course_date->course->getFullname(); + $name = $this->assigned_course_date->course->getFullName(); $name .= ' (' . implode(',', $this->assigned_course_date->course->getMembersWithStatus('dozent', true)->limit(3)->getValue('nachname')) . ')'; } elseif ($this->getAssignedUserType() === 'user') { if (get_visibility_by_id($this->assigned_user->id) || ($this->assigned_user->id == $GLOBALS['user']->id) ) { - $name = $this->assigned_user->getFullname(); + $name = $this->assigned_user->getFullName(); if ($this->description) { $name .= " \n" . $this->description; } @@ -1482,7 +1482,7 @@ class ResourceBooking extends SimpleORMap implements PrivacyObject, Studip\Calen $current_user = User::findCurrent(); if (($resource instanceof Resource) && ($current_user instanceof User)) { if ($resource->userHasPermission($current_user, 'user')) { - $name = $this->assigned_user->getFullname(); + $name = $this->assigned_user->getFullName(); if ($this->description) { $name .= " \n" . $this->description; } diff --git a/lib/models/resources/ResourceProperty.class.php b/lib/models/resources/ResourceProperty.class.php index 8481644..4bbc4ec 100644 --- a/lib/models/resources/ResourceProperty.class.php +++ b/lib/models/resources/ResourceProperty.class.php @@ -48,7 +48,7 @@ class ResourceProperty extends SimpleORMap ]; $config['additional_fields']['name'] = ['definition', 'name']; - $config['additional_fields']['fullname'] = ['get' => 'getFullname']; + $config['additional_fields']['fullname'] = ['get' => 'getFullName']; $config['additional_fields']['display_name'] = ['definition', 'display_name']; $config['additional_fields']['type'] = ['definition', 'type']; $config['additional_fields']['info_label'] = ['definition', 'info_label']; @@ -114,7 +114,7 @@ class ResourceProperty extends SimpleORMap return $string; } - public function getFullname() + public function getFullName() { $name = (string)$this->definition->display_name ?: $this->definition->name; $category = trim(strstr($name, ':', true)); diff --git a/lib/models/resources/ResourceRequest.class.php b/lib/models/resources/ResourceRequest.class.php index 6200127..6b22b44 100644 --- a/lib/models/resources/ResourceRequest.class.php +++ b/lib/models/resources/ResourceRequest.class.php @@ -1446,14 +1446,14 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen continue; } if ($rra->appointment) { - $parts[] = $rra->appointment->getFullname('include-room'); + $parts[] = $rra->appointment->getFullName('include-room'); } } $strings[] = implode('; ', $parts); } elseif ($this->termin_id) { if ($this->date) { if ($with_past_intervals || $this->date->end_time >= $now) { - $strings[] = $this->date->getFullname('include-room'); + $strings[] = $this->date->getFullName('include-room'); } } } elseif ($this->metadate_id) { @@ -1461,7 +1461,7 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen $this->cycle->dates->filter(function($date) use($with_past_intervals, $now) { return $with_past_intervals || $date->end_time >= $now; })->map(function($date) use(&$strings) { - $strings[] = $date->getFullname('include-room'); + $strings[] = $date->getFullName('include-room'); }); } } elseif ($this->course_id) { @@ -1519,13 +1519,13 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen if ($short || !$date) { return _('Einzeltermin'); } else { - return sprintf(_('Einzeltermin (%s)'), $date->getFullname()); + return sprintf(_('Einzeltermin (%s)'), $date->getFullName()); } } elseif ($this->date) { if ($short) { return _('Einzeltermin'); } else { - return sprintf(_('Einzeltermin (%s)'), $this->date->getFullname()); + return sprintf(_('Einzeltermin (%s)'), $this->date->getFullName()); } } elseif ($this->cycle) { if ($short) { @@ -1820,7 +1820,7 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen public function getRangeName() { if ($this->getRangeType() === 'course') { - $name = $this->getRangeObject()->getFullname(); + $name = $this->getRangeObject()->getFullName(); $name .= ' (' . implode(',', $this->getRangeObject()->getMembersWithStatus('dozent', true)->limit(3)->getValue('nachname')) . ')'; } else { $range_object = $this->getRangeObject(); @@ -1837,9 +1837,9 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen //see the name of the requester. if ($this->resource_id && ($this->resource instanceof Resource) && $this->resource->userHasPermission($current_user, 'autor')) { - $name = $range_object->getFullname(); + $name = $range_object->getFullName(); } else if (ResourceManager::userHasGlobalPermission($current_user, 'autor')) { - $name = $range_object->getFullname(); + $name = $range_object->getFullName(); } else { return ''; } @@ -1848,7 +1848,7 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen } } } else { - $name = $range_object->getFullname(); + $name = $range_object->getFullName(); } if ($this->comment) { $name .= " \n" . $this->comment; @@ -2210,7 +2210,7 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen $range_object = $this->getRangeObject(); $mail_title = _('Raumanfrage wurde abgelehnt'); if($range_object instanceof Course) { - $mail_title .= ': ' . $range_object->getFullname(); + $mail_title .= ': ' . $range_object->getFullName(); } $mail_text = $template->render( [ |
