diff --git a/admin/themes/default/js/history.js b/admin/themes/default/js/history.js index f15fa4c18..6dbfd9387 100644 --- a/admin/themes/default/js/history.js +++ b/admin/themes/default/js/history.js @@ -114,8 +114,8 @@ function fillSummaryResult(summary) { if ((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; + if (current_param.user_id == "-1") { + current_param.user_id = guest_id; addGuestFilter(str_guest); fillHistoryResult(current_param); } @@ -155,8 +155,8 @@ function fillSummaryResult(summary) { new_user_item.data("user-id", id_of[key]); new_user_item.on("click", function () { - if (current_param.user != id_of[key]) { - current_param.user = $(this).data("user-id"); + if (current_param.user_id != id_of[key]) { + current_param.user_id = $(this).data("user-id"); addUserFilter(key) fillHistoryResult(current_param); } @@ -272,9 +272,9 @@ function lineConstructor(line, id, imageDisplay) { newLine.find(".user-name").html(line.USERNAME + ''); newLine.find(".user-name").attr("id", line.USERID); - if (current_param.user == "-1") { + if (current_param.user_id == "-1") { newLine.find(".user-name").on("click", function () { - current_param.user = $(this).attr('id') + ""; + current_param.user_id = $(this).attr('id') + ""; current_param.pageNumber = 0; addUserFilter($(this).html()); fillHistoryResult(current_param); @@ -422,7 +422,7 @@ function addUserFilter(username) { newFilter.find(".remove-filter").on("click", function () { $(this).parent().remove(); - current_param.user = "-1"; + current_param.user_id = "-1"; current_param.pageNumber = 0; fillHistoryResult(current_param); checkFilters(); @@ -444,7 +444,7 @@ function addGuestFilter(username) { newFilter.find(".remove-filter").on("click", function () { $(this).parent().remove(); - current_param.user = "-1"; + current_param.user_id = "-1"; current_param.pageNumber = 0; fillHistoryResult(current_param); checkFilters(); diff --git a/admin/themes/default/template/history.tpl b/admin/themes/default/template/history.tpl index 9de626455..a6730faf7 100644 --- a/admin/themes/default/template/history.tpl +++ b/admin/themes/default/template/history.tpl @@ -24,7 +24,7 @@ var current_param = { 2: "high", 3: "other" }, - user: "-1", + user_id: "-1", image_id: "", filename: "", ip: "", diff --git a/include/ws_functions/pwg.php b/include/ws_functions/pwg.php index d73111586..b78685f13 100644 --- a/include/ws_functions/pwg.php +++ b/include/ws_functions/pwg.php @@ -674,7 +674,7 @@ function ws_history_search($param, &$service) } // user - $search['fields']['user'] = intval($param['user']); + $search['fields']['user'] = intval($param['user_id']); // image if (!empty($param['image_id'])) diff --git a/ws.php b/ws.php index 31e2d88d8..47467dd7d 100644 --- a/ws.php +++ b/ws.php @@ -1309,8 +1309,47 @@ enabled_high, registration_date, registration_date_string, registration_date_sin $service->addMethod( 'pwg.history.search', 'ws_history_search', - null, - 'Gives an history of who has visited the galery and the actions done in it. Receives parameter.', + array( + 'start' => array( + 'default' => null + ), + 'end' => array( + 'default' => null + ), + 'types' => array( + 'flags'=>WS_PARAM_FORCE_ARRAY, + 'default' => array( + 'none', + 'picture', + 'high', + 'other', + ) + ), + 'user_id' => array( + 'default' => -1, + ), + 'image_id' => array( + 'default' => null, + 'type' => WS_TYPE_ID, + ), + 'filename' => array( + 'default' => null + ), + 'ip' => array( + 'default' => null + ), + 'display_thumbnail' => array( + 'default' => 'display_thumbnail_classic' + ), + 'pageNumber' => array( + 'default' => null, + 'type' => WS_TYPE_INT|WS_TYPE_POSITIVE, + ), + ), + 'Gives an history of who has visited the galery and the actions done in it. Receives parameter. +
Types can be : \'none\', \'picture\', \'high\', \'other\' +
Date format is yyyy-mm-dd +
display_thumbnail can be : \'no_display_thumbnail\', \'display_thumbnail_classic\', \'display_thumbnail_hoverbox\'', $ws_functions_root . 'pwg.php' ); }