Merge branch 'ent-4309-Falta-mensaje-de-Successfull-al-cambiar-el-owner-de-un-evento' into 'develop'

Added success and error messages when change the event owner - #4309

See merge request artica/pandorafms!2590
This commit is contained in:
Daniel Rodriguez 2019-07-11 11:36:03 +02:00
commit ac3de84bda
4 changed files with 62 additions and 33 deletions

View File

@ -1139,6 +1139,7 @@ if ($get_extended_event) {
$dialog_page = get_parameter('dialog_page', 'general');
$filter = get_parameter('filter', []);
$similar_ids = get_parameter('similar_ids', $event_id);
$group_rep = $filter['group_rep'];
$event_rep = $event['event_rep'];
$timestamp_first = $event['min_timestamp'];
@ -1146,6 +1147,8 @@ if ($get_extended_event) {
$server_id = $event['server_id'];
$comments = $event['comments'];
$event['similar_ids'] = $similar_ids;
if (!isset($comments)) {
$comments = $event['user_comment'];
}

View File

@ -4398,6 +4398,8 @@ function events_page_general($event)
$data[1] = $user_owner;
}
$table_general->cellclass[3][1] = 'general_owner';
$table_general->data[] = $data;
$data = [];
@ -4465,6 +4467,8 @@ function events_page_general($event)
$data[1] = '<i>'.__('N/A').'</i>';
}
$table_general->cellclass[7][1] = 'general_status';
$table_general->data[] = $data;
$data = [];

View File

@ -437,19 +437,18 @@ function event_change_status(event_ids) {
var meta = $("#hidden-meta").val();
var history = $("#hidden-history").val();
var params = [];
params.push("page=include/ajax/events");
params.push("change_status=1");
params.push("event_ids=" + event_ids);
params.push("new_status=" + new_status);
params.push("meta=" + meta);
params.push("history=" + history);
$("#button-status_button").attr("disabled", "disabled");
$("#response_loading").show();
jQuery.ajax({
data: params.join("&"),
data: {
page: "include/ajax/events",
change_status: 1,
event_ids: event_ids,
new_status: new_status,
meta: meta,
history: history
},
type: "POST",
url: $("#hidden-ajax_file").val(),
async: true,
@ -457,12 +456,21 @@ function event_change_status(event_ids) {
success: function(data) {
$("#button-status_button").removeAttr("disabled");
$("#response_loading").hide();
show_event_dialog(
event_id,
$("#hidden-group_rep").val(),
"responses",
data
);
if ($("#notification_status_success").length) {
$("#notification_status_success").hide();
}
if ($("#notification_status_error").length) {
$("#notification_status_error").hide();
}
if (data == "status_ok") {
dt_events.draw(false);
$("#notification_status_success").show();
} else {
$("#notification_status_error").show();
}
}
});
return false;
@ -475,19 +483,18 @@ function event_change_owner() {
var meta = $("#hidden-meta").val();
var history = $("#hidden-history").val();
var params = [];
params.push("page=include/ajax/events");
params.push("change_owner=1");
params.push("event_id=" + event_id);
params.push("new_owner=" + new_owner);
params.push("meta=" + meta);
params.push("history=" + history);
$("#button-owner_button").attr("disabled", "disabled");
$("#response_loading").show();
jQuery.ajax({
data: params.join("&"),
data: {
page: "include/ajax/events",
change_owner: 1,
event_id: event_id,
new_owner: new_owner,
meta: meta,
history: history
},
type: "POST",
url: $("#hidden-ajax_file").val(),
async: true,
@ -496,12 +503,29 @@ function event_change_owner() {
$("#button-owner_button").removeAttr("disabled");
$("#response_loading").hide();
show_event_dialog(
event_id,
$("#hidden-group_rep").val(),
"responses",
data
);
if ($("#notification_owner_success").length) {
$("#notification_owner_success").hide();
}
if ($("#notification_owner_error").length) {
$("#notification_owner_error").hide();
}
if (data == "owner_ok") {
dt_events.draw(false);
$("#notification_owner_success").show();
if (new_owner == -1) {
$("#extended_event_general_page table td.general_owner").html(
"<i>N/A</i>"
);
} else {
$("#extended_event_general_page table td.general_owner").text(
new_owner
);
}
} else {
$("#notification_owner_error").show();
}
}
});

View File

@ -271,6 +271,7 @@ ul.ui-tabs-nav.ui-corner-all.ui-helper-reset.ui-helper-clearfix.ui-widget-header
margin: 0;
margin-bottom: -1px;
border: none;
border-bottom: 1px solid #a9a9a9;
}
ul.ui-tabs-nav.ui-corner-all.ui-helper-reset.ui-helper-clearfix.ui-widget-header
@ -298,9 +299,6 @@ li.ui-tabs-tab.ui-corner-top.ui-state-default.ui-tab {
li.ui-tabs-tab.ui-corner-top.ui-state-default.ui-tab.ui-tabs-active.ui-state-active {
border-bottom: 1px solid #fff;
}
div.extended_event_pages.ui-tabs-panel.ui-corner-bottom.ui-widget-content {
border-top: 1px solid #a9a9a9;
}
tr.group {
padding: 5px;