Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
e98093ef
Commit
e98093ef
authored
Jul 27, 2003
by
caillon%returnzero.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 153583 - Links to obsoleted attachment should use line-through style
r=kiko@async.com.br a=justdave@netscape.com
parent
7fac0596
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
7 deletions
+61
-7
edit_bug.css
css/edit_bug.css
+2
-0
globals.pl
globals.pl
+58
-2
list.html.tmpl
template/en/default/attachment/list.html.tmpl
+1
-5
No files found.
css/edit_bug.css
View file @
e98093ef
...
...
@@ -2,4 +2,6 @@
.bz_private
{
color
:
darkred
;
background
:
#f3eeee
;
}
.bz_disabled
{
color
:
#a0a0a0
;
}
.bz_obsolete
{
text-decoration
:
line-through
underline
;
}
table
#flags
th
,
table
#flags
td
{
vertical-align
:
baseline
;
text-align
:
left
;
}
globals.pl
View file @
e98093ef
...
...
@@ -905,10 +905,12 @@ sub quoteUrls {
# attachment links - handle both cases separatly for simplicity
$text =~ s~((?:^Created\ an\ |\b)attachment\s*\(id=(\d+)\))
~<a href=\"attachment.cgi?id=$2&action=view\">$1</a>~igx;
~GetAttachmentLink($2, $1)
~egmx;
$text =~ s~\b(attachment\s*\#?\s*(\d+))
~<a href=\"attachment.cgi?id=$2&action=view\">$1</a>~igx;
~GetAttachmentLink($2, $1)
~egmx;
# This handles bug a, comment b type stuff. Because we're using /g
# we have to do this in one pattern, and so this is semi-messy.
...
...
@@ -937,6 +939,60 @@ sub quoteUrls {
return
$text
;
}
# GetAttachmentLink creates a link to an attachment,
# including its title.
sub
GetAttachmentLink
{
my
(
$attachid
,
$link_text
)
=
@_
;
detaint_natural
(
$attachid
)
||
die
"GetAttachmentLink() called with non-integer attachment number"
;
# If we've run GetAttachmentLink() for this attachment before,
# %::attachlink will contain an anonymous array ref of relevant
# values. If not, we need to get the information from the database.
if
(
!
defined
$::attachlink
{
$attachid
})
{
# Make sure any unfetched data from a currently running query
# is saved off rather than overwritten
PushGlobalSQLState
();
SendSQL
(
"SELECT bug_id, isobsolete, description
FROM attachments WHERE attach_id = $attachid"
);
if
(
MoreSQLData
())
{
my
(
$bugid
,
$isobsolete
,
$desc
)
=
FetchSQLData
();
my
$title
=
""
;
my
$className
=
""
;
if
(
CanSeeBug
(
$bugid
,
$::userid
))
{
$title
=
$desc
;
}
if
(
$isobsolete
)
{
$className
=
"bz_obsolete"
;
}
$::attachlink
{
$attachid
}
=
[
value_quote
(
$title
),
$className
];
}
else
{
# Even if there's nothing in the database, we want to save a blank
# anonymous array in the %::attachlink hash so the query doesn't get
# run again next time we're called for this attachment number.
$::attachlink
{
$attachid
}
=
[]
;
}
# All done with this sidetrip
PopGlobalSQLState
();
}
# Now that we know we've got all the information we're gonna get, let's
# return the link (which is the whole reason we were called :)
my
(
$title
,
$className
)
=
@
{
$::attachlink
{
$attachid
}};
# $title will be undefined if the bug didn't exist in the database.
if
(
defined
$title
)
{
my
$linkval
=
"attachment.cgi?id=$attachid&action=view"
;
return
qq{<a href="$linkval" class="$className" title="$title">$link_text</a>}
;
}
else
{
return
qq{$link_text}
;
}
}
# GetBugLink creates a link to a bug, including its title.
# It takes either two or three parameters:
# - The bug number
...
...
template/en/default/attachment/list.html.tmpl
View file @
e98093ef
...
...
@@ -35,11 +35,7 @@
[% IF !attachment.isprivate || canseeprivate %]
<tr [% "class=\"bz_private\"" IF attachment.isprivate %]>
<td valign="top">
[% IF attachment.isobsolete %]
<strike><a href="attachment.cgi?id=[% attachment.attachid %]&action=view">[% attachment.description FILTER html %]</a></strike>
[% ELSE %]
<a href="attachment.cgi?id=[% attachment.attachid %]&action=view">[% attachment.description FILTER html %]</a>
[% END %]
<a href="attachment.cgi?id=[% attachment.attachid %]&action=view" [% "class=\"bz_obsolete\"" IF attachment.isobsolete %]>[% attachment.description FILTER html %]</a>
</td>
<td valign="top">
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment