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
a74271e7
Commit
a74271e7
authored
Jul 13, 2004
by
bugreport%peshkin.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 226434: Add %reporter%, %user%, and %assignee% pronouns to boolean charts
r=jouni a=justdave
parent
8c1a3e8f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
9 deletions
+79
-9
Search.pm
Bugzilla/Search.pm
+75
-9
user-error.html.tmpl
template/en/default/global/user-error.html.tmpl
+4
-0
No files found.
Bugzilla/Search.pm
View file @
a74271e7
...
...
@@ -322,6 +322,12 @@ sub init {
my
%
funcsbykey
;
my
@funcdefs
=
(
"^(?:assigned_to|reporter|qa_contact),(?:equals|anyexact),(%\\w+%)"
=>
sub
{
$term
=
"bugs.$f = "
.
pronoun
(
$1
,
$user
);
},
"^(?:assigned_to|reporter|qa_contact),(?:notequals),(%\\w+%)"
=>
sub
{
$term
=
"bugs.$f <> "
.
pronoun
(
$1
,
$user
);
},
"^(assigned_to|reporter),"
=>
sub
{
push
(
@supptables
,
"profiles AS map_$f"
);
push
(
@wherepart
,
"bugs.$f = map_$f.userid"
);
...
...
@@ -333,11 +339,34 @@ sub init {
$f
=
"map_$f.login_name"
;
},
"^cc,(?:equals|anyexact),(%\\w+%)"
=>
sub
{
my
$match
=
pronoun
(
$1
,
$user
);
my
$chartseq
=
$chartid
;
if
(
$chartid
eq
""
)
{
$chartseq
=
"CC$sequence"
;
$sequence
++
;
}
push
(
@supptables
,
"LEFT JOIN cc cc_$chartseq
ON bugs.bug_id = cc_$chartseq.bug_id
AND cc_$chartseq.who = $match"
);
$term
=
"cc_$chartseq.who IS NOT NULL"
;
},
"^cc,(?:notequals),(%\\w+%)"
=>
sub
{
my
$match
=
pronoun
(
$1
,
$user
);
my
$chartseq
=
$chartid
;
if
(
$chartid
eq
""
)
{
$chartseq
=
"CC$sequence"
;
$sequence
++
;
}
push
(
@supptables
,
"LEFT JOIN cc cc_$chartseq
ON bugs.bug_id = cc_$chartseq.bug_id
AND cc_$chartseq.who = $match"
);
$term
=
"cc_$chartseq.who IS NULL"
;
},
"^cc,(anyexact|substring)"
=>
sub
{
my
$list
;
$list
=
$self
->
ListIDsForEmail
(
$t
,
$v
);
my
$chartseq
;
$chartseq
=
$chartid
;
my
$chartseq
=
$chartid
;
if
(
$chartid
eq
""
)
{
$chartseq
=
"CC$sequence"
;
$sequence
++
;
...
...
@@ -355,8 +384,7 @@ sub init {
}
},
"^cc,"
=>
sub
{
my
$chartseq
;
$chartseq
=
$chartid
;
my
$chartseq
=
$chartid
;
if
(
$chartid
eq
""
)
{
$chartseq
=
"CC$sequence"
;
$sequence
++
;
...
...
@@ -442,11 +470,27 @@ sub init {
push
(
@fields
,
$select_term
);
}
},
"^commenter,(?:equals|anyexact),(%\\w+%)"
=>
sub
{
my
$match
=
pronoun
(
$1
,
$user
);
my
$chartseq
=
$chartid
;
if
(
$chartid
eq
""
)
{
$chartseq
=
"LD$sequence"
;
$sequence
++
;
}
my
$table
=
"longdescs_$chartseq"
;
my
$extra
=
""
;
if
(
Param
(
"insidergroup"
)
&&
!&::
UserInGroup
(
Param
(
"insidergroup"
)))
{
$extra
=
"AND $table.isprivate < 1"
;
}
push
(
@supptables
,
"LEFT JOIN longdescs $table
ON $table.bug_id = bugs.bug_id $extra
AND $table.who IN ($match)"
);
$term
=
"$table.who IS NOT NULL"
;
},
"^commenter,"
=>
sub
{
my
$chartseq
;
my
$chartseq
=
$chartid
;
my
$list
;
$list
=
$self
->
ListIDsForEmail
(
$t
,
$v
);
$chartseq
=
$chartid
;
if
(
$chartid
eq
""
)
{
$chartseq
=
"LD$sequence"
;
$sequence
++
;
...
...
@@ -1023,13 +1067,15 @@ sub init {
# a valid field name, which means that it's ok.
trick_taint
(
$f
);
$q
=
&::
SqlQuote
(
$v
);
my
$rhs
=
$v
;
$rhs
=~
tr
/,/
/
;
my
$func
;
$term
=
undef
;
foreach
my
$key
(
@funcnames
)
{
if
(
"$f,$t"
=~
m/$key/
)
{
if
(
"$f,$t
,$rhs
"
=~
m/$key/
)
{
my
$ref
=
$funcsbykey
{
$key
};
if
(
$debug
)
{
print
"<p>$key ($f , $t ) => "
;
print
"<p>$key ($f , $t
, $rhs
) => "
;
}
$ff
=
$f
;
if
(
$f
!~
/\./
)
{
...
...
@@ -1037,7 +1083,7 @@ sub init {
}
&
$ref
;
if
(
$debug
)
{
print
"$f , $t , $term</p>"
;
print
"$f , $t , $
v , $
term</p>"
;
}
if
(
$term
)
{
last
;
...
...
@@ -1254,4 +1300,24 @@ sub getSQL {
return
$self
->
{
'sql'
};
}
sub
pronoun
{
my
(
$noun
,
$user
)
=
(
@_
);
if
(
$noun
eq
"%user%"
)
{
if
(
$user
)
{
return
$user
->
id
;
}
else
{
ThrowUserError
(
'login_required_for_pronoun'
);
}
}
if
(
$noun
eq
"%reporter%"
)
{
return
"bugs.reporter"
;
}
if
(
$noun
eq
"%assignee%"
)
{
return
"bugs.assigned_to"
;
}
if
(
$noun
eq
"%qacontact%"
)
{
return
"bugs.qa_contact"
;
}
return
0
;
}
1
;
template/en/default/global/user-error.html.tmpl
View file @
a74271e7
...
...
@@ -414,6 +414,10 @@
[% title = "Login Name Required" %]
You must enter a login name when requesting to change your password.
[% ELSIF error == "login_required_for_pronoun" %]
[% title = "Login Name Required" %]
You must enter a login name when using your login as a pronoun.
[% ELSIF error == "milestone_required" %]
[% title = "Milestone Required" %]
You must determine a target milestone for [% terms.bug %]
...
...
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