Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Eric Rasmussen
UNL-CMS
Commits
e323fe7d
Commit
e323fe7d
authored
Feb 14, 2013
by
Eric Rasmussen
Browse files
[gh-603] Send support email to mysupport rather than listsrv
Also, rebrand as 'support' from 'technical feedback'
parent
e6a7855b
Changes
2
Hide whitespace changes
Inline
Side-by-side
sites/all/modules/unl/unl.module
View file @
e323fe7d
...
...
@@ -106,10 +106,10 @@ function unl_block_list_alter(&$blocks) {
*/
function
unl_toolbar_add_links
(
$toolbar
)
{
$link
[
'html'
]
=
TRUE
;
$icon
=
'<span style="background-image:url('
.
base_path
()
.
'sites/all/modules/unl/images/feedback_toolbar.png); background-repeat: no-repeat; width:17px; height:14px; text-indent:-9999px; display:block; margin: 3px 0;">
Feedback
</span>'
;
$icon
=
'<span style="background-image:url('
.
base_path
()
.
'sites/all/modules/unl/images/feedback_toolbar.png); background-repeat: no-repeat; width:17px; height:14px; text-indent:-9999px; display:block; margin: 3px 0;">
Support
</span>'
;
$link
[
'title'
]
=
t
(
"!icon"
,
array
(
'!icon'
=>
$icon
));
$link
[
'attributes'
][
'title'
]
=
t
(
'Submit
technical
feedback/issues/problems
about
the UNLcms system'
);
$link
[
'href'
]
=
'user/unl/
technical_feedback
'
;
$link
[
'attributes'
][
'title'
]
=
t
(
'Submit feedback/issues/problems
concerning
the UNLcms system'
);
$link
[
'href'
]
=
'user/unl/
support
'
;
$toolbar
[
'toolbar_user'
][
'#links'
]
=
array_merge
(
array
(
'unl'
=>
$link
),
$toolbar
[
'toolbar_user'
][
'#links'
]);
return
$toolbar
;
...
...
@@ -301,15 +301,15 @@ function unl_menu() {
'file'
=>
'unl_whoami.php'
,
);
// Returns UNLcms
technical feedback
form
$items
[
'user/unl/
technical_feedback
'
]
=
array
(
'title'
=>
'UNLcms
Technical Feeedback
Form'
,
'description'
=>
'Submit
technical
feedback/issues/problems
about
the UNLcms system.'
,
// Returns UNLcms
support
form
$items
[
'user/unl/
support
'
]
=
array
(
'title'
=>
'UNLcms
Support
Form'
,
'description'
=>
'Submit feedback/issues/problems
concerning
the UNLcms system.'
,
'access callback'
=>
'user_is_logged_in'
,
'page callback'
=>
'drupal_get_form'
,
'page arguments'
=>
array
(
'unl_
technical_feedback
'
),
'page arguments'
=>
array
(
'unl_
support
'
),
'type'
=>
MENU_NORMAL_ITEM
,
'file'
=>
'
technical_feedback
.php'
,
'file'
=>
'
unl_support
.php'
,
);
$items
[
'admin/content/unl/reset'
]
=
array
(
...
...
sites/all/modules/unl/
technical_feedback
.php
→
sites/all/modules/unl/
unl_support
.php
View file @
e323fe7d
<?php
function
unl_
technical_feedback
(
$form
,
&
$form_state
)
{
function
unl_
support
(
$form
,
&
$form_state
)
{
$form
[
'root'
]
=
array
(
'#title'
=>
'UNLcms
Technical Feeedback F
orm'
,
'#title'
=>
'UNLcms
support f
orm'
,
);
$form
[
'root'
][
'cas_username'
]
=
array
(
'#type'
=>
'textfield'
,
'#title'
=>
t
(
'Username'
),
'#value'
=>
(
$GLOBALS
[
'user'
]
->
name
),
'#disabled'
=>
'disabled'
,
);
$form
[
'root'
][
'email'
]
=
array
(
'#type'
=>
'textfield'
,
'#title'
=>
t
(
'Email'
),
'#value'
=>
(
$GLOBALS
[
'user'
]
->
mail
),
'#disabled'
=>
'disabled'
,
);
$form
[
'root'
][
'browser_useragent'
]
=
array
(
'#type'
=>
'textfield'
,
'#title'
=>
t
(
'Browser UserAgent'
),
...
...
@@ -26,7 +23,6 @@ function unl_technical_feedback($form, &$form_state) {
'#disabled'
=>
'disabled'
,
'#size'
=>
120
,
);
$form
[
'root'
][
'site'
]
=
array
(
'#type'
=>
'textfield'
,
'#title'
=>
t
(
'Site'
),
...
...
@@ -34,20 +30,17 @@ function unl_technical_feedback($form, &$form_state) {
'#disabled'
=>
'disabled'
,
'#size'
=>
120
,
);
$form
[
'root'
][
'current_url'
]
=
array
(
'#type'
=>
'textfield'
,
'#title'
=>
t
(
'Page address in question'
),
'#value'
=>
$_SERVER
[
'HTTP_REFERER'
],
'#size'
=>
120
,
);
$form
[
'root'
][
'technical_feedback'
]
=
array
(
'#type'
=>
'textarea'
,
'#title'
=>
t
(
'
Please give y
our feedback or
describe
the issue you are having'
),
'#title'
=>
t
(
'
Y
our feedback or the issue you are having'
),
'#required'
=>
TRUE
,
);
$form
[
'root'
][
'submit'
]
=
array
(
'#type'
=>
'submit'
,
'#value'
=>
t
(
'Submit'
),
...
...
@@ -56,27 +49,32 @@ function unl_technical_feedback($form, &$form_state) {
return
$form
;
}
function
unl_technical_feedback_submit
(
$form
,
&
$form_state
)
{
$to
=
"unlcms-dev@listserv.unl.edu"
;
$from
=
$form_state
[
'values'
][
'email'
];
$subject
=
"UNLcms technical feedback from "
.
$form_state
[
'values'
][
'cas_username'
];
function
unl_support_submit
(
$form
,
&
$form_state
)
{
$to
=
'mysupport@unl.edu'
;
$subject
=
'UNLcms: '
.
substr
(
$form_state
[
'values'
][
'technical_feedback'
],
0
,
44
)
.
'...'
;
$message
=
<<<
EOF
contact
=
{
$form_state
[
'values'
][
'email'
]}
assignees
=
"UNLCMS and Web Support"
{
$form_state
[
'values'
][
'technical_feedback'
]}
Requestor
:
{
$form_state
[
'values'
][
'cas_username'
]}
Email
:
{
$form_state
[
'values'
][
'email'
]}
UserAgent
:
{
$form_state
[
'values'
][
'browser_useragent'
]}
Site
:
{
$form_state
[
'values'
][
'site'
]}
Page
:
{
$form_state
[
'input'
][
'current_url'
]}
$message
=
'
Username: '
.
$form_state
[
'values'
][
'cas_username'
]
.
'
Email: '
.
$form_state
[
'values'
][
'email'
]
.
'
UserAgent: '
.
$form_state
[
'values'
][
'browser_useragent'
]
.
'
Site: '
.
$form_state
[
'values'
][
'site'
]
.
'
Page: '
.
$form_state
[
'input'
][
'current_url'
]
.
'
Comment:
'
.
$form_state
[
'values'
][
'technical_feedback'
];
(
This
request
was
sent
from
a
UNLcms
support
form
at
{
$form_state
[
'values'
][
'site'
]}
user
/
unl
/
support
)
EOF
;
$headers
=
'
From:
'
.
$form_state
[
'values'
][
'email'
]
.
"
\n
"
;
$headers
.
=
"MIME-Version: 1.0
\n
"
;
$headers
.
=
"Content-type:text/plain; charset=UTF-8
\n
"
;
$headers
=
"
From:
mysupportform@unl.edu
\n
"
.
"MIME-Version: 1.0
\n
"
.
"Content-type:text/plain; charset=UTF-8
\n
"
;
mail
(
$to
,
$subject
,
$message
,
$headers
);
drupal_set_message
(
t
(
'Your
feedback has been emailed to the UNLcms dev team. Thank you!
'
));
drupal_set_message
(
t
(
'Your
message was submitted as a support ticket to MySupport (http://mysupport.unl.edu/) and the UNLcms team was notified.
'
));
return
;
}
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment