diff --git a/models/StudyCourseModel.php b/models/StudyCourseModel.php index 7fc08f7e16e375a64e28ceafa191ac1c261a6d6f..267766a6f708eb946b182d20c75552e4d2ae7c1c 100644 --- a/models/StudyCourseModel.php +++ b/models/StudyCourseModel.php @@ -54,7 +54,9 @@ class StudycourseModel $studycourses = DBManager::get()->query($query1)->fetchAll(PDO::FETCH_ASSOC); $users = DBManager::get()->query($query2)->fetchGrouped(PDO::FETCH_COLUMN); foreach ($studycourses as $index => $course) { - $studycourses[$index]['count_user'] = $users[$course['studiengang_id']]; + if (isset($users[$course['studiengang_id']])) { + $studycourses[$index]['count_user'] = $users[$course['studiengang_id']]; + } } } @@ -69,7 +71,7 @@ class StudycourseModel foreach ($studycourses as $index => $row) { // get one profession with all degrees - $statement->execute(array($row['studiengang_id,'])); + $statement->execute(array($row['studiengang_id'])); $studycourses[$index]['degree'] = $statement->fetchAll(PDO::FETCH_ASSOC); $statement->closeCursor(); } @@ -108,7 +110,9 @@ class StudycourseModel $users = DBManager::get()->query($query2)->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP); foreach ($studydegrees as $index => $degree) { - $studydegrees[$index]['count_user'] = $users[$degree['abschluss_id']][0]; + if (isset($users[$degree['abschluss_id']])) { + $studydegrees[$index]['count_user'] = $users[$degree['abschluss_id']][0]; + } } } diff --git a/plugin.manifest b/plugin.manifest index fb7f092a5a7936f8b714c8fc90c785447470cc85..8ef380c3e1d8870f1902a430b8da003c8da2659c 100644 --- a/plugin.manifest +++ b/plugin.manifest @@ -1,5 +1,5 @@ pluginname=MultiMess pluginclassname=MultiMess origin=elan-ev -version=2.5.3 +version=2.5.4 studipMinVersion=5.3 diff --git a/views/admin/_addressee_lookup.php b/views/admin/_addressee_lookup.php index c24948ebef91299612d012a9c200e56c356452f8..d89b90b3cb923af966c1cc5ed59c049503fbcd88 100644 --- a/views/admin/_addressee_lookup.php +++ b/views/admin/_addressee_lookup.php @@ -7,7 +7,7 @@ use Studip\Button, Studip\LinkButton; </label></br></br></br> <div style="clear:both" align="center"> <div style="float:left;width:45%;"> - <textarea id="cand_addressee" name="cand_addressee" rows="15" cols="40" wrap="virtual"><?=(is_array($addressee_list) ? join("\n", array_keys($addressee_list)): '')?></textarea> + <textarea id="cand_addressee" name="cand_addressee" rows="15" cols="40" wrap="virtual"><?= isset($cand_addressees) ? join("\n", array_keys($cand_addressees)): '' ?></textarea> </div> <div align="left"> <input type="checkbox" name="perms[]" value="admin"> Administratoren<br> @@ -30,4 +30,4 @@ use Studip\Button, Studip\LinkButton; <?= \Studip\Button::create(_('Suchen'), 'suchen') ?> <!-- </div> --> </div> -</form> \ No newline at end of file +</form> diff --git a/views/admin/compose.php b/views/admin/compose.php index accc1d94b3f9adcefa71530a9ca8aa7052511b11..a24360c3a5504b0f4595e40ffb27591019c002b6 100644 --- a/views/admin/compose.php +++ b/views/admin/compose.php @@ -73,7 +73,7 @@ $infobox = array('picture' => 'infobox/messages.jpg', 'content' => $infobox_cont </div> -<form action="<?= PluginEngine::getLink('multimess/admin/send/') ?>" method=post> +<form action="<?= PluginEngine::getLink('multimess/admin/send') ?>" method=post> <div id="compose-accordion"> <h3> <?= _("Empfänger") ?> @@ -89,7 +89,7 @@ $infobox = array('picture' => 'infobox/messages.jpg', 'content' => $infobox_cont </h3> <div class="admin-accordion-content"> <?//=Icon::create('edit', array('id'=> 'addressee_lookup'))?> - <? if (count($cand_addressees) > 0) : ?> + <? if (!empty($cand_addressees)) : ?> <?=$this->render_partial("admin/_addressees", array('cand_addressees' => $cand_addressees));?> <? endif; ?> </div> diff --git a/views/admin/index.php b/views/admin/index.php index fa67eada47304fd511b0bf721cdc15ff984bd9d2..0495804385c9dc172a9f4673d62fb33403173bde 100644 --- a/views/admin/index.php +++ b/views/admin/index.php @@ -48,7 +48,7 @@ echo PluginEngine::getLink('multimess/admin/addressee_lookup/') <div class="form-group adressees"> <label for="cand_addressee"><?php echo _('Empfänger:') ?></label> <textarea id="cand_addressee" name="cand_addressee"><?php - echo join(PHP_EOL, array_keys($addressee_list ?: array())) + echo join(PHP_EOL, array_keys($cand_addressees ?? array())) ?></textarea> </div> <div class="form-group groups">