Skip to content

Commit

Permalink
batch manager: ability to filter on a specific duplicates option
Browse files Browse the repository at this point in the history
example : admin.php?page=batch_manager&filter=prefilter-duplicates-checksum

this is to prepare Tour of 2.9 new features
  • Loading branch information
plegall committed Mar 16, 2017
1 parent 44724ff commit a51fdb3
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions admin/batch_manager.php
Expand Up @@ -212,7 +212,20 @@
switch ($type)
{
case 'prefilter':
$_SESSION['bulk_manager_filter']['prefilter'] = $value;
if (preg_match('/^duplicates-?/', $value))
{
list(, $duplicate_field) = explode('-', $value, 2);
$_SESSION['bulk_manager_filter']['prefilter'] = 'duplicates';

if (in_array($duplicate_field, array('filename', 'checksum', 'date', 'dimensions')))
{
$_SESSION['bulk_manager_filter']['duplicates_'.$duplicate_field] = true;
}
}
else
{
$_SESSION['bulk_manager_filter']['prefilter'] = $value;
}
break;

case 'album': case 'category': case 'cat':
Expand Down Expand Up @@ -392,7 +405,7 @@
$duplicates_on_fields[] = 'width';
$duplicates_on_fields[] = 'height';
}

$query = '
SELECT
GROUP_CONCAT(id) AS ids
Expand Down

0 comments on commit a51fdb3

Please sign in to comment.