Skip to content

Commit 2a07977

Browse files
authored
Merge pull request #1788 from catsoup11789/24.05.00
fix for LiDA browse cats
2 parents fdde646 + f2f2326 commit 2a07977

File tree

8 files changed

+55
-44
lines changed

8 files changed

+55
-44
lines changed

code/web/interface/themes/responsive/Search/Recommend/TopFacets.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
<div id="availabilityControl" class="btn-group" data-toggle="buttons-radio" style="display: flex;align-items: center;justify-content: center;">
4646
{foreach from=$cluster.list item=thisFacet name="narrowLoop"}
4747
{if !empty($thisFacet.isApplied)}
48-
<button type="button" id="{$thisFacet.value|escape|regex_replace:'/[()\s]/':''}" class="btn btn-primary btn-wrap" name="availabilityControls">{translate text=$thisFacet.display|escape isPublicFacing=true}{if $thisFacet.count > 0}{if $facetCountsToShow == 1 || ($facetCountsToShow == 2 && empty($thisFacet.countIsApproximate))} ({$thisFacet.count|number_format:0:".":","}){/if}{/if}</button>
48+
<button aria-pressed="true" type="button" id="{$thisFacet.value|escape|regex_replace:'/[()\s]/':''}" class="btn btn-primary btn-wrap" name="availabilityControls">{translate text=$thisFacet.display|escape isPublicFacing=true}{if $thisFacet.count > 0}{if $facetCountsToShow == 1 || ($facetCountsToShow == 2 && empty($thisFacet.countIsApproximate))} ({$thisFacet.count|number_format:0:".":","}){/if}{/if}</button>
4949
{else}
50-
<button type="button" id="{$thisFacet.value|escape|regex_replace:'/[()\s]/':''}" class="btn btn-default btn-wrap" name="availabilityControls" data-url="{$thisFacet.url|escape}" onclick="window.location = $(this).data('url')" >{translate text=$thisFacet.display|escape isPublicFacing=true}{if $thisFacet.count > 0}{if $facetCountsToShow == 1 || ($facetCountsToShow == 2 && empty($thisFacet.countIsApproximate))} ({$thisFacet.count|number_format:0:".":","}){/if}{/if}</button>
50+
<button aria-pressed="false" type="button" id="{$thisFacet.value|escape|regex_replace:'/[()\s]/':''}" class="btn btn-default btn-wrap" name="availabilityControls" data-url="{$thisFacet.url|escape}" onclick="window.location = $(this).data('url')" >{translate text=$thisFacet.display|escape isPublicFacing=true}{if $thisFacet.count > 0}{if $facetCountsToShow == 1 || ($facetCountsToShow == 2 && empty($thisFacet.countIsApproximate))} ({$thisFacet.count|number_format:0:".":","}){/if}{/if}</button>
5151
{/if}
5252
{/foreach}
5353
</div>
@@ -59,4 +59,4 @@
5959
{else}
6060
<br>
6161
{/if}
62-
{/strip}
62+
{/strip}

