WIP: event dashboard responses

This commit is contained in:
Luis 2022-03-21 18:15:58 +01:00
parent 6dc775649d
commit ba6a56b9fc
5 changed files with 48 additions and 9 deletions

View File

@ -1269,10 +1269,14 @@ if ($change_status) {
); );
if ($return !== false) { if ($return !== false) {
$event_st = events_display_status($new_status);
echo json_encode( echo json_encode(
[ [
'status' => 'status_ok', 'status_title' => $event_st['title'],
'user' => db_get_value( 'status_img' => html_print_image($event_st['img'], true, false, true),
'status' => 'status_ok',
'user' => db_get_value(
'fullname', 'fullname',
'tusuario', 'tusuario',
'id_user', 'id_user',

View File

@ -5008,6 +5008,8 @@ function events_page_general($event)
$event_st = events_display_status($event['estado']); $event_st = events_display_status($event['estado']);
$data = []; $data = [];
$table_general->rowid[7] = 'general_status';
$data[0] = __('Status'); $data[0] = __('Status');
$data[1] = $event_st['title']; $data[1] = $event_st['title'];
$data[2] = html_print_image($event_st['img'], true); $data[2] = html_print_image($event_st['img'], true);

View File

@ -651,7 +651,7 @@ function initialiceLayout(data) {
url: data.url, url: data.url,
data: { data: {
page: data.page, page: data.page,
method: "drawWidget", method: "drawCell",
dashboardId: data.dashboardId, dashboardId: data.dashboardId,
cellId: cellId, cellId: cellId,
newWidth: newWidth, newWidth: newWidth,
@ -1329,6 +1329,29 @@ function dashboardShowEventDialog(settings) {
close: function() { close: function() {
//$("#refrcounter").countdown("resume"); //$("#refrcounter").countdown("resume");
//$("div.vc-countdown").countdown("resume"); //$("div.vc-countdown").countdown("resume");
debugger;
$.ajax({
method: "post",
url: settings.ajaxUrl,
data: {
page: "operation/dashboard/dashboard",
method: "drawWidget",
dashboardId: settings.dashboardId,
cellId: settings.cellId,
widgetId: settings.widgetId,
redraw: 1
},
success: function(dataWidget) {
// Widget empty and reload.
$("#widget-" + settings.cellId + " .content-widget").empty();
$("#widget-" + settings.cellId + " .content-widget").append(
dataWidget
);
},
error: function(error) {
console.error(error);
}
});
}, },
overlay: { overlay: {
opacity: 0.5, opacity: 0.5,

View File

@ -504,7 +504,7 @@ function event_change_status(event_ids) {
if ($("#notification_status_error").length) { if ($("#notification_status_error").length) {
$("#notification_status_error").hide(); $("#notification_status_error").hide();
} }
debugger;
if (data.status == "status_ok") { if (data.status == "status_ok") {
if (typeof dt_events !== "undefined") { if (typeof dt_events !== "undefined") {
dt_events.draw(false); dt_events.draw(false);
@ -519,6 +519,13 @@ function event_change_status(event_ids) {
"N/A" "N/A"
); );
} }
$("#general_status")
.find(".general_status")
.text(data.status_title);
$("#general_status")
.find("img")
.attr("src", data.status_img);
} else { } else {
$("#notification_status_error").show(); $("#notification_status_error").show();
} }

View File

@ -718,16 +718,19 @@ class EventsListWidget extends Widget
$settings = json_encode( $settings = json_encode(
[ [
'event' => $event, 'event' => $event,
'page' => 'include/ajax/events', 'page' => 'include/ajax/events',
'cellId' => $this->cellId, 'cellId' => $this->cellId,
'ajaxUrl' => \ui_get_full_url( 'ajaxUrl' => \ui_get_full_url(
'ajax.php', 'ajax.php',
false, false,
false, false,
false false
), ),
'result' => false, 'result' => false,
'dashboardId' => $this->dashboardId,
'widgetId' => $this->widgetId,
'cellId' => $this->cellId,
] ]
); );