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
2e6c635d
Commit
2e6c635d
authored
Dec 09, 2002
by
bugreport%peshkin.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 159627 quips should be editable and deleteable using the web interface
patch by burnus r=timeless,a=justdave
parent
e008fbf6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
1 deletion
+84
-1
quips.cgi
quips.cgi
+41
-0
code-error.html.tmpl
template/en/default/global/code-error.html.tmpl
+3
-0
user-error.html.tmpl
template/en/default/global/user-error.html.tmpl
+5
-1
quips.html.tmpl
template/en/default/list/quips.html.tmpl
+35
-0
No files found.
quips.cgi
View file @
2e6c635d
...
...
@@ -58,6 +58,34 @@ if ($action eq "show") {
$vars
->
{
'show_quips'
}
=
1
;
}
if
(
$action
eq
"edit"
)
{
if
(
!
UserInGroup
(
'admin'
))
{
ThrowUserError
(
"quips_edit_denied"
);
}
# Read in the entire quip list
SendSQL
(
"SELECT quipid,userid,quip FROM quips"
);
my
$quips
;
my
@quipids
;
while
(
MoreSQLData
())
{
my
(
$quipid
,
$userid
,
$quip
)
=
FetchSQLData
();
$quips
->
{
$quipid
}
=
{
'userid'
=>
$userid
,
'quip'
=>
$quip
};
push
(
@quipids
,
$quipid
);
}
my
$users
;
foreach
my
$quipid
(
@quipids
)
{
if
(
not
defined
$users
->
{
$userid
})
{
SendSQL
(
"SELECT login_name FROM profiles WHERE userid = $userid"
);
$users
->
{
$userid
}
=
FetchSQLData
();
}
}
$vars
->
{
'quipids'
}
=
\
@quipids
;
$vars
->
{
'quips'
}
=
$quips
;
$vars
->
{
'users'
}
=
$users
;
$vars
->
{
'edit_quips'
}
=
1
;
}
if
(
$action
eq
"add"
)
{
(
Param
(
'enablequips'
)
eq
"on"
)
||
ThrowUserError
(
"no_new_quips"
);
...
...
@@ -71,6 +99,19 @@ if ($action eq "add") {
$vars
->
{
'added_quip'
}
=
$comment
;
}
if
(
$action
eq
"delete"
)
{
if
(
!
UserInGroup
(
'admin'
))
{
ThrowUserError
(
"quips_edit_denied"
);
}
my
$quipid
=
$::FORM
{
"quipid"
};
ThrowCodeError
(
"need_quipid"
)
unless
$quipid
=~
/(\d+)/
;
$quipid
=
$1
;
SendSQL
(
"SELECT quip FROM quips WHERE quipid = $quipid"
);
$vars
->
{
'deleted_quip'
}
=
FetchSQLData
();
SendSQL
(
"DELETE FROM quips WHERE quipid = $quipid"
);
}
print
"Content-type: text/html\n\n"
;
$template
->
process
(
"list/quips.html.tmpl"
,
$vars
)
||
ThrowTemplateError
(
$template
->
error
());
template/en/default/global/code-error.html.tmpl
View file @
2e6c635d
...
...
@@ -177,6 +177,9 @@
No Y axis was defined when creating report. The X axis is optional,
but the Y axis is compulsory.
[% ELSIF error == "need_quipid" %]
A valid quipid is needed.
[% ELSIF error == "request_queue_group_invalid" %]
The group field <em>[% group FILTER html %]</em> is invalid.
...
...
template/en/default/global/user-error.html.tmpl
View file @
2e6c635d
...
...
@@ -371,7 +371,7 @@
[% ELSIF error == "need_quip" %]
[% title = "Quip Required" %]
Please enter a quip in the text field.
[% ELSIF error == "new_password_missing" %]
[% title = "New Password Missing" %]
You must enter a new password.
...
...
@@ -480,6 +480,10 @@
[% title = "Quips Disabled" %]
Quips are disabled.
[% ELSIF error == "quips_edit_denied" %]
[% title = "Permission Denied" %]
You do not have permission to edit quips.
[% ELSIF error == "reassign_to_empty" %]
[% title = "Illegal Reassignment" %]
You cannot reassign to a bug to nobody. Unless you
...
...
template/en/default/list/quips.html.tmpl
View file @
2e6c635d
...
...
@@ -39,6 +39,14 @@
</p>
[% END %]
[% IF deleted_quip %]
<p>
<font color="red">
The quip '<tt>[% deleted_quip FILTER html %]</tt>' has been deleted.
</font>
</p>
[% END %]
<p>
Bugzilla will pick a random quip for the headline on each bug list, and
you can extend the quip list. Type in something clever or funny or boring
...
...
@@ -62,11 +70,38 @@
<li>[% quip FILTER html %]</li>
[% END %]
</ul>
[% ELSIF edit_quips %]
<h2>Edit existing quips:</h2>
<table border="1">
<thead><tr>
<th>Action</th>
<th>User</th>
<th>Quip</th>
</tr></thead><tbody>
[% FOREACH quipid = quipids %]
<tr>
<td>
<a href="quips.cgi?action=delete&quipid=[% quipid FILTER uri%]">
Delete
</a>
</td>
<td>
[% userid = quips.$quipid.userid %]
[% users.$userid FILTER html %]
[% "Unknown" IF NOT users.$userid %]
</td>
<td>[% quips.$quipid.quip FILTER html %]</td>
</tr>
[% END %]
</tbody></table>
[% ELSE %]
<p>
Those who like their wisdom in large doses can
<a href="quips.cgi?action=show">view the whole quip list</a>.
</p>
[% IF UserInGroup('admin') %]
<p><a href="quips.cgi?action=edit">Edit</a> the quip list.</p>
[% END %]
[% END %]
[% PROCESS global/footer.html.tmpl %]
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