code/web/interface/themes/responsive/header-menu.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
{$link->htmlContents}
6262
{else}
6363
<div class="header-menu-option {if !empty($categoryName) && !preg_match('/none-\\d+/', $categoryName)}childMenuItem{/if}">
64-
<a href="{$link->url}" {if $link->openInNewTab}target="_blank"{/if} aria-label="{translate text=$linkName inAttribute=true isPublicFacing=true} ({translate text="opens in a new window" isPublicFacing=true inAttribute=true})">
64+
<a href="{$link->url}" {if $link->openInNewTab}target="_blank"{/if} aria-label="{translate text=$linkName inAttribute=true isPublicFacing=true} ({translate text="opens in a new window" isPublicFacing=true inAttribute=true})" title="{translate text=$linkName inAttribute=true isPublicFacing=true} ({translate text="opens in a new window" isPublicFacing=true inAttribute=true})">
6565
{if !empty($link->iconName)}
6666
<i class="fas fa-{$link->iconName} fa-fw" role="presentation"></i>
6767
{/if}
@@ -79,7 +79,7 @@
7979
{if $link->htmlContents}
8080
{$link->htmlContents}
8181
{else}
82-
<a href="{$link->url}" {if $link->openInNewTab}target="_blank"{/if} aria-label="{translate text=$linkName inAttribute=true isPublicFacing=true} ({translate text="opens in a new window" isPublicFacing=true inAttribute=true})">
82+
<a href="{$link->url}" {if $link->openInNewTab}target="_blank"{/if} aria-label="{translate text=$linkName inAttribute=true isPublicFacing=true} ({translate text="opens in a new window" isPublicFacing=true inAttribute=true})" title="{translate text=$linkName inAttribute=true isPublicFacing=true} ({translate text="opens in a new window" isPublicFacing=true inAttribute=true})">
8383
<div class="header-menu-option {if $link->showInTopMenu || $link->alwaysShowIconInTopMenu}hidden-lg{/if}">
8484
{if !empty($link->iconName)}
8585
<i class="fas fa-{$link->iconName} fa-fw" role="presentation"></i>

code/web/interface/themes/responsive/horizontal-menu-bar.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
{* Only render HTML contents in the header menu *}
3030
{if empty($link->htmlContents)}
3131
<div class="header-menu-option childMenuItem">
32-
<a href="{$link->url}" {if $link->openInNewTab}target="_blank"{/if} aria-label="{translate text=$linkName isPublicFacing=true inAttribute=true} ({translate text="opens in a new window" isPublicFacing=true inAttribute=true})">
32+
<a href="{$link->url}" {if $link->openInNewTab}target="_blank"{/if} aria-label="{translate text=$linkName isPublicFacing=true inAttribute=true} ({translate text="opens in a new window" isPublicFacing=true inAttribute=true})" title="{translate text=$linkName isPublicFacing=true inAttribute=true} ({translate text="opens in a new window" isPublicFacing=true inAttribute=true})">
3333
{if $link->published == 0}<em>{/if}
3434
{translate text=$linkName isPublicFacing=true}
3535
{if $link->published == 0}</em>{/if}
@@ -54,7 +54,7 @@
5454
</script>
5555
{/literal}
5656
{else}
57-
<a href="{$topCategory->url}" role="link" class="menu-icon menu-bar-option {if !$topCategory->alwaysShowIconInTopMenu}visible-inline-block-lg{/if}" aria-label="{translate text=$categoryName inAttribute=true isPublicFacing=true} ({translate text="opens in a new window" isPublicFacing=true inAttribute=true})" {if $topCategory->openInNewTab}target="_blank"{/if} tabindex="0">
57+
<a href="{$topCategory->url}" role="link" class="menu-icon menu-bar-option {if !$topCategory->alwaysShowIconInTopMenu}visible-inline-block-lg{/if}" aria-label="{translate text=$categoryName inAttribute=true isPublicFacing=true} ({translate text="opens in a new window" isPublicFacing=true inAttribute=true})" title="{translate text=$categoryName inAttribute=true isPublicFacing=true} ({translate text="opens in a new window" isPublicFacing=true inAttribute=true})" {if $topCategory->openInNewTab}target="_blank"{/if} tabindex="0">
5858
{if !empty($topCategory->iconName)}
5959
<i class="fas fa-{$topCategory->iconName} fa-lg" role="presentation"></i>
6060
{/if}

code/web/release_notes/24.05.00.MD

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@
9494
- Added aria-expanded attributes to filter headings in the search sidebar for better accessibility. (*KK*)
9595
- The "Go to Top" button will no longer display on tablets and phone devices due to the size causing issues for using Aspen Discovery. (*KK*)
9696
- Added the aria-expanded attribute to the "What's this?" link on My Preferences page for better accessibility. (*KK*)
97+
- Update several modal buttons to button elements from span elements. (*KK*)
98+
- For availability control toggles, added aria-pressed attribute to indicate if the button is pressed. (*KK*)
99+
- Added title attributes to custom menu links in the navigation bar. (*KK*)
97100

