merged r2622:2651 from trunk:


			
			
				2.0@3605
			
			
		
Daniel Tiefnig 17 years ago
parent 3b4f78c3ac
commit 2a66a1710d

@ -693,16 +693,11 @@ sub update_preferences : Local {
$fw_target =~ s/^sip://i;
if($fw_target =~ /^\+?\d+$/) {
if($fw_target =~ /^\+[1-9][0-9]+$/) {
$fw_target =~ s/^\+//;
} elsif($fw_target =~ /^00[1-9][0-9]+$/) {
$fw_target =~ s/^00//;
} elsif($fw_target =~ /^0[1-9][0-9]+$/) {
$fw_target =~ s/^0/$c->session->{subscriber}{cc}/e;
} else {
$messages{$fwtype} = 'Client.Voip.MalformedNumber';
$fw_target = $c->request->params->{$fwtype .'_sipuri'};
}
$fw_target = admin::Utils::get_qualified_number_for_subscriber($c, $fw_target);
my $checkresult;
return unless $c->model('Provisioning')->call_prov( $c, 'voip', 'check_E164_number', $fw_target, \$checkresult);
$messages{$fwtype} = 'Client.Voip.MalformedNumber'
unless $checkresult;
} elsif($fw_target =~ /^[a-z0-9&=+\$,;?\/_.!~*'()-]+\@[a-z0-9.-]+$/i) {
$fw_target = 'sip:'. lc $fw_target;
} elsif($fw_target =~ /^[a-z0-9&=+\$,;?\/_.!~*'()-]+$/) {
@ -732,7 +727,11 @@ sub update_preferences : Local {
$$preferences{cli} = $c->request->params->{cli} or undef;
if(defined $$preferences{cli} and $$preferences{cli} =~ /^\+?\d+$/) {
$$preferences{cli} =~ s/^\++//;
$$preferences{cli} = admin::Utils::get_qualified_number_for_subscriber($c, $$preferences{cli});
my $checkresult;
return unless $c->model('Provisioning')->call_prov( $c, 'voip', 'check_E164_number', $$preferences{cli}, \$checkresult);
$messages{cli} = 'Client.Voip.MalformedNumber'
unless $checkresult;
}
$$preferences{clir} = $c->request->params->{clir} ? 1 : undef;
@ -1263,15 +1262,7 @@ sub do_edit_speed_dial_slots : Local {
my $checkadd_destination;
my $destination;
if ($add_destination =~ /^\+?\d+$/) {
if($add_destination =~ /^\+[1-9][0-9]+$/) {
$add_destination =~ s/^\+//;
} elsif($add_destination =~ /^00[1-9][0-9]+$/) {
$add_destination =~ s/^00//;
} elsif($add_destination =~ /^0[1-9][0-9]+$/) {
$add_destination =~ s/^0/$c->session->{subscriber}{cc}/e;
} else {
$add_destination = $c->session->{subscriber}{cc} . $c->session->{subscriber}{ac} . $add_destination;
}
$add_destination = admin::Utils::get_qualified_number_for_subscriber($c, $add_destination);
my $checkresult;
return unless $c->model('Provisioning')->call_prov( $c, 'voip', 'check_E164_number', $add_destination, \$checkresult);
$destination = 'sip:'. $add_destination .'@'. $c->session->{subscriber}{domain}
@ -1335,15 +1326,7 @@ sub do_edit_speed_dial_slots : Local {
my $checkupdate_destination;
my $destination;
if ($update_destination =~ /^\+?\d+$/) {
if($update_destination =~ /^\+[1-9][0-9]+$/) {
$update_destination =~ s/^\+//;
} elsif($update_destination =~ /^00[1-9][0-9]+$/) {
$update_destination =~ s/^00//;
} elsif($update_destination =~ /^0[1-9][0-9]+$/) {
$update_destination =~ s/^0/$c->session->{subscriber}{cc}/e;
} else {
$update_destination = $c->session->{subscriber}{cc} . $c->session->{subscriber}{ac} . $update_destination;
}
$update_destination = admin::Utils::get_qualified_number_for_subscriber($c, $update_destination);
my $checkresult;
return unless $c->model('Provisioning')->call_prov( $c, 'voip', 'check_E164_number', $update_destination, \$checkresult);
$destination = 'sip:'. $update_destination .'@'. $c->session->{subscriber}{domain}
@ -1520,27 +1503,18 @@ sub do_edit_destlist : Local {
}
# input text field to add new entry to destination list
# this is also sent by the save link next to entries in edit mode
# this is also sent (together with a list_del) by the save link in edit mode
my $add = $c->request->params->{list_add};
if(defined $add) {
my $checkresult;
if($add =~ /^\+?\d+$/) {
if($add =~ /^\+[1-9][0-9]+$/) {
$add =~ s/^\+//;
} elsif($add =~ /^00[1-9][0-9]+$/) {
$add =~ s/^00//;
} elsif($add =~ /^0[1-9][0-9]+$/) {
$add =~ s/^0/$c->session->{subscriber}{cc}/e;
} else {
$add = $c->session->{subscriber}{cc} . $c->session->{subscriber}{ac} . $add;
}
$add = admin::Utils::get_qualified_number_for_subscriber($c, $add);
return unless $c->model('Provisioning')->call_prov( $c, 'voip', 'check_E164_number', $add, \$checkresult);
} else {
return unless $c->model('Provisioning')->call_prov( $c, 'voip', 'check_email', $add, \$checkresult);
}
unless($checkresult) {
$messages{msgadd} = 'Client.Voip.MalformedFaxDestination';
$c->session->{arefill}{destination} = $add;
}
$entry{destination} = $add;
$entry{filetype} = $c->request->params->{filetype} || 'TIFF';
@ -1552,7 +1526,12 @@ sub do_edit_destlist : Local {
my $destlist = $$preferences{$list};
$destlist = [] unless defined $destlist;
$destlist = [ $destlist ] unless ref $destlist;
$$preferences{$list} = [ @$destlist, \%entry ];
if(grep { lc $$_{destination} eq lc $add } @$destlist) {
$messages{msgadd} = 'Web.Fax.ExistingFaxDestination';
} else {
$$preferences{$list} = [ @$destlist, \%entry ];
}
$c->session->{arefill} = \%entry if keys %messages;
}

@ -104,4 +104,19 @@ sub get_contract_contact_form_fields {
}
sub get_qualified_number_for_subscriber {
my ($c, $number) = @_;
if($number =~ /^\+[1-9][0-9]+$/) {
} elsif($number =~ /^00[1-9][0-9]+$/) {
$number =~ s/^00/+/;
} elsif($number =~ /^0[1-9][0-9]+$/) {
$number =~ s/^0/'+'.$c->session->{subscriber}{cc}/e;
} elsif($number =~ /^[1-9][0-9]+$/) {
$number = '+' . $c->session->{subscriber}{cc} . $c->session->{subscriber}{ac} . $number;
}
return $number;
}
1;

@ -381,7 +381,9 @@
<table class="contracts">
<tr>
<td class="table_header">ContractID</td>
[% IF Catalyst.config.order_features %]
<td class="table_header">OrderID</td>
[% END %]
<td class="table_header">Product</td>
<td class="table_header">status</td>
<td class="table_header">created</td>
@ -404,7 +406,9 @@
[% contract.id %]
[% END %]
</td>
[% IF Catalyst.config.order_features %]
<td>[% contract.order_id %]</td>
[% END %]
<td>
[% IF contract.class == 'voip' %]
<a href="/account/detail?account_id=[% contract.id %]">
@ -426,6 +430,8 @@
[% END %]
</div>
[% IF Catalyst.config.order_features %]
<h3 id="order">Orders</h3>
<div class="p1">
@ -497,5 +503,7 @@
[% END %]
</div>
[% END %]
[% END %]

Loading…
Cancel
Save