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
4ab3936a
Commit
4ab3936a
authored
11 years ago
by
Peter Rotich
Committed by
Jared Hancock
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add ability to set thank you page specific to a help topic.
parent
2fcdd56a
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.topic.php
+31
-14
31 additions, 14 deletions
include/class.topic.php
include/staff/helptopic.inc.php
+21
-7
21 additions, 7 deletions
include/staff/helptopic.inc.php
with
52 additions
and
21 deletions
include/class.topic.php
+
31
−
14
View file @
4ab3936a
...
...
@@ -16,10 +16,12 @@
class
Topic
{
var
$id
;
var
$ht
;
var
$parent
;
var
$page
;
function
Topic
(
$id
)
{
$this
->
id
=
0
;
$this
->
load
(
$id
);
...
...
@@ -40,11 +42,14 @@ class Topic {
return
false
;
$this
->
ht
=
db_fetch_array
(
$res
);
$this
->
id
=
$this
->
ht
[
'topic_id'
];
$this
->
id
=
$this
->
ht
[
'topic_id'
];
$this
->
page
=
null
;
return
true
;
}
function
reload
()
{
return
$this
->
load
();
}
...
...
@@ -52,7 +57,7 @@ class Topic {
function
asVar
()
{
return
$this
->
getName
();
}
function
getId
()
{
return
$this
->
id
;
}
...
...
@@ -71,7 +76,7 @@ class Topic {
function
getName
()
{
return
$this
->
ht
[
'name'
];
}
function
getDeptId
()
{
return
$this
->
ht
[
'dept_id'
];
}
...
...
@@ -91,7 +96,18 @@ class Topic {
function
getTeamId
()
{
return
$this
->
ht
[
'team_id'
];
}
function
getPageId
()
{
return
$this
->
ht
[
'page_id'
];
}
function
getPage
()
{
if
(
!
$this
->
page
&&
$this
->
getPageId
())
$this
->
page
=
Page
::
lookup
(
$this
->
getPageId
());
return
$this
->
page
;
}
function
autoRespond
()
{
return
(
!
$this
->
ht
[
'noautoresp'
]);
}
...
...
@@ -137,7 +153,7 @@ class Topic {
return
$num
;
}
/*** Static functions ***/
function
create
(
$vars
,
&
$errors
)
{
function
create
(
$vars
,
&
$errors
)
{
return
self
::
save
(
0
,
$vars
,
$errors
);
}
...
...
@@ -195,10 +211,10 @@ class Topic {
if
(
!
$vars
[
'dept_id'
])
$errors
[
'dept_id'
]
=
'You must select a department'
;
if
(
!
$vars
[
'priority_id'
])
$errors
[
'priority_id'
]
=
'You must select a priority'
;
if
(
$errors
)
return
false
;
$sql
=
' updated=NOW() '
...
...
@@ -207,6 +223,7 @@ class Topic {
.
',dept_id='
.
db_input
(
$vars
[
'dept_id'
])
.
',priority_id='
.
db_input
(
$vars
[
'priority_id'
])
.
',sla_id='
.
db_input
(
$vars
[
'sla_id'
])
.
',page_id='
.
db_input
(
$vars
[
'page_id'
])
.
',isactive='
.
db_input
(
$vars
[
'isactive'
])
.
',ispublic='
.
db_input
(
$vars
[
'ispublic'
])
.
',noautoresp='
.
db_input
(
isset
(
$vars
[
'noautoresp'
])
?
1
:
0
)
...
...
@@ -219,7 +236,7 @@ class Topic {
$sql
.
=
',staff_id=0, team_id='
.
db_input
(
preg_replace
(
"/[^0-9]/"
,
""
,
$vars
[
'assign'
]));
else
$sql
.
=
',staff_id=0, team_id=0 '
;
//no auto-assignment!
if
(
$id
)
{
$sql
=
'UPDATE '
.
TOPIC_TABLE
.
' SET '
.
$sql
.
' WHERE topic_id='
.
db_input
(
$id
);
if
(
db_query
(
$sql
))
...
...
@@ -230,10 +247,10 @@ class Topic {
$sql
=
'INSERT INTO '
.
TOPIC_TABLE
.
' SET '
.
$sql
.
',created=NOW()'
;
if
(
db_query
(
$sql
)
&&
(
$id
=
db_insert_id
()))
return
$id
;
$errors
[
'err'
]
=
'Unable to create the topic. Internal error'
;
}
return
false
;
}
}
...
...
This diff is collapsed.
Click to expand it.
include/staff/helptopic.inc.php
+
21
−
7
View file @
4ab3936a
...
...
@@ -149,6 +149,26 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
<em>
(Overwrites department's SLA)
</em>
</td>
</tr>
<tr>
<td
width=
"180"
>
Thank-you Page:
</td>
<td>
<select
name=
"page_id"
>
<option
value=
""
>
—
System Default
—
</option>
<?php
if
((
$pages
=
Page
::
getActiveThankYouPages
()))
{
foreach
(
$pages
as
$page
)
{
if
(
strcasecmp
(
$page
->
getType
(),
'thank-you'
))
continue
;
echo
sprintf
(
'<option value="%d" %s>%s</option>'
,
$page
->
getId
(),
(
$info
[
'page_id'
]
==
$page
->
getId
())
?
'selected="selected"'
:
''
,
$page
->
getName
());
}
}
?>
</select>
<font
class=
"error"
>
<?php
echo
$errors
[
'page_id'
];
?>
</font>
<em>
(Overwrites global setting. Applies to web tickets only.)
</em>
</td>
</tr>
<tr>
<td
width=
"180"
>
Auto-assign To:
...
...
@@ -156,14 +176,9 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
<td>
<select
name=
"assign"
>
<option
value=
"0"
>
—
Unassigned
—
</option>
<?php
$sql
=
' SELECT staff_id,CONCAT_WS(", ",lastname,firstname) as name '
.
' FROM '
.
STAFF_TABLE
.
' WHERE isactive=1 ORDER BY name'
;
if
((
$res
=
db_query
(
$sql
))
&&
db_num_rows
(
$res
)){
echo
'<OPTGROUP label="Staff Members">'
;
while
(
list
(
$id
,
$name
)
=
db_fetch_row
(
$res
)){
...
...
@@ -171,10 +186,9 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
$selected
=
(
$info
[
'assign'
]
==
$k
||
$info
[
'staff_id'
]
==
$id
)
?
'selected="selected"'
:
''
;
?>
<option
value=
"
<?php
echo
$k
;
?>
"
<?php
echo
$selected
;
?>
>
<?php
echo
$name
;
?>
</option>
<?php
}
echo
'</OPTGROUP>'
;
}
$sql
=
'SELECT team_id, name FROM '
.
TEAM_TABLE
.
' WHERE isenabled=1'
;
if
((
$res
=
db_query
(
$sql
))
&&
db_num_rows
(
$res
)){
...
...
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