alert template schedule
This commit is contained in:
parent
2519335637
commit
1a6127624e
|
@ -1282,6 +1282,7 @@ ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript
|
|||
ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
|
||||
ui_require_css_file('main.min', 'include/javascript/fullcalendar/');
|
||||
ui_require_javascript_file('main.min', 'include/javascript/fullcalendar/');
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
@ -1548,6 +1549,33 @@ if ($step == 2) {
|
|||
}
|
||||
});
|
||||
|
||||
/*
|
||||
function formatDate(date) {
|
||||
var d = new Date(date),
|
||||
month = '' + (d.getMonth() + 1),
|
||||
day = '' + d.getDate(),
|
||||
year = d.getFullYear();
|
||||
|
||||
if (month.length < 2)
|
||||
month = '0' + month;
|
||||
if (day.length < 2)
|
||||
day = '0' + day;
|
||||
|
||||
return [year, month, day].join('/');
|
||||
}*/
|
||||
|
||||
function time_format(date) {
|
||||
var d = new Date(date)
|
||||
hours = format_two_digits(d.getHours() - 1);
|
||||
minutes = format_two_digits(d.getMinutes());
|
||||
seconds = format_two_digits(d.getSeconds());
|
||||
return hours + ":" + minutes + ":" + seconds;
|
||||
}
|
||||
|
||||
function format_two_digits(n) {
|
||||
return n < 10 ? '0' + n : n;
|
||||
}
|
||||
|
||||
var calendarEl = document.getElementById('calendar');
|
||||
var calendar = new FullCalendar.Calendar(calendarEl, {
|
||||
height: 625,
|
||||
|
@ -1574,76 +1602,76 @@ if ($step == 2) {
|
|||
scrollTime: '00:00:00',
|
||||
timeFormat: 'H:mm',
|
||||
locale: 'en-GB',
|
||||
timeZone: "local",
|
||||
firstDay: 1,
|
||||
select: function(arg) {
|
||||
//console.log(arg);
|
||||
//console.log(arg);
|
||||
calendar.addEvent({
|
||||
title: 'hummmm',
|
||||
start: arg.start,
|
||||
end: arg.end,
|
||||
});
|
||||
calendar.unselect()
|
||||
calendar.unselect();
|
||||
},
|
||||
eventDrop: function(event) {
|
||||
event.revert();
|
||||
},
|
||||
eventClick: function(arg) {
|
||||
console.log(arg);
|
||||
eventClick: function(info) {
|
||||
console.log('event click');
|
||||
console.log(info);
|
||||
|
||||
var div = document.createElement('div');
|
||||
|
||||
var input_start = document.createElement('input');
|
||||
input_start.setAttribute('type', 'time');
|
||||
input_start.setAttribute('value', arg.start);
|
||||
|
||||
var input_end = document.createElement('input');
|
||||
input_end.setAttribute('type', 'time');
|
||||
input_end.setAttribute('value', arg.end);
|
||||
|
||||
div.append(input_start);
|
||||
div.append(input_end);
|
||||
|
||||
confirmDialog({
|
||||
console.log(info.view.getCurrentData());
|
||||
confirmDialog({
|
||||
title: 'Eventoooooo',
|
||||
message: 'ole',
|
||||
onAccept: function() {
|
||||
/*
|
||||
message: function () {
|
||||
var id = "div-" + uniqId();
|
||||
var loading = "<?php echo __('Loading, this operation might take several minutes...'); ?>";
|
||||
$.ajax({
|
||||
method: "post",
|
||||
url: settings.url,
|
||||
url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
|
||||
data: {
|
||||
page: settings.page,
|
||||
method: "deleteActionAlert",
|
||||
id_alert: settings.id_alert,
|
||||
id_action: settings.id_action
|
||||
page: 'include/ajax/alert_list.ajax',
|
||||
resize_event_week: true,
|
||||
day_from: info.el.fcSeg.start.getDay(),
|
||||
day_to: info.el.fcSeg.end.getDay(),
|
||||
time_from: time_format(info.el.fcSeg.start),
|
||||
time_to: time_format(info.el.fcSeg.end),
|
||||
},
|
||||
dataType: "json",
|
||||
dataType: "html",
|
||||
success: function(data) {
|
||||
// Delete row table.
|
||||
$(
|
||||
"#li-al-" + settings.id_alert + "-act-" + settings.id_action
|
||||
).remove();
|
||||
$('#' + id).empty().append(data);
|
||||
$("#text-time_from, #text-time_to").timepicker({
|
||||
showSecond: false,
|
||||
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
|
||||
timeOnlyTitle: '<?php echo __('Choose time'); ?>',
|
||||
timeText: '<?php echo __('Time'); ?>',
|
||||
hourText: '<?php echo __('Hour'); ?>',
|
||||
minuteText: '<?php echo __('Minute'); ?>',
|
||||
secondText: '<?php echo __('Second'); ?>',
|
||||
currentText: '<?php echo __('Now'); ?>',
|
||||
closeText: '<?php echo __('Close'); ?>'
|
||||
});
|
||||
|
||||
var num_row = $("#ul-al-" + settings.id_alert + " li").length;
|
||||
if (num_row === 0) {
|
||||
var emptyli =
|
||||
"<li id='emptyli-al-" +
|
||||
settings.id_alert +
|
||||
"'>" +
|
||||
settings.emptyli +
|
||||
"</li>";
|
||||
$("#ul-al-" + settings.id_alert).append(emptyli);
|
||||
}
|
||||
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
|
||||
},
|
||||
error: function(error) {
|
||||
console.log(error);
|
||||
console.log(error);
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
return "<div id ='" + id + "'>" + loading + "</div>";
|
||||
},
|
||||
onAccept: function() {
|
||||
//info.el.remove();
|
||||
|
||||
console.log(calendar);
|
||||
console.log(calendar.view());
|
||||
console.log(calendar.getEvents());
|
||||
console.log(info.event);
|
||||
//info.event.setDates('2022-01-24T00:00:00','2022-01-24T23:59:59')
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//arg.event.remove()
|
||||
},
|
||||
eventOverlap: function(stillEvent, movingEvent) {
|
||||
|
|
|
@ -25,6 +25,7 @@ $enable_alert = (bool) get_parameter('enable_alert');
|
|||
$get_actions_module = (bool) get_parameter('get_actions_module');
|
||||
$show_update_action_menu = (bool) get_parameter('show_update_action_menu');
|
||||
$get_agent_alerts_agent_view = (bool) get_parameter('get_agent_alerts_agent_view');
|
||||
$resize_event_week = (bool) get_parameter('resize_event_week');
|
||||
|
||||
if ($get_agent_alerts_simple) {
|
||||
$id_agent = (int) get_parameter('id_agent');
|
||||
|
@ -561,4 +562,71 @@ if ($show_update_action_menu) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ($resize_event_week === true) {
|
||||
// Date.
|
||||
$day_from = get_parameter('day_from', 0);
|
||||
$day_to = get_parameter('day_to', 0);
|
||||
|
||||
// Time.
|
||||
$time_from = get_parameter('time_from', '');
|
||||
$time_to = get_parameter('time_to', '');
|
||||
|
||||
hd($day_from, true);
|
||||
hd($day_to, true);
|
||||
|
||||
$days = [
|
||||
__('Sunday'),
|
||||
__('Monday'),
|
||||
__('Tuesday'),
|
||||
__('Wednesday'),
|
||||
__('Thursday'),
|
||||
__('Friday'),
|
||||
__('Saturday'),
|
||||
];
|
||||
|
||||
$table = new StdClass();
|
||||
$table->class = 'databox filters';
|
||||
$table->width = '100%';
|
||||
$table->data = [];
|
||||
$table->data[0][0] = __('From:');
|
||||
$table->data[0][1] = html_print_select(
|
||||
$days,
|
||||
'day_from',
|
||||
$day_from,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
$table->data[0][2] = html_print_input_text(
|
||||
'time_from',
|
||||
$time_from,
|
||||
'',
|
||||
9,
|
||||
9,
|
||||
true
|
||||
);
|
||||
$table->data[1][0] = __('To:');
|
||||
$table->data[1][1] = html_print_select(
|
||||
$days,
|
||||
'day_to',
|
||||
$day_to,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
$table->data[1][2] = html_print_input_text(
|
||||
'time_to',
|
||||
$time_to,
|
||||
'',
|
||||
9,
|
||||
9,
|
||||
true
|
||||
);
|
||||
|
||||
echo html_print_table($table, true);
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue