diff --git a/local/config/vufind/config.ini b/local/config/vufind/config.ini index f574d8e3a19cbb3ec158d25b25cf313c7e55a518..7f6b2e6872ef9a0c948a03f526787cc98c092744 100644 --- a/local/config/vufind/config.ini +++ b/local/config/vufind/config.ini @@ -1540,6 +1540,8 @@ remove[] = "gndmusic" ; fit to resolve by bare linkresolver logic or openurl processing. [LinksRewrite] ; Start to declare a own group which can have following keys. +; identifier[remove] single definition item needs a url pattern to suppress links +; of displaying. ; identifier[pattern] is necessary to switch on rewrite und sort out the right links. ; regular expression are allowed ; identifier[search] is the string to replaced diff --git a/local/languages/de.ini b/local/languages/de.ini index d3ca624f5594d5cc3baf7fc0d41fd110f489bef2..1f737d2386fa1c7f17e3e6dbf2da9d736ea91ffa 100644 --- a/local/languages/de.ini +++ b/local/languages/de.ini @@ -588,6 +588,7 @@ View Records = "Datensätze ansehen" Visit our blog to the new catalogue = "Wir bloggen zum neuen Katalog" Volume = Jahrgang/ Nummer Volumes in Stock = "Jahrgänge im Bestand" +Warning: These citations may not always be 100% accurate = "Bitte überprüfen Sie diese Angaben auf Richtigkeit, bevor Sie sie in Ihre Arbeit aufnehmen" Web = Web Wednesday = Mittwoch Year = "Jahr" @@ -622,7 +623,7 @@ Your Tags = "Meine Tags" Your book bag is empty = "Ihre Zwischenablage ist leer" Your old password does not match = "Ihr altes Passwort ist nicht korrekt" Your search terms = "Meine Suchbegriffe" -Zip = PLZ, Ort +Zip = PLZ add_favorite_fail = "Fehler: Datensatz wurde nicht gespeichert" add_favorite_prefix = "" add_favorite_suffix = "zu den Favoriten hinzufügen" @@ -756,7 +757,7 @@ fav_delete_deleting = "Ihre ausgewählten Favoriten werden gelöscht." fav_delete_fail = "Leider ist ein Fehler aufgetreten. Ihre ausgewählten Favoriten wurden nicht gelöscht." fav_delete_missing = "Fehlende Angaben. Ihre ausgewählten Favoriten wurden nicht gelöscht." fav_delete_success = "Ihre ausgewählten Favoriten wurden gelöscht." -fav_delete_warn = "Sie sind dabei diese Favoriten aus all Ihren Listen zu löschen. Falls Sie Favoriten nur aus einer einzelnen Liste löschen möchten, wählen Sie bitte die betreffende Liste aus, bevor Sie auf Löschen klicken." +fav_delete_warn = "Sie sind dabei, diese Favoriten aus all Ihren Listen zu löschen. Falls Sie Favoriten nur aus einer einzelnen Liste löschen möchten, wählen Sie bitte die betreffende Liste aus, bevor Sie auf Löschen klicken." fav_email_fail = "Leider ist ein Fehler aufgetreten. Ihre ausgewählten Favoriten wurden nicht per E-Mail versendet." fav_email_missing = "Fehlende Angaben. Ihre ausgewählten Favoriten wurden nicht per E-Mail versendet." fav_email_success = "Ihre ausgewählten Favoriten wurden erfolgreich per E-Mail versendet." @@ -1869,4 +1870,5 @@ Originator = "Schöpfer" Originators = "Schöpfer" Other ID = "Weitere Identifier" Other Originators = "Weitere Schöpfer" +Subject Actor = "Motiv" Time of origin = "Entstehungszeit" diff --git a/local/languages/en.ini b/local/languages/en.ini index 9e4ac60854698d85f7321488845fd342adc128fc..aa1bbf0afa266dd124311b8c513569a0b1c41109 100644 --- a/local/languages/en.ini +++ b/local/languages/en.ini @@ -263,7 +263,7 @@ Video = Video Videos = Videos View online: Full view Book Preview from the Hathi Trust = "View Online: View full book preview from Hathi Trust" Volume = Volume -Warning: These citations may not always be 100% accurate = "Warning: These citations may not always be 100% correct" +Warning: These citations may not always be 100% accurate = "Remember to check citations for accuracy before including them in your work" Web = Web # Welsh = "Cymraeg" Welsh = Welsh @@ -1810,4 +1810,5 @@ Originator = "Originator" Originators = "Originators" Other ID = "Other ID" Other Originators = "Other Originators" +Subject Actor = "Subject Actor" Time of origin = "Time of origin" \ No newline at end of file diff --git a/module/finc/src/finc/Controller/AjaxController.php b/module/finc/src/finc/Controller/AjaxController.php index 53f551a5fe8773fd3509e4f6f8bed7649fef5fe1..8e842270ded229a2f52639126b26d9ecea02bd5f 100644 --- a/module/finc/src/finc/Controller/AjaxController.php +++ b/module/finc/src/finc/Controller/AjaxController.php @@ -27,6 +27,7 @@ */ namespace finc\Controller; use VuFind\Exception\Auth as AuthException; +use VuFind\View\Helper\Root\SafeMoneyFormat; /** * This controller handles global AJAX functionality diff --git a/module/finc/src/finc/ILS/Driver/FincILS.php b/module/finc/src/finc/ILS/Driver/FincILS.php index c6c0531888d7f42d2b71750fbe71adc6e10bbff6..8b309faadcdd5f886911711fc7ce6c4b467f939b 100644 --- a/module/finc/src/finc/ILS/Driver/FincILS.php +++ b/module/finc/src/finc/ILS/Driver/FincILS.php @@ -201,7 +201,7 @@ class FincILS extends PAIA implements LoggerAwareInterface $this->root_username = $this->config['PAIA']['root_username']; $this->root_password = $this->config['PAIA']['root_password']; } - + // get ISIL from config if ILS-specific recordId is barcode for // interaction with ILS if (!isset($this->mainConfig['InstitutionInfo']['isil'])) { @@ -357,7 +357,7 @@ class FincILS extends PAIA implements LoggerAwareInterface } return []; } - + /********************************************* * Custom DAIA methods *********************************************/ @@ -425,7 +425,7 @@ class FincILS extends PAIA implements LoggerAwareInterface parent::getStatuses($this->_getILSRecordIds($ids)), $ids )); } - + /** * Override and add to DAIA item status Email Hold availability * @@ -445,7 +445,7 @@ class FincILS extends PAIA implements LoggerAwareInterface } return $return; } - + /** * Returns the value for "barcode" in VuFind getStatus/getHolding array * @@ -520,7 +520,7 @@ class FincILS extends PAIA implements LoggerAwareInterface foreach ($vcard->ADR as $adr) { $address[( (isset($adr->parameters['ALTID'])) - ? (string)$adr->parameters['ALTID'] : null + ? (string)$adr->parameters['ALTID'] : 'p' //sets default key 'p' for private address )] = $adr->getParts(); } } @@ -528,7 +528,7 @@ class FincILS extends PAIA implements LoggerAwareInterface foreach ($vcard->TEL as $tel) { $phone[( (isset($tel->parameters['TYPE'])) - ? (string)$tel->parameters['TYPE'] : null + ? (string)$tel->parameters['TYPE'] : 'home' //sets default key 'home' for private phone number )] = (string)$tel; } } @@ -557,16 +557,18 @@ class FincILS extends PAIA implements LoggerAwareInterface ? $this->config['PAIA']['profileFormEmptyInputReplacement'] : NULL; - foreach ($address as $key => $altid) { - foreach ($addressParameterMap as $parameter => $pos) { - $var = strtolower($parameter . '-' . $key); - $profile[$var] = ($altid[$pos] != $replace) - ? $altid[$pos] : ''; - // keep backward compatibility to old forms - // vcard ALTID p is default value - if (strtolower($key) == 'p') { - $profile[$parameter] = ($altid[$pos] != $replace) + if (isset($address)) { + foreach ($address as $key => $altid) { + foreach ($addressParameterMap as $parameter => $pos) { + $var = strtolower($parameter . '-' . $key); + $profile[$var] = ($altid[$pos] != $replace) ? $altid[$pos] : ''; + // keep backward compatibility to old forms + // vcard ALTID p is default value + if (strtolower($key) == 'p') { + $profile[$parameter] = ($altid[$pos] != $replace) + ? $altid[$pos] : ''; + } } } } @@ -599,7 +601,7 @@ class FincILS extends PAIA implements LoggerAwareInterface $patron['email'] : (!empty($emails[0]) ? $emails[0] : null), 'editableFields' => (!empty($editable)) ? $editable : null ]; - return array_merge($idm, $profile); + return (isset($profile)) ? array_merge($idm, $profile) : $idm; } return []; @@ -634,7 +636,7 @@ class FincILS extends PAIA implements LoggerAwareInterface = array_merge_recursive($fields, $address_fields); } } elseif ($match[1] == "TEL") { - $fields = 'phone-' . $match[2]; + $fields[] = 'phone-' . $match[2]; // backward compatibility if ($match[2] == 'home') { $fields[] = 'phone'; @@ -678,16 +680,21 @@ class FincILS extends PAIA implements LoggerAwareInterface //handle name $params['name'] = ''; $name_array = array_fill(0,2,null); + $noname = TRUE; if (isset($inval['firstname'])) { $params['name'] .= $inval['firstname']; $name_array[1] = $inval['firstname']; + $noname = FALSE; } if (isset($inval['lastname'])) { $params['name'] .= ' '.$inval['lastname']; $name_array[0] = $inval['lastname']; + $noname = FALSE; + } + if (!$noname) { + $this->setVCardValue($vcard, 'FN', $params['name']); + $this->setVCardValue($vcard, 'N', $name_array); } - $this->setVCardValue($vcard,'FN',$params['name']); - $this->setVCardValue($vcard,'N',$name_array); //handle e-mail if (isset($inval['email'])) { @@ -703,7 +710,8 @@ class FincILS extends PAIA implements LoggerAwareInterface $address_array = []; // array_fill(0,7,NULL); //the empty-field marker in the used ILS - $replace = isset($this->config['PAIA']['profileFormEmptyInputReplacement']) ? $this->config['PAIA']['profileFormEmptyInputReplacement'] : NULL; + $replace = isset($this->config['PAIA']['profileFormEmptyInputReplacement']) + ? $this->config['PAIA']['profileFormEmptyInputReplacement'] : NULL; foreach ($inval as $key => $val) { @@ -713,7 +721,7 @@ class FincILS extends PAIA implements LoggerAwareInterface // add phone inputs to vcard if (0 < preg_match('/phone-(\w+)/', $key, $match)) { $this->setVCardValue( - $vcard, 'TEL', $match[0], ['type' => $match[1]] + $vcard, 'TEL', $val, ['type' => $match[1]] ); } @@ -782,6 +790,7 @@ class FincILS extends PAIA implements LoggerAwareInterface // process vcard $vcard = $vcard->convert(VObject\Component\VCard::VCARD40); + $n = $vcard->select('N'); if ($address = $vcard->serialize()) { $params['address'] = $address; } @@ -827,9 +836,15 @@ class FincILS extends PAIA implements LoggerAwareInterface VObject\Component\VCard $vcard, $key, $value, $type = null ) { - if (is_string($value)) $value = str_replace(',','',$value); - elseif (is_array($value)) array_walk_recursive($value,function (&$value,$key) {$value = str_replace(',','',$value);}); - if ($vcard->select($key) == array()) { + if (is_string($value)) { + $value = str_replace(',', '', $value); + } elseif (is_array($value)) { + array_walk_recursive($value, function (&$value, $key) { + $value = str_replace(',', '', $value); + }); + } + $children = $vcard->select($key); + if (empty($children)) { // if the key is unknown, we add a new property with the value if (in_array($key, array('TEL', 'ADR'))) { @@ -839,9 +854,29 @@ class FincILS extends PAIA implements LoggerAwareInterface } $vcard->add($key, $value, $type); } else { - // if the property/child already exists - // we change the value - $vcard->{$key}->setValue($value); + if (isset($type)) { + foreach ($children as &$child) { + foreach ($type as $type_key => $type_value) { + if (in_array( + $type_value, + $child->parameters[strtoupper($type_key)]->getParts() + )) { + $child->setValue($value); + return; + } + } + } + // refs #10912 + // if key exists in first dimension VCARD object return update true + } elseif (isset($key)) { + foreach ($children as $child) { + if ($key == $child->name) { + $vcard->{$key}->setValue($value); + return; + } + } + } + $vcard->add($key, $value, $type); } } @@ -853,9 +888,10 @@ class FincILS extends PAIA implements LoggerAwareInterface * @param string $username The patron's username * @param string $password The patron's login password * - * @return mixed Associative array of patron info on successful login, + * @return mixed Associative array of patron info on successful login, * null on unsuccessful login. - * + * @access public + * @throws \Exception * @throws ILSException */ public function patronLogin($username, $password) @@ -876,7 +912,7 @@ class FincILS extends PAIA implements LoggerAwareInterface $password, $username ); - } catch (Exception $e) { + } catch (\Exception $e) { // TODO? $this->debug('Session expired, login again', 'info'); // all error handling is done in paiaHandleErrors so pass on the excpetion throw $e; @@ -891,7 +927,7 @@ class FincILS extends PAIA implements LoggerAwareInterface $username ); } - } catch (Exception $e) { + } catch (\Exception $e) { // all error handling is done in paiaHandleErrors so pass on the excpetion throw $e; } @@ -915,10 +951,10 @@ class FincILS extends PAIA implements LoggerAwareInterface $session = $this->getSession(); $details['cat_username'] = $session->patron === 'root' && !empty($username) ? $username : $session->patron; - + return $details; } - + /** * Customized PAIA support method for PAIA core method 'items' returning only * filtered items. @@ -936,7 +972,7 @@ class FincILS extends PAIA implements LoggerAwareInterface { // check for existing data in cache if ($this->paiaCacheEnabled) { - $itemsResponse = $this->getCachedData($patron['cat_username'] . '_items'); + $itemsResponse = $this->getCachedData($patron['cat_username']); } if (!isset($itemsResponse) || $itemsResponse == null) { @@ -950,7 +986,7 @@ class FincILS extends PAIA implements LoggerAwareInterface } if ($this->paiaCacheEnabled) { - $this->putCachedData($patron['cat_username'] . '_items', $itemsResponse); + $this->putCachedData($patron['cat_username'], $itemsResponse); } } @@ -1085,7 +1121,7 @@ class FincILS extends PAIA implements LoggerAwareInterface } /********************************************* - * Finc-ILS specific methods + * Finc-ILS specific methods *********************************************/ /** @@ -1169,7 +1205,7 @@ class FincILS extends PAIA implements LoggerAwareInterface * finc-specific function to total the fines (e.g. for use in MyResearch menu) * * @param array $patron Patron details returned by patronLogin - * + * * @return float */ public function getFinesTotal($patron) { @@ -1220,7 +1256,7 @@ class FincILS extends PAIA implements LoggerAwareInterface return ''; } } - + /** * Helper function to create static ils response * @@ -1470,7 +1506,7 @@ class FincILS extends PAIA implements LoggerAwareInterface if ($ilsIdentifier != "default") { // different ilsIdentifier is configured, retrieve fincid - + // if the given ilsIdentifier is known as a dynamic field it is suffixed // with the isil if (in_array($ilsIdentifier, $this->dynamicFields)) { diff --git a/module/finc/src/finc/ILS/Driver/PAIA.php b/module/finc/src/finc/ILS/Driver/PAIA.php index 35ab905e049e3705f5bad573d88149cbca146578..3da0a278cc08d3b1f957ad3482ce950afe99b21d 100644 --- a/module/finc/src/finc/ILS/Driver/PAIA.php +++ b/module/finc/src/finc/ILS/Driver/PAIA.php @@ -106,8 +106,11 @@ class PAIA extends \VuFind\ILS\Driver\PAIA $it = $cancelDetails['details']; $items = []; + $count = 0; foreach ($it as $item) { $items[] = ['item' => stripslashes($item)]; + //we count how many items shall be cancelled + $count++; } $patron = $cancelDetails['patron']; $post_data = ["doc" => $items]; @@ -133,23 +136,23 @@ class PAIA extends \VuFind\ILS\Driver\PAIA 'sysMessage' => $array_response['error'] ]; } else { - $count = 0; $elements = $array_response['doc']; foreach ($elements as $element) { $item_id = $element['item']; - if ($element['error']) { + if (isset($element['error']) && $element['error']) { $details[$item_id] = [ 'success' => false, 'status' => $element['error'], 'sysMessage' => 'Cancel request rejected' ]; + //if an item could not be cancelled it must not be counted + $count--; } else { $details[$item_id] = [ 'success' => true, 'status' => 'Success', 'sysMessage' => 'Successfully cancelled' ]; - $count++; // DAIA cache cannot be cleared for particular item as PAIA only // operates with specific item URIs and the DAIA cache is setup @@ -264,35 +267,39 @@ class PAIA extends \VuFind\ILS\Driver\PAIA // 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])$/"; + $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; + return null; }; $results = []; if (isset($fees['fee'])) { foreach ($fees['fee'] as $fee) { - $result = [ - // fee.amount 1..1 money amount of a single fee - 'amount' => $feeConverter($fee['amount']), - 'checkout' => '', - // fee.feetype 0..1 string textual description of the type - // of service that caused the fee - 'fine' => (isset($fee['feetype']) ? $fee['feetype'] : null), - 'balance' => $feeConverter($fee['amount']), - // 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 URI edition that caused the fee - 'id' => (isset($fee['edition']) - ? $this->getAlternativeItemId($fee['edition']) : ''), - ]; - // custom PAIA fields can get added in getAdditionalFeeData - $results[] = $result + $this->getAdditionalFeeData($fee, $patron); + // won't show this fee if there is a formatting error + // see #11128-45, DM + if ($amount = $feeConverter($fee['amount'])) { + $result = [ + // fee.amount 1..1 money amount of a single fee + 'amount' => $amount, + 'checkout' => '', + // fee.feetype 0..1 string textual description of the type + // of service that caused the fee + 'fine' => (isset($fee['feetype']) ? $fee['feetype'] : null), + 'balance' => $amount, + // 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 URI edition that caused the fee + 'id' => (isset($fee['edition']) + ? $this->getAlternativeItemId($fee['edition']) : ''), + ]; + // custom PAIA fields can get added in getAdditionalFeeData + $results[] = $result + $this->getAdditionalFeeData($fee, $patron); + } } } return $results; diff --git a/module/finc/src/finc/RecordDriver/SolrAI.php b/module/finc/src/finc/RecordDriver/SolrAI.php index 0872d3d2cc8e47b62bf247cc771e5505efc447fa..850d5659fea55a48cd9cc0e2ee44cc9922da9574 100644 --- a/module/finc/src/finc/RecordDriver/SolrAI.php +++ b/module/finc/src/finc/RecordDriver/SolrAI.php @@ -314,7 +314,7 @@ class SolrAI extends SolrDefault implements } /** - * gets pages as 'start - end' if both exist + * Get pages as 'start-end' if both exist * * @return string pages */ @@ -327,7 +327,7 @@ class SolrAI extends SolrDefault implements // pages $pages = $this->getAIRecord('rft.pages'); if (!empty($spage) && !empty($epage)) { - return sprintf('%s - %s', $spage, $epage); + return sprintf('%s-%s', $spage, $epage); } elseif (!empty($spage)) { return $spage[0]; } elseif (!empty($epage)) { diff --git a/module/finc/src/finc/RecordDriver/SolrDefaultFincTrait.php b/module/finc/src/finc/RecordDriver/SolrDefaultFincTrait.php index a24a01bf209804782d8a421a88b27fbd54369a59..972012b459d1e825cfd6444ac2bbc2488fe8a41f 100644 --- a/module/finc/src/finc/RecordDriver/SolrDefaultFincTrait.php +++ b/module/finc/src/finc/RecordDriver/SolrDefaultFincTrait.php @@ -1201,4 +1201,15 @@ trait SolrDefaultFincTrait return isset($this->fields['title_alt']) ? $this->fields['title_alt'] : null; } + + /** + * Get values of genre_facet field + * + * @return array + */ + public function getGenreFacet() + { + return isset($this->fields['genre_facet']) + ? $this->fields['genre_facet'] : []; + } } diff --git a/module/finc/src/finc/RecordDriver/SolrLidoFincTrait.php b/module/finc/src/finc/RecordDriver/SolrLidoFincTrait.php index 7c4ed314e9a9cc451f2759944192fcad57aac1fd..226e5bd85d1eb46af4dfbe244ca50ac6b31d6b03 100644 --- a/module/finc/src/finc/RecordDriver/SolrLidoFincTrait.php +++ b/module/finc/src/finc/RecordDriver/SolrLidoFincTrait.php @@ -91,4 +91,24 @@ trait SolrLidoFincTrait return $results; } + /** + * Get subject actors + * + * @return array + */ + public function getSubjectActors() + { + $results = []; + foreach ($this->getSimpleXML()->xpath( + 'lido/descriptiveMetadata/objectRelationWrap/subjectWrap/' + . 'subjectSet/subject/subjectActor/actor/nameActorSet/appellationValue' + ) as $node) { + if ('preferred' == (string)$node->attributes()->pref) { + $results[] = (string)$node; + } + } + return $results; + } + + } \ No newline at end of file diff --git a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php index 8b8036b08712363d3ddd8fea4d9c7e03dcc5f938..ed6354e0c7df8d7bee09410330213d6c2c16a83c 100644 --- a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php +++ b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php @@ -51,17 +51,6 @@ trait SolrMarcFincTrait return $this->hasILS(); } - /** - * Get value of genre_facet field - * - * @return string - */ - public function getGenreFacet() - { - return isset($this->fields['genre_facet']) - ? $this->fields['genre_facet'] : ''; - } - /** * Do we have an attached ILS connection and (finc specific) do we want ILS support * for the records source_id and access_facet-value? @@ -1119,9 +1108,7 @@ trait SolrMarcFincTrait } // end foreach } // end foreach - // open to discuss if it is better use $this->addFincIDToRecord($array) or - // RecordLink as ViewHelper at frontend; - return $array; + return $this->addFincIDToRecord($array); } @@ -1286,10 +1273,8 @@ trait SolrMarcFincTrait } } // end foreach } // end foreach - - // open to discuss if it is better use $this->addFincIDToRecord($array) or - // RecordLink as ViewHelper at frontend; - return $array; + + return $this->addFincIDToRecord($array); } /** @@ -1885,39 +1870,23 @@ trait SolrMarcFincTrait /** * Get dissertation notes for the record. * - * @return array + * @return array $retVal */ public function getDissertationNote() { - $tmpArray = []; + $retVal = []; + $subFields = ['a','b','c','d','g']; $field = $this->getMarcRecord()->getFields('502'); foreach ($field as $subfield) { - - $subfieldA = $subfield->getSubField('a'); - if ($subfieldA) { - $tmpArray[] = $subfieldA->getData(); - } - - $subfieldB = $subfield->getSubField('b'); - if ($subfieldB) { - $tmpArray[] = $subfieldB->getData(); - } - - $subfieldC = $subfield->getSubField('c'); - if ($subfieldC) { - $tmpArray[] = $subfieldC->getData(); - } - - $subfieldD = $subfield->getSubField('d'); - if ($subfieldD) { - $tmpArray[] = $subfieldD->getData(); + foreach ($subFields as $fld) { + $sfld = $subfield->getSubField($fld); + if ($sfld) { + $retVal[$fld] = $sfld->getData(); + } } } - $retVal = implode(', ', $tmpArray); - return $retVal; - } /** diff --git a/module/finc/src/finc/View/Helper/Root/Citation.php b/module/finc/src/finc/View/Helper/Root/Citation.php index 31d98172b211d9906b516d4edb07b713aa677ee7..9466d045c97e3defeef9cdb0f4e41615d80add73 100644 --- a/module/finc/src/finc/View/Helper/Root/Citation.php +++ b/module/finc/src/finc/View/Helper/Root/Citation.php @@ -58,6 +58,13 @@ class Citation extends \VuFind\View\Helper\Root\Citation if (!empty($primary)) { $authors[] = $primary; } + if (empty($primary)) { + $additionalAuthors = $driver->tryMethod('getAdditionalAuthors'); + if (!empty($additionalAuthors)) { + foreach ($additionalAuthors as $author) + $authors[] = $author['name']; + } + } $secondary = $driver->tryMethod('getSecondaryAuthors'); if (is_array($secondary) && !empty($secondary)) { $authors = array_unique(array_merge($authors, $secondary)); diff --git a/module/finc/src/finc/View/Helper/Root/ExternalCatalogueLink.php b/module/finc/src/finc/View/Helper/Root/ExternalCatalogueLink.php index e0147949814963638494a09cc65def9fda70cb6b..cb33cd70fbce78899d954d437a67fbe5ac0522f6 100644 --- a/module/finc/src/finc/View/Helper/Root/ExternalCatalogueLink.php +++ b/module/finc/src/finc/View/Helper/Root/ExternalCatalogueLink.php @@ -116,7 +116,7 @@ class ExternalCatalogueLink extends \Zend\View\Helper\AbstractHelper $i = -1; // iterator of extUrls $extUrls = []; - foreach ($this->extCatConf as $recordType => $accessUrl) { + foreach ($this->extCatConf as $recordType => $accessUrls) { $replaceId = null; // get identifier of record id type switch ($recordType) { @@ -129,19 +129,21 @@ class ExternalCatalogueLink extends \Zend\View\Helper\AbstractHelper default: $replaceId = null; } - foreach ($accessUrl as $institution => $v) { - // pre-filter replaceId - if (isset($v['filter'])) { - $isReplaceId = ( - true === $this->filterAccessibilityUrl($v['filter']) - ) ? $replaceId : null; - } - // institution filter - if (true === in_array($institution, $institutions) - && !empty($isReplaceId) - ) { - $extUrls[++$i]['desc'] = $institution; - $extUrls[$i]['url'] = sprintf($v['pattern'], $replaceId); + foreach ($accessUrls as $institution => $accessUrl) { + foreach ($accessUrl as $v) { + // pre-filter replaceId + if (isset($v['filter'])) { + $isReplaceId = ( + true === $this->filterAccessibilityUrl($v['filter']) + ) ? $replaceId : null; + } + // institution filter + if (true === in_array($institution, $institutions) + && !empty($isReplaceId) + ) { + $extUrls[++$i]['desc'] = $institution; + $extUrls[$i]['url'] = sprintf($v['pattern'], $replaceId); + } } } } @@ -160,23 +162,77 @@ class ExternalCatalogueLink extends \Zend\View\Helper\AbstractHelper protected function filterAccessibilityUrl($filter) { foreach ($filter as $driverMethod => $val) { - $resType = gettype($res = $this->driver->tryMethod($driverMethod)); - switch ($resType) { - case "string": - if (is_array($val)) { - return (in_array($res, $val)) ? true : false; - } else { - return ($res == $val) ? true : false; - } - case "array": - if (is_array($val)) { - return (count(array_intersect($res, $val)) > 0) ? true : false; - } else { - return (in_array($val, $res)) ? true : false; - } - default: - return false; + $resType = gettype($res = $this->driver->tryMethod( + ($this->cleanDriverMethod($driverMethod))) + ); + if (false === $this->isFilterExclusive($driverMethod)) { + switch ($resType) { + case "string": + if (is_array($val)) { + return (in_array($res, $val)) ? true : false; + } else { + return ($res == $val) ? true : false; + } + case "array": + if (is_array($val)) { + return (count(array_intersect($res, $val)) > 0) ? true : false; + } else { + return (in_array($val, $res)) ? true : false; + } + default: + return false; + } + // @to-do check if is valid that exclusive filter is poorly the + // negative opposite. Beware of immediately return. + } else { + switch ($resType) { + case "string": + if (is_array($val)) { + return (in_array($res, $val)) ? false : true; + } else { + return ($res == $val) ? false : true; + } + case "array": + if (is_array($val)) { + return (count(array_intersect($res, $val)) > 0) ? false : true; + } else { + return (in_array($val, $res)) ? false : true; + } + default: + return false; + } } } } + + /** + * Check if filter is exclusive than default/standard inclusive. + * + * @param string $driverMethod Value of filter + * + * @return boolean + * @access protected + */ + protected function isFilterExclusive($driverMethod) + { + return (0 < preg_match('/^\-(.*)$/', $driverMethod)) ? true : false; + } + + /** + * Clean driver method from additional functions for call of RecordDriver + * + * @param string $driverMethod Value of filter + * + * @return boolean + * @access protected + */ + protected function cleanDriverMethod($driverMethod) + { + $match = []; + return (0 < preg_match('/^\-(.*)$/', $driverMethod, $match)) + ? $match[1] : $driverMethod; + + } + + } \ No newline at end of file diff --git a/module/finc/src/finc/View/Helper/Root/Factory.php b/module/finc/src/finc/View/Helper/Root/Factory.php index 0501b70ebb1d9c5b53c7aa119b06119e9bad6757..e34aa96f46ea39528ec4bc875799d1a57bf925bf 100644 --- a/module/finc/src/finc/View/Helper/Root/Factory.php +++ b/module/finc/src/finc/View/Helper/Root/Factory.php @@ -65,13 +65,19 @@ class Factory */ public static function getRecord(ServiceManager $sm) { - return new Record( + $return = new Record( $sm->getServiceLocator()->get('VuFind\Config')->get('config'), $sm->get('url'), $sm->getServiceLocator()->get('VuFind\AuthManager'), $sm->getServiceLocator()->get('finc\Rewrite'), $sm->getServiceLocator()->get('VuFind\Config')->get('Resolver') ); + + //due to https://github.com/vufind-org/vufind/pull/718 + //we have to explicitly add the cover router (cf. # + $return->setCoverRouter($sm->getServiceLocator()->get('VuFind\Cover\Router')); + + return $return; } /** diff --git a/module/finc/src/finc/View/Helper/Root/Record.php b/module/finc/src/finc/View/Helper/Root/Record.php index 9f18c3912678c2ebb852c1326ad8186ede8c9bcf..78a21b4606f9d15982e23842de4886cfa2535575 100644 --- a/module/finc/src/finc/View/Helper/Root/Record.php +++ b/module/finc/src/finc/View/Helper/Root/Record.php @@ -301,7 +301,7 @@ class Record extends \VuFind\View\Helper\Root\Record } foreach ($links as &$link) { - $link['url'] = $this->rewriteLink($link['url']); + $link = $this->rewriteLink($link); } return $links; @@ -314,36 +314,64 @@ class Record extends \VuFind\View\Helper\Root\Record * * @access protected * @return string $link Return processed link. + * + * @to-do resolve non consistently behaviour between method pattern and remove + * to handle slashes in urls */ - protected function rewriteLink($link) + protected function rewriteLink(&$link) { $rewrite = $this->config->LinksRewrite->toArray(); foreach ($rewrite as $r) { // is pattern set so try rewrite url - if (isset($r['pattern'])) { + if (isset($r['pattern']) || $r['remove']) { + // is remove pattern than suppress link refs #10834 + if (isset($r['remove'])) { + if (0 != preg_match( + '/' . addcslashes($r['remove'], '/') . '/i', + trim($link['url']) + ) + ) { + unset($link); + return; + } + } // is search and replace set so try to rewrite url if (isset($r['search']) && isset($r['replace'])) { // check if pattern exists. if at least one match than continue - if (0 != preg_match('/' . $r['pattern'] . '/i', trim($link))) { + if (0 != preg_match( + '/' . $r['pattern'] . '/i', trim($link['url']) + ) + ) { // prepare search pattern // should be free of conflicting meta characters - $pattern = str_replace(array('.'), array('\.'), $r['search']); + $pattern + = str_replace(array('.'), array('\.'), $r['search']); $pattern = '/(' . $pattern . ')/i'; // replace it only one time - $link = preg_replace($pattern, trim($r['replace']), trim($link), 1, $count); + $link + = preg_replace( + $pattern, + trim($r['replace']), + trim($link['url']), + 1, + $count + ); // add http if needed - // @todo make it https compatible - if (!preg_match('/^(http:\/\/)/', $link)) { - $link = 'http://' . $link; + // @to-do make it https compatible + if (!preg_match('/^(http:\/\/)/', $link['url'])) { + $link['url'] = 'http://' . $link['url']; } } } // is method set so call alternatively method proceed link if (isset($r['method']) && method_exists($this, $r['method'])) { /* && $count > 0) { @todo fix */ - if (0 != preg_match('/' . $r['pattern'] . '/i', trim($link))) { - $link = $this->$r['method']($link); + if (0 != preg_match( + '/' . $r['pattern'] . '/i', trim($link['url']) + ) + ) { + $link['url'] = $this->$r['method']($link['url']); } } // end if isset method diff --git a/themes/finc/images/noCover2.gif b/themes/finc/images/noCover2.gif index 6f10ce2f52e3fb8ee36e0dbc089cfdc96231ce21..5bc53f718151000dd685308578bf334338cc785e 100644 Binary files a/themes/finc/images/noCover2.gif and b/themes/finc/images/noCover2.gif differ diff --git a/themes/finc/scss/_customVariables.scss b/themes/finc/scss/_customVariables.scss index 2f0d335a1c901b23f4d39cee0f4907c883d9e424..db702e66fd6b2b8d1c83cdc2c32d2d38aa737622 100644 --- a/themes/finc/scss/_customVariables.scss +++ b/themes/finc/scss/_customVariables.scss @@ -159,7 +159,9 @@ $sidebar-item-active-hover-bg: transparentize($brand-primary, .1) !default; $grid-gutter-width: 30px !default; //// Navbar gets a minimum-height of 50px by default, activate and change here! -//// for fixed navbars, the body requires a padding-bottom of the same height as the navbar +//// For fixed navbars ('navbar-fixed-top' in 'header.phtml'), the body requires a padding-bottom of the same height as the navbar because of postition.fixed +//// When using 'affix' instead of 'navbar-fixed-top', set '$navbar-height', '$navbar-height-xs' and '$navbar-height-sm' to '=0' +//// or set the paddings-top under 'body' in compiled.scss to '=0'; see also the comment in header.phtml $navbar-height: 80px !default; $navbar-height-sm: $navbar-height / 2 !default; //// Set navbar-height for small devices, USE px as rem will throw an error in conjunction _variables.scss diff --git a/themes/finc/scss/compiled.scss b/themes/finc/scss/compiled.scss index 57271f258a98d7adeeb201b148f44e743a78ed8a..30003eb8d3ebf58a03bc35f5b8bdaff7572c5061 100644 --- a/themes/finc/scss/compiled.scss +++ b/themes/finc/scss/compiled.scss @@ -192,6 +192,19 @@ form { } } +//// Set max-width to make sure boxes don't bleed over the edge on XS (e.g. acquisitionpda, source_id:3 +@media (max-width: $screen-xs-max) { + input, + select, + textarea { + max-width: 100%; + } + + .form-control { + max-width: 400px; + } +} + //// Fieldsets fieldset { border: 1px solid $border-color; @@ -768,6 +781,79 @@ table.collapse.in { } } +//// Redi link-resolver traffic lights +.traffic-light { + display: inline; + padding: 0; + vertical-align: middle; + + span { + background-color: $silver; // temporary, will be overwritten by first, second, third items below + border-top: 3px solid transparent; + display: inline-block; + height: 1em; + margin: 0 -3px 0 0; + padding-right: .5rem; + width: 1em; + + &.last { + margin-right: .5em; + } + } + + &.access-denied { + span { + &.first { + background-color: $brand-danger; + } + + &.second { + background-color: $gainsboro; + } + + &.last { + background-color: $gainsboro; + } + } + } + + &.access-limited { + span { + &.first { + background-color: $gainsboro; + } + + &.second { + background-color: $brand-warning; + } + + &.last { + background-color: $gainsboro; + } + } + } + + &.access-open { + span { + + &.first { + background-color: $gainsboro; + } + + &.second { + background-color: $gainsboro; + } + + &.last { + background-color: $brand-success; + } + } + } +} +//// Redi link-resolver traffic lights - END + + + // HEADER and NAVBAR FIXED having the same width as rest of the page // (the header can also run the full width of the viewport!) header, diff --git a/themes/finc/templates/Auth/AbstractBase/resetpassword.phtml b/themes/finc/templates/Auth/AbstractBase/resetpassword.phtml index e3536d96e446bd1837f118b4c6eb47d4a6461aa8..84a59fd28f2ff87fa13fcc6297082639100c7ba6 100644 --- a/themes/finc/templates/Auth/AbstractBase/resetpassword.phtml +++ b/themes/finc/templates/Auth/AbstractBase/resetpassword.phtml @@ -11,25 +11,25 @@ $this->headTitle($this->translate('Reset Password')); </p> <div class="form-group"> - <label class="col-xs-3"><?=$this->transEsc('First Name') ?>:</label> + <label class="col-xs-3 control-label"><?=$this->transEsc('First Name') ?>:</label> <div class="col-xs-7"> <input type="text" class="form-control" name="firstname" <?=isset($firstname) ? 'value="'.$firstname.'" ' : ''?>required /> </div> </div> <div class="form-group"> - <label class="col-xs-3"><?=$this->transEsc('Last Name') ?>:</label> + <label class="col-xs-3 control-label"><?=$this->transEsc('Last Name') ?>:</label> <div class="col-xs-7"> <input type="text" class="form-control" name="lastname" <?=isset($lastname) ? 'value="'.$lastname.'" ' : ''?>required/> </div> </div> <div class="form-group"> - <label class="col-xs-3"><?=$this->transEsc('Username') ?>:</label> + <label class="col-xs-3 control-label"><?=$this->transEsc('Username') ?>:</label> <div class="col-xs-7"> <input type="text" class="form-control" name="username" <?=isset($username) ? 'value="'.$username.'" ' : ''?>required/> </div> </div> <div class="form-group"> - <label class="col-xs-3"><?=$this->transEsc('Email') ?>:</label> + <label class="col-xs-3 control-label"><?=$this->transEsc('Email') ?>:</label> <div class="col-xs-7"> <input type="email" class="form-control" name="email" <?=isset($email) ? 'value="'.$email.'" ' : ''?>required/> </div> diff --git a/themes/finc/templates/Citation/apaai-article.phtml b/themes/finc/templates/Citation/apaai-article.phtml index 506bcbb1828e19e4b000e5285173aedb05510a0b..f97da1bee41b95c06a0c5f2fb70ffbe4eb3728d3 100644 --- a/themes/finc/templates/Citation/apaai-article.phtml +++ b/themes/finc/templates/Citation/apaai-article.phtml @@ -3,5 +3,5 @@ <?=$this->escapeHtml($this->title)?><? if ($this->periodAfterTitle): ?>. <? endif ?> <i><?=$this->escapeHtml($this->journal)?><? if (!empty($this->volume) || !empty($this->issue) || !empty($this->pageRange)): ?>, <? endif; ?> <? if (!empty($this->volume)): ?><?=$this->escapeHtml($this->volume)?><? endif; ?></i><? if (!empty($this->issue)): ?>(<?=$this->escapeHtml($this->issue)?>)<? endif; ?> -<? if (!empty($this->volume) || !empty($this->issue)): ?>. <? endif; ?> +<? if (!empty($this->volume) || !empty($this->issue)): ?>, <? endif; ?> <? if (!empty($this->pageRange)): ?><?=$this->escapeHtml($this->pageRange)?>. <? if (isset($this->doi)): ?>doi:<?=$this->escapeHtml($this->doi)?><? endif; ?><? endif; ?> diff --git a/themes/finc/templates/Citation/mlaai-article.phtml b/themes/finc/templates/Citation/mlaai-article.phtml index ccceb50c16c397ce8682f3f64d10d6df2184a8ff..14955a3ff92e985f53f6fdb0a858bf8421c3ce84 100644 --- a/themes/finc/templates/Citation/mlaai-article.phtml +++ b/themes/finc/templates/Citation/mlaai-article.phtml @@ -7,4 +7,4 @@ <? if (!empty($this->volume) || !empty($this->issue)): ?>)<? endif; ?> <? endif; ?> <? if (!empty($this->pageRange)): ?>: <?=$this->escapeHtml($this->pageRange)?>. <? endif; ?> -<? /*if (!empty($this->year)): ?><? if (!empty($this->publisher)): ?>, <? endif; ?>(<?=$this->escapeHtml($this->year)?>)<? endif;*/ ?><? if (!empty($this->year) || !empty($this->publisher)): ?>.<? endif; ?> +<? /*if (!empty($this->year)): ?><? if (!empty($this->publisher)): ?>, <? endif; ?>(<?=$this->escapeHtml($this->year)?>)<? endif;*/ ?><? if (!empty($this->year) && !empty($this->publisher)): ?>.<? endif; ?> diff --git a/themes/finc/templates/RecordDriver/SolrAI/link-isn.phtml b/themes/finc/templates/RecordDriver/SolrAI/link-isn.phtml index a7fab255f94ff2b86dc3b0274d9e6fdd9d041732..90f7077590e543ff877cd8f3acaf302c1601df50 100644 --- a/themes/finc/templates/RecordDriver/SolrAI/link-isn.phtml +++ b/themes/finc/templates/RecordDriver/SolrAI/link-isn.phtml @@ -1,9 +1,9 @@ <? // use advanced search if we have multiple issns if (is_array($this->lookfor) && count($this->lookfor) > 1) { - $query = '?join=AND&bool0[]=AND&'; + $query = '?join=AND&bool0[]=OR'; foreach ($this->lookfor as $issn) { - $query .= 'lookfor0[]=' . urlencode($issn) . '&type0[]=ISN'; + $query .= '&lookfor0[]=' . urlencode($issn) . '&type0[]=ISN'; } } elseif (count($this->lookfor) == 1) { $query = '?lookfor=%22' . urlencode($this->lookfor[0]) . '%22&type=ISN'; diff --git a/themes/finc/templates/RecordDriver/SolrDefault/core.phtml b/themes/finc/templates/RecordDriver/SolrDefault/core.phtml index de8632095d7828e0a72526b69064333c1582d914..bebac1e6eb2ee9a1ae34e15006f87cf24dbbcd16 100644 --- a/themes/finc/templates/RecordDriver/SolrDefault/core.phtml +++ b/themes/finc/templates/RecordDriver/SolrDefault/core.phtml @@ -184,9 +184,10 @@ if($loggedin = $this->auth()->isLoggedIn()) { <? /* finc: NO getFormats here, but getEdition - END */ ?> <? /* finc: getDissertationNote, CK */ ?> <? $dissertationNote = $this->driver->getDissertationNote(); if (!empty($dissertationNote)): ?> + <? $first = true; $dissertation = ''; foreach ($dissertationNote as $val): $dissertation .= (false === $first) ? ', ' . $val : $val ; $first = false; endforeach; ?> <tr> <th><?=$this->transEsc('Dissertation Note')?>: </th> - <td><?=$dissertationNote?></td> + <td><?=$this->transEsc($dissertation)?></td> </tr> <? endif; ?> <? /* finc: getDissertationNote, CK */ ?> diff --git a/themes/finc/templates/RecordDriver/SolrDefault/list-entry.phtml b/themes/finc/templates/RecordDriver/SolrDefault/list-entry.phtml new file mode 100644 index 0000000000000000000000000000000000000000..4a038c833273d1ea0d82f8312ec3240dd81774fb --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrDefault/list-entry.phtml @@ -0,0 +1,203 @@ +<? + // Set up some convenience variables: + $id = $this->driver->getUniqueId(); + $source = $this->driver->getSourceIdentifier(); + if (isset($this->list) && is_object($this->list)) { + $list_id = $this->list->id; + $user_id = $this->list->user_id; + } else { + $list_id = null; + $user_id = $this->user ? $this->user->id : null; + } + $isEditable = $this->user && $this->user->id === $user_id; + // Thumbnail + $coverDetails = $this->record($this->driver)->getCoverDetails('list-entry', 'medium', $this->recordLink()->getUrl($this->driver)); + $cover = $coverDetails['html']; + $thumbnail = false; + $thumbnailAlignment = $this->record($this->driver)->getThumbnailAlignment('list'); + if ($cover): + ob_start(); ?> + <div class="media-<?=$thumbnailAlignment ?> <?=$this->escapeHtmlAttr($coverDetails['size'])?>"> + <?=$cover ?> + </div> + <? $thumbnail = ob_get_contents(); ?> + <? ob_end_clean(); ?> +<? endif; ?> +<div class="result<? if($this->driver->supportsAjaxStatus()): ?> ajaxItem<? endif ?>"> + <input type="hidden" value="<?=$this->escapeHtmlAttr($id) ?>" class="hiddenId"/> + <input type="hidden" value="<?=$this->escapeHtmlAttr($source) ?>" class="hiddenSource"/> + <div class="checkbox hidden-print"> + <label><?=$this->record($this->driver)->getCheckbox()?></label> + </div> + <div class="media"> + <? if ($thumbnail && $thumbnailAlignment == 'left'): ?> + <?=$thumbnail ?> + <? endif; ?> + <div class="media-body"> + <div class="row short-view"> + <div class="col-sm-8"> + <div class="resultItemLine1"> + <? $missing = $this->driver instanceof \VuFind\RecordDriver\Missing; ?> + <? if (!$missing): ?><a href="<?=$this->recordLink()->getUrl($this->driver)?>" class="getFull" data-view="<?=$this->params->getOptions()->getListViewOption() ?>"><? endif; ?> + <span class="title"><?=$this->record($this->driver)->getTitleHtml()?></span> + <? if (!$missing): ?></a><? endif; ?> + </div> + + <div class="resultItemLine2"> + <? if($this->driver->isCollection()): ?> + <?=implode('<br>', array_map(array($this, 'escapeHtml'), $this->driver->getSummary())); ?> + <? else: ?> + <? $summAuthors = $this->driver->getPrimaryAuthors(); if (!empty($summAuthors)): ?> + <?=$this->transEsc('by')?> + <? $authorCount = count($summAuthors); foreach ($summAuthors as $i => $summAuthor): ?> + <a href="<?=$this->record($this->driver)->getLink('author', $summAuthor)?>"><?=$this->escapeHtml($summAuthor)?></a><?=($i + 1 < $authorCount ? ';' : '') ?> + <? endforeach; ?> + <? endif; ?> + + <? $journalTitle = $this->driver->getContainerTitle(); $summDate = $this->driver->getPublicationDates(); ?> + <? if (!empty($journalTitle)): ?> + <?=!empty($summAuthor) ? '<br/>' : ''?> + <?=/* TODO: handle highlighting more elegantly here */ $this->transEsc('Published in') . ' <a href="' . $this->record($this->driver)->getLink('journaltitle', str_replace(array('{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'), '', $journalTitle)) . '">' . $this->highlight($journalTitle) . '</a>';?> + <?=!empty($summDate) ? ' (' . $this->escapeHtml($summDate[0]) . ')' : ''?> + <? elseif (!empty($summDate)): ?> + <?=!empty($summAuthor) ? '<br/>' : ''?> + <?=$this->transEsc('Published') . ' ' . $this->escapeHtml($summDate[0])?> + <? endif; ?> + <? $summInCollection = $this->driver->getContainingCollections(); if (false && !empty($summInCollection)): ?> + <? foreach ($summInCollection as $collId => $collText): ?> + <div> + <b><?=$this->transEsc("in_collection_label")?></b> + <a class="collectionLinkText" href="<?=$this->url('collection', array('id' => $collId))?>?recordID=<?=urlencode($this->driver->getUniqueID())?>"> + <?=$this->escapeHtml($collText)?> + </a> + </div> + <? endforeach; ?> + <? endif; ?> + <? endif; ?> + </div> + + <div class="last"> + <? if(!$this->driver->isCollection()) { + if ($snippet = $this->driver->getHighlightedSnippet()) { + if (!empty($snippet['caption'])) { + echo '<strong>' . $this->transEsc($snippet['caption']) . ':</strong> '; + } + if (!empty($snippet['snippet'])) { + echo '<span class="quotestart">“</span>...' . $this->highlight($snippet['snippet']) . '...<span class="quoteend">”</span><br/>'; + } + } + } ?> + + <? $listTags = ($this->usertags()->getMode() !== 'disabled') ? $this->driver->getTags( + null === $list_id ? true : $list_id, // get tags for all lists if no single list is selected + $user_id, 'tag' + ) : array(); + ?> + <? if (count($listTags) > 0): ?> + <strong><?=$this->transEsc('Your Tags')?>:</strong> + <? foreach ($listTags as $tag): ?> + <a href="<?=$this->currentPath() . $results->getUrlQuery()->addFacet('tags', $tag->tag)?>"><?=$this->escapeHtml($tag->tag)?></a> + <? endforeach; ?> + <br/> + <? endif; ?> + <? $listNotes = $this->driver->getListNotes($list_id, $user_id); ?> + <? if (count($listNotes) > 0): ?> + <strong><?=$this->transEsc('Notes')?>:</strong> + <? if (count($listNotes) > 1): ?><br/><? endif; ?> + <? foreach ($listNotes as $note): ?> + <?=$this->escapeHtml($note)?><br/> + <? endforeach; ?> + <? endif; ?> + + <? if (count($this->lists) > 0): ?> + <strong><?=$this->transEsc('Saved in')?>:</strong> + <? $i=0;foreach($this->lists as $current): ?> + <a href="<?=$this->url('userList', array('id' => $current->id))?>"><?=$this->escapeHtml($current->title)?></a><? if($i++ < count($this->lists)-1): ?>,<? endif; ?> + <? endforeach; ?> + <br/> + <? endif; ?> + + <div class="callnumAndLocation ajax-availability hidden"> + <? if ($this->driver->supportsAjaxStatus()): ?> + <strong class="hideIfDetailed"><?=$this->transEsc('Call Number')?>:</strong> + <span class="callnumber ajax-availability hidden"> + <?=$this->transEsc('Loading')?>...<br/> + </span> + <strong><?=$this->transEsc('Located')?>:</strong> + <span class="location ajax-availability hidden"> + <?=$this->transEsc('Loading')?>... + </span> + <div class="locationDetails"></div> + <? else: ?> + <? $summCallNo = $this->driver->getCallNumber(); if (!empty($summCallNo)): ?> + <strong><?=$this->transEsc('Call Number')?>:</strong> <?=$this->escapeHtml($summCallNo)?> + <? endif; ?> + <? endif; ?> + </div> + + <? /* We need to find out if we're supposed to display an OpenURL link ($openUrlActive), + but even if we don't plan to display the link, we still want to get the $openUrl + value for use in generating a COinS (Z3988) tag -- see bottom of file. + */ + $openUrl = $this->openUrl($this->driver, 'results'); + $openUrlActive = $openUrl->isActive(); + // Account for replace_other_urls setting + $urls = $this->record($this->driver)->getLinkDetails($openUrlActive); + + if ($openUrlActive || !empty($urls)): + ?> + <? if ($openUrlActive): ?> + <br/> + <?=$openUrl->renderTemplate()?> + <? endif;?> + + <? if (!is_array($urls)) { $urls = array(); } + if(!$this->driver->isCollection()): + foreach ($urls as $current): ?> + <a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>" class="fulltext" target="new"><i class="fa fa-external-link" aria-hidden="true"></i> <?=($current['url'] == $current['desc']) ? $this->transEsc('Get full text') : $this->escapeHtml($current['desc'])?></a> + <? endforeach; ?> + <? endif; ?> + <? endif; ?> + <br/> + + <?=$this->record($this->driver)->getFormatList() ?> + + <? if (!$openUrlActive && empty($urls) && $this->driver->supportsAjaxStatus()): ?> + <span class="status ajax-availability hidden"><?=$this->transEsc('Loading')?>...</span> + <br/><br/> + <? endif; ?> + <?=$this->record($this->driver)->getPreviews()?> + </div> + </div> + + <div class="col-sm-4 right"> + <? if ($isEditable): ?> + <i class="fa fa-fw fa-edit" aria-hidden="true"></i> <a href="<?=$this->url('myresearch-edit')?>?id=<?=urlencode($id)?>&source=<?=urlencode($source)?><? if (!is_null($list_id)):?>&list_id=<?=urlencode($list_id)?><? endif; ?>" class="edit tool"><?=$this->transEsc('Edit')?></a><br/> + <? /* Use a different delete URL if we're removing from a specific list or the overall favorites: */ + $deleteUrl = null === $list_id + ? $this->url('myresearch-favorites') + : $this->url('userList', array('id' => $list_id)); + $deleteUrlGet = $deleteUrl . '?delete=' . urlencode($id) . '&source=' . urlencode($source); + + $dLabel = 'delete-label-' . preg_replace('[\W]','-',$id); + ?> + <div class="dropdown"> + <i class="fa fa-fw fa-trash-o" aria-hidden="true"></i> <a class="dropdown-toggle" id="<?=$dLabel ?>" role="button" data-toggle="dropdown" data-target="#" href="<?=$deleteUrlGet ?>"> + <?=$this->transEsc('Delete') ?> + </a> + <ul class="dropdown-menu" role="menu" aria-labelledby="<?=$dLabel ?>"> + <li><a onClick="$.post('<?=$deleteUrl?>', {'delete':'<?=$this->escapeJs($id) ?>','source':'<?=$this->escapeJs($source) ?>','confirm':true},function(){location.reload(true)})" title="<?=$this->transEsc('confirm_delete_brief')?>"><?=$this->transEsc('confirm_dialog_yes')?></a></li> + <li><a><?=$this->transEsc('confirm_dialog_no')?></a></li> + </ul> + </div> + + <?=$this->driver->supportsCoinsOpenUrl()?'<span class="Z3988" title="'.$this->escapeHtmlAttr($this->driver->getCoinsOpenUrl()).'"></span>':''?> + <? endif; ?> + </div> + </div> + </div> + <? if ($thumbnail && $thumbnailAlignment == 'right'): ?> + <?=$thumbnail ?> + <? endif; ?> + </div> +</div> diff --git a/themes/finc/templates/RecordDriver/SolrMarc/core.phtml b/themes/finc/templates/RecordDriver/SolrMarc/core.phtml index 097488d7bc5b6df97f092616aad0a5a79343858b..122b0aa3670926aad8a984e73a8ac9ff44dddf75 100644 --- a/themes/finc/templates/RecordDriver/SolrMarc/core.phtml +++ b/themes/finc/templates/RecordDriver/SolrMarc/core.phtml @@ -207,9 +207,10 @@ if($loggedin = $this->auth()->isLoggedIn()) { <? /* finc: NO getFormats here, but getEdition - END */ ?> <? /* finc: getDissertationNote, CK */ ?> <? $dissertationNote = $this->driver->getDissertationNote(); if (!empty($dissertationNote)): ?> + <? $first = true; $dissertation = ''; foreach ($dissertationNote as $val): $dissertation .= (false === $first) ? ', ' . $val : $val ; $first = false; endforeach; ?> <tr> <th><?=$this->transEsc('Dissertation Note')?>: </th> - <td><?=$dissertationNote?></td> + <td><?=$this->transEsc($dissertation)?></td> </tr> <? endif; ?> <? /* finc: getDissertationNote, CK */ ?> diff --git a/themes/finc/templates/cart/contents.phtml b/themes/finc/templates/cart/contents.phtml new file mode 100644 index 0000000000000000000000000000000000000000..6830358b126387690e9626e397a2921bc96c1ce0 --- /dev/null +++ b/themes/finc/templates/cart/contents.phtml @@ -0,0 +1,28 @@ +<? $records = $this->cart()->getRecordDetails(); if (!empty($records)): ?> + <hr/> + <ul class="list-unstyled"> + <? foreach ($records as $i => $record): ?> + <li> + <div class="checkbox"> + <label> + <?=$this->record($record)->getCheckbox('cart')?> + <a title="<?=$this->transEsc('View Record')?>" href="<?=$this->recordLink()->getUrl($record)?>" data-lightbox-ignore> + <? + // Collect citation data: + $helper = $this->citation($record); + $recordtype = $record->getRecordType(); + ?> + <? if ($recordtype == 'ai'): ?> + <?=$helper->getCitation('APAAI')?> + <? else: ?> + <?=$helper->getCitation('APA')?> + <? endif; ?> + </a> + </label> + </div> + </li> + <? endforeach; ?> + </ul> +<? else: ?> + <p class="alert alert-info"><?=$this->transEsc('bookbag_is_empty')?>.</p> +<? endif; ?> \ No newline at end of file diff --git a/themes/finc/templates/collection/view.phtml b/themes/finc/templates/collection/view.phtml index e9e6e6d7decb0fb7686dd505519dc066914f1a4f..d1b2dce4227a3ecb41d3aaf05b0a39359b102582 100644 --- a/themes/finc/templates/collection/view.phtml +++ b/themes/finc/templates/collection/view.phtml @@ -99,8 +99,7 @@ $this->layout()->breadcrumbs .= '<li><a href="' . $this->url('collections-home') } ?> <li<?=count($tab_classes) > 0 ? ' class="' . implode(' ', $tab_classes) . '"' : ''?>> - <a class="<?=strtolower($tab)?>" - href="<?=$this->recordLink()->getTabUrl($this->driver, $tab)?>"<? if ($obj->supportsAjax() && in_array($tab, $this->backgroundTabs)): ?> data-background<? endif ?>><?=$this->transEsc($desc)?></a> + <a class="<?=strtolower($tab)?>" href="<?=$this->recordLink()->getTabUrl($this->driver, $tab)?>#tabnav"<? if ($obj->supportsAjax() && in_array($tab, $this->backgroundTabs)): ?> data-background<? endif ?>><?=$this->transEsc($desc)?></a> </li> <? endforeach; ?> </ul> diff --git a/themes/finc/templates/documentdeliveryservice/form.phtml b/themes/finc/templates/documentdeliveryservice/form.phtml index 7024e5d76c2f1b28b82cce70229b292681a60389..f6efd887dc2a6f3c441db128ef371ea14f7c4ed7 100644 --- a/themes/finc/templates/documentdeliveryservice/form.phtml +++ b/themes/finc/templates/documentdeliveryservice/form.phtml @@ -1,3 +1,4 @@ +<!-- finc - documentdeliveryservice -- form --> <div class="row"> <div class="<?=$this->layoutClass('mainbody')?>"> <h2><?=$this->transEsc('DDS::dds_form_headline')?></h2> diff --git a/themes/finc/templates/header.phtml b/themes/finc/templates/header.phtml index 31328a0e0e10061ba6f7e4f3b5cc925c19a87011..eb6c14042b0f45a10b6240217b0e5a884df92a20 100644 --- a/themes/finc/templates/header.phtml +++ b/themes/finc/templates/header.phtml @@ -1,7 +1,13 @@ <!-- finc HEADER --> <? $account = $this->auth()->getManager(); ?> -<? /* This nav element is the sticky element in the header - CK */ ?> +<? /* This nav element is the sticky element in the header - CK; + you can use 'Affix' as an alternative to 'navbar-fixed-top' like so: + <div data-spy="affix" data-offset-top="1" class="navbar"> + Do not use 'navbar-fixed-top' and 'affix* at the same time. + When using 'affix', set the variables for '$navbar-height', '$navbar-height-xs' and '$navbar-height-sm' in _customVariables.scss to '=0' + or set the paddings-top under 'body' in compiled.scss to '=0' + */ ?> <nav class="navbar navbar-fixed-top"> <div class="container-fluid"> diff --git a/themes/finc/templates/myresearch/mylist.phtml b/themes/finc/templates/myresearch/mylist.phtml new file mode 100644 index 0000000000000000000000000000000000000000..82eca59191604a7797ab0662f147709303767a87 --- /dev/null +++ b/themes/finc/templates/myresearch/mylist.phtml @@ -0,0 +1,85 @@ +<? + // Grab list object from search results (if applicable): + $list = $this->results->getListObject(); + + // Set up page title: + $this->headTitle(isset($list) ? $list->title : $this->translate('Favorites')); + + // Set up breadcrumbs: + $currPage = isset($list) ? 'List' : 'Favorites'; + $this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc($currPage) . '</li>'; + + // Load Javascript dependencies into header: + $this->headScript()->appendFile("check_item_statuses.js"); + + // Load Javascript only if list view parameter is NOT full: + if ($this->params->getOptions()->getListViewOption()!="full") { + $this->headScript()->appendFile("record.js"); + $this->headScript()->appendFile("embedded_record.js"); + } + + $recordTotal = $this->results->getResultTotal(); + + // Convenience variable: + $account = $this->auth()->getManager(); + $user = $this->auth()->isLoggedIn(); +?> + +<?=$this->flashmessages()?> + +<div class="row"> + <div class="<?=$this->layoutClass('mainbody')?>"> + <div class="clearfix hidden-print"> + <h2 class="pull-left flip"><?=$list ? $this->escapeHtml($list->title) : $this->transEsc("Your Favorites")?></h2> + <div class="pull-right flip"> + <? if (isset($list)): ?> + <? if ($list->editAllowed($account->isLoggedIn())): ?> + <a href="<?=$this->url('editList', array('id' => $list->id)) ?>" class="btn btn-link"><i class="fa fa-edit" aria-hidden="true"></i> <?=$this->transEsc("edit_list")?></a> + <div class="btn-group"> + <a class="btn btn-link dropdown-toggle" data-toggle="dropdown" href="<?=$this->url('myresearch-deletelist') ?>?listID=<?=urlencode($list->id)?>"> + <i class="fa fa-trash-o" aria-hidden="true"></i> <?=$this->transEsc("delete_list")?> + </a> + <ul class="dropdown-menu"> + <li><a href="<?=$this->url('myresearch-deletelist') ?>?listID=<?=urlencode($list->id)?>&confirm=1"><?=$this->transEsc('confirm_dialog_yes') ?></a></li> + <li><a href="#"><?=$this->transEsc('confirm_dialog_no')?></a></li> + </ul> + </div> + <? endif; ?> + <? elseif ($recordTotal > 0): ?> + <?=$this->transEsc("Showing")?> + <strong><?=$this->localizedNumber($this->results->getStartRecord())?></strong> - <strong><?=$this->localizedNumber($this->results->getEndRecord())?></strong> + <?=$this->transEsc('of')?> <strong><?=$this->localizedNumber($recordTotal)?></strong> + <? endif; ?> + </div> + </div> + <? if ($list && !empty($list->description)): ?> + <p><?=$this->escapeHtml($list->description)?></p> + <? endif; ?> + <? if ($recordTotal > 0): ?> + <div class="resulthead"> + <div class="pull-right flip"> + <?=$this->render('search/controls/limit.phtml')?> + <?=$this->render('search/controls/sort.phtml')?> + </div> + </div> + <form class="form-inline" method="post" name="bulkActionForm" action="<?=$this->url('cart-myresearchbulk')?>" data-lightbox data-lightbox-onsubmit="bulkFormHandler"> + <?=$this->context($this)->renderInContext('myresearch/bulk-action-buttons.phtml', array('idPrefix' => '', 'list' => isset($list) ? $list : null, 'account' => $this->account))?> + <? foreach ($this->results->getResults() as $i=>$current): ?> + <?=$this->record($current)->getListEntry($list, $user)?> + <? endforeach; ?> + </form> + <?=$this->paginationControl($this->results->getPaginator(), 'Sliding', 'search/pagination.phtml', array('results' => $this->results))?> + <? else: ?> + <p><?=$this->transEsc('You do not have any saved resources')?></p> + <? endif; ?> + </div> + + <div class="<?=$this->layoutClass('sidebar')?>"> + <? if ($user): ?> + <?=$this->context($this)->renderInContext("myresearch/menu.phtml", array('active' => isset($list) ? 'list' . $list['id'] : 'favorites'))?> + <? endif; ?> + <? foreach ($this->results->getRecommendations('side') as $current): ?> + <?=$this->recommend($current)?> + <? endforeach; ?> + </div> +</div> diff --git a/themes/finc/templates/record/emailhold.phtml b/themes/finc/templates/record/emailhold.phtml index b62d85c0c115c43cd0715361800a9988ed01f3a8..66764a5d1ab2c7185c5d5c7f5e6856cae71f9485 100644 --- a/themes/finc/templates/record/emailhold.phtml +++ b/themes/finc/templates/record/emailhold.phtml @@ -19,15 +19,15 @@ <? if (in_array("item-issue", $this->extraFields)): ?> <div class="row"> <div id="emailHoldReference" class="emailHoldReference"> - <label class="col-sm-3"><?=$this->transEsc('EmailHold::email_hold_volume')?>:</label> + <label class="col-sm-3 control-label"><?=$this->transEsc('EmailHold::email_hold_volume')?>:</label> <div class="col-sm-9"> <input type="text" name="gatheredDetails[volume]" value="<?=isset($this->gatheredDetails['volume']) ? $this->escapeHtmlAttr($this->gatheredDetails['volume']) : ''?>" class="auto"/><br/> </div> - <label class="col-sm-3"><?=$this->transEsc('EmailHold::email_hold_issue')?>:</label> + <label class="col-sm-3 control-label"><?=$this->transEsc('EmailHold::email_hold_issue')?>:</label> <div class="col-sm-9"> <input type="text" name="gatheredDetails[issue]" value="<?=isset($this->gatheredDetails['issue']) ? $this->escapeHtmlAttr($this->gatheredDetails['issue']) : ''?>" class="auto"/><br/> </div> - <label class="col-sm-3"><?=$this->transEsc('EmailHold::email_hold_year')?>:</label> + <label class="col-sm-3 control-label"><?=$this->transEsc('EmailHold::email_hold_year')?>:</label> <div class="col-sm-9"> <input type="text" name="gatheredDetails[year]" value="<?=isset($this->gatheredDetails['year']) ? $this->escapeHtmlAttr($this->gatheredDetails['year']) : ''?>" class="auto"/><br/> </div> @@ -37,7 +37,7 @@ <? if (in_array("requiredByDate", $this->extraFields)): ?> <div class="row"> - <label class="col-sm-3"><?=$this->transEsc("EmailHold::hold_required_by")?>:</label> + <label class="col-sm-3 control-label"><?=$this->transEsc("EmailHold::hold_required_by")?>:</label> <div class="col-sm-9"> <input id="requiredByDate" type="text" name="gatheredDetails[requiredBy]" value="<?=(isset($this->gatheredDetails['requiredBy']) && !empty($this->gatheredDetails['requiredBy'])) ? $this->escapeHtmlAttr($this->gatheredDetails['requiredBy']) : $this->escapeHtmlAttr($this->defaultRequiredDate)?>" size="8" class="auto"/> (<?=$this->dateTime()->getDisplayDateFormat()?>) @@ -57,7 +57,7 @@ $selected = $this->defaultPickup; } ?> - <label class="col-sm-3"><?=$this->transEsc("EmailHold::pick_up_location")?>:</label> + <label class="col-sm-3 control-label"><?=$this->transEsc("EmailHold::pick_up_location")?>:</label> <div class="col-sm-9"> <select name="gatheredDetails[pickUpLocation]" class="form-control"> <? if ($selected === false): ?> @@ -80,7 +80,7 @@ <? if (in_array("comments", $this->extraFields)): ?> <div class="row"> - <label class="col-sm-3"><?=$this->transEsc("Comments")?>:</label> + <label class="col-sm-3 control-label"><?=$this->transEsc("Comments")?>:</label> <div class="col-sm-9"> <textarea rows="3" cols="20" name="gatheredDetails[comment]" class="auto"><?=isset($this->gatheredDetails['comment']) ? $this->escapeHtml($this->gatheredDetails['comment']) : ''?></textarea> </div> diff --git a/themes/finc/templates/record/pdaform.phtml b/themes/finc/templates/record/pdaform.phtml index 97856b1042ae8136ec687403b614b682e31c5a84..a057f989045a3b852743d5061f117f2257d427d9 100644 --- a/themes/finc/templates/record/pdaform.phtml +++ b/themes/finc/templates/record/pdaform.phtml @@ -17,14 +17,14 @@ <?=$this->translate('PDA::pda_delivery_text')?> </p> <div class="form-group"> - <label class="col-sm-3" for="pdaStatement"><?=$this->transEsc('PDA::pda_form_statement_label')?><span class="required">*</span>:</label> - <div class="col-sm-9"> - <textarea id="pdaStatement" class="auto" name="pdaStatement" rows="5" type="text" cols="50"><?=isset($this->pdaStatement) ? $this->pdaStatement : ''?></textarea> + <label class="col-sm-4 control-label" for="pdaStatement"><?=$this->transEsc('PDA::pda_form_statement_label')?><span class="required">*</span>:</label> + <div class="col-sm-8"> + <textarea id="pdaStatement" class="auto" name="pdaStatement" rows="5" type="text" cols="46"><?=isset($this->pdaStatement) ? $this->pdaStatement : ''?></textarea> </div> </div> <div class="form-group"> - <label class="col-sm-3" for="pdaSubject"><?=$this->transEsc('PDA::pda_form_field_of_study_label')?><span class="required">*</span>:</label> - <div class="col-sm-9"> + <label class="col-sm-4 control-label" for="pdaSubject"><?=$this->transEsc('PDA::pda_form_field_of_study_label')?><span class="required">*</span>:</label> + <div class="col-sm-8"> <select name="pdaFieldOfStudy" class="form-control"> <option value="-1"><?=$this->transEsc('PDA::pda_form_field_of_study_text')?></option> <? if (isset( $this->fieldOfStudyList) && is_array( $this->fieldOfStudyList)): ?> @@ -40,6 +40,8 @@ <span> <?=$this->recaptcha()->html($this->useRecaptcha) ?> </span> + </div> + <div class="col-sm-8 col-sm-push-4"> <div class="btn-group" role="group"> <input type="submit" class="btn btn-primary" role="button" name="submit" value="<?=$this->transEsc('Submit')?>"/> <a class="btn btn-primary" data-lightbox-ignore data-toggle="tooltip" title="<?=$this->transEsc('PDA::pda_open_new_window')?>" href="<?=$this->interlibraryloan()->getSwbLink($this->driver)?>" diff --git a/themes/finc/templates/record/view.phtml b/themes/finc/templates/record/view.phtml index c674692416ac6f4512371631fee30d1731a465b0..d1d2950200cd55d2cc130a4977c91d1c0872732f 100644 --- a/themes/finc/templates/record/view.phtml +++ b/themes/finc/templates/record/view.phtml @@ -94,8 +94,7 @@ $this->layout()->title = $this->driver->getShortTitle(); } ?> <li<?=count($tab_classes) > 0 ? ' class="' . implode(' ', $tab_classes) . '"' : ''?>> - <a class="<?=strtolower($tab)?>" - href="<?=$this->recordLink()->getTabUrl($this->driver, $tab)?>"<? if ($obj->supportsAjax() && in_array($tab, $this->backgroundTabs)): ?> data-background<? endif ?>><?=$this->transEsc($desc)?></a> + <a class="<?=strtolower($tab)?>" href="<?=$this->recordLink()->getTabUrl($this->driver, $tab)?>#tabnav"<? if ($obj->supportsAjax() && in_array($tab, $this->backgroundTabs)): ?> data-background<? endif ?>><?=$this->transEsc($desc)?></a> </li> <? endforeach; ?> </ul> diff --git a/themes/finc/templates/search/advanced/layout.phtml b/themes/finc/templates/search/advanced/layout.phtml index 4a2d84553273a16fd7a507e148e5f442f81638b4..fec216d6d050be502ee5b42950b8f4bfe9ac7221 100644 --- a/themes/finc/templates/search/advanced/layout.phtml +++ b/themes/finc/templates/search/advanced/layout.phtml @@ -101,7 +101,7 @@ <div id="new_group_template"> <? endif; ?> <div id="group<?=$group ?>" class="group row"> - <a href="#" class="group-close hidden" title="<?=$this->transEsc("del_search")?>">×</a> + <a href="javascript:void(0);" class="group-close hidden" title="<?=$this->transEsc("del_search")?>">×</a> <div class="col-sm-9"> <div class="row"> <div class="col-sm-12"> @@ -128,7 +128,7 @@ </div> <div class="col-sm-1 close hidden"> <? /* finc: use tooltip, CK */ ?> - <a class="help-block" href="#" data-toggle="tooltip" title="<?=$this->transEsc("Delete")?>">×</a> + <a class="help-block" href="javascript:void(0);" data-toggle="tooltip" title="<?=$this->transEsc("Delete")?>">×</a> </div> </div> </div>