diff -u -N -r bugzilla2174/Bug.pm bugzilla2174_cf/Bug.pm --- bugzilla2174/Bug.pm 2003-09-16 12:04:15.901914000 +0200 +++ bugzilla2174_cf/Bug.pm 2003-09-16 11:18:40.263031000 +0200 @@ -50,7 +50,7 @@ bug_file_loc status_whiteboard keywords priority bug_severity target_milestone dependson blocked votes - reporter assigned_to cc + reporter assigned_to cc customfield ); if (Param('useqacontact')) { @@ -181,6 +181,7 @@ return $self; } + $self->{'type'} = 'Task' unless ($self->{'type'}); $self->{'assigned_to'} = new Bugzilla::User($self->{'assigned_to'}); $self->{'reporter'} = new Bugzilla::User($self->{'reporter'}); @@ -259,6 +260,47 @@ $self->{'blocked'} = \@blocked; } + # Support for customfields. + $self->{'customfield'} = (); + my @cfields; + my $position_cnt = 1; + $query = "SELECT name, type, valid_exp, mandatory, position, value, default_value FROM customfields c, products_customfields d, bugs_customfields e + WHERE e.cf_id=d.cf_id and e.bug_id=$bug_id + and d.product_id=" . &::SqlQuote($self->{'product_id'}) . "and d.cf_id=c.id + ORDER BY position"; + &::SendSQL($query); + while (&::MoreSQLData()) { + my ($name, $type, $valid_exp, $mandatory, $position, $value, $default_value) = &::FetchSQLData(); + # Get rid of all the non positioned fields (normally this should nether happen) + if ($position ne '0') { + while ($position > $position_cnt) { + my %cbug; + $cbug{'type'} = "empty"; + $position_cnt++; + push @cfields, \%cbug; + } + my %cbug; + $position_cnt++; + $cbug{'name'} = $name; + $cbug{'type'} = $type; + $cbug{'mandatory'} = $mandatory; + if ($cbug{'type'} eq "any") { + $cbug{'values'} = $value ? $value : $default_value; + } + else { + $cbug{'values'} = [split('\|',$valid_exp)]; + if ($cbug{'type'} eq "single") { + $cbug{'selectedvalues'} = $value; + } + else { + $cbug{'selectedvalues'} = [split('\|',$value)]; + } + } + push @cfields, \%cbug; + } + } + $self->{'customfield'} = \@cfields; + return $self; } @@ -459,6 +501,7 @@ 'product' => \@prodlist, 'rep_platform' => \@::legal_platform, 'priority' => \@::legal_priority, + 'customfield' => $self->{'customfield'}, 'bug_severity' => \@::legal_severity, 'op_sys' => \@::legal_opsys, 'bug_status' => \@::legal_bugs_status, diff -u -N -r bugzilla2174/Bugzilla/Search.pm bugzilla2174_cf/Bugzilla/Search.pm --- bugzilla2174/Bugzilla/Search.pm 2003-09-16 12:04:17.861923000 +0200 +++ bugzilla2174_cf/Bugzilla/Search.pm 2003-09-15 18:55:18.632101000 +0200 @@ -57,6 +57,7 @@ my $self = shift; my $fieldsref = $self->{'fields'}; my $params = $self->{'params'}; + my $custom_cols = $self->{'custom_columns'}; my $debug = 0; @@ -67,6 +68,7 @@ @fields = @$fieldsref if $fieldsref; my @specialchart; my @andlist; + my @custom_columns = @$custom_cols if $custom_cols; &::GetVersionTable(); @@ -98,6 +100,21 @@ push @wherepart, "bugs.component_id = map_components.id"; } + # custom field support. To be tested on large database. + my $cf_id; + my $field; + foreach $field (@custom_columns) { + trick_taint($field); + # get the custom field id. + $cf_id = $::legal_customfields{$field}[2]; + # Use the custom field value + push @fields , "bcf$cf_id.value as $field"; + # Add custom field tables to join + push @supptables, "LEFT JOIN customfields cf$cf_id ON cf$cf_id.name='$field'"; + push @supptables, "LEFT JOIN bugs_customfields bcf$cf_id ON bugs.bug_id = bcf$cf_id.bug_id and bcf$cf_id.cf_id=cf$cf_id.id"; + } + + my $minvotes; if (defined $params->param('votes')) { my $c = trim($params->param('votes')); @@ -881,7 +898,19 @@ print "
$key ($f , $t ) => ";
}
$ff = $f;
- if ($f !~ /\./) {
+ if (defined ($::legal_customfields{$f})) {
+ my $cf_crc = "${chart}_${row}_${col}";
+ # Use the custom field value
+ $ff = "bcf$cf_crc.value";
+ # Add custom field tables to join
+ push @supptables, "bugs_customfields bcf$cf_crc";
+ push @supptables, "customfields cf$cf_crc";
+ # Add join criteria and custom field name to where clause
+ push @andlist, "bugs.bug_id = bcf$cf_crc.bug_id";
+ push @andlist, "bcf$cf_crc.cf_id = cf$cf_crc.id";
+ push @andlist, "cf$cf_crc.name = '$f'";
+ }
+ elsif ($f !~ /\./) {
$ff = "bugs.$f";
}
&$ref;
diff -u -N -r bugzilla2174/buglist.cgi bugzilla2174_cf/buglist.cgi
--- bugzilla2174/buglist.cgi 2003-09-16 12:04:20.071918000 +0200
+++ bugzilla2174_cf/buglist.cgi 2003-09-15 18:55:03.322100000 +0200
@@ -50,6 +50,7 @@
@legal_priority
@legal_product
@legal_severity
+ @legal_customfields
@settable_resolution
@target_milestone
$unconfirmedstate
@@ -62,6 +63,7 @@
}
ConnectToDatabase();
+GetVersionTable();
################################################################################
# Data and Security Validation
@@ -405,12 +407,22 @@
DefineColumn("remaining_time" , "bugs.remaining_time" , "Remaining Hours" );
DefineColumn("actual_time" , "(SUM(ldtime.work_time)*COUNT(DISTINCT ldtime.bug_when)/COUNT(bugs.bug_id)) AS actual_time", "Actual Hours");
DefineColumn("percentage_complete","(100*((SUM(ldtime.work_time)*COUNT(DISTINCT ldtime.bug_when)/COUNT(bugs.bug_id))/((SUM(ldtime.work_time)*COUNT(DISTINCT ldtime.bug_when)/COUNT(bugs.bug_id))+bugs.remaining_time))) AS percentage_complete", "% Complete");
+for my $name (keys %::legal_customfields) {
+ # get the custom field id.
+ my $cf_id = $::legal_customfields{$name}[2];
+ DefineColumn($name, "bcf$cf_id.value", $name);
+}
+
+
+
################################################################################
# Display Column Determination
################################################################################
# Determine the columns that will be displayed in the bug list via the
# columnlist CGI parameter, the user's preferences, or the default.
+my @custom_columns = ();
+my %custom_map = ();
my @displaycolumns = ();
if (defined $params->param('columnlist')) {
if ($params->param('columnlist') eq "all") {
@@ -441,6 +453,22 @@
@displaycolumns = @::default_column_list;
}
+# remove custom columns from @displaycolumns and add them to @custom_columns
+my @displaycolumns_tmp;
+
+foreach my $c (@displaycolumns) {
+ # this allows spaces in customfields for the space-delimited COLUMNLIST cookie.
+ $c = url_decode($c);
+
+ if (exists $::legal_customfields{$c}) {
+ push(@custom_columns, $c);
+ }
+ else {
+ push (@displaycolumns_tmp, $c);
+ }
+}
+@displaycolumns = @displaycolumns_tmp;
+
# Weed out columns that don't actually exist to prevent the user
# from hacking their column list cookie to grab data to which they
# should not have access. Detaint the data along the way.
@@ -598,9 +626,13 @@
# Generate the basic SQL query that will be used to generate the bug list.
my $search = new Bugzilla::Search('fields' => \@selectnames,
+ 'custom_columns' => \@custom_columns,
'params' => $params);
my $query = $search->getSQL();
+# Add the customfields columns to the displayed columns
+push (@displaycolumns, @custom_columns);
+
# Extra special disgusting hack: if we are ordering by target_milestone,
# change it to order by the sortkey of the target_milestone first.
if ($db_order =~ /bugs.target_milestone/) {
@@ -608,7 +640,37 @@
$query =~ s/\sWHERE\s/ LEFT JOIN milestones ms_order ON ms_order.value = bugs.target_milestone AND ms_order.product_id = bugs.product_id WHERE /;
}
-$query .= " ORDER BY $db_order " if ($order);
+ # Extra special disgusting hack: if we are ordering by a not-displayed custom fields,
+ # change db_order to delete the wrong bcf# values in db_order.
+ # @custom_bcf = diplayed customfields.
+ my @custom_bcf;
+ foreach (@custom_columns) {
+ push @custom_bcf , "bcf".$::legal_customfields{$_}[2];
+ }
+ while ($db_order =~ m/(,*(bcf[0-9]+).value,*)/g) {
+ if (!grep($_ eq $2, @custom_bcf)) {
+ $_ = $1;
+ SWITCH: {
+ /^,.*,$/ && do {
+ $db_order =~ s/$_/,/;
+ last SWITCH;
+ };
+ /^.*,$/ && do {
+ $db_order =~ s/$_//;
+ last SWITCH;
+ };
+ #DEFAULT
+ $db_order =~ s/$_//;
+ }
+ }
+ }
+ #if a "," stays at the end of the db_order string
+ if ($db_order =~ m/(.*),/) {
+ $db_order = $1;
+ }
+
+
+$query . " ORDER BY $db_order " if ($order);
################################################################################
@@ -666,7 +728,10 @@
foreach my $column (@selectcolumns) {
$bug->{$column} = shift @row;
}
-
+ # Get the customfields values
+ foreach my $column (@custom_columns) {
+ $bug->{$column}= shift @row;
+ }
# Process certain values further (i.e. date format conversion).
if ($bug->{'changeddate'}) {
$bug->{'changeddate'} =~
diff -u -N -r bugzilla2174/checksetup.pl bugzilla2174_cf/checksetup.pl
--- bugzilla2174/checksetup.pl 2003-09-16 12:04:20.731940000 +0200
+++ bugzilla2174_cf/checksetup.pl 2003-09-15 18:55:03.352088000 +0200
@@ -1556,6 +1556,37 @@
unique(product_id,name),
index(name)';
+# Table that defines custom fields
+#
+$table{'customfields'} =
+ "id mediumint(9) not null auto_increment primary key,
+ name varchar(64) not null,
+ type enum('any','single','multi'),
+ valid_exp mediumtext not null,
+ default_value mediumtext not null,
+ mandatory tinyint not null default 0,
+
+ unique(name)";
+
+#
+# Product to CustomField join
+#
+$table{'products_customfields'} =
+ "product varchar(64) not null,
+ cf_id mediumint(9) not null,
+ position int(2) not null,
+
+ unique(product, cf_id)";
+
+#
+# Bug to CustomField join
+#
+$table{'bugs_customfields'} =
+ "bug_id mediumint(9) not null,
+ cf_id mediumint(9) not null,
+ value mediumtext,
+ unique(bug_id, cf_id),
+ index (cf_id)";
$table{dependencies} =
'blocked mediumint not null,
@@ -1564,6 +1595,37 @@
index(blocked),
index(dependson)';
+# Table that defines custom fields
+#
+$table{'customfields'} =
+ "id mediumint(9) not null auto_increment primary key,
+ name varchar(64) not null,
+ type enum('any','single','multi'),
+ valid_exp mediumtext not null,
+ default_value mediumtext not null,
+ mandatory tinyint not null default 0,
+
+ unique(name)";
+
+#
+# Product to CustomField join
+#
+$table{'products_customfields'} =
+ "product_id smallint not null,
+ cf_id mediumint(9) not null,
+ position int(2) not null,
+
+ unique(product_id, cf_id)";
+
+#
+# Bug to CustomField join
+#
+$table{'bugs_customfields'} =
+ "bug_id mediumint(9) not null,
+ cf_id mediumint(9) not null,
+ value mediumtext,
+ unique(bug_id, cf_id),
+ index (cf_id)";
# User regexp is which email addresses are put into this group.
#
@@ -2842,6 +2904,18 @@
$dbh->do('ALTER TABLE longdescs ADD INDEX (who)');
}
+# 2002-10-02 mm2@axlog.fr - bug 91037
+# for compatibility.
+if (&TableExists('customfields')) {
+ RenameField ('customfields', 'valexp', 'valid_exp');
+ AddField('customfields', 'default_value', "mediumtext not null");
+ AddField('customfields', 'mandatory', 'tinyint not null');
+}
+if (&TableExists('products_customfields')) {
+ AddField('products_customfields', 'position', 'int(2) not null');
+}
+
+
# 2001-06-15 kiko@async.com.br - Change bug:version size to avoid
# truncates re http://bugzilla.mozilla.org/show_bug.cgi?id=9352
ChangeFieldType('bugs', 'version','varchar(64) not null');
@@ -2939,7 +3013,6 @@
# using the attachment manager can record changes to attachments.
AddField("bugs_activity", "attach_id", "mediumint null");
-# 2002-02-04 bbaetz@student.usyd.edu.au bug 95732
# Remove logincookies.cryptpassword, and delete entries which become
# invalid
if (GetFieldDef("logincookies", "cryptpassword")) {
@@ -2991,6 +3064,18 @@
AddField("logincookies", "ipaddr", "varchar(40) NOT NULL");
}
+# 2002-10-02 mm2@axlog.fr - bug 91037
+# for compatibility.
+if (&TableExists('customfields')) {
+ RenameField ('customfields', 'valexp', 'valid_exp');
+ AddField('customfields', 'default_value', "mediumtext not null");
+ AddField('customfields', 'mandatory', 'tinyint not null');
+}
+if (&TableExists('products_customfields')) {
+ AddField('products_customfields', 'position', 'int(2) not null');
+}
+
+
# 2002-08-19 - bugreport@peshkin.net bug 143826
# Add private comments and private attachments on less-private bugs
AddField('longdescs', 'isprivate', 'tinyint not null default 0');
@@ -3046,6 +3131,7 @@
AddField("milestones", "product_id", "smallint not null");
AddField("bugs", "product_id", "smallint not null");
AddField("attachstatusdefs", "product_id", "smallint not null");
+ AddField("products_customfields", "product_id", "smallint not null");
my %products;
my $sth = $dbh->prepare("SELECT id, product FROM products");
$sth->execute;
@@ -3066,6 +3152,8 @@
"WHERE product = " . $dbh->quote($product));
$dbh->do("UPDATE attachstatusdefs SET product_id = $product_id " .
"WHERE product = " . $dbh->quote($product));
+ $dbh->do("UPDATE products_customfields SET product_id = $product_id " .
+ "WHERE product = " . $dbh->quote($product));
}
print "Updating the database to use component IDs.\n";
@@ -3096,6 +3184,7 @@
$dbh->do("ALTER TABLE bugs ADD INDEX (product_id)");
$dbh->do("ALTER TABLE bugs DROP INDEX component");
$dbh->do("ALTER TABLE bugs ADD INDEX (component_id)");
+ $dbh->do("ALTER TABLE products_customfields ADD INDEX (product_id)");
print "Removing, renaming, and retyping old product and component fields.\n";
DropField("components", "program");
@@ -3104,6 +3193,7 @@
DropField("bugs", "product");
DropField("bugs", "component");
DropField("attachstatusdefs", "product");
+ DropField("products_customfields", "product");
RenameField("products", "product", "name");
ChangeFieldType("products", "name", "varchar(64) not null");
RenameField("components", "value", "name");
diff -u -N -r bugzilla2174/colchange.cgi bugzilla2174_cf/colchange.cgi
--- bugzilla2174/colchange.cgi 2003-09-16 12:04:21.111916000 +0200
+++ bugzilla2174_cf/colchange.cgi 2003-09-15 18:55:03.382085000 +0200
@@ -68,6 +68,11 @@
push(@masterlist, ("short_desc", "short_short_desc"));
+SendSQL("select name from customfields order by name");
+while (my @row = FetchSQLData()) {
+ push(@masterlist, $row[0]);
+}
+
$vars->{'masterlist'} = \@masterlist;
my @collist;
@@ -78,7 +83,8 @@
} else {
foreach my $i (@masterlist) {
if (defined $::FORM{"column_$i"}) {
- push @collist, $i;
+ # this allows spaces in customfields for the space-delimited COLUMNLIST cookie.
+ push @collist, url_quote($i);
}
}
if (exists $::FORM{'splitheader'}) {
@@ -100,7 +106,9 @@
}
if (defined $::COOKIE{'COLUMNLIST'}) {
- @collist = split(/ /, $::COOKIE{'COLUMNLIST'});
+ foreach(split(/ /, ($::COOKIE{'COLUMNLIST'}))) {
+ push @collist, url_decode($_);
+ }
} else {
@collist = @::default_column_list;
}
diff -u -N -r bugzilla2174/contrib/bug_email.pl bugzilla2174_cf/contrib/bug_email.pl
--- bugzilla2174/contrib/bug_email.pl 2003-09-16 12:04:21.761926000 +0200
+++ bugzilla2174_cf/contrib/bug_email.pl 2003-09-16 11:41:26.320559000 +0200
@@ -83,6 +83,10 @@
my $Header = "";
my @RequiredLabels = ();
my @AllowedLabels = ();
+my @AllowedCustomLabels = ();
+my @used_customfields;
+my $used_customfields_no=0;
+my %CustomFieldsIds = ();
my $Body = "";
my @attachments = ();
@@ -220,7 +224,7 @@
}
###############################################################
-# Check if component is valid for product.
+# Check if version is valid for product.
sub CheckVersion {
my $Product = shift;
my $Version = shift;
@@ -637,7 +641,7 @@
my $body = $entity->bodyhandle;
my ($data, $on_disk );
- if( $msg_part =~ /^attachment/ ) {
+ if( $msg_part =~ /^attachment/ || $msg_part =~ /^inline/ ) {
# Attached File
my $des = $entity->head->get('Content-Description');
$des ||= $entity->head->recommended_filename;
@@ -799,11 +803,42 @@
"bug_status", "bug_file_loc", "short_desc", "component",
"status_whiteboard", "target_milestone", "groupset",
"qa_contact");
-#my @AllowedLabels = qw{Summary priority platform assign};
+
+# Add customfields defined for given product to AllowedLabels
+SendSQL( "select cf_id,name from products_customfields pc, customfields c where product=".SqlQuote($Control{'product'})." AND c.id=pc.cf_id");
+my ($cf_id, $cname);
+while ( ($cf_id, $cname) = FetchSQLData())
+{
+ $cname = lc($cname);
+ push @AllowedCustomLabels, $cname;
+ $CustomFieldsIds{ $cname } = $cf_id;
+ print "$cname: id[$cname]=$cf_id\n";
+}
+
+sub IsCustom {
+ my ($list,$item) = @_;
+
+ foreach my $i (@$list) {
+ if ( uc($i) eq uc($item) ) {
+ return 1;
+ }
+ }
+ return 0;
+}
+
foreach (keys %Control) {
- if ( lsearch( \@AllowedLabels, $_) < 0 ) {
+ if ( lsearch( \@AllowedLabels, $_) < 0 )
+ {
+ if (IsCustom(\@AllowedCustomLabels, $_))
+ {
+ push (@used_customfields, $_);
+ $used_customfields_no++;
+ }
+ else
+ {
BugMailError( 0, "You sent a unknown label: " . $_ );
}
+ }
}
push( @AllowedLabels, "reporter" );
@@ -1017,18 +1052,19 @@
#
my $GroupSet = "";
$GroupSet = $Control{'groupset'} if( defined( $Control{ 'groupset' }));
+
#
# Fetch the default value for groupsetting
-SendSQL("select bit from groups where name=" . SqlQuote( "ReadInternal" ));
-my $default_group = FetchOneColumn();
+#SendSQL("select bit from groups where name=" . SqlQuote( "ReadInternal" ));
+my $default_group = 0; # This has to be checked and changed if needed.
if( $GroupSet eq "" ) {
# To bad: Groupset does not contain anything -> set to default
$GroupSet = $default_group;
- #
+
# Give the user a hint
my $Text = "You did not send a value for optional key \@groupset, which controls\n";
- $Text .= "the Permissions of the bug. It was set to a default value 'Internal Bug'\n";
+ $Text .= "the Permissions of the bug. It was set to a default value\n";
$Text .= "Probably the QA will change that if desired.\n";
BugMailError( 0, $Text );
@@ -1149,9 +1185,13 @@
my @used_fields;
foreach my $f (@AllowedLabels) {
- if ((exists $Control{$f}) && ($Control{$f} !~ /^\s*$/ )) {
+ if (exists $Control{$f}) {
+ if ($Control{$f} !~ /^\s*$/ ) {
+ if ( !IsCustom( \@AllowedCustomLabels, $f)) {
push (@used_fields, $f);
}
+ }
+ }
}
#
@@ -1245,6 +1285,22 @@
my $long_desc_query = "INSERT INTO longdescs SET bug_id=$id, who=$userid, bug_when=\'$bug_when\', thetext=" . SqlQuote($comment);
SendSQL($long_desc_query);
+ # insert custom fields
+ my ($fieldslist);
+
+ if ( $used_customfields_no > 0 ) {
+ $tmp_reply .= "\n\tYou sent $used_customfields_no custom field(s). \n";
+ }
+ else
+ {
+ $tmp_reply .= "No customfields.\n";
+ }
+
+ foreach my $field (@used_customfields) {
+ $tmp_reply .= sprintf( " \@%-15s = %-15s\n", $field, $Control{$field} );
+ SendSQL("INSERT into bugs_customfields set cf_id=".$CustomFieldsIds{ $field }.", value=".SqlQuote($Control{$field}).",bug_id=$id");
+ }
+
# Cool, the mail was successful
system("./processmail", $id, $SenderShort);
} else {
diff -u -N -r bugzilla2174/defparams.pl bugzilla2174_cf/defparams.pl
--- bugzilla2174/defparams.pl 2003-09-16 12:04:22.641913000 +0200
+++ bugzilla2174_cf/defparams.pl 2003-09-15 19:08:39.691540000 +0200
@@ -1049,6 +1049,13 @@
default => 1,
},
+ {
+ name => 'usecustomfields',
+ desc => 'Do you wish to use custom fields',
+ type => 'b',
+ default => 0
+ },
+
);
1;
diff -u -N -r bugzilla2174/editcustomfields.cgi bugzilla2174_cf/editcustomfields.cgi
--- bugzilla2174/editcustomfields.cgi 1970-01-01 01:00:00.000000000 +0100
+++ bugzilla2174_cf/editcustomfields.cgi 2003-09-16 11:17:31.523029000 +0200
@@ -0,0 +1,310 @@
+#!/usr/bonsaitools/bin/perl -wT
+# -*- Mde: perl; indent-tabs-mode: nil -*-
+#
+# View/Edit/Delete customfields as described in Bugzilla bug no. 91037
+#
+# Contributor: Maciej Maczynski
+
+
+
+ [% END %]
+ [% i=i+1 %]
+
+ [% END %]
+
+ [% ELSIF c.type == "single" %]
+ [% IF i==0 %]
+
+ [% IF i==2 %]
+ [% i=0 %]
+
+
+
+
+ [% END %]
+ [% i=i+1 %]
+
+ [% END %]
+
+ [% ELSIF c.type=="multi" %]
+ [% IF i==0 %]
+
+ [% c.name FILTER html %]:
+
+
+
+
+ [% IF i==2 %]
+ [% i=0 %]
+
+
+
+
+ [% END %]
+ [% i=i+1 %]
+
+ [% END %]
+
+ [% ELSIF c.type=="any" %]
+ [% IF i==0 %]
+
+ [% c.name FILTER html %]:
+
+
+
+
+ [% IF i==2 %]
+ [% i=0 %]
+
+
+
+
+ [% END %]
+ [% i=i+1 %]
+
+ [% END %]
+ [% END %]
+ [% END %]
+[% END %]
+
+
+ [% c.name FILTER html %]:
+
+
+
+
+
+ [% IF i==2 %]
+ [% i=0 %]
+
+
+[% IF Param("usecustomfields") %]
+ [% i=0 %]
+ [% FOREACH c = customfield %]
+ [% IF c.type == "empty" %]
+ [% IF i==0 %]
+
@@ -258,7 +355,16 @@
+ return false; }
+
+ [% FOREACH c=customfield %]
+ [% IF c.mandatory == 1 %]
+ if (this.form.[% c.name %].value == '' )
+ { alert('Please enter a value for the [% c.name %] field.');
+ return false; }
+ [% END %]
+ [% END %]
+ return true;">
diff -u -N -r bugzilla2174/template/en/default/bug/edit.html.tmpl bugzilla2174_cf/template/en/default/bug/edit.html.tmpl
--- bugzilla2174/template/en/default/bug/edit.html.tmpl 2003-04-09 11:29:19.000000000 +0200
+++ bugzilla2174_cf/template/en/default/bug/edit.html.tmpl 2003-09-15 19:05:20.071537000 +0200
@@ -174,6 +174,89 @@
[% PROCESS select selname = "bug_severity" accesskey => "e" %]
+ [% END %]
+ [% i=i+1 %]
+
+ [% END %]
++
+ [% ELSIF c.type == "single" %]
+ [% IF i==0 %]
+
+ [% IF i==2 %]
+ [% i=0 %]
+
+ [% END %]
+ [% i=i+1 %]
+
+ [% END %]
++
+ [% ELSIF c.type=="multi" %]
+ [% IF i==0 %]
+
+ [% c.name FILTER html %]:
+
+
+
+
+ [% IF i==2 %]
+ [% i=0 %]
+
+ [% END %]
+ [% i=i+1 %]
+
+ [% END %]
+ [% ELSIF c.type=="any" %]
+ [% IF i==0 %]
+
+ [% c.name FILTER html %]:
+
+
+
+
+
+ [% IF i==2 %]
+ [% i=0 %]
+
+ [% END %]
+ [% i=i+1 %]
+
+[% END %]
+
+ [% c.name FILTER html %]:
+
+
+
+
+
+
+ [% IF i==2 %]
+ [% i=0 %]
+ [% END %]
+ [% END %]
+ [% END %]
+
-
+
diff -u -N -r bugzilla2174/template/en/default/bug/show-multiple.html.tmpl bugzilla2174_cf/template/en/default/bug/show-multiple.html.tmpl
--- bugzilla2174/template/en/default/bug/show-multiple.html.tmpl 2003-04-24 22:49:39.000000000 +0200
+++ bugzilla2174_cf/template/en/default/bug/show-multiple.html.tmpl 2003-09-15 19:01:15.761536000 +0200
@@ -88,7 +88,12 @@
name => "qa_contact" } %]
[% END %]
+ [% FOREACH c= bug.customfield %]
+ [% PROCESS cell attr = { description => c,
+ name => c } %]
+ [% END %]
+
Component:
diff -u -N -r bugzilla2174/template/en/default/bug/show.html.tmpl bugzilla2174_cf/template/en/default/bug/show.html.tmpl
--- bugzilla2174/template/en/default/bug/show.html.tmpl 2002-12-15 10:24:08.000000000 +0100
+++ bugzilla2174_cf/template/en/default/bug/show.html.tmpl 2003-09-15 18:55:53.872085000 +0200
@@ -23,6 +23,7 @@
[%# This script/template only handles one bug #%]
[% bug = bugs.0 %]
+[% customfield = bug.customfield %]
[% filtered_desc = bug.short_desc FILTER html %]
[% filtered_timestamp = bug.delta_ts FILTER time %]
diff -u -N -r bugzilla2174/template/en/default/customfields/customfields.html.tmpl bugzilla2174_cf/template/en/default/customfields/customfields.html.tmpl
--- bugzilla2174/template/en/default/customfields/customfields.html.tmpl 1970-01-01 01:00:00.000000000 +0100
+++ bugzilla2174_cf/template/en/default/customfields/customfields.html.tmpl 2003-09-15 19:24:22.671532000 +0200
@@ -0,0 +1,53 @@
+[%#
+# Contributor(s): Maciej Maczynski
+[% count %] [%IF count==1%]bug uses[% ELSE %] bugs use[% END %] this keyword!
+
+
+[% ELSIF action=="do_delete" %]
+
Custom field '[% name %]' deleted
+Back to the customfields page
+[% END %]
+[% PROCESS global/footer.html.tmpl %]
+
diff -u -N -r bugzilla2174/template/en/default/customfields/editcustomfields.html.tmpl bugzilla2174_cf/template/en/default/customfields/editcustomfields.html.tmpl
--- bugzilla2174/template/en/default/customfields/editcustomfields.html.tmpl 1970-01-01 01:00:00.000000000 +0100
+++ bugzilla2174_cf/template/en/default/customfields/editcustomfields.html.tmpl 2003-09-15 19:24:22.681541000 +0200
@@ -0,0 +1,88 @@
+[%#
+# Contributors: Maciej Maczynski
+
+
+
+
+
+
+[% PROCESS global/footer.html.tmpl %]
diff -u -N -r bugzilla2174/template/en/default/customfields/error_customfields.html.tmpl bugzilla2174_cf/template/en/default/customfields/error_customfields.html.tmpl
--- bugzilla2174/template/en/default/customfields/error_customfields.html.tmpl 1970-01-01 01:00:00.000000000 +0100
+++ bugzilla2174_cf/template/en/default/customfields/error_customfields.html.tmpl 2003-09-15 19:24:22.681549000 +0200
@@ -0,0 +1,15 @@
+[%#
+# Contributor: Matthieu Montagne
+
Two custom fields have the same position !
+Back to the Position page
+[% ELSIF error == "name" %]
+
The name you provided for this custom field is not allowed or already exists
+Back to the customfields page
+[% END %]
+[% PROCESS global/footer.html.tmpl %]
diff -u -N -r bugzilla2174/template/en/default/customfields/new_customfields.html.tmpl bugzilla2174_cf/template/en/default/customfields/new_customfields.html.tmpl
--- bugzilla2174/template/en/default/customfields/new_customfields.html.tmpl 1970-01-01 01:00:00.000000000 +0100
+++ bugzilla2174_cf/template/en/default/customfields/new_customfields.html.tmpl 2003-09-15 19:24:22.681553000 +0200
@@ -0,0 +1,13 @@
+[%#
+# Contributor: Maciej Maczynski
Custom field '[% fieldname %]' added
+Back to the customfields page
+[% PROCESS global/footer.html.tmpl %]
+
+
diff -u -N -r bugzilla2174/template/en/default/customfields/update_customfields.html.tmpl bugzilla2174_cf/template/en/default/customfields/update_customfields.html.tmpl
--- bugzilla2174/template/en/default/customfields/update_customfields.html.tmpl 1970-01-01 01:00:00.000000000 +0100
+++ bugzilla2174_cf/template/en/default/customfields/update_customfields.html.tmpl 2003-09-15 19:24:22.681557000 +0200
@@ -0,0 +1,13 @@
+[%#
+# Contributor: Maciej Maczynski
Custom field '[% fieldname %]' changed
+Back to the customfields page
+[% PROCESS global/footer.html.tmpl %]
+
+
diff -u -N -r bugzilla2174/template/en/default/customfields/update_position.html.tmpl bugzilla2174_cf/template/en/default/customfields/update_position.html.tmpl
--- bugzilla2174/template/en/default/customfields/update_position.html.tmpl 1970-01-01 01:00:00.000000000 +0100
+++ bugzilla2174_cf/template/en/default/customfields/update_position.html.tmpl 2003-09-15 19:24:22.681561000 +0200
@@ -0,0 +1,10 @@
+[%#
+# Contributor: Matthieu Montagne
Positions changed
+Back to the position page or to the customfields page
+[% PROCESS global/footer.html.tmpl %]
diff -u -N -r bugzilla2174/template/en/default/global/useful-links.html.tmpl bugzilla2174_cf/template/en/default/global/useful-links.html.tmpl
--- bugzilla2174/template/en/default/global/useful-links.html.tmpl 2002-12-09 01:24:43.000000000 +0100
+++ bugzilla2174_cf/template/en/default/global/useful-links.html.tmpl 2003-09-15 18:56:10.132090000 +0200
@@ -81,6 +81,8 @@
IF user.groups.creategroups %]
[% ', keywords'
IF user.groups.editkeywords %]
+ [% ', custom fields'
+ IF user.groups.tweakparams && Param('usecustomfields') %]
[% ' | Sanity check'
IF user.groups.tweakparams %]