From cd193cad650ed708d4cfd7c770e478f7d0e03dcb Mon Sep 17 00:00:00 2001 From: Daniel Tiefnig Date: Tue, 9 Jun 2009 03:35:14 +0000 Subject: [PATCH] merged branch with changes from trunk: fixed billing fees search for zone detail added support for regex in billing fee destinations implemented checkbox to search for terminated subscribers added version string to footer, updated copyright notice added sipwise logo from new inkscape source added "local" flag for domains reworked domain form layout and added tooltips allow removal of subscriber number added Catalyst::Plugin::Unicode to handle UTF-8 data on in-/output added ENCODING to TT Views to tell TT that templates are stored in UTF-8 --- lib/admin.pm | 2 +- lib/admin/Controller/billing.pm | 31 ++++++++---- lib/admin/Controller/domain.pm | 4 ++ lib/admin/Controller/subscriber.pm | 7 +++ lib/admin/View/Sipwise.pm | 1 + root/css/admin.css | 19 +++++++- root/layout/footer | 5 +- root/static/images/sipwise_logo_96.png | Bin 2959 -> 3399 bytes root/tt/billing_fees.tt | 8 ++-- root/tt/domain.tt | 63 ++++++++++++++++++------- root/tt/subscriber.tt | 9 +++- 11 files changed, 110 insertions(+), 39 deletions(-) diff --git a/lib/admin.pm b/lib/admin.pm index 628b702..5522732 100644 --- a/lib/admin.pm +++ b/lib/admin.pm @@ -16,7 +16,7 @@ use XML::Simple; use Catalyst::Log::Log4perl; -use Catalyst qw/-Debug ConfigLoader Static::Simple +use Catalyst qw/-Debug ConfigLoader Static::Simple Unicode Authentication Authentication::Store::Minimal Authentication::Credential::Password Session Session::Store::FastMmap Session::State::Cookie /; diff --git a/lib/admin/Controller/billing.pm b/lib/admin/Controller/billing.pm index 4fd65a8..b67f302 100644 --- a/lib/admin/Controller/billing.pm +++ b/lib/admin/Controller/billing.pm @@ -490,7 +490,8 @@ sub set_fees : Local { last; } @keyval{@elements} = @values; - $keyval{destination} = $self->_normalize_destination($c, $keyval{destination}); + $keyval{destination} = $self->_normalize_destination($c, $keyval{destination}) || $keyval{destination} + if length $keyval{destination}; unless(defined $keyval{destination}) { $messages{feeerr} = 'Web.Fees.InvalidDestination'; $c->session->{feeerr}{line} = $line; @@ -534,8 +535,8 @@ sub edit_fee : Local { my $destination = $c->stash->{destination} = $c->request->params->{destination}; $c->stash->{offset} = $c->request->params->{offset} || 0; - $destination = $self->_normalize_destination($c, $destination) - if defined $destination; + $destination = $self->_normalize_destination($c, $destination) || $destination + if length $destination; if(ref $c->session->{restore_fee_input} eq 'HASH') { $c->stash->{fee} = $c->session->{restore_fee_input}; @@ -580,10 +581,12 @@ sub do_edit_fee : Local { my $bilprof = $c->request->params->{bilprof}; my $offset = $c->request->params->{offset}; $settings{destination} = $c->request->params->{destination}; - $settings{destination} = $self->_normalize_destination($c, $settings{destination}) - if defined $settings{destination}; + $settings{destination} = $self->_normalize_destination($c, $settings{destination}) || $settings{destination} + if length $settings{destination}; if(defined $c->request->params->{new_destination}) { - $settings{destination} = $self->_normalize_destination($c, $c->request->params->{new_destination}); + $settings{destination} = $self->_normalize_destination($c, $c->request->params->{new_destination}) + || $c->request->params->{new_destination} + if length $c->request->params->{new_destination}; unless(defined $settings{destination}) { $messages{destination} = 'Web.Fees.InvalidDestination'; } @@ -638,7 +641,7 @@ sub do_delete_fee : Local { my $destination = $c->request->params->{destination}; my $offset = $c->request->params->{offset}; - $destination = $self->_normalize_destination($c, $destination); + $destination = $self->_normalize_destination($c, $destination) || $destination; if($c->model('Provisioning')->call_prov( $c, 'billing', 'set_billing_profile_fees', { handle => $bilprof, @@ -860,15 +863,18 @@ sub _normalize_destination : Private { my ($self, $c, $destination) = @_; if($destination =~ /^\d+$/) { + # E.164 number $destination = '^' . $destination . '.*$'; } elsif($destination =~ /^(?:[a-z0-9]+(?:-[a-z0-9]+)*\.)+[a-z]+$/i - or $destination =~ /^[\d.]+$/) + or $destination =~ /^[012]?[0-9]?[0-9](?:\.[012]?[0-9]?[0-9]){3}$/) { + # domain or IP address $destination =~ s/\./\\./g; $destination = '^.*@'. $destination .'$'; } elsif($destination =~ /^.+\@(?:[a-z0-9]+(?:-[a-z0-9]+)*\.)+[a-z]+$/i - or $destination =~ /^.+\@[\d.]+$/) + or $destination =~ /^.+\@[012]?[0-9]?[0-9](?:\.[012]?[0-9]?[0-9]){3}$/) { + # SIP URI $destination =~ s/\./\\./g; $destination = '^'. $destination .'$'; } else { @@ -881,13 +887,18 @@ sub _normalize_destination : Private { sub _denormalize_destination : Private { my ($self, $c, $destination) = @_; + my $backup = $destination; $destination =~ s/\\\././g; $destination =~ s/\$$//; $destination =~ s/^\^//; $destination =~ s/\.\*$//; $destination =~ s/^\.\*\@//; - return $destination; + if(defined $self->_normalize_destination($c, $destination)) { + return $destination; + } else { + return $backup; + } } diff --git a/lib/admin/Controller/domain.pm b/lib/admin/Controller/domain.pm index 7890a37..ca83a04 100644 --- a/lib/admin/Controller/domain.pm +++ b/lib/admin/Controller/domain.pm @@ -63,6 +63,8 @@ sub do_edit_domain : Local { my $domain = $c->request->params->{domain}; + $settings{local} = $c->request->params->{local} ? 1 : 0; + $settings{cc} = $c->request->params->{cc}; $messages{ecc} = 'Client.Voip.MalformedCc' unless $settings{cc} =~ /^\d+$/; @@ -108,6 +110,8 @@ sub do_create_domain : Local { my $domain = $c->request->params->{domain}; + $settings{local} = $c->request->params->{local} ? 1 : 0; + $settings{cc} = $c->request->params->{cc}; $messages{acc} = 'Client.Voip.MalformedCc' unless $settings{cc} =~ /^\d+$/; diff --git a/lib/admin/Controller/subscriber.pm b/lib/admin/Controller/subscriber.pm index bd5ffff..d6de21b 100644 --- a/lib/admin/Controller/subscriber.pm +++ b/lib/admin/Controller/subscriber.pm @@ -55,6 +55,7 @@ sub search : Local { $exact{$sf} = 1 if $c->request->params->{'exact_'.$sf}; } } + $filter{terminated} = 1 if $c->request->params->{terminated}; $c->session->{search_filter} = { %filter }; $c->session->{exact_filter} = { %exact }; } @@ -74,6 +75,7 @@ sub search : Local { $filter{$sf} =~ s/\%*$/\%/; } } + $c->stash->{terminated} = $filter{terminated}; my $offset = $c->request->params->{offset} || 0; $offset = 0 if $offset !~ /^\d+$/; @@ -355,7 +357,12 @@ sub update_subscriber : Local { $messages{number_sn} = 'Client.Voip.MalformedSn' unless $sn =~ /^[1-9][0-9]+$/; } + } else { + $settings{cc} = undef; + $settings{ac} = undef; + $settings{sn} = undef; } + my $timezone = $c->request->params->{timezone}; if(length $timezone) { $settings{timezone} = $timezone; diff --git a/lib/admin/View/Sipwise.pm b/lib/admin/View/Sipwise.pm index cb3e225..dc7d001 100644 --- a/lib/admin/View/Sipwise.pm +++ b/lib/admin/View/Sipwise.pm @@ -35,6 +35,7 @@ __PACKAGE__->config( }, }, }, + ENCODING => 'utf-8', ); =head1 BUGS AND LIMITATIONS diff --git a/root/css/admin.css b/root/css/admin.css index 3699f74..8e64396 100644 --- a/root/css/admin.css +++ b/root/css/admin.css @@ -252,11 +252,21 @@ h3 { width: 95px; } -/* decrease input text fields for cc/ac */ +/* decrease input text fields */ +.imedium { + width: 140px; +} + +/* decrease input text fields for ac */ .ishort { width: 50px; } +/* decrease input text fields for cc */ +.irealshort { + width: 30px; +} + /* increase spacing between password and show/hide href */ #contentplace .apass { vertical-align: middle; @@ -312,7 +322,8 @@ h3 { #contentplace .order_payments, #contentplace .registered_contacts, #contentplace .billing_fees, -#contentplace .billing_peaktimes +#contentplace .billing_peaktimes, +#contentplace .domains { width: 100%; border-spacing: 0px; @@ -356,3 +367,7 @@ h3 { #contentplace .padding6 { padding: 6px; } + +.topbottomspace { + margin: 5px 0; +} diff --git a/root/layout/footer b/root/layout/footer index 9315ddd..83798a2 100644 --- a/root/layout/footer +++ b/root/layout/footer @@ -1,6 +1,7 @@ diff --git a/root/static/images/sipwise_logo_96.png b/root/static/images/sipwise_logo_96.png index 24174ba33e324ae35a957472cc5924f7b3d411e5..0199cfed9670a235d15bc7e077a2302e24bb1eb1 100644 GIT binary patch literal 3399 zcmV-N4Y=}&P)Px#32;bRa{vGh*8l(w*8xH(n|J^K00(qQO+^RU1r-h}GnM>)?*IS{*-1n}RA}Dq zT6<7aR~r9v31|X|fj|fW!YfLEAR#GPbK-r`9?< zoxWHVtAdE_I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F*3 zLZMKpR3Zoh00$2qEG;c9DJe-M%83&vnCEaf+}hge^Z5W^XlSURp#cCWied_+YIm7p z@W5c_r=5q+9Ewk5)IrywE#)opP4f5!9sg0j=vSguc81>>PP*tLF|vqhK02MQrlw{M zHY7Cm% zc{m+A(v4Cc%1fG6Boqp1jhdUA9S(<7Dg^*8ms?s|nlx;u3A$rKTsN$)uEuekqNvi+ z(!9RA1@}yM`ojHVX5ayM5f~eVELrYeq(P$c=d4rC~RnGNOd95Xf)E@KRphdFe)J{O%>X4rPK@5dfels@Ln|hp^7h&i(uM1AyP}_xXH6p)ga5k;wf) zlpX|=B7V~^e#rlsoiqmHq){X0 z-Fy3xpTvY4SVNv>ql2AqVYgD$S&Eg_?3bEJNxx-ua`Yn zM&DG7L?Z)V4Xld#+()?bP4dKPHvo9=cr8wg|8A0QRKB%5r+-C=zwVlgonJDtIh+5# zLQVoP=NS*@VBexact match
- - -
+ + +
diff --git a/root/tt/domain.tt b/root/tt/domain.tt index ed3c120..c99e993 100644 --- a/root/tt/domain.tt +++ b/root/tt/domain.tt @@ -4,13 +4,14 @@ [% IF messages.edommsg %]
[% messages.edommsg %]
[% END %] [% IF messages.edomerr %]
[% messages.edomerr %]
[% END %] - +
- - - + + + [% id = 0 %] [% FOREACH domain = domains %] @@ -19,8 +20,16 @@ [% IF domain.domain == edit_domain %] - - + + + [% ELSE %] + [% IF domain.domain == edit_domain %] [% IF messages.ecc || messages.etimezone %] -
domaincountry codetimezone - + localcctimezone +
+ + + + cancel + + [% domain.cc %] [% domain.timezone %] @@ -52,7 +65,7 @@
+
[% messages.ecc %] [% IF messages.ecc && messages.etimezone %]
[% END %] @@ -73,26 +86,40 @@ [% IF messages.cdommsg %]
[% messages.cdommsg %]
[% END %] [% IF messages.cdomerr %]
[% messages.cdomerr %]
[% END %] - +
- - - + + + - - - + + + + + - [% IF messages.acc || messages.atimezone %]
domaincountry codetimezone - + localcctimezone +
+ + + + + + + +
diff --git a/root/tt/subscriber.tt b/root/tt/subscriber.tt index 29a1455..876a9a7 100644 --- a/root/tt/subscriber.tt +++ b/root/tt/subscriber.tt @@ -19,9 +19,14 @@ - +
+
+ +
+
+ @@ -32,7 +37,7 @@
- + [% FOREACH subscriber = subscriber_list %]
SIP URIAccount ID
SIP URIAccount ID