[freeside-commits] freeside/rt/lib/RT CustomField.pm, 1.2.2.2, 1.2.2.3 CustomField_Vendor.pm, NONE, 1.1.2.1 Ticket_Vendor.pm, NONE, 1.1.2.2
Mark Wells
mark at wavetail.420.am
Tue May 31 16:12:39 PDT 2011
Update of /home/cvs/cvsroot/freeside/rt/lib/RT
In directory wavetail.420.am:/tmp/cvs-serv17802/lib/RT
Modified Files:
Tag: FREESIDE_2_1_BRANCH
CustomField.pm
Added Files:
Tag: FREESIDE_2_1_BRANCH
CustomField_Vendor.pm Ticket_Vendor.pm
Log Message:
improve mandatory fields, #9260
Index: CustomField.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/rt/lib/RT/CustomField.pm,v
retrieving revision 1.2.2.2
retrieving revision 1.2.2.3
diff -u -w -d -r1.2.2.2 -r1.2.2.3
--- CustomField.pm 19 Apr 2011 00:23:56 -0000 1.2.2.2
+++ CustomField.pm 31 May 2011 23:12:37 -0000 1.2.2.3
@@ -122,7 +122,6 @@
Disabled => '0',
LinkToValue => '',
IncludeContentForValue => '',
- Required => '0',
@_);
$self->SUPER::Create(
@@ -382,9 +381,6 @@
{read => 1, auto => 1, sql_type => 11, length => 0, is_blob => 0, is_numeric => 0, type => 'datetime', default => ''},
Disabled =>
{read => 1, write => 1, sql_type => 5, length => 6, is_blob => 0, is_numeric => 1, type => 'smallint(6)', default => '0'},
- Required =>
- {read => 1, write => 1, sql_type => 5, length => 6, is_blob => 0, is_numeric => 1, type => 'smallint(6)', default => '0'},
-
}
};
--- NEW FILE: CustomField_Vendor.pm ---
package RT::CustomField;
use strict;
no warnings 'redefine';
sub _VendorAccessible {
{
Required =>
{read => 1, write => 1, sql_type => 5, length => 6, is_blob => 0, is_numeric => 1, type => 'smallint(6)', default => '0'},
},
};
1;
--- NEW FILE: Ticket_Vendor.pm ---
#!/usr/bin/perl
package RT::Ticket;
use strict;
=head2 MissingRequiredFields
Return all custom fields with the Required flag set for which this object
doesn't have any non-empty values.
=cut
sub MissingRequiredFields {
my $self = shift;
my $CustomFields = $self->CustomFields;
my @results;
while ( my $CF = $CustomFields->Next ) {
next if !$CF->Required;
if ( !length($self->FirstCustomFieldValue($CF->Id) || '') ) {
push @results, $CF;
}
}
return @results;
}
1;
More information about the freeside-commits
mailing list