fixes #2025 add author field in search by words filter

This commit is contained in:
plegall
2023-10-18 18:19:30 +02:00
parent 188be4849c
commit c904d536a5
5 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -138,7 +138,7 @@ function get_sql_search_clause($search)
if (isset($search['fields']['allwords']) and !empty($search['fields']['allwords']['words']) and count($search['fields']['allwords']['fields']) > 0)
{
// 1) we search in regular fields (ie, the ones in the piwigo_images table)
$fields = array('file', 'name', 'comment');
$fields = array('file', 'name', 'comment', 'author');
if (isset($search['fields']['allwords']['fields']) and count($search['fields']['allwords']['fields']) > 0)
{
+1 -1
View File
@@ -732,7 +732,7 @@ function ws_images_filteredSearch_create($params, $service)
}
$search['fields']['allwords']['mode'] = $params['allwords_mode'];
$allwords_fields_available = array('name', 'comment', 'file', 'tags', 'cat-title', 'cat-desc');
$allwords_fields_available = array('name', 'comment', 'file', 'author', 'tags', 'cat-title', 'cat-desc');
if (!isset($params['allwords_fields']))
{
$params['allwords_fields'] = $allwords_fields_available;
+1 -1
View File
@@ -41,7 +41,7 @@ $search = array(
'allwords' => array(
'words' => $words,
'mode' => 'AND',
'fields' => array('file', 'name', 'comment', 'tags', 'cat-title', 'cat-desc'),
'fields' => array('file', 'name', 'comment', 'tags', 'author', 'cat-title', 'cat-desc'),
),
'cat' => array(
'words' => $cat_ids,
@@ -106,6 +106,10 @@ str_empty_search_bot_alt = "{'Pre-established filters are proposed, but you can
<input type="checkbox" id="file" name="file">
<label for="file">{'File name'|@translate}</label>
</div>
<div>
<input type="checkbox" id="author" name="author">
<label for="author">{'Author'|translate}</label>
</div>
<div>
<input type="checkbox" id="comment" name="comment">
<label for="comment">{'Photo description'|@translate}</label>
+1 -1
View File
@@ -1400,7 +1400,7 @@ enabled_high, registration_date, registration_date_string, registration_date_sin
),
'allwords_fields' => array(
'flags' => WS_PARAM_OPTIONAL|WS_PARAM_FORCE_ARRAY,
'info' => 'values among [name, comment, tags, file, cat-title, cat-desc]',
'info' => 'values among [name, comment, tags, file, author, cat-title, cat-desc]',
),
'tags' => array(
'flags' => WS_PARAM_OPTIONAL|WS_PARAM_FORCE_ARRAY,