summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormyk%mozilla.org <>2005-09-10 07:22:41 +0200
committermyk%mozilla.org <>2005-09-10 07:22:41 +0200
commit89fc3ba62b1a5e3db02d21c06f83c8cbc4dbf75b (patch)
tree5a7fadd934c624d3ad80d6b05d43e38915860e02
parentfe43c2dcdfc844fce2c699887cf1ddae53c24b4b (diff)
downloadbugzilla-89fc3ba62b1a5e3db02d21c06f83c8cbc4dbf75b.tar.gz
bugzilla-89fc3ba62b1a5e3db02d21c06f83c8cbc4dbf75b.tar.xz
Fix for bug 300949: reverts fix for bug 274906 which eliminated [edit] link next to attachments to avoid duplicate [edit] references and made the main attachment link go to the 'edit attachment' page; that fix unreasonably reduced Bugzilla usability by making it difficult to view attachments; this patch includes a different fix for bug 274906 that prevents those duplicate [edit] references; long-term we want to make the 'edit attachment' page the irresistable default and have a pop-up menu of links, at which point [edit] can truly go away, but for now it stays
-rw-r--r--globals.pl11
1 files changed, 8 insertions, 3 deletions
diff --git a/globals.pl b/globals.pl
index 7605ffe0f..ac502f39a 100644
--- a/globals.pl
+++ b/globals.pl
@@ -669,7 +669,7 @@ sub quoteUrls {
~<a href=\"mailto:$2\">$1$2</a>~igx;
# attachment links - handle both cases separately for simplicity
- $text =~ s~((?:^Created\ an\ |\b)attachment\s*\(id=(\d+)\))
+ $text =~ s~((?:^Created\ an\ |\b)attachment\s*\(id=(\d+)\)(\s\[edit\])?)
~($things[$count++] = GetAttachmentLink($2, $1)) &&
("\0\0" . ($count-1) . "\0\0")
~egmx;
@@ -752,8 +752,13 @@ sub GetAttachmentLink {
my ($title, $className) = @{$::attachlink{$attachid}};
# $title will be undefined if the attachment didn't exist in the database.
if (defined $title) {
- my $linkval = "attachment.cgi?id=$attachid&amp;action=edit";
- return qq{<a href="$linkval" class="$className" title="$title">$link_text</a>};
+ $link_text =~ s/ \[edit\]$//;
+ my $linkval = "attachment.cgi?id=$attachid&amp;action=";
+ # Whitespace matters here because these links are in <pre> tags.
+ return qq|<span class="$className">|
+ . qq|<a href="${linkval}view" title="$title">$link_text</a>|
+ . qq| <a href="${linkval}edit" title="$title">[edit]</a>|
+ . qq|</span>|;
}
else {
return qq{$link_text};