Docker image / push (push) Canceled after 0s
包含:登录失败锁定、90天密码有效期、30分钟会话超时、 强制改密、登录审计日志、屏幕水印、企业背景图、 备案信息固定底部、favicon、登录页JS修复等全部改动
297 lines
8.2 KiB
HTML
297 lines
8.2 KiB
HTML
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>Help - report.php</title>
|
|
<style type="text/css">
|
|
body {
|
|
font-size: small;
|
|
font-family: Arial, Verdana, sans-serif;
|
|
}
|
|
h1 {
|
|
font-size: medium;
|
|
margin-top: 2em;
|
|
}
|
|
body > table > tbody > tr:last-child > td {
|
|
padding-bottom: 1em;
|
|
}
|
|
td {
|
|
padding: 0 1em 0 0;
|
|
vertical-align: top;
|
|
}
|
|
table table {
|
|
margin-left: 2em;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<h1>NAME</h1>
|
|
<p>
|
|
report.php - produce MRBS reports
|
|
</p>
|
|
<h1>SYNOPSIS</h1>
|
|
<p>
|
|
<code>report.php [args]</code>
|
|
</p>
|
|
<p>
|
|
where args is a space separated list of arguments of the form <code>param1=value1&param2=value2</code>. Spaces
|
|
in the value string and ampersands can normally be escaped with the backslash character ('\'), depending
|
|
on the shell. Array parameters can be sent by using the '[]' notation, eg <code>param1[]=valueA&param1[]=valueB</code>.
|
|
Array parameters must all appear in the same argument.
|
|
</p>
|
|
<h1>DESCRIPTION</h1>
|
|
<p>
|
|
This page describes how to use MRBS reporting from the command line (CLI). Report.php can
|
|
either be called directly or as a cron job. The script report.php should be called
|
|
as a parameter to the PHP interpreter. The output of report.php is sent to STDOUT.
|
|
</p>
|
|
<p>
|
|
The language and locale used for the reports is specified by the config variable
|
|
$cli_language. The script can only be run from the command line if the MRBS config
|
|
variable $allow_cli is set to TRUE.
|
|
</p>
|
|
<h1>OPTIONS</h1>
|
|
<table>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>output</code></td>
|
|
<td>
|
|
The type of output to produce. Permitted values are:
|
|
<table>
|
|
<tr><td><code>0</code></td><td>A report<em> (default)</em></td></tr>
|
|
<tr><td><code>1</code></td><td>A summary</td></tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>output_format</code></td>
|
|
<td>
|
|
The format that the output should be produced in. Permitted values are:
|
|
<table>
|
|
<tr><td><code>0</code></td><td>HTML<em> (default except when running from the CLI)</em></td></tr>
|
|
<tr><td><code>1</code></td><td>CSV<em> (default when running from the CLI)</em></td></tr>
|
|
<tr><td><code>2</code></td><td>iCalendar (.ics file) report - excluding periods<em> (cannot be used for summaries)</em></td></tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
<code>day</code>
|
|
</td>
|
|
<td>
|
|
The day (1..31) to use as the base date for the reporting
|
|
period. If any of day, week and month are not specified
|
|
then today's date will be used as the base date.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<code>month</code>
|
|
</td>
|
|
<td>
|
|
The month (1..12) to use as the base date for the reporting
|
|
period. If any of day, week and month are not specified
|
|
then today's date will be used as the base date.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<code>year</code>
|
|
</td>
|
|
<td>
|
|
The year (4 digits) to use as the base date for the reporting
|
|
period. If any of day, week and month are not specified
|
|
then today's date will be used as the base date.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>from_date</code></td>
|
|
<td>
|
|
The start date of the reporting period in YYYY-MM-DD format. If
|
|
from_date is not specified then the base date will be used.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>to_date</code></td>
|
|
<td>
|
|
The end date of the reporting period in YYYY-MM-DD format. If
|
|
to_date is not specified then the base date +
|
|
$default_report_days (specified in systemdefaults.inc.php and
|
|
optionally over-ridden in config.in.php) will be used. Note that
|
|
the reporting period ends at 0000 on the to_day, so if for example
|
|
you want a report for all bookings in 2019 the to_date should be
|
|
2020-01-01.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>creatormatch</code></td>
|
|
<td>
|
|
Limit the report to entries where the creator's user name contains the string.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>areamatch</code></td>
|
|
<td>
|
|
Limit the report to entries where the area name contains the string.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>roommatch</code></td>
|
|
<td>
|
|
Limit the report to entries where the room name contains the string.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>namematch</code></td>
|
|
<td>
|
|
Limit the report to entries where the entry name contains the string.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>descrmatch</code></td>
|
|
<td>
|
|
Limit the report to entries where the description contains the string.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>typematch[]</code></td>
|
|
<td>
|
|
Limit the report to entries of types X,Y,Z (eg typematch[]=X&typematch[]=Y&typematch[]=Z). Default: all types.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>match_approved</code></td>
|
|
<td>
|
|
Limit the report to entries that are/are not approved. Permitted values are:
|
|
<table>
|
|
<tr><td><code>0</code></td><td>Awaiting approval</td></tr>
|
|
<tr><td><code>1</code></td><td>Approved</td></tr>
|
|
<tr><td><code>2</code></td><td>All entries<em> (default)</em></td></tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>match_confirmed</code></td>
|
|
<td>
|
|
Limit the report to entries that are tentative or confirmed. Permitted values are:
|
|
<table>
|
|
<tr><td><code>0</code></td><td>Tentative</td></tr>
|
|
<tr><td><code>1</code></td><td>Confirmed</td></tr>
|
|
<tr><td><code>2</code></td><td>All entries<em> (default)</em></td></tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>match_private</code></td>
|
|
<td>
|
|
Limit the report to entries that are private or public. Permitted values are:
|
|
<table>
|
|
<tr><td><code>0</code></td><td>Private</td></tr>
|
|
<tr><td><code>1</code></td><td>Public</td></tr>
|
|
<tr><td><code>2</code></td><td>All entries<em> (default)</em></td></tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>sortby</code></td>
|
|
<td>
|
|
Permitted values are:
|
|
<table>
|
|
<tr><td><code>r</code></td><td>sort by room name<em> (default)</em></td></tr>
|
|
<tr><td><code>s</code></td><td>sort by start time</td></tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>sumby</code></td>
|
|
<td>
|
|
The field to use for the first column of the summary table.
|
|
Permitted values are:
|
|
<table>
|
|
<tr><td><code>d</code></td><td>brief description<em> (default)</em></td></tr>
|
|
<tr><td><code>c</code></td><td>creator's user name</td></tr>
|
|
<tr><td><code>t</code></td><td>type</td></tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>phase</code></td>
|
|
<td>
|
|
The phase of report production. Phase 1 is the gathering of user input from
|
|
the web page form; Phase 2 is the production of the report or summary. When running
|
|
from the command line it is not necessary to set this option as it is automatically
|
|
set to 2 by MRBS. However when running report.php from the web browser or by using wget,
|
|
setting phase=2 will force report.php to go straight to the production of a report.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
<tbody>
|
|
<tr>
|
|
<td>custom</td>
|
|
<td>
|
|
Custom fields can be searched for using the same syntax as above.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h1>RETURN VALUES</h1>
|
|
<p>
|
|
Returns 0 on success.
|
|
</p>
|
|
<h1>EXAMPLES</h1>
|
|
<p>
|
|
To produce a summary in CSV format of all bookings for 2019, arranged by the creator's
|
|
name, and send the summary to the file summary.csv:
|
|
</p>
|
|
<p>
|
|
<code>
|
|
/usr/local/bin/php /home/mrbs/report.php output=1 from_date=2019-01-01 to_date=2020-01-01 sumby=c > summary.csv
|
|
</code>
|
|
</p>
|
|
<p>
|
|
The CLI output can be simulated in a browser by putting the parameters in a query string. But note
|
|
that the parameter <code>phase=2</code> must be added to tell MRBS that it is on the second
|
|
phase of report production (the first phase is gathering the user input from the form; if report.php
|
|
is called from the command line the phase is automatically set to 2). For example,
|
|
to simulate the CLI command above enter into the browser (note the addition of the <code>
|
|
output_format</code> parameter as CSV is not the default format when running from the browser):
|
|
</p>
|
|
<p>
|
|
<code>
|
|
report.php?phase=2&output=1&output_format=2&from_date=2019-01-01&to_date=2020-01-01&sumby=c
|
|
</code>
|
|
</p>
|
|
<p>
|
|
When using wget, don't forget to escape ampersands with a backslash. For example:
|
|
</p>
|
|
<p>
|
|
<code>
|
|
wget -O myreport.csv http://localhost/mrbs/report.php?phase=2\&output=1\&output_format=2\&sumby=c
|
|
</code>
|
|
</p>
|
|
</body>
|
|
</html>
|