mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-05 17:32:25 +02:00
related to #1465 better indent, new translation line + add guest as filter
This commit is contained in:
committed by
plegall
parent
f9d800abcb
commit
1ada02c1b6
@@ -607,6 +607,7 @@ $template->assign(
|
||||
|
||||
$template->assign('display_thumbnails', $display_thumbnails);
|
||||
$template->assign('display_thumbnail_selected', $form['display_thumbnail']);
|
||||
$template->assign('guest_id', $conf['guest_id']);
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | html code display |
|
||||
|
||||
@@ -113,6 +113,18 @@ function fillSummaryResult(summary) {
|
||||
$(".summary-users .summary-data").html(summary.USERS);
|
||||
$(".summary-guests .summary-data").html(summary.GUESTS);
|
||||
|
||||
(summary.GUESTS.split(" ")[0] != "0") ? $(".summary-guests .summary-data").addClass("icon-plus-circled").on("click", function () {
|
||||
if (current_param.user == "-1") {
|
||||
current_param.user = guest_id;
|
||||
addUserFilter(str_guest);
|
||||
fillHistoryResult(current_param);
|
||||
}
|
||||
}).hover(function () {
|
||||
$(this).css({
|
||||
cursor : "pointer"
|
||||
})
|
||||
}) : console.log();
|
||||
|
||||
var id_of = [];
|
||||
var user_dot_title = "";
|
||||
|
||||
@@ -378,7 +390,7 @@ function addIpFilter(ip) {
|
||||
newFilter.removeClass("hide");
|
||||
|
||||
newFilter.find(".filter-title").html(ip);
|
||||
newFilter.find(".filter-icon").addClass("icon-code");
|
||||
newFilter.find(".filter-icon").html("IP ").addClass("bold");
|
||||
|
||||
newFilter.find(".remove-filter").on("click", function () {
|
||||
$(this).parent().remove();
|
||||
|
||||
@@ -42,6 +42,8 @@ const str_recent_cats = "{'Recent albums'|translate}";
|
||||
const str_recent_pics = "{'Recent photos'|translate}";
|
||||
const str_memories = "{'Memories'|translate}";
|
||||
const unit_MB = "{"%s MB"|@translate}";
|
||||
const str_guest = '{'guest'|@translate}';
|
||||
const guest_id = {$guest_id};
|
||||
{/footer_script}
|
||||
|
||||
{combine_script id='common' load='footer' path='admin/themes/default/js/common.js'}
|
||||
@@ -58,7 +60,7 @@ const unit_MB = "{"%s MB"|@translate}";
|
||||
<fieldset class="history-filter">
|
||||
<div class="selectable-filter">
|
||||
<div class="filter-part date-start">
|
||||
<label>{'Date'|@translate}</label>
|
||||
<label>{'Start-Date'|@translate}</label>
|
||||
<input type="hidden" name="start" value="{$START}">
|
||||
<label>
|
||||
<input type="text" data-datepicker="start" data-datepicker-end="end" data-datepicker-unset="start_unset" readonly>
|
||||
@@ -88,8 +90,7 @@ const unit_MB = "{"%s MB"|@translate}";
|
||||
<label>{'Personnalized filters'|translate}</label>
|
||||
<div class="filter-container">
|
||||
<div id="default-filter" class="filter-item hide">
|
||||
<i class="filter-icon"> </i>
|
||||
<span class="filter-title"> test </span><span class="remove-filter icon-cancel"></span>
|
||||
<span class="filter-icon"></span><span class="filter-title"> test </span><span class="remove-filter icon-cancel"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -142,6 +143,7 @@ const unit_MB = "{"%s MB"|@translate}";
|
||||
<div class="summary-guests">
|
||||
<span class="icon-blue icon-user-secret summary-icons"></span>
|
||||
<span class="summary-data"> </span>
|
||||
<span class="addGuestFilter"> </span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -364,7 +366,7 @@ jQuery(document).ready( function() {
|
||||
.filter-title, .remove-filter, .filter-icon {
|
||||
color: #777;
|
||||
background: #fff;
|
||||
padding: 10px 0;
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.filter-title {
|
||||
|
||||
@@ -5607,4 +5607,12 @@ color:#FF7B00;
|
||||
|
||||
.hasDatepicker, .elem-type-select {
|
||||
background: white !important;
|
||||
}
|
||||
|
||||
.selectable-filter label {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.selectable-filter .elem-type-select {
|
||||
margin-top: 5px !important;
|
||||
}
|
||||
@@ -1674,7 +1674,7 @@ li.plupload_delete a:hover {background: url("images/cancelhover.svg")!important;
|
||||
}
|
||||
|
||||
.history-filter {
|
||||
background: transparent;
|
||||
background: #333 !important;
|
||||
color: #a1a1a1;
|
||||
box-shadow: 0px 2px 4px #00000024;
|
||||
}
|
||||
@@ -1685,6 +1685,7 @@ li.plupload_delete a:hover {background: url("images/cancelhover.svg")!important;
|
||||
}
|
||||
|
||||
.hasDatepicker, .elem-type-select {
|
||||
background: #444 !important;
|
||||
border-color: #c1c1c1 !important;
|
||||
background: #252525 !important;
|
||||
border-color: transparent !important;
|
||||
color: #777;
|
||||
}
|
||||
+114
-116
@@ -585,135 +585,135 @@ SELECT
|
||||
function ws_history_search($param, &$service)
|
||||
{
|
||||
|
||||
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
|
||||
include_once(PHPWG_ROOT_PATH.'admin/include/functions_history.inc.php');
|
||||
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
|
||||
include_once(PHPWG_ROOT_PATH.'admin/include/functions_history.inc.php');
|
||||
|
||||
global $conf;
|
||||
global $conf;
|
||||
|
||||
if (isset($_GET['start']) and is_numeric($_GET['start']))
|
||||
{
|
||||
$page['start'] = $_GET['start'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$page['start'] = 0;
|
||||
}
|
||||
if (isset($_GET['start']) and is_numeric($_GET['start']))
|
||||
{
|
||||
$page['start'] = $_GET['start'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$page['start'] = 0;
|
||||
}
|
||||
|
||||
$types = array_merge(array('none'), get_enums(HISTORY_TABLE, 'image_type'));
|
||||
$types = array_merge(array('none'), get_enums(HISTORY_TABLE, 'image_type'));
|
||||
|
||||
$display_thumbnails = array('no_display_thumbnail' => l10n('No display'),
|
||||
'display_thumbnail_classic' => l10n('Classic display'),
|
||||
'display_thumbnail_hoverbox' => l10n('Hoverbox display')
|
||||
);
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | Build search criteria and redirect to results |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
$page['errors'] = array();
|
||||
$search = array();
|
||||
|
||||
// date start
|
||||
if (!empty($param['start']))
|
||||
{
|
||||
check_input_parameter('start', $param, false, '/^\d{4}-\d{2}-\d{2}$/');
|
||||
$search['fields']['date-after'] = $param['start'];
|
||||
}
|
||||
|
||||
// date end
|
||||
if (!empty($param['end']))
|
||||
{
|
||||
check_input_parameter('end', $param, false, '/^\d{4}-\d{2}-\d{2}$/');
|
||||
$search['fields']['date-before'] = $param['end'];
|
||||
}
|
||||
|
||||
// types
|
||||
if (empty($param['types']))
|
||||
{
|
||||
$search['fields']['types'] = $types;
|
||||
}
|
||||
else
|
||||
{
|
||||
check_input_parameter('types', $param, true, '/^('.implode('|', $types).')$/');
|
||||
$search['fields']['types'] = $param['types'];
|
||||
}
|
||||
|
||||
// user
|
||||
$search['fields']['user'] = intval($param['user']);
|
||||
|
||||
// image
|
||||
if (!empty($param['image_id']))
|
||||
{
|
||||
$search['fields']['image_id'] = intval($param['image_id']);
|
||||
}
|
||||
|
||||
// filename
|
||||
if (!empty($param['filename']))
|
||||
{
|
||||
$search['fields']['filename'] = str_replace(
|
||||
'*',
|
||||
'%',
|
||||
pwg_db_real_escape_string($param['filename'])
|
||||
$display_thumbnails = array('no_display_thumbnail' => l10n('No display'),
|
||||
'display_thumbnail_classic' => l10n('Classic display'),
|
||||
'display_thumbnail_hoverbox' => l10n('Hoverbox display')
|
||||
);
|
||||
}
|
||||
|
||||
// ip
|
||||
if (!empty($param['ip']))
|
||||
{
|
||||
$search['fields']['ip'] = str_replace(
|
||||
'*',
|
||||
'%',
|
||||
pwg_db_real_escape_string($param['ip'])
|
||||
);
|
||||
}
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | Build search criteria and redirect to results |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
// thumbnails
|
||||
check_input_parameter('display_thumbnail', $param, false, '/^('.implode('|', array_keys($display_thumbnails)).')$/');
|
||||
$page['errors'] = array();
|
||||
$search = array();
|
||||
|
||||
$search['fields']['display_thumbnail'] = $param['display_thumbnail'];
|
||||
// Display choise are also save to one cookie
|
||||
if (!empty($param['display_thumbnail'])
|
||||
and isset($display_thumbnails[$param['display_thumbnail']]))
|
||||
{
|
||||
$cookie_val = $param['display_thumbnail'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$cookie_val = null;
|
||||
}
|
||||
// date start
|
||||
if (!empty($param['start']))
|
||||
{
|
||||
check_input_parameter('start', $param, false, '/^\d{4}-\d{2}-\d{2}$/');
|
||||
$search['fields']['date-after'] = $param['start'];
|
||||
}
|
||||
|
||||
pwg_set_cookie_var('display_thumbnail', $cookie_val, strtotime('+1 month') );
|
||||
// date end
|
||||
if (!empty($param['end']))
|
||||
{
|
||||
check_input_parameter('end', $param, false, '/^\d{4}-\d{2}-\d{2}$/');
|
||||
$search['fields']['date-before'] = $param['end'];
|
||||
}
|
||||
|
||||
// TODO manage inconsistency of having $_POST['image_id'] and
|
||||
// $_POST['filename'] simultaneously
|
||||
// types
|
||||
if (empty($param['types']))
|
||||
{
|
||||
$search['fields']['types'] = $types;
|
||||
}
|
||||
else
|
||||
{
|
||||
check_input_parameter('types', $param, true, '/^('.implode('|', $types).')$/');
|
||||
$search['fields']['types'] = $param['types'];
|
||||
}
|
||||
|
||||
// store seach in database
|
||||
if (!empty($search))
|
||||
{
|
||||
// register search rules in database, then they will be available on
|
||||
// thumbnails page and picture page.
|
||||
$query ='
|
||||
INSERT INTO '.SEARCH_TABLE.'
|
||||
(rules)
|
||||
VALUES
|
||||
(\''.pwg_db_real_escape_string(serialize($search)).'\')
|
||||
;';
|
||||
// user
|
||||
$search['fields']['user'] = intval($param['user']);
|
||||
|
||||
pwg_query($query);
|
||||
// image
|
||||
if (!empty($param['image_id']))
|
||||
{
|
||||
$search['fields']['image_id'] = intval($param['image_id']);
|
||||
}
|
||||
|
||||
$search_id = pwg_db_insert_id(SEARCH_TABLE);
|
||||
// filename
|
||||
if (!empty($param['filename']))
|
||||
{
|
||||
$search['fields']['filename'] = str_replace(
|
||||
'*',
|
||||
'%',
|
||||
pwg_db_real_escape_string($param['filename'])
|
||||
);
|
||||
}
|
||||
|
||||
// Remove redirect for ajax //
|
||||
// redirect(
|
||||
// PHPWG_ROOT_PATH.'admin.php?page=history&search_id='.$search_id
|
||||
// );
|
||||
}
|
||||
else
|
||||
{
|
||||
$page['errors'][] = l10n('Empty query. No criteria has been entered.');
|
||||
}
|
||||
// ip
|
||||
if (!empty($param['ip']))
|
||||
{
|
||||
$search['fields']['ip'] = str_replace(
|
||||
'*',
|
||||
'%',
|
||||
pwg_db_real_escape_string($param['ip'])
|
||||
);
|
||||
}
|
||||
|
||||
// what are the lines to display in reality ?
|
||||
// thumbnails
|
||||
check_input_parameter('display_thumbnail', $param, false, '/^('.implode('|', array_keys($display_thumbnails)).')$/');
|
||||
|
||||
$search['fields']['display_thumbnail'] = $param['display_thumbnail'];
|
||||
// Display choise are also save to one cookie
|
||||
if (!empty($param['display_thumbnail'])
|
||||
and isset($display_thumbnails[$param['display_thumbnail']]))
|
||||
{
|
||||
$cookie_val = $param['display_thumbnail'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$cookie_val = null;
|
||||
}
|
||||
|
||||
pwg_set_cookie_var('display_thumbnail', $cookie_val, strtotime('+1 month') );
|
||||
|
||||
// TODO manage inconsistency of having $_POST['image_id'] and
|
||||
// $_POST['filename'] simultaneously
|
||||
|
||||
// store seach in database
|
||||
if (!empty($search))
|
||||
{
|
||||
// register search rules in database, then they will be available on
|
||||
// thumbnails page and picture page.
|
||||
$query ='
|
||||
INSERT INTO '.SEARCH_TABLE.'
|
||||
(rules)
|
||||
VALUES
|
||||
(\''.pwg_db_real_escape_string(serialize($search)).'\')
|
||||
;';
|
||||
|
||||
pwg_query($query);
|
||||
|
||||
$search_id = pwg_db_insert_id(SEARCH_TABLE);
|
||||
|
||||
// Remove redirect for ajax //
|
||||
// redirect(
|
||||
// PHPWG_ROOT_PATH.'admin.php?page=history&search_id='.$search_id
|
||||
// );
|
||||
}
|
||||
else
|
||||
{
|
||||
$page['errors'][] = l10n('Empty query. No criteria has been entered.');
|
||||
}
|
||||
|
||||
// what are the lines to display in reality ?
|
||||
$query = '
|
||||
SELECT rules
|
||||
FROM '.SEARCH_TABLE.'
|
||||
@@ -1011,8 +1011,6 @@ SELECT
|
||||
|
||||
unset($name_of_tag);
|
||||
|
||||
sleep(3);
|
||||
|
||||
return array(
|
||||
'lines' => $result,
|
||||
'params' => $param,
|
||||
|
||||
@@ -417,4 +417,5 @@ $lang['generate random password'] = 'generate random password';
|
||||
$lang['Related albums'] = 'Related albums';
|
||||
$lang['Album name, 1 → 5 → 10 → 100'] = 'Album name, 1 → 5 → 10 → 100';
|
||||
$lang['Album name, 100 → 10 → 5 → 1'] = 'Album name, 100 → 10 → 5 → 1';
|
||||
$lang['Start-Date'] = 'Start date';
|
||||
?>
|
||||
|
||||
@@ -417,4 +417,4 @@ $lang['Related albums'] = 'Albums liés';
|
||||
$lang['Password: ********** (no copy by email)'] = 'Mot de passe : ********** (pas de copie par email)';
|
||||
$lang['Album name, 1 → 5 → 10 → 100'] = 'Nom d\'album, 1 → 5 → 10 → 100';
|
||||
$lang['Album name, 100 → 10 → 5 → 1'] = 'Nom d\'album, 100 → 10 → 5 → 1';
|
||||
|
||||
$lang['Start-Date'] = 'Date de début';
|
||||
|
||||
Reference in New Issue
Block a user