Skip to content

Commit

Permalink
Merge branch 'dev' into pull-request/configurable-view-for-eds
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz authored Jan 27, 2025
2 parents c66dd46 + 1b3a9fd commit 812107b
Show file tree
Hide file tree
Showing 24 changed files with 135 additions and 5,512 deletions.
2 changes: 2 additions & 0 deletions config/vufind/EDS.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ common_expanders = fulltext
; This setting controls the default view for search results; the selected option
; should be one of the options present in the [Views] section below.
default_view = list_brief
; If a warning should be shown on searches and records when the user only has a restricted view.
show_restricted_view_warning = false

; These are the default recommendations modules to use when no specific setting
; are found in the [TopRecommendations], [SideRecommendations] or
Expand Down
2 changes: 2 additions & 0 deletions languages/de.ini
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,7 @@ Located = "Standort"
Location = "Standort"
Log Out = "Log out"
logged_in = "Sie haben sich eingeloggt."
logged_in_access_restricted = "Ihr Konto hat nicht vollen Zugriff."
Login = "Login"
Login for full access = "Für Vollzugriff bitte einloggen."
login_disabled = "Login steht momentan nicht zur Verfügung."
Expand Down Expand Up @@ -1487,6 +1488,7 @@ Theme = "Layout"
Thesis = "Abschlussarbeit"
This email was sent from = "Diese Mail wurde verschickt von"
This field is required = "Pflichtfeld"
This is only a restricted view = "Dies ist nur eine eingeschränkte Ansicht."
This item is already part of the following list/lists = "Dieser Datensatz ist bereits in der/den folgenden Liste/Listen enthalten"
This result is not displayed to guests = "Dieser Treffer wird im Gastzugang nicht angezeigt."
Title = "Titel"
Expand Down
2 changes: 2 additions & 0 deletions languages/en.ini
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,7 @@ Located = "Located"
Location = "Location"
Log Out = "Log Out"
logged_in = "You have logged in."
logged_in_access_restricted = "Your account has not been granted full access."
Login = "Login"
Login for full access = "Login for full access."
login_disabled = "Login is not available at this time."
Expand Down Expand Up @@ -1499,6 +1500,7 @@ Theme = "Theme"
Thesis = "Thesis"
This email was sent from = "This email was sent from"
This field is required = "This field is required"
This is only a restricted view = "This is only a restricted view."
This item is already part of the following list/lists = "This item is already part of the following list/lists"
This result is not displayed to guests = "This result is not displayed to guests."
Title = "Title"
Expand Down
18 changes: 18 additions & 0 deletions module/VuFind/src/VuFind/Search/Base/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,13 @@ abstract class Options implements TranslatorAwareInterface
*/
protected $displayCitationLinksInResults;

/**
* Should we display a warning in restricted views?
*
* @var bool
*/
protected bool $showRestrictedViewWarning;

/**
* Constructor
*
Expand Down Expand Up @@ -430,6 +437,7 @@ public function __construct(\VuFind\Config\PluginManager $configLoader)
$this->hiddenSortOptions = $searchSettings?->HiddenSorting?->pattern?->toArray() ?? [];
$this->displayCitationLinksInResults
= (bool)($searchSettings->Results_Settings->display_citation_links ?? true);
$this->showRestrictedViewWarning = (bool)($searchSettings->General->show_restricted_view_warning ?? false);
}

/**
Expand Down Expand Up @@ -1387,4 +1395,14 @@ public function getHierarchicalFacetFilters(?string $field = null): array
}
return $this->hierarchicalFacetFilters;
}

/**
* Should we display a warning in restricted views?
*
* @return bool
*/
public function showRestrictedViewWarning(): bool
{
return $this->showRestrictedViewWarning ?? false;
}
}
17 changes: 17 additions & 0 deletions module/VuFind/src/VuFind/Search/Base/Results.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@ abstract class Results
*/
protected $hierarchicalFacetHelper = null;

/**
* If the results provide only a restricted view.
*
* @var bool
*/
protected bool $restrictedView = false;

/**
* Extra search details.
*
Expand Down Expand Up @@ -843,6 +850,16 @@ public function getFullFieldFacets(
return $facets;
}

/**
* Check if the results provide only a restricted view.
*
* @return bool
*/
public function isRestrictedView()
{
return $this->restrictedView;
}

/**
* Get the extra search details
*
Expand Down
1 change: 1 addition & 0 deletions module/VuFind/src/VuFind/Search/EDS/Results.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ protected function performSearch()

// Construct record drivers for all the items in the response:
$this->results = $collection->getRecords();
$this->restrictedView = $collection->isRestrictedView();
}
}

Expand Down
Loading

0 comments on commit 812107b

Please sign in to comment.