fixes #2361 explicit action to empty lounge

This commit is contained in:
plegall
2025-09-19 16:48:17 +02:00
parent 1be0527523
commit ad88ed9d5f
5 changed files with 36 additions and 0 deletions

View File

@@ -49,6 +49,10 @@ $maint_actions = array(
'icon' => 'icon-info-circled-1',
'label' => l10n('Update photos information'),
),
'empty_lounge' => array(
'icon' => 'icon-thumbs-up',
'label' => l10n('Empty lounge'),
),
'delete_orphan_tags' => array(
'icon' => 'icon-tags',
'label' => l10n('Delete orphan tags'),

View File

@@ -159,6 +159,12 @@ DELETE
$page['infos'][] = sprintf('%s : %s', l10n('Reinitialize check integrity'), l10n('action successfully performed.'));
break;
}
case 'empty_lounge':
{
$rows = empty_lounge();
$page['infos'][] = sprintf('%d photos were moved from the upload lounge to their albums', count($rows));
break;
}
case 'search' :
{
$query = '
@@ -362,6 +368,23 @@ else
);
}
$query = '
SELECT
COUNT(*)
FROM '.LOUNGE_TABLE.'
;';
list($nb_lounge) = pwg_db_fetch_row(pwg_query($query));
if ($nb_lounge > 0)
{
$template->assign(
array(
'U_EMPTY_LOUNGE' => sprintf($url_format, 'empty_lounge'),
'LOUNGE_COUNTER' => $nb_lounge,
)
);
}
$template->assign('isWebmaster', (is_webmaster()) ? 1 : 0);
// +-----------------------------------------------------------------------+

View File

@@ -132,6 +132,9 @@ $(".delete-size-check").click( function () {
<a href="{$U_MAINT_IMAGES}" class="{$maint_actions['images']['icon']} maintenance-action">{$maint_actions['images']['label']}</a>
<a href="{$U_MAINT_DATABASE}" class="{$maint_actions['database']['icon']} maintenance-action">{$maint_actions['database']['label']}</a>
<a href="{$U_MAINT_C13Y}" class="{$maint_actions['c13y']['icon']} maintenance-action">{$maint_actions['c13y']['label']}</a>
{if (isset($U_EMPTY_LOUNGE))}
<a href="{$U_EMPTY_LOUNGE}" class="{$maint_actions['empty_lounge']['icon']} maintenance-action tiptip" title="{'There is currently %d photos in the lounge (upload buffer)'|translate:$LOUNGE_COUNTER}">{$maint_actions['empty_lounge']['label']}<span class="multiple-pictures-sizes">{$LOUNGE_COUNTER}</span></a>
{/if}
</div>
</fieldset>
<fieldset class="">

View File

@@ -1417,5 +1417,8 @@ $lang['The comment has been validated.'] = 'The comment has been validated.';
$lang['The comments have been validated.'] = 'The comments have been validated.';
$lang['Are you sure you want to delete "%d" comments?'] = 'Are you sure you want to delete "%d" comments?';
$lang['If a photo in this album has the same filename, update the file without changing the photo\'s properties'] = 'If a photo in this album has the same filename, update the file without changing the photo\'s properties';
$lang['Empty lounge'] = 'Empty lounge';
$lang['There is currently %d photos in the lounge (upload buffer)'] = 'There is currently %d photos in the lounge (upload buffer)';
$lang['%d photos were moved from the upload lounge to their albums'] = '%d photos were moved from the upload lounge to their albums';
// Leave this line empty

View File

@@ -1419,4 +1419,7 @@ $lang['The comment has been validated.'] = 'Le commentaire a été validé.';
$lang['The comments have been validated.'] = 'Les commentaires ont été validés.';
$lang['Are you sure you want to delete "%d" comments?'] = 'Êtes-vous sûr de vouloir supprimer "%d" commentaires ?';
$lang['If a photo in this album has the same filename, update the file without changing the photo\'s properties'] = 'Si une photo de cet album a le même nom de fichier, mettre à jour le fichier sans changer les propriétés de la photo';
$lang['Empty lounge'] = 'Vider le lounge';
$lang['There is currently %d photos in the lounge (upload buffer)'] = 'Il y a actuellement %d photos dans le lounge (salle d\'attente des transferts)';
$lang['%d photos were moved from the upload lounge to their albums'] = '%d photos ont été déplacées du lounge vers leurs albums respectifs';
// Leave this line empty