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
2fcdd56a
Commit
2fcdd56a
authored
11 years ago
by
Peter Rotich
Committed by
Jared Hancock
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add ability set default (required) pages
parent
76bedb10
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.config.php
+65
-0
65 additions, 0 deletions
include/class.config.php
include/staff/settings-pages.inc.php
+73
-0
73 additions, 0 deletions
include/staff/settings-pages.inc.php
scp/settings.php
+1
-0
1 addition, 0 deletions
scp/settings.php
with
139 additions
and
0 deletions
include/class.config.php
+
65
−
0
View file @
2fcdd56a
...
@@ -368,6 +368,51 @@ class OsticketConfig extends Config {
...
@@ -368,6 +368,51 @@ class OsticketConfig extends Config {
return
$this
->
defaultTemplate
;
return
$this
->
defaultTemplate
;
}
}
function
getLandingPageId
()
{
return
$this
->
get
(
'landing_page_id'
);
}
function
getLandingPage
()
{
if
(
!
$this
->
landing_page
&&
$this
->
getLandingPageId
())
$this
->
landing_page
=
Page
::
lookup
(
$this
->
getLandingPageId
());
return
$this
->
landing_page
;
}
function
getOfflinePageId
()
{
return
$this
->
get
(
'offline_page_id'
);
}
function
getOfflinePage
()
{
if
(
!
$this
->
offline_page
&&
$this
->
getOfflinePageId
())
$this
->
offline_page
=
Page
::
lookup
(
$this
->
getOfflinePageId
());
return
$this
->
offline_page
;
}
function
getThankYouPageId
()
{
return
$this
->
get
(
'thank-you_page_id'
);
}
function
getThankYouPage
()
{
if
(
!
$this
->
thankyou_page
&&
$this
->
getThankYouPageId
())
$this
->
thankyou_page
=
Page
::
lookup
(
$this
->
getThankYouPageId
());
return
$this
->
thankyou_page
;
}
function
getDefaultPages
()
{
/* Array of ids...as opposed to objects */
return
array
(
$this
->
getLandingPageId
(),
$this
->
getOfflinePageId
(),
$this
->
getThankYouPageId
(),
);
}
function
getMaxOpenTickets
()
{
function
getMaxOpenTickets
()
{
return
$this
->
get
(
'max_open_tickets'
);
return
$this
->
get
(
'max_open_tickets'
);
}
}
...
@@ -641,6 +686,9 @@ class OsticketConfig extends Config {
...
@@ -641,6 +686,9 @@ class OsticketConfig extends Config {
case
'emails'
:
case
'emails'
:
return
$this
->
updateEmailsSettings
(
$vars
,
$errors
);
return
$this
->
updateEmailsSettings
(
$vars
,
$errors
);
break
;
break
;
case
'pages'
:
return
$this
->
updatePagesSettings
(
$vars
,
$errors
);
break
;
case
'autoresp'
:
case
'autoresp'
:
return
$this
->
updateAutoresponderSettings
(
$vars
,
$errors
);
return
$this
->
updateAutoresponderSettings
(
$vars
,
$errors
);
break
;
break
;
...
@@ -804,6 +852,23 @@ class OsticketConfig extends Config {
...
@@ -804,6 +852,23 @@ class OsticketConfig extends Config {
));
));
}
}
function
updatePagesSettings
(
$vars
,
&
$errors
)
{
$f
=
array
();
$f
[
'landing_page_id'
]
=
array
(
'type'
=>
'int'
,
'required'
=>
1
,
'error'
=>
'required'
);
$f
[
'offline_page_id'
]
=
array
(
'type'
=>
'int'
,
'required'
=>
1
,
'error'
=>
'required'
);
$f
[
'thank-you_page_id'
]
=
array
(
'type'
=>
'int'
,
'required'
=>
1
,
'error'
=>
'required'
);
if
(
!
Validator
::
process
(
$f
,
$vars
,
$errors
)
||
$errors
)
return
false
;
return
$this
->
updateAll
(
array
(
'landing_page_id'
=>
$vars
[
'landing_page_id'
],
'offline_page_id'
=>
$vars
[
'offline_page_id'
],
'thank-you_page_id'
=>
$vars
[
'thank-you_page_id'
],
));
}
function
updateAutoresponderSettings
(
$vars
,
&
$errors
)
{
function
updateAutoresponderSettings
(
$vars
,
&
$errors
)
{
if
(
$errors
)
return
false
;
if
(
$errors
)
return
false
;
...
...
This diff is collapsed.
Click to expand it.
include/staff/settings-pages.inc.php
0 → 100644
+
73
−
0
View file @
2fcdd56a
<?php
if
(
!
defined
(
'OSTADMININC'
)
||
!
$thisstaff
||
!
$thisstaff
->
isAdmin
()
||
!
$config
)
die
(
'Access Denied'
);
$pages
=
Page
::
getPages
();
?>
<h2>
Site Pages
</h2>
<form
action=
"settings.php?t=pages"
method=
"post"
id=
"save"
>
<?php
csrf_token
();
?>
<input
type=
"hidden"
name=
"t"
value=
"pages"
>
<table
class=
"form_table settings_table"
width=
"940"
border=
"0"
cellspacing=
"0"
cellpadding=
"2"
>
<thead>
<tr>
<th
colspan=
"2"
>
<h4>
Pages
</h4>
<em>
To edit or add new pages go to
<a
href=
"pages"
>
Manage > Site Pages
</a></em>
</th>
</tr>
</thead>
<tbody>
<tr>
<td
width=
"220"
class=
"required"
>
Default Landing Page:
</td>
<td>
<select
name=
"landing_page_id"
>
<option
value=
""
>
—
Select Landing Page
—
</option>
<?php
foreach
(
$pages
as
$page
)
{
if
(
strcasecmp
(
$page
->
getType
(),
'landing'
))
continue
;
echo
sprintf
(
'<option value="%d" %s>%s</option>'
,
$page
->
getId
(),
(
$config
[
'landing_page_id'
]
==
$page
->
getId
())
?
'selected="selected"'
:
''
,
$page
->
getName
());
}
?>
</select>
<font
class=
"error"
>
*
<?php
echo
$errors
[
'landing_page_id'
];
?>
</font>
</td>
</tr>
<tr>
<td
width=
"220"
class=
"required"
>
Default Offline Page:
</td>
<td>
<select
name=
"offline_page_id"
>
<option
value=
""
>
—
Select Offline Page
—
</option>
<?php
foreach
(
$pages
as
$page
)
{
if
(
strcasecmp
(
$page
->
getType
(),
'offline'
))
continue
;
echo
sprintf
(
'<option value="%d" %s>%s</option>'
,
$page
->
getId
(),
(
$config
[
'offline_page_id'
]
==
$page
->
getId
())
?
'selected="selected"'
:
''
,
$page
->
getName
());
}
?>
</select>
<font
class=
"error"
>
*
<?php
echo
$errors
[
'offline_page_id'
];
?>
</font>
</td>
</tr>
<tr>
<td
width=
"220"
class=
"required"
>
Default Thank-You Page:
</td>
<td>
<select
name=
"thank-you_page_id"
>
<option
value=
""
>
—
Select Thank-You Page
—
</option>
<?php
foreach
(
$pages
as
$page
)
{
if
(
strcasecmp
(
$page
->
getType
(),
'thank-you'
))
continue
;
echo
sprintf
(
'<option value="%d" %s>%s</option>'
,
$page
->
getId
(),
(
$config
[
'thank-you_page_id'
]
==
$page
->
getId
())
?
'selected="selected"'
:
''
,
$page
->
getName
());
}
?>
</select>
<font
class=
"error"
>
*
<?php
echo
$errors
[
'thank-you_page_id'
];
?>
</font>
</td>
</tr>
</tbody>
</table>
<p
style=
"padding-left:250px;"
>
<input
class=
"button"
type=
"submit"
name=
"submit"
value=
"Save Changes"
>
<input
class=
"button"
type=
"reset"
name=
"reset"
value=
"Reset Changes"
>
</p>
</form>
This diff is collapsed.
Click to expand it.
scp/settings.php
+
1
−
0
View file @
2fcdd56a
...
@@ -19,6 +19,7 @@ $settingOptions=array(
...
@@ -19,6 +19,7 @@ $settingOptions=array(
'system'
=>
'System Settings'
,
'system'
=>
'System Settings'
,
'tickets'
=>
'Ticket Settings and Options'
,
'tickets'
=>
'Ticket Settings and Options'
,
'emails'
=>
'Email Settings'
,
'emails'
=>
'Email Settings'
,
'pages'
=>
'Site Pages'
,
'kb'
=>
'Knowledgebase Settings'
,
'kb'
=>
'Knowledgebase Settings'
,
'autoresp'
=>
'Autoresponder Settings'
,
'autoresp'
=>
'Autoresponder Settings'
,
'alerts'
=>
'Alerts and Notices Settings'
);
'alerts'
=>
'Alerts and Notices Settings'
);
...
...
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