98101
### Other Updates
99102
- Web Builder page cells will now again save the custom color scheme. (Tickets 129813, 130819) (*KK*)
@@ -131,4 +134,4 @@
131134
- PTFS-Europe
132135
- Jacob O'Mara (JOM)
133136
- Theke Solutions
134-
- Lucas Montoya (LM)
137+
- Lucas Montoya (LM)

code/web/services/API/SearchAPI.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,11 +1931,7 @@ function getAppActiveBrowseCategories() {
19311931
//based off of url, branch parameter, or IP address
19321932
$activeLocation = $locationSingleton->getActiveLocation();
19331933

1934-
[
1935-
$username,
1936-
$password,
1937-
] = $this->loadUsernameAndPassword();
1938-
$appUser = UserAccount::validateAccount($username, $password);
1934+
$appUser = $this->getUserForApiCall();
19391935

19401936
//Get a list of browse categories for that library / location
19411937
/** @var BrowseCategoryGroupEntry[] $browseCategories */

code/web/services/MyAccount/AJAX.php

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,10 @@ function removeManagingAccount(): array {
219219
'text' => 'Successfully removed linked account. Removing this link does not guarantee the security of your account. If another user has your barcode and PIN/password they will still be able to access your account. Would you like to change your password?',
220220
'isPublicFacing' => true,
221221
]),
222-
'modalButtons' => "<span class='tool btn btn-primary' onclick='AspenDiscovery.Account.redirectPinReset(); return false;'>" . translate([
222+
'modalButtons' => "<button type='button' class='tool btn btn-primary' onclick='AspenDiscovery.Account.redirectPinReset(); return false;'>" . translate([
223223
'text' => "Request PIN Change",
224224
'isPublicFacing' => true,
225-
]) . "</span>",
225+
]) . "</button>",
226226
];
227227
} else {
228228
$result = [
@@ -324,10 +324,10 @@ function disableAccountLinkingInfo(): array {
324324
'text' => 'Re-enabling account linking will allow others to link to your account. Do you want to continue?',
325325
'isPublicFacing' => true,
326326
]),
327-
'modalButtons' => "<span class='tool btn btn-primary' onclick='AspenDiscovery.Account.toggleAccountLinkingAccept(); return false;'>" . translate([
327+
'modalButtons' => "<button type='button' class='tool btn btn-primary' onclick='AspenDiscovery.Account.toggleAccountLinkingAccept(); return false;'>" . translate([
328328
'text' => "Accept",
329329
'isPublicFacing' => true,
330-
]) . "</span>",
330+
]) . "</button>",
331331
];
332332
} else {
333333
return [
@@ -339,10 +339,10 @@ function disableAccountLinkingInfo(): array {
339339
'text' => 'Disabling account linking will sever any current links and prevent any new ones. Do you want to continue?',
340340
'isPublicFacing' => true,
341341
]),
342-
'modalButtons' => "<span class='tool btn btn-primary' onclick='AspenDiscovery.Account.toggleAccountLinkingAccept(); return false;'>" . translate([
342+
'modalButtons' => "<button type='button' class='tool btn btn-primary' onclick='AspenDiscovery.Account.toggleAccountLinkingAccept(); return false;'>" . translate([
343343
'text' => "Accept",
344344
'isPublicFacing' => true,
345-
]) . "</span>",
345+
]) . "</button>",
346346
];
347347
}
348348
}
@@ -390,10 +390,10 @@ function toggleAccountLinking() {
390390
'text' => 'Account linking has been disabled. Disabling account linking does not guarantee the security of your account. If another user has your barcode and PIN/password they will still be able to access your account. Would you like to change your password?',
391391
'isPublicFacing' => true,
392392
]),
393-
'modalButtons' => "<span class='tool btn btn-primary' onclick='AspenDiscovery.Account.redirectPinReset(); return false;'>" . translate([
393+
'modalButtons' => "<button type='button' class='tool btn btn-primary' onclick='AspenDiscovery.Account.redirectPinReset(); return false;'>" . translate([
394394
'text' => "Request PIN Change",
395395
'isPublicFacing' => true,
396-
]) . "</span>",
396+
]) . "</button>",
397397
];
398398
} else {
399399
$result = [
@@ -451,10 +451,10 @@ function getAddAccountLinkForm() {
451451
'isPublicFacing' => true,
452452
]),
453453
'modalBody' => $interface->fetch('MyAccount/addAccountLink.tpl'),
454-
'modalButtons' => "<span class='tool btn btn-primary' id = 'AddAccountSubmit' onclick='AspenDiscovery.Account.processAddLinkedUser(); return false;'>" . translate([
454+
'modalButtons' => "<button type='button' class='tool btn btn-primary' id = 'AddAccountSubmit' onclick='AspenDiscovery.Account.processAddLinkedUser(); return false;'>" . translate([
455455
'text' => "Add Account",
456456
'isPublicFacing' => true,
457-
]) . "</span>",
457+
]) . "</button>",
458458
];
459459
}
460460

