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

This commit is contained in:
myk%mozilla.org 2005-09-09 22:22:41 +00:00
Родитель e415d47a02
Коммит e4e1d4869d
1 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -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};