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
558b05ca
Commit
558b05ca
authored
Mar 08, 2007
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 345826: Ability to save column list in saved searches
Patch By Ronaldo Maia <romaia@async.com.br> r=LpSolit, a=LpSolit
parent
532eabde
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
4 deletions
+59
-4
colchange.cgi
colchange.cgi
+48
-4
change-columns.html.tmpl
template/en/default/list/change-columns.html.tmpl
+11
-0
No files found.
colchange.cgi
View file @
558b05ca
...
@@ -28,6 +28,8 @@ use lib qw(.);
...
@@ -28,6 +28,8 @@ use lib qw(.);
use
Bugzilla
;
use
Bugzilla
;
use
Bugzilla::
Constants
;
use
Bugzilla::
Constants
;
use
Bugzilla::
CGI
;
use
Bugzilla::Search::
Saved
;
use
Bugzilla::
Error
;
use
Bugzilla::
Error
;
use
Bugzilla::
User
;
use
Bugzilla::
User
;
use
Bugzilla::
Keyword
;
use
Bugzilla::
Keyword
;
...
@@ -101,9 +103,13 @@ if (defined $cgi->param('rememberedquery')) {
...
@@ -101,9 +103,13 @@ if (defined $cgi->param('rememberedquery')) {
my
$urlbase
=
Bugzilla
->
params
->
{
"urlbase"
};
my
$urlbase
=
Bugzilla
->
params
->
{
"urlbase"
};
if
(
$list
)
{
if
(
$list
)
{
$cgi
->
send_cookie
(
-
name
=>
'COLUMNLIST'
,
# Only set the cookie if this is not a saved search.
-
value
=>
$list
,
# Saved searches have their own column list
-
expires
=>
'Fri, 01-Jan-2038 00:00:00 GMT'
);
if
(
!
$cgi
->
param
(
'save_columns_for_search'
))
{
$cgi
->
send_cookie
(
-
name
=>
'COLUMNLIST'
,
-
value
=>
$list
,
-
expires
=>
'Fri, 01-Jan-2038 00:00:00 GMT'
);
}
}
}
else
{
else
{
$cgi
->
remove_cookie
(
'COLUMNLIST'
);
$cgi
->
remove_cookie
(
'COLUMNLIST'
);
...
@@ -118,7 +124,27 @@ if (defined $cgi->param('rememberedquery')) {
...
@@ -118,7 +124,27 @@ if (defined $cgi->param('rememberedquery')) {
}
}
$vars
->
{
'message'
}
=
"change_columns"
;
$vars
->
{
'message'
}
=
"change_columns"
;
$vars
->
{
'redirect_url'
}
=
"buglist.cgi?"
.
$cgi
->
param
(
'rememberedquery'
);
my
$search
;
if
(
defined
$cgi
->
param
(
'saved_search'
))
{
$search
=
new
Bugzilla::Search::
Saved
(
$cgi
->
param
(
'saved_search'
));
}
if
(
$cgi
->
param
(
'save_columns_for_search'
)
&&
defined
$search
&&
$search
->
user
->
id
==
Bugzilla
->
user
->
id
)
{
my
$params
=
new
Bugzilla::
CGI
(
$search
->
url
);
$params
->
param
(
'columnlist'
,
join
(
","
,
@collist
));
$search
->
set_url
(
$params
->
query_string
());
$search
->
update
();
$vars
->
{
'redirect_url'
}
=
"buglist.cgi?"
.
$cgi
->
param
(
'rememberedquery'
);
}
else
{
my
$params
=
new
Bugzilla::
CGI
(
$cgi
->
param
(
'rememberedquery'
));
$params
->
param
(
'columnlist'
,
join
(
","
,
@collist
));
$vars
->
{
'redirect_url'
}
=
"buglist.cgi?"
.
$params
->
query_string
();
}
# If we're running on Microsoft IIS, using cgi->redirect discards
# If we're running on Microsoft IIS, using cgi->redirect discards
# the Set-Cookie lines -- workaround is to use the old-fashioned
# the Set-Cookie lines -- workaround is to use the old-fashioned
...
@@ -149,6 +175,24 @@ $vars->{'splitheader'} = $cgi->cookie('SPLITHEADER') ? 1 : 0;
...
@@ -149,6 +175,24 @@ $vars->{'splitheader'} = $cgi->cookie('SPLITHEADER') ? 1 : 0;
$vars
->
{
'buffer'
}
=
$cgi
->
query_string
();
$vars
->
{
'buffer'
}
=
$cgi
->
query_string
();
my
$search
;
if
(
defined
$cgi
->
param
(
'query_based_on'
))
{
my
$searches
=
Bugzilla
->
user
->
queries
;
my
(
$search
)
=
grep
(
$_
->
name
eq
$cgi
->
param
(
'query_based_on'
),
@$searches
);
# Only allow users to edit their own queries.
if
(
$search
&&
$search
->
user
->
id
==
Bugzilla
->
user
->
id
)
{
$vars
->
{
'saved_search'
}
=
$search
;
$vars
->
{
'buffer'
}
=
"cmdtype=runnamed&namedcmd="
.
$search
->
name
;
my
$params
=
new
Bugzilla::
CGI
(
$search
->
url
);
if
(
$params
->
param
(
'columnlist'
))
{
my
@collist
=
split
(
','
,
$params
->
param
(
'columnlist'
));
$vars
->
{
'collist'
}
=
\
@collist
if
scalar
(
@collist
);
}
}
}
# Generate and return the UI (HTML page) from the appropriate template.
# Generate and return the UI (HTML page) from the appropriate template.
print
$cgi
->
header
();
print
$cgi
->
header
();
$template
->
process
(
"list/change-columns.html.tmpl"
,
$vars
)
$template
->
process
(
"list/change-columns.html.tmpl"
,
$vars
)
...
...
template/en/default/list/change-columns.html.tmpl
View file @
558b05ca
...
@@ -63,6 +63,17 @@
...
@@ -63,6 +63,17 @@
</label>
</label>
</p>
</p>
[% IF saved_search %]
<p>
<input type="hidden" name="saved_search"
value="[% saved_search.id FILTER html%]" >
<input type="checkbox" id="save_columns_for_search" checked="checked"
name="save_columns_for_search" value="1">
<label for="save_columns_for_search">Save this column list only
for search '[% saved_search.name FILTER html %]'</label>
</p>
[% END %]
<p>
<p>
<input type="submit" id="change" value="Change Columns">
<input type="submit" id="change" value="Change Columns">
</p>
</p>
...
...
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