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
b64a1904
Commit
b64a1904
authored
10 years ago
by
Jared Hancock
Browse files
Options
Downloads
Patches
Plain Diff
forms: Use new file upload field for staff response
parent
232d85eb
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/class.forms.php
+1
-0
1 addition, 0 deletions
include/class.forms.php
include/staff/ticket-view.inc.php
+3
-1
3 additions, 1 deletion
include/staff/ticket-view.inc.php
scp/tickets.php
+14
-2
14 additions, 2 deletions
scp/tickets.php
with
18 additions
and
3 deletions
include/class.forms.php
+
1
−
0
View file @
b64a1904
...
...
@@ -59,6 +59,7 @@ class Form {
function
getTitle
()
{
return
$this
->
title
;
}
function
getInstructions
()
{
return
$this
->
instructions
;
}
function
getSource
()
{
return
$this
->
_source
;
}
function
setSource
(
$source
)
{
$this
->
_source
=
$source
;
}
/**
* Validate the form and indicate if there no errors.
...
...
This diff is collapsed.
Click to expand it.
include/staff/ticket-view.inc.php
+
3
−
1
View file @
b64a1904
...
...
@@ -591,7 +591,9 @@ $tcount+= $ticket->getNumNotes();
<div
class=
"uploads"
>
</div>
<div
class=
"file_input"
>
<input
type=
"file"
class=
"multifile"
name=
"attachments[]"
size=
"30"
value=
""
/>
<?php
print
$response_form
->
getField
(
'attachments'
)
->
render
();
?>
</div>
</td>
</tr>
...
...
This diff is collapsed.
Click to expand it.
scp/tickets.php
+
14
−
2
View file @
b64a1904
...
...
@@ -39,6 +39,11 @@ if($_REQUEST['id']) {
if
(
$_REQUEST
[
'uid'
])
$user
=
User
::
lookup
(
$_REQUEST
[
'uid'
]);
// Configure form for file uploads
$response_form
=
new
Form
(
array
(
'attachments'
=>
new
FileUploadField
(
array
(
'id'
=>
'attach'
))
));
//At this stage we know the access status. we can process the post.
if
(
$_POST
&&
!
$errors
)
:
...
...
@@ -65,8 +70,10 @@ if($_POST && !$errors):
//If no error...do the do.
$vars
=
$_POST
;
if
(
!
$errors
&&
$_FILES
[
'attachments'
])
$vars
[
'files'
]
=
AttachmentFile
::
format
(
$_FILES
[
'attachments'
]);
$attachments
=
$response_form
->
getField
(
'attachments'
)
->
getClean
();
if
(
!
$errors
&&
$attachments
)
$vars
[
'cannedattachments'
]
=
array_merge
(
$vars
[
'cannedattachments'
]
?:
array
(),
$attachments
);
if
(
!
$errors
&&
(
$response
=
$ticket
->
postReply
(
$vars
,
$errors
,
$_POST
[
'emailreply'
])))
{
$msg
=
sprintf
(
__
(
'%s: Reply posted successfully'
),
...
...
@@ -75,6 +82,10 @@ if($_POST && !$errors):
$ticket
->
getId
(),
$ticket
->
getNumber
()))
);
// Clear attachment list
$response_form
->
setSource
(
array
());
$response_form
->
getField
(
'attachments'
)
->
reset
();
// Remove staff's locks
TicketLock
::
removeStaffLocks
(
$thisstaff
->
getId
(),
$ticket
->
getId
());
...
...
@@ -465,4 +476,5 @@ if($ticket) {
require_once
(
STAFFINC_DIR
.
'header.inc.php'
);
require_once
(
STAFFINC_DIR
.
$inc
);
print
$response_form
->
getMedia
();
require_once
(
STAFFINC_DIR
.
'footer.inc.php'
);
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