From d28f3aff4a6cf4e55e070015106948b720076bef Mon Sep 17 00:00:00 2001
From: Moritz Strohm <strohm@data-quest.de>
Date: Tue, 28 May 2024 14:41:49 +0000
Subject: [PATCH] added aria-label text for icons on the profile page, fixes
 #4046

Closes #4046

Merge request studip/studip!3047
---
 app/views/calendar/contentbox/_termin.php         |  6 +++---
 app/views/calendar/contentbox/display.php         |  4 ++--
 app/views/news/_actions.php                       |  9 ++++++---
 app/views/news/display.php                        | 11 +++++++----
 app/views/questionnaire/_widget_questionnaire.php |  5 +++--
 app/views/questionnaire/widget.php                |  9 ++++++---
 6 files changed, 27 insertions(+), 17 deletions(-)

diff --git a/app/views/calendar/contentbox/_termin.php b/app/views/calendar/contentbox/_termin.php
index ded7d0bc228..3daf6992775 100644
--- a/app/views/calendar/contentbox/_termin.php
+++ b/app/views/calendar/contentbox/_termin.php
@@ -13,19 +13,19 @@
             </span>
             <? if ($admin && $isProfile && $termin->getObjectClass() === 'CalendarDateAssignment') : ?>
                 <a href="<?= URLHelper::getLink('dispatch.php/calendar/calendar') ?>"
-                   title="<?= _('Zum Kalender') ?>">
+                   title="<?= _('Zum Kalender') ?>" aria-label="<?= _('Zum Kalender') ?>">
                     <?= Icon::create('schedule')->asImg(['class' => 'text-bottom']) ?>
                 </a>
                 <? if ($termin->calendar_date->isWritable($GLOBALS['user']->id)) : ?>
                     <a href="<?= URLHelper::getLink('dispatch.php/calendar/date/edit/' . $termin->getPrimaryObjectId()) ?>"
-                       title="<?= _('Termin bearbeiten') ?>"
+                       title="<?= _('Termin bearbeiten') ?>" aria-label="<?= _('Termin bearbeiten') ?>"
                        data-dialog>
                         <?= Icon::create('edit')->asImg(['class' => 'text-bottom']) ?>
                     </a>
                 <? endif ?>
             <? elseif (!$course_range && in_array($termin->getObjectClass(), ['CourseDate', 'CourseExDate'])) : ?>
                 <a href="<?= URLHelper::getLink('dispatch.php/course/dates', ['cid' => $termin->getPrimaryObjectId()]) ?>"
-                   title="<?= _('Zur Veranstaltung') ?>">
+                   title="<?= _('Zur Veranstaltung') ?>" aria-label="<?= _('Zur Veranstaltung') ?>">
                     <?= Icon::create('seminar')->asImg(['class'=> 'text-bottom']) ?>
                 </a>
             <? endif ?>
diff --git a/app/views/calendar/contentbox/display.php b/app/views/calendar/contentbox/display.php
index c0387fd9819..bd7b266173a 100644
--- a/app/views/calendar/contentbox/display.php
+++ b/app/views/calendar/contentbox/display.php
@@ -10,12 +10,12 @@
                     <? if ($isProfile) : ?>
                         <a href="<?= URLHelper::getLink('dispatch.php/calendar/date/add') ?>"
                            data-dialog="reload-on-close"
-                           title="<?= _('Neuen Termin anlegen') ?>">
+                           title="<?= _('Neuen Termin anlegen') ?>" aria-label="<?= _('Neuen Termin anlegen') ?>">
                             <?= Icon::create('add', 'clickable')->asImg(['class' => 'text-bottom']) ?>
                         </a>
                     <? else: ?>
                         <a href="<?= URLHelper::getLink("dispatch.php/course/timesrooms", ['cid' => $range_id]) ?>"
-                           title="<?= _('Neuen Termin anlegen') ?>">
+                           title="<?= _('Neuen Termin anlegen') ?>" aria-label="<?= _('Neuen Termin anlegen') ?>">
                             <?= Icon::create('admin', 'clickable')->asImg(['class' => 'text-bottom']) ?>
                         </a>
                     <? endif ?>
diff --git a/app/views/news/_actions.php b/app/views/news/_actions.php
index 343cd102857..d67de26a80b 100644
--- a/app/views/news/_actions.php
+++ b/app/views/news/_actions.php
@@ -37,16 +37,19 @@ if ($new['allow_comments']) :
 
 
 <? if ($new->havePermission('edit')): ?>
-    <a href="<?= URLHelper::getLink('dispatch.php/news/edit_news/' . $new->id) ?>" data-dialog>
+    <a href="<?= URLHelper::getLink('dispatch.php/news/edit_news/' . $new->id) ?>" data-dialog
+       title="<?= _('Bearbeiten') ?>" aria-label="<?= _('Bearbeiten') ?>">
         <?= Icon::create('edit') ?>
     </a>
     <? if ($new->havePermission('unassign', $range)): ?>
-        <a href=" <?= URLHelper::getLink('', ['remove_news' => $new->id, 'news_range' => $range]) ?>" >
+        <a href=" <?= URLHelper::getLink('', ['remove_news' => $new->id, 'news_range' => $range]) ?>"
+           title="<?= _('Nicht mehr abonnieren') ?>" aria-label="<?= _('Nicht mehr abonnieren') ?>">
             <?= Icon::create('remove') ?>
         </a>
     <? endif; ?>
     <? if ($new->havePermission('delete')): ?>
-        <a href=" <?= URLHelper::getLink('', ['delete_news' => $new->id]) ?>" >
+        <a href=" <?= URLHelper::getLink('', ['delete_news' => $new->id]) ?>"
+           title="<?= _('Löschen') ?>" aria-label="<?= _('Löschen') ?>">
             <?= Icon::create('trash') ?>
         </a>
     <? endif; ?>
