Skip to content
Snippets Groups Projects
Commit 71c73dbc authored by Peter Thienel's avatar Peter Thienel
Browse files

Resolve "MVV: Bearbeitungskontext geht nach Bearbeitung einer Fachsemsterzuordnung verloren"

Closes #5203

Merge request !3890
parent 95f49715
Branches
No related tags found
2 merge requests!4241Draft: Resolve "Im fromSORM fehlt Eingabename des `templates/forms/wysiwyg_input.php`",!3890Resolve "MVV: Bearbeitungskontext geht nach Bearbeitung einer Fachsemsterzuordnung verloren"
Pipeline #31074 passed
......@@ -355,7 +355,6 @@ abstract class SharedVersionController extends MVVController
public function abschnitte_action($version_id)
{
$this->abschnitt_id = null;
$this->abschnitte($version_id);
if (Request::isXhr()) {
$this->render_template('studiengaenge/versionen/abschnitte');
......@@ -674,7 +673,10 @@ abstract class SharedVersionController extends MVVController
public function details_abschnitt_action($abschnitt_id, $modul_id = null)
{
$this->modul_id = $modul_id;
if ($modul_id) {
$this->modul = Modul::find($modul_id);
$this->modul_id = $this->modul->id;
}
$this->abschnitt = StgteilAbschnitt::find($abschnitt_id);
if (!$this->abschnitt) {
PageLayout::postError(_('Unbekannter Abschnitt'));
......@@ -720,10 +722,8 @@ abstract class SharedVersionController extends MVVController
if (Request::isXhr()) {
$this->render_template('studiengaenge/versionen/details_abschnitt');
} else {
if ($modul_id) {
$this->modul = Modul::find($modul_id);
if ($this->modul_id) {
$this->abschnitt_id = $this->abschnitt->id;
$this->modul_id = $this->modul->id;
$this->stgteil_id = $this->version->studiengangteil->id;
}
$this->abschnitte_action($this->version_id);
......
......@@ -35,11 +35,9 @@ class Studiengaenge_StudiengangteileController extends SharedVersionController
$search_result = $this->getSearchResult('StudiengangTeil');
$this->sortby = $this->sortby ?: 'fach_name,zusatz,kp';
$this->order = $this->order ?: 'ASC';
$this->stgteil_id = null;
//get data
if (count($search_result)) {
$filter['stgteil_id'] = $search_result;
$this->stgteil_id = $search_result;
$this->stgteile = StudiengangTeil::getAllEnriched(
$this->sortby, $this->order,
$filter, self::$items_per_page,
......
......@@ -26,12 +26,12 @@
</thead>
<? if ($count) : ?>
<? foreach ($stgteile as $stgteil): ?>
<tbody class="<?php if (!$stgteil->count_versionen) echo 'empty' ?> <?= $stgteil_id === $stgteil->getId() ? 'not-collapsed' : 'collapsed' ?>">
<tbody class="<?php if (!$stgteil->count_versionen) echo 'empty' ?> <?= $stgteil_id === $stgteil->id ? 'not-collapsed' : 'collapsed' ?>">
<tr class="header-row">
<td class="toggle-indicator">
<? if ($stgteil->count_versionen) : ?>
<a class="mvv-load-in-new-row"
href="<?= $controller->action_link('details/' . $stgteil->getId()) ?>">
href="<?= $controller->action_link('details/' . $stgteil->id) ?>">
<?= htmlReady($stgteil->fach_name) ?>
<? if ($stgteil->count_contacts) : ?>
<?= Icon::create('community', Icon::ROLE_INFO, ['title' => sprintf(ngettext('%s Kontakt zugeordnet', '%s Kontakte zugeordnet', $stgteil->count_contacts), $stgteil->count_contacts)]) ?>
......@@ -51,21 +51,21 @@
<? $actionMenu = ActionMenu::get()->setContext($stgteil->fach_name) ?>
<? if (MvvPerm::havePermCreate('StgteilVersion')) : ?>
<? $actionMenu->addLink(
$controller->action_url('version/' . $stgteil->getId()),
$controller->action_url('version/' . $stgteil->id),
_('Neue Version anlegen'),
Icon::create('file', Icon::ROLE_CLICKABLE, ['title' => _('Neue Version anlegen')])
) ?>
<? endif; ?>
<? if (MvvPerm::havePermWrite($stgteil)) : ?>
<? $actionMenu->addLink(
$controller->action_url('stgteil/' . $stgteil->getId()),
$controller->action_url('stgteil/' . $stgteil->id),
_('Studiengangteil bearbeiten'),
Icon::create('edit', Icon::ROLE_CLICKABLE, ['title' => _('Studiengangteil bearbeiten')])
) ?>
<? endif; ?>
<? if (MvvPerm::havePermCreate('StudiengangTeil')) : ?>
<? $actionMenu->addLink(
$controller->action_url('copy/' . $stgteil->getId()),
$controller->action_url('copy/' . $stgteil->id),
_('Studiengangteil kopieren'),
Icon::create('files', Icon::ROLE_CLICKABLE, ['title' => _('Studiengangteil kopieren')])
) ?>
......@@ -76,7 +76,7 @@
_('Studiengangteil löschen'),
Icon::create('trash', Icon::ROLE_CLICKABLE, [
'title' => _('Studiengangteil löschen'),
'formaction' => $controller->action_url('delete/' . $stgteil->getId()),
'formaction' => $controller->action_url('delete/' . $stgteil->id),
'data-confirm' => sprintf(_('Wollen Sie wirklich den Studiengangteil "%s" löschen?'), $stgteil->getDisplayName()),
])
) ?>
......@@ -84,8 +84,8 @@
<?= $actionMenu->render() ?>
</td>
</tr>
<? if (!empty($stgteil_id) && ($stgteil_id == $stgteil->getId())) : ?>
<? $versionen = StgteilVersion::findByStgteil($stgteil->getId()); ?>
<? if (!empty($stgteil_id) && ($stgteil_id == $stgteil->id)) : ?>
<? $versionen = StgteilVersion::findByStgteil($stgteil->id); ?>
<tr class="loaded-details nohover">
<?= $this->render_partial('studiengaenge/studiengangteile/details', compact('stgteil_id', 'versionen')) ?>
</tr>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment