Bug 40933

wiki_url in products and components


git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@257 6955db30-a419-402b-8a0d-67ecbb4d7f56
master
vfilippov 2009-08-18 12:08:16 +00:00
parent 54742c148f
commit e8fcddfbda
13 changed files with 84 additions and 19 deletions

View File

@ -58,6 +58,7 @@ use constant UPDATE_COLUMNS => qw(
initialowner
initialqacontact
description
wiki_url
);
use constant VALIDATORS => {
@ -301,6 +302,7 @@ sub _create_series {
}
}
sub set_wiki_url { $_[0]->set('wiki_url', $_[1]); }
sub set_name { $_[0]->set('name', $_[1]); }
sub set_description { $_[0]->set('description', $_[1]); }
sub set_default_assignee {

View File

@ -1,4 +1,3 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
@ -1181,6 +1180,7 @@ use constant ABSTRACT_SCHEMA => {
DEFAULT => 0},
defaultmilestone => {TYPE => 'varchar(20)',
NOTNULL => 1, DEFAULT => "'---'"},
wiki_url => {TYPE => 'varchar(255)', NOTNULL => 1, DEFAULT => "''"},
],
INDEXES => [
products_name_idx => {FIELDS => ['name'],
@ -1205,7 +1205,7 @@ use constant ABSTRACT_SCHEMA => {
COLUMN => 'userid',
DELETE => 'SET NULL'}},
description => {TYPE => 'MEDIUMTEXT', NOTNULL => 1},
wiki_url => {TYPE => 'TINYTEXT', NOTNULL => 1},
wiki_url => {TYPE => 'varchar(255)', NOTNULL => 1, DEFAULT => "''"},
],
INDEXES => [
components_product_id_idx => {FIELDS => [qw(product_id name)],

View File

@ -48,16 +48,17 @@ use constant NAME_FIELD => 'name';
use constant LIST_ORDER => 'name';
use constant DB_COLUMNS => qw(
id
name
classification_id
description
milestoneurl
disallownew
votesperuser
maxvotesperbug
votestoconfirm
defaultmilestone
id
name
classification_id
description
milestoneurl
disallownew
votesperuser
maxvotesperbug
votestoconfirm
defaultmilestone
wiki_url
);
use constant REQUIRED_CREATE_FIELDS => qw(
@ -75,6 +76,7 @@ use constant UPDATE_COLUMNS => qw(
votesperuser
maxvotesperbug
votestoconfirm
wiki_url
);
use constant VALIDATORS => {
@ -605,6 +607,7 @@ sub set_disallow_new { $_[0]->set('disallownew', $_[1]); }
sub set_votes_per_user { $_[0]->set('votesperuser', $_[1]); }
sub set_votes_per_bug { $_[0]->set('maxvotesperbug', $_[1]); }
sub set_votes_to_confirm { $_[0]->set('votestoconfirm', $_[1]); }
sub set_wiki_url { $_[0]->set('wiki_url', $_[1]); }
sub set_group_controls {
my ($self, $group, $settings) = @_;
@ -864,6 +867,7 @@ sub max_votes_per_bug { return $_[0]->{'maxvotesperbug'}; }
sub votes_to_confirm { return $_[0]->{'votestoconfirm'}; }
sub default_milestone { return $_[0]->{'defaultmilestone'}; }
sub classification_id { return $_[0]->{'classification_id'}; }
sub wiki_url { return $_[0]->{'wiki_url'}; }
###############################
#### Subroutines ######
@ -911,10 +915,11 @@ Bugzilla::Product - Bugzilla product class.
my $name = $product->name;
my $description = $product->description;
my $milestoneurl = $product->milestone_url;
my disallownew = $product->disallow_new;
my votesperuser = $product->votes_per_user;
my maxvotesperbug = $product->max_votes_per_bug;
my votestoconfirm = $product->votes_to_confirm;
my $disallownew = $product->disallow_new;
my $votesperuser = $product->votes_per_user;
my $maxvotesperbug = $product->max_votes_per_bug;
my $votestoconfirm = $product->votes_to_confirm;
my $wiki_url = $product->wiki_url;
my $defaultmilestone = $product->default_milestone;
my $classificationid = $product->classification_id;

View File

@ -225,6 +225,7 @@ if ($action eq 'update') {
my $default_assignee = trim($cgi->param('initialowner') || '');
my $default_qa_contact = trim($cgi->param('initialqacontact') || '');
my $description = trim($cgi->param('description') || '');
my $wiki_url = trim($cgi->param('wiki_url') || '');
my @initial_cc = $cgi->param('initialcc');
my $component =
@ -234,6 +235,7 @@ if ($action eq 'update') {
$component->set_description($description);
$component->set_default_assignee($default_assignee);
$component->set_default_qa_contact($default_qa_contact);
$component->set_wiki_url($wiki_url);
$component->set_cc_list(\@initial_cc);
my $changes = $component->update();

View File

@ -291,6 +291,7 @@ if ($action eq 'update') {
$product->set_votes_per_user(scalar $cgi->param('votesperuser'));
$product->set_votes_per_bug(scalar $cgi->param('maxvotesperbug'));
$product->set_votes_to_confirm(scalar $cgi->param('votestoconfirm'));
$product->set_wiki_url(scalar $cgi->param('wiki_url'));
my $changes = $product->update();

View File

@ -1,6 +1,11 @@
-- SQL скрипт изменений требуемых в нашей боевой базе багзиллы при обновлении с 2.x до 3.х
-- Возможно, добавятся ещё новые кривости, но пока так.
set names utf8;
-- äï ./checksetup.pl:
alter table components change wiki_url wiki_url1 varchar(255) not null;
-- ðïóìå ./checksetup.pl:
alter table components drop wiki_url;
alter table components change wiki_url1 wiki_url varchar(255) not null;
-- Убираем кривые значения из базы
delete from profiles_activity where userid=83;
delete from bugs_activity where attach_id=13529;

View File

@ -1,5 +1,5 @@
#!/usr/bin/perl
# Перекодировка параметров сохранённых поисков из CP-1251 в UTF-8
# ./checksetup'Ï×ÙÅ ÏÂÎÏ×ÌÅÎÉÑ ÂÁÚÙ
use strict;
use utf8;
@ -18,6 +18,7 @@ sub sure_utf8
return $s;
}
# ðÅÒÅËÏÄÉÒÏ×ËÁ ÐÁÒÁÍÅÔÒÏ× ÓÏÈÒÁΣÎÎÙÈ ÐÏÉÓËÏ× ÉÚ CP-1251 × UTF-8
print "Making sure saved queries are in UTF-8...\n";
my $dbh = Bugzilla->dbh;
my $nq = $dbh->selectall_arrayref("SELECT * FROM namedqueries WHERE query LIKE '%\\%%'", {Slice=>{}});
@ -31,3 +32,14 @@ if ($nq)
$dbh->do("UPDATE namedqueries SET query=? WHERE id=?", undef, $q, $_->{id}) if $q ne $_->{query};
}
}
# äÏÂÁ×ÌÑÅÍ ËÏÌÏÎËÕ wiki_url × ÐÒÏÄÕËÔÙ É ËÏÍÐÏÎÅÎÔÙ
if (!$dbh->bz_column_info('products', 'buglist'))
{
$dbh->bz_add_column('products', 'wiki_url', {TYPE => 'varchar(255)', NOTNULL => 1, DEFAULT => "''"});
}
if (!$dbh->bz_column_info('components', 'buglist'))
{
$dbh->bz_add_column('components', 'wiki_url', {TYPE => 'varchar(255)', NOTNULL => 1, DEFAULT => "''"});
}

View File

@ -90,6 +90,15 @@
[% END %]
</td>
</tr>
<tr>
<th align="right">
<label for="wiki_url">Wiki URL:</label>
</td>
<td>
<input size="64" maxlength="64" name="wiki_url" value="" />
<br><em>Or use product setting when empty.</em>
</td>
</tr>
</table>
<hr>
<input type="submit" id="create" value="Add">

View File

@ -100,6 +100,15 @@
[% END %]
</td>
</tr>
<tr>
<td valign="top">
<label for="wiki_url">Wiki URL:</label>
</td>
<td>
<input size="64" maxlength="64" name="wiki_url" value="[% comp.wiki_url FILTER html %]" />
<br><em>Or use product setting when empty.</em>
</td>
</tr>
<tr>
<td>[% terms.Bugs %]:</td>
<td>

View File

@ -76,6 +76,15 @@
checked="checked"[% END %]>
</td>
</tr>
<tr>
<th align="right">
<label for="wiki_url">Wiki URL:</label>
</th>
<td>
<input size="64" maxlength="64" name="wiki_url" value="[% product.wiki_url FILTER html %]" />
<br><em>Or use default setting when empty.</em>
</td>
</tr>
[% IF !Param('usevotes') %]
<tr class="param_disabled">

View File

@ -118,6 +118,14 @@
[% checkvotes = 1 %]
[% END %]
[% IF changes.wiki_url.defined %]
<p>
Updated Wiki URL from
[%+ changes.wiki_url.0 FILTER html %] to
[%+ product.wiki_url FILTER html %].
</p>
[% END %]
[% IF !changes.keys.size %]
<p>Nothing changed for product '[% product.name FILTER html %]'.</p>
[% END %]

View File

@ -1217,13 +1217,13 @@
<br>Look for [% terms.Bug %] in:
<a href="[% Param('viewvc_url') %]?view=query&comment=bug[% bug.bug_id %]+[% bug.bug_id %]&comment_match=fulltext&querysort=date&date=all">CVS&SVN</a>
/
<a href="[% bug.component_obj.wiki_url || Param('wiki_url') %][% terms.Bug %]_[% bug.bug_id %]">Wiki</a>
<a href="[% bug.component_obj.wiki_url || bug.product_obj.wiki_url || Param('wiki_url') %][% terms.Bug %]_[% bug.bug_id %]">Wiki</a>
</div>
[% ELSE %]
<div class="knob-buttons">
<a href="[% Param('viewvc_url') %]?view=query&comment=bug[% bug.bug_id %]+[% bug.bug_id %]&comment_match=fulltext&querysort=date&date=all">CVS&SVN</a>
/
<a href="[% bug.component_obj.wiki_url || Param('wiki_url') %][% terms.Bug %]_[% bug.bug_id %]">Wiki</a>
<a href="[% bug.component_obj.wiki_url || bug.product_obj.wiki_url || Param('wiki_url') %][% terms.Bug %]_[% bug.bug_id %]">Wiki</a>
<input type="submit" value="Commit" id="commit[% id FILTER css_class_quote %]">
[% IF bug.user.canmove %]
<input type="submit" name="action" id="action[% id FILTER css_class_quote %]" value="[% Param("move-button-text") %]">

View File

@ -242,6 +242,9 @@
<li>Default CC list deleted</li>
[% END %]
[% END %]
[% IF changes.wiki_url.defined %]
<li>Wiki URL updated to '[% comp.wiki_url FILTER html %]'</li>
[% END %]
[% ELSE %]
No changes made to <em>[% comp.name FILTER html %]</em>.
[% END %]