@@ -491,10 +491,10 @@ function getBulkAddToListForm() {
491491
'isPublicFacing' => true,
492492
]),
493493
'modalBody' => $interface->fetch('MyAccount/bulkAddToListPopup.tpl'),
494-
'modalButtons' => "<span class='tool btn btn-primary' onclick='AspenDiscovery.Lists.processBulkAddForm(); return false;'>" . translate([
494+
'modalButtons' => "<button type='button' class='tool btn btn-primary' onclick='AspenDiscovery.Lists.processBulkAddForm(); return false;'>" . translate([
495495
'text' => "Add To List",
496496
'isPublicFacing' => true,
497-
]) . "</span>",
497+
]) . "</button>",
498498
];
499499
}
500500

@@ -599,7 +599,7 @@ function confirmCancelHold(): array {
599599
'text' => "Are you sure you want to cancel this hold?",
600600
'isPublicFacing' => true,
601601
]),
602-
'buttons' => "<span class='tool btn btn-primary' onclick='AspenDiscovery.Account.cancelHold(\"$patronId\", \"$recordId\", \"$cancelId\", \"$isIll\")'>$cancelButtonLabel</span>",
602+
'buttons' => "<button type='button' class='tool btn btn-primary' onclick='AspenDiscovery.Account.cancelHold(\"$patronId\", \"$recordId\", \"$cancelId\", \"$isIll\")'>$cancelButtonLabel</button>",
603603
];
604604
}
605605

@@ -690,7 +690,7 @@ function confirmCancelHoldSelected(): array {
690690
'text' => 'Are you sure you want to cancel selected holds?',
691691
'isPublicFacing' => true,
692692
]),
693-
'buttons' => "<span class='tool btn btn-primary' onclick='AspenDiscovery.Account.cancelHoldSelected(\"$patronId\", \"$recordId\", \"$cancelId\")'>$cancelButtonLabel</span>",
693+
'buttons' => "<button type='button' class='tool btn btn-primary' onclick='AspenDiscovery.Account.cancelHoldSelected(\"$patronId\", \"$recordId\", \"$cancelId\")'>$cancelButtonLabel</button>",
694694
];
695695
}
696696

@@ -848,7 +848,7 @@ function confirmCancelHoldAll(): array {
848848
'text' => 'Are you sure you want to cancel all holds?',
849849
'isPublicFacing' => true,
850850
]),
851-
'buttons' => "<span class='tool btn btn-primary' onclick='AspenDiscovery.Account.cancelHoldAll()'>$cancelButtonLabel</span>",
851+
'buttons' => "<button type='button' class='tool btn btn-primary' onclick='AspenDiscovery.Account.cancelHoldAll()'>$cancelButtonLabel</button>",
852852
];
853853
}
854854

