mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-25 19:00:03 +03:00
issue #2164 updated & fixed bugs on batch manager
Added dark mode for unit mode Templatized filter block for both unit and global mode Optimized JS functions and added extensibility for unit mode Modified images.setInfo method so unit mode could save orphan images Fixed a bug where php would break if filter selection was empty in unit mode
This commit is contained in:
parent
c27d166d46
commit
12ca607727
12 changed files with 450 additions and 439 deletions
|
@ -430,157 +430,17 @@ $template->set_filenames(array('batch_manager_global' => 'batch_manager_global.t
|
|||
|
||||
$base_url = get_root_url().'admin.php';
|
||||
|
||||
$prefilters = array(
|
||||
array('ID' => 'caddie', 'NAME' => l10n('Caddie')),
|
||||
array('ID' => 'favorites', 'NAME' => l10n('Your favorites')),
|
||||
array('ID' => 'last_import', 'NAME' => l10n('Last import')),
|
||||
array('ID' => 'no_album', 'NAME' => l10n('With no album').' ('.l10n('Orphans').')'),
|
||||
array('ID' => 'no_tag', 'NAME' => l10n('With no tag')),
|
||||
array('ID' => 'duplicates', 'NAME' => l10n('Duplicates')),
|
||||
array('ID' => 'all_photos', 'NAME' => l10n('All'))
|
||||
);
|
||||
|
||||
if ($conf['enable_synchronization'])
|
||||
{
|
||||
$prefilters[] = array('ID' => 'no_virtual_album', 'NAME' => l10n('With no virtual album'));
|
||||
$prefilters[] = array('ID' => 'no_sync_md5sum', 'NAME' => l10n('With no checksum'));
|
||||
}
|
||||
|
||||
function UC_name_compare($a, $b)
|
||||
{
|
||||
return strcmp(strtolower($a['NAME']), strtolower($b['NAME']));
|
||||
}
|
||||
|
||||
$prefilters = trigger_change('get_batch_manager_prefilters', $prefilters);
|
||||
|
||||
// Sort prefilters by localized name.
|
||||
usort($prefilters, function ($a, $b) {
|
||||
return strcmp(strtolower($a['NAME']), strtolower($b['NAME']));
|
||||
});
|
||||
|
||||
$template->assign(
|
||||
array(
|
||||
'conf_checksum_compute_blocksize' => $conf['checksum_compute_blocksize'],
|
||||
'prefilters' => $prefilters,
|
||||
'filter' => $_SESSION['bulk_manager_filter'],
|
||||
'selection' => $collection,
|
||||
'all_elements' => $page['cat_elements_id'],
|
||||
'START' => $page['start'],
|
||||
'PWG_TOKEN' => get_pwg_token(),
|
||||
'U_DISPLAY'=>$base_url.get_query_string_diff(array('display')),
|
||||
'F_ACTION'=>$base_url.get_query_string_diff(array('cat','start','tag','filter')),
|
||||
'ADMIN_PAGE_TITLE' => l10n('Batch Manager'),
|
||||
)
|
||||
);
|
||||
|
||||
if (isset($page['no_md5sum_number']))
|
||||
{
|
||||
$template->assign(
|
||||
array(
|
||||
'NB_NO_MD5SUM' => $page['no_md5sum_number'],
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$template->assign('NB_NO_MD5SUM', '');
|
||||
}
|
||||
include(PHPWG_ROOT_PATH.'admin/include/batch_manager_filters.inc.php');
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | caddie options |
|
||||
// +-----------------------------------------------------------------------+
|
||||
$template->assign('IN_CADDIE', 'caddie' == $page['prefilter']);
|
||||
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | global mode form |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
// privacy level
|
||||
foreach ($conf['available_permission_levels'] as $level)
|
||||
{
|
||||
$level_options[$level] = l10n(sprintf('Level %d', $level));
|
||||
|
||||
if (0 == $level)
|
||||
{
|
||||
$level_options[$level] = l10n('Everybody');
|
||||
}
|
||||
}
|
||||
$template->assign(
|
||||
array(
|
||||
'filter_level_options'=> $level_options,
|
||||
'filter_level_options_selected' => isset($_SESSION['bulk_manager_filter']['level'])
|
||||
? $_SESSION['bulk_manager_filter']['level']
|
||||
: 0,
|
||||
)
|
||||
);
|
||||
|
||||
// tags
|
||||
$filter_tags = array();
|
||||
|
||||
if (!empty($_SESSION['bulk_manager_filter']['tags']))
|
||||
{
|
||||
$query = '
|
||||
SELECT
|
||||
id,
|
||||
name
|
||||
FROM '.TAGS_TABLE.'
|
||||
WHERE id IN ('.implode(',', $_SESSION['bulk_manager_filter']['tags']).')
|
||||
;';
|
||||
|
||||
$filter_tags = get_taglist($query);
|
||||
}
|
||||
|
||||
$template->assign('filter_tags', $filter_tags);
|
||||
|
||||
// in the filter box, which category to select by default
|
||||
$selected_category = array();
|
||||
|
||||
if (isset($_SESSION['bulk_manager_filter']['category']))
|
||||
{
|
||||
$selected_category = array($_SESSION['bulk_manager_filter']['category']);
|
||||
}
|
||||
else
|
||||
{
|
||||
// we need to know the category in which the last photo was added
|
||||
$query = '
|
||||
SELECT category_id
|
||||
FROM '.IMAGE_CATEGORY_TABLE.'
|
||||
ORDER BY image_id DESC
|
||||
LIMIT 1
|
||||
;';
|
||||
$result = pwg_query($query);
|
||||
if (pwg_db_num_rows($result) > 0)
|
||||
{
|
||||
$row = pwg_db_fetch_assoc($result);
|
||||
$selected_category[] = $row['category_id'];
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign('filter_category_selected', $selected_category);
|
||||
|
||||
// Dissociate from a category : categories listed for dissociation can only
|
||||
// represent virtual links. We can't create orphans. Links to physical
|
||||
// categories can't be broken.
|
||||
$associated_categories = array();
|
||||
|
||||
if (count($page['cat_elements_id']) > 0)
|
||||
{
|
||||
$query = '
|
||||
SELECT
|
||||
DISTINCT(category_id) AS id
|
||||
FROM '.IMAGE_CATEGORY_TABLE.' AS ic
|
||||
JOIN '.IMAGES_TABLE.' AS i ON i.id = ic.image_id
|
||||
WHERE ic.image_id IN ('.implode(',', $page['cat_elements_id']).')
|
||||
AND (
|
||||
ic.category_id != i.storage_category_id
|
||||
OR i.storage_category_id IS NULL
|
||||
)
|
||||
;';
|
||||
|
||||
$associated_categories = query2array($query, 'id', 'id');
|
||||
}
|
||||
|
||||
$template->assign('associated_categories', $associated_categories);
|
||||
|
||||
if (count($page['cat_elements_id']) > 0)
|
||||
{
|
||||
// remove tags
|
||||
|
|
|
@ -149,127 +149,13 @@ $template->assign(
|
|||
'PWG_TOKEN' => get_pwg_token(),
|
||||
)
|
||||
);
|
||||
//prefilter
|
||||
$prefilters = array(
|
||||
array('ID' => 'caddie', 'NAME' => l10n('Caddie')),
|
||||
array('ID' => 'favorites', 'NAME' => l10n('Your favorites')),
|
||||
array('ID' => 'last_import', 'NAME' => l10n('Last import')),
|
||||
array('ID' => 'no_album', 'NAME' => l10n('With no album').' ('.l10n('Orphans').')'),
|
||||
array('ID' => 'no_tag', 'NAME' => l10n('With no tag')),
|
||||
array('ID' => 'duplicates', 'NAME' => l10n('Duplicates')),
|
||||
array('ID' => 'all_photos', 'NAME' => l10n('All'))
|
||||
);
|
||||
|
||||
if ($conf['enable_synchronization'])
|
||||
{
|
||||
$prefilters[] = array('ID' => 'no_virtual_album', 'NAME' => l10n('With no virtual album'));
|
||||
$prefilters[] = array('ID' => 'no_sync_md5sum', 'NAME' => l10n('With no checksum'));
|
||||
}
|
||||
|
||||
function UC_name_compare($a, $b)
|
||||
{
|
||||
return strcmp(strtolower($a['NAME']), strtolower($b['NAME']));
|
||||
}
|
||||
|
||||
$prefilters = trigger_change('get_batch_manager_prefilters', $prefilters);
|
||||
|
||||
// Sort prefilters by localized name.
|
||||
usort($prefilters, function ($a, $b) {
|
||||
return strcmp(strtolower($a['NAME']), strtolower($b['NAME']));
|
||||
});
|
||||
|
||||
$template->assign(
|
||||
array(
|
||||
'conf_checksum_compute_blocksize' => $conf['checksum_compute_blocksize'],
|
||||
'prefilters' => $prefilters,
|
||||
'filter' => $_SESSION['bulk_manager_filter'],
|
||||
'selection' => $collection,
|
||||
'all_elements' => $page['cat_elements_id'],
|
||||
'START' => $page['start'],
|
||||
'U_DISPLAY'=>$base_url.get_query_string_diff(array('display')),
|
||||
'F_ACTION'=>$base_url.get_query_string_diff(array('cat','start','tag','filter')),
|
||||
)
|
||||
);
|
||||
|
||||
if (isset($page['no_md5sum_number']))
|
||||
{
|
||||
$template->assign(
|
||||
array(
|
||||
'NB_NO_MD5SUM' => $page['no_md5sum_number'],
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$template->assign('NB_NO_MD5SUM', '');
|
||||
}
|
||||
|
||||
|
||||
// privacy level
|
||||
foreach ($conf['available_permission_levels'] as $level)
|
||||
{
|
||||
$level_options[$level] = l10n(sprintf('Level %d', $level));
|
||||
|
||||
if (0 == $level)
|
||||
{
|
||||
$level_options[$level] = l10n('Everybody');
|
||||
}
|
||||
}
|
||||
$template->assign(
|
||||
array(
|
||||
'filter_level_options'=> $level_options,
|
||||
'filter_level_options_selected' => isset($_SESSION['bulk_manager_filter']['level'])
|
||||
? $_SESSION['bulk_manager_filter']['level']
|
||||
: 0,
|
||||
)
|
||||
);
|
||||
|
||||
// tags
|
||||
$filter_tags = array();
|
||||
|
||||
if (!empty($_SESSION['bulk_manager_filter']['tags']))
|
||||
{
|
||||
$query = '
|
||||
SELECT
|
||||
id,
|
||||
name
|
||||
FROM '.TAGS_TABLE.'
|
||||
WHERE id IN ('.implode(',', $_SESSION['bulk_manager_filter']['tags']).')
|
||||
;';
|
||||
|
||||
$filter_tags = get_taglist($query);
|
||||
}
|
||||
|
||||
$template->assign('filter_tags', $filter_tags);
|
||||
|
||||
// in the filter box, which category to select by default
|
||||
$selected_category = array();
|
||||
|
||||
if (isset($_SESSION['bulk_manager_filter']['category']))
|
||||
{
|
||||
$selected_category = array($_SESSION['bulk_manager_filter']['category']);
|
||||
}
|
||||
else
|
||||
{
|
||||
// we need to know the category in which the last photo was added
|
||||
$query = '
|
||||
SELECT category_id
|
||||
FROM '.IMAGE_CATEGORY_TABLE.'
|
||||
ORDER BY image_id DESC
|
||||
LIMIT 1
|
||||
;';
|
||||
$result = pwg_query($query);
|
||||
if (pwg_db_num_rows($result) > 0)
|
||||
{
|
||||
$row = pwg_db_fetch_assoc($result);
|
||||
$selected_category[] = $row['category_id'];
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign('filter_category_selected', $selected_category);
|
||||
|
||||
include(PHPWG_ROOT_PATH.'admin/include/batch_manager_filters.inc.php');
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | global mode thumbnails |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
$template->assign('ACTIVE_PLUGINS', array_keys($pwg_loaded_plugins));
|
||||
|
||||
// how many items to display on this page
|
||||
if (!empty($_GET['display']))
|
||||
{
|
||||
|
@ -285,8 +171,7 @@ else
|
|||
{
|
||||
$page['nb_images'] = 5;
|
||||
}
|
||||
$template->assign('per_page', $conf['batch_manager_images_per_page_unit']);
|
||||
|
||||
$template->assign('per_page', $page['nb_images']);
|
||||
|
||||
if (count($page['cat_elements_id']) > 0)
|
||||
{
|
||||
|
@ -345,8 +230,21 @@ SELECT *
|
|||
'.$conf['order_by'].'
|
||||
LIMIT '.$page['nb_images'].' OFFSET '.$page['start'].'
|
||||
;';
|
||||
$result = pwg_query($query);
|
||||
|
||||
// $result = pwg_query($query);
|
||||
$images = query2array($query);
|
||||
$added_by_ids = array_unique(array_column($images, 'added_by'));
|
||||
if (count($added_by_ids) > 0)
|
||||
{
|
||||
$query = '
|
||||
SELECT
|
||||
'.$conf['user_fields']['username'].' AS username,
|
||||
'.$conf['user_fields']['id'].' AS id
|
||||
FROM '.USERS_TABLE.'
|
||||
WHERE '.$conf['user_fields']['id'].' IN ( '.implode(',', $added_by_ids).' )
|
||||
;';
|
||||
$added_by_username_of = query2array($query, 'id', 'username');
|
||||
}
|
||||
|
||||
$storage_category_id = null;
|
||||
if (!empty($row['storage_category_id']))
|
||||
{
|
||||
|
@ -359,9 +257,9 @@ SELECT *
|
|||
"2" => "2",
|
||||
"4" => "1",
|
||||
"8" => "0",
|
||||
];
|
||||
];
|
||||
|
||||
while ($row = pwg_db_fetch_assoc($result))
|
||||
foreach ($images as $row)
|
||||
{
|
||||
$element_ids[] = $row['id'];
|
||||
|
||||
|
@ -470,7 +368,7 @@ SELECT
|
|||
$admin_url_start = $admin_photo_base_url.'-properties';
|
||||
$admin_url_start.= isset($row['cat_id']) ? '&cat_id='.$row['cat_id'] : '';
|
||||
$selected_level = isset($row['level']) ? $row['level'] : $row['level'];
|
||||
|
||||
|
||||
|
||||
$template->append(
|
||||
'elements', array_merge($row,
|
||||
|
@ -493,9 +391,9 @@ SELECT
|
|||
'FILESIZE' => l10n('%.2f MB',$row['filesize']/1024),
|
||||
'REGISTRATION_DATE' => format_date($row['date_available']),
|
||||
'EXT' => l10n('%s file type',end($extTab)),
|
||||
'POST_DATE' => l10n('Posted the %s', format_date($row['date_available'], array('day', 'month', 'year'))),
|
||||
'POST_DATE' => l10n('Added on %s', format_date($row['date_available'], array('day', 'month', 'year'))),
|
||||
'AGE' => l10n(ucfirst(time_since($row['date_available'], 'year'))),
|
||||
'ADDED_BY' => l10n('Added by %s', $row['added_by']),
|
||||
'ADDED_BY' => l10n('Added by %s', $added_by_username_of[ $row['added_by'] ] ?? l10n('N/A')),
|
||||
'STATS' => l10n('Visited %d times', $row['hit']),
|
||||
'FILE' => l10n('%s', $row['file']),
|
||||
'related_categories' => $related_categories,
|
||||
|
@ -515,16 +413,15 @@ SELECT
|
|||
));
|
||||
}
|
||||
|
||||
$template->assign('ACTIVE_PLUGINS', array_keys($pwg_loaded_plugins));
|
||||
|
||||
$template->assign(array(
|
||||
'ELEMENT_IDS' => implode(',', $element_ids),
|
||||
'CACHE_KEYS' => get_admin_client_cache_keys(array('tags')),
|
||||
|
||||
));
|
||||
|
||||
));
|
||||
}
|
||||
|
||||
$template->assign(array(
|
||||
'CACHE_KEYS' => get_admin_client_cache_keys(array('tags', 'categories')),
|
||||
));
|
||||
|
||||
trigger_notify('loc_end_element_set_unit');
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
|
142
admin/include/batch_manager_filters.inc.php
Normal file
142
admin/include/batch_manager_filters.inc.php
Normal file
|
@ -0,0 +1,142 @@
|
|||
<?php
|
||||
//prefilter
|
||||
$prefilters = array(
|
||||
array('ID' => 'caddie', 'NAME' => l10n('Caddie')),
|
||||
array('ID' => 'favorites', 'NAME' => l10n('Your favorites')),
|
||||
array('ID' => 'last_import', 'NAME' => l10n('Last import')),
|
||||
array('ID' => 'no_album', 'NAME' => l10n('With no album').' ('.l10n('Orphans').')'),
|
||||
array('ID' => 'no_tag', 'NAME' => l10n('With no tag')),
|
||||
array('ID' => 'duplicates', 'NAME' => l10n('Duplicates')),
|
||||
array('ID' => 'all_photos', 'NAME' => l10n('All'))
|
||||
);
|
||||
|
||||
if ($conf['enable_synchronization'])
|
||||
{
|
||||
$prefilters[] = array('ID' => 'no_virtual_album', 'NAME' => l10n('With no virtual album'));
|
||||
$prefilters[] = array('ID' => 'no_sync_md5sum', 'NAME' => l10n('With no checksum'));
|
||||
}
|
||||
|
||||
function UC_name_compare($a, $b)
|
||||
{
|
||||
return strcmp(strtolower($a['NAME']), strtolower($b['NAME']));
|
||||
}
|
||||
|
||||
$prefilters = trigger_change('get_batch_manager_prefilters', $prefilters);
|
||||
|
||||
// Sort prefilters by localized name.
|
||||
usort($prefilters, function ($a, $b) {
|
||||
return strcmp(strtolower($a['NAME']), strtolower($b['NAME']));
|
||||
});
|
||||
|
||||
$template->assign(
|
||||
array(
|
||||
'conf_checksum_compute_blocksize' => $conf['checksum_compute_blocksize'],
|
||||
'prefilters' => $prefilters,
|
||||
'filter' => $_SESSION['bulk_manager_filter'],
|
||||
'selection' => $collection,
|
||||
'all_elements' => $page['cat_elements_id'],
|
||||
'START' => $page['start'],
|
||||
'PWG_TOKEN' => get_pwg_token(),
|
||||
'U_DISPLAY'=>$base_url.get_query_string_diff(array('display')),
|
||||
'F_ACTION'=>$base_url.get_query_string_diff(array('cat','start','tag','filter')),
|
||||
'ADMIN_PAGE_TITLE' => l10n('Batch Manager'),
|
||||
)
|
||||
);
|
||||
|
||||
if (isset($page['no_md5sum_number']))
|
||||
{
|
||||
$template->assign(
|
||||
array(
|
||||
'NB_NO_MD5SUM' => $page['no_md5sum_number'],
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$template->assign('NB_NO_MD5SUM', '');
|
||||
}
|
||||
|
||||
// privacy level
|
||||
foreach ($conf['available_permission_levels'] as $level)
|
||||
{
|
||||
$level_options[$level] = l10n(sprintf('Level %d', $level));
|
||||
|
||||
if (0 == $level)
|
||||
{
|
||||
$level_options[$level] = l10n('Everybody');
|
||||
}
|
||||
}
|
||||
$template->assign(
|
||||
array(
|
||||
'filter_level_options'=> $level_options,
|
||||
'filter_level_options_selected' => isset($_SESSION['bulk_manager_filter']['level'])
|
||||
? $_SESSION['bulk_manager_filter']['level']
|
||||
: 0,
|
||||
)
|
||||
);
|
||||
|
||||
// tags
|
||||
$filter_tags = array();
|
||||
|
||||
if (!empty($_SESSION['bulk_manager_filter']['tags']))
|
||||
{
|
||||
$query = '
|
||||
SELECT
|
||||
id,
|
||||
name
|
||||
FROM '.TAGS_TABLE.'
|
||||
WHERE id IN ('.implode(',', $_SESSION['bulk_manager_filter']['tags']).')
|
||||
;';
|
||||
|
||||
$filter_tags = get_taglist($query);
|
||||
}
|
||||
|
||||
$template->assign('filter_tags', $filter_tags);
|
||||
|
||||
// in the filter box, which category to select by default
|
||||
$selected_category = array();
|
||||
if (isset($_SESSION['bulk_manager_filter']['category']))
|
||||
{
|
||||
$selected_category = array($_SESSION['bulk_manager_filter']['category']);
|
||||
}
|
||||
else
|
||||
{
|
||||
// we need to know the category in which the last photo was added
|
||||
$query = '
|
||||
SELECT category_id
|
||||
FROM '.IMAGE_CATEGORY_TABLE.'
|
||||
ORDER BY image_id DESC
|
||||
LIMIT 1
|
||||
;';
|
||||
$result = pwg_query($query);
|
||||
if (pwg_db_num_rows($result) > 0)
|
||||
{
|
||||
$row = pwg_db_fetch_assoc($result);
|
||||
$selected_category[] = $row['category_id'];
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign('filter_category_selected', $selected_category);
|
||||
|
||||
// Dissociate from a category : categories listed for dissociation can only
|
||||
// represent virtual links. We can't create orphans. Links to physical
|
||||
// categories can't be broken.
|
||||
$associated_categories = array();
|
||||
|
||||
if (count($page['cat_elements_id']) > 0)
|
||||
{
|
||||
$query = '
|
||||
SELECT
|
||||
DISTINCT(category_id) AS id
|
||||
FROM '.IMAGE_CATEGORY_TABLE.' AS ic
|
||||
JOIN '.IMAGES_TABLE.' AS i ON i.id = ic.image_id
|
||||
WHERE ic.image_id IN ('.implode(',', $page['cat_elements_id']).')
|
||||
AND (
|
||||
ic.category_id != i.storage_category_id
|
||||
OR i.storage_category_id IS NULL
|
||||
)
|
||||
;';
|
||||
|
||||
$associated_categories = query2array($query, 'id', 'id');
|
||||
}
|
||||
|
||||
$template->assign('associated_categories', $associated_categories);
|
||||
?>
|
|
@ -1,13 +1,13 @@
|
|||
$(document).ready(function() {
|
||||
// Detect unsaved changes on any inputs
|
||||
var user_interacted = false;
|
||||
let user_interacted = false;
|
||||
|
||||
$('input, textarea, select').on('focus', function() {
|
||||
user_interacted = true;
|
||||
});
|
||||
|
||||
$('input, textarea').on('input', function() {
|
||||
var pictureId = $(this).parents("fieldset").data("image_id");
|
||||
const pictureId = $(this).parents("fieldset").data("image_id");
|
||||
if (user_interacted == true) {
|
||||
showUnsavedLocalBadge(pictureId);
|
||||
}
|
||||
|
@ -15,14 +15,14 @@ $(document).ready(function() {
|
|||
|
||||
// Specific handler for datepicker inputs
|
||||
$('input[data-datepicker]').on('change', function() {
|
||||
var pictureId = $(this).parents("fieldset").data("image_id");
|
||||
const pictureId = $(this).parents("fieldset").data("image_id");
|
||||
if (user_interacted == true) {
|
||||
showUnsavedLocalBadge(pictureId);
|
||||
}
|
||||
});
|
||||
|
||||
$('select').on('change', function() {
|
||||
var pictureId = $(this).parents("fieldset").data("image_id");
|
||||
const pictureId = $(this).parents("fieldset").data("image_id");
|
||||
if (user_interacted == true) {
|
||||
showUnsavedLocalBadge(pictureId);
|
||||
}
|
||||
|
@ -30,13 +30,13 @@ $(document).ready(function() {
|
|||
|
||||
$('.related-categories-container .remove-item, .datepickerDelete').on('click', function() {
|
||||
user_interacted = true;
|
||||
var pictureId = $(this).parents("fieldset").data("image_id");
|
||||
const pictureId = $(this).parents("fieldset").data("image_id");
|
||||
showUnsavedLocalBadge(pictureId);
|
||||
});
|
||||
|
||||
// METADATA SYNC
|
||||
$('.action-sync-metadata').on('click', function(event) {
|
||||
var pictureId = $(this).parents("fieldset").data("image_id");
|
||||
const pictureId = $(this).parents("fieldset").data("image_id");
|
||||
$.confirm({
|
||||
title: str_meta_warning,
|
||||
draggable: false,
|
||||
|
@ -66,7 +66,7 @@ $(document).ready(function() {
|
|||
},
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
var isOk = data.stat && data.stat === "ok";
|
||||
const isOk = data.stat && data.stat === "ok";
|
||||
if (isOk) {
|
||||
updateBlock(pictureId);
|
||||
} else {
|
||||
|
@ -82,15 +82,15 @@ $(document).ready(function() {
|
|||
}
|
||||
},
|
||||
cancel: {
|
||||
text: str_meta_no
|
||||
text: str_no
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
// DELETE
|
||||
$('.action-delete-picture').on('click', function(event) {
|
||||
var $fieldset = $(this).parents("fieldset");
|
||||
var pictureId = $fieldset.data("image_id");
|
||||
const $fieldset = $(this).parents("fieldset");
|
||||
const pictureId = $fieldset.data("image_id");
|
||||
$.confirm({
|
||||
title: str_are_you_sure,
|
||||
draggable: false,
|
||||
|
@ -109,7 +109,7 @@ $(document).ready(function() {
|
|||
text: str_yes,
|
||||
btnClass: 'btn-red',
|
||||
action: function() {
|
||||
var image_ids = [pictureId];
|
||||
const image_ids = [pictureId];
|
||||
(function(ids) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
|
@ -121,7 +121,7 @@ $(document).ready(function() {
|
|||
},
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
var isOk = data.stat && data.stat === "ok";
|
||||
const isOk = data.stat && data.stat === "ok";
|
||||
if (isOk) {
|
||||
$fieldset.remove();
|
||||
$('.pagination-container').css({
|
||||
|
@ -151,8 +151,8 @@ $(document).ready(function() {
|
|||
// VALIDATION
|
||||
//Unit Save
|
||||
$('.action-save-picture').on('click', function(event) {
|
||||
var $fieldset = $(this).parents("fieldset");
|
||||
var pictureId = $fieldset.data("image_id");
|
||||
const $fieldset = $(this).parents("fieldset");
|
||||
const pictureId = $fieldset.data("image_id");
|
||||
saveChanges(pictureId);
|
||||
});
|
||||
//Global Save
|
||||
|
@ -220,7 +220,7 @@ function check_related_categories(pictureId) {
|
|||
}
|
||||
|
||||
function updateUnsavedGlobalBadge() {
|
||||
var visibleLocalUnsavedCount = $(".local-unsaved-badge").filter(function() {
|
||||
const visibleLocalUnsavedCount = $(".local-unsaved-badge").filter(function() {
|
||||
return $(this).css('display') === 'block';
|
||||
}).length;
|
||||
if (visibleLocalUnsavedCount > 0) {
|
||||
|
@ -258,7 +258,7 @@ function hideErrorLocalBadge(pictureId) {
|
|||
}
|
||||
//Succes badge
|
||||
function updateSuccessGlobalBadge() {
|
||||
var visibleLocalSuccesCount = $(".local-success-badge").filter(function() {
|
||||
const visibleLocalSuccesCount = $(".local-success-badge").filter(function() {
|
||||
return $(this).css('display') === 'block';
|
||||
}).length;
|
||||
if (visibleLocalSuccesCount > 0) {
|
||||
|
@ -269,7 +269,7 @@ function updateSuccessGlobalBadge() {
|
|||
}
|
||||
|
||||
function showSuccessLocalBadge(pictureId) {
|
||||
var badge = $("#picture-" + pictureId + " .local-success-badge");
|
||||
const badge = $("#picture-" + pictureId + " .local-success-badge");
|
||||
badge.css({
|
||||
'display': 'block',
|
||||
'opacity': 1
|
||||
|
@ -286,7 +286,7 @@ function hideSuccesLocalBadge(pictureId) {
|
|||
}
|
||||
|
||||
function showSuccesGlobalBadge() {
|
||||
var badge = $(".global-succes-badge");
|
||||
const badge = $(".global-succes-badge");
|
||||
badge.css({
|
||||
'display': 'block',
|
||||
'opacity': 1
|
||||
|
@ -303,7 +303,7 @@ function hideSuccesGlobalBadge() {
|
|||
}
|
||||
|
||||
function showMetasyncSuccesBadge(pictureId) {
|
||||
var badge = $("#picture-" + pictureId + " .metasync-success");
|
||||
const badge = $("#picture-" + pictureId + " .metasync-success");
|
||||
badge.css({
|
||||
'display': 'block',
|
||||
'opacity': 1
|
||||
|
@ -340,21 +340,21 @@ function saveChanges(pictureId) {
|
|||
if ($("#picture-" + pictureId + " .local-unsaved-badge").css('display') === 'block') {
|
||||
disableLocalButton(pictureId);
|
||||
// Retrieve Infos
|
||||
var name = $("#name-" + pictureId).val();
|
||||
var author = $("#author-" + pictureId).val();
|
||||
var date_creation = $("#date_creation-" + pictureId).val();
|
||||
var comment = $("#description-" + pictureId).val();
|
||||
var level = $("#level-" + pictureId + " option:selected").val();
|
||||
const name = $("#picture-" + pictureId +" #name").val();
|
||||
const author = $("#picture-" + pictureId +" #author").val();
|
||||
const date_creation = $("#picture-" + pictureId + " #date_creation").val();
|
||||
const comment = $("#picture-" + pictureId +" #description").val();
|
||||
const level = $("#picture-" + pictureId +" #level" + " option:selected").val();
|
||||
// Get Categories
|
||||
const categories = get_related_category(pictureId);
|
||||
var categoriesStr = categories.join(';');
|
||||
let categoriesStr = categories.join(';');
|
||||
// Get Tags
|
||||
var tags = [];
|
||||
$("#tags-" + pictureId + " option").each(function() {
|
||||
var tagId = $(this).val().replace(/~~/g, '');
|
||||
let tags = [];
|
||||
$("#picture-" + pictureId +" #tags" + " option").each(function() {
|
||||
let tagId = $(this).val().replace(/~~/g, '');
|
||||
tags.push(tagId);
|
||||
});
|
||||
var tagsStr = tags.join(',');
|
||||
let tagsStr = tags.join(',');
|
||||
$.ajax({
|
||||
url: 'ws.php?format=json',
|
||||
method: 'POST',
|
||||
|
@ -394,37 +394,39 @@ function saveChanges(pictureId) {
|
|||
|
||||
function saveAllChanges() {
|
||||
$("fieldset").each(function() {
|
||||
var pictureId = $(this).data("image_id");
|
||||
const pictureId = $(this).data("image_id");
|
||||
saveChanges(pictureId);
|
||||
});
|
||||
}
|
||||
//PLUGINS SAVE METHOD
|
||||
var pluginFunctionMap = {};
|
||||
const pluginFunctionMap = {};
|
||||
|
||||
function pluginFunctionMapInit(activePlugins) {
|
||||
activePlugins.forEach(function(pluginId) {
|
||||
var functionName = pluginId + '_batchManagerSave';
|
||||
const functionName = pluginId + '_batchManagerSave';
|
||||
if (typeof window[functionName] === 'function') {
|
||||
pluginFunctionMap[pluginId] = window[functionName];
|
||||
} else {
|
||||
console.log('Function not found during initialization: ' + functionName);
|
||||
}
|
||||
}
|
||||
// else {
|
||||
// console.log('Function not found during initialization: ' + functionName);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
function pluginSaveLoop(activePlugins) {
|
||||
if (activePlugins.length === 0) {
|
||||
console.log("No plugins to process in pluginSaveLoop.");
|
||||
// console.log("No plugins to process in pluginSaveLoop.");
|
||||
return;
|
||||
}
|
||||
activePlugins.forEach(function(pluginId) {
|
||||
var saveFunction = pluginFunctionMap[pluginId];
|
||||
const saveFunction = pluginFunctionMap[pluginId];
|
||||
if (typeof saveFunction === 'function') {
|
||||
saveFunction();
|
||||
console.log('Executed function for plugin: ' + pluginId);
|
||||
} else {
|
||||
console.log('Function not found for plugin: ' + pluginId);
|
||||
}
|
||||
// console.log('Executed function for plugin: ' + pluginId);
|
||||
}
|
||||
// else {
|
||||
// console.log('Function not found for plugin: ' + pluginId);
|
||||
// }
|
||||
});
|
||||
}
|
||||
//UPDATE BLOCKS (Yet to be implemented)
|
||||
|
@ -468,12 +470,12 @@ function updateBlock(pictureId) {
|
|||
}
|
||||
//TAGS UPDATE Yet to be implemented
|
||||
// function updateTags(tagsData, pictureId) {
|
||||
// var $tagsUpdate = $('#tags-'+pictureId).selectize({
|
||||
// const $tagsUpdate = $('#tags-'+pictureId).selectize({
|
||||
// create: true,
|
||||
// persist: false
|
||||
// });
|
||||
// var selectizeTags = $tagsUpdate[0].selectize;
|
||||
// var transformedData = tagsData.map(function(item) {
|
||||
// const selectizeTags = $tagsUpdate[0].selectize;
|
||||
// const transformedData = tagsData.map(function(item) {
|
||||
// return {
|
||||
// value: item.id,
|
||||
// text: item.name
|
||||
|
@ -483,24 +485,4 @@ function updateBlock(pictureId) {
|
|||
// selectizeTags.clearOptions();
|
||||
// selectizeTags.addOption(transformedData);
|
||||
// selectizeTags.refreshOptions(true);
|
||||
// };
|
||||
|
||||
//UNRELEASED LEVEL SLIDER
|
||||
// $(function () {
|
||||
// $('.privacy-filter-slider').each(function() {
|
||||
// var id = $(this).attr('id');
|
||||
// $(this).slider({
|
||||
// range: 'min',
|
||||
// value: $(this).attr('value'),
|
||||
// min: 0,
|
||||
// max: 4,
|
||||
// slide: function (event, ui) {
|
||||
// updateCertificationFilterLabel(ui.value, id);
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// });
|
||||
// function updateCertificationFilterLabel(value, id) {
|
||||
// let label = strs_privacy[value];
|
||||
// $('#' + id + ' .privacy').html(label);
|
||||
// }
|
||||
// };
|
|
@ -4,15 +4,6 @@
|
|||
|
||||
{combine_script id='common' load='footer' path='admin/themes/default/js/common.js'}
|
||||
|
||||
{combine_script id='jquery.ui.slider' require='jquery.ui' load='async' path='themes/default/js/ui/minified/jquery.ui.slider.min.js'}
|
||||
{combine_css path="themes/default/js/ui/theme/jquery.ui.slider.css"}
|
||||
{combine_script id='doubleSlider' load='footer' require='jquery.ui.slider' path='admin/themes/default/js/doubleSlider.js'}
|
||||
|
||||
{combine_script id='LocalStorageCache' load='footer' path='admin/themes/default/js/LocalStorageCache.js'}
|
||||
|
||||
{combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'}
|
||||
{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.{$themeconf.colorscheme}.css"}
|
||||
|
||||
{combine_script id='jquery.progressBar' load='async' path='themes/default/js/plugins/jquery.progressbar.min.js'}
|
||||
{combine_script id='jquery.ajaxmanager' load='async' path='themes/default/js/plugins/jquery.ajaxmanager.js'}
|
||||
|
||||
|
|
|
@ -4,17 +4,6 @@
|
|||
|
||||
{combine_script id='jquery.sort' load='footer' path='themes/default/js/plugins/jquery.sort.js'}
|
||||
|
||||
{combine_script id='LocalStorageCache' load='footer' path='admin/themes/default/js/LocalStorageCache.js'}
|
||||
|
||||
{combine_script id='jquery.selectize' load='header' path='themes/default/js/plugins/selectize.min.js'}
|
||||
{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.{$themeconf.colorscheme}.css"}
|
||||
{combine_script id='doubleSlider' load='footer' require='jquery.ui.slider' path='admin/themes/default/js/doubleSlider.js'}
|
||||
|
||||
{combine_script id='jquery.ui.slider' require='jquery.ui' load='header' path='themes/default/js/ui/minified/jquery.ui.slider.min.js'}
|
||||
{combine_css path="themes/default/js/ui/theme/jquery.ui.slider.css"}
|
||||
|
||||
{combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'}
|
||||
|
||||
{combine_script id='jquery.confirm' load='footer' require='jquery' path='themes/default/js/plugins/jquery-confirm.min.js'}
|
||||
{combine_css path="themes/default/js/plugins/jquery-confirm.min.css"}
|
||||
|
||||
|
@ -23,18 +12,47 @@
|
|||
{footer_script}
|
||||
{* <!-- PLUGINS --> *}
|
||||
var activePlugins = {$ACTIVE_PLUGINS|json_encode};
|
||||
(function(){
|
||||
{if isset($CACHE_KEYS)}
|
||||
{* <!-- TAGS --> *}
|
||||
var tagsCache = new TagsCache({
|
||||
serverKey: '{$CACHE_KEYS.tags}',
|
||||
serverId: '{$CACHE_KEYS._hash}',
|
||||
rootUrl: '{$ROOT_URL}'
|
||||
});
|
||||
|
||||
tagsCache.selectize(jQuery('[data-selectize=tags]'), { lang: {
|
||||
'Add': '{'Create'|translate}'
|
||||
}});
|
||||
|
||||
{* <!-- CATEGORIES --> *}
|
||||
window.categoriesCache = new CategoriesCache({
|
||||
serverKey: '{$CACHE_KEYS.categories}',
|
||||
serverId: '{$CACHE_KEYS._hash}',
|
||||
rootUrl: '{$ROOT_URL}'
|
||||
});
|
||||
|
||||
var associated_categories = {$associated_categories|@json_encode};
|
||||
|
||||
categoriesCache.selectize(jQuery('[data-selectize=categories]'), {
|
||||
filter: function(categories, options) {
|
||||
if (this.name == 'dissociate') {
|
||||
var filtered = jQuery.grep(categories, function(cat) {
|
||||
return !!associated_categories[cat.id];
|
||||
});
|
||||
|
||||
if (filtered.length > 0) {
|
||||
options.default = filtered[0].id;
|
||||
}
|
||||
|
||||
return filtered;
|
||||
}
|
||||
else {
|
||||
return categories;
|
||||
}
|
||||
}
|
||||
});
|
||||
{/if}
|
||||
|
||||
|
||||
{* <!-- DATEPICKER --> *}
|
||||
jQuery(function(){ {* <!-- onLoad needed to wait localization loads --> *}
|
||||
jQuery('[data-datepicker]').pwgDatepicker({
|
||||
|
@ -54,9 +72,7 @@ str_no = '{'No, I have changed my mind'|translate|@escape:'javascript'}';
|
|||
str_orphan = '{'This photo is an orphan'|@translate|escape:javascript}';
|
||||
str_meta_warning = '{'Warning ! Unsaved changes will be lost'|translate|escape:javascript}';
|
||||
str_meta_yes = '{'I want to continue'|translate|escape:javascript}'
|
||||
str_meta_no = '{'No, I have changed my mind'|translate|escape:javascript}'
|
||||
|
||||
}());
|
||||
const strs_privacy = {
|
||||
"0" : "{$level_options[8]}",
|
||||
"1" : "{$level_options[4]}",
|
||||
|
@ -80,22 +96,23 @@ let b_current_picture_id;
|
|||
</div>
|
||||
{/if}
|
||||
{*Filters*}
|
||||
<form method="post" action="{$F_ACTION}" class="filter">
|
||||
<form method="post" action="{$F_ACTION}">
|
||||
{include file='include/batch_manager_filter.inc.tpl' title={'Batch Manager Filter'|@translate} searchPlaceholder={'Filters'|@translate}}
|
||||
</form>
|
||||
<legend style="padding: 1em;">
|
||||
<span class='icon-menu icon-blue'></span>
|
||||
Liste
|
||||
{'List'|@translate}
|
||||
<span class="count-badge"> {count($all_elements)}</span>
|
||||
</legend>
|
||||
{if !empty($elements) }
|
||||
<div style="margin: 10px 0; display: flex; justify-content: space-between; padding: 1em;">
|
||||
<div style="margin-right: 21px;" class="pagination-per-page">
|
||||
<span style="font-weight: bold;color: unset;">{'photos per page'|@translate} :</span>
|
||||
<a href="{$U_ELEMENTS_PAGE}&display=5">5</a>
|
||||
<a href="{$U_ELEMENTS_PAGE}&display=10">10</a>
|
||||
<a href="{$U_ELEMENTS_PAGE}&display=50">50</a>
|
||||
<div style="margin: 10px 0; display: flex; justify-content: space-between; padding: 1em; height: 33px;">
|
||||
<div style="margin-right: 21px;" class="pagination-per-page">
|
||||
<span style="font-weight: bold;color: unset;">{'photos per page'|@translate} :</span>
|
||||
<a href="{$U_ELEMENTS_PAGE}&display=5" class="{if $per_page == 5}selected-pagination{/if}">5</a>
|
||||
<a href="{$U_ELEMENTS_PAGE}&display=10" class="{if $per_page == 10}selected-pagination{/if}">10</a>
|
||||
<a href="{$U_ELEMENTS_PAGE}&display=50" class="{if $per_page == 50}selected-pagination{/if}">50</a>
|
||||
</div>
|
||||
|
||||
<div style="margin-left: 22px;">
|
||||
<div class="pagination-reload">
|
||||
{if !empty($navbar) }
|
||||
|
@ -105,11 +122,11 @@ let b_current_picture_id;
|
|||
</div>
|
||||
</div>
|
||||
{foreach from=$elements item=element}
|
||||
{footer_script}
|
||||
all_related_categories_ids.push({ id: {$element.ID}, cat_ids: {$element.related_category_ids} });
|
||||
{footer_script}
|
||||
all_related_categories_ids.push({ id: {$element.ID}, cat_ids: {$element.related_category_ids} });
|
||||
url_delete_{$element.id} = '{$element.U_DELETE}';
|
||||
{/footer_script}
|
||||
<div class="success deleted-badge" data-image_id="{$element.ID}" style="display: none;">
|
||||
<div class="infos deleted-badge" data-image_id="{$element.ID}" style="display: none;">
|
||||
<i class="icon-ok" style="font-size: 20px;"></i>
|
||||
<p>
|
||||
{'Image'|@translate}
|
||||
|
@ -163,16 +180,16 @@ let b_current_picture_id;
|
|||
<div class='info-framed-icon' style="margin-right:0px;">
|
||||
<i class='icon-picture'></i>
|
||||
</div>
|
||||
<span class="main-info-title" id="filename-{$element.id}">{$element.FILE}</span>
|
||||
<span class="main-info-desc" id="dimensions-{$element.id}">{$element.DIMENSIONS}</span>
|
||||
<span class="main-info-desc" id="filesize-{$element.id}">{$element.FILESIZE}</span>
|
||||
<span class="main-info-title" id="filename">{$element.FILE}</span>
|
||||
<span class="main-info-desc" id="dimensions">{$element.DIMENSIONS}</span>
|
||||
<span class="main-info-desc" id="filesize">{$element.FILESIZE}</span>
|
||||
<span class="main-info-desc">{$element.EXT}</span>
|
||||
</div>
|
||||
<div class="main-info-block">
|
||||
<div class='info-framed-icon' style="margin-right:0px;">
|
||||
<span class='icon-calendar'></span>
|
||||
</div>
|
||||
<span class="main-info-title">{$element.POST_DATE}</span>
|
||||
<span class="main-info-title first-letter-capitalize">{$element.POST_DATE}</span>
|
||||
<span class="main-info-desc">{$element.AGE}</span>
|
||||
<span class="main-info-desc">{$element.ADDED_BY}</span>
|
||||
<span class="main-info-desc">{$element.STATS}</span>
|
||||
|
@ -181,11 +198,11 @@ let b_current_picture_id;
|
|||
<div class="info-container">
|
||||
<div class="half-line-info-box">
|
||||
<strong>{'Title'|@translate}</strong>
|
||||
<input type="text" name="name" id="name-{$element.id}" value="{$element.NAME}">
|
||||
<input type="text" name="name" id="name" value="{$element.NAME}">
|
||||
</div>
|
||||
<div class="calendar-box">
|
||||
<strong>{'Creation date'|@translate}</strong>
|
||||
<input type="hidden" id="date_creation-{$element.id}" name="date_creation-{$element.id}" value="{$element.DATE_CREATION}">
|
||||
<input type="hidden" id="date_creation" name="date_creation-{$element.id}" value="{$element.DATE_CREATION}">
|
||||
<label class="calendar-input">
|
||||
<i class="icon-calendar"></i>
|
||||
<input type="text" data-datepicker="date_creation-{$element.id}" data-datepicker-unset="date_creation_unset-{$element.id}" readonly>
|
||||
|
@ -194,14 +211,14 @@ let b_current_picture_id;
|
|||
</div>
|
||||
<div class="half-line-info-box">
|
||||
<strong>{'Author'|@translate}</strong>
|
||||
<input type="text" name="author" id="author-{$element.id}" value="{$element.AUTHOR}">
|
||||
<input type="text" name="author" id="author" value="{$element.AUTHOR}">
|
||||
</div>
|
||||
<div class="half-line-info-box">
|
||||
<div class="privacy-label-container">
|
||||
<strong>{'Who can see ?'|@translate}</strong>
|
||||
<i>{'level of confidentiality'|@translate}</i>
|
||||
</div>
|
||||
<select name="level" id="level-{$element.id}" size="1">
|
||||
<select name="level" id="level" size="1">
|
||||
{html_options options=$level_options selected=$element.level_options_selected}
|
||||
</select>
|
||||
{*
|
||||
|
@ -219,11 +236,11 @@ let b_current_picture_id;
|
|||
</div>
|
||||
*}
|
||||
</div>
|
||||
<div class="full-line-tag-box">
|
||||
<div class="full-line-tag-box" id="action_add_tags">
|
||||
<strong>{'Tags'|@translate}</strong>
|
||||
<select id="tags-{$element.id}" data-selectize="tags" data-value="{$element.TAGS|@json_encode|escape:html}"placeholder="{'Type in a search term'|translate}"data-create="true" name="tags" id="tags-{$element.id}[]" multiple></select>
|
||||
<select id="tags" data-selectize="tags" data-value="{$element.TAGS|@json_encode|escape:html}"placeholder="{'Type in a search term'|translate}"data-create="true" name="tags" id="tags-{$element.id}[]" multiple></select>
|
||||
</div>
|
||||
<div class="full-line-info-box" id="{$element.ID}">
|
||||
<div class="full-line-box" id="{$element.ID}">
|
||||
<strong>{'Linked albums'|@translate} <span class="linked-albums-badge {if $element.related_categories|@count < 1 } badge-red {/if}"> {$element.related_categories|@count} </span></strong>
|
||||
{if $element.related_categories|@count
|
||||
< 1}
|
||||
|
@ -233,7 +250,7 @@ let b_current_picture_id;
|
|||
{/if}
|
||||
<div class="related-categories-container">
|
||||
{foreach from=$element.related_categories item=$cat_path key=$key}
|
||||
<div class="breadcrumb-item album-listed">
|
||||
<div class="breadcrumb-item">
|
||||
<span class="link-path">{$cat_path['name']}</span>
|
||||
{if $cat_path['unlinkable']}
|
||||
<span id={$key} class="icon-cancel-circled remove-item"></span>
|
||||
|
@ -250,8 +267,10 @@ let b_current_picture_id;
|
|||
</div>
|
||||
<div class="full-line-description-box">
|
||||
<strong>{'Description'|@translate}</strong>
|
||||
<textarea cols="50" rows="4" name="description" class="description-box" id="description-{$element.id}">{$element.DESCRIPTION}</textarea>
|
||||
<textarea cols="50" rows="4" name="description" class="description-box" id="description">{$element.DESCRIPTION}</textarea>
|
||||
</div>
|
||||
{if !empty($PLUGIN_BATCH_MANAGER_UNIT_PHOTO_END)}{$PLUGIN_BATCH_MANAGER_UNIT_PHOTO_END}{/if}
|
||||
{* Plugins anchor 1 *}
|
||||
<div class="validation-container">
|
||||
<div class="save-button-container">
|
||||
<div class="buttonLike action-save-picture buttonSubmitLocal">
|
||||
|
@ -281,21 +300,22 @@ let b_current_picture_id;
|
|||
</div>
|
||||
</fieldset>
|
||||
{/foreach}
|
||||
<div style="margin: 30px 0; display: flex; justify-content: space-between; padding: 1em;">
|
||||
<div class="pagination-per-page">
|
||||
<span class="thumbnailsActionsShow" style="font-weight: bold;">{'Display'|@translate}</span>
|
||||
<a id="pagination-per-page-5">5</a>
|
||||
<a id="pagination-per-page-10">10</a>
|
||||
<a id="pagination-per-page-50">50</a>
|
||||
</div>
|
||||
<div style="margin-left: 22px;">
|
||||
<div class="pagination-reload">
|
||||
{if !empty($navbar) }
|
||||
<a class="button-reload tiptip" title="Pagination has changed and needs to be reloaded !" style="display: none;" href="{$F_ACTION}"><i class="icon-cw"></i></a>
|
||||
{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin: 10px 0; display: flex; justify-content: space-between; padding: 1em; height: 33px;">
|
||||
<div style="margin-right: 21px;" class="pagination-per-page">
|
||||
<span style="font-weight: bold;color: unset;">{'photos per page'|@translate} :</span>
|
||||
<a href="{$U_ELEMENTS_PAGE}&display=5" class="{if $per_page == 5}selected-pagination{/if}">5</a>
|
||||
<a href="{$U_ELEMENTS_PAGE}&display=10" class="{if $per_page == 10}selected-pagination{/if}">10</a>
|
||||
<a href="{$U_ELEMENTS_PAGE}&display=50" class="{if $per_page == 50}selected-pagination{/if}">50</a>
|
||||
</div>
|
||||
|
||||
<div style="margin-left: 22px;">
|
||||
<div class="pagination-reload">
|
||||
{if !empty($navbar) }
|
||||
<a class="button-reload tiptip" title="{'Pagination has changed and needs to be reloaded !'|@translate}" style="display: none;" href="{$F_ACTION}"><i class="icon-cw"></i></a>
|
||||
{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="bottom-save-bar">
|
||||
<input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
|
||||
|
@ -329,41 +349,43 @@ let b_current_picture_id;
|
|||
{include file='include/album_selector.inc.tpl'
|
||||
title={'Associate to album'|@translate}
|
||||
searchPlaceholder={'Search'|@translate}
|
||||
admin_mode=true
|
||||
admin_mode=true
|
||||
}
|
||||
|
||||
{footer_script}
|
||||
var pluginFunctionNames = pluginFunctionMapInit(activePlugins);
|
||||
{/footer_script}
|
||||
|
||||
<style>
|
||||
.selectize-input .item,
|
||||
.selectize-input .item.active {
|
||||
background-image:none !important;
|
||||
background-color: #ffa646 !important;
|
||||
border-color: transparent !important;
|
||||
color: black !important;
|
||||
|
||||
|
||||
border-radius: 20px !important;
|
||||
#action_add_tags .item,
|
||||
#action_add_tags .item.active {
|
||||
background-image:none;
|
||||
background-color: #ffa646;
|
||||
border-color: transparent;
|
||||
color: black;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.selectize-input .item .remove,
|
||||
.selectize-input .item .remove {
|
||||
background-color: transparent !important;
|
||||
border-top-right-radius: 20px !important;
|
||||
border-bottom-right-radius: 20px !important;
|
||||
color: black !important;
|
||||
|
||||
border-left: 1px solid transparent !important;
|
||||
#action_add_tags .item .remove,
|
||||
#action_add_tags .item .remove {
|
||||
background-color: transparent;
|
||||
border-top-right-radius: 20px;
|
||||
border-bottom-right-radius: 20px;
|
||||
color: black;
|
||||
border-left: 1px solid transparent;
|
||||
|
||||
}
|
||||
.selectize-input .item .remove:hover,
|
||||
.selectize-input .item .remove:hover {
|
||||
background-color: #ff7700 !important;
|
||||
#action_add_tags .item .remove:hover,
|
||||
#action_add_tags .item .remove:hover {
|
||||
background-color: #ff7700;
|
||||
}
|
||||
|
||||
.selectize-input.items.not-full.has-options,
|
||||
/* .selectize-input.items.not-full.has-options,
|
||||
.selectize-input.items.not-full.has-options.focus.input-active.dropdown-active,
|
||||
.selectize-input.items.not-full,
|
||||
.selectize-input.items.full{
|
||||
border: 1px solid #D3D3D3 !important;
|
||||
}
|
||||
} */
|
||||
|
||||
.breadcrumb-item.add-item.highlight{
|
||||
color: #3C3C3C !important;
|
||||
|
@ -373,7 +395,4 @@ let b_current_picture_id;
|
|||
margin: 5px 0 5px 0 !important;
|
||||
}
|
||||
|
||||
.album-listed{
|
||||
background-color: #FFFFFF !important;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
{combine_script id='doubleSlider' load='footer' require='jquery.ui.slider' path='admin/themes/default/js/doubleSlider.js'}
|
||||
{combine_script id='jquery.selectize' load='header' path='themes/default/js/plugins/selectize.min.js'}
|
||||
{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.{$themeconf.colorscheme}.css"}
|
||||
{combine_script id='jquery.ui.slider' require='jquery.ui' load='async' path='themes/default/js/ui/minified/jquery.ui.slider.min.js'}
|
||||
{combine_css path="themes/default/js/ui/theme/jquery.ui.slider.css"}
|
||||
{combine_script id='LocalStorageCache' load='footer' path='admin/themes/default/js/LocalStorageCache.js'}
|
||||
|
||||
{footer_script}
|
||||
<!-- sliders config -->
|
||||
var sliders = {
|
||||
|
|
|
@ -921,6 +921,17 @@ LI.menuLi {
|
|||
}
|
||||
|
||||
/* Pagination */
|
||||
.user-pagination {
|
||||
margin: 0;
|
||||
display: flex;
|
||||
padding: 0;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.selected-pagination {
|
||||
background: #ffd2a1;
|
||||
}
|
||||
|
||||
.pagination-container {
|
||||
height: 40px;
|
||||
|
@ -3400,7 +3411,7 @@ LEGEND SPAN {
|
|||
|
||||
.pictureIdLabel{
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
bottom: 3px;
|
||||
right: 0px;
|
||||
align-items: right;
|
||||
color:#7a7a7a89;
|
||||
|
@ -3505,6 +3516,13 @@ LEGEND SPAN {
|
|||
height: 50px;
|
||||
}
|
||||
|
||||
.full-line-box{
|
||||
flex: 0 0 calc(100% - 20px);
|
||||
margin: 0px 10px;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
}
|
||||
|
||||
.full-line-info-box{
|
||||
flex: 0 0 calc(100% - 20px);
|
||||
margin: 0px 10px;
|
||||
|
@ -3584,8 +3602,6 @@ LEGEND SPAN {
|
|||
outline: none !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.privacy-label-container{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
@ -3596,6 +3612,7 @@ LEGEND SPAN {
|
|||
color: #ffa646;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.bottom-save-bar{
|
||||
display:flex;
|
||||
flex-direction: row;
|
||||
|
@ -3612,7 +3629,7 @@ LEGEND SPAN {
|
|||
|
||||
.action-save-global{
|
||||
margin: 10px 0;
|
||||
margin-right: 2%;
|
||||
margin-right: 1.5em;
|
||||
}
|
||||
|
||||
.badge-container {
|
||||
|
@ -3664,7 +3681,6 @@ LEGEND SPAN {
|
|||
align-items: center;
|
||||
padding:0px;
|
||||
margin: 1.5em !important;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.validation-container{
|
||||
|
@ -6529,7 +6545,6 @@ li.plupload_delete a:hover {background: url("images/cancelhover.svg")!important;
|
|||
|
||||
#pictureModify .selectize-input.items.not-full, .elementEdit .selectize-input.items.not-full {
|
||||
height: auto !important;
|
||||
min-height: 45px;
|
||||
max-height: 184px;
|
||||
}
|
||||
|
||||
|
|
|
@ -1911,7 +1911,7 @@ li.plupload_delete a:hover {background: url("images/cancelhover.svg")!important;
|
|||
|
||||
.breadcrumb-item {
|
||||
background-color: #333;
|
||||
box-shadow: 0px 2px #00000070;
|
||||
box-shadow: 0px 2px #000000AA;
|
||||
color: #777;
|
||||
}
|
||||
.breadcrumb-item:hover {
|
||||
|
@ -2091,4 +2091,80 @@ ul.jqtree-tree li.jqtree-ghost span.jqtree-line {
|
|||
|
||||
.desc-modal-body textarea {
|
||||
background-color: #333 !important;
|
||||
}
|
||||
|
||||
/* Batch manager, unit mode */
|
||||
|
||||
.elementEdit{
|
||||
background-color:#555555;
|
||||
}
|
||||
|
||||
.main-info-block{
|
||||
border: 1px solid #333333;
|
||||
background: #333333;
|
||||
}
|
||||
|
||||
.main-info-desc {
|
||||
color: #777777;
|
||||
}
|
||||
|
||||
.main-info-title {
|
||||
color: #C1C1C1;
|
||||
}
|
||||
|
||||
.bottom-save-bar{
|
||||
background-color: #444444;
|
||||
border-top: 1px solid #666;
|
||||
}
|
||||
|
||||
.media-box{
|
||||
background-color: #1C1C1C;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.full-line-info-box input,
|
||||
.half-line-info-box input,
|
||||
.half-line-info-box select,
|
||||
.full-line-tag-box select,
|
||||
.calendar-input,
|
||||
.description-box{
|
||||
border: 1px solid #474747;
|
||||
background-color: #333333 !important;
|
||||
color: #757575;
|
||||
}
|
||||
|
||||
.full-line-info-box,
|
||||
.half-line-info-box,
|
||||
.calendar-box,
|
||||
.full-line-description-box,
|
||||
.full-line-tag-box{
|
||||
color: #A4A4A4;
|
||||
}
|
||||
|
||||
.calendar-input input{
|
||||
background-color: #333333 !important;
|
||||
}
|
||||
|
||||
.pictureIdLabel{
|
||||
color: #C1C1C1;
|
||||
}
|
||||
|
||||
.badge-unsaved{
|
||||
background-color: #FADDA2;
|
||||
color: #E18C32;
|
||||
}
|
||||
|
||||
.badge-succes{
|
||||
background-color: #AAF6E4;
|
||||
color: #4EA590;
|
||||
}
|
||||
|
||||
.badge-error{
|
||||
background-color: #BE4949;
|
||||
color: #FFC8C8;
|
||||
}
|
||||
|
||||
.first-letter-capitalize::first-letter {
|
||||
text-transform: uppercase;
|
||||
}
|
|
@ -29,6 +29,18 @@ function ws_add_image_category_relations($image_id, $categories_string, $replace
|
|||
$rank_on_category = array();
|
||||
$search_current_ranks = false;
|
||||
|
||||
if (empty($categories_string)) {
|
||||
if ($replace_mode) {
|
||||
$query = '
|
||||
DELETE
|
||||
FROM '.IMAGE_CATEGORY_TABLE.'
|
||||
WHERE image_id = '.$image_id.'
|
||||
;';
|
||||
pwg_query($query);
|
||||
update_category([]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
$tokens = explode(';', $categories_string);
|
||||
foreach ($tokens as $token)
|
||||
{
|
||||
|
@ -57,9 +69,16 @@ function ws_add_image_category_relations($image_id, $categories_string, $replace
|
|||
|
||||
if (count($cat_ids) == 0)
|
||||
{
|
||||
return new PwgError(500,
|
||||
'[ws_add_image_category_relations] there is no category defined in "'.$categories_string.'"'
|
||||
);
|
||||
if ($replace_mode) {
|
||||
$query = '
|
||||
DELETE
|
||||
FROM '.IMAGE_CATEGORY_TABLE.'
|
||||
WHERE image_id = '.$image_id.'
|
||||
;';
|
||||
pwg_query($query);
|
||||
update_category([]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
$query = '
|
||||
|
@ -157,6 +176,7 @@ SELECT category_id, MAX(`rank`) AS max_rank
|
|||
|
||||
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
|
||||
update_category($new_cat_ids);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1280,7 +1280,6 @@ $lang['No search in progress'] = 'No search in progress';
|
|||
$lang['Create a new album at root'] = 'Create a new album at root';
|
||||
$lang['Create a sub-album of "%s"'] = 'Create a sub-album of "%s"';
|
||||
$lang['No research in progress'] = 'No research in progress';
|
||||
|
||||
$lang['Visited'] = 'Visited';
|
||||
$lang['Downloaded'] = 'Downloaded';
|
||||
$lang['Additional filters'] = 'Additional filters';
|
||||
|
@ -1290,7 +1289,6 @@ $lang['Add as filter'] = 'Add as filter';
|
|||
$lang['Show plugins compatible with previous version of Piwigo'] = 'Show plugins compatible with previous version of Piwigo';
|
||||
$lang['Place first'] = 'Place first';
|
||||
$lang['Place last'] = 'Place last';
|
||||
|
||||
$lang['Piwigo is also on mobile.'] = 'Piwigo is also on mobile.';
|
||||
$lang['Try now !'] = 'Try now!';
|
||||
$lang['Install Piwigo on mobile'] = 'Install Piwigo on mobile';
|
||||
|
@ -1377,4 +1375,6 @@ $lang['Create a root album'] = 'Create a root album';
|
|||
$lang['Create your first album'] = 'Create your first album';
|
||||
$lang['First choose an album, then add your files'] = 'First choose an album, then add your files';
|
||||
$lang['Select or create an album'] = 'Select or create an album';
|
||||
$lang['List'] = 'List';
|
||||
$lang['Added on %s'] = 'Added on %s';
|
||||
// Leave this line empty
|
||||
|
|
|
@ -1377,4 +1377,6 @@ $lang['Create a root album'] = 'Créer un album racine';
|
|||
$lang['Create your first album'] = 'Créez votre premier album';
|
||||
$lang['First choose an album, then add your files'] = 'Choisissez d\'abord un album, puis ajoutez vos fichiers';
|
||||
$lang['Select or create an album'] = 'Sélectionner ou créer un album';
|
||||
$lang['List'] = 'Liste';
|
||||
$lang['Added on %s'] = 'Ajouté le %s';
|
||||
// Leave this line empty
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue