CMS
Version 3.9
scheduled_task_logs.inc
Go to the documentation of this file.
1
<?php
2
Fakoli::using
(
"scheduled_task"
);
3
Fakoli::using
(
"data_view"
);
4
5
$menu_item
=
"Scheduled Tasks"
;
6
7
$task_id
= checkNumeric($_GET[
"task_id"
]);
8
if
(!
$task_id
)
9
{
10
redirect(
"scheduled_tasks"
);
11
}
12
13
$task
=
new
ScheduledTask
(
$task_id
);
14
15
$log
=
new
ScheduledTaskLogEntry
();
16
$log
->filter =
new
InclusionFilter(
"log_date"
);
17
$filterForm
=
new
FilterForm(
$log
);
18
19
$dateRangeFilter
=
new
DateRangeFilterRenderer(
$filterForm
,
"log_date"
,
""
,
"month"
);
20
21
22
$constraint
=
$filterForm
->getConstraint();
23
$logEntries
=
$task
->LogEntries(
"$constraint ORDER BY log_date DESC"
);
24
25
$table
=
new
DataListView(
$logEntries
,
"log_entries"
);
26
$table
->column(
"Execution Date"
,
"{log_date}"
,
true
,
"width: 20%"
)
27
->column(
"Status"
,
"<a class='button' style='float: right' href='#' onclick='showTaskLog({task_id}, {log_entry_id}, \"{log_date}\"); return false'>Show Log</a> {status}"
,
true
);
28
29
$table
->paginate =
true
;
30
$table
->pageSize = 20;
31
$table
->filter =
true
;
32
$table
->sortable =
true
;
33
$table
->excelFile =
"scheduled_task_log.xls"
;
34
$table
->emptyMessage =
"There are no log files for this task."
;
35
36
$tabs
=
ScheduledTaskManager::getTabs
(
$task_id
);
37
38
$script
.=
$filterForm
->writeScript();
39
$script
.=
$table
->writeScript();
40
$script
.= <<<ENDSCRIPT
41
<script type=
'text/javascript'
>
42
function
showTaskLog(task_id, log_entry_id, log_date)
43
{
44
modalPopup(
"Task Log for "
+ log_date,
"/action/scheduled_task/show_log?task_id="
+ task_id +
"&log_entry_id="
+ log_entry_id,
'800px'
,
'auto'
);
45
}
46
</script>
47
ENDSCRIPT;
48
$tabs
->writeHTML();
49
?>
50
<div
class
=
'tab_border'
>
51
<h4><?echo
$task
->format(
"{component:prettify}: {task_name}"
);?></h4>
52
<?
53
$filterForm
->drawForm();
54
$table
->drawView();
55
?>
56
<br/>
57
<a
class
=
'button'
href=
'/action/scheduled_task/run_task?task_id=<?echo $task_id?>'
>Run Now</a>
58
</div>
$constraint
$constraint
Definition:
scheduled_task_logs.inc:22
$logEntries
$logEntries
Definition:
scheduled_task_logs.inc:23
$log
$log
Definition:
scheduled_task_logs.inc:15
$dateRangeFilter
$dateRangeFilter
Definition:
scheduled_task_logs.inc:19
$filterForm
$filterForm
Definition:
scheduled_task_logs.inc:17
$tabs
$tabs
Definition:
scheduled_task_logs.inc:36
$menu_item
$menu_item
Definition:
scheduled_task_logs.inc:5
$task_id
$task_id
Definition:
scheduled_task_logs.inc:7
$table
$table
Definition:
scheduled_task_logs.inc:25
$task
if(! $task_id) $task
Definition:
scheduled_task_logs.inc:13
$script
$script
Definition:
scheduled_task_logs.inc:38
Fakoli\using
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition:
core.inc:116
ScheduledTask
Definition:
scheduled_task.inc:8
ScheduledTaskLogEntry
Definition:
scheduled_task.inc:51
ScheduledTaskManager\getTabs
static getTabs($key)
Definition:
scheduled_task_manager.inc:71
code
cms.sonjara.com
cms
components
scheduled_task
admin
scheduled_task_logs.inc
Generated on Tue Mar 23 2021 15:36:14 for CMS by
1.9.1