Permalink
Browse files

fixes #2, prefilter "in several albums"

  • Loading branch information...
plegall committed Dec 19, 2017
1 parent 673bb44 commit a68cc808c173161b57ce07019f5df662edb9a4a9
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
@@ -5,4 +5,5 @@
$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';
$lang['in several albums'] = 'associated to several albums';
?>
@@ -5,4 +5,5 @@
$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';
$lang['in several albums'] = 'Associées à plusieurs albums';
?>
View
@@ -21,6 +21,7 @@ function add_bmp($prefilters)
array_push(
$prefilters,
array('ID' => 'only_one_album', 'NAME' => l10n('in only one album')),
array('ID' => 'in_several_albums', 'NAME' => l10n('in several albums')),
array('ID' => 'with tags', 'NAME' => l10n('with tags')),
array('ID' => 'with author', 'NAME' => l10n('with author')),
array('ID' => 'without author', 'NAME' => l10n('without author')),
@@ -69,6 +70,12 @@ function perform_bmp($filter_sets, $prefilter)
array_push($filter_sets, array_from_query($query, 'image_id'));
}
if ('in_several_albums' == $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;
}
@@ -79,6 +86,7 @@ function element_set_global_action_bmp($action)
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')))
or (@$_SESSION['bulk_manager_filter']['prefilter'] == 'in_several_albums' 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 a68cc80

Please sign in to comment.