diff --git a/local/config/vufind/facets.ini b/local/config/vufind/facets.ini index f034da44690e6cf480b790cd05f5e9f5ae488b7f..a9b8777fd980e6da9cfdc68478557bad26fe84e5 100644 --- a/local/config/vufind/facets.ini +++ b/local/config/vufind/facets.ini @@ -37,7 +37,7 @@ publishDate = "adv_search_year" ; share year string w/advanced search pa [SpecialFacets] ; Any fields listed below will be treated as year-based date ranges rather than plain ; facets: -dateRange[] = publishDate +dateRange[] = publishDateSort ; Any fields listed below will be treated as year/month/day-based date ranges rather ; than plain facets: ;fullDateRange[] = example_field_date diff --git a/module/finc/src/finc/ILS/Driver/Factory.php b/module/finc/src/finc/ILS/Driver/Factory.php index 4e20ecbbce5a81450919ee8db10a642f9310e36c..9d14ae610d4b72f92b5a33ed8a9637f5ed22632f 100644 --- a/module/finc/src/finc/ILS/Driver/Factory.php +++ b/module/finc/src/finc/ILS/Driver/Factory.php @@ -52,6 +52,7 @@ class Factory return new FincILS( $sm->getServiceLocator()->get('VuFind\DateConverter'), $sm->getServiceLocator()->get('VuFind\RecordLoader'), + $sm->getServiceLocator()->get('VuFind\Search'), $sm->getServiceLocator()->get('VuFind\Config')->get('config') ); } diff --git a/module/finc/src/finc/ILS/Driver/FincILS.php b/module/finc/src/finc/ILS/Driver/FincILS.php index 2fa392fc19e77025ef6abecea625dc73aad19a22..aa6bea06e2a556730715f95ff4f5e7a318a588c3 100644 --- a/module/finc/src/finc/ILS/Driver/FincILS.php +++ b/module/finc/src/finc/ILS/Driver/FincILS.php @@ -27,6 +27,7 @@ */ namespace finc\ILS\Driver; use VuFind\Exception\ILS as ILSException, + VuFindSearch\Query\Query, VuFindSearch\Service as SearchService, Zend\Log\LoggerAwareInterface as LoggerAwareInterface; /** @@ -75,6 +76,13 @@ class FincILS extends PAIA implements LoggerAwareInterface */ protected $recordLoader; + /** + * Connection used when searching for fincid + * + * @var SearchService + */ + protected $searchService; + /** * Date converter object * @@ -98,10 +106,11 @@ class FincILS extends PAIA implements LoggerAwareInterface * built-in defaults) */ public function __construct(\VuFind\Date\Converter $converter, - \VuFind\Record\Loader $loader, $mainConfig = null + \VuFind\Record\Loader $loader, SearchService $ss, $mainConfig = null ) { $this->dateConverter = $converter; $this->recordLoader = $loader; + $this->searchService = $ss; $this->mainConfig = $mainConfig; } @@ -150,6 +159,18 @@ class FincILS extends PAIA implements LoggerAwareInterface $this->_testILSConnections(); } + /** + * PAIA support method - try to find fincid for last segment of PAIA id + * + * @param string $id itemId + * + * @return string $id + */ + protected function getAlternativeItemId($id) + { + return $this->_getFincId(end(explode(":", $id))); + } + /** * Get Status * @@ -437,6 +458,35 @@ class FincILS extends PAIA implements LoggerAwareInterface return $ids; } + /** + * Get the finc id of the record with the given ilsIdentifier value + * + * @param string $ilsId Document to look up. + * + * @return string $fincId if ilsIdentifier is configured, otherwise $ilsId + */ + private function _getFincId($ilsId) + { + if ($this->ilsIdentifier != "default") { + // different ilsIdentifier is configured, retrieve fincid + try { + $query = $this->ilsIdentifier . ':' . $ilsId; + $result = $this->searchService->search('VuFind', new Query($query)); + if (count($result) === 0) { + throw new \Exception( + 'Problem retrieving finc id for record with ' + . $this->ilsIdentifier . ":" . $ilsId + ); + } + return current($result->getRecords())->getUniqueId(); + } catch (\Exception $e) { + $this->debug($e); + return $ilsId; + } + } + return $ilsId; + } + /** * Private service test method * diff --git a/module/finc/src/finc/ILS/Driver/PAIA.php b/module/finc/src/finc/ILS/Driver/PAIA.php index 3da4f0e8c5e95b598361b4d9a4399002793bfc81..201989f77967ce68ef0777072ca32918ac2f1386 100644 --- a/module/finc/src/finc/ILS/Driver/PAIA.php +++ b/module/finc/src/finc/ILS/Driver/PAIA.php @@ -388,23 +388,38 @@ class PAIA extends \VuFind\ILS\Driver\DAIA implements 'core/'.$patron['cat_username'].'/fees' ); + // PAIA simple data type money: a monetary value with currency (format + // [0-9]+\.[0-9][0-9] [A-Z][A-Z][A-Z]), for instance 0.80 USD. + $feeConverter = function ($fee) { + $paiaCurrencyPattern = "/^([0-9]+\.[0-9][0-9]) ([A-Z][A-Z][A-Z])$/"; + if (preg_match($paiaCurrencyPattern, $fee, $feeMatches)) { + // VuFind expects fees in PENNIES + return ($feeMatches[1]*100); + } + return $fee; + }; + $results = []; if (isset($fees['fee'])) { foreach ($fees['fee'] as $fee) { $results[] = [ - // fee.amount (1..1) amount of a single fee - 'amount' => $fee['amount'], + // fee.amount 1..1 money amount of a single fee + 'amount' => $feeConverter($fee['amount']), 'checkout' => '', - // fee.feetype (0..1) textual description of the type of fee + // fee.feetype 0..1 string textual description of the type of service that caused the fee 'fine' => (isset($fee['feetype']) ? $fee['feetype'] : null), 'balance' => '', - // fee.date (0..1) date when the fee was claimed + // fee.date 0..1 date date when the fee was claimed 'createdate' => (isset($fee['date']) ? $this->convertDate($fee['date']) : null), 'duedate' => '', - // fee.edition (0..1) edition that caused the fee + // fee.edition 0..1 URI edition that caused the fee 'id' => (isset($fee['edition']) ? $this->getAlternativeItemId($fee['edition']) : ''), + // custom PAIA fields + // fee.about 0..1 string textual information about the fee + // fee.item 0..1 URI item that caused the fee + // fee.feeid 0..1 URI URI of the type of service that caused the fee ]; } } @@ -951,7 +966,7 @@ class PAIA extends \VuFind\ILS\Driver\DAIA implements $result = []; // canrenew (0..1) whether a document can be renewed (bool) $result['renewable'] = (isset($doc['canrenew']) - ? $doc['canrenew'] : true); + ? $doc['canrenew'] : false); // item (0..1) URI of a particular copy $result['item_id'] = (isset($doc['item']) ? $doc['item'] : ''); diff --git a/themes/foundation5/scss/default.scss b/themes/foundation5/scss/default.scss index 34cc82913e70a00484d744c87094b883cd414c09..f95cf74ef7fb3c23337e16dad0a0934265e84be8 100644 --- a/themes/foundation5/scss/default.scss +++ b/themes/foundation5/scss/default.scss @@ -273,7 +273,8 @@ ul { } ul.date-range-slider { - margin: .25rem 1rem 0 1rem + margin: .25rem 1rem 0 1rem; + list-style: none; } .slider-container { diff --git a/themes/foundation5/templates/Recommend/SideFacets.phtml b/themes/foundation5/templates/Recommend/SideFacets.phtml index 4308817ce41c4e398bfa397fd07d9e035a8a772e..1106e08df1e3cee19ebe60122c3daafd85c08207 100644 --- a/themes/foundation5/templates/Recommend/SideFacets.phtml +++ b/themes/foundation5/templates/Recommend/SideFacets.phtml @@ -182,8 +182,8 @@ JS; </li> <? endif; ?> <? if ($thisFacet['isApplied']): ?> - <li class="list-group-item active<? if ($i >= $facets_before_more): ?><?= $moreClass ?>"<? endif ?>> - <a class="active <? if ($thisFacet['operator'] == 'OR'): ?> facetOR applied<? endif ?>" href="<?= $this->currentPath() . $results->getUrlQuery()->removeFacet($title, $thisFacet['value'], true, $thisFacet['operator']) ?>"> + <li class="<? if ($i >= $facets_before_more): ?> <?= $moreClass ?> <? endif ?>" > + <a class="active <? if ($thisFacet['operator'] == 'OR'): ?> facetOR applied<? endif ?>" href="<?= $this->currentPath() . $results->getUrlQuery()->removeFacet($title, $thisFacet['value'], true, $thisFacet['operator']) ?>" > <? if ($thisFacet['operator'] == 'OR'): ?> <i class="fa fa-check-square-o"></i> <? else: ?> diff --git a/themes/foundation5/templates/search/advanced/layout.phtml b/themes/foundation5/templates/search/advanced/layout.phtml index f54bbf3f7c01e3b07039d53573126267f1ac9973..be3717a0656dead34a0861b2994add371b48e357 100644 --- a/themes/foundation5/templates/search/advanced/layout.phtml +++ b/themes/foundation5/templates/search/advanced/layout.phtml @@ -67,7 +67,6 @@ if (isset($searchDetails) && is_object($searchDetails)) { <input type="hidden" name="sort" value="relevance"> <div class="clearfix"> <h2 class="left"><?= $this->transEsc('Advanced Search') ?></h2> - <div id="groupJoin" class="right hide"> <label for="groupJoinOptions"><?= $this->transEsc("search_match") ?>:</label> <select id="groupJoinOptions" name="join" class="auto"><? /* leave class=auto - was form-control and used in advanced_search.js - CK */ ?> @@ -109,7 +108,7 @@ if (isset($searchDetails) && is_object($searchDetails)) { <input name="lookfor<?= $group ?>[]" id="search_lookfor<?= $group . '_' . $search ?>" class="input_slot" type="text"<? if (isset($setQueries[$group][$search])): ?> value="<?= $this->escapeHtml($setQueries[$group][$search]->getString()) ?>"<? endif; ?>><? /* Leave input_slot in - used in advancedsearch.js */ ?> </div> <div class="small-10 medium-4 columns"> - <select class="type" name="type<?= $group ?>[]"> + <select class="type auto" name="type<?= $group ?>[]"> <? foreach ($this->options->getAdvancedHandlers() as $searchVal => $searchDesc): ?> <option value="<?= $this->escapeHtml($searchVal) ?>"<? if (isset($setQueries[$group][$search]) && $searchVal == $setQueries[$group][$search]->getHandler()): ?> selected<? endif; ?>><?= $this->transEsc($searchDesc) ?></option> @@ -117,13 +116,17 @@ if (isset($searchDetails) && is_object($searchDetails)) { </select> </div> <div class="small-2 medium-1 columns close hide"> - <a class="help-block small-text-right medium-text-center" title="<?= $this->transEsc("Delete") ?>" href="#"><span class="show-for-medium-up alert">×</span> <span class="show-for-small-only alert">× <small class="sr-only"><?= $this->transEsc("Delete") ?></small></span></a> + <a class="help-block small-text-right medium-text-center" title="<?= $this->transEsc("Delete") ?>" href="#"> + <span class="show-for-medium-up alert">×</span> + <span class="show-for-small-only alert">× <small class="sr-only"><?= $this->transEsc("Delete") ?></small></span> + </a> </div> </div> </div> <? if ($group == 0 && $search == 0): ?> </div> - <i class="fa fa-plus search_place_holder hide"></i> <a href="#" class="add_search_link hide"><?= $this->transEsc("add_search") ?></a> + <i class="fa fa-plus search_place_holder hide"></i> + <a href="#" class="add_search_link hide"><?= $this->transEsc("add_search") ?></a> <? endif; ?> <? endfor; ?> </div> @@ -131,7 +134,7 @@ if (isset($searchDetails) && is_object($searchDetails)) { </div> <div class="medium-3 columns match"> <label class="search_bool"><?= $this->transEsc("search_match") ?>: </label> - <select name="bool<?= $group ?>[]" id="search_bool<?= $group ?>"> + <select name="bool<?= $group ?>[]" id="search_bool<?= $group ?>" class="auto"> <option value="AND"<? if (isset($setSearchGroups[$group]) && 'AND' == $setSearchGroups[$group]): ?> selected<? endif; ?>><?= $this->transEsc("search_AND") ?></option> <option value="OR"<? if (isset($setSearchGroups[$group]) && 'OR' == $setSearchGroups[$group]): ?> selected<? endif; ?>><?= $this->transEsc("search_OR") ?></option> <option value="NOT"<? if (isset($setSearchGroups[$group]) && 'NOT' == $setSearchGroups[$group]): ?> selected<? endif; ?>><?= $this->transEsc("search_NOT") ?></option>