Skip to content

Commit 50726be

Browse files
authored
[5.2] Search for content checked out by an author (joomla#43965)
1 parent 8a780c3 commit 50726be

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

administrator/components/com_content/src/Model/ArticlesModel.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,11 @@ protected function getListQuery()
425425
$search = '%' . substr($search, 8) . '%';
426426
$query->where('(' . $db->quoteName('a.introtext') . ' LIKE :search1 OR ' . $db->quoteName('a.fulltext') . ' LIKE :search2)')
427427
->bind([':search1', ':search2'], $search);
428+
} elseif (stripos($search, 'checkedout:') === 0) {
429+
$search = '%' . substr($search, 11) . '%';
430+
$query->where('(' . $db->quoteName('uc.name') . ' LIKE :search1 OR ' . $db->quoteName('uc.username') . ' LIKE :search2)'
431+
. ' AND ' . $db->quoteName('a.checked_out') . ' IS NOT NULL')
432+
->bind([':search1', ':search2'], $search);
428433
} else {
429434
$search = '%' . str_replace(' ', '%', trim($search)) . '%';
430435
$query->where(

administrator/language/en-GB/com_content.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ COM_CONTENT_FIELDSET_URLS_AND_IMAGES="Images and Links"
106106
COM_CONTENT_FILTER_AUTHORS_BY_ME="Created by me"
107107
COM_CONTENT_FILTER_FEATURED_NO="Unfeatured Articles"
108108
COM_CONTENT_FILTER_FEATURED_YES="Featured Articles"
109-
COM_CONTENT_FILTER_SEARCH_DESC="Search in title, alias and note. Prefix with ID: or AUTHOR: or CONTENT: to search for an article ID, article author or search in article content."
109+
COM_CONTENT_FILTER_SEARCH_DESC="Search in title, alias and note. Prefix with ID: or AUTHOR: or CONTENT: to search for an article ID, article author or search in article content. Prefix with CHECKEDOUT: to search for content checked out by a specified user."
110110
COM_CONTENT_FILTER_SEARCH_LABEL="Search Articles"
111111
COM_CONTENT_FORM_TITLE_EDIT="Edit Article"
112112
COM_CONTENT_FORM_TITLE_NEW="New Article"

0 commit comments

Comments
 (0)