Merge lp:~felmas/mvhub/add_referer_contact_email into lp:mvhub

Proposed by Ferhat Elmas
Status: Merged
Merged at revision: 571
Proposed branch: lp:~felmas/mvhub/add_referer_contact_email
Merge into: lp:mvhub
Diff against target: 67 lines (+28/-4)
2 files modified
app-mvhub/DocumentRoot/cgi-bin/mvhub/contact_form.pl (+21/-1)
app-mvhub/conf/templates/html/contact_form.tmpl (+7/-3)
To merge this branch: bzr merge lp:~felmas/mvhub/add_referer_contact_email
Reviewer Review Type Date Requested Status
MVHub devs with commit rights Pending
Review via email: mp+66641@code.launchpad.net

Description of the change

improve of contact email with referer

To post a comment you must log in.
Revision history for this message
Dan MacNeil (omacneil) wrote :

Looks like these lines:

58 +
59 + <td><span class="warning">
60 + <!-- tmpl_var error-referer --></span></td>

... are still there.

If FormBuilder requires <!-- tmpl_var error-referer --> , that is fine but no need for the <span></span> which inserts blank line.

This is a really, really microscopic flaw, but it is also very easy to fix.

573. By Ferhat Elmas <ferhat@veteran-linux>

associate with bug 539662 ( improve contact form with referer info )

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app-mvhub/DocumentRoot/cgi-bin/mvhub/contact_form.pl'
2--- app-mvhub/DocumentRoot/cgi-bin/mvhub/contact_form.pl 2010-10-22 19:49:21 +0000
3+++ app-mvhub/DocumentRoot/cgi-bin/mvhub/contact_form.pl 2011-07-01 20:06:38 +0000
4@@ -31,6 +31,11 @@
5 );
6
7 $form->field(
8+ name => 'referer',
9+ type => 'hidden',
10+ required => 1
11+ );
12+ $form->field(
13 name => 'name',
14 size => 45,
15 label => 'Your name',
16@@ -75,7 +80,7 @@
17 From => $fields->{name} . ' <' . $fields->{liame} . '>',
18 To => $cfg->param('NOTIFICATION.admin_email'),
19 Subject => $subject,
20- Data => $fields->{question},
21+ Data => $fields->{question} . " \nREFERER: " . $fields->{referer},
22 );
23 MVHub::Common::sendmail($mail);
24
25@@ -89,6 +94,21 @@
26
27 }
28 else {
29+ if ( $ENV{HTTP_REFERER} ) {
30+ $form->field(
31+ name => 'referer',
32+ value => $ENV{HTTP_REFERER},
33+ force => 1
34+ );
35+ }
36+ else {
37+ $form->field(
38+ name => 'referer',
39+ value => 'not available, user came to contact directly',
40+ force => 1
41+ );
42+ }
43+
44 my $show_nsp_left_menu = 0;
45 if ( $site_code eq 'nsp' ) {
46 $show_nsp_left_menu = 1;
47
48=== modified file 'app-mvhub/conf/templates/html/contact_form.tmpl'
49--- app-mvhub/conf/templates/html/contact_form.tmpl 2010-07-21 20:00:54 +0000
50+++ app-mvhub/conf/templates/html/contact_form.tmpl 2011-07-01 20:06:38 +0000
51@@ -23,9 +23,13 @@
52 comments, please <strong>fill out the form
53 below</strong>, and we will respond within 2
54 business days.</p><!-- tmpl_var form-start -->
55-
56- <table summary='contact form'>
57- <tr>
58+ <!-- tmpl_var field-referer -->
59+ <span class="warning">
60+ <!-- tmpl_var error-referer --></span>
61+
62+ <table summary='contact form'>
63+
64+ <tr>
65 <td><!-- tmpl_var label-name -->:</td>
66
67 <td><!-- tmpl_var field-name --></td>

Subscribers

People subscribed via source and target branches