diff --git a/app/views/news/display.php b/app/views/news/display.php
index 7d9e2d0334e..5f62443f434 100644
--- a/app/views/news/display.php
+++ b/app/views/news/display.php
@@ -9,18 +9,21 @@
         <nav>
         <? if ($perm): ?>
             <a href="<?= $controller->link_for('news/edit_news/new/' . $range); ?>" data-dialog
-               title="<?= _('Hinzufügen') ?>">
+               title="<?= _('Hinzufügen') ?>" aria-label="<?= _('Hinzufügen') ?>">
                 <?= Icon::create('add') ?>
             </a>
         <? endif; ?>
         <? if ($perm && Config::get()->NEWS_RSS_EXPORT_ENABLE): ?>
-            <a data-dialog="size=auto;reload-on-close" title="<?=_('RSS-Feed konfigurieren') ?>" href="<?= $controller->link_for('news/rss_config/' . $range); ?>">
+            <a data-dialog="size=auto;reload-on-close" title="<?=_('RSS-Feed konfigurieren') ?>"
+               aria-label="<?=_('RSS-Feed konfigurieren') ?>"
+               href="<?= $controller->link_for('news/rss_config/' . $range); ?>">
                 <?= Icon::create('admin') ?>
             </a>
         <? endif; ?>
         <? if ($rss_id): ?>
-            <a href="<?= URLHelper::getLink('rss.php', ['id' => $rss_id]) ?>">
-                <?= Icon::create('rss')->asImg(['title' => _('RSS-Feed')]) ?>
+            <a href="<?= URLHelper::getLink('rss.php', ['id' => $rss_id]) ?>"
+               title="<?= _('RSS-Feed') ?>" aria-label="<?= _('RSS-Feed') ?>">
+                <?= Icon::create('rss') ?>
             </a>
         <? endif; ?>
         </nav>
diff --git a/app/views/questionnaire/_widget_questionnaire.php b/app/views/questionnaire/_widget_questionnaire.php
index 22ecf7252cf..4f625c214b3 100644
--- a/app/views/questionnaire/_widget_questionnaire.php
+++ b/app/views/questionnaire/_widget_questionnaire.php
@@ -30,7 +30,7 @@
             <span title="<?= _("Anzahl der Antworten") ?>">
                 <?= $questionnaire->countAnswers() ?>
             </span>
-            <span title="<?= _("QR-Code zu diesem Fragebogen anzeigen") ?>">
+            <span>
                 <? $oldbase = URLHelper::setBaseURL($GLOBALS['ABSOLUTE_URI_STUDIP']) ?>
                 <a href="<?=
                          URLHelper::getLink(
@@ -38,7 +38,8 @@
                              compact('range_type', 'range_id')
                          ) ?>"
                    class="questionnaire-qr"
-                    data-qr-code>
+                   title="<?= _("QR-Code zu diesem Fragebogen anzeigen") ?>" aria-label="<?= _("QR-Code zu diesem Fragebogen anzeigen") ?>"
+                   data-qr-code>
                     <? URLHelper::setBaseURL($oldbase) ?>
                     <?= Icon::create("code-qr", "clickable")->asImg(20, ['class' => "text-bottom"]) ?>
                 </a>
diff --git a/app/views/questionnaire/widget.php b/app/views/questionnaire/widget.php
index 9804b24646b..6d7f4b3effe 100644
--- a/app/views/questionnaire/widget.php
+++ b/app/views/questionnaire/widget.php
@@ -8,15 +8,18 @@
         <nav>
             <? if ($allowed_to_add) : ?>
                 <? if ($statusgruppen_ids): ?>
-                    <a href="<?= $controller->link_for('questionnaire/add_to_context') ?>" data-dialog="size=auto" title="<?= _('Fragebogen hinzufügen') ?>">
+                    <a href="<?= $controller->link_for('questionnaire/add_to_context') ?>" data-dialog="size=auto"
+                       title="<?= _('Fragebogen hinzufügen') ?>" aria-label="<?= _('Fragebogen hinzufügen') ?>">
                         <?= Icon::create("add", "clickable")->asimg("16px", ['class' => "text-bottom"]) ?>
                     </a>
                 <? else: ?>
-                    <a href="<?= $controller->link_for('questionnaire/edit', compact('range_type', 'range_id')) ?>" data-dialog title="<?= _('Fragebogen hinzufügen') ?>">
+                    <a href="<?= $controller->link_for('questionnaire/edit', compact('range_type', 'range_id')) ?>" data-dialog
+                       title="<?= _('Fragebogen hinzufügen') ?>" aria-label="<?= _('Fragebogen hinzufügen') ?>">
                         <?= Icon::create("add", "clickable")->asimg("16px", ['class' => "text-bottom"]) ?>
                     </a>
                 <? endif ?>
-                <a href="<?= URLHelper::getLink("dispatch.php/questionnaire/" . ($range_type == 'course' || $range_type == 'institute' ? 'course' : ''). "overview") ?>" title="<?= _('Fragebögen verwalten') ?>">
+                <a href="<?= URLHelper::getLink("dispatch.php/questionnaire/" . ($range_type == 'course' || $range_type == 'institute' ? 'course' : ''). "overview") ?>"
+                   title="<?= _('Fragebögen verwalten') ?>" aria-label="<?= _('Fragebögen verwalten') ?>">
                     <?= Icon::create("admin", "clickable")->asimg("16px", ['class' => "text-bottom"]) ?>
                 </a>
             <? endif ?>
-- 
GitLab