4 * Report to view the background services.
7 * @link http://www.open-emr.org
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @copyright Copyright (c) 2013-2018 Brady Miller <brady.g.miller@gmail.com>
10 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 require_once("../globals.php");
15 use OpenEMR\Common\Acl\AclMain
;
16 use OpenEMR\Common\Twig\TwigContainer
;
17 use OpenEMR\Core\Header
;
19 if (!AclMain
::aclCheckCore('admin', 'super')) {
20 echo (new TwigContainer(null, $GLOBALS['kernel']))->getTwig()->render('core/unauthorized.html.twig', ['pageTitle' => xl("Background Services")]);
29 <?php Header
::setupHeader(); ?
>
31 <title
><?php
echo xlt('Background Services'); ?
></title
>
35 /* specifically include & exclude from printing */
41 #report_parameters_daterange {
45 #report_results table {
50 /* specifically exclude some from the screen */
52 #report_parameters_daterange {
61 <body
class="body_top">
63 <span
class='title'><?php
echo xlt('Background Services'); ?
></span
>
65 <form method
='post' name
='theform' id
='theform' action
='background_services.php' onsubmit
='return top.restoreSession()'>
67 <div id
="report_parameters">
71 <div
class="btn-group float-left" role
="group">
72 <a id
='refresh_button' href
='#' class='btn btn-secondary btn-refresh' onclick
='top.restoreSession(); $("#theform").submit()'>
73 <?php
echo xlt('Refresh'); ?
>
79 </div
> <!-- end of search parameters
-->
85 <div id
="report_results">
88 <thead
class='thead-light'>
90 <?php
echo xlt('Service Name'); ?
>
94 <?php
echo xlt('Active{{Service}}'); ?
>
98 <?php
echo xlt('Automatic'); ?
>
102 <?php
echo xlt('Interval (minutes)'); ?
>
106 <?php
echo xlt('Currently Busy{{Service}}'); ?
>
110 <?php
echo xlt('Last Run Started At'); ?
>
114 <?php
echo xlt('Next Scheduled Run'); ?
>
122 <tbody
> <!-- added
for better
print-ability
-->
125 $res = sqlStatement("SELECT *, (`next_run` - INTERVAL `execute_interval` MINUTE) as `last_run_start`" .
126 " FROM `background_services` ORDER BY `sort_order`");
127 while ($row = sqlFetchArray($res)) {
130 <td align
='center'><?php
echo xlt($row['title']); ?
></td
>
132 <td align
='center'><?php
echo ($row['active']) ?
xlt("Yes") : xlt("No"); ?
></td
>
134 <?php
if ($row['active']) { ?
>
135 <td align
='center'><?php
echo ($row['execute_interval'] > 0) ?
xlt("Yes") : xlt("No"); ?
></td
>
137 <td align
='center'><?php
echo xlt('Not Applicable'); ?
></td
>
140 <?php
if ($row['active'] && ($row['execute_interval'] > 0)) { ?
>
141 <td align
='center'><?php
echo text($row['execute_interval']); ?
></td
>
143 <td align
='center'><?php
echo xlt('Not Applicable'); ?
></td
>
146 <td align
='center'><?php
echo ($row['running'] > 0) ?
xlt("Yes") : xlt("No"); ?
></td
>
148 <?php
if ($row['running'] > -1) { ?
>
149 <td align
='center'><?php
echo text(oeFormatDateTime($row['last_run_start'], "global", true)); ?
></td
>
151 <td align
='center'><?php
echo xlt('Never'); ?
></td
>
154 <?php
if ($row['active'] && ($row['execute_interval'] > 0)) { ?
>
155 <td align
='center'><?php
echo text(oeFormatDateTime($row['next_run'], "global", true)); ?
></td
>
157 <td align
='center'><?php
echo xlt('Not Applicable'); ?
></td
>
160 <?php
if ($row['name'] == "phimail") { ?
>
161 <td align
='center'><a href
='direct_message_log.php' onclick
='top.restoreSession()'><?php
echo xlt("View Log"); ?
></a
></td
>
163 <td align
='center'> 
;</td
>
168 } // $row = sqlFetchArray($res) while
172 </div
> <!-- end of search results
-->