diff --git a/devops/codecheck/rules/scss-lint.yml b/devops/codecheck/rules/scss-lint.yml new file mode 100644 index 0000000000000000000000000000000000000000..7c7af720314667660f552cb794cf4e500c0970c5 --- /dev/null +++ b/devops/codecheck/rules/scss-lint.yml @@ -0,0 +1,258 @@ +# Default configuration for finc VuFind projects. + +scss_files: "**/*.scss" +plugin_directories: ['.scss-linters'] + +# List of gem names to load custom linters from (make sure they are already +# installed) +plugin_gems: [] + +# Default severity of all linters. +severity: warning + +linters: + BangFormat: + enabled: true + space_before_bang: true + space_after_bang: false + + BemDepth: + enabled: false + max_elements: 1 + + BorderZero: + enabled: true + convention: zero # or `none` + + ChainedClasses: + enabled: false + + ColorKeyword: + enabled: true + + ColorVariable: + enabled: true + + Comment: + enabled: true + style: silent + + DebugStatement: + enabled: true + + DeclarationOrder: + enabled: true + + DisableLinterReason: + enabled: false + + DuplicateProperty: + enabled: true + + ElsePlacement: + enabled: true + style: same_line # or 'new_line' + + EmptyLineBetweenBlocks: + enabled: true + ignore_single_line_blocks: true + + EmptyRule: + enabled: true + + ExtendDirective: + enabled: false + + FinalNewline: + enabled: true + present: true + + HexLength: + enabled: true + style: short # or 'long' + + HexNotation: + enabled: true + style: lowercase # or 'uppercase' + + HexValidation: + enabled: true + + IdSelector: + enabled: false + + ImportantRule: + enabled: true + + ImportPath: + enabled: true + leading_underscore: false + filename_extension: false + + Indentation: + enabled: true + allow_non_nested_indentation: false + character: space # or 'tab' + width: 2 + + LeadingZero: + enabled: true + style: exclude_zero # or 'include_zero' + + MergeableSelector: + enabled: true + force_nesting: true + + NameFormat: + enabled: false + allow_leading_underscore: true + convention: hyphenated_lowercase # or 'camel_case', or 'snake_case', or a regex pattern + + NestingDepth: + enabled: false + max_depth: 5 + ignore_parent_selectors: false + + PlaceholderInExtend: + enabled: true + + PrivateNamingConvention: + enabled: false + prefix: _ + + PropertyCount: + enabled: false + include_nested: false + max_properties: 10 + + PropertySortOrder: + enabled: true + ignore_unspecified: false + min_properties: 2 + separate_groups: false + + PropertySpelling: + enabled: true + extra_properties: [] + disabled_properties: [] + + PropertyUnits: + enabled: true + global: [ + 'ch', 'em', 'ex', 'rem', # Font-relative lengths + 'cm', 'in', 'mm', 'pc', 'pt', 'px', 'q', # Absolute lengths + 'vh', 'vw', 'vmin', 'vmax', # Viewport-percentage lengths + 'deg', 'grad', 'rad', 'turn', # Angle + 'ms', 's', # Duration + 'Hz', 'kHz', # Frequency + 'dpi', 'dpcm', 'dppx', # Resolution + '%'] # Other + properties: {} + + PseudoElement: + enabled: true + + QualifyingElement: + enabled: true + allow_element_with_attribute: false + allow_element_with_class: true + allow_element_with_id: true + + SelectorDepth: + enabled: false + max_depth: 4 + + SelectorFormat: + enabled: false + convention: hyphenated_lowercase # or 'strict_BEM', or 'hyphenated_BEM', or 'snake_case', or 'camel_case', or a regex pattern + + Shorthand: + enabled: true + allowed_shorthands: [1, 2, 3, 4] + + SingleLinePerProperty: + enabled: true + allow_single_line_rule_sets: true + + SingleLinePerSelector: + enabled: true + + SpaceAfterComma: + enabled: true + style: one_space # or 'no_space', or 'at_least_one_space' + + SpaceAfterComment: + enabled: false + style: one_space # or 'no_space', or 'at_least_one_space' + allow_empty_comments: true + + SpaceAfterPropertyColon: + enabled: true + style: one_space # or 'no_space', or 'at_least_one_space', or 'aligned' + + SpaceAfterPropertyName: + enabled: true + + SpaceAfterVariableColon: + enabled: false + style: one_space # or 'no_space', 'at_least_one_space' or 'one_space_or_newline' + + SpaceAfterVariableName: + enabled: true + + SpaceAroundOperator: + enabled: true + style: one_space # or 'at_least_one_space', or 'no_space' + + SpaceBeforeBrace: + enabled: true + style: space # or 'new_line' + allow_single_line_padding: false + + SpaceBetweenParens: + enabled: true + spaces: 0 + + StringQuotes: + enabled: true + style: single_quotes # or double_quotes + + TrailingSemicolon: + enabled: true + + TrailingWhitespace: + enabled: true + + TrailingZero: + enabled: false + + TransitionAll: + enabled: false + + UnnecessaryMantissa: + enabled: true + + UnnecessaryParentReference: + enabled: true + + UrlFormat: + enabled: true + + UrlQuotes: + enabled: true + + VariableForProperty: + enabled: false + properties: [] + + VendorPrefix: + enabled: false + identifier_list: base + additional_identifiers: [] + excluded_identifiers: [] + + ZeroUnit: + enabled: true + + Compass::*: + enabled: false \ No newline at end of file diff --git a/local/config/vufind/facets.ini b/local/config/vufind/facets.ini index bd6a48cea17b71d7dcb6bd7a75c3171580ee8b64..7b4bd79f901f9cf49f1aa23cfb5f04df41ce3cba 100644 --- a/local/config/vufind/facets.ini +++ b/local/config/vufind/facets.ini @@ -141,6 +141,7 @@ dateRange[] = publishDateSort facet_limit = 30 ; Override facet_limit on a per-field basis using this array: ;facet_limit_by_field[format] = 50 +facet_limit_by_field[publishDateSort] = -1 ; By default, the side facets will only show 6 facets and then the "show more" ; button. This can get configured with the showMore settings. @@ -310,12 +311,6 @@ hide_facets = "genre_facet,era_facet,geographic_facet" [SortedByIndex] ;index[] = format -[Results_Settings] -; By default, how many values should we show for each facet? (-1 for no limit) -;facet_limit = 30 -; Override facet_limit on a per-field basis using this array: -facet_limit_by_field[publishDateSort] = -1 - ; Special terms (key), which can't / shouldn't be translated but marked as other language (value) for BARF reasons [LanguageTags] en[] = "American Museum of Natural History" diff --git a/module/fid/src/View/Helper/Root/GetIt.php b/module/fid/src/View/Helper/Root/GetIt.php index acd633cbe679ca8b4ea74a6936870f8d15a57309..7b78c0f57e45f4edeb09ce59bd1c9ebc903f87dd 100644 --- a/module/fid/src/View/Helper/Root/GetIt.php +++ b/module/fid/src/View/Helper/Root/GetIt.php @@ -30,7 +30,6 @@ namespace fid\View\Helper\Root; use VuFind\I18n\Translator\TranslatorAwareTrait; use VuFind\RecordDriver\AbstractBase; use VuFind\Role\PermissionManager; -use VuFind\View\Helper\Root\Config; use Zend\View\Helper\AbstractHelper; /** @@ -46,26 +45,9 @@ class GetIt extends AbstractHelper { use TranslatorAwareTrait; - /* @var \Zend\Config\Config */ - protected $config; - /* @var AbstractBase */ protected $driver; - /* @var array list of available source ID definitions from config */ - protected $sids = [ - 'source_V1_openaccess', - 'source_V3_magazinarticles', - 'source_V4_pda', - 'source_V5_ebl', - 'source_V6_izi', - 'source_V7_margeretlib', - 'source_V8_vkfilmcollection', - 'source_V9_vkfilm2', - 'source_V10_mediaviewweb', - 'source_V11_base', - ]; - /** * FID API Client * @@ -114,7 +96,7 @@ class GetIt extends AbstractHelper * * @var */ - protected $isCollection; + public $isCollection; /** * Solr field institution @@ -151,34 +133,6 @@ class GetIt extends AbstractHelper */ protected $issn; - /** - * Default color of a accordeon - * - * @var - */ - protected $accordeonColorDefault; - - /** - * Second color of the accordeon - * - * @var - */ - protected $accordeonColorAlternative; - - /** - * Default headline text of the get it box - * - * @var - */ - protected $accordeonHeadlineDefault; - - /** - * Second headline text of the get it box - * - * @var - */ - protected $accordeonHeadlineAlternative; - /** * Rules to be evaluated * @@ -189,14 +143,12 @@ class GetIt extends AbstractHelper /** * GetIt constructor. * - * @param $getItConfig Config config * @param $fidClient FIDIS Client * @param $permissionManager Permission Manager * @param $getItRules Config Manager */ - public function __construct($getItConfig, $fidClient, $permissionManager, $getItRules) + public function __construct($fidClient, $permissionManager, $getItRules) { - $this->config = $getItConfig; $this->fidClient = $fidClient; $this->permissionManager = $permissionManager; @@ -228,11 +180,6 @@ class GetIt extends AbstractHelper $this->isbn = $this->driver->tryMethod('getISBNs'); $this->issn = $this->driver->tryMethod('getISSNs'); - $this->accordeonColorDefault = 'azure'; - $this->accordeonColorAlternative = 'amber'; - $this->accordeonHeadlineDefault = $this->translate('getit_infos'); - $this->accordeonHeadlineAlternative = $this->translate('getit_links'); - return $this; } @@ -249,29 +196,28 @@ class GetIt extends AbstractHelper } /** - * Retrieve SIDs from config (getit.ini) + * This function exists so it's easier to adjust settings within the rules evaluator engine * - * @param $value sid - * - * @return array + * @return array context for rules evaluator */ - protected function _getSourceIds($value) + protected function getContext(): array { - $sids = $this->config->SourceIds; - return isset($sids->$value) ? explode(',', $sids->$value) : []; - } - - /** - * Retrieve NonSIDs from config (getit.ini) - * - * @param $value sid - * - * @return string - */ - protected function _getNonSourceIds($value) - { - $sids = $this->config->NonSourceIds; - return $sids->$value ?? ''; + return [ + 'this' => $this, + 'client' => $this->fidClient, + 'permissionmanager' => $this->permissionManager, + 'driver' => $this->driver, + 'sid' => $this->sid, + 'format' => $this->format, + 'facet_avail' => $this->facetAvail, + 'is_collection' => $this->isCollection, + 'institution' => $this->institution, + 'megacollection' => $this->megacollection, + 'collection' => $this->collection, + 'isbn' => $this->isbn, + 'issn' => $this->issn, + 'hasEBookAccess' => $this->hasPermission('fid.EBooks') + ]; } /** @@ -282,112 +228,18 @@ class GetIt extends AbstractHelper */ public function getConfig() { - //set default values - $accordeonColor = $this->accordeonColorDefault; - $accordeonHeadline = $this->accordeonHeadlineDefault; - $boxHeadline = $this->translate('Get it'); - $notice = $this->translate('getit_text_default'); - $showLinks = true; - $showOrderButton = false; - $showPartCopyButton = false; - $showArticleButton = false; - $bossData = false; - $isEBCEBooks = false; - $hideNotice = false; - $isAiSidRecord = false; - $noticeLinkType = 'register'; - - // let specific functions override defaults where necessary - foreach ($this->sids as $sid_config) { - $sid = $this->_getSourceIds($sid_config); - if (current($sid) === 'ALL' || in_array($this->sid, $sid)) { - $dynamic_func = 'get_config_' . $sid_config; - $this->$dynamic_func( - $accordeonColor, - $accordeonHeadline, - $boxHeadline, - $notice, - $showLinks, - $showOrderButton, - $showPartCopyButton, - $showArticleButton, - $bossData, - $isEBCEBooks, - $hideNotice, - $isAiSidRecord, - $noticeLinkType - ); - if ($this->sid !== '0') { - //special case for source ID 0 - // this is th only SID that is contained in multiple configs (V8 + V9) - break; - } - } - } - # injecting rules evaluator for testing - if (isset($this->getItRules)) { - $eval = new \finc\Rules\Evaluator\Evaluator( - array_values($this->getItRules['rules']), - (array)$this->getItRules['stopFlags'] - ); - $rvh = $this->getView()->plugin('record'); - $context = [ - 'this' => $this, - 'client' => $this->fidClient, - 'permissionmanager' => $this->permissionManager, - 'driver' => $this->driver, - 'allowDirectDelivery' => $rvh($this->driver)->allowDirectDelivery(), - 'sid' => $this->sid, - 'format' => $this->format, - 'facet_avail' => $this->facetAvail, - 'is_collection' => $this->isCollection, - 'institution' => $this->institution, - 'megacollection' => $this->megacollection, - 'collection' => $this->collection, - 'isbn' => $this->isbn, - 'issn' => $this->issn, - 'allowDigitizationOnDemand' => $rvh($this->driver)->allowDigitizationOnDemand(), - 'enabledServices' => $this->config->Permission - ]; - // set variables of config in context - foreach ($this->getItRules as $key => $value) { - if ($key != "rules" and $key != "stopFlags") { - $context[$key] = $value; - } + $eval = new \finc\Rules\Evaluator\Evaluator( + array_values($this->getItRules['rules']), + (array)$this->getItRules['stopFlags'] + ); + $context = $this->getContext(); + // set variables of config in context + foreach ($this->getItRules as $key => $value) { + if ($key != "rules" and $key != "stopFlags") { + $context[$key] = $value; } - $context = $eval($context); - - /* tmp checks - TODO: Remove*/ - if ('development' == APPLICATION_ENV || 'testing' == APPLICATION_ENV) { - $checkProps = []; - // Part 1 - array_push($checkProps, 'accordeonColor', 'accordeonHeadline', 'boxHeadline', 'notice'); - // Part 2 - array_push($checkProps, "isAiSidRecord", "hideNotice", "isEBCEBooks", "noticeLinkType", "bossData"); - // Part 3 - array_push($checkProps, "showLinks", "showOrderButton", "showPartCopyButton", "showArticleButton"); - - // just for easier debugging - delete later - $debugComparer = []; - - foreach ($checkProps as $prop) { - if (${$prop} === $context["{$prop}"]) { - $debugComparer[] = $prop . " is identical: " . $context["{$prop}"]; - } else { - $debugComparer[] = $prop . " is '" . $context["{$prop}"] . "', but should be instead: '" . ${$prop} . "'"; - } - - assert( - ${$prop} == $context["{$prop}"], - new \Exception($this->driver->getUniqueID() . ":" . $prop . " is '" . $context["{$prop}"] - . "', but should be instead: '" . ${$prop} . "'") - ); - } - } - /* tmp checks - END */ } - - return $context; + return $eval($context); } /** @@ -412,620 +264,14 @@ class GetIt extends AbstractHelper */ public function out($key) { - return $this->translate("getit_text_{$key}"); - } - - /** - * Open Access - * - * Configuration of SIDs 13,22,26,28,30,34,53,80,84,87,88,99,101,150,153,170 - * - * @param $accordeonColor string accordeon color - * @param $accordeonHeadline string accordeon headline - * @param $boxHeadline string headline text get it box - * @param $notice string text of box version - * @param $showLinks boolean display links - * @param $showOrderButton boolean display order button - * @param $showPartCopyButton boolean display part copy button - * @param $showArticleButton boolean display part copy button - * @param $bossData boolean display data of BOSS webservice - * @param $isEBCEBooks boolean is given record UBL-FID-EBC - * @param $hideNotice boolean hide notice - * @param $isAiSidRecord boolean is given record an ai record - * @param $noticeLinkType string type of link - * - * @return void - */ - public function get_config_source_V1_openaccess( - &$accordeonColor, - &$accordeonHeadline, - &$boxHeadline, - &$notice, - &$showLinks, - &$showOrderButton, - &$showPartCopyButton, - &$showArticleButton, - &$bossData, - &$isEBCEBooks, - &$hideNotice, - &$isAiSidRecord, - &$noticeLinkType - ) { - $accordeonColor = $this->accordeonColorAlternative; - $accordeonHeadline = $this->accordeonHeadlineAlternative; - $notice = $this->translate('getit_text_free_avail'); - } - - /** - * Magazine Articles - * - * Configuration of SID 49,55,68,105 - * - * @param $accordeonColor string accordeon color - * @param $accordeonHeadline string accordeon headline - * @param $boxHeadline string headline text get it box - * @param $notice string text of box version - * @param $showLinks boolean display links - * @param $showOrderButton boolean display order button - * @param $showPartCopyButton boolean display part copy button - * @param $showArticleButton boolean display part copy button - * @param $bossData boolean display data of BOSS webservice - * @param $isEBCEBooks boolean is given record UBL-FID-EBC - * @param $hideNotice boolean hide notice - * @param $isAiSidRecord boolean is given record an ai record - * @param $noticeLinkType string type of link - * - * @return void - */ - public function get_config_source_V3_magazinarticles( - &$accordeonColor, - &$accordeonHeadline, - &$boxHeadline, - &$notice, - &$showLinks, - &$showOrderButton, - &$showPartCopyButton, - &$showArticleButton, - &$bossData, - &$isEBCEBooks, - &$hideNotice, - &$isAiSidRecord, - &$noticeLinkType - ) { - $accordeonColor = $this->accordeonColorAlternative; - $accordeonHeadline = $this->accordeonHeadlineAlternative; - $boxHeadline = $this->fidClient->isLoggedOn() ? - $this->translate('Get it') : $this->translate('getit_logged_not'); - $notice = ''; - $isAiSidRecord = true; - $showArticleButton = $this->config->Permission->allowSubitoArticleCopy ?? true; - } - - /** - * PDA - * - * Configuration of SID 51 - * - * @param $accordeonColor string accordeon color - * @param $accordeonHeadline string accordeon headline - * @param $boxHeadline string headline text get it box - * @param $notice string text of box version - * @param $showLinks boolean display links - * @param $showOrderButton boolean display order button - * @param $showPartCopyButton boolean display part copy button - * @param $showArticleButton boolean display part copy button - * @param $bossData boolean display data of BOSS webservice - * @param $isEBCEBooks boolean is given record UBL-FID-EBC - * @param $hideNotice boolean hide notice - * @param $isAiSidRecord boolean is given record an ai record - * @param $noticeLinkType string type of link - * - * @return void - */ - public function get_config_source_V4_pda( - &$accordeonColor, - &$accordeonHeadline, - &$boxHeadline, - &$notice, - &$showLinks, - &$showOrderButton, - &$showPartCopyButton, - &$showArticleButton, - &$bossData, - &$isEBCEBooks, - &$hideNotice, - &$isAiSidRecord, - &$noticeLinkType - ) { - $boxHeadline = $this->fidClient->isLoggedOn() ? - $this->translate('Get it') : $this->translate('getit_logged_not'); - if ($this->fidClient->isLoggedOn()) { - $notice = $this->translate('getit_text_direct_delivery'); - } else { - $notice = $this->translate('getit_text_free_loan'); - $noticeLinkType = "register"; - } - $showOrderButton = $this->config->Permission->allowPDA ?? true; - } - - /** - * EBL - * - * Configuration of SID 76 - * - * @param $accordeonColor string accordeon color - * @param $accordeonHeadline string accordeon headline - * @param $boxHeadline string headline text get it box - * @param $notice string text of box version - * @param $showLinks boolean display links - * @param $showOrderButton boolean display order button - * @param $showPartCopyButton boolean display part copy button - * @param $showArticleButton boolean display part copy button - * @param $bossData boolean display data of BOSS webservice - * @param $isEBCEBooks boolean is given record UBL-FID-EBC - * @param $hideNotice boolean hide notice - * @param $isAiSidRecord boolean is given record an ai record - * @param $noticeLinkType string type of link - * - * @return void - */ - public function get_config_source_V5_ebl( - &$accordeonColor, - &$accordeonHeadline, - &$boxHeadline, - &$notice, - &$showLinks, - &$showOrderButton, - &$showPartCopyButton, - &$showArticleButton, - &$bossData, - &$isEBCEBooks, - &$hideNotice, - &$isAiSidRecord, - &$noticeLinkType - ) { - $hasEBookAccess = false; - if ($this->fidClient->isLoggedOn()) { - $hasEBookAccess = $this->hasPermission('fid.EBooks'); - } - - $accordeonColor = $this->accordeonColorAlternative; - $accordeonHeadline = $this->accordeonHeadlineAlternative; - if ($this->fidClient->isLoggedOn()) { - if ($hasEBookAccess) { - $notice = $this->translate('getit_text_fidbbi_licence'); - } else { - $notice = $this->translate('getit_text_13b_1'); - $noticeLinkType = "contact"; - } + if ($key == "multipart_mono") { + return $this->translate( + 'getit_text_multipart_mono', + ['%%hierarchy_tree%%' => $this->translate('hierarchy_tree')] + ); } else { - $notice = $this->translate('getit_text_info_req_registry'); - $noticeLinkType = "register"; + return $this->translate("getit_text_{$key}"); } - $boxHeadline = $this->fidClient->isLoggedOn() ? - $this->translate('Get it') : $this->translate('getit_logged_not'); - $showLinks = $this->fidClient->isLoggedOn() && $hasEBookAccess; - } - - /** - * IZI Database - * - * Configuration of SID 78 - * - * @param $accordeonColor string accordeon color - * @param $accordeonHeadline string accordeon headline - * @param $boxHeadline string headline text get it box - * @param $notice string text of box version - * @param $showLinks boolean display links - * @param $showOrderButton boolean display order button - * @param $showPartCopyButton boolean display part copy button - * @param $showArticleButton boolean display part copy button - * @param $bossData boolean display data of BOSS webservice - * @param $isEBCEBooks boolean is given record UBL-FID-EBC - * @param $hideNotice boolean hide notice - * @param $isAiSidRecord boolean is given record an ai record - * @param $noticeLinkType string type of link - * - * @return void - */ - public function get_config_source_V6_izi( - &$accordeonColor, - &$accordeonHeadline, - &$boxHeadline, - &$notice, - &$showLinks, - &$showOrderButton, - &$showPartCopyButton, - &$showArticleButton, - &$bossData, - &$isEBCEBooks, - &$hideNotice, - &$isAiSidRecord, - &$noticeLinkType - ) { - $notice = $this->translate('getit_text_part_not_free'); - } - - /** - * Margaret Herrick Library - * - * Configuration of SID 103 - * - * @param $accordeonColor string accordeon color - * @param $accordeonHeadline string accordeon headline - * @param $boxHeadline string headline text get it box - * @param $notice string text of box version - * @param $showLinks boolean display links - * @param $showOrderButton boolean display order button - * @param $showPartCopyButton boolean display part copy button - * @param $showArticleButton boolean display part copy button - * @param $bossData boolean display data of BOSS webservice - * @param $isEBCEBooks boolean is given record UBL-FID-EBC - * @param $hideNotice boolean hide notice - * @param $isAiSidRecord boolean is given record an ai record - * @param $noticeLinkType string type of link - * - * @return void - */ - public function get_config_source_V7_margeretlib( - &$accordeonColor, - &$accordeonHeadline, - &$boxHeadline, - &$notice, - &$showLinks, - &$showOrderButton, - &$showPartCopyButton, - &$showArticleButton, - &$bossData, - &$isEBCEBooks, - &$hideNotice, - &$isAiSidRecord, - &$noticeLinkType - ) { - $accordeonColor = $this->accordeonColorAlternative; - $accordeonHeadline = $this->accordeonHeadlineAlternative; - $notice = $this->translate('getit_text_nationallicence'); - } - - /** - * VK Film collection - * - * Configuration of SID 0,109,117,119,127,142,148,151,155 - * - * @param $accordeonColor string accordeon color - * @param $accordeonHeadline string accordeon headline - * @param $boxHeadline string headline text get it box - * @param $notice string text of box version - * @param $showLinks boolean display links - * @param $showOrderButton boolean display order button - * @param $showPartCopyButton boolean display part copy button - * @param $showArticleButton boolean display part copy button - * @param $bossData boolean display data of BOSS webservice - * @param $isEBCEBooks boolean is given record UBL-FID-EBC - * @param $hideNotice boolean hide notice - * @param $isAiSidRecord boolean is given record an ai record - * @param $noticeLinkType string type of link - * - * @return void - */ - public function get_config_source_V8_vkfilmcollection( - &$accordeonColor, - &$accordeonHeadline, - &$boxHeadline, - &$notice, - &$showLinks, - &$showOrderButton, - &$showPartCopyButton, - &$showArticleButton, - &$bossData, - &$isEBCEBooks, - &$hideNotice, - &$isAiSidRecord, - &$noticeLinkType - ) { - //accordeon - if (in_array('Free', $this->facetAvail)) { - $accordeonHeadline = $this->accordeonHeadlineAlternative; - $accordeonColor = $this->accordeonColorAlternative; - } elseif (in_array('Online', $this->facetAvail) - && (preg_grep($this->_getNonSourceIds('getit_V8_media_5'), $this->format) - || preg_grep($this->_getNonSourceIds('getit_V8_media_6'), $this->format) - || preg_grep($this->_getNonSourceIds('getit_V8_media_1'), $this->format)) - ) { - $accordeonHeadline = $this->accordeonHeadlineAlternative; - $accordeonColor = $this->accordeonColorAlternative; - } - //END accordeon - //box headline - $isLogin = false; - if (in_array($this->sid, $this->_getSourceIds('source_V9_vkfilm2')) - && preg_grep($this->_getNonSourceIds('getit_V8_collection_2'), $this->collection) - ) {# TODO: find out if ex V8_8 is supposed to be an institution or a format - $isLogin = true; - } elseif (in_array('Local', $this->facetAvail) - && ((preg_grep($this->_getNonSourceIds('getit_V8_media_1'), $this->format) - && !in_array($this->_getNonSourceIds('getit_V8_institute_1'), $this->institution)) - || preg_grep($this->_getNonSourceIds('getit_V8_media_3'), $this->format)) - ) { - $isLogin = true; - } elseif (in_array('Online', $this->facetAvail) - && !in_array('Free', $this->facetAvail) - && (preg_grep($this->_getNonSourceIds('getit_V8_media_1'), $this->format)) - ) { - $isLogin = true; - } - if ($isLogin && !$this->fidClient->isLoggedOn()) { - $boxHeadline = $this->translate('getit_logged_not'); - } - //END boxheadline - //notice - if (in_array($this->sid, $this->_getSourceIds('source_V9_vkfilm2'))) { - if (preg_grep($this->_getNonSourceIds('getit_V8_collection_2'), $this->collection)) { - if (!$this->fidClient->isLoggedOn()) { - $notice = $this->translate('getit_text_info_req_registry'); - } else { - $notice = $this->translate('getit_text_fidbbi_licence'); - } - } elseif ($this->isCollection) { - $notice = $this->translate('getit_text_multipart_mono', ['%%hierarchy_tree%%' => $this->translate('hierarchy_tree')]); - } elseif (preg_grep($this->_getNonSourceIds('getit_V8_megacollection_1'), $this->megacollection) - ) { - $notice = $this->translate('getit_text_free_avail'); - } elseif (in_array('Local', $this->facetAvail) - && (preg_grep($this->_getNonSourceIds('getit_V8_media_1'), $this->format) - || preg_grep($this->_getNonSourceIds('getit_V8_media_3'), $this->format)) - ) { - if (!$this->fidClient->isLoggedOn()) { - $notice = $this->translate('getit_text_info_req_reg'); - $noticeLinkType = "register"; - } elseif (preg_grep($this->_getNonSourceIds('getit_V8_media_3'), $this->format)) { - $notice = $this->translate('getit_text_media_typ_limitation'); - } else { - $notice = ''; - } - } elseif (in_array('Local', $this->facetAvail) - && preg_grep($this->_getNonSourceIds('getit_V8_media_2'), $this->format) - ) { - $notice = $this->translate('getit_text_no_further_info_notice'); - } elseif (in_array('Free', $this->facetAvail)) { - $notice = $this->translate('getit_text_free_avail'); - } elseif (in_array('Online', $this->facetAvail) - && (preg_grep($this->_getNonSourceIds('getit_V8_media_5'), $this->format) - || preg_grep($this->_getNonSourceIds('getit_V8_media_6'), $this->format)) - ) { - $notice = $this->translate('getit_text_online_res_money_hint'); - } elseif (in_array('Online', $this->facetAvail) - && preg_grep($this->_getNonSourceIds('getit_V8_media_1'), $this->format) - ) { - if (!$this->fidClient->isLoggedOn()) { - $notice = $this->translate('getit_text_info_req_reg'); - $noticeLinkType = "register"; - } else { - $notice = $this->translate('getit_text_access_ebook_hint'); - } - } - } elseif ($this->isCollection) { - $notice = $this->translate('getit_text_multipart_mono', ['%%hierarchy_tree%%' => $this->translate('hierarchy_tree')]); - } elseif (in_array('Local', $this->facetAvail) - && preg_grep($this->_getNonSourceIds('getit_V8_media_2'), $this->format) - ) { - $notice = $this->translate('getit_text_no_further_info_notice'); - } elseif (in_array('Local', $this->facetAvail)) { - if (!$this->fidClient->isLoggedOn()) { - $notice = $this->translate('getit_text_info_req_reg'); - $noticeLinkType = "register"; - } elseif (preg_grep($this->_getNonSourceIds('getit_V8_media_3'), $this->format)) { - $notice = $this->translate('getit_text_media_typ_limitation'); - } elseif (!preg_grep($this->_getNonSourceIds('getit_V8_media_7'), $this->format)) { - $notice = ''; - } - } elseif (in_array('Free', $this->facetAvail)) { - $notice = $this->translate('getit_text_free_avail'); - } elseif (in_array('Online', $this->facetAvail) - && (preg_grep($this->_getNonSourceIds('getit_V8_media_5'), $this->format) - || preg_grep($this->_getNonSourceIds('getit_V8_media_6'), $this->format)) - ) { - $notice = $this->translate('getit_text_online_res_money_hint'); - } elseif (in_array('Online', $this->facetAvail) - && preg_grep($this->_getNonSourceIds('getit_V8_media_1'), $this->format) - ) { - if (!$this->fidClient->isLoggedOn()) { - $notice = $this->translate('getit_text_info_req_reg'); - $noticeLinkType = "register"; - } else { - $notice = $this->translate('getit_text_access_ebook_hint'); - } - } - //END notice - //bossData - if (!in_array('Free', $this->facetAvail) - //&& (!empty($this->isbn) || !empty($this->issn)) - && !preg_grep($this->_getNonSourceIds('getit_V8_collection_2'), $this->collection) - ) { - if (!in_array('Online', $this->facetAvail) - && preg_grep($this->_getNonSourceIds('getit_V8_media_1'), $this->format) - ) { - if (!$this->isCollection) { - $showPartCopyButton = $this->config->Permission->allowSubitoPartialCopy ?? true; - } - } - if (preg_grep($this->_getNonSourceIds('getit_V8_media_1'), $this->format) - ) { - $bossData = true; - } elseif (in_array('Local', $this->facetAvail) - && preg_grep($this->_getNonSourceIds('getit_V8_media_3'), $this->format) - ) { - $bossData = true; - } - } - //END bossData - //hideNotice - if ($this->fidClient->isLoggedOn()) { - if (in_array('Local', $this->facetAvail)) { - if (preg_grep($this->_getNonSourceIds('getit_V8_media_1'), $this->format) - && empty($this->isbn) - && !preg_grep($this->_getNonSourceIds('getit_V8_institute_1'), $this->institution) - && !preg_grep($this->_getNonSourceIds('getit_V8_collection_2'), $this->collection) - ) { - $hideNotice = true; - } - if ($this->isCollection) { - $hideNotice = false; - } - } - } - //END hideNotice - } - - /** - * VK Film collection - * - * Configuration of SID 0 (special cases) - * - * @param $accordeonColor string accordeon color - * @param $accordeonHeadline string accordeon headline - * @param $boxHeadline string headline text get it box - * @param $notice string text of box version - * @param $showLinks boolean display links - * @param $showOrderButton boolean display order button - * @param $showPartCopyButton boolean display part copy button - * @param $showArticleButton boolean display part copy button - * @param $bossData boolean display data of BOSS webservice - * @param $isEBCEBooks boolean is given record UBL-FID-EBC - * @param $hideNotice boolean hide notice - * @param $isAiSidRecord boolean is given record an ai record - * @param $noticeLinkType string type of link - * - * @return void - */ - public function get_config_source_V9_vkfilm2( - &$accordeonColor, - &$accordeonHeadline, - &$boxHeadline, - &$notice, - &$showLinks, - &$showOrderButton, - &$showPartCopyButton, - &$showArticleButton, - &$bossData, - &$isEBCEBooks, - &$hideNotice, - &$isAiSidRecord, - &$noticeLinkType - ) { - //accordeon - if (preg_grep($this->_getNonSourceIds('getit_V8_collection_2'), $this->collection) - || preg_grep($this->_getNonSourceIds('getit_V8_megacollection_1'), $this->megacollection) - ) { - $accordeonHeadline = $this->accordeonHeadlineAlternative; - $accordeonColor = $this->accordeonColorAlternative; - } - //END accordeon - //showLinks - if (preg_grep($this->_getNonSourceIds('getit_V8_collection_2'), $this->collection) - ) { - if (!$this->fidClient->isLoggedOn()) { - $showLinks = false; - } - } - //END showLinks - //orderButton - if (in_array('Local', $this->facetAvail) - && preg_grep($this->_getNonSourceIds('getit_V8_media_1'), $this->format) - && !preg_grep($this->_getNonSourceIds('getit_V8_institute_1'), $this->institution) - && !$this->isCollection - && !preg_grep($this->_getNonSourceIds('getit_V8_collection_2'), $this->collection) - ) { - $showOrderButton = $this->config->Permission->allowPDA ?? true; - } - //END orderButton - //EBCEbooks - if (in_array('Online', $this->facetAvail) - && preg_grep($this->_getNonSourceIds('getit_V8_collection_2'), $this->collection) - ) { - $isEBCEBooks = true; - } - //END EBCEbooks - } - - /** - * MediathekViewWeb - * - * Configuration of SID 169 - * - * @param $accordeonColor string accordeon color - * @param $accordeonHeadline string accordeon headline - * @param $boxHeadline string headline text get it box - * @param $notice string text of box version - * @param $showLinks boolean display links - * @param $showOrderButton boolean display order button - * @param $showPartCopyButton boolean display part copy button - * @param $showArticleButton boolean display part copy button - * @param $bossData boolean display data of BOSS webservice - * @param $isEBCEBooks boolean is given record UBL-FID-EBC - * @param $hideNotice boolean hide notice - * @param $isAiSidRecord boolean is given record an ai record - * @param $noticeLinkType string type of link - * - * @return void - */ - public function get_config_source_V10_mediaviewweb( - &$accordeonColor, - &$accordeonHeadline, - &$boxHeadline, - &$notice, - &$showLinks, - &$showOrderButton, - &$showPartCopyButton, - &$showArticleButton, - &$bossData, - &$isEBCEBooks, - &$hideNotice, - &$isAiSidRecord, - &$noticeLinkType - ) { - $accordeonColor = $this->accordeonColorAlternative; - $accordeonHeadline = $this->accordeonHeadlineAlternative; - $notice = $this->translate('getit_text_digital_access_hint'); - } - - /** - * Bielefeld Academic Search Engine (BASE) - * - * Configuration of SID 126 - * - * @param $accordeonColor string accordeon color - * @param $accordeonHeadline string accordeon headline - * @param $boxHeadline string headline text get it box - * @param $notice string text of box version - * @param $showLinks boolean display links - * @param $showOrderButton boolean display order button - * @param $showPartCopyButton boolean display part copy button - * @param $showArticleButton boolean display part copy button - * @param $bossData boolean display data of BOSS webservice - * @param $isEBCEBooks boolean is given record UBL-FID-EBC - * @param $hideNotice boolean hide notice - * @param $isAiSidRecord boolean is given record an ai record - * @param $noticeLinkType string type of link - * - * @return void - */ - public function get_config_source_V11_base( - &$accordeonColor, - &$accordeonHeadline, - &$boxHeadline, - &$notice, - &$showLinks, - &$showOrderButton, - &$showPartCopyButton, - &$showArticleButton, - &$bossData, - &$isEBCEBooks, - &$hideNotice, - &$isAiSidRecord, - &$noticeLinkType - ) { - $notice = $this->translate('getit_text_bielefeld'); } /** diff --git a/module/fid/src/View/Helper/Root/GetItViewHelperFactory.php b/module/fid/src/View/Helper/Root/GetItViewHelperFactory.php index e77c2ff0cceee2daa2366128688c06f95216f9d5..4badef3ad3212105179ea45e55e080297e2e9d31 100644 --- a/module/fid/src/View/Helper/Root/GetItViewHelperFactory.php +++ b/module/fid/src/View/Helper/Root/GetItViewHelperFactory.php @@ -61,7 +61,6 @@ class GetItViewHelperFactory implements FactoryInterface throw new \Exception('Unexpected options sent to factory.'); } return new $requestedName( - $container->get('VuFind\Config')->get('getit'), $container->get(\fid\Service\Client::class), $container->get('VuFind\Role\PermissionManager'), $container->get('VuFind\YamlReader')->get('GetItRules.yaml') diff --git a/module/finc/config/module.config.php b/module/finc/config/module.config.php index 428a1287c507b81be2d2f68e1f3f2a89e605bb96..3f206c21d65272cb09a6290778af66698f39152f 100644 --- a/module/finc/config/module.config.php +++ b/module/finc/config/module.config.php @@ -205,12 +205,10 @@ $config = [ ], 'resolver_driver' => [ 'factories' => [ - 'finc\Resolver\Driver\Ezb' => 'finc\Resolver\Driver\FincResolverDriverFactory', - 'finc\Resolver\Driver\Redi' => 'finc\Resolver\Driver\FincResolverDriverFactory' + 'finc\Resolver\Driver\Ezb' => 'finc\Resolver\Driver\FincResolverDriverFactory' ], 'aliases' => [ - 'ezb' => 'finc\Resolver\Driver\Ezb', - 'redi' => 'finc\Resolver\Driver\Redi' + 'ezb' => 'finc\Resolver\Driver\Ezb' ] ], 'hierarchy_treedataformatter' => [ diff --git a/module/finc/src/finc/ILS/Driver/PAIA.php b/module/finc/src/finc/ILS/Driver/PAIA.php index 39aca6e9c61dd4d78d83216be122c2f8efefc04d..15c6aecc6ff4d3c59ebae586b80e9379d7056ffb 100644 --- a/module/finc/src/finc/ILS/Driver/PAIA.php +++ b/module/finc/src/finc/ILS/Driver/PAIA.php @@ -962,8 +962,11 @@ class PAIA extends \VuFind\ILS\Driver\PAIA // queue (0..1) number of waiting requests for the document or item $result['position'] = ($doc['queue'] ?? null); - // only true if status == 4 - $result['available'] = false; + // status: provided (the document is ready to be used by the patron) + $result['available'] = $doc['status'] == 4 ? true : false; + + // status: reserved (1) and ordered (2) + $result['in_transit'] = $doc['status'] == 1 || $doc['status'] == 2; // about (0..1) textual description of the document $result['title'] = ($doc['about'] ?? null); @@ -1006,9 +1009,6 @@ class PAIA extends \VuFind\ILS\Driver\PAIA ? $this->convertDatetime($doc['endtime']) : ''); } - // status: provided (the document is ready to be used by the patron) - $result['available'] = $doc['status'] == 4 ? true : false; - // Optional VuFind fields /* $result['reqnum'] = null; @@ -1067,8 +1067,11 @@ class PAIA extends \VuFind\ILS\Driver\PAIA // queue (0..1) number of waiting requests for the document or item $result['position'] = ($doc['queue'] ?? null); - // only true if status == 4 - $result['available'] = false; + // status: provided (the document is ready to be used by the patron) + $result['available'] = $doc['status'] == 4 ? true : false; + + // status: reserved (1) and ordered (2) + $result['in_transit'] = $doc['status'] == 1 || $doc['status'] == 2; // about (0..1) textual description of the document $result['title'] = ($doc['about'] ?? null); @@ -1161,6 +1164,15 @@ class PAIA extends \VuFind\ILS\Driver\PAIA $result['duedate'] = (isset($doc['duedate']) ? $this->convertDate($doc['duedate']) : ''); + // From Vufind documentation: + // "dueStatus - A special status – may be 'due' (for items due very + // soon) or 'overdue' (for overdue items). If this is false, empty + // string, or unset, VuFind will assume that items have no special status. + // (optional)." + $result['dueStatus'] = isset($doc['endtime']) && (new \DateTime() > new \DateTime($doc['endtime'])) + ? 'overdue' + : ''; + // cancancel (0..1) whether an ordered or provided document can be // canceled diff --git a/module/finc/src/finc/Resolver/Driver/Redi.php b/module/finc/src/finc/Resolver/Driver/Redi.php deleted file mode 100644 index a75ad7db9a9cbee116ce9a24df82ff677241abed..0000000000000000000000000000000000000000 --- a/module/finc/src/finc/Resolver/Driver/Redi.php +++ /dev/null @@ -1,99 +0,0 @@ -<?php -/** - * ReDi Link Resolver Driver - * - * PHP version 5 - * - * Copyright (C) Leipzig University Library 2015 - * - * @category VuFind - * @package Resolver_Drivers - * @author Robert Lange <lange@ub.uni-leipzig.de> - * @author Gregor Gawol <gawol@ub.uni-leipzig.de> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development:plugins:link_resolver_drivers Wiki - */ -namespace finc\Resolver\Driver; - -use VuFind\Resolver\Driver\Redi as RediBase; -use Zend\Dom\DOMXPath; - -/** - * Redi Link Resolver Driver - * - * @category VuFind - * @package Resolver_Drivers - * @author Robert Lange <lange@ub.uni-leipzig.de> - * @author Gregor Gawol <gawol@ub.uni-leipzig.de> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development:plugins:link_resolver_drivers Wiki - */ -class Redi extends RediBase -{ - - /** - * Constructor - * - * @param string $config redi configuration - * @param \Zend\Http\Client $httpClient HTTP client - */ - public function __construct($config, \Zend\Http\Client $httpClient) - { - $this->baseUrl = $config->url; - $this->httpClient = $httpClient; - } - - /** - * Fetch Links - * - * Fetches a set of links corresponding to an OpenURL - * - * @param string $openURL openURL (url-encoded) - * - * @return string raw XML returned by resolver - */ - public function fetchLinks($openURL) - { - $url = $this->getResolverUrl($openURL); - $feed = $this->httpClient->setUri($url)->send()->getBody(); - return $feed; - } - - /** - * Parse the Redi XML response and return array with DOI information. - * - * @param DOMDocument $xml Loaded xml document - * - * @deprecated with VuFind 9 - cf. https://github.com/vufind-org/vufind/pull/2419 - * @return array Get back a array with title, URL and service_type - */ - protected function parseDOI($xml) - { - $retval = []; - - $xpath = new DOMXPath($xml); - - $doiTerm = $xpath - ->query("//dt[@class='doi_t']"); - $doiDefinition = $xpath - ->query("//dd[@class='doi_d']"); - - if ($doiTerm->length == $doiDefinition->length) { - for ($i = 0; $i < $doiTerm->length; $i++) { - $href = $xpath - ->query(".//@href", $doiDefinition->item($i)) - ->item(0)->textContent; - $retval[] = [ - 'title' => $doiTerm->item($i)->textContent - . $doiDefinition->item($i)->textContent, - 'href' => $href, - 'access' => 'unknown', - 'coverage' => null, - 'service_type' => 'getDOI', - ]; - } - } - - return $retval; - } -} diff --git a/module/finc/tests/unit-tests/src/fincTest/Resolver/Driver/EzbTest.php b/module/finc/tests/unit-tests/src/fincTest/Resolver/Driver/EzbTest.php deleted file mode 100644 index 9841f6a87386e6af50723c016e0f1b1186185313..0000000000000000000000000000000000000000 --- a/module/finc/tests/unit-tests/src/fincTest/Resolver/Driver/EzbTest.php +++ /dev/null @@ -1,101 +0,0 @@ -<?php -/** - * Finc Resolver Ezb Test Class - * - * PHP version 5 - * - * Copyright (C) Leipzig University Library 2017. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * @category Finc - * @package Tests - * @author Robert Lange <lange@ub.uni-leipzig.de> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development:testing:unit_tests Wiki - */ -namespace FincTest\Resolver\Driver\Root; - -use Zend\Http\Client\Adapter\Test as TestAdapter; -use finc\Resolver\Driver\Ezb; - -/** - * Finc Resolver Redi Test Class - * - * @category Finc - * @package Tests - * @author Robert Lange <lange@ub.uni-leipzig.de> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development:testing:unit_tests Wiki - */ -class EzbTest extends \VuFindTest\Resolver\Driver\EzbTest -{ - protected $adapter; - protected $client; - - protected function initEmpty() - { - $this->adapter = new TestAdapter(); - $this->client = new \Zend\Http\Client(); - $this->client->setAdapter($this->adapter); - } - - protected function getInstance($baseUrl = false) - { - $this->initEmpty(); - return $ezb = new Ezb( - $baseUrl !== false ? (object) ['url' => $baseUrl] : (object) $this->openUrlConfig['OpenURL'], - $this->client - ); - } - - public function testGetResolverUrl() - { - $openUrl = "x=1&y=2"; - $this->assertEquals( - "{$this->openUrlConfig['OpenURL']['url']}?$openUrl", - $this->getInstance()->getResolverUrl($openUrl) - ); - } - - public function testGetResolverUrlWithQuestionMarkInBaseUrl() - { - $baseUrl = "{$this->openUrlConfig['OpenURL']['url']}?site=xyz"; - $openUrl = "x=1&y=2"; - $this->assertEquals("$baseUrl&$openUrl", $this->getInstance($baseUrl)->getResolverUrl($openUrl)); - } - - public function testGetResolverUrlNoParams() - { - $this->assertEquals($this->openUrlConfig['OpenURL']['url'], $this->getInstance()->getResolverUrl("")); - } - - public function testEmptyBaseUrlException() - { - $this->expectException(\Zend\Config\Exception\InvalidArgumentException::class); - $this->getInstance("")->getResolverUrl("xyz"); - } - - public function testRemoveLeadingConnectorFromOpenUrl() - { - $baseUrl = "http://services.dnb.de/fize-service/gvr/full.xml"; - $openUrl = "&x=1&y=2"; - $this->assertEquals( - "http://services.dnb.de/fize-service/gvr/full.xml?x=1&y=2", - $this->getInstance($baseUrl)->getResolverUrl($openUrl) - ); - - $openUrl = "?x=1&y=2"; - $this->assertEquals( - "http://services.dnb.de/fize-service/gvr/full.xml?x=1&y=2", - $this->getInstance($baseUrl)->getResolverUrl($openUrl) - ); - } -} diff --git a/module/finc/tests/unit-tests/src/fincTest/Resolver/Driver/RediTest.php b/module/finc/tests/unit-tests/src/fincTest/Resolver/Driver/RediTest.php deleted file mode 100644 index 0d375d90e760927d32d70d158b49908de154b2c9..0000000000000000000000000000000000000000 --- a/module/finc/tests/unit-tests/src/fincTest/Resolver/Driver/RediTest.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php -/** - * Finc Resolver Redi Test Class - * - * PHP version 5 - * - * Copyright (C) Leipzig University Library 2017. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * @category Finc - * @package Tests - * @author Robert Lange <lange@ub.uni-leipzig.de> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development:testing:unit_tests Wiki - */ -namespace FincTest\Resolver\Driver\Root; - -use Zend\Http\Client\Adapter\Test as TestAdapter; -use finc\Resolver\Driver\Redi; - -/** - * Finc Resolver Redi Test Class - * - * @category Finc - * @package Tests - * @author Robert Lange <lange@ub.uni-leipzig.de> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development:testing:unit_tests Wiki - */ -class RediTest extends \VuFindTest\Resolver\Driver\RediTest -{ - protected $adapter; - protected $client; - - protected function initEmpty() - { - $this->adapter = new TestAdapter(); - $this->client = new \Zend\Http\Client(); - $this->client->setAdapter($this->adapter); - } - - protected function getInstance($baseUrl = false) - { - $this->initEmpty(); - return $redi = new Redi( - $baseUrl !== false ? $baseUrl : $this->openUrlConfig['OpenURL']['url'], - $this->client - ); - } - - public function testGetResolverUrl() - { - $openUrl = "x=1&y=2"; - $this->assertEquals( - "{$this->openUrlConfig['OpenURL']['url']}?$openUrl", - $this->getInstance()->getResolverUrl($openUrl) - ); - } - - public function testGetResolverUrlWithQuestionMarkInBaseUrl() - { - $baseUrl = "{$this->openUrlConfig['OpenURL']['url']}?site=xyz"; - $openUrl = "x=1&y=2"; - $this->assertEquals("$baseUrl&$openUrl", $this->getInstance($baseUrl)->getResolverUrl($openUrl)); - } - - public function testGetResolverUrlNoParams() - { - $this->assertEquals($this->openUrlConfig['OpenURL']['url'], $this->getInstance()->getResolverUrl("")); - } - - public function testGetResolverUrlWHZ() - { - $openUrl = "rl_site=whz&issn=1941-9511"; - $this->assertEquals( - "http://www.redi-bw.de/links/whz?rl_site=whz&rl_site=whz&issn=1941-9511", - $this->getInstance("http://www.redi-bw.de/links/whz?rl_site=whz")->getResolverUrl($openUrl) - ); - } - - public function testEmptyBaseUrlException() - { - $this->expectException(\Zend\Config\Exception\InvalidArgumentException::class); - $this->getInstance("")->getResolverUrl(""); - } -} diff --git a/themes/finc/js/account_ajax.js b/themes/finc/js/account_ajax.js deleted file mode 100644 index 6f6d3687376ecba195ad5dbef8c6f68c97f55bda..0000000000000000000000000000000000000000 --- a/themes/finc/js/account_ajax.js +++ /dev/null @@ -1,285 +0,0 @@ -/*global userIsLoggedIn, VuFind */ -VuFind.register('account', function Account() { - // Retrieved statuses - var LOADING = -1 * Math.PI; // waiting for request - var MISSING = -2 * Math.PI; // no data available - var INACTIVE = -3 * Math.PI; // status element missing - var _statuses = {}; - - // Account Icons - var ICON_LEVELS = { - "NONE": 0, - "GOOD": 1, - "WARNING": 2, - "DANGER": 3 - }; - var _accountIcons = {}; - _accountIcons[ICON_LEVELS.NONE] = "fa fa-user-circle"; - _accountIcons[ICON_LEVELS.GOOD] = "fa fa-bell text-success"; - _accountIcons[ICON_LEVELS.WARNING] = "fa fa-bell text-warning"; - _accountIcons[ICON_LEVELS.DANGER] = "fa fa-exclamation-triangle text-danger"; - - var _submodules = []; - - var _sessionDataPrefix = "vf-account-status-"; - var _save = function _save(module) { - sessionStorage.setItem( - _sessionDataPrefix + module, - JSON.stringify(_statuses[module]) - ); - }; - - // Clearing save forces AJAX update next page load - var clearCache = function clearCache(name) { - if (typeof name === "undefined") { - for (var sub in _submodules) { - if (Object.prototype.hasOwnProperty.call(_submodules, sub)) { - clearCache(sub); - } - } - } else { - sessionStorage.removeItem(_sessionDataPrefix + name); - } - }; - - var _getStatus = function _getStatus(module) { - return (typeof _statuses[module] === "undefined") ? LOADING : _statuses[module]; - }; - - var _render = function _render() { - var accountStatus = ICON_LEVELS.NONE; - for (var sub in _submodules) { - if (Object.prototype.hasOwnProperty.call(_submodules, sub)) { - var $element = $(_submodules[sub].selector); - if (!$element) { - _statuses[sub] = INACTIVE; - continue; - } - var status = _getStatus(sub); - if (status === MISSING) { - $element.addClass('hidden'); - } else { - $element.removeClass('hidden'); - if (status === LOADING) { - $element.html('<i class="fa fa-spin fa-spinner"></i>'); - } else { - var moduleStatus = _submodules[sub].render($element, _statuses[sub], ICON_LEVELS); - if (moduleStatus > accountStatus) { - accountStatus = moduleStatus; - } - } - } - } - } - $("#account-icon").attr("class", _accountIcons[accountStatus]); - if (accountStatus > ICON_LEVELS.NONE) { - $("#account-icon") - .attr("data-toggle", "tooltip") - .attr("data-placement", "bottom") - .attr("title", VuFind.translate("account_has_alerts")) - .tooltip(); - } else { - $("#account-icon").tooltip("destroy"); - } - }; - var _ajaxLookup = function _ajaxLookup(module) { - $.ajax({ - url: VuFind.path + '/AJAX/JSON?method=' + _submodules[module].ajaxMethod, - dataType: 'json', - data: _submodules[module].data || [] /* finc specific */ - }) - .done(function ajaxLookupDone(response) { - _statuses[module] = response.data; - }) - .fail(function ajaxLookupFail() { - _statuses[module] = MISSING; - }) - .always(function ajaxLookupAlways() { - _save(module); - _render(); - }); - }; - - var _load = function _load(module) { - var $element = $(_submodules[module].selector); - if (!$element) { - _statuses[module] = INACTIVE; - } else { - var json = sessionStorage.getItem(_sessionDataPrefix + module); - var session = typeof json === "undefined" ? null : JSON.parse(json); - if ( - session === null || - session === LOADING || - session === MISSING - ) { - _statuses[module] = LOADING; - _ajaxLookup(module); - } else { - _statuses[module] = session; - } - _render(); - } - }; - - var init = function init() { - // Update information when certain actions are performed - $("#renewals").submit(function clearCheckedOut() { - clearCache("checkedOut"); - }); - $('#cancelHold, [name="placeHold"]').submit(function clearHolds() { - clearCache("holds"); - }); - $('#ILLRequestForm, #cancelILLRequest').submit(function clearHolds() { - clearCache("illRequests"); - }); - $('[name="placeStorageRetrievalRequest"], #cancelStorageRetrievalRequest').submit(function clearStorageRetrievals() { - clearCache("storageRetrievalRequests"); - }); - $("#library_card").change(function clearChangeLibraryCard() { - clearCache(/* all */); - }); - }; - - var register = function register(name, module) { - if (typeof _submodules[name] === "undefined") { - _submodules[name] = typeof module == 'function' ? module() : module; - } - var $el = $(_submodules[name].selector); - if ($el.length > 0) { - $el.removeClass("hidden"); - _statuses[name] = LOADING; - _load(name); - } else { - _statuses[name] = INACTIVE; - } - }; - - return { - init: init, - clearCache: clearCache, - // if user is logged out, clear cache instead of register - register: userIsLoggedIn ? register : clearCache - }; -}); - -$(document).ready(function registerAccountAjax() { - - VuFind.account.register("fines", { - selector: ".fines-status", - ajaxMethod: "getUserFines", - render: function render($element, status, ICON_LEVELS) { - if (status.value === 0) { - $element.addClass("hidden"); - return ICON_LEVELS.NONE; - } - $element.html('<span class="badge overdue">' + status.display + '</span>'); - return ICON_LEVELS.DANGER; - } - }); - - VuFind.account.register("checkedOut", { - selector: ".checkedout-status", - ajaxMethod: "getUserTransactions", - render: function render($element, status, ICON_LEVELS) { - var html = ''; - var level = ICON_LEVELS.NONE; - if (status.ok > 0) { - html += '<span class="badge ok" data-toggle="tooltip" title="' + VuFind.translate('Checked Out Items') + '">' + status.ok + '</span>'; - } - if (status.warn > 0) { - html += '<span class="badge warn" data-toggle="tooltip" title="' + VuFind.translate('renew_item_due_tooltip') + '">' + status.warn + '</span>'; - level = ICON_LEVELS.WARNING; - } - if (status.overdue > 0) { - html += '<span class="badge overdue" data-toggle="tooltip" title="' + VuFind.translate('renew_item_overdue_tooltip') + '">' + status.overdue + '</span>'; - level = ICON_LEVELS.DANGER; - } - $element.html(html); - $('[data-toggle="tooltip"]', $element).tooltip(); - return level; - } - }); - - VuFind.account.register("holds", { - selector: ".holds-status", - ajaxMethod: "getUserHolds", - render: function render($element, status, ICON_LEVELS) { - var level = ICON_LEVELS.NONE; - if (status.available > 0) { - $element.html('<i class="fa fa-bell text-success" data-toggle="tooltip" title="' + VuFind.translate('hold_available') + '"></i>'); - level = ICON_LEVELS.GOOD; - } else if (status.in_transit > 0) { - $element.html('<i class="fa fa-clock-o text-warning" data-toggle="tooltip" title="' + VuFind.translate('request_in_transit') + '"></i>'); - } else { - $element.addClass("holds-status hidden"); - } - $('[data-toggle="tooltip"]', $element).tooltip(); - return level; - } - }); - - VuFind.account.register("illRequests", { - selector: ".illrequests-status", - ajaxMethod: "getUserILLRequests", - render: function render($element, status, ICON_LEVELS) { - var level = ICON_LEVELS.NONE; - if (status.available > 0) { - $element.html('<i class="fa fa-bell text-success" data-toggle="tooltip" title="' + VuFind.translate('ill_request_available') + '"></i>'); - level = ICON_LEVELS.GOOD; - } else if (status.in_transit > 0) { - $element.html('<i class="fa fa-clock-o text-warning" data-toggle="tooltip" title="' + VuFind.translate('request_in_transit') + '"></i>'); - } else { - $element.addClass("holds-status hidden"); - } - $('[data-toggle="tooltip"]', $element).tooltip(); - return level; - } - }); - - VuFind.account.register("storageRetrievalRequests", { - selector: ".storageretrievalrequests-status", - ajaxMethod: "getUserStorageRetrievalRequests", - render: function render($element, status, ICON_LEVELS) { - var level = ICON_LEVELS.NONE; - if (status.available > 0) { - $element.html('<i class="fa fa-bell text-success" data-toggle="tooltip" title="' + VuFind.translate('storage_retrieval_request_available') + '"></i>'); - level = ICON_LEVELS.GOOD; - } else if (status.in_transit > 0) { - $element.html('<i class="fa fa-clock-o text-warning" data-toggle="tooltip" title="' + VuFind.translate('request_in_transit') + '"></i>'); - } else { - $element.addClass("holds-status hidden"); - } - $('[data-toggle="tooltip"]', $element).tooltip(); - return level; - } - }); - - /* finc specific */ - $(document).ready(function () { - var menuItems = $('.itemCount'); - if(menuItems.length === 0) { - return; - } - var countables = new Array; - menuItems.each(function() { - countables.push($(this).attr('id')); - }); - - $.ajax({ - dataType: 'json', - method: 'GET', - url: VuFind.path + '/AJAX/JSON?method=getAdditionalAccountInfo', - data: {'views':countables} - }) - .done(function(response) { - if (response.data.countFines != undefined && response.data.countFines != 0) { - $('#getFinesTotal').text(response.data.countFines); - $('.fines').addClass('red-alert'); - } - $.each(response.data.countViewItems, function (id, itemCount) { - $('#'+id).text('('+itemCount+')'); - }); - }); - }); - /* finc specific - END */ -}); diff --git a/themes/finc/templates/ajax/resolverLink.phtml b/themes/finc/templates/ajax/resolverLink.phtml index f84a2cd4eee2ffbabb071094472cec49f3b5072b..7c9b03763609794a698148ef980bf373666cd400 100644 --- a/themes/finc/templates/ajax/resolverLink.phtml +++ b/themes/finc/templates/ajax/resolverLink.phtml @@ -1,14 +1,35 @@ +<!-- finc - templates - ajax - resolverLink --> <?php if (!empty($link['href'])): ?> - <a href="<?=$this->escapeHtmlAttr($link['href'])?>" title="<?=$this->transEsc($link['service_type'] ?? '')?>"<?=!empty($link['access']) ? ' class="access-' . $link['access'] . '"':''?>> - <?=$this->escapeHtml($link['title'] ?? '')?> - </a> + <?php /* finc-specific change #7986 - CK - traffic light */ ?> + <div class="show-availability"> + <span class="sr-only"> + <?=$this->translate('Availability')?>: <?=$this->transEsc('resolver_link_access_' . $link['access'])?> + </span> + <div aria-hidden="true"<?php if (!empty($link['access'])): ?> data-toggle="tooltip" title="<?=$this->transEsc('resolver_link_access_' . $link['access'])?>" class="traffic-light access-<?=$link['access']?>"<?php endif;?>> + <span class="first"></span> + <span class="second"></span> + <span class="last"></span> + </div> + </div> + <?php /* finc-specific change #7986 - END */ ?> + <?= $this->externalLink( + $this->escapeHtmlAttr($link['href']), + $link['title'] ?? '', + [ + 'title' => $link['service_type'] ?? '', + 'class' => !empty($link['access']) ? 'access-' . $link['access'] : '' + ] + ) ?> + <?php /* finc-specific change #5334 - CK */ ?> + <small> + <?= isset($link['coverage']) ? $this->escapeHtml($link['coverage']) : '' ?> + <?= isset($link['coverageHref']) + ? $this->externalLink($link['coverageHref'], $this->translate('Readme')) + : '' ?> + </small> + <?php /* finc-specific change #5334 - END */ ?> <?php else: ?> - <?=$this->escapeHtml($link['title'] ?? '')?> -<?php endif; ?> -<?php if (!empty($link['coverage'])): ?> - <span class="openurl-coverage"> - <?=$this->escapeHtml($link['coverage'])?> - </span> + <?=isset($link['title'])?$this->escapeHtml($link['title']):''?> <?=isset($link['coverage'])?$this->transEsc($link['coverage']):''?> <?php endif; ?> <?php if (!empty($link['notes'])): ?> <span class="openurl-notes"> @@ -20,3 +41,4 @@ <?=$this->escapeHtml($link['authentication'])?> </span> <?php endif; ?> +<!-- finc - templates - ajax - resolverLink - END --> \ No newline at end of file diff --git a/themes/finc/templates/collection/view.phtml b/themes/finc/templates/collection/view.phtml index 176b98227bbdcf1fe711c5a941c6afcf552f0613..7c0dca05e567a8721057ea1daa3fd7d3c39a4e8a 100644 --- a/themes/finc/templates/collection/view.phtml +++ b/themes/finc/templates/collection/view.phtml @@ -29,11 +29,7 @@ <?=$this->render('record/prev-next.phtml'); ?> <?php endif; ?> -<?php /* DON'T pull the toolbar in here but below, finc-specific, CK */ -/* <?=$this->record($this->driver)->getToolbar()?> -*/ -?> <div class="record"> <?php /* finc - don't use '<?=count($sidebarList) < 1 ? ' solo' : '' ?>' or toolbar won't fit; BS count sidebars but our toolbar isn't counted */ ?> @@ -89,17 +85,6 @@ <?=$this->driver->supportsCoinsOpenURL()?'<span class="Z3988" title="' . $this->escapeHtmlAttr($this->driver->getCoinsOpenURL()) . '"></span>':''?> </div> - - <?php /* pull the toolbar here, finc-specific, CK */ ?> - <?php if (isset($activeTabObj) && is_callable([$activeTabObj, 'getSideRecommendations'])): ?> - <div class="<?= $this->layoutClass('sidebar') ?>" id="myresearch-sidebar"> - - <?= $this->record($this->driver)->getToolbar() ?> - <?php foreach ($activeTabObj->getSideRecommendations() as $current): ?> - <?= $this->recommend($current) ?> - <?php endforeach; ?> - </div> - <?php endif; ?> </div> <?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$(document).ready(recordDocReady);', 'SET'); ?> <!-- finc: collection - view - END --> diff --git a/themes/finc/templates/myresearch/menu.phtml b/themes/finc/templates/myresearch/menu.phtml deleted file mode 100644 index e98fc9528ea9185bc197a1982ae46cd2e9c943f5..0000000000000000000000000000000000000000 --- a/themes/finc/templates/myresearch/menu.phtml +++ /dev/null @@ -1,159 +0,0 @@ -<!-- finc: myresearch - menu --> -<?php - $user = $this->auth()->isLoggedIn(); - $patron = $user ? $this->auth()->getILSPatron() : false; - $capabilityParams = $patron ? ['patron' => $patron] : []; - $ilsOnline = ('ils-none' !== $this->ils()->getOfflineMode()); -?> -<?php /* finc change btn-link to btn-default */ ?> -<button class="close-offcanvas btn btn-default" data-toggle="offcanvas"><?=$this->transEsc('navigate_back') ?></button> -<?php /* finc: change h3 to h2 */ ?> -<h2><?=$this->transEsc('Your Account')?></h2> -<?php /* finc needs to add .facet-group class and classes on sub items for borders - CK */ - /* also adds aria-current for correct menu action */ ?> -<?php /* finc needs to add .facet-group class and classes on sub items for borders - CK */ ?> -<?php /* finc: myreasearch menu as list #19734 */ ?> -<?php /* finc: specify current page menu entry in following elements #19941 */ ?> -<ul class="myresearch-menu account-menu facet-group"> - <?php if ($this->userlist()->getMode() !== 'disabled'): ?> - <li class="facet"> - <a href="<?=$this->url('myresearch-favorites')?>"<?=$this->active == 'favorites' ? ' class="active" aria-current="page"' : ''?>> - <i class="fa fa-fw fa-star" aria-hidden="true"></i> <?=$this->transEsc('Favorites')?> - </a> - </li> - <?php endif; ?> - <?php if ($ilsOnline && $this->ils()->checkCapability('getMyTransactions', $capabilityParams)): ?> - <li class="facet"> - <a href="<?=$this->url('myresearch-checkedout')?>" class="flex checkedout<?=$this->active == 'checkedout' ? ' active' : ''?>" - <?=$this->active == 'checkedout' ? ' aria-current="page"' : ''?> - > - <span class="flex-col"><i class="fa fa-fw fa-book" aria-hidden="true"></i> <?=$this->transEsc('Checked Out Items')?></span> - <span class="checkedout-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span> - <?php /* nxt line finc specific - CK */ ?> - <span id="getMyTransactions" class="itemCount pull-right no-padding"></span> - </a> - </li> - <?php endif; ?> - <?php if ($ilsOnline && $this->ils()->checkFunction('getMyTransactionHistory', $capabilityParams)): ?> - <li class="facet"> - <a href="<?=$this->url('myresearch-historicloans')?>"<?=$this->active == 'historicloans' ? ' class="active" aria-current="page"' : ''?>> - <i class="fa fa-fw fa-history" aria-hidden="true"></i> <?=$this->transEsc('Loan History')?> - </a> - </li> - <?php endif; ?> - <?php if ($ilsOnline && $this->ils()->checkCapability('getMyHolds', $capabilityParams)): ?> - <li class="facet"> - <a href="<?=$this->url('myresearch-holds')?>" class="flex<?=$this->active == 'holds' ? ' active' : ''?>" - <?=$this->active == 'holds' ? ' aria-current="page"' : ''?> - > - <span class="flex-col"><i class="fa fa-fw fa-flag" aria-hidden="true"></i> <?=$this->transEsc('Holds and Recalls')?></span> - <span class="holds-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span> - <?php /* nxt line finc specific - CK */ ?> - <span id="getMyHolds" class="itemCount pull-right no-padding"></span> - </a> - </li> - <?php endif; ?> - <?php if ($ilsOnline && $this->ils()->checkFunction('StorageRetrievalRequests', $capabilityParams)): ?> - <li class="facet"> - <a href="<?=$this->url('myresearch-storageretrievalrequests')?>" class="flex<?=$this->active == 'storageRetrievalRequests' ? ' active' : ''?>" - <?=$this->active == 'storageRetrievalRequests' ? ' aria-current="page"' : ''?> - > - <span class="flex-col"><i class="fa fa-fw fa-archive" aria-hidden="true"></i> <?=$this->transEsc('Storage Retrieval Requests')?></span> - <span class="storageretrievalrequests-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span> - <?php /* nxt line finc specific - CK */ ?> - <span id="getMyStorageRetrievalRequests" class="itemCount pull-right no-padding"></span> - </a> - </li> - <?php endif; ?> - <?php if ($ilsOnline && $this->ils()->checkFunction('ILLRequests', $capabilityParams)): ?> - <li class="facet"> - <a href="<?=$this->url('myresearch-illrequests')?>" class="flex<?=$this->active == 'ILLRequests' ? ' active' : ''?>" - <?=$this->active == 'ILLRequests' ? ' aria-current="page"' : ''?> - > - <span class="flex-col"><i class="fa fa-fw fa-exchange" aria-hidden="true"></i> <?=$this->transEsc('Interlibrary Loan Requests')?></span> - <span class="illrequests-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span> - <?php /* nxt line finc specific - CK */ ?> - <span id="getMyILLRequests" class="itemCount pull-right no-padding"></span> - </a> - </li> - <?php endif; ?> - <?php if ($ilsOnline && $this->ils()->checkCapability('getMyFines', $capabilityParams)): ?> - <li class="facet"> - <a href="<?=$this->url('myresearch-fines')?>" class="flex<?=$this->active == 'fines' ? ' active' : ''?>" - <?=$this->active == 'fines' ? ' aria-current="page"' : ''?> - > - <span class="flex-col"><i class="fa fa-fw fa-usd" aria-hidden="true"></i> <?=$this->transEsc('Fines')?></span> - <span class="fines-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span> - </a> - </li> - <?php endif; ?> - <li class="facet"> - <a href="<?=$this->url('myresearch-profile')?>"<?=$this->active == 'profile' ? ' class="active" aria-current="page"' : ''?>> - <i class="fa fa-fw fa-user" aria-hidden="true"></i> <?=$this->transEsc('Profile')?> - </a> - </li> - <?php if ($ilsOnline && $user && $user->libraryCardsEnabled()): ?> - <li class="facet"> - <a href="<?=$this->url('librarycards-home')?>"<?=$this->active == 'librarycards' ? ' class="active" aria-current="page"' : ''?>> - <i class="fa fa-fw fa-barcode" aria-hidden="true"></i> <?=$this->transEsc('Library Cards')?> - </a> - </li> - <?php endif; ?> - <?php if ($this->overdrive()->showMyContentLink()):?> - <li class="facet"> - <a href="<?=$this->url('overdrive-mycontent')?>"<?=$this->active == 'dgcontent' ? ' class="active"' : ''?>> - <i class="fa fa-fw fa-download" aria-hidden="true"></i> <?=$this->transEsc('Overdrive Content')?> - </a> - </li> - <?php endif; ?> - <?php if ($this->accountCapabilities()->getSavedSearchSetting() === 'enabled'): ?> - <li class="facet"> - <a href="<?=$this->url('search-history')?>?require_login"<?=$this->active == 'history' ? ' class="active" aria-current="page"' : ''?>> - <i class="fa fa-fw fa-search" aria-hidden="true"></i> <?=$this->transEsc('history_saved_searches')?> - </a> - </li> - <?php endif; ?> - <?php if ($user): ?> - <li class="facet"> - <a href="<?=$this->url('myresearch-logout')?>"> - <i class="fa fa-fw fa-sign-out" aria-hidden="true"></i> <?=$this->transEsc("Log Out")?> - </a> - </li> - <?php endif; ?> -</ul> - -<?php if ($user && $this->userlist()->getMode() !== 'disabled'): ?> - <?php /* finc adds '.lists-heading' for styling purposes */ ?> - <h3 class="lists-heading"><?=$this->transEsc('Your Lists')?></h3> - <?php /* finc: change menu into list */ ?> - <ul class="myresearch-menu facet-group"> - <li class="facet"> - <?php /* finc adds aria-current */ ?> - <a href="<?=$this->url('myresearch-favorites')?>"<?=$this->active == 'favorites' ? ' class="active"' : ''?> - <?=$this->active == 'favorites' ? ' aria-current="page"' : ''?> - > - <i class="fa fa-fw fa-star" aria-hidden="true"></i> <?=$this->transEsc('Your Favorites')?> - </a> - </li> - <?php $lists = $user->getLists() ?> - <?php foreach ($lists as $list): ?> - <?php /* finc: keep icon inside + keep braces in badge!; CK*/ ?> - <li class="facet"> - <a href="<?=$this->url('userList', ['id' => $list['id']])?>"<?=$this->active == 'list' . $list['id'] ? ' class="active"' : ''?> - <?=$this->active == 'list' . $list['id'] ? ' aria-current="page"' : ''?> - > - <i class="fa fa-fw fa-star-o" aria-hidden="true"></i> <?=$this->escapeHtml($list['title'])?> - <span class="badge">(<?=$list->cnt?>)</span> - </a> - </li> - <?php endforeach; ?> - <li class="facet"> - <a href="<?=$this->url('editList', ['id' => 'NEW'])?>"<?=$this->active == 'editlist/NEW' ? ' class="active"' : ''?> - <?=$this->active == 'editlist/NEW' ? ' aria-current="page"' : ''?> - > - <i class="fa fa-fw fa-plus" aria-hidden="true"></i> <?=$this->transEsc('Create a List')?> - </a> - </li> - </ul> -<?php endif ?> -<!-- finc: myresearch - menu - END -->