From 453de4a3d1568603fb1eaa72bbc50932b744da2c Mon Sep 17 00:00:00 2001 From: Matthieu Leproux Date: Wed, 9 Nov 2022 12:41:49 +0100 Subject: [PATCH] fixed #1783 added image filter from the edit image page --- admin/history.php | 3 ++- admin/picture_modify.php | 1 + admin/themes/default/js/history.js | 3 +++ admin/themes/default/template/history.tpl | 2 +- admin/themes/default/template/picture_modify.tpl | 1 + 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/admin/history.php b/admin/history.php index a09eede93..ed0969930 100644 --- a/admin/history.php +++ b/admin/history.php @@ -101,10 +101,11 @@ else } $form_param['ip'] = isset($_GET['filter_ip']) ? $_GET['filter_ip'] : @$form['ip']; +$form_param['image_id'] = isset($_GET['filter_image_id']) ? $_GET['filter_image_id'] : @$form['image_id']; $template->assign( array( - 'IMAGE_ID' => @$form['image_id'], + 'IMAGE_ID' => $form_param['image_id'], 'FILENAME' => @$form['filename'], 'IP' => $form_param['ip'], 'START' => @$form['start'], diff --git a/admin/picture_modify.php b/admin/picture_modify.php index b56f0942a..2252a246c 100644 --- a/admin/picture_modify.php +++ b/admin/picture_modify.php @@ -241,6 +241,7 @@ $template->assign( 'U_DOWNLOAD' => 'action.php?id='.$_GET['image_id'].'&part=e&pwg_token='.get_pwg_token().'&download', 'U_SYNC' => $admin_url_start.'&sync_metadata=1', 'U_DELETE' => $admin_url_start.'&delete=1&pwg_token='.get_pwg_token(), + 'U_HISTORY' => get_root_url().'admin.php?page=history&filter_image_id='.$_GET['image_id'], 'PATH'=>$row['path'], diff --git a/admin/themes/default/js/history.js b/admin/themes/default/js/history.js index 9d40e4474..c27494a1a 100644 --- a/admin/themes/default/js/history.js +++ b/admin/themes/default/js/history.js @@ -6,6 +6,9 @@ $(document).ready(() => { if (current_param.ip != "") { addIpFilter(current_param.ip); } + if (current_param.image_id != "") { + addImageFilter(current_param.image_id); + } $(".elem-type-select").on("change", function (e) { console.log($(".elem-type-select option:selected").attr("value")); diff --git a/admin/themes/default/template/history.tpl b/admin/themes/default/template/history.tpl index 4c7732a8e..70a7bc182 100644 --- a/admin/themes/default/template/history.tpl +++ b/admin/themes/default/template/history.tpl @@ -25,7 +25,7 @@ var current_param = { 3: "other" }, user_id: "-1", - image_id: "", + image_id: {if isset($IMAGE_ID)}"{$IMAGE_ID}"{else}""{/if}, filename: "", ip:{if isset($IP)}"{$IP}"{else}""{/if}, display_thumbnail: "display_thumbnail_classic", diff --git a/admin/themes/default/template/picture_modify.tpl b/admin/themes/default/template/picture_modify.tpl index 9df5d55d5..d4b3d3122 100644 --- a/admin/themes/default/template/picture_modify.tpl +++ b/admin/themes/default/template/picture_modify.tpl @@ -108,6 +108,7 @@ $('#action-delete-picture').on('click', function() { {/if} + {if !url_is_remote($PATH)}