diff --git a/module/fid/src/View/Helper/Root/GetIt.php b/module/fid/src/View/Helper/Root/GetIt.php index 5c7e2f870abca0fb961db8d3107eff6113700299..00d94c7a5181f51cedce91a849641405aab92656 100644 --- a/module/fid/src/View/Helper/Root/GetIt.php +++ b/module/fid/src/View/Helper/Root/GetIt.php @@ -65,6 +65,7 @@ class GetIt extends AbstractHelper protected $format; protected $facetAvail; protected $multipart; + protected $isCollection; protected $institution; protected $megacollection; protected $collection; @@ -91,7 +92,8 @@ class GetIt extends AbstractHelper $this->sid = $this->driver->tryMethod('getSourceID'); $this->format = $this->driver->tryMethod('getFormats'); $this->facetAvail = $this->driver->tryMethod('getFacetAvail'); - $this->multipart = $this->driver->tryMethod('getMultiPart'); + //$this->multipart = $this->driver->tryMethod('isMultiPartSet'); + $this->isCollection = $this->driver->tryMethod('hasChildren'); $this->institution = $this->driver->tryMethod('getInstitutions'); $this->megacollection = $this->driver->tryMethod('getMegaCollection'); $this->collection = $this->driver->tryMethod('getCollection'); @@ -255,8 +257,8 @@ class GetIt extends AbstractHelper return $this->translate('getit_text_13'); } } - if (preg_grep($this->_getNonSourceIds('source_idsV8_4'), [$this->multipart])) { - return $this->translate('getit_text_11'); + if ($this->isCollection) { + return $this->translate('getit_text_11',['%%hierarchy_tree%%' => $this->translate('hierarchy_tree')]); } if (preg_grep($this->_getNonSourceIds('source_idsV8_7'), $this->megacollection) ) { @@ -296,8 +298,8 @@ class GetIt extends AbstractHelper return $this->translate('getit_text_15'); } } - } elseif (preg_grep($this->_getNonSourceIds('source_idsV8_4'), [$this->multipart])) { - return $this->translate('getit_text_11'); + } elseif ($this->isCollection) { + return $this->translate('getit_text_11',['%%hierarchy_tree%%' => $this->translate('hierarchy_tree')]); } elseif (in_array('Local', $this->facetAvail) && preg_grep($this->_getNonSourceIds('source_idsV8_2'), $this->format) ) { @@ -352,7 +354,7 @@ class GetIt extends AbstractHelper if (in_array($this->sid, $this->_getSourceIds('source_idsV9')) && preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format) && !in_array($this->_getNonSourceIds('source_idsV8_9'), $this->institution) - && !preg_grep($this->_getNonSourceIds('source_idsV8_4'), [$this->multipart]) + && !$this->isCollection && !preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection) ) { return true; @@ -366,9 +368,9 @@ class GetIt extends AbstractHelper public function showPartCopyButton() { if (!in_array('Free', $this->facetAvail) - && in_array($this->sid, $this->_getSourceIds('source_idsV9')) + && in_array($this->sid, $this->_getSourceIds('source_idsV8')) && preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format) - && !preg_grep($this->_getNonSourceIds('source_idsV8_4'), [$this->multipart]) + && !$this->isCollection && !preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection) ) { return true; @@ -383,21 +385,16 @@ class GetIt extends AbstractHelper { if (!in_array('Free', $this->facetAvail) && in_array($this->sid, $this->_getSourceIds('source_idsV8')) - && (!empty($this->isbn) || !empty($this->issn)) + //&& (!empty($this->isbn) || !empty($this->issn)) && !preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection) ) { - if (in_array($this->sid, $this->_getSourceIds('source_idsV9')) - && preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format) + if (preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format) ) { return true; } elseif (in_array('Local', $this->facetAvail) && preg_grep($this->_getNonSourceIds('source_idsV8_3'), $this->format) ) { return true; - } elseif (in_array('Online', $this->facetAvail) - && preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format) - ) { - return true; } } return false; @@ -413,4 +410,20 @@ class GetIt extends AbstractHelper } return false; } + + public function hideNotice() + { + if (in_array($this->sid, $this->_getSourceIds('source_idsV8'))) { + if (in_array('Online', $this->facetAvail) + && preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format) + ) { + return false; + } elseif (in_array('Local', $this->facetAvail) + && preg_grep($this->_getNonSourceIds('source_idsV8_3'), $this->format) + ) { + return false; + } + } + return true; + } }