Permalink
Browse files

fixes #1, prefilter "in only one album"

  • Loading branch information...
plegall committed Dec 19, 2017
1 parent 364dc57 commit 673bb4461843a17647fbedaad7e9cc521490e8a4
Showing with 10 additions and 0 deletions.
  1. +1 −0 language/en_UK/plugin.lang.php
  2. +1 −0 language/fr_FR/plugin.lang.php
  3. +8 −0 main.inc.php
@@ -4,4 +4,5 @@
$lang['without author'] = 'without author';
$lang['With no title'] = 'With no title';
$lang['With no creation date'] = 'With no creation date';
$lang['in only one album'] = 'associated to only one album';
?>
@@ -4,4 +4,5 @@
$lang['without author'] = 'Sans auteur';
$lang['With no title'] = 'Sans titre';
$lang['With no creation date'] = 'Sans date de création';
$lang['in only one album'] = 'Associées à un seul album';
?>
View
@@ -20,6 +20,7 @@ function add_bmp($prefilters)
array_push(
$prefilters,
array('ID' => 'only_one_album', 'NAME' => l10n('in only one album')),
array('ID' => 'with tags', 'NAME' => l10n('with tags')),
array('ID' => 'with author', 'NAME' => l10n('with author')),
array('ID' => 'without author', 'NAME' => l10n('without author')),
@@ -62,6 +63,12 @@ function perform_bmp($filter_sets, $prefilter)
array_push($filter_sets, array_from_query($query, 'id'));
}
if ('only_one_album' == $prefilter)
{
$query = 'SELECT image_id FROM '.IMAGE_CATEGORY_TABLE.' GROUP BY image_id HAVING COUNT(category_id) = 1;';
array_push($filter_sets, array_from_query($query, 'image_id'));
}
return $filter_sets;
}
@@ -71,6 +78,7 @@ function element_set_global_action_bmp($action)
or (in_array(@$_SESSION['bulk_manager_filter']['prefilter'], array('with author', 'without author')) and $action == 'author')
or (in_array(@$_SESSION['bulk_manager_filter']['prefilter'], array('no_date_creation')) and $action == 'date_creation')
or (in_array(@$_SESSION['bulk_manager_filter']['prefilter'], array('no_title')) and $action == 'title')
or (@$_SESSION['bulk_manager_filter']['prefilter'] == 'only_one_album' and in_array($action, array('associate', 'move', 'dissociate')))
)
{
// let's refresh the page because we the current set might be modified

0 comments on commit 673bb44

Please sign in to comment.