Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docker
osticket
Commits
4302d1d8
Commit
4302d1d8
authored
9 years ago
by
Jared Hancock
Browse files
Options
Downloads
Patches
Plain Diff
dashboard: Reimplement export support
parent
c03279de
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/staff/dashboard.inc.php
+6
-2
6 additions, 2 deletions
include/staff/dashboard.inc.php
scp/css/scp.css
+11
-1
11 additions, 1 deletion
scp/css/scp.css
scp/dashboard.php
+25
-0
25 additions, 0 deletions
scp/dashboard.php
with
42 additions
and
3 deletions
include/staff/dashboard.inc.php
+
6
−
2
View file @
4302d1d8
...
...
@@ -11,10 +11,10 @@ $plots = $report->getPlotData();
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/dashboard.css"
/>
<form
method=
"post"
action=
"dashboard.php"
>
<div
id=
"basic_search"
>
<div
style=
"min-height:25px;"
>
<!--<p>
<?php
//echo __('Select the starting time and period for the system activity graph');?></p>-->
<
form
method
=
"post"
action
=
"dashboard.php"
>
<?
php
echo
csrf_token
();
?>
<label>
<?php
echo
__
(
'Report timeframe'
);
?>
:
...
...
@@ -45,7 +45,6 @@ $plots = $report->getPlotData();
<?php
echo
__
(
'Refresh'
);
?>
</button>
<i class="help-tip icon-question-sign" href="#report_timeframe"></i>
</form>
</div>
</div>
<div class="clear"></div>
...
...
@@ -109,10 +108,15 @@ foreach ($groups as $g=>$desc) {
}
$first
=
false
;
?>
</tbody></table>
<div
style=
"margin-top: 5px"
><button
type=
"submit"
class=
"link button"
name=
"export"
value=
"
<?php
echo
Format
::
htmlchars
(
$g
);
?>
"
>
<i
class=
"icon-download"
></i>
<?php
echo
__
(
'Export'
);
?>
</a></div>
</div>
<?php
}
?>
</form>
<script>
$
.
drawPlots
(
<?php
echo
JsonDataEncoder
::
encode
(
$report
->
getPlotData
());
?>
);
</script>
This diff is collapsed.
Click to expand it.
scp/css/scp.css
+
11
−
1
View file @
4302d1d8
...
...
@@ -13,13 +13,14 @@ body, html {
padding
:
0
;
}
.button.link
,
a
{
color
:
#184E81
;
text-decoration
:
none
;
display
:
inline-block
;
}
a
:hover
{
a
:hover
,
.button.link
:hover
{
text-decoration
:
underline
;
}
...
...
@@ -487,6 +488,7 @@ a {
}
table
.dashboard-stats
{
text-align
:
right
;
border-bottom
:
2px
solid
#ddd
;
}
table
.dashboard-stats
tbody
:first-child
th
{
border-bottom
:
1px
dashed
#ddd
;
...
...
@@ -1808,6 +1810,14 @@ select + .button {
box-shadow
:
0
0
0
2px
rgba
(
255
,
255
,
255
,
0.7
)
inset
;
color
:
white
;
}
.link.button
,
.link.button
:hover
,
.link.button
:active
{
border
:
none
;
box-shadow
:
none
;
background-color
:
transparent
;
color
:
#184E81
;
padding
:
0
;
font-size
:
inherit
;
}
.light
.button
:hover
,
.white.button
{
...
...
This diff is collapsed.
Click to expand it.
scp/dashboard.php
+
25
−
0
View file @
4302d1d8
...
...
@@ -17,6 +17,31 @@ require('staff.inc.php');
require_once
INCLUDE_DIR
.
'class.report.php'
;
if
(
$_POST
[
'export'
])
{
$report
=
new
OverviewReport
(
$_POST
[
'start'
],
$_POST
[
'period'
]);
switch
(
true
)
{
case
(
$data
=
$report
->
getTabularData
(
$_POST
[
'export'
]))
:
$ts
=
strftime
(
'%Y%m%d'
);
$group
=
Format
::
slugify
(
$_POST
[
'export'
]);
$delimiter
=
','
;
if
(
class_exists
(
'NumberFormatter'
))
{
$nf
=
NumberFormatter
::
create
(
Internationalization
::
getCurrentLocale
(),
NumberFormatter
::
DECIMAL
);
$s
=
$nf
->
getSymbol
(
NumberFormatter
::
DECIMAL_SEPARATOR_SYMBOL
);
if
(
$s
==
','
)
$delimiter
=
';'
;
}
Http
::
download
(
"stats-
$group
-
$ts
.csv"
,
'text/csv'
);
$output
=
fopen
(
'php://output'
,
'w'
);
fputs
(
$output
,
chr
(
0xEF
)
.
chr
(
0xBB
)
.
chr
(
0xBF
));
fputcsv
(
$output
,
$data
[
'columns'
],
$delimeter
);
foreach
(
$data
[
'data'
]
as
$row
)
fputcsv
(
$output
,
$row
,
$delimeter
);
exit
;
}
}
$nav
->
setTabActive
(
'dashboard'
);
$ost
->
addExtraHeader
(
'<meta name="tip-namespace" content="dashboard.dashboard" />'
,
"$('#content').data('tipNamespace', 'dashboard.dashboard');"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment