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
2d35033c
Commit
2d35033c
authored
11 years ago
by
Peter Rotich
Browse files
Options
Downloads
Patches
Plain Diff
Bug fixes and enhancements
parent
4c511c8d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/class.collaborator.php
+5
-0
5 additions, 0 deletions
include/class.collaborator.php
include/class.ticket.php
+12
-18
12 additions, 18 deletions
include/class.ticket.php
with
17 additions
and
18 deletions
include/class.collaborator.php
+
5
−
0
View file @
2d35033c
...
...
@@ -54,6 +54,11 @@ class Collaborator {
return
call_user_func
(
array
(
$user
,
$name
));
}
function
__toString
()
{
return
Format
::
htmlchars
(
sprintf
(
'%s <%s>'
,
$this
->
getName
(),
$this
->
getEmail
()));
}
function
getId
()
{
return
$this
->
ht
[
'id'
];
}
...
...
This diff is collapsed.
Click to expand it.
include/class.ticket.php
+
12
−
18
View file @
2d35033c
...
...
@@ -67,16 +67,13 @@ class Ticket {
.
' ,IF(sla.id IS NULL, NULL, '
.
'DATE_ADD(ticket.created, INTERVAL sla.grace_period HOUR)) as sla_duedate '
.
' ,count(distinct attach.attach_id) as attachments'
.
' ,count(distinct collab.id) as collaborators '
.
' FROM '
.
TICKET_TABLE
.
' ticket '
.
' LEFT JOIN '
.
DEPT_TABLE
.
' dept ON (ticket.dept_id=dept.dept_id) '
.
' LEFT JOIN '
.
SLA_TABLE
.
' sla ON (ticket.sla_id=sla.id AND sla.isactive=1) '
.
' LEFT JOIN '
.
TICKET_LOCK_TABLE
.
' tlock ON ('
.
'ticket.ticket_id=tlock.ticket_id AND tlock.expire>NOW()) '
.
' LEFT JOIN '
.
TICKET_ATTACHMENT_TABLE
.
' attach ON ('
.
'ticket.ticket_id=attach.ticket_id) '
.
' LEFT JOIN '
.
TICKET_COLLABORATOR_TABLE
.
' collab ON ('
.
'ticket.ticket_id=collab.ticket_id) '
.
' LEFT JOIN '
.
TICKET_LOCK_TABLE
.
' tlock
ON ( ticket.ticket_id=tlock.ticket_id AND tlock.expire>NOW()) '
.
' LEFT JOIN '
.
TICKET_ATTACHMENT_TABLE
.
' attach
ON ( ticket.ticket_id=attach.ticket_id) '
.
' WHERE ticket.ticket_id='
.
db_input
(
$id
)
.
' GROUP BY ticket.ticket_id'
;
...
...
@@ -562,7 +559,7 @@ class Ticket {
//Collaborators
function
getNumCollaborators
()
{
return
$this
->
ht
[
'c
ollaborators
'
]
;
return
count
(
$this
->
getC
ollaborators
())
;
}
function
getNumActiveCollaborators
()
{
...
...
@@ -580,10 +577,10 @@ class Ticket {
function
getCollaborators
(
$criteria
=
array
())
{
if
(
$criteria
)
if
(
$criteria
)
return
Collaborator
::
forTicket
(
$this
->
getId
(),
$criteria
);
if
(
!
$this
->
c
ollaborators
&&
$this
->
getNumC
ollaborators
(
))
if
(
!
isset
(
$this
->
collaborators
))
$this
->
collaborators
=
Collaborator
::
forTicket
(
$this
->
getId
());
return
$this
->
collaborators
;
...
...
@@ -600,10 +597,8 @@ class Ticket {
if
(
!
(
$c
=
Collaborator
::
add
(
$vars
,
$errors
)))
return
null
;
$this
->
ht
[
'collaborators'
]
+=
1
;
$this
->
collaborators
=
null
;
return
$c
;
}
...
...
@@ -620,11 +615,11 @@ class Ticket {
if
((
$c
=
Collaborator
::
lookup
(
$cid
))
&&
$c
->
getTicketId
()
==
$this
->
getId
()
&&
$c
->
remove
())
$collabs
[]
=
Format
::
htmlchars
(
sprintf
(
'%s <%s>'
,
$c
->
getName
(),
$c
->
getEmail
()))
;
$collabs
[]
=
$c
;
}
$this
->
logNote
(
'Collaborators Removed'
,
implode
(
"
\n
"
,
$collabs
),
$thisstaff
,
false
);
implode
(
"
<br>
"
,
$collabs
),
$thisstaff
,
false
);
}
//statuses
...
...
@@ -1467,14 +1462,13 @@ class Ticket {
$collabs
=
array
();
foreach
(
$vars
[
'recipients'
]
as
$recipient
)
{
if
((
$user
=
User
::
fromVars
(
$recipient
)))
if
(
$this
->
addCollaborator
(
$user
,
$errors
))
$collabs
[]
=
Format
::
htmlchars
(
sprintf
(
'%s <%s>'
,
$user
->
getName
(),
$user
->
getEmail
()));
if
(
$c
=
$this
->
addCollaborator
(
$user
,
$errors
))
$collabs
[]
=
$c
;
}
//TODO: Can collaborators add others?
if
(
$collabs
)
{
$this
->
logNote
(
'Collaborators CCed by enduser'
,
implode
(
"
\n
"
,
$collabs
),
'EndUser'
,
false
);
implode
(
"
<br>
"
,
$collabs
),
'EndUser'
,
false
);
}
}
...
...
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