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
42945619
Commit
42945619
authored
Jan 30, 2002
by
myk%mozilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug 104521: Removes old attachment interface in favor of new attachment tracker.
Patch by Myk Melez <myk@mozilla.org>. r=bbaetz,kiko
parent
9704bcdf
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
72 deletions
+31
-72
CGI.pl
CGI.pl
+2
-2
bug_form.pl
bug_form.pl
+6
-21
checksetup.pl
checksetup.pl
+1
-3
defparams.pl
defparams.pl
+10
-5
globals.pl
globals.pl
+2
-2
processmail
processmail
+3
-3
showattachment.cgi
showattachment.cgi
+7
-36
No files found.
CGI.pl
View file @
42945619
...
...
@@ -1270,7 +1270,7 @@ sub DumpBugActivity {
while
(
@row
=
FetchSQLData
())
{
my
(
$field
,
$attachid
,
$when
,
$removed
,
$added
,
$who
)
=
(
@row
);
$field
=~
s/^Attachment/<a href="attachment.cgi?id=$attachid&action=view">Attachment #$attachid<\/a>/
if
(
Param
(
'useattachmenttracker'
)
&&
$attachid
)
;
if
$attachid
;
$removed
=
html_quote
(
$removed
);
$added
=
html_quote
(
$added
);
$removed
=
" "
if
$removed
eq
""
;
...
...
@@ -1349,7 +1349,7 @@ Edit <a href="userprefs.cgi">prefs</a>
if
(
UserInGroup
(
"editcomponents"
))
{
$html
.=
", <a href=\"editproducts.cgi\">products</a>\n"
;
$html
.=
", <a href=\"editattachstatuses.cgi\">
attachment statuses</a>\n"
if
Param
(
'useattachmenttracker'
)
;
attachment statuses</a>\n"
;
}
if
(
UserInGroup
(
"creategroups"
))
{
$html
.=
", <a href=\"editgroups.cgi\">groups</a>\n"
;
...
...
bug_form.pl
View file @
42945619
...
...
@@ -25,6 +25,9 @@ use strict;
use
RelationSet
;
# Use the Attachment module to display attachments for the bug.
use
Attachment
;
# Shut up misguided -w warnings about "used only once". For some reason,
# "use vars" chokes on me when I try it here.
...
...
@@ -324,28 +327,10 @@ if (@::legal_keywords) {
}
;
}
# 2001-05-16 myk@mozilla.org: use the attachment tracker to display attachments
# if this installation has enabled use of the attachment tracker.
if
(
Param
(
'useattachmenttracker'
))
{
print
"</table>\n"
;
use
Attachment
;
&
Attachment::
list
(
$id
);
}
else
{
print
"<tr><td align=right><B>Attachments:</b></td>\n"
;
SendSQL
(
"select attach_id, creation_ts, mimetype, description from attachments where bug_id = $id"
);
while
(
MoreSQLData
())
{
my
(
$attachid
,
$date
,
$mimetype
,
$desc
)
=
(
FetchSQLData
());
if
(
$date
=~
/^(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/
)
{
$date
=
"$3/$4/$2 $5:$6"
;
}
my
$link
=
"showattachment.cgi?attach_id=$attachid"
;
$desc
=
value_quote
(
$desc
);
$mimetype
=
html_quote
(
$mimetype
);
print
qq{<td><a href="$link">$date</a></td><td colspan=6>$desc ($mimetype)</td></tr><tr><td></td>}
;
}
print
"<td colspan=7><a href=\"createattachment.cgi?id=$id\">Create a new attachment</a> (proposed patch, testcase, etc.)</td></tr></table>\n"
;
}
print
"</TABLE>\n"
;
# Display attachments for this bug (if any).
&
Attachment::
list
(
$id
);
sub
EmitDependList
{
my
(
$desc
,
$myfield
,
$targetfield
)
=
(
@_
);
...
...
checksetup.pl
View file @
42945619
...
...
@@ -934,11 +934,9 @@ $table{attachments} =
index(bug_id),
index(creation_ts)'
;
# 2001-05-05 myk@mozilla.org: Tables to support
the attachment tracker
.
# 2001-05-05 myk@mozilla.org: Tables to support
attachment statuses
.
# "attachstatuses" stores one record for each status on each attachment.
# "attachstatusdefs" defines the statuses that can be set on attachments.
# Note: These tables are only used if the parameter "useattachmenttracker"
# is turned on via editparameters.cgi.
$table
{
attachstatuses
}
=
'
...
...
defparams.pl
View file @
42945619
...
...
@@ -54,6 +54,16 @@ sub WriteParams {
}
}
}
# If Bugzilla has been upgraded since the last time parameters were edited,
# and some parameters have been removed in the new version of Bugzilla,
# remove them from the parameters file.
foreach
my
$item
(
keys
%::
param
)
{
if
(
!
grep
(
$_
eq
$item
,
@::param_list
)
&&
$item
ne
"version"
)
{
print
"The <em>$item</em> parameter is no longer used in Bugzilla
and has been removed from your parameters file.<br>"
;
delete
$::param
{
$item
};
}
}
mkdir
(
"data"
,
0777
);
chmod
0777
,
"data"
;
my
$tmpname
=
"data/params.$$"
;
...
...
@@ -674,11 +684,6 @@ DefParam("moved-default-component",
"t"
,
''
);
DefParam
(
"useattachmenttracker"
,
"Whether or not to use the attachment tracker that adds additional features for tracking bug attachments."
,
"b"
,
0
);
# The maximum size (in bytes) for patches and non-patch attachments.
# The default limit is 1000KB, which is 24KB less than mysql's default
# maximum packet size (which determines how much data can be sent in a
...
...
globals.pl
View file @
42945619
...
...
@@ -1039,7 +1039,7 @@ sub quoteUrls {
my
$num
=
$2
;
$item
=
value_quote
(
$item
);
# Not really necessary, since we know
# there's no special chars in it.
$item
=
qq{<A HREF="
showattachment.cgi?attach_id=$num
">$item</A>}
;
$item
=
qq{<A HREF="
attachment.cgi?id=$num&action=view
">$item</A>}
;
$things
[
$count
++
]
=
$item
;
}
while
(
$text
=~
s/\*\*\* This bug has been marked as a duplicate of (\d+) \*\*\*/"##$count##"/ei
)
{
...
...
@@ -1054,7 +1054,7 @@ sub quoteUrls {
my
$item
=
$&
;
my
$num
=
$1
;
if
(
$knownattachments
->
{
$num
})
{
$item
=
qq{<A HREF="
showattachment.cgi?attach_id=$num
">$item</A>}
;
$item
=
qq{<A HREF="
attachment.cgi?id=$num&action=view
">$item</A>}
;
}
$things
[
$count
++
]
=
$item
;
}
...
...
processmail
View file @
42945619
...
...
@@ -160,7 +160,7 @@ sub ProcessOneBug {
$difftext
.=
FormatTriple
(
"What "
,
"Removed"
,
"Added"
);
$difftext
.=
(
'-'
x
76
)
.
"\n"
;
}
$what
=~
s/^Attachment/Attachment #$attachid/
if
(
Param
(
'useattachmenttracker'
)
&&
$attachid
)
;
$what
=~
s/^Attachment/Attachment #$attachid/
if
$attachid
;
$difftext
.=
FormatTriple
(
$what
,
$old
,
$new
);
}
...
...
@@ -737,9 +737,9 @@ sub NewProcessOnePerson ($$$$$$$$$$$$) {
if
(
$newcomments
=~
/Created an attachment \(/
)
{
my
$showattachurlbase
=
Param
(
'urlbase'
)
.
"
showattachment.cgi?attach_
id="
;
Param
(
'urlbase'
)
.
"
attachment.cgi?
id="
;
$newcomments
=~
s/(Created an attachment \(id=([0-9]+)\))/$1\n --> \(${showattachurlbase}$2\)/g
;
$newcomments
=~
s/(Created an attachment \(id=([0-9]+)\))/$1\n --> \(${showattachurlbase}$2
&action=view
\)/g
;
}
$person
.=
Param
(
'emailsuffix'
);
...
...
showattachment.cgi
View file @
42945619
...
...
@@ -28,39 +28,10 @@ use lib qw(.);
require
"CGI.pl"
;
if
(
!
defined
$::FORM
{
'attach_id'
})
{
print
"Content-type: text/html\n"
;
print
"\n"
;
PutHeader
(
"Search by attachment number"
);
print
"<FORM METHOD=GET ACTION=\"showattachment.cgi\">\n"
;
print
"You may view a single attachment by entering its id here: \n"
;
print
"<INPUT NAME=attach_id>\n"
;
print
"<INPUT TYPE=\"submit\" VALUE=\"Show Me This Attachment\">\n"
;
print
"</FORM>\n"
;
PutFooter
();
exit
;
}
ConnectToDatabase
();
quietly_check_login
();
if
(
!
detaint_natural
(
$::FORM
{
attach_id
}))
{
DisplayError
(
"Attachment ID should be numeric."
);
exit
;
}
SendSQL
(
"select bug_id, mimetype, thedata from attachments where attach_id = $::FORM{'attach_id'}"
);
my
(
$bug_id
,
$mimetype
,
$thedata
)
=
FetchSQLData
();
if
(
!
$bug_id
)
{
DisplayError
(
"Attachment $::FORM{attach_id} does not exist."
);
exit
;
}
# Make sure the user can see the bug to which this file is attached
ValidateBugID
(
$bug_id
);
print
qq{Content-type: $mimetype\n\n$thedata}
;
# Redirect to the new interface for displaying attachments.
detaint_natural
(
$::FORM
{
'attach_id'
})
if
defined
(
$::FORM
{
'attach_id'
});
my
$id
=
$::FORM
{
'attach_id'
}
||
""
;
print
"Status: 301 Permanent Redirect\n"
;
print
"Location: attachment.cgi?id=$id&action=view\n\n"
;
exit
;
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