Skip to content
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<h2>
<?php
$ilsDetails = $driver->getExtraDetail('ils_details');
$id = $this->record($driver)->getUniqueHtmlElementId();
// If this is a non-missing Solr record, we should display a link:
if (is_a($driver, \VuFind\RecordDriver\SolrDefault::class) && !is_a($driver, \VuFind\RecordDriver\Missing::class)) {
$title = $driver->getTitle();
$title = empty($title) ? $this->transEsc('Title not available') : $this->escapeHtml($title);
echo '<a href="' . $this->escapeHtmlAttr($this->recordLinker()->getUrl($driver))
. '" class="title">' . $title . '</a>';
. '" class="title" id="' . $id . '">' . $title . '</a>';
} elseif (!empty($ilsDetails['title'])) {
// If the record is not available in Solr, perhaps the ILS driver sent us a title we can show...
echo '<span class="title">' . $this->escapeHtml($ilsDetails['title']) . '</span>';
echo '<span class="title" id="' . $id . '">' . $this->escapeHtml($ilsDetails['title']) . '</span>';
} else {
// Last resort -- indicate that no title could be found.
echo $this->transEsc('Title not available');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div class="media-body">
<div class="result-body">
<h2>
<a href="<?=$this->escapeHtmlAttr($recordLinker->getUrl($this->driver))?>" class="title getFull" data-view="<?=isset($this->params) ? $this->params->getOptions()->getListViewOption() : 'list' ?>">
<a href="<?=$this->escapeHtmlAttr($recordLinker->getUrl($this->driver))?>" class="title getFull" data-view="<?=isset($this->params) ? $this->params->getOptions()->getListViewOption() : 'list' ?>" id="<?=$this->record($this->driver)->getUniqueHtmlElementId()?>">
<?=$this->record($this->driver)->getTitleHtml()?>
</a>
<?php foreach ($this->driver->tryMethod('getTitlesAltScript', [], []) as $altTitle): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<div class="resultItemLine1">
<?php if ('Ti' == $item['Group']): ?>
<h2>
<a href="<?=$this->escapeHtmlAttr($recordLinker->getUrl($this->driver))?>" class="title getFull _record_link" data-view="<?=$this->escapeHtmlAttr($this->params->getOptions()->getListViewOption())?>">
<a href="<?=$this->escapeHtmlAttr($recordLinker->getUrl($this->driver))?>" class="title getFull _record_link" data-view="<?=$this->escapeHtmlAttr($this->params->getOptions()->getListViewOption())?>" id="<?=$this->record($this->driver)->getUniqueHtmlElementId()?>">
<?=$item['Data']?> </a>
</h2>
<?php elseif ('Au' == $item['Group'] && strtolower($edsConfig->AuthorDisplay->ResultListFormat ?? 'Short') == 'short'): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<div class="media-body">
<div class="result-body">
<div>
<a href="<?=$this->escapeHtmlAttr($recordLinker->getUrl($this->driver))?>" class="title getFull" data-view="<?=isset($this->params) ? $this->params->getOptions()->getListViewOption() : 'list' ?>">
<a href="<?=$this->escapeHtmlAttr($recordLinker->getUrl($this->driver))?>" class="title getFull" data-view="<?=isset($this->params) ? $this->params->getOptions()->getListViewOption() : 'list' ?>" id="<?=$this->record($this->driver)->getUniqueHtmlElementId()?>">
<?=$this->record($this->driver)->getTitleHtml()?>
</a>
<?php foreach ($this->driver->tryMethod('getTitlesAltScript', [], []) as $altTitle): ?>
Expand Down
2 changes: 1 addition & 1 deletion themes/bootstrap3/templates/myresearch/checkedout.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<?php if (isset($ilsDetails['renewable']) && $ilsDetails['renewable'] && isset($ilsDetails['renew_details'])): ?>
<?php $safeId = preg_replace('/[^a-zA-Z0-9]/', '', $ilsDetails['renew_details']); ?>
<label>
<input class="checkbox-select-item" type="checkbox" name="renewSelectedIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['renew_details'])?>" id="checkbox_<?=$safeId?>" aria-label="<?=$this->transEscAttr('select_item_checked_out_renew')?>">
<input class="checkbox-select-item" type="checkbox" name="renewSelectedIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['renew_details'])?>" id="checkbox_<?=$safeId?>" aria-label="<?=$this->escapeHtmlAttr($ilsDetails['title'])?>">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a clean way here to get the record driver, to pass to the Record view helper for getUniqueHtmlElementId. I could use $ilsDetails['item_id'] which in my testing is the same value, but I believe there are cases where that might not be. Alternately maybe I can use $safeId and generate the same value in account-entry.phtml, but I don't know if that adds any value.

If there is not a way to get getUniqueHtmlElementId here, then I should revert the changes to account-entry since they don't have any purpose.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And once we figure out this screen, I can apply the logic to the other account pages with checkboxes.
#3552 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this template, I believe that $resource is the record driver. Does that help?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks! Got this page working with aria-labelledby as well now. Not to presuppose the final decision, but at least the approach is consistent now in this PR for the pages that the Moravian report originally cited.

</label>
<input type="hidden" name="selectAllIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['renew_details'])?>">
<input type="hidden" name="renewAllIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['renew_details'])?>">
Expand Down
2 changes: 1 addition & 1 deletion themes/bootstrap3/templates/record/checkbox.phtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<label class="record-checkbox hidden-print">
<input class="checkbox-select-item" type="checkbox" name="ids[]" value="<?=$this->escapeHtmlAttr($this->id) ?>"<?php if (isset($this->formAttr)): ?> form="<?=$this->formAttr ?>"<?php endif; ?> aria-label="<?=$this->transEscAttr('select_item')?>">
<input class="checkbox-select-item" type="checkbox" name="ids[]" value="<?=$this->escapeHtmlAttr($this->id) ?>"<?php if (isset($this->formAttr)): ?> form="<?=$this->formAttr ?>"<?php endif; ?> aria-labelledby="<?=$this->checkboxElementId?>">
<span class="checkbox-icon"></span>
<?php if (strlen($this->number ?? '') > 0): ?><span class="sr-only"><?=$this->transEsc('result_checkbox_label', ['%%number%%' => $this->number]) ?></span><?php endif; ?>
</label>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<h2>
<?php
$ilsDetails = $driver->getExtraDetail('ils_details');
$id = $this->record($driver)->getUniqueHtmlElementId();
// If this is a non-missing Solr record, we should display a link:
if (is_a($driver, \VuFind\RecordDriver\SolrDefault::class) && !is_a($driver, \VuFind\RecordDriver\Missing::class)) {
$title = $driver->getTitle();
$title = empty($title) ? $this->transEsc('Title not available') : $this->escapeHtml($title);
echo '<a href="' . $this->escapeHtmlAttr($this->recordLinker()->getUrl($driver))
. '" class="title">' . $title . '</a>';
. '" class="title" id="' . $id . '">' . $title . '</a>';
} elseif (!empty($ilsDetails['title'])) {
// If the record is not available in Solr, perhaps the ILS driver sent us a title we can show...
echo '<span class="title">' . $this->escapeHtml($ilsDetails['title']) . '</span>';
echo '<span class="title" id="' . $id . '">' . $this->escapeHtml($ilsDetails['title']) . '</span>';
} else {
// Last resort -- indicate that no title could be found.
echo $this->transEsc('Title not available');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div class="media-body">
<div class="result-body">
<h2>
<a href="<?=$this->escapeHtmlAttr($recordLinker->getUrl($this->driver))?>" class="title getFull" data-view="<?=isset($this->params) ? $this->params->getOptions()->getListViewOption() : 'list' ?>">
<a href="<?=$this->escapeHtmlAttr($recordLinker->getUrl($this->driver))?>" class="title getFull" data-view="<?=isset($this->params) ? $this->params->getOptions()->getListViewOption() : 'list' ?>" id="<?=$this->record($this->driver)->getUniqueHtmlElementId()?>">
<?=$this->record($this->driver)->getTitleHtml()?>
</a>
<?php foreach ($this->driver->tryMethod('getTitlesAltScript', [], []) as $altTitle): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<div class="resultItemLine1">
<?php if ('Ti' == $item['Group']): ?>
<h2>
<a href="<?=$this->escapeHtmlAttr($recordLinker->getUrl($this->driver))?>" class="title getFull _record_link" data-view="<?=$this->escapeHtmlAttr($this->params->getOptions()->getListViewOption())?>">
<a href="<?=$this->escapeHtmlAttr($recordLinker->getUrl($this->driver))?>" class="title getFull _record_link" data-view="<?=$this->escapeHtmlAttr($this->params->getOptions()->getListViewOption())?>" id="<?=$this->record($this->driver)->getUniqueHtmlElementId()?>">
<?=$item['Data']?> </a>
</h2>
<?php elseif ('Au' == $item['Group'] && strtolower($edsConfig->AuthorDisplay->ResultListFormat ?? 'Short') == 'short'): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<div class="media-body">
<div class="result-body">
<div>
<a href="<?=$this->escapeHtmlAttr($recordLinker->getUrl($this->driver))?>" class="title getFull" data-view="<?=isset($this->params) ? $this->params->getOptions()->getListViewOption() : 'list' ?>">
<a href="<?=$this->escapeHtmlAttr($recordLinker->getUrl($this->driver))?>" class="title getFull" data-view="<?=isset($this->params) ? $this->params->getOptions()->getListViewOption() : 'list' ?>" id="<?=$this->record($this->driver)->getUniqueHtmlElementId()?>">
<?=$this->record($this->driver)->getTitleHtml()?>
</a>
<?php foreach ($this->driver->tryMethod('getTitlesAltScript', [], []) as $altTitle): ?>
Expand Down
2 changes: 1 addition & 1 deletion themes/bootstrap5/templates/myresearch/checkedout.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<?php if (isset($ilsDetails['renewable']) && $ilsDetails['renewable'] && isset($ilsDetails['renew_details'])): ?>
<?php $safeId = preg_replace('/[^a-zA-Z0-9]/', '', $ilsDetails['renew_details']); ?>
<label>
<input class="checkbox-select-item" type="checkbox" name="renewSelectedIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['renew_details'])?>" id="checkbox_<?=$safeId?>" aria-label="<?=$this->transEscAttr('select_item_checked_out_renew')?>">
<input class="checkbox-select-item" type="checkbox" name="renewSelectedIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['renew_details'])?>" id="checkbox_<?=$safeId?>" aria-label="<?=$this->escapeHtmlAttr($ilsDetails['title'])?>">
</label>
<input type="hidden" name="selectAllIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['renew_details'])?>">
<input type="hidden" name="renewAllIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['renew_details'])?>">
Expand Down
2 changes: 1 addition & 1 deletion themes/bootstrap5/templates/record/checkbox.phtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<label class="record-checkbox hidden-print">
<input class="checkbox-select-item" type="checkbox" name="ids[]" value="<?=$this->escapeHtmlAttr($this->id) ?>"<?php if (isset($this->formAttr)): ?> form="<?=$this->formAttr ?>"<?php endif; ?> aria-label="<?=$this->transEscAttr('select_item')?>">
<input class="checkbox-select-item" type="checkbox" name="ids[]" value="<?=$this->escapeHtmlAttr($this->id) ?>"<?php if (isset($this->formAttr)): ?> form="<?=$this->formAttr ?>"<?php endif; ?> aria-labelledby="<?=$this->checkboxElementId?>">
<span class="checkbox-icon"></span>
<?php if (strlen($this->number ?? '') > 0): ?><span class="sr-only"><?=$this->transEsc('result_checkbox_label', ['%%number%%' => $this->number]) ?></span><?php endif; ?>
</label>
Expand Down