aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/problem-creation-graph2
-rwxr-xr-xbin/problems-filed-graph2
-rwxr-xr-xbin/send-reports17
-rw-r--r--conf/crontab.ugly6
l---------[-rw-r--r--]conf/packages39
-rw-r--r--conf/packages.debian-squeeze38
-rw-r--r--conf/packages.debian-squeeze+testing38
-rw-r--r--notes/INSTALL.pod107
-rw-r--r--perllib/FixMyStreet/Geocode/Bing.pm9
-rw-r--r--perllib/FixMyStreet/Geocode/Google.pm9
-rw-r--r--templates/web/fixmystreet/static/for_councils.html2
-rw-r--r--templates/web/fixmystreet/static/for_councils_faq.html19
-rw-r--r--urls.txt12
-rw-r--r--web/cobrands/fixmystreet/_base.scss11
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js1
-rw-r--r--web/js/map-OpenLayers.js10
16 files changed, 230 insertions, 92 deletions
diff --git a/bin/problem-creation-graph b/bin/problem-creation-graph
index 4bba1cdb8..6692ae724 100755
--- a/bin/problem-creation-graph
+++ b/bin/problem-creation-graph
@@ -104,6 +104,6 @@ END
#echo "gpscript $GPSCRIPT"
export GDFONTPATH=/usr/share/fonts/truetype/ttf-bitstream-vera
-gnuplot < $GPSCRIPT > fixmystreet/web/bci-live-creation$EXTENSION
+gnuplot < $GPSCRIPT > fixmystreet/web/bci-live-creation$EXTENSION 2>/dev/null
diff --git a/bin/problems-filed-graph b/bin/problems-filed-graph
index dbac35639..8addacd62 100755
--- a/bin/problems-filed-graph
+++ b/bin/problems-filed-graph
@@ -57,5 +57,5 @@ END
#echo "gpscript $GPSCRIPT"
export GDFONTPATH=/usr/share/fonts/truetype/ttf-bitstream-vera
-gnuplot < $GPSCRIPT > fixmystreet/web/bci-live-line$EXTENSION
+gnuplot < $GPSCRIPT > fixmystreet/web/bci-live-line$EXTENSION 2>/dev/null
diff --git a/bin/send-reports b/bin/send-reports
index b7a6b9571..17fe225a4 100755
--- a/bin/send-reports
+++ b/bin/send-reports
@@ -560,19 +560,28 @@ sub post_barnet_message {
$problem->external_body( 'Barnet Borough Council' ); # better to use $problem->body()?
$problem->send_method_used('barnet');
$return = 0;
- } else {
- $err_msg = "Failed (problem id $h{id}): service returned no external id";
+ } else {
+ my @returned_items = split /<item[^>]*>/, $result->get_ET_RETURN;
+ my @messages = ();
+ foreach my $item (@returned_items) {
+ if ($item=~/<MESSAGE [^>]*>\s*(\S.*?)<\/MESSAGE>/) { # if there's a non-null MESSAGE in there, grab it
+ push @messages, $1; # best stab at extracting useful error message back from convoluted response
+ }
+ }
+ push @messages, "service returned no external id" unless @messages;
+ $err_msg = "Failed (problem id $h{id}): " . join(" \n ", @messages);
}
} else {
my %fault = (
'code' => $result->get_faultcode(),
'actor' => $result->get_faultactor(),
'string' => $result->get_faultstring(),
- # 'detail' => $result->get_detail(), # possibly only contains debug info
+ 'detail' => $result->get_detail(), # possibly only contains debug info
);
$fault{$_}=~s/^\s*|\s*$//g foreach keys %fault;
$fault{actor}&&=" (actor: $fault{actor})";
- $err_msg = "Failed (problem id $h{id}): Fault $fault{code}$fault{actor}\n$fault{string}";
+ $fault{'detail'} &&= "\n" . $fault{'detail'};
+ $err_msg = "Failed (problem id $h{id}): Fault $fault{code}$fault{actor}\n$fault{string}$fault{detail}";
}
};
diff --git a/conf/crontab.ugly b/conf/crontab.ugly
index 4052275ee..1a4e82cee 100644
--- a/conf/crontab.ugly
+++ b/conf/crontab.ugly
@@ -7,10 +7,10 @@
# $Id: crontab.ugly,v 1.23 2010-01-07 10:32:24 louise Exp $
PATH=/usr/local/bin:/usr/bin:/bin
-!!(* if ($vhost eq 'integration-staging.fixmystreet.com') { *)!!
-MAILTO=dave@mysociety.org
-!!(* } else { *)!!
+!!(* if ($vhost eq 'www.fixmystreet.com' || $vhost eq 'reportemptyhomes.com') { *)!!
MAILTO=cron-!!(*= $site *)!!@mysociety.org
+!!(* } else { *)!!
+MAILTO=!!(*= $user *)!!@mysociety.org
!!(* } *)!!
# On only one server
diff --git a/conf/packages b/conf/packages
index 0f0c48df2..b5287718b 100644..120000
--- a/conf/packages
+++ b/conf/packages
@@ -1,38 +1 @@
-jhead
-libdatetime-format-w3cdtf-perl
-libcache-memcached-perl
-libdbd-pg-perl
-libdbi-perl
-libdigest-sha1-perl
-liberror-perl
-libfcgi-perl
-libfile-slurp-perl
-libgeography-nationalgrid-perl
-libhtml-parser-perl
-libio-string-perl
-liblingua-en-inflect-perl
-liblocale-gettext-perl
-libsoap-lite-perl
-libstatistics-distributions-perl
-liburi-perl
-libwww-perl
-libxml-rss-perl
-memcached
-perl
-perl-base
-perl-modules
-perlmagick
-libjson-perl
-libimage-size-perl
-libmath-bigint-gmp-perl
-gettext
-libtest-exception-perl
-libipc-run3-perl
-libyaml-perl
-liblist-moreutils-perl
-ruby-compass | libhaml-ruby
-libtemplate-perl
-postgresql-8.4
-postgresql-server-dev-8.4
-gnuplot
-ttf-bitstream-vera
+packages.debian-squeeze+testing \ No newline at end of file
diff --git a/conf/packages.debian-squeeze b/conf/packages.debian-squeeze
new file mode 100644
index 000000000..cb494157d
--- /dev/null
+++ b/conf/packages.debian-squeeze
@@ -0,0 +1,38 @@
+jhead
+libdatetime-format-w3cdtf-perl
+libcache-memcached-perl
+libdbd-pg-perl
+libdbi-perl
+libdigest-sha1-perl
+liberror-perl
+libfcgi-perl
+libfile-slurp-perl
+libgeography-nationalgrid-perl
+libhtml-parser-perl
+libio-string-perl
+liblingua-en-inflect-perl
+liblocale-gettext-perl
+libsoap-lite-perl
+libstatistics-distributions-perl
+liburi-perl
+libwww-perl
+libxml-rss-perl
+memcached
+perl
+perl-base
+perl-modules
+perlmagick
+libjson-perl
+libimage-size-perl
+libmath-bigint-gmp-perl
+gettext
+libtest-exception-perl
+libipc-run3-perl
+libyaml-perl
+liblist-moreutils-perl
+libhaml-ruby
+libtemplate-perl
+postgresql-8.4
+postgresql-server-dev-8.4
+gnuplot
+ttf-bitstream-vera
diff --git a/conf/packages.debian-squeeze+testing b/conf/packages.debian-squeeze+testing
new file mode 100644
index 000000000..cec3a2624
--- /dev/null
+++ b/conf/packages.debian-squeeze+testing
@@ -0,0 +1,38 @@
+jhead
+libdatetime-format-w3cdtf-perl
+libcache-memcached-perl
+libdbd-pg-perl
+libdbi-perl
+libdigest-sha1-perl
+liberror-perl
+libfcgi-perl
+libfile-slurp-perl
+libgeography-nationalgrid-perl
+libhtml-parser-perl
+libio-string-perl
+liblingua-en-inflect-perl
+liblocale-gettext-perl
+libsoap-lite-perl
+libstatistics-distributions-perl
+liburi-perl
+libwww-perl
+libxml-rss-perl
+memcached
+perl
+perl-base
+perl-modules
+perlmagick
+libjson-perl
+libimage-size-perl
+libmath-bigint-gmp-perl
+gettext
+libtest-exception-perl
+libipc-run3-perl
+libyaml-perl
+liblist-moreutils-perl
+ruby-compass
+libtemplate-perl
+postgresql-8.4
+postgresql-server-dev-8.4
+gnuplot
+ttf-bitstream-vera
diff --git a/notes/INSTALL.pod b/notes/INSTALL.pod
index ea549bd7e..701112b45 100644
--- a/notes/INSTALL.pod
+++ b/notes/INSTALL.pod
@@ -13,6 +13,11 @@ following command from inside the fixmystreet directory:
git submodule update --init
+If you're using git version 1.6.5 or later, you can do those steps in
+one go with:
+
+ git clone --recursive https://github.com/mysociety/fixmystreet.git
+
=head1 REQUIREMENTS
On the server you are installing FixMyStreet on you will need the following things:
@@ -50,17 +55,24 @@ to CSS convertor. You can get one from L<http://sass-lang.com/>
If you're expecting a lot of traffic it's recommended that you install memcached: L<http://memcached.org/>
-If you're using a Debian based Linux distribution then the packages to install
-some required dependencies (though not all the required Perl modules) are
-listed in C<conf/packages>. To install all of them you can run:
+If you're using Debian 6.0 ("squeeze") then the packages to install
+some required dependencies (though not all the required Perl modules)
+are listed in C<conf/packages.debian-squeeze>. To install all of them
+you can run:
- xargs -a conf/packages apt-get install
+ sudo xargs -a conf/packages.debian-squeeze apt-get install
-Note, you will need to either be logged in as root or to use
+A similar list of packages should work for other Debian-based
+distributions. (Please let us know if you would like to contribute
+such a package list or instructions for other distributions.)
- sudo xargs -a conf/packages apt-get install
+To generate the CSS for the current design of FixMyStreet you will
+also need Compass L<http://compass-style.org/>, but unfortunately
+it is not packaged in Debian squeeze (or squeeze-backports). You
+will either need to install the package from testing, or you could
+install it from the Ruby gem with:
-for this to work.
+ gem install compass
=head2 Service dependencies
@@ -81,22 +93,70 @@ geolocation services.
=head1 DETAILED INSTALLATION INSTRUCTIONS
-=head2 Unpacking the Code
-
-Once you've downloaded the code you should unpack it. The best place to do this
-is in the location you want the web server vhost to be.
-
=head2 Creating the database
-The default settings file assumes the database is called fms and the user the same.
+The default settings file (C<conf/general.yml>) assumes the database is called fms and the user the same.
You can change these if you like.
+If you wish to create this new database and database user with
+password authentication, the following steps may help. First, create
+the fms user:
+
+ $ sudo -u postgres createuser fms
+ Shall the new role be a superuser? (y/n) n
+ Shall the new role be allowed to create databases? (y/n) n
+ Shall the new role be allowed to create more new roles? (y/n) n
+
+Then create the fms database:
+
+ $ sudo -u postgres createdb fms
+
+Set the password of the fms user, and change the owner of the fms database to be the fms user:
+
+ $ sudo -u postgres psql
+ postgres=# ALTER USER fms WITH PASSWORD 'somepassword'
+ ALTER ROLE
+ postgres=# ALTER DATABASE fms OWNER to fms;
+ ALTER DATABASE
+ postgres=# \q
+ $
+
+Then you need to configure PostgreSQL to allow password-based access
+to the fms database as the user fms from using Unix-domain sockets.
+Edit the file C</etc/postgresql/8.4/main/pg_hba.conf> and add as the
+first line:
+
+ local fms fms md5
+
+You will then need to restart PostgreSQL with:
+
+ $ sudo /etc/init.d/postgresql restart
+
+If you want to access the database from the command line, you can add
+the following line to C<~/.pgpass>:
+
+ localhost:*:fms:fms:somepassword
+
+Then you should be able to access the database with:
+
+ $ psql -U fms fms
+
=head2 Set up the database
-Once you've created the database you can use the sql in C<db/schema.sql> to create the required
+Before creating the database schema, you will need to install the
+PostgreSQL's SQL procedural language into the database:
+
+ createlang -U fms plpgsql fms
+
+Now you can use the sql in C<db/schema.sql> to create the required
tables, triggers and stored procedures. You will also need to run
-C<db/alert_types.sql> which
-populates the alert_types table.
+C<db/alert_types.sql> which populates the alert_types table. For
+example, you might run:
+
+ $ psql -U fms fms < db/schema.sql
+ ...
+ $ psql -U fms fms < db/alert_types.sql
+ ...
=head2 Install Perl modules
@@ -130,6 +190,21 @@ the required development tools.
=head2 Set up Webserver
+For production use of FixMyStreet, we suggest you use Apache and
+FastCGI. (See below.) For local development, however, you can use
+the Catalyst development server. First, install the Catalyst
+development tools with:
+
+ ./bin/cron-wrapper local/bin/carton install Catalyst::Devel
+
+Then the development server can be run with:
+
+ CATALYST_DEBUG=1 ./bin/cron-wrapper ./script/fixmystreet_app_server.pl -r
+
+The server will be accessible as L<http://localhost:3000/>.
+
+=head3 Setting up Apache
+
It is recommended that you run FixMyStreet using FastCGI. It should also be
possible to run it using Plack/PSGI.
diff --git a/perllib/FixMyStreet/Geocode/Bing.pm b/perllib/FixMyStreet/Geocode/Bing.pm
index 4ba00dbfe..a24f7c102 100644
--- a/perllib/FixMyStreet/Geocode/Bing.pm
+++ b/perllib/FixMyStreet/Geocode/Bing.pm
@@ -69,7 +69,14 @@ sub string {
);
( $latitude, $longitude ) = @{ $_->{point}->{coordinates} };
- push (@$error, { address => $address, latitude => $latitude, longitude => $longitude });
+ # These co-ordinates are output as query parameters in a URL, make sure they have a "."
+ mySociety::Locale::in_gb_locale {
+ push (@$error, {
+ address => $address,
+ latitude => sprintf('%0.6f', $latitude),
+ longitude => sprintf('%0.6f', $longitude)
+ });
+ };
push (@valid_locations, $_);
}
diff --git a/perllib/FixMyStreet/Geocode/Google.pm b/perllib/FixMyStreet/Geocode/Google.pm
index 83b36dbcd..1ab347066 100644
--- a/perllib/FixMyStreet/Geocode/Google.pm
+++ b/perllib/FixMyStreet/Geocode/Google.pm
@@ -75,7 +75,14 @@ sub string {
my $address = $_->{address};
next unless $c->cobrand->geocoded_string_check( $address );
( $longitude, $latitude ) = @{ $_->{Point}->{coordinates} };
- push (@$error, { address => $address, latitude => $latitude, longitude => $longitude });
+ # These co-ordinates are output as query parameters in a URL, make sure they have a "."
+ mySociety::Locale::in_gb_locale {
+ push (@$error, {
+ address => $address,
+ latitude => sprintf('%0.6f', $latitude),
+ longitude => sprintf('%0.6f', $longitude)
+ });
+ };
push (@valid_locations, $_);
}
return { latitude => $latitude, longitude => $longitude } if scalar @valid_locations == 1;
diff --git a/templates/web/fixmystreet/static/for_councils.html b/templates/web/fixmystreet/static/for_councils.html
index 2e83c7c6c..1e1789df7 100644
--- a/templates/web/fixmystreet/static/for_councils.html
+++ b/templates/web/fixmystreet/static/for_councils.html
@@ -38,8 +38,6 @@ forty local authorities in the UK. We understand the challenges that councils
face in channel shift, and will bring our passion and expertise to support your
journey.
-<p><a href="http://www.mysociety.org/wp/wp-content/uploads/2012/02/FixMyStreet_for_councils_2012.pdf">FixMyStreet for Councils brochure</a>
-
<p>Have questions? Read our <a href="/for-councils/faq">Questions and Answers for Councils</a>
or get in touch at <a href="mailto:hello&#64;mysociety.org">hello&#64;mysociety.org</a>.
diff --git a/templates/web/fixmystreet/static/for_councils_faq.html b/templates/web/fixmystreet/static/for_councils_faq.html
index 16c7d5cfe..d45166ed1 100644
--- a/templates/web/fixmystreet/static/for_councils_faq.html
+++ b/templates/web/fixmystreet/static/for_councils_faq.html
@@ -131,15 +131,22 @@ href="mailto:hello&#64;mysociety.org">let us know</a>.
<dd>
<ul>
-<li>The front end product costs £3,500 in year one, reducing to £1,500 per annum in future years.
-<li>The mobile web version costs £3,000 in year one and £1,000 per annum subsequently.
-<li>Back-end integration costs depend on the complexity of your systems. Prices start at £3,500 in year one, then £1,500 per annum.
+<li>The front end product costs £3,500 in year one, reducing to £2,000 per annum in future years.
+<li>Web and mobile-optimised site together cost £5,500 in year one and £3,000 per annum subsequently.
+<li>Web, mobile-optimised site, and iPhone and Android apps cost £9,500 in year one, then £4,000 per annum.
</ul>
+<p>We also offer fixed price for integration with Microsoft, Oracle and
+Lagan CRM systems, at £5,500 in year one, then £2,000 per annum
+thereafter. Integration with other CRM or back-office systems costs
+£6,500 in year one,
+
+<p>These prices exclude VAT and assume standard FixMyStreet for councils
+product - if you need further customisations please get in touch with
+us for a quote.
+
<p>The prices are all-inclusive, covering installation, updates, unlimited
-problem reports and user training. There are no hidden fees. Please see <a
-href="http://www.mysociety.org/wp/wp-content/uploads/2012/02/FixMyStreet_for_councils_2012.pdf">our
-brochure</a> for more detail on what’s included.
+problem reports and user training. There are no hidden fees.
<p>There’s no commitment beyond the first 12 months, so you won’t be locked
into a lengthy contract.
diff --git a/urls.txt b/urls.txt
deleted file mode 100644
index 5c9b25f34..000000000
--- a/urls.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-This is a list of some of the urls currently served:
-
-homepage: /
-postcode search: /?pc=SW1A+1AA
-placename: /?pc=Westminster
-street (ambiguous): /?pc=St+Margaret+St
-street (exact): /?pc=St+Margaret+St%2c+Westminster%2c+London+SW1A+2
-
-all reports: /reports
-council reports: /reports/Aberdeen
-individual report: /report/173526
-
diff --git a/web/cobrands/fixmystreet/_base.scss b/web/cobrands/fixmystreet/_base.scss
index 3969bfde4..644b015b5 100644
--- a/web/cobrands/fixmystreet/_base.scss
+++ b/web/cobrands/fixmystreet/_base.scss
@@ -149,10 +149,12 @@ img {
select, input, textarea {
font-size: 99%;
- width: 100%;
max-width: 95%;
}
-
+// To deal with bug from drop-down being wider than holder
+select {
+ width: 100%;
+}
// links
a,
@@ -380,7 +382,7 @@ p.label-valid {
// Padding creates page margins on mobile
.container{
- padding: 0 1em;
+ padding: 0 1em 1em;
}
// Use full width to reverse .container margins
@@ -448,6 +450,9 @@ p.label-valid {
color:#fff;
text-decoration: none;
}
+ span {
+ background-color: #ccc;
+ }
}
&#mysoc-menu{
li {
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index f73290b7b..9d5151189 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -503,6 +503,7 @@ $.fn.drawer = function(id, ajax) {
$('.container').on('click', '#alert_email_button', function(e){
e.preventDefault();
var form = $('<form/>').attr({ method:'post', action:"/alert/subscribe" });
+ form.append($('<input name="alert" value="Subscribe me to an email alert" type="hidden" />'));
$('#alerts input[type=text], #alerts input[type=hidden], #alerts input[type=radio]:checked').each(function() {
var $v = $(this);
$('<input/>').attr({ name:$v.attr('name'), value:$v.val(), type:'hidden' }).appendTo(form);
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index 544e6e850..eb7ded781 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -148,10 +148,10 @@ function fixmystreet_onload() {
var markers = fms_markers_list( fixmystreet.pins, true );
fixmystreet.markers.addFeatures( markers );
if (fixmystreet.page == 'around' || fixmystreet.page == 'reports' || fixmystreet.page == 'my') {
- var select = new OpenLayers.Control.SelectFeature( fixmystreet.markers );
+ fixmystreet.select_feature = new OpenLayers.Control.SelectFeature( fixmystreet.markers );
var selectedFeature;
function onPopupClose(evt) {
- select.unselect(selectedFeature);
+ fixmystreet.select_feature.unselect(selectedFeature);
OpenLayers.Event.stop(evt);
}
fixmystreet.markers.events.register( 'featureunselected', fixmystreet.markers, function(evt) {
@@ -172,8 +172,8 @@ function fixmystreet_onload() {
feature.popup = popup;
fixmystreet.map.addPopup(popup);
});
- fixmystreet.map.addControl( select );
- select.activate();
+ fixmystreet.map.addControl( fixmystreet.select_feature );
+ fixmystreet.select_feature.activate();
} else if (fixmystreet.page == 'new') {
fixmystreet_activate_drag();
}
@@ -194,9 +194,11 @@ function fixmystreet_onload() {
for (var i=0; i<showhide.length; i+=2) {
if (this.innerHTML == showhide[i]) {
fixmystreet.markers.setVisibility(true);
+ fixmystreet.select_feature.activate();
this.innerHTML = showhide[i+1];
} else if (this.innerHTML == showhide[i+1]) {
fixmystreet.markers.setVisibility(false);
+ fixmystreet.select_feature.deactivate();
this.innerHTML = showhide[i];
}
}