Skip to content

Commit

Permalink
Changes in clipboard sort, refs #8941
Browse files Browse the repository at this point in the history
- Fix reference code sort by using the same order than
  in the browse IO page switch
- Add date option, over the events start date
  • Loading branch information
jraddaoui committed Dec 2, 2015
1 parent 994056b commit ce85502
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
16 changes: 11 additions & 5 deletions apps/qubit/modules/user/actions/clipboardAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,21 @@ public function execute($request)
case 'identifier':
$this->search->query->addSort(array('referenceCode.untouched' => 'asc'));

case 'lastUpdated':
$this->search->query->setSort(array('updatedAt' => 'desc'));
break;

// I don't think that this is going to scale, but let's leave it for now
case 'alphabetic':
default:
$field = sprintf('i18n.%s.title.untouched', $this->selectedCulture);
$this->search->query->addSort(array($field => 'asc'));

break;

case 'date':
$this->search->query->setSort(array('dates.startDate' => 'asc'));

break;

case 'lastUpdated':
default:
$this->search->query->setSort(array('updatedAt' => 'desc'));
}

$this->search->query->setQuery($this->search->queryBool);
Expand Down
12 changes: 6 additions & 6 deletions apps/qubit/modules/user/templates/clipboardSuccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
<section class="header-options">
<?php echo get_partial('default/printPreviewButton', array('class' => 'clipboard-print')) ?>

<?php echo get_partial('default/sortPicker',
array(
'options' => array(
'lastUpdated' => __('Most recent'),
'alphabetic' => __('Alphabetic'),
'identifier' => __('Reference code')))) ?>
<?php echo get_partial('default/sortPicker', array(
'options' => array(
'lastUpdated' => __('Most recent'),
'alphabetic' => __('Alphabetic'),
'identifier' => __('Reference code'),
'date' => __('Date')))) ?>
</section>
<?php end_slot() ?>

Expand Down

0 comments on commit ce85502

Please sign in to comment.