@@ -1019,7 +1019,7 @@ function confirmFreezeHoldSelected(): array {
10191019
'text' => 'Are you sure you want to freeze selected holds?',
10201020
'isPublicFacing' => true,
10211021
]);
1022-
$button = "<span class='tool btn btn-primary' onclick='AspenDiscovery.Account.freezeHoldSelected(\"$patronId\", \"$recordId\", \"$holdId\")'>$freezeButtonLabel</span>";
1022+
$button = "<button type='button' class='tool btn btn-primary' onclick='AspenDiscovery.Account.freezeHoldSelected(\"$patronId\", \"$recordId\", \"$holdId\")'>$freezeButtonLabel</button>";
10231023
}
10241024

10251025
return [
@@ -1181,7 +1181,7 @@ function confirmFreezeHoldAll(): array {
11811181
'text' => 'Are you sure you want to freeze all holds?',
11821182
'isPublicFacing' => true,
11831183
]);
1184-
$button = "<span class='tool btn btn-primary' onclick='AspenDiscovery.Account.freezeHoldAll(\"$patronId\")'>$freezeButtonLabel</span>";
1184+
$button = "<button type='button' class='tool btn btn-primary' onclick='AspenDiscovery.Account.freezeHoldAll(\"$patronId\")'>$freezeButtonLabel</button>";
11851185
}
11861186
return [
11871187
'title' => translate([
@@ -1298,7 +1298,7 @@ function confirmThawHoldSelected(): array {
12981298
'text' => 'Are you sure you want to thaw selected holds?',
12991299
'isPublicFacing' => true,
13001300
]),
1301-
'buttons' => "<span class='tool btn btn-primary' onclick='AspenDiscovery.Account.thawHoldSelected(\"$patronId\", \"$recordId\", \"$holdId\")'>$thawButtonLabel</span>",
1301+
'buttons' => "<button type='button' class='tool btn btn-primary' onclick='AspenDiscovery.Account.thawHoldSelected(\"$patronId\", \"$recordId\", \"$holdId\")'>$thawButtonLabel</button>",
13021302
];
13031303
}
13041304

@@ -1438,7 +1438,7 @@ function confirmThawHoldAll(): array {
14381438
'text' => 'Are you sure you want to thaw all holds?',
14391439
'isPublicFacing' => true,
14401440
]),
1441-
'buttons' => "<span class='tool btn btn-primary' onclick='AspenDiscovery.Account.thawHoldAll(\"$patronId\")'>$thawButtonLabel</span>",
1441+
'buttons' => "<button type='button' class='tool btn btn-primary' onclick='AspenDiscovery.Account.thawHoldAll(\"$patronId\")'>$thawButtonLabel</button>",
14421442
];
14431443
}
14441444

@@ -1689,10 +1689,10 @@ function getCreateListForm() {
16891689
'isPublicFacing' => true,
16901690
]),
16911691
'modalBody' => $interface->fetch("MyAccount/createListForm.tpl"),
1692-
'modalButtons' => "<span class='tool btn btn-primary' onclick='AspenDiscovery.Account.addList(); return false;'>" . translate([
1692+
'modalButtons' => "<button type='button' class='tool btn btn-primary' onclick='AspenDiscovery.Account.addList(); return false;'>" . translate([
16931693
'text' => 'Create List',
16941694
'isPublicFacing' => true,
1695-
]) . "</span>",
1695+
]) . "</button>",
16961696
];
16971697
}
16981698

