aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFinn Schneider <schneider@data-quest.de>2026-02-23 12:25:43 +0100
committerFinn Schneider <schneider@data-quest.de>2026-03-13 17:25:01 +0000
commite8d9c90a35e7b3c304f444f4277677f3ad267912 (patch)
treef714996c9d56b391026c79bd1a6a7def8c1635be
parente690aab5c6e10a54235555dfaeba053bba519435 (diff)
preedit not if all sem profiles
-rw-r--r--app/controllers/evaluation/profiles.php1
-rw-r--r--app/views/evaluation/profiles/preedit.php29
2 files changed, 17 insertions, 13 deletions
diff --git a/app/controllers/evaluation/profiles.php b/app/controllers/evaluation/profiles.php
index 7c89c09..06e7555 100644
--- a/app/controllers/evaluation/profiles.php
+++ b/app/controllers/evaluation/profiles.php
@@ -14,6 +14,7 @@ class Evaluation_ProfilesController extends AuthenticatedController
public function preedit_action()
{
$this->semesters = $this->getAvailableSemesters(true);
+ $this->total_sem_count = Semester::countBySql();
$this->render_template('evaluation/profiles/preedit');
}
diff --git a/app/views/evaluation/profiles/preedit.php b/app/views/evaluation/profiles/preedit.php
index ac503ec..1972c38 100644
--- a/app/views/evaluation/profiles/preedit.php
+++ b/app/views/evaluation/profiles/preedit.php
@@ -4,10 +4,10 @@
*/
?>
-<form method="post">
- <?= CSRFProtection::tokenTag() ?>
- <h2><?= _('Neues Profil anlegen') ?></h2>
- <div>
+<?php if ($controller->total_sem_count > count($controller->semesters)) :?>
+ <form method="post">
+ <?= CSRFProtection::tokenTag() ?>
+ <h2><?= _('Neues Profil anlegen') ?></h2>
<div class="clickable">
<button
class="as-link"
@@ -19,22 +19,22 @@
<p><?= _('Neu anlegen') ?></p>
</button>
</div>
-</form>
+ </form>
-<?php if (count($controller->semesters)) : ?>
- <form method="post">
- <?= CSRFProtection::tokenTag() ?>
+ <?php if (count($controller->semesters)) : ?>
+ <form method="post">
+ <?= CSRFProtection::tokenTag() ?>
<h2><?= _('Profildaten übernehmen') ?></h2>
<label>
- <?= _('Aus Profil von Semester') ?></br>
+ <?= _('Aus Profil von Semester') ?><br/>
<select name="sem_select">
<?php foreach ($controller->semesters as $key => $semester) : ?>
<option value="<?= $key ?>"><?= htmlReady($semester) ?></option>
<?php endforeach ?>
</select>
</label>
- </br>
- </br>
+ <br/>
+ <br/>
<div class="clickable">
<button
class="as-link"
@@ -45,6 +45,9 @@
<p><?= _('Daten übernehmen') ?></p>
</button>
</div>
- </div>
- </form>
+ </form>
+ <?php endif ?>
+<?php else : ?>
+ <br/>
+ <p><?= _('Es ist kein Semester ohne Profil vorhanden.') ?></p>
<?php endif ?>