diff --git a/code/carlx_export/carlx_export.jar b/code/carlx_export/carlx_export.jar index 47e1614df0..280321163a 100644 Binary files a/code/carlx_export/carlx_export.jar and b/code/carlx_export/carlx_export.jar differ diff --git a/code/carlx_export/src/com/turning_leaf_technologies/carlx/CarlXExportMain.java b/code/carlx_export/src/com/turning_leaf_technologies/carlx/CarlXExportMain.java index 62ca1a94d8..125250b3b7 100644 --- a/code/carlx_export/src/com/turning_leaf_technologies/carlx/CarlXExportMain.java +++ b/code/carlx_export/src/com/turning_leaf_technologies/carlx/CarlXExportMain.java @@ -85,6 +85,7 @@ public static void main(String[] args) { if (extractSingleWork && singleWorkId == null) { singleWorkId = AspenStringUtils.getInputFromCommandLine("Enter the id of the title to extract"); singleWorkId = StringUtils.replace(singleWorkId,"CARL", ""); + //Strip leading zeroes singleWorkId = Integer.toString(Integer.parseInt(singleWorkId)); } @@ -184,8 +185,6 @@ public static void main(String[] args) { } else { logEntry.incErrors("Did not export holds because connection to the CARL.X database was not established"); } - - processRecordsToReload(indexingProfile, logEntry); } logEntry.setFinished(); @@ -278,7 +277,7 @@ private static void disconnectDatabase(Connection dbConn) { } } - private static void processRecordsToReload(IndexingProfile indexingProfile, IlsExtractLogEntry logEntry) { + private static void loadRecordsToReload(HashSet updatedBibs, IndexingProfile indexingProfile, IlsExtractLogEntry logEntry) { try { PreparedStatement getRecordsToReloadStmt = dbConn.prepareStatement("SELECT * from record_identifiers_to_reload WHERE processed = 0 and type='" + indexingProfile.getName() + "'", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); PreparedStatement markRecordToReloadAsProcessedStmt = dbConn.prepareStatement("UPDATE record_identifiers_to_reload SET processed = 1 where id = ?"); @@ -287,21 +286,17 @@ private static void processRecordsToReload(IndexingProfile indexingProfile, IlsE while (getRecordsToReloadRS.next()) { long recordToReloadId = getRecordsToReloadRS.getLong("id"); String recordIdentifier = getRecordsToReloadRS.getString("identifier"); - org.marc4j.marc.Record marcRecord = getGroupedWorkIndexer(dbConn).loadMarcRecordFromDatabase(indexingProfile.getName(), recordIdentifier, logEntry); - if (marcRecord != null) { - logEntry.incRecordsRegrouped(); - //Regroup the record - String groupedWorkId = getRecordGroupingProcessor(dbConn).processMarcRecord(marcRecord, true, null, getGroupedWorkIndexer(dbConn)); - //Reindex the record - getGroupedWorkIndexer(dbConn).processGroupedWork(groupedWorkId); - } + recordIdentifier = StringUtils.replace(recordIdentifier,"CARL", ""); + //Strip leading zeroes + recordIdentifier = Integer.toString(Integer.parseInt(recordIdentifier)); + updatedBibs.add(recordIdentifier); markRecordToReloadAsProcessedStmt.setLong(1, recordToReloadId); markRecordToReloadAsProcessedStmt.executeUpdate(); numRecordsToReloadProcessed++; } if (numRecordsToReloadProcessed > 0) { - logEntry.addNote("Regrouped " + numRecordsToReloadProcessed + " records marked for reprocessing"); + logEntry.addNote("Loaded " + numRecordsToReloadProcessed + " records marked for reprocessing"); } getRecordsToReloadRS.close(); }catch (Exception e){ @@ -627,6 +622,11 @@ private static int updateRecordsUsingAPI(Connection dbConn, CarlXInstanceInforma } } + //Add any records that have been marked for reprocessing + if (singleWorkId == null) { + loadRecordsToReload(updatedBibs, indexingProfile, logEntry); + } + //Update total products to be processed logEntry.setNumProducts(updatedBibs.size() + createdBibs.size() + deletedBibs.size()); diff --git a/code/cron/cron.jar b/code/cron/cron.jar index 750143647c..4dc3116ca8 100644 Binary files a/code/cron/cron.jar and b/code/cron/cron.jar differ diff --git a/code/cron/src/com/turning_leaf_technologies/cron/DatabaseCleanup.java b/code/cron/src/com/turning_leaf_technologies/cron/DatabaseCleanup.java index 5195cf3b8e..779a2c02ae 100644 --- a/code/cron/src/com/turning_leaf_technologies/cron/DatabaseCleanup.java +++ b/code/cron/src/com/turning_leaf_technologies/cron/DatabaseCleanup.java @@ -440,7 +440,7 @@ private void removeOldSearches(Connection dbConn, Logger logger, CronProcessLogE //Remove old searches try { int rowsRemoved = 0; - ResultSet numSearchesRS = dbConn.prepareStatement("SELECT count(id) from search where created < (CURDATE() - INTERVAL 2 DAY) and saved = 0").executeQuery(); + ResultSet numSearchesRS = dbConn.prepareStatement("SELECT count(id) from search where saved = 0").executeQuery(); numSearchesRS.next(); long numSearches = numSearchesRS.getLong(1); long batchSize = 100000; @@ -448,7 +448,7 @@ private void removeOldSearches(Connection dbConn, Logger logger, CronProcessLogE processLog.addNote("Found " + numSearches + " expired searches that need to be removed. Will process in " + numBatches + " batches"); processLog.saveResults(); for (int i = 0; i < numBatches; i++){ - PreparedStatement searchesToRemove = dbConn.prepareStatement("SELECT id from search where created < (CURDATE() - INTERVAL 2 DAY) and saved = 0 LIMIT 0, " + batchSize, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + PreparedStatement searchesToRemove = dbConn.prepareStatement("SELECT id from search where saved = 0 LIMIT 0, " + batchSize, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); PreparedStatement removeSearchStmt = dbConn.prepareStatement("DELETE from search where id = ?"); ResultSet searchesToRemoveRs = searchesToRemove.executeQuery(); diff --git a/code/evergreen_export/evergreen_export.jar b/code/evergreen_export/evergreen_export.jar index 01e3f872a2..4f629b5a3d 100644 Binary files a/code/evergreen_export/evergreen_export.jar and b/code/evergreen_export/evergreen_export.jar differ diff --git a/code/evergreen_export/src/org/aspendiscovery/evergreen_export/EvergreenExportMain.java b/code/evergreen_export/src/org/aspendiscovery/evergreen_export/EvergreenExportMain.java index 73fcb62a48..21a8cb586b 100644 --- a/code/evergreen_export/src/org/aspendiscovery/evergreen_export/EvergreenExportMain.java +++ b/code/evergreen_export/src/org/aspendiscovery/evergreen_export/EvergreenExportMain.java @@ -180,10 +180,6 @@ public static void main(String[] args) { logEntry.incErrors("Could not load account profile."); } - if (!extractSingleWork) { - processRecordsToReload(indexingProfile, logEntry); - } - if (recordGroupingProcessorSingleton != null) { recordGroupingProcessorSingleton.close(); recordGroupingProcessorSingleton = null; @@ -702,6 +698,8 @@ private synchronized static GroupedWorkIndexer getGroupedWorkIndexer() { private static void processRecordsToReload(IndexingProfile indexingProfile, IlsExtractLogEntry logEntry) { try { + MarcFactory marcFactory = MarcFactory.newInstance(); + PreparedStatement getRecordsToReloadStmt = dbConn.prepareStatement("SELECT * from record_identifiers_to_reload WHERE processed = 0 and type='" + indexingProfile.getName() + "'", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); PreparedStatement markRecordToReloadAsProcessedStmt = dbConn.prepareStatement("UPDATE record_identifiers_to_reload SET processed = 1 where id = ?"); ResultSet getRecordsToReloadRS = getRecordsToReloadStmt.executeQuery(); @@ -709,21 +707,21 @@ private static void processRecordsToReload(IndexingProfile indexingProfile, IlsE while (getRecordsToReloadRS.next()) { long recordToReloadId = getRecordsToReloadRS.getLong("id"); String recordIdentifier = getRecordsToReloadRS.getString("identifier"); - org.marc4j.marc.Record marcRecord = getGroupedWorkIndexer().loadMarcRecordFromDatabase(indexingProfile.getName(), recordIdentifier, logEntry); - if (marcRecord != null){ - logEntry.incRecordsRegrouped(); - //Regroup the record - String groupedWorkId = groupEvergreenRecord(marcRecord); - //Reindex the record - getGroupedWorkIndexer().processGroupedWork(groupedWorkId); - } + updateBibFromEvergreen(recordIdentifier, marcFactory, true); markRecordToReloadAsProcessedStmt.setLong(1, recordToReloadId); markRecordToReloadAsProcessedStmt.executeUpdate(); numRecordsToReloadProcessed++; + + logEntry.incProducts(); + logEntry.incUpdated(); + if (numRecordsToReloadProcessed > 0 && numRecordsToReloadProcessed % 250 == 0) { + getGroupedWorkIndexer().commitChanges(); + logEntry.saveResults(); + } } if (numRecordsToReloadProcessed > 0) { - logEntry.addNote("Regrouped " + numRecordsToReloadProcessed + " records marked for reprocessing"); + logEntry.addNote("Processed " + numRecordsToReloadProcessed + " records marked for reprocessing"); } getRecordsToReloadRS.close(); }catch (Exception e){ @@ -855,6 +853,8 @@ private static int updateRecords() { } } + processRecordsToReload(indexingProfile, logEntry); + return totalChanges; } diff --git a/code/koha_export/koha_export.jar b/code/koha_export/koha_export.jar index 0711c07a92..9b8f6f9cfa 100644 Binary files a/code/koha_export/koha_export.jar and b/code/koha_export/koha_export.jar differ diff --git a/code/koha_export/src/com/turning_leaf_technologies/koha_export/KohaExportMain.java b/code/koha_export/src/com/turning_leaf_technologies/koha_export/KohaExportMain.java index 1c508bcd09..108463596c 100644 --- a/code/koha_export/src/com/turning_leaf_technologies/koha_export/KohaExportMain.java +++ b/code/koha_export/src/com/turning_leaf_technologies/koha_export/KohaExportMain.java @@ -1560,21 +1560,20 @@ private static void processRecordsToReload(IndexingProfile indexingProfile, IlsE while (getRecordsToReloadRS.next()) { long recordToReloadId = getRecordsToReloadRS.getLong("id"); String recordIdentifier = getRecordsToReloadRS.getString("identifier"); - Record marcRecord = getGroupedWorkIndexer().loadMarcRecordFromDatabase(indexingProfile.getName(), recordIdentifier, logEntry); - if (marcRecord != null){ - logEntry.incRecordsRegrouped(); - //Regroup the record - String groupedWorkId = groupKohaRecord(marcRecord); - //Reindex the record - getGroupedWorkIndexer().processGroupedWork(groupedWorkId); - } + logEntry.incProducts(); + updateBibRecord(recordIdentifier); markRecordToReloadAsProcessedStmt.setLong(1, recordToReloadId); markRecordToReloadAsProcessedStmt.executeUpdate(); numRecordsToReloadProcessed++; + + if (numRecordsToReloadProcessed > 0 && numRecordsToReloadProcessed % 250 == 0) { + getGroupedWorkIndexer().commitChanges(); + logEntry.saveResults(); + } } if (numRecordsToReloadProcessed > 0) { - logEntry.addNote("Regrouped " + numRecordsToReloadProcessed + " records marked for reprocessing"); + logEntry.addNote("Processed " + numRecordsToReloadProcessed + " records marked for reprocessing"); logEntry.saveResults(); } getRecordsToReloadRS.close(); diff --git a/code/polaris_export/polaris_export.jar b/code/polaris_export/polaris_export.jar index 204b4dc068..cf0ba95abf 100644 Binary files a/code/polaris_export/polaris_export.jar and b/code/polaris_export/polaris_export.jar differ diff --git a/code/polaris_export/src/com/turning_leaf_technologies/polaris/PolarisExportMain.java b/code/polaris_export/src/com/turning_leaf_technologies/polaris/PolarisExportMain.java index 801e00248e..25a7e702d2 100644 --- a/code/polaris_export/src/com/turning_leaf_technologies/polaris/PolarisExportMain.java +++ b/code/polaris_export/src/com/turning_leaf_technologies/polaris/PolarisExportMain.java @@ -643,21 +643,14 @@ private static void processRecordsToReload(IndexingProfile indexingProfile, IlsE while (getRecordsToReloadRS.next()) { long recordToReloadId = getRecordsToReloadRS.getLong("id"); String recordIdentifier = getRecordsToReloadRS.getString("identifier"); - org.marc4j.marc.Record marcRecord = getGroupedWorkIndexer().loadMarcRecordFromDatabase(indexingProfile.getName(), recordIdentifier, logEntry); - if (marcRecord != null){ - logEntry.incRecordsRegrouped(); - //Regroup the record - String groupedWorkId = groupPolarisRecord(marcRecord); - //Reindex the record - getGroupedWorkIndexer().processGroupedWork(groupedWorkId); - } + updateBibFromPolaris(recordIdentifier, null, 0, true); markRecordToReloadAsProcessedStmt.setLong(1, recordToReloadId); markRecordToReloadAsProcessedStmt.executeUpdate(); numRecordsToReloadProcessed++; } if (numRecordsToReloadProcessed > 0) { - logEntry.addNote("Regrouped " + numRecordsToReloadProcessed + " records marked for reprocessing"); + logEntry.addNote("Processed " + numRecordsToReloadProcessed + " records marked for reprocessing"); logEntry.saveResults(); } getRecordsToReloadRS.close(); @@ -954,7 +947,7 @@ private static int updateBibsFromPolaris(long lastExtractTime) { } logEntry.saveResults(); } catch (Exception e) { - logEntry.incErrors("Unable to parse document for replaced bubs response", e); + logEntry.incErrors("Unable to parse document for replaced bibs response", e); } } diff --git a/code/sierra_export_api/sierra_export_api.jar b/code/sierra_export_api/sierra_export_api.jar index 25fd6c332a..9efea3ddb2 100644 Binary files a/code/sierra_export_api/sierra_export_api.jar and b/code/sierra_export_api/sierra_export_api.jar differ diff --git a/code/sierra_export_api/src/com/turning_leaf_technologies/sierra/SierraExportAPIMain.java b/code/sierra_export_api/src/com/turning_leaf_technologies/sierra/SierraExportAPIMain.java index 142c758330..4d7104c44d 100644 --- a/code/sierra_export_api/src/com/turning_leaf_technologies/sierra/SierraExportAPIMain.java +++ b/code/sierra_export_api/src/com/turning_leaf_technologies/sierra/SierraExportAPIMain.java @@ -189,12 +189,14 @@ public static void main(String[] args){ getBibsAndItemUpdatesFromSierra(sierraInstanceInformation, sierraConn); } + loadRecordsToReload(indexingProfile, logEntry); + logEntry.setNumProducts(allBibsToUpdate.size()); logEntry.saveResults(); numChanges = updateBibs(sierraInstanceInformation); - processRecordsToReload(indexingProfile, logEntry); + if (sierraConn != null){ try{ @@ -355,7 +357,7 @@ private static void disconnectDatabase() { } } - private static void processRecordsToReload(IndexingProfile indexingProfile, IlsExtractLogEntry logEntry) { + private static void loadRecordsToReload(IndexingProfile indexingProfile, IlsExtractLogEntry logEntry) { try { PreparedStatement getRecordsToReloadStmt = dbConn.prepareStatement("SELECT * from record_identifiers_to_reload WHERE processed = 0 and type='" + indexingProfile.getName() + "'", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); PreparedStatement markRecordToReloadAsProcessedStmt = dbConn.prepareStatement("UPDATE record_identifiers_to_reload SET processed = 1 where id = ?"); @@ -364,20 +366,17 @@ private static void processRecordsToReload(IndexingProfile indexingProfile, IlsE while (getRecordsToReloadRS.next()) { long recordToReloadId = getRecordsToReloadRS.getLong("id"); String recordIdentifier = getRecordsToReloadRS.getString("identifier"); - org.marc4j.marc.Record marcRecord = getGroupedWorkIndexer().loadMarcRecordFromDatabase(indexingProfile.getName(), recordIdentifier, logEntry); - if (marcRecord != null){ - //Regroup the record - String groupedWorkId = groupSierraRecord(marcRecord); - //Reindex the record - getGroupedWorkIndexer().processGroupedWork(groupedWorkId); + if (recordIdentifier.startsWith(".b")){ + recordIdentifier = recordIdentifier.substring(2, recordIdentifier.length() -1); } + allBibsToUpdate.add(recordIdentifier); markRecordToReloadAsProcessedStmt.setLong(1, recordToReloadId); markRecordToReloadAsProcessedStmt.executeUpdate(); numRecordsToReloadProcessed++; } if (numRecordsToReloadProcessed > 0) { - logEntry.addNote("Regrouped " + numRecordsToReloadProcessed + " records marked for reprocessing"); + logEntry.addNote("Loaded " + numRecordsToReloadProcessed + " records marked for reprocessing"); } getRecordsToReloadRS.close(); }catch (Exception e){ diff --git a/code/web/Drivers/Koha.php b/code/web/Drivers/Koha.php index 0956e83d20..6885f16a5b 100644 --- a/code/web/Drivers/Koha.php +++ b/code/web/Drivers/Koha.php @@ -277,7 +277,7 @@ function updatePatronInfo($patron, $canUpdateContactInfo, $fromMasquerade = fals $loginResult = $this->loginToKohaOpac($patron); if ($loginResult['success']) { - $updatePage = $this->getKohaPage($catalogUrl . '/cgi-bin/koha/opac-memberentry.pl'); + $updatePage = $this->getKohaPage($catalogUrl . '/cgi-bin/koha/opac-memberentry.pl?DISABLE_SYSPREF_OPACUserCSS=1'); //Get the csr token $csr_token = ''; if (preg_match('%%s', $updatePage, $matches)) { @@ -367,7 +367,7 @@ function updatePatronInfo($patron, $canUpdateContactInfo, $fromMasquerade = fals $postVariables['resendEmail'] = strip_tags($_REQUEST['resendEmail']); } - $postResults = $this->postToKohaPage($catalogUrl . '/cgi-bin/koha/opac-memberentry.pl', $postVariables); + $postResults = $this->postToKohaPage($catalogUrl . '/cgi-bin/koha/opac-memberentry.pl?DISABLE_SYSPREF_OPACUserCSS=1', $postVariables); $messageInformation = []; if (preg_match('%
(.*?)
%s', $postResults, $messageInformation)) { @@ -4476,7 +4476,7 @@ function selfRegister(): array { if ($this->getKohaVersion() < 20.05) { $catalogUrl = $this->accountProfile->vendorOpacUrl; - $selfRegPage = $this->getKohaPage($catalogUrl . '/cgi-bin/koha/opac-memberentry.pl'); + $selfRegPage = $this->getKohaPage($catalogUrl . '/cgi-bin/koha/opac-memberentry.pl?DISABLE_SYSPREF_OPACUserCSS=1'); $captcha = ''; $captchaDigest = ''; $captchaInfo = []; @@ -4540,7 +4540,7 @@ function selfRegister(): array { $postFields['action'] = 'create'; $headers = ['Content-Type: application/x-www-form-urlencoded']; $this->opacCurlWrapper->addCustomHeaders($headers, false); - $selfRegPageResponse = $this->postToKohaPage($catalogUrl . '/cgi-bin/koha/opac-memberentry.pl', $postFields); + $selfRegPageResponse = $this->postToKohaPage($catalogUrl . '/cgi-bin/koha/opac-memberentry.pl?DISABLE_SYSPREF_OPACUserCSS=1', $postFields); $matches = []; if (preg_match('%

Registration Complete!

.*?(.*?).*?(.*?).*?(.*?)%s', $selfRegPageResponse, $matches)) { diff --git a/code/web/RecordDrivers/SideLoadedRecord.php b/code/web/RecordDrivers/SideLoadedRecord.php index 0f675ed19e..87da1c59ff 100644 --- a/code/web/RecordDrivers/SideLoadedRecord.php +++ b/code/web/RecordDrivers/SideLoadedRecord.php @@ -110,8 +110,8 @@ function getEContentFormat($fileOrUrl, $iType) { return ''; } - function createActionsFromUrls($relatedUrls, $itemInfo = null, $variationId = 'any') { - /** @var SideLoad[] $sideLoadSettings */ global $sideLoadSettings; + function createActionsFromUrls($relatedUrls, $itemInfo = null, $variationId = 'any') : array { + global $sideLoadSettings; $sideLoad = $sideLoadSettings[strtolower($this->profileType)]; global $configArray; @@ -146,6 +146,9 @@ function createActionsFromUrls($relatedUrls, $itemInfo = null, $variationId = 'a ]); } $action = $configArray['Site']['url'] . '/' . $this->getModule() . '/' . $this->id . "/AccessOnline?index=$i"; + if ($itemInfo != null) { + $action .= '&itemId=' . $itemInfo->itemId; + } $fileOrUrl = isset($urlInfo['url']) ? $urlInfo['url'] : $urlInfo['file']; if (strlen($fileOrUrl) > 0) { $actions[] = [ @@ -154,6 +157,8 @@ function createActionsFromUrls($relatedUrls, $itemInfo = null, $variationId = 'a 'title' => $title, 'requireLogin' => false, 'target' => '_blank', + 'itemId' => $itemInfo->itemId, + 'index' => $i ]; $i++; } diff --git a/code/web/RecordDrivers/SummonRecordDriver.php b/code/web/RecordDrivers/SummonRecordDriver.php index 6b1749e99c..9987ae9d26 100644 --- a/code/web/RecordDrivers/SummonRecordDriver.php +++ b/code/web/RecordDrivers/SummonRecordDriver.php @@ -24,19 +24,25 @@ public function isValid() { } public function getBookcoverUrl($size='large', $absolutePath = false) { + // require_once ROOT_DIR . '/sys/LibraryLocation/Library.php'; + global $library; + global $configArray; if ($size == 'small' || $size == 'medium'){ $sizeInArray = 'thumbnail_m'; }else{ $sizeInArray = 'thumbnail_l'; } - if (!empty($this->record[$sizeInArray][0])) { - $imageDimensions = getimagesize($this->record[$sizeInArray][0]); - if ($sizeInArray == 'thumbnail_m' && $imageDimensions[0] > 10) { - return $this->record[$sizeInArray][0]; - } elseif ($sizeInArray == 'thumbnail_l' && $imageDimensions[0] > 10) { - return $this->record[$sizeInArray][0]; - } + + if ($library->showAvailableCoversInSummon) { + if(!empty($this->record[$sizeInArray][0])){ + $imagePath = $this->record[$sizeInArray][0]; + + $imageDimensions = getImageSize($imagePath); + if($imageDimensions[0] > 10){ + return $imagePath; + } + } } if ($absolutePath) { $bookCoverUrl = $configArray['Site']['url']; @@ -242,6 +248,9 @@ public function getStaffView() { public function getTitle() { if (isset($this->record['Title'])) { $title=$this->record['Title'][0]; + if (isset($this->record['Subtitle'])) { + $title .= ': ' . $this->record['Subtitle'][0]; + } } else { $title='Unknown Title'; } @@ -339,8 +348,8 @@ public function getPrimaryAuthor() { } public function getAuthor() { - if(isset($this->record['Author'][0])) { - $author=$this->record['Author'][0]; + if(isset($this->record['Author_xml'][0]['fullname'])) { + $author=$this->record['Author_xml'][0]['fullname']; } else { $author='Unknown Title'; } diff --git a/code/web/interface/themes/responsive/Admin/copyEventsFacetGroupForm.tpl b/code/web/interface/themes/responsive/Admin/copyEventsFacetGroupForm.tpl new file mode 100644 index 0000000000..03381053b1 --- /dev/null +++ b/code/web/interface/themes/responsive/Admin/copyEventsFacetGroupForm.tpl @@ -0,0 +1,7 @@ +
+ +
+ + +
+
\ No newline at end of file diff --git a/code/web/interface/themes/responsive/CollectionSpotlight/collectionSpotlightTabs.tpl b/code/web/interface/themes/responsive/CollectionSpotlight/collectionSpotlightTabs.tpl index 548db93796..e608260922 100644 --- a/code/web/interface/themes/responsive/CollectionSpotlight/collectionSpotlightTabs.tpl +++ b/code/web/interface/themes/responsive/CollectionSpotlight/collectionSpotlightTabs.tpl @@ -28,7 +28,7 @@ @@ -74,6 +74,11 @@ {/if} {/if} + {assign var="tabClasses" value="tab-pane" } + {if $active} + {assign var="tabClasses" value="$tabClasses active" } + {/if} + {if $collectionSpotlight->style == 'horizontal'} {include file='CollectionSpotlight/titleScroller.tpl'} {elseif $collectionSpotlight->style == 'horizontal-carousel'} @@ -107,6 +112,7 @@ $(document).ready(function(){ldelim} {if count($collectionSpotlight->lists) > 1 && (!isset($collectionSpotlight->listDisplayType) || $collectionSpotlight->listDisplayType == 'tabs')} + applyTabsSwitcher(); $('#collectionSpotlight{$collectionSpotlight->id} a[data-toggle="tab"]').on('shown.bs.tab', function (e) {ldelim} showList($(e.target).data('index')); {rdelim}); @@ -135,7 +141,7 @@ var selectedOption = availableLists.options[availableLists.selectedIndex]; var selectedList = selectedOption.value; - $("#collectionSpotlight{$collectionSpotlight->id} .titleScroller.active").removeClass('active').hide(); + $("#collectionSpotlight{$collectionSpotlight->id} .active").removeClass('active').hide(); $("#" + selectedList).addClass('active').show(); // update view more link with data.url for the selectedOption showList(availableLists.selectedIndex); @@ -175,15 +181,13 @@ var selectedList = selectedOption.value; $("#collectionSpotlight{$collectionSpotlight->id} .titleScroller.active").removeClass('active').hide(); - $("#" + selectedList).addClass('active').show().jcarousel('reload'); + $("#" + selectedList).addClass('active').show(); + $('#collectionSpotlightCarousel' + selectedOption.dataset.carouselid).jcarousel('reload'); {rdelim} $(document).ready(function(){ldelim} {if count($collectionSpotlight->lists) > 1 && (!isset($collectionSpotlight->listDisplayType) || $collectionSpotlight->listDisplayType == 'tabs')} - var tablists = document.querySelectorAll('[role=tablist]'); - for (var i = 0; i < tablists.length; i++) {ldelim} - new TabsSwitcher(tablists[i]); - {rdelim} + applyTabsSwitcher(); $('#collectionSpotlight{$collectionSpotlight->id} a[data-toggle="tab"]').on('shown.bs.tab', function (e) {ldelim} $('#collectionSpotlightCarousel' + $(e.target).data('carouselid')).jcarousel('reload'); {rdelim}); @@ -191,6 +195,14 @@ {rdelim}); {/if} + {strip} {/strip} \ No newline at end of file diff --git a/code/web/interface/themes/responsive/CollectionSpotlight/horizontalCarousel.tpl b/code/web/interface/themes/responsive/CollectionSpotlight/horizontalCarousel.tpl index 594c6efbf6..57a0ece4d2 100644 --- a/code/web/interface/themes/responsive/CollectionSpotlight/horizontalCarousel.tpl +++ b/code/web/interface/themes/responsive/CollectionSpotlight/horizontalCarousel.tpl @@ -1,4 +1,4 @@ -