Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
e95f0e2b
Unverified
Commit
e95f0e2b
authored
6 years ago
by
Peter Rotich
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #4737 from JediKev/variable/complete-thread-asc-or-desc
variable: Complete Thread ASC or DESC
parents
89838c08
84d05c61
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/class.thread.php
+40
-10
40 additions, 10 deletions
include/class.thread.php
include/client/templates/thread-export.tmpl.php
+1
-1
1 addition, 1 deletion
include/client/templates/thread-export.tmpl.php
with
41 additions
and
11 deletions
include/class.thread.php
+
40
−
10
View file @
e95f0e2b
...
@@ -2989,7 +2989,7 @@ implements TemplateVariable {
...
@@ -2989,7 +2989,7 @@ implements TemplateVariable {
}
}
function
asVar
()
{
function
asVar
()
{
return
$this
->
getVar
(
'complete'
);
return
new
ThreadEntries
(
$this
);
}
}
function
getVar
(
$name
)
{
function
getVar
(
$name
)
{
...
@@ -3013,21 +3013,14 @@ implements TemplateVariable {
...
@@ -3013,21 +3013,14 @@ implements TemplateVariable {
break
;
break
;
case
'complete'
:
case
'complete'
:
$content
=
''
;
return
$this
->
asVar
();
$thread
=
$this
;
ob_start
();
include
INCLUDE_DIR
.
'client/templates/thread-export.tmpl.php'
;
$content
=
ob_get_contents
();
ob_end_clean
();
return
$content
;
break
;
break
;
}
}
}
}
static
function
getVarScope
()
{
static
function
getVarScope
()
{
return
array
(
return
array
(
'complete'
=>
__
(
'Thread Correspondence'
),
'complete'
=>
array
(
'class'
=>
'ThreadEntries'
,
'desc'
=>
__
(
'Thread Correspondence'
)
)
,
'original'
=>
array
(
'class'
=>
'MessageThreadEntry'
,
'desc'
=>
__
(
'Original Message'
)),
'original'
=>
array
(
'class'
=>
'MessageThreadEntry'
,
'desc'
=>
__
(
'Original Message'
)),
'lastmessage'
=>
array
(
'class'
=>
'MessageThreadEntry'
,
'desc'
=>
__
(
'Last Message'
)),
'lastmessage'
=>
array
(
'class'
=>
'MessageThreadEntry'
,
'desc'
=>
__
(
'Last Message'
)),
);
);
...
@@ -3047,6 +3040,43 @@ implements TemplateVariable {
...
@@ -3047,6 +3040,43 @@ implements TemplateVariable {
}
}
}
}
class
ThreadEntries
{
var
$thread
;
function
__construct
(
$thread
)
{
$this
->
thread
=
$thread
;
}
function
asVar
()
{
return
$this
->
getVar
();
}
function
getVar
(
$name
=
''
)
{
$order
=
''
;
switch
(
$name
)
{
case
'reversed'
:
$order
=
'-'
;
default
:
$content
=
''
;
$thread
=
$this
->
thread
;
ob_start
();
include
INCLUDE_DIR
.
'client/templates/thread-export.tmpl.php'
;
$content
=
ob_get_contents
();
ob_end_clean
();
return
$content
;
break
;
}
}
static
function
getVarScope
()
{
return
array
(
'reversed'
=>
sprintf
(
'%s %s'
,
__
(
'Thread Correspondence'
),
__
(
'in reversed order'
)),
);
}
}
// Ticket thread class
// Ticket thread class
class
TicketThread
extends
ObjectThread
{
class
TicketThread
extends
ObjectThread
{
static
function
create
(
$ticket
=
false
)
{
static
function
create
(
$ticket
=
false
)
{
...
...
This diff is collapsed.
Click to expand it.
include/client/templates/thread-export.tmpl.php
+
1
−
1
View file @
e95f0e2b
...
@@ -12,7 +12,7 @@ AttachmentFile::objects()->filter(array(
...
@@ -12,7 +12,7 @@ AttachmentFile::objects()->filter(array(
))
->
all
();
))
->
all
();
$entries
=
$thread
->
getEntries
();
$entries
=
$thread
->
getEntries
();
$entries
->
filter
(
array
(
'type__in'
=>
array_keys
(
$entryTypes
)));
$entries
->
filter
(
array
(
'type__in'
=>
array_keys
(
$entryTypes
)))
->
order_by
(
"
{
$order
}
id"
);
;
?>
?>
<style
type=
"text/css"
>
<style
type=
"text/css"
>
div
{
font-family
:
sans-serif
;}
div
{
font-family
:
sans-serif
;}
...
...
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