Index: buglist.cgi
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/buglist.cgi,v
retrieving revision 1.205
diff -u -r1.205 buglist.cgi
--- buglist.cgi 31 Oct 2002 05:30:49 -0000 1.205
+++ buglist.cgi 2 Nov 2002 05:19:36 -0000
@@ -169,13 +169,20 @@
}
sub LookupNamedQuery {
- my ($name) = @_;
+ my ($name, $owner) = @_;
confirm_login();
- my $userid = DBNameToIdAndCheck($::COOKIE{"Bugzilla_login"});
+ my $userid;
+ my $extracondition = "";
+ if ((!$owner) || ($owner eq $::COOKIE{"Bugzilla_login"})) {
+ $userid = DBNameToIdAndCheck($::COOKIE{"Bugzilla_login"});
+ } else {
+ $userid = DBNameToIdAndCheck($owner);
+ $extracondition = "AND ispublic != 0";
+ }
my $qname = SqlQuote($name);
- SendSQL("SELECT query FROM namedqueries WHERE userid = $userid AND name = $qname");
+ SendSQL("SELECT query FROM namedqueries WHERE userid = $userid AND name = $qname $extracondition");
my $result = FetchOneColumn();
- $result || ThrowUserError("missing_query", {'queryname' => '$name'});
+ $result || ThrowUserError("missing_query", {'queryname' => "$name"});
return $result;
}
@@ -236,7 +243,7 @@
# Take appropriate action based on user's request.
if ($::FORM{'cmdtype'} eq "dorem") {
if ($::FORM{'remaction'} eq "run") {
- $::buffer = LookupNamedQuery($::FORM{"namedcmd"});
+ $::buffer = LookupNamedQuery($::FORM{"namedcmd"}, $::FORM{"queryowner"});
$vars->{'title'} = "Bug List: $::FORM{'namedcmd'}";
$params = new Bugzilla::CGI($::buffer);
$order = $params->param('order') || $order;
@@ -302,11 +309,13 @@
my $qbuffer = SqlQuote($::buffer);
my $tofooter = $::FORM{'tofooter'} ? 1 : 0;
+ my $makepublic = $::FORM{'makepublic'} ? 1 : 0;
SendSQL("SELECT query FROM namedqueries WHERE userid = $userid AND name = $qname");
if (FetchOneColumn()) {
SendSQL("UPDATE namedqueries
- SET query = $qbuffer , linkinfooter = $tofooter
+ SET query = $qbuffer, linkinfooter = $tofooter,
+ ispublic = $makepublic
WHERE userid = $userid AND name = $qname");
}
else {
Index: checksetup.pl
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v
retrieving revision 1.201
diff -u -r1.201 checksetup.pl
--- checksetup.pl 30 Oct 2002 08:29:45 -0000 1.201
+++ checksetup.pl 2 Nov 2002 05:19:39 -0000
@@ -1593,6 +1593,7 @@
'userid mediumint not null,
name varchar(64) not null,
linkinfooter tinyint not null,
+ ispublic tinyint not null,
query mediumtext not null,
unique(userid, name)';
@@ -3451,6 +3452,9 @@
print "done.\n";
}
+
+# bug 69000 November 2002, bugreport@peshkin.net
+AddField('namedqueries', 'ispublic', 'tinyint not null');
# If you had to change the --TABLE-- definition in any way, then add your
# differential change code *** A B O V E *** this comment.
Index: template/en/default/global/useful-links.html.tmpl
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/template/en/default/global/useful-links.html.tmpl,v
retrieving revision 1.12
diff -u -r1.12 useful-links.html.tmpl
--- template/en/default/global/useful-links.html.tmpl 8 Oct 2002 06:41:28 -0000 1.12
+++ template/en/default/global/useful-links.html.tmpl 2 Nov 2002 05:19:39 -0000
@@ -107,7 +107,7 @@
[% FOREACH q = user.queries %]
[% IF q.linkinfooter %]
[% " | " IF print_pipe %]
- [% q.name FILTER html %]
+ [% q.name FILTER html %]
[% print_pipe = 1 %]
[% END %]
[% END %]
Index: template/en/default/search/knob.html.tmpl
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/template/en/default/search/knob.html.tmpl,v
retrieving revision 1.8
diff -u -r1.8 knob.html.tmpl
--- template/en/default/search/knob.html.tmpl 8 Aug 2002 11:03:39 -0000 1.8
+++ template/en/default/search/knob.html.tmpl 2 Nov 2002 05:19:40 -0000
@@ -45,6 +45,7 @@
document.queryform.remtype[1].disabled = true;
document.queryform.newqueryname.disabled = true;
document.queryform.tofooter.disabled = true;
+ document.queryform.makepublic.disabled = true;
}
}
@@ -52,10 +53,12 @@
if (document.queryform.remtype[0].checked == true) {
document.queryform.newqueryname.disabled = false;
document.queryform.tofooter.disabled = false;
+ document.queryform.makepublic.disabled = false;
}
else {
document.queryform.newqueryname.disabled = true;
document.queryform.tofooter.disabled = true;
+ document.queryform.makepublic.disabled = true;
}
}
@@ -91,6 +94,9 @@
+
+
+