@@ -1996,10 +1996,10 @@ function getChangeHoldLocationForm() {
19961996
'isPublicFacing' => true,
19971997
]),
19981998
'modalBody' => $interface->fetch("MyAccount/changeHoldLocation.tpl"),
1999-
'modalButtons' => '<span class="tool btn btn-primary" onclick="AspenDiscovery.Account.doChangeHoldLocation(); return false;">' . translate([
1999+
'modalButtons' => '<button type="button" class="tool btn btn-primary" onclick="AspenDiscovery.Account.doChangeHoldLocation(); return false;">' . translate([
20002000
'text' => 'Change Location',
20012001
'isPublicFacing' => true,
2002-
]) . '</span>',
2002+
]) . '</button>',
20032003
];
20042004
} else {
20052005
$results = [
@@ -2235,10 +2235,15 @@ function getEmailMyListForm() {
22352235
$listId = $_REQUEST['listId'];
22362236

22372237
$interface->assign('listId', $listId);
2238+
22382239
return [
22392240
'title' => 'Email a list',
22402241
'modalBody' => $interface->fetch('MyAccount/emailListPopup.tpl'),
2241-
'modalButtons' => '<span class="tool btn btn-primary" onclick="$(\'#emailListForm\').submit();">Send Email</span>',
2242+
'modalButtons' => '<button type="button" class="btn btn-primary" onclick="$(\'#emailListForm\').submit();">' . translate([
2243+
'text' => 'Send Email',
2244+
'isPublicFacing' => true,
2245+
'inAttribute' => true,
2246+
]) . '</button>',
22422247
];
22432248
} else {
22442249
return [
@@ -6376,7 +6381,10 @@ function getHiddenBrowseCategories() {
63766381
return [
63776382
'title' => 'Hidden browse categories',
63786383
'modalBody' => $interface->fetch('MyAccount/hiddenBrowseCategories.tpl'),
6379-
'modalButtons' => '<span class="tool btn btn-primary" onclick="return AspenDiscovery.Account.showBrowseCategory()">Show these Browse Categories</span>',
6384+
'modalButtons' => '<button type="button" class="tool btn btn-primary" onclick="return AspenDiscovery.Account.showBrowseCategory()">' . translate ([
6385+
'text' => 'Show These Browse Categories',
6386+
'isPublicFacing' => true,
6387+
]) . '</button>',
63806388
];
63816389
} else {
63826390
$interface->assign('message', 'You have no hidden browse categories.');
@@ -7721,10 +7729,10 @@ function getCancelCurbsidePickup() {
77217729
'text' => 'Are you sure you want to cancel this curbside pickup?',
77227730
'isPublicFacing' => true,
77237731
]),
7724-
'buttons' => "<span class='btn btn-primary' onclick='AspenDiscovery.Account.cancelCurbsidePickup(\"$patronId\", \"$pickupId\")'>" . translate([
7732+
'buttons' => "<button type='button' class='btn btn-primary' onclick='AspenDiscovery.Account.cancelCurbsidePickup(\"$patronId\", \"$pickupId\")'>" . translate([
77257733
'text' => 'Yes, cancel pickup',
77267734
'isPublicFacing' => true,
7727-
]) . "</span>",
7735+
]) . "</button>",
77287736
];
77297737
}
77307738

code/web/sys/Browse/BrowseCategory.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,10 @@ public function isValidForDisplayInApp($user, $checkDismiss = false): bool {
526526
}
527527
}
528528

529-
if ($this->textId == 'system_user_lists' || $this->textId == 'system_saved_searches' || $this->textId == 'system_recommended_for_you' && (!$user || ($user instanceof AspenError))) {
530-
return false;
529+
if ($this->textId == 'system_user_lists' || $this->textId == 'system_saved_searches' || $this->textId == 'system_recommended_for_you') {
530+
if(!$user || ($user instanceof AspenError)) {
531+
return false;
532+
}
531533
}
532534

533535
return true;

code/web/sys/Browse/BrowseCategoryGroupEntry.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,10 @@ public function isValidForDisplayInApp($user, $checkDismiss = false): bool {
272272
}
273273
}
274274

275-
if ($browseCategory->textId == 'system_user_lists' || $browseCategory->textId == 'system_saved_searches' || $browseCategory->textId == 'system_recommended_for_you' && (!$user || ($user instanceof AspenError))) {
276-
return false;
275+
if ($browseCategory->textId == 'system_user_lists' || $browseCategory->textId == 'system_saved_searches' || $browseCategory->textId == 'system_recommended_for_you') {
276+
if(!$user || ($user instanceof AspenError)) {
277+
return false;
278+
}
277279
}
278280

279281
return true;

0 commit comments

Comments
 (0)