]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 236779: Add UI for changing "linkinfooter" flag for saved searches
authorbugreport%peshkin.net <>
Thu, 13 May 2004 23:04:26 +0000 (23:04 +0000)
committerbugreport%peshkin.net <>
Thu, 13 May 2004 23:04:26 +0000 (23:04 +0000)
r=gerv,preed
a=justdave

template/en/default/account/prefs/prefs.html.tmpl
template/en/default/account/prefs/saved-searches.html.tmpl
template/en/default/global/useful-links.html.tmpl
userprefs.cgi

index 03d49ccb3c3506e777e6fc9a5d3903980a71a553..00e7f89131b60a3d43898b23814139d9ca567e95 100644 (file)
@@ -53,7 +53,7 @@
             { name => "email", description => "Email settings", 
               saveable => "1" },
             { name => "saved-searches", description => "Saved searches", 
-              saveable => "0" },
+              saveable => "1" },
             { name => "permissions", description => "Permissions", 
               saveable => "0" } ] %]
 
index d5a0308773a163d4b97edb0683b8642d59533d71..a11c1c380f66eeee247c4331d3e7776718edeec4 100644 (file)
 <p>Your saved searches are as follows:</p>
 
 <blockquote>
-  <table cellpadding="3">  
+  <table border="1" cellpadding="3">  
+    <tr>
+      <th>
+        Show in <br>
+        Footer
+      </th>
+      <th>
+        Search
+      </th>
+      <th>
+        Run
+      </th>
+      <th>
+        Edit
+      </th>
+      <th>
+        Forget
+      </th>
+    </tr>
     [% FOREACH q = queries %]
       <tr>
-        <td>[% q.name FILTER html %]:</td>
         <td>
-          <a href="buglist.cgi?[% q.query FILTER html %]">Run</a> |
-          <a href="query.cgi?[% q.query FILTER html %]">Edit</a> |
+          <input type="checkbox" 
+                 name="linkinfooter_[% q.name FILTER html %]"
+                 value="1"
+                 [% " checked" IF q.linkinfooter %]>
+        </td>
+        <td>[% q.name FILTER html %]</td>
+        <td>
+          <a href="buglist.cgi?[% q.query FILTER html %]">Run</a>
+        </td>
+        <td>
+          <a href="query.cgi?[% q.query FILTER html %]">Edit</a>
+        </td>
+        <td>
           <a href="buglist.cgi?cmdtype=dorem&amp;remaction=forget&amp;namedcmd=
                    [% q.name FILTER html %]">Forget</a>
         </td>
index 806edfcf70e683ed0358a7792e7bbc08d31a3161..d238a42538fb272b622c53c36667cbe8b679a776 100644 (file)
         [% END %]
 
         [% FOREACH q = user.queries %]
-          [% " | " IF print_pipe %]
-          <a href="buglist.cgi?cmdtype=runnamed&amp;namedcmd=[% q.name FILTER url_quote %]"><nobr>[% q.name FILTER html %]</nobr></a>
-          [% print_pipe = 1 %]
+          [% IF q.linkinfooter %]
+            [% " | " IF print_pipe %]
+            <a href="buglist.cgi?cmdtype=runnamed&amp;namedcmd=[% q.name FILTER url_quote %]"><nobr>[% q.name FILTER html %]</nobr></a>
+            [% print_pipe = 1 %]
+          [% END %]
         [% END %]
       </td>
     </tr>
index eefe40205b9ed7ff42c3d8c15df518a1d86688cd..cd73678c9b3749602086144394193343c8762229 100755 (executable)
@@ -301,7 +301,21 @@ sub DoSavedSearches() {
     $vars->{'queries'} = Bugzilla->user->queries;
 }
 
-# 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 = ?");
+    foreach my $q (@queries) {
+        my $linkinfooter = 
+            defined($cgi->param("linkinfooter_$q->{'name'}")) ? 1 : 0;
+            $sth->execute($linkinfooter, $userid, $q->{'name'});
+    }
+
+    Bugzilla->user->flush_queries_cache;
+}
 
 
 ###############################################################################
@@ -340,6 +354,7 @@ SWITCH: for ($current_tab_name) {
         last SWITCH;
     };
     /^saved-searches$/ && do {
+        SaveSavedSearches() if $cgi->param('dosave');
         DoSavedSearches();
         last SWITCH;
     };