Skip to content
Snippets Groups Projects
Commit ce2f4b7c authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Merge branch 'release-2.3'

Conflicts:
	themes/bootstrap3/css/combined-search.css
	themes/bootstrap3/templates/combined/results.phtml
	themes/bootstrap3/templates/combined/stack-distributed.phtml
	themes/bootstrap3/templates/combined/stack-left.phtml
	themes/bootstrap3/templates/combined/stack-right.phtml
parents aeaaacb4 5c1b00f1
No related merge requests found
......@@ -102,11 +102,18 @@ class CombinedController extends AbstractSearch
) {
$html = '';
} else {
$cart = $this->getServiceLocator()->get('VuFind\Cart');
$general = $this->getServiceLocator()->get('VuFind\Config')
->get('config');
$viewParams = array(
'searchClassId' => $searchClassId,
'currentSearch' => $settings,
'showCartControls' => $currentOptions->supportsCart()
&& $cart->isActive()
);
$html = $this->getViewRenderer()->render(
'combined/results-list.phtml',
array(
'searchClassId' => $searchClassId, 'currentSearch' => $settings
)
$viewParams
);
}
$response->setContent($html);
......@@ -143,6 +150,7 @@ class CombinedController extends AbstractSearch
$config = $this->getServiceLocator()->get('VuFind\Config')->get('combined')
->toArray();
$supportsCart = false;
$supportsCartOptions = array();
foreach ($config as $current => $settings) {
// Special case -- ignore recommendation config:
if ($current == 'Layout' || $current == 'RecommendationModules') {
......@@ -150,8 +158,9 @@ class CombinedController extends AbstractSearch
}
$this->adjustQueryForSettings($settings);
$currentOptions = $options->get($current);
$supportsCartOptions[] = $currentOptions->supportsCart();
if ($currentOptions->supportsCart()) {
$supportsCart = true;
$supportsCart = true;
}
list($controller, $action)
= explode('-', $currentOptions->getSearchAction());
......@@ -192,6 +201,7 @@ class CombinedController extends AbstractSearch
'placement' => $placement,
'results' => $results,
'supportsCart' => $supportsCart,
'supportsCartOptions' => $supportsCartOptions
)
);
}
......@@ -247,3 +257,4 @@ class CombinedController extends AbstractSearch
$query->noRecommend = 1;
}
}
......@@ -4,4 +4,4 @@
.result {padding-right:0}
.result > .col-xs-1.checkbox {padding-right:0;width:10%}
.result > .col-xs-11 {width:89%}
.form-inline > .clearfix {margin-left:7px}
\ No newline at end of file
.form-inline > .clearfix {margin-left:7px}
......@@ -66,10 +66,11 @@
<?
$viewType = in_array('list', array_keys($params->getViewList()))
? 'list' : $params->getView();
$viewParams = array('results' => $results, 'params' => $params);
if (!$params->getOptions()->supportsCart()) {
$viewParams['hideCartControls'] = true;
}
$viewParams = array(
'results' => $results,
'params' => $params,
'showCartControls' => $this->showCartControls
);
?>
<?=$this->render('search/list-' . $viewType . '.phtml', $viewParams)?>
<? if ($currentSearch['more_link']): ?>
......
......@@ -34,6 +34,9 @@
$this->escapeHtml($lookfor) . '</li>';
}
// Enable cart if appropriate:
$this->showCartControls = $this->supportsCart && $this->cart()->isActive();
// Load Javascript dependencies into header:
$this->headScript()->appendFile("check_item_statuses.js");
$this->headScript()->appendFile("check_save_statuses.js");
......@@ -52,7 +55,15 @@
<? if ($this->supportsCart && $this->cart()->isActive()): ?>
<?=$this->context($this)->renderInContext('search/bulk-action-buttons.phtml', array('idPrefix' => ''))?>
<? endif; ?>
<?=$this->context($this)->renderInContext('combined/stack-'.$placement.'.phtml', array('searchClassId' => $searchClassId, 'combinedResults' => $this->combinedResults))?>
<?
$viewParams = array(
'searchClassId' => $searchClassId,
'combinedResults' => $this->combinedResults,
'supportsCartOptions' => $this->supportsCartOptions,
'showCartControls' => $this->showCartControls
);
?>
<?=$this->context($this)->renderInContext('combined/stack-'.$placement.'.phtml', $viewParams)?>
<? $recs = $combinedResults->getRecommendations('bottom'); if (!empty($recs)): ?>
<div>
<? foreach ($recs as $current): ?>
......
......@@ -14,9 +14,14 @@
<? $searchClassId = $keys[$columnIndex]; ?>
<? $currentSearch = $searches[$columnIndex]; ?>
<? if ((!isset($currentSearch['ajax']) || !$currentSearch['ajax']) && isset($currentSearch['hide_if_empty']) && $currentSearch['hide_if_empty'] && $currentSearch['view']->results->getResultTotal() == 0) { $columnIndex += $columns; continue; } ?>
<?
$viewParams = array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch);
// Enable cart if appropriate:
$viewParams['showCartControls'] = $this->supportsCartOptions[$columnIndex] && $this->showCartControls;
?>
<div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
<? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?>
<?=$this->render('combined/results-' . $templateSuffix . '.phtml', array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch))?>
<?=$this->render('combined/results-' . $templateSuffix . '.phtml', $viewParams)?>
</div>
<? $columnIndex += $columns ?>
<? endwhile; ?>
......
......@@ -7,10 +7,15 @@
<? if ($columnIndex < $columns): ?>
<div class="col-sm-<?=$span ?><? if($columnIndex == $columns-1): ?> col-sm-pull-<?=$span*($columns-1) ?><? else: ?> col-sm-push-<?=$span ?><? endif; ?> combined-list">
<? endif; ?>
<div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
<? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?>
<?=$this->render('combined/results-' . $templateSuffix . '.phtml', array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch))?>
</div>
<?
$viewParams = array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch);
// Enable cart if appropriate:
$viewParams['showCartControls'] = $this->supportsCartOptions[$columnIndex] && $this->showCartControls;
?>
<div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
<? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?>
<?=$this->render('combined/results-' . $templateSuffix . '.phtml', $viewParams)?>
</div>
<? ++$columnIndex ?>
<? if($columnIndex < $columns || $columnIndex == $sectionCount): ?>
</div>
......
......@@ -7,10 +7,15 @@
<? if ($columnIndex < $columns): ?>
<div class="col-sm-<?=$span ?> combined-list">
<? endif; ?>
<div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
<? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?>
<?=$this->render('combined/results-' . $templateSuffix . '.phtml', array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch))?>
</div>
<?
$viewParams = array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch);
// Enable cart if appropriate:
$viewParams['showCartControls'] = $this->supportsCartOptions[$columnIndex] && $this->showCartControls;
?>
<div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
<? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?>
<?=$this->render('combined/results-' . $templateSuffix . '.phtml', $viewParams)?>
</div>
<? ++$columnIndex ?>
<? if($columnIndex < $columns || $columnIndex == $sectionCount): ?>
</div>
......
<? if (!isset($this->indexStart)) $this->indexStart = 0; ?>
<? $showCheckboxes = (isset($this->showCartControls) && $this->showCartControls) ?>
<? $i = $this->indexStart; foreach ($this->results->getResults() as $current):
$recordNumber = $this->results->getStartRecord()+$i-$this->indexStart; ?>
<div id="result<?=$i++ ?>" class="row result clearfix">
<div class="col-xs-1 hidden-print checkbox">
<div class="col-xs-1 hidden-print<? if ($showCheckboxes): ?> checkbox<? endif; ?>">
<label>
<? if (!isset($this->hideCartControls) && $this->cart()->isActive()): ?>
<? if ($showCheckboxes): ?>
<?=$this->record($current)->getCheckbox()?>
<? endif; ?>
<?=$recordNumber?>
......
......@@ -30,10 +30,8 @@
$this->layout()->breadcrumbs .= '<li class="active">' . $this->transEsc('Search') . ': ' . $this->escapeHtml($lookfor) . '</li>';
}
// Disable cart if appropriate:
if (!$this->params->getOptions()->supportsCart()) {
$this->hideCartControls = true;
}
// Enable cart if appropriate:
$this->showCartControls = $this->params->getOptions()->supportsCart() && $this->cart()->isActive();
// Load Javascript dependencies into header:
$this->headScript()->appendFile("check_item_statuses.js");
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment