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
ee84183c
Commit
ee84183c
authored
Dec 15, 2002
by
gerv%gerv.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 116819 - Attach and Reassign in one fell swoop. Patch by gerv; r,a=justdave.
parent
53394f51
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
9 deletions
+70
-9
attachment.cgi
attachment.cgi
+59
-9
create.html.tmpl
template/en/default/attachment/create.html.tmpl
+11
-0
No files found.
attachment.cgi
View file @
ee84183c
...
...
@@ -416,14 +416,16 @@ sub viewall
push
@attachments
,
\%
a
;
}
# Retrieve the bug summary for displaying on screen.
SendSQL
(
"SELECT short_desc FROM bugs WHERE bug_id = $::FORM{'bugid'}"
);
my
(
$bugsummary
)
=
FetchSQLData
();
# Retrieve the bug summary (for displaying on screen) and assignee.
SendSQL
(
"SELECT short_desc, assigned_to FROM bugs "
.
"WHERE bug_id = $::FORM{'bugid'}"
);
my
(
$bugsummary
,
$assignee_id
)
=
FetchSQLData
();
# Define the variables and functions that will be passed to the UI template.
$vars
->
{
'bugid'
}
=
$::FORM
{
'bugid'
};
$vars
->
{
'bugsummary'
}
=
$bugsummary
;
$vars
->
{
'attachments'
}
=
\
@attachments
;
$vars
->
{
'bugassignee_id'
}
=
$assignee_id
;
$vars
->
{
'bugsummary'
}
=
$bugsummary
;
# Return the appropriate HTTP response headers.
print
"Content-Type: text/html\n\n"
;
...
...
@@ -458,14 +460,16 @@ sub enter
push
@attachments
,
\%
a
;
}
# Retrieve the bug summary for displaying on screen.
SendSQL
(
"SELECT short_desc FROM bugs WHERE bug_id = $::FORM{'bugid'}"
);
my
(
$bugsummary
)
=
FetchSQLData
();
# Retrieve the bug summary (for displaying on screen) and assignee.
SendSQL
(
"SELECT short_desc, assigned_to FROM bugs
WHERE bug_id = $::FORM{'bugid'}"
);
my
(
$bugsummary
,
$assignee_id
)
=
FetchSQLData
();
# Define the variables and functions that will be passed to the UI template.
$vars
->
{
'bugid'
}
=
$::FORM
{
'bugid'
};
$vars
->
{
'bugsummary'
}
=
$bugsummary
;
$vars
->
{
'attachments'
}
=
\
@attachments
;
$vars
->
{
'bugassignee_id'
}
=
$assignee_id
;
$vars
->
{
'bugsummary'
}
=
$bugsummary
;
# Return the appropriate HTTP response headers.
print
"Content-Type: text/html\n\n"
;
...
...
@@ -523,6 +527,51 @@ sub insert
}
}
# Assign the bug to the user, if they are allowed to take it
my
$forcecc
=
""
;
if
(
$::FORM
{
'takebug'
}
&&
UserInGroup
(
"editbugs"
))
{
SendSQL
(
"select NOW()"
);
my
$timestamp
=
FetchOneColumn
();
my
@fields
=
(
"assigned_to"
,
"bug_status"
,
"resolution"
,
"login_name"
);
# Get the old values, for the bugs_activity table
SendSQL
(
"SELECT "
.
join
(
", "
,
@fields
)
.
" FROM bugs, profiles "
.
"WHERE bugs.bug_id = $::FORM{'bugid'} "
.
"AND profiles.userid = bugs.assigned_to"
);
my
@oldvalues
=
FetchSQLData
();
my
@newvalues
=
(
$::userid
,
"ASSIGNED"
,
""
,
DBID_to_name
(
$::userid
));
# Make sure the person we are taking the bug from gets mail.
$forcecc
=
$oldvalues
[
3
];
@oldvalues
=
map
(
SqlQuote
(
$_
),
@oldvalues
);
@newvalues
=
map
(
SqlQuote
(
$_
),
@newvalues
);
# Update the bug record. Note that this doesn't involve login_name.
SendSQL
(
"UPDATE bugs SET "
.
join
(
", "
,
map
(
"$fields[$_] = $newvalues[$_]"
,
(
0
..
2
)))
.
" WHERE bug_id = $::FORM{'bugid'}"
);
# We store email addresses in the bugs_activity table rather than IDs.
$oldvalues
[
0
]
=
$oldvalues
[
3
];
$newvalues
[
0
]
=
$newvalues
[
3
];
# Add the changes to the bugs_activity table
for
(
my
$i
=
0
;
$i
<
3
;
$i
++
)
{
if
(
$oldvalues
[
$i
]
ne
$newvalues
[
$i
])
{
my
$fieldid
=
GetFieldID
(
$fields
[
$i
]);
SendSQL
(
"INSERT INTO bugs_activity "
.
"(bug_id, who, bug_when, fieldid, removed, added) "
.
" VALUES ($::FORM{'bugid'}, $::userid, "
.
SqlQuote
(
$timestamp
)
.
", $fieldid, $oldvalues[$i], $newvalues[$i])"
);
}
}
}
# Send mail to let people know the attachment has been created. Uses a
# special syntax of the "open" and "exec" commands to capture the output of
# "processmail", which "system" doesn't allow, without running the command
...
...
@@ -530,7 +579,8 @@ sub insert
#system ("./processmail", $bugid , $::userid);
#my $mailresults = `./processmail $bugid $::userid`;
my
$mailresults
=
''
;
open
(
PMAIL
,
"-|"
)
or
exec
(
'./processmail'
,
$::FORM
{
'bugid'
},
$::COOKIE
{
'Bugzilla_login'
});
open
(
PMAIL
,
"-|"
)
or
exec
(
'./processmail'
,
'-forcecc'
,
$forcecc
,
$::FORM
{
'bugid'
},
$::COOKIE
{
'Bugzilla_login'
});
$mailresults
.=
$_
while
<
PMAIL
>
;
close
(
PMAIL
);
...
...
template/en/default/attachment/create.html.tmpl
View file @
ee84183c
...
...
@@ -122,6 +122,17 @@
[% END %]
</td>
</tr>
[% IF (user.userid != bugassignee_id) AND UserInGroup("editbugs") %]
<tr>
<th>Reassignment:</th>
<td>
<em>If you want to assign this bug to yourself,
check the box below.</em><br>
<input type="checkbox" id="takebug" name="takebug" value="1">
<label for="takebug">take bug</label>
</td>
</tr>
[% END %]
<tr>
<th>Comment:</th>
<td>
...
...
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