Closed
Bug 236779
Opened 21 years ago
Closed 21 years ago
Add UI for changing "linkinfooter" flag for saved searches
Categories
(Bugzilla :: User Accounts, defect, P2)
Tracking
()
RESOLVED
FIXED
Bugzilla 2.18
People
(Reporter: gerv, Assigned: bugreport)
Details
(Keywords: regression)
Attachments
(1 file, 1 obsolete file)
|
4.73 KB,
patch
|
gerv
:
review+
preed
:
review+
|
Details | Diff | Splinter Review |
We need to add linkinfooter UI to the new Saved Searches prefs panel.
Gerv
| Reporter | ||
Comment 1•21 years ago
|
||
And perhaps allow people to edit the names - bug 156662.
Gerv
Updated•21 years ago
|
Comment 2•21 years ago
|
||
Gerv, did you have a plan for this, or want someone else to take it?
| Reporter | ||
Comment 3•21 years ago
|
||
Anyone who has time could do it, I guess. It's not hard - just add an extra
column of checkboxes to the UI, get the data to populate them in
DoSavedSearches(), and write SaveSavedSearches() to write the results to the
database. I'd forget name editing at this stage - there are issues there, and
it's not a blocker.
One catch: you may also have to mess with Bugzilla->user or somesuch to make
sure the footer on the results page shows the right thing.
Gerv
| Assignee | ||
Comment 4•21 years ago
|
||
| Assignee | ||
Updated•21 years ago
|
Priority: -- → P2
| Assignee | ||
Updated•21 years ago
|
Attachment #147859 -
Flags: review?
| Reporter | ||
Comment 5•21 years ago
|
||
Comment on attachment 147859 [details] [diff] [review]
The patch
>-# No SaveSavedSearches() because this panel has no changeable fields (yet).
>+sub SaveSavedSearches() {
>+ my $cgi = Bugzilla->cgi;
>+ my $dbh = Bugzilla->dbh;
>+ my @queries = @{Bugzilla->user->queries};
>+ my $sth = $dbh->prepare("UPDATE namedqueries SET linkinfooter = ?
>+ WHERE userid = ?
>+ AND name = ?");
AIUI, you shouldn't use a placeholder for userid because it doesn't change.
>+ foreach my $q (@queries) {
>+ if ($q->{linkinfooter}
>+ && !defined($cgi->param("linkinfooter_" . $q->{name}))) {
This logic is hard to read immediately - why not simplify, and just UPDATE
whatever the current state is?
Nit: I believe most Bugzilla code quotes hash references in single quotes.
>+ $sth->execute(0, $userid, $q->{name});
>+ } elsif (!$q->{linkinfooter}
>+ && defined($cgi->param("linkinfooter_" . $q->{name}))) {
>+ $sth->execute(1, $userid, $q->{name});
>+ }
>+ }
>+ Bugzilla->user->flush_queries_cache;
Nit: we tend to put blank lines after closing quotes, unless they are followed
by another closing quote.
>Index: template/en/default/account/prefs/saved-searches.html.tmpl
>===================================================================
> <blockquote>
>+ Show query in page footer
> <table cellpadding="3">
>+ <tr>
>+ <th>
>+ |
>+ </th>
>+ </tr>
Ooh, ick. Now that it needs it, can we convert this table to have proper
headings?
> [% FOREACH q = queries %]
> <tr>
>+ <td>
>+ <input type="checkbox"
>+ name="linkinfooter_[% q.name FILTER html %]"
Are you certain this (and the corresponding Perl) works whatever nasty
characters you put in the query name?
Gerv
Attachment #147859 -
Flags: review? → review-
| Assignee | ||
Comment 6•21 years ago
|
||
It does work with eascaped characters like "%" in the name.
I'll de-nit this and submit a revised patch.
| Reporter | ||
Comment 7•21 years ago
|
||
Great :-) Thanks for doing this, by the way. Feel free to take the bug.
Gerv
Comment 8•21 years ago
|
||
(In reply to comment #5)
> (From update of attachment 147859 [details] [diff] [review])
> >+ my $sth = $dbh->prepare("UPDATE namedqueries SET linkinfooter = ?
> >+ WHERE userid = ?
> >+ AND name = ?");
>
> AIUI, you shouldn't use a placeholder for userid because it doesn't change.
But it does change between invocations, when different users connect, and using
a placeholder for it allows MySQL 4's server-side query caching to work. (not
that it's a terribly intensive query anyway)
| Assignee | ||
Comment 9•21 years ago
|
||
Changed format to use a table and cleaned up SaveSavedSearches code.
| Assignee | ||
Updated•21 years ago
|
Attachment #147949 -
Flags: review?(gerv)
Comment 10•21 years ago
|
||
Comment on attachment 147949 [details] [diff] [review]
Patch v2
>+ defined($cgi->param("linkinfooter_$q->{name}")) ? 1 : 0;
>+ $sth->execute($linkinfooter, $userid, $q->{name});
Aestheticallly, this should be $q->{'name'}.
Other than that, r=preed.
Attachment #147949 -
Flags: review+
| Assignee | ||
Updated•21 years ago
|
Flags: approval?
| Reporter | ||
Comment 11•21 years ago
|
||
Comment on attachment 147949 [details] [diff] [review]
Patch v2
r=gerv too. Sorry for the delay.
Gerv
Attachment #147949 -
Flags: review?(gerv)
Updated•21 years ago
|
Flags: approval? → approval+
| Assignee | ||
Comment 12•21 years ago
|
||
Checking in userprefs.cgi;
/cvsroot/mozilla/webtools/bugzilla/userprefs.cgi,v <-- userprefs.cgi
new revision: 1.58; previous revision: 1.57
done
Checking in template/en/default/account/prefs/prefs.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/account/prefs/prefs.html.tmpl,v
<-- prefs.html.tmpl
new revision: 1.15; previous revision: 1.14
done
Checking in template/en/default/account/prefs/saved-searches.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/account/prefs/saved-searches.html.tmpl,v
<-- saved-searches.html.tmpl
new revision: 1.2; previous revision: 1.1
done
Checking in template/en/default/global/useful-links.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/global/useful-links.html.tmpl,v
<-- useful-links.html.tmpl
new revision: 1.25; previous revision: 1.24
done
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Updated•13 years ago
|
QA Contact: matty_is_a_geek → default-qa
You need to log in
before you can comment on or make changes to this bug.
Description
•