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
45f35c89
Commit
45f35c89
authored
11 years ago
by
Jared Hancock
Browse files
Options
Downloads
Patches
Plain Diff
Add ticket details update for clients
parent
89b28923
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/client/edit.inc.php
+30
-0
30 additions, 0 deletions
include/client/edit.inc.php
include/client/view.inc.php
+2
-0
2 additions, 0 deletions
include/client/view.inc.php
tickets.php
+25
-1
25 additions, 1 deletion
tickets.php
with
57 additions
and
1 deletion
include/client/edit.inc.php
0 → 100644
+
30
−
0
View file @
45f35c89
<?php
if
(
!
defined
(
'OSTCLIENTINC'
)
||
!
$thisclient
||
!
$ticket
||
!
$ticket
->
checkUserAccess
(
$thisclient
))
die
(
'Access Denied!'
);
?>
<h1>
Editing Ticket #
<?php
echo
$ticket
->
getNumber
();
?>
</h1>
<form
action=
"tickets.php"
method=
"post"
>
<?php
echo
csrf_token
();
?>
<input
type=
"hidden"
name=
"a"
value=
"edit"
/>
<input
type=
"hidden"
name=
"id"
value=
"
<?php
echo
$_REQUEST
[
'id'
];
?>
"
/>
<table
width=
"800"
>
<tbody
id=
"dynamic-form"
>
<?php
if
(
$forms
)
foreach
(
$forms
as
$form
)
{
$form
->
render
(
false
);
}
?>
</tbody>
</table>
<hr>
<p
style=
"text-align: center;"
>
<input
type=
"submit"
value=
"Update"
/>
<input
type=
"reset"
value=
"Reset"
/>
<input
type=
"button"
value=
"Cancel"
onclick=
"javascript:
window.location.href='index.php';"
/>
</p>
</form>
This diff is collapsed.
Click to expand it.
include/client/view.inc.php
+
2
−
0
View file @
45f35c89
...
@@ -15,6 +15,8 @@ if(!$dept || !$dept->isPublic())
...
@@ -15,6 +15,8 @@ if(!$dept || !$dept->isPublic())
<h1>
<h1>
Ticket #
<?php
echo
$ticket
->
getNumber
();
?>
Ticket #
<?php
echo
$ticket
->
getNumber
();
?>
<a
href=
"view.php?id=
<?php
echo
$ticket
->
getId
();
?>
"
title=
"Reload"
><span
class=
"Icon refresh"
>
</span></a>
<a
href=
"view.php?id=
<?php
echo
$ticket
->
getId
();
?>
"
title=
"Reload"
><span
class=
"Icon refresh"
>
</span></a>
<a
class=
"action-button"
href=
"tickets.php?a=edit&id=
<?php
echo
$ticket
->
getId
();
?>
"
><i
class=
"icon-edit"
></i>
Edit
</a>
</h1>
</h1>
</td>
</td>
</tr>
</tr>
...
...
This diff is collapsed.
Click to expand it.
tickets.php
+
25
−
1
View file @
45f35c89
...
@@ -32,6 +32,23 @@ if($_REQUEST['id']) {
...
@@ -32,6 +32,23 @@ if($_REQUEST['id']) {
if
(
$_POST
&&
is_object
(
$ticket
)
&&
$ticket
->
getId
())
:
if
(
$_POST
&&
is_object
(
$ticket
)
&&
$ticket
->
getId
())
:
$errors
=
array
();
$errors
=
array
();
switch
(
strtolower
(
$_POST
[
'a'
])){
switch
(
strtolower
(
$_POST
[
'a'
])){
case
'edit'
:
if
(
!
$ticket
->
checkUserAccess
(
$thisclient
))
//double check perm again!
$errors
[
'err'
]
=
'Access Denied. Possibly invalid ticket ID'
;
else
{
$forms
=
DynamicFormEntry
::
forTicket
(
$ticket
->
getId
());
foreach
(
$forms
as
$form
)
if
(
!
$form
->
isValid
())
$errors
=
array_merge
(
$errors
,
$form
->
errors
());
}
if
(
!
$errors
)
{
foreach
(
$forms
as
$f
)
$f
->
save
();
$_REQUEST
[
'a'
]
=
null
;
//Clear edit action - going back to view.
$ticket
->
logNote
(
'Ticket details updated'
,
sprintf
(
'Ticket details were updated by client %s <%s>'
,
$thisclient
->
getName
(),
$thisclient
->
getEmail
()));
}
break
;
case
'reply'
:
case
'reply'
:
if
(
!
$ticket
->
checkUserAccess
(
$thisclient
))
//double check perm again!
if
(
!
$ticket
->
checkUserAccess
(
$thisclient
))
//double check perm again!
$errors
[
'err'
]
=
'Access Denied. Possibly invalid ticket ID'
;
$errors
[
'err'
]
=
'Access Denied. Possibly invalid ticket ID'
;
...
@@ -70,7 +87,14 @@ if($_POST && is_object($ticket) && $ticket->getId()):
...
@@ -70,7 +87,14 @@ if($_POST && is_object($ticket) && $ticket->getId()):
endif
;
endif
;
$nav
->
setActiveNav
(
'tickets'
);
$nav
->
setActiveNav
(
'tickets'
);
if
(
$ticket
&&
$ticket
->
checkUserAccess
(
$thisclient
))
{
if
(
$ticket
&&
$ticket
->
checkUserAccess
(
$thisclient
))
{
$inc
=
'view.inc.php'
;
if
(
isset
(
$_REQUEST
[
'a'
])
&&
$_REQUEST
[
'a'
]
==
'edit'
)
{
$inc
=
'edit.inc.php'
;
if
(
!
$forms
)
$forms
=
DynamicFormEntry
::
forTicket
(
$ticket
->
getId
());
// Auto add new fields to the entries
foreach
(
$forms
as
$f
)
$f
->
addMissingFields
();
}
else
$inc
=
'view.inc.php'
;
}
elseif
(
$cfg
->
showRelatedTickets
()
&&
$thisclient
->
getNumTickets
())
{
}
elseif
(
$cfg
->
showRelatedTickets
()
&&
$thisclient
->
getNumTickets
())
{
$inc
=
'tickets.inc.php'
;
$inc
=
'tickets.inc.php'
;
}
else
{
}
else
{
...
...
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