[Rt-commit] rt branch, ip-customfields, updated. rt-3.8.8-654-g082373d
? sunnavy
sunnavy at bestpractical.com
Thu Sep 2 06:57:14 EDT 2010
The branch, ip-customfields has been updated
via 082373ddf7c2124515242672407e27c124fa7171 (commit)
via f5ba076e3c959f57eb9d63b8312b084ad023095e (commit)
from b06d221ef5a9ff4dc16c4a05dbcb7e8aa8c96742 (commit)
Summary of changes:
lib/RT/CustomField_Overlay.pm | 29 -----------------------------
lib/RT/ObjectCustomFieldValue_Overlay.pm | 30 ++++++++++++++++++++++++++++++
lib/RT/Test/Web.pm | 2 +-
3 files changed, 31 insertions(+), 30 deletions(-)
- Log -----------------------------------------------------------------
commit f5ba076e3c959f57eb9d63b8312b084ad023095e
Author: sunnavy <sunnavy at bestpractical.com>
Date: Thu Sep 2 12:34:33 2010 +0800
tiny fix
diff --git a/lib/RT/Test/Web.pm b/lib/RT/Test/Web.pm
index 5761f7c..f8f8f6e 100644
--- a/lib/RT/Test/Web.pm
+++ b/lib/RT/Test/Web.pm
@@ -152,7 +152,7 @@ sub goto_create_ticket {
die "not yet implemented";
}
- $self->get($self->rt_base_url . '/Ticket/Create.html?Queue='.$id);
+ $self->get($self->rt_base_url . 'Ticket/Create.html?Queue='.$id);
return 1;
}
commit 082373ddf7c2124515242672407e27c124fa7171
Author: sunnavy <sunnavy at bestpractical.com>
Date: Thu Sep 2 12:35:16 2010 +0800
ParseIPRange should be in ObjectCustomFieldValue
diff --git a/lib/RT/CustomField_Overlay.pm b/lib/RT/CustomField_Overlay.pm
index c327336..30c3351 100755
--- a/lib/RT/CustomField_Overlay.pm
+++ b/lib/RT/CustomField_Overlay.pm
@@ -54,10 +54,6 @@ no warnings qw(redefine);
use RT::CustomFieldValues;
use RT::ObjectCustomFields;
use RT::ObjectCustomFieldValues;
-use Regexp::Common qw(RE_net_IPv4);
-use Regexp::Common::net::CIDR;
-require Net::CIDR;
-
our %FieldTypes = (
Select => {
@@ -1634,29 +1630,4 @@ sub BasedOnObj {
return $obj;
}
-sub ParseIPRange {
- my $self = shift;
- my $arg = shift or return ();
-
- if ( $arg =~ /^\s*$RE{net}{CIDR}{IPv4}{-keep}\s*$/go ) {
- my $cidr = join( '.', map $_||0, (split /\./, $1)[0..3] ) ."/$2";
- $arg = (Net::CIDR::cidr2range( $cidr ))[0] || $arg;
- }
-
- my ($sIP, $eIP);
- if ( $arg =~ /^\s*($RE{net}{IPv4})\s*$/o ) {
- $sIP = $eIP = sprintf "%03d.%03d.%03d.%03d", split /\./, $1;
- }
- elsif ( $arg =~ /^\s*($RE{net}{IPv4})-($RE{net}{IPv4})\s*$/o ) {
- $sIP = sprintf "%03d.%03d.%03d.%03d", split /\./, $1;
- $eIP = sprintf "%03d.%03d.%03d.%03d", split /\./, $2;
- }
- else {
- return ();
- }
- ($sIP, $eIP) = ($eIP, $sIP) if $sIP gt $eIP;
-
- return $sIP, $eIP;
-}
-
1;
diff --git a/lib/RT/ObjectCustomFieldValue_Overlay.pm b/lib/RT/ObjectCustomFieldValue_Overlay.pm
index 967ac47..1797fc7 100644
--- a/lib/RT/ObjectCustomFieldValue_Overlay.pm
+++ b/lib/RT/ObjectCustomFieldValue_Overlay.pm
@@ -51,6 +51,10 @@ package RT::ObjectCustomFieldValue;
use strict;
use warnings;
use RT::Interface::Web;
+use Regexp::Common qw(RE_net_IPv4);
+use Regexp::Common::net::CIDR;
+require Net::CIDR;
+
no warnings qw(redefine);
@@ -364,4 +368,30 @@ sub IncludeContentForValue {
return $self->_FillInTemplateURL($self->CustomFieldObj->IncludeContentForValue);
}
+
+sub ParseIPRange {
+ my $self = shift;
+ my $arg = shift or return ();
+
+ if ( $arg =~ /^\s*$RE{net}{CIDR}{IPv4}{-keep}\s*$/go ) {
+ my $cidr = join( '.', map $_||0, (split /\./, $1)[0..3] ) ."/$2";
+ $arg = (Net::CIDR::cidr2range( $cidr ))[0] || $arg;
+ }
+
+ my ($sIP, $eIP);
+ if ( $arg =~ /^\s*($RE{net}{IPv4})\s*$/o ) {
+ $sIP = $eIP = sprintf "%03d.%03d.%03d.%03d", split /\./, $1;
+ }
+ elsif ( $arg =~ /^\s*($RE{net}{IPv4})-($RE{net}{IPv4})\s*$/o ) {
+ $sIP = sprintf "%03d.%03d.%03d.%03d", split /\./, $1;
+ $eIP = sprintf "%03d.%03d.%03d.%03d", split /\./, $2;
+ }
+ else {
+ return ();
+ }
+ ($sIP, $eIP) = ($eIP, $sIP) if $sIP gt $eIP;
+
+ return $sIP, $eIP;
+}
+
1;
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list