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
cb5ec02f
Commit
cb5ec02f
authored
12 years ago
by
Jared Hancock
Browse files
Options
Downloads
Patches
Plain Diff
Export all results
parent
03a84301
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/class.export.php
+7
-4
7 additions, 4 deletions
include/class.export.php
with
7 additions
and
4 deletions
include/class.export.php
+
7
−
4
View file @
cb5ec02f
...
...
@@ -16,18 +16,18 @@
class
Export
{
/* static */
function
dumpQuery
(
$sql
,
$headers
,
$how
=
'csv'
)
{
/* static */
function
dumpQuery
(
$sql
,
$headers
,
$how
=
'csv'
,
$filter
=
false
)
{
$exporters
=
array
(
'csv'
=>
CsvResultsExporter
,
'json'
=>
JsonResultsExporter
);
$exp
=
new
$exporters
[
$how
](
$sql
,
$headers
);
$exp
=
new
$exporters
[
$how
](
$sql
,
$headers
,
$filter
);
return
$exp
->
dump
();
}
# XXX: Think about facilitated exporting. For instance, we might have a
# TicketExporter, which will know how to formulate or lookup a
# format
l
query (SQL), and cooperate with the output process to add
# format query (SQL), and cooperate with the output process to add
# extra (recursive) information. In this funciton, the top-level
# SQL is exported, but for something like tickets, we will need to
# export attached messages, reponses, and notes, as well as
...
...
@@ -60,8 +60,11 @@ class Export {
}
class
ResultSetExporter
{
function
ResultSetExporter
(
$sql
,
$headers
)
{
function
ResultSetExporter
(
$sql
,
$headers
,
$filter
=
false
)
{
$this
->
headers
=
array_values
(
$headers
);
if
(
$s
=
strpos
(
strtoupper
(
$sql
),
' LIMIT '
))
$sql
=
substr
(
$sql
,
0
,
$s
);
# TODO: If $filter, add different LIMIT clause to query
$this
->
_res
=
db_query
(
$sql
);
if
(
$row
=
db_fetch_array
(
$this
->
_res
))
{
$query_fields
=
array_keys
(
$row
);
...
...
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