aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2014-10-02 19:09:30 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2014-10-02 19:09:30 +0200
commitd33c399b231a1d47a3fb94a770256369dbb32e6a (patch)
tree96db97ec199ed1c34ab2bf14134b51e7a1bafe55
parenta9efeb7460d263ed929947f9ca380a9616584f91 (diff)
downloadbugs-d33c399b231a1d47a3fb94a770256369dbb32e6a.tar
bugs-d33c399b231a1d47a3fb94a770256369dbb32e6a.tar.gz
bugs-d33c399b231a1d47a3fb94a770256369dbb32e6a.tar.bz2
bugs-d33c399b231a1d47a3fb94a770256369dbb32e6a.tar.xz
bugs-d33c399b231a1d47a3fb94a770256369dbb32e6a.zip
Bug 1076155: Remove "?" from table columns and labels + code cleanup
r=dkl a=justdave
-rw-r--r--template/en/default/account/prefs/apikey.html.tmpl2
-rw-r--r--template/en/default/flag/list.html.tmpl15
-rwxr-xr-xuserprefs.cgi20
3 files changed, 14 insertions, 23 deletions
diff --git a/template/en/default/account/prefs/apikey.html.tmpl b/template/en/default/account/prefs/apikey.html.tmpl
index 970258e50..bed3f3809 100644
--- a/template/en/default/account/prefs/apikey.html.tmpl
+++ b/template/en/default/account/prefs/apikey.html.tmpl
@@ -29,7 +29,7 @@ here.</p>
<th>API key</th>
<th>Description (optional)</th>
<th>Last used</th>
- <th>Revoked?</th>
+ <th>Revoked</th>
</tr>
[% FOREACH api_key IN api_keys %]
diff --git a/template/en/default/flag/list.html.tmpl b/template/en/default/flag/list.html.tmpl
index 455238cfc..7547e5687 100644
--- a/template/en/default/flag/list.html.tmpl
+++ b/template/en/default/flag/list.html.tmpl
@@ -173,17 +173,14 @@
[% END %]
<td>
[% IF type.is_multiplicable && edit_multiple_bugs %]
- <input type="checkbox"
- name="flags_add-[% type.id %]"
- id="flags_add-[% type.id %]">
- <label for="flags_add-[% type.id %]">
- <a class="field_help_link"
- title="If ticked, always create a new flag. Leaving it unchecked will update existing flag(s) and add a new flag if it does not exist">
- Always add?
- </a>
+ <input type="checkbox" name="flags_add-[% type.id %]"
+ id="flags_add-[% type.id %]" value="1">
+ <label for="flags_add-[% type.id %]"
+ title="If ticked, always create a new flag. Leaving it unchecked will update existing flag(s) and add a new flag if it does not exist">
+ Always add
</label>
[% END %]
- <td>
+ </td>
</tr>
</tbody>
[% END %]
diff --git a/userprefs.cgi b/userprefs.cgi
index bb57b56b3..ad5fb7d19 100755
--- a/userprefs.cgi
+++ b/userprefs.cgi
@@ -526,8 +526,8 @@ sub SaveApiKey {
# Update any existing keys
my $api_keys = Bugzilla::User::APIKey->match({ user_id => $user->id });
foreach my $api_key (@$api_keys) {
- my $description = $cgi->param('description_'.$api_key->id);
- my $revoked = $cgi->param('revoked_'.$api_key->id);
+ my $description = $cgi->param('description_' . $api_key->id);
+ my $revoked = $cgi->param('revoked_' . $api_key->id);
if ($description ne $api_key->description
|| $revoked != $api_key->revoked)
@@ -540,25 +540,19 @@ sub SaveApiKey {
}
}
- # Was a new api key requested
+ # Create a new API key if requested.
if ($cgi->param('new_key')) {
- my $new_key = Bugzilla::User::APIKey->create({
+ $vars->{new_key} = Bugzilla::User::APIKey->create({
user_id => $user->id,
description => $cgi->param('new_description'),
});
# As a security precaution, we always sent out an e-mail when
# an API key is created
- my $lang = $user->setting('lang')
- // Bugzilla::User->new()->setting('lang');
-
- my $template = Bugzilla->template_inner($lang);
+ my $template = Bugzilla->template_inner($user->setting('lang'));
my $message;
- $template->process(
- 'email/new-api-key.txt.tmpl',
- { user => $user, new_key => $new_key },
- \$message
- ) || ThrowTemplateError($template->error());
+ $template->process('email/new-api-key.txt.tmpl', $vars, \$message)
+ || ThrowTemplateError($template->error());
MessageToMTA($message);
}