Skip to content

Commit 2d0b264

Browse files
committed
Portfolio: #add option to show all post by alphabetical order - refs BT#22711
1 parent b66bb19 commit 2d0b264

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

main/inc/lib/PortfolioController.php

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3676,16 +3676,18 @@ private function createFormStudentFilter(bool $listByUser = false, bool $listHig
36763676

36773677
$frmStudentList->addHtml("<p>$link</p>");
36783678

3679-
if ($listAlphabeticalOrder) {
3680-
$link = Display::url(
3681-
get_lang('BackToDateOrder'),
3682-
$this->baseUrl
3683-
);
3684-
} else {
3685-
$link = Display::url(
3686-
get_lang('SeeAlphabeticalOrder'),
3687-
$this->baseUrl.http_build_query(['list_alphabetical' => true])
3688-
);
3679+
if (true !== api_get_configuration_value('portfolio_order_post_by_alphabetical_order')) {
3680+
if ($listAlphabeticalOrder) {
3681+
$link = Display::url(
3682+
get_lang('BackToDateOrder'),
3683+
$this->baseUrl
3684+
);
3685+
} else {
3686+
$link = Display::url(
3687+
get_lang('SeeAlphabeticalOrder'),
3688+
$this->baseUrl.http_build_query(['list_alphabetical' => true])
3689+
);
3690+
}
36893691
}
36903692

36913693
$frmStudentList->addHtml("<p>$link</p>");
@@ -3918,7 +3920,7 @@ private function getItemsForIndex(
39183920
}
39193921

39203922
$queryBuilder->setParameter('current_user', $currentUserId);
3921-
if ($alphabeticalOrder) {
3923+
if ($alphabeticalOrder || true === api_get_configuration_value('portfolio_order_post_by_alphabetical_order')) {
39223924
$queryBuilder->orderBy('pi.title', 'ASC');
39233925
} else {
39243926
$queryBuilder->orderBy('pi.creationDate', 'DESC');

main/install/configuration.dist.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,9 @@
11531153
CREATE INDEX IDX_A9ED1062FC4CB679 ON portfolio (duplicated_from);
11541154
*/
11551155
//$_configuration['portfolio_show_base_course_post_in_sessions'] = false;
1156+
//
1157+
// Show all post in portfolio by alphabetical order instead of reverse date order.
1158+
//$_configuration['portfolio_order_post_by_alphabetical_order'] = false;
11561159

11571160
// DEPRECATED: gradebook_enable_best_score is deprecated. Use gradebook_display_extra_stats instead.
11581161
// Enable best score column in gradebook. Previously called disable_gradebook_stats

0 commit comments

Comments
 (0)