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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
ab5067bb
Commit
ab5067bb
authored
Mar 11, 2005
by
travis%sedsystems.ca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 41972 : Per-user pref to turn quips off
Patch by Shane H. W. Travis <travis@sedsystems.ca> r=mkanat a=justdave
parent
6674f619
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
35 additions
and
26 deletions
+35
-26
Config.pm
Bugzilla/Config.pm
+13
-0
checksetup.pl
checksetup.pl
+3
-0
defparams.pl
defparams.pl
+9
-9
quips.cgi
quips.cgi
+4
-8
setting-descs.none.tmpl
template/en/default/global/setting-descs.none.tmpl
+1
-0
user-error.html.tmpl
template/en/default/global/user-error.html.tmpl
+0
-4
list.html.tmpl
template/en/default/list/list.html.tmpl
+1
-1
quips.html.tmpl
template/en/default/list/quips.html.tmpl
+4
-4
No files found.
Bugzilla/Config.pm
View file @
ab5067bb
...
@@ -237,6 +237,19 @@ sub UpdateParams {
...
@@ -237,6 +237,19 @@ sub UpdateParams {
delete
$param
{
'loginmethod'
};
delete
$param
{
'loginmethod'
};
}
}
# Remove quip-display control from parameters
# and give it to users via User Settings (Bug 41972)
if
(
exists
$param
{
'enablequips'
}
&&
!
exists
$param
{
'quip_list_entry_control'
})
{
my
$new_value
;
(
$param
{
'enablequips'
}
eq
'on'
)
&&
do
{
$new_value
=
'open'
;};
(
$param
{
'enablequips'
}
eq
'approved'
)
&&
do
{
$new_value
=
'moderated'
;};
(
$param
{
'enablequips'
}
eq
'frozen'
)
&&
do
{
$new_value
=
'closed'
;};
$param
{
'quip_list_entry_control'
}
=
$new_value
;
delete
$param
{
'enablequips'
};
}
# --- DEFAULTS FOR NEW PARAMS ---
# --- DEFAULTS FOR NEW PARAMS ---
foreach
my
$item
(
@param_list
)
{
foreach
my
$item
(
@param_list
)
{
...
...
checksetup.pl
View file @
ab5067bb
...
@@ -4136,6 +4136,9 @@ if (!defined $dbh->bz_get_index_def('bugs_activity','who')) {
...
@@ -4136,6 +4136,9 @@ if (!defined $dbh->bz_get_index_def('bugs_activity','who')) {
$dbh
->
do
(
'ALTER TABLE bugs_activity ADD INDEX (who)'
);
$dbh
->
do
(
'ALTER TABLE bugs_activity ADD INDEX (who)'
);
}
}
# 2005-03-03 travis@sedsystems.ca -- Bug 41972
add_setting
(
"display_quips"
,
{
"on"
=>
1
,
"off"
=>
2
},
"on"
);
#
#
# Final checks...
# Final checks...
...
...
defparams.pl
View file @
ab5067bb
...
@@ -390,16 +390,16 @@ sub find_languages {
...
@@ -390,16 +390,16 @@ sub find_languages {
},
},
{
{
name
=>
'
enablequips
'
,
name
=>
'
quip_list_entry_control
'
,
desc
=>
'Controls
the appearance of quips at the top of buglists.<ul>
'
.
desc
=>
'Controls
how easily users can add entries to the quip list.
'
.
'<
li>on - Bugzilla will display a quip, and lets users add to
'
.
'<
ul><li>open - Users may freely add to the quip list, and
'
.
'the
list.</li><li>approved - quips can be entered, but need
'
.
'the
ir entries will immediately be available for viewing.</li>
'
.
'
be approved before shown</li><li>frozen - Bugzilla will display
'
.
'
<li>moderated - quips can be entered, but need to be approved
'
.
'
a quip but not permit new additions.</li><li>off - Bugzilla
'
.
'
by an admin before they will be shown</li><li>closed - no new
'
.
'
will not display quips
.</li></ul>'
,
'
additions to the quips list are allowed
.</li></ul>'
,
type
=>
's'
,
type
=>
's'
,
choices
=>
[
'o
n'
,
'approved'
,
'frozen'
,
'off
'
],
choices
=>
[
'o
pen'
,
'moderated'
,
'closed
'
],
default
=>
'on'
,
default
=>
'o
pe
n'
,
checker
=>
\&
check_multi
checker
=>
\&
check_multi
},
},
...
...
quips.cgi
View file @
ab5067bb
...
@@ -41,10 +41,6 @@ Bugzilla->login(LOGIN_REQUIRED);
...
@@ -41,10 +41,6 @@ Bugzilla->login(LOGIN_REQUIRED);
my
$cgi
=
Bugzilla
->
cgi
;
my
$cgi
=
Bugzilla
->
cgi
;
if
(
Param
(
'enablequips'
)
eq
"off"
)
{
ThrowUserError
(
"quips_disabled"
);
}
my
$action
=
$cgi
->
param
(
'action'
)
||
""
;
my
$action
=
$cgi
->
param
(
'action'
)
||
""
;
if
(
$action
eq
"show"
)
{
if
(
$action
eq
"show"
)
{
...
@@ -75,12 +71,12 @@ if ($action eq "show") {
...
@@ -75,12 +71,12 @@ if ($action eq "show") {
}
}
if
(
$action
eq
"add"
)
{
if
(
$action
eq
"add"
)
{
(
Param
(
'
enablequips'
)
eq
"on"
or
Param
(
'enablequips'
)
eq
"approved"
)
(
Param
(
'
quip_list_entry_control'
)
eq
"closed"
)
&&
||
ThrowUserError
(
"no_new_quips"
);
ThrowUserError
(
"no_new_quips"
);
# Add the quip
# Add the quip
my
$approved
=
(
Param
(
'enablequips'
)
eq
"on"
)
?
'1'
:
'0'
;
my
$approved
=
$approved
=
1
if
(
UserInGroup
(
'admin'
))
;
(
Param
(
'quip_list_entry_control'
)
eq
"open"
)
||
(
UserInGroup
(
'admin'
))
||
0
;
my
$comment
=
$cgi
->
param
(
"quip"
);
my
$comment
=
$cgi
->
param
(
"quip"
);
$comment
||
ThrowUserError
(
"need_quip"
);
$comment
||
ThrowUserError
(
"need_quip"
);
$comment
!~
m/</
||
ThrowUserError
(
"no_html_in_quips"
);
$comment
!~
m/</
||
ThrowUserError
(
"no_html_in_quips"
);
...
...
template/en/default/global/setting-descs.none.tmpl
View file @
ab5067bb
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
[% PROCESS global/variables.none.tmpl %]
[% PROCESS global/variables.none.tmpl %]
[% setting_descs = {
[% setting_descs = {
"display_quips" => "Show a quip at the top of each bug list",
"off" => "Off",
"off" => "Off",
"on" => "On"
"on" => "On"
}
}
...
...
template/en/default/global/user-error.html.tmpl
View file @
ab5067bb
...
@@ -917,10 +917,6 @@
...
@@ -917,10 +917,6 @@
[% title = "Query Name Too Long" %]
[% title = "Query Name Too Long" %]
The name of the query must be less than 64 characters long.
The name of the query must be less than 64 characters long.
[% ELSIF error == "quips_disabled" %]
[% title = "Quips Disabled" %]
Quips are disabled.
[% ELSIF error == "reassign_to_empty" %]
[% ELSIF error == "reassign_to_empty" %]
[% title = "Illegal Reassignment" %]
[% title = "Illegal Reassignment" %]
To reassign [% terms.abug %], you must provide an address for
To reassign [% terms.abug %], you must provide an address for
...
...
template/en/default/list/list.html.tmpl
View file @
ab5067bb
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
<p>[% query FILTER html %]</p>
<p>[% query FILTER html %]</p>
[% END %]
[% END %]
[% IF
Param('enablequips') != 'off
' %]
[% IF
user.settings.display_quips.value == 'on
' %]
[% DEFAULT quip = "$terms.Bugzilla would like to put a random quip here, but no one has entered any." %]
[% DEFAULT quip = "$terms.Bugzilla would like to put a random quip here, but no one has entered any." %]
<a href="quips.cgi"><i>[% quip FILTER html %]</i></a>
<a href="quips.cgi"><i>[% quip FILTER html %]</i></a>
[% END %]
[% END %]
...
...
template/en/default/list/quips.html.tmpl
View file @
ab5067bb
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
<p>
<p>
<font color="red">
<font color="red">
Your quip '<tt>[% added_quip FILTER html %]</tt>' has been added.
Your quip '<tt>[% added_quip FILTER html %]</tt>' has been added.
[% IF Param("
enablequips") == "approv
ed" AND !user.groups.admin %]
[% IF Param("
quip_list_entry_control") == "moderat
ed" AND !user.groups.admin %]
It will be used as soon as it gets approved.
It will be used as soon as it gets approved.
[% END %]
[% END %]
</font>
</font>
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
[% terms.Bugzilla %] will pick a random quip for the headline on each [% terms.bug %] list, and
[% terms.Bugzilla %] will pick a random quip for the headline on each [% terms.bug %] list, and
you can extend the quip list. Type in something clever or funny or boring
you can extend the quip list. Type in something clever or funny or boring
(but not obscene or offensive, please) and bonk on the button.
(but not obscene or offensive, please) and bonk on the button.
[% IF Param("
enablequips") == "approv
ed" AND !user.groups.admin %]
[% IF Param("
quip_list_entry_control") == "moderat
ed" AND !user.groups.admin %]
Note that your quip has to be approved before it is used.
Note that your quip has to be approved before it is used.
[% END %]
[% END %]
</p>
</p>
...
@@ -88,8 +88,8 @@
...
@@ -88,8 +88,8 @@
<h2>Edit existing quips:</h2>
<h2>Edit existing quips:</h2>
<p>
<p>
<strong>Note:</strong> Only approved quips will be shown.
<strong>Note:</strong> Only approved quips will be shown.
If
enablequips is set to <q>on</q>, entered quips are automatically
If
the parameter 'quip_list_entry_control' is set to <q>open</q>,
approved.
entered quips are automatically
approved.
</p>
</p>
<form name="editform" method="post" action="quips.cgi">
<form name="editform" method="post" action="quips.cgi">
<input type="hidden" name="action" value="approve">
<input type="hidden" name="action" value="approve">
...
...
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