diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-05-04 19:17:45 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-05-04 19:17:45 +0100 |
commit | 76d52727e987c20babcd528973ef2355d77d0755 (patch) | |
tree | 657e262971110bb19d6b63686900237971d47d58 | |
parent | 6a7d6d660e75fb22b10b66076ea13251749edb2b (diff) | |
parent | d7a8d772c083f5b4d8abf6d40e29f3f422bd0314 (diff) |
Merge commit 'petter/fix-perl-warnings-from-admin-cgi' into develop
-rwxr-xr-x | web-admin/index.cgi | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/web-admin/index.cgi b/web-admin/index.cgi index 2f3ec85e7..aaf4e3651 100755 --- a/web-admin/index.cgi +++ b/web-admin/index.cgi @@ -148,13 +148,13 @@ sub admin_summary ($) { $questionnaires{0} ||= 0; $questionnaires{1} ||= 0; $questionnaires{total} = $questionnaires{0} + $questionnaires{1}; - my $questionnaires_pc = $questionnaires{total} ? $questionnaires{1} / $questionnaires{total} * 100 : 'na'; + my $questionnaires_pc = $questionnaires{total} ? sprintf('%.1f', $questionnaires{1} / $questionnaires{total} * 100) : 'na'; print $q->ul( $q->li(sprintf(_("<strong>%d</strong> live problems"), $total_problems_live)), $q->li(sprintf(_("%d live updates"), $comments{confirmed})), $q->li(sprintf(_("%d confirmed alerts, %d unconfirmed"), $alerts{1}, $alerts{0})), - $q->li(sprintf(_("%d questionnaires sent – %d answered (%d%%)"), $questionnaires{total}, $questionnaires{1}, $questionnaires_pc)), + $q->li(sprintf(_("%d questionnaires sent – %d answered (%s%%)"), $questionnaires{total}, $questionnaires{1}, $questionnaires_pc)), $q->li(sprintf(_("%d council contacts – %d confirmed, %d unconfirmed"), $contacts{total}, $contacts{1}, $contacts{0})), ); @@ -828,10 +828,11 @@ sub admin_timeline { print '<dt><b>', decode_utf8(strftime('%H:%M:%S', localtime($_))), ':</b></dt> <dd>'; foreach (@{$time{$_}}) { my $type = $_->{type}; - my $name_str = '; ' . sprintf(_("by %s"), ent($_->{name})) . " <" . ent($_->{email}) . ">, '" . ent($_->{title}) . "'"; if ($type eq 'problemCreated') { + my $name_str = '; ' . sprintf(_("by %s"), ent($_->{name})) . " <" . ent($_->{email}) . ">, '" . ent($_->{title}) . "'"; print sprintf(_("Problem %d created"), $_->{id}) . $name_str; } elsif ($type eq 'problemConfirmed') { + my $name_str = '; ' . sprintf(_("by %s"), ent($_->{name})) . " <" . ent($_->{email}) . ">, '" . ent($_->{title}) . "'"; $cobrand_data = get_cobrand_data_from_hash($cobrand, $_); my $url = Cobrand::base_url_for_emails($cobrand, $cobrand_data) . "/report/$_->{id}"; print sprintf(_("Problem %s confirmed"), "<a href='$url'>$_->{id}</a>") . $name_str; |