removed local, cc and timezone settings from domains

3.0-u-redesign
Daniel Tiefnig 15 years ago
parent 34154860f7
commit c1ab8bf332

@ -31,16 +31,6 @@ sub index : Private {
); );
$c->stash->{domains} = $domains if eval { @$domains }; $c->stash->{domains} = $domains if eval { @$domains };
$c->stash->{edit_domain} = $c->request->params->{edit_domain};
if(ref $c->session->{restore_domedit_input} eq 'HASH') {
foreach my $domain (@{$c->stash->{domains}}) {
next unless $$domain{domain} eq $c->stash->{edit_domain};
$domain = { %$domain, %{$c->session->{restore_domedit_input}} };
last;
}
delete $c->session->{restore_domedit_input};
}
if(ref $c->session->{restore_domadd_input} eq 'HASH') { if(ref $c->session->{restore_domadd_input} eq 'HASH') {
$c->stash->{arefill} = $c->session->{restore_domadd_input}; $c->stash->{arefill} = $c->session->{restore_domadd_input};
delete $c->session->{restore_domadd_input}; delete $c->session->{restore_domadd_input};
@ -49,53 +39,6 @@ sub index : Private {
return 1; return 1;
} }
=head2 do_edit_domain
Change settings for a domain.
=cut
sub do_edit_domain : Local {
my ( $self, $c ) = @_;
my %messages;
my %settings;
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+$/;
$settings{timezone} = $c->request->params->{timezone};
$messages{etimezone} = 'Client.Syntax.MalformedTimezone'
unless $settings{timezone} =~ m#^\w+/\w.+$#;
unless(keys %messages) {
if($c->model('Provisioning')->call_prov( $c, 'billing', 'update_domain',
{ domain => $domain,
data => \%settings,
},
undef
))
{
$messages{edommsg} = 'Server.Voip.SavedSettings';
$c->session->{messages} = \%messages;
$c->response->redirect("/domain");
return;
}
} else {
$messages{edomerr} = 'Client.Voip.InputErrorFound';
}
$c->session->{messages} = \%messages;
$c->session->{restore_domedit_input} = \%settings;
$c->response->redirect("/domain?edit_domain=$domain");
return;
}
=head2 do_create_domain =head2 do_create_domain
Create a new domain. Create a new domain.
@ -106,25 +49,12 @@ sub do_create_domain : Local {
my ( $self, $c ) = @_; my ( $self, $c ) = @_;
my %messages; my %messages;
my %settings;
my $domain = $c->request->params->{domain}; 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+$/;
$settings{timezone} = $c->request->params->{timezone};
$messages{atimezone} = 'Client.Syntax.MalformedTimezone'
unless $settings{timezone} =~ m#^\w+/\w.+$#;
unless(keys %messages) { unless(keys %messages) {
if($c->model('Provisioning')->call_prov( $c, 'billing', 'create_domain', if($c->model('Provisioning')->call_prov( $c, 'billing', 'create_domain',
{ domain => $domain, { domain => $domain },
data => \%settings,
},
undef undef
)) ))
{ {
@ -138,7 +68,6 @@ sub do_create_domain : Local {
} }
$c->session->{messages} = \%messages; $c->session->{messages} = \%messages;
$c->session->{restore_domadd_input} = \%settings;
$c->session->{restore_domadd_input}{domain} = $domain; $c->session->{restore_domadd_input}{domain} = $domain;
$c->response->redirect("/domain"); $c->response->redirect("/domain");
return; return;

@ -416,13 +416,17 @@ ul#topsubmenu {
#contentplace .registered_contacts, #contentplace .registered_contacts,
#contentplace .billing_fees, #contentplace .billing_fees,
#contentplace .billing_peaktimes, #contentplace .billing_peaktimes,
#contentplace .numberblocks, #contentplace .numberblocks
#contentplace .domains
{ {
width: 100%; width: 100%;
border-spacing: 0px; border-spacing: 0px;
} }
#contentplace .domains
{
border-spacing: 0px;
}
#contentplace .table_name { #contentplace .table_name {
font-weight: bold; font-weight: bold;
white-space: nowrap; white-space: nowrap;

@ -6,11 +6,7 @@
<table class="domains"> <table class="domains">
<tr class="table_header"> <tr class="table_header">
<td>domain</td> <td style="width:270px;" >domain</td>
<td class="tdcenter" style="width:40px;" >local</td>
<td class="tdcenter" style="width:40px;" >cc</td>
<td style="width:150px;" >timezone</td>
<td style="width:40px;" />
<td style="width:60px;" /> <td style="width:60px;" />
</tr> </tr>
[% id = 0 %] [% id = 0 %]
@ -25,63 +21,18 @@
[% domain.domain %] [% domain.domain %]
[% END %] [% END %]
</td> </td>
[% IF domain.domain == edit_domain %]
<form action="/domain/do_edit_domain" method="post">
<input type="hidden" name="domain" value="[% domain.domain %]" />
<td class="tdcenter">
<input type="checkbox" class="checkbox" title="check if domain contains local users"
name="local" [% IF domain.local %]checked="checked"[% END %] />
</td>
<td class="tdcenter"><input class="irealshort" title="integer, country code"
name="cc" value="[% domain.cc %]" /></td>
<td>
<input type="text" class="imedium" title="string, timezone in continent/capital format"
name="timezone" value="[% domain.timezone %]" />
</td>
<td>
<div class="postlink">
<label for="domsave[% id %]">save</label>
<input type="image" class="hidden" src="/static/images/dot_trans.gif" alt="" id="domsave[% id %]" />
</div>
</td>
</form>
<td><a href="/domain" class="aaction">cancel</a></td>
[% ELSE %]
<td class="tdcenter">
<input type="checkbox" class="checkbox" name="local"
[% IF domain.local %]checked="checked"[% END %] disabled="disabled" />
</td>
<td class="tdcenter">[% domain.cc %]</td>
<td>[% domain.timezone %]</td>
<td> <td>
[% UNLESS Catalyst.session.admin.read_only %] [% UNLESS Catalyst.session.admin.read_only %]
<a href="/domain?edit_domain=[% domain.domain %]" class="aaction">edit</a> <form action="/domain/do_delete_domain" method="post">
[% END %] <input type="hidden" name="domain" value="[% domain.domain %]" />
</td>
<form action="/domain/do_delete_domain" method="post">
<input type="hidden" name="domain" value="[% domain.domain %]" />
<td>
[% UNLESS Catalyst.session.admin.read_only %]
<div class="postlink"> <div class="postlink">
<label for="domdel[% id %]">delete</label> <label for="domdel[% id %]">delete</label>
<input type="image" class="hidden" src="/static/images/dot_trans.gif" alt="" id="domdel[% id %]" /> <input type="image" class="hidden" src="/static/images/dot_trans.gif" alt="" id="domdel[% id %]" />
</div> </div>
[% END %] </form>
</td>
</form>
[% END %] [% END %]
</td>
</tr> </tr>
[% IF domain.domain == edit_domain %]
[% IF messages.ecc || messages.etimezone %]
<tr><td colspan="6">
<div class="errormsg">
[% messages.ecc %]
[% IF messages.ecc && messages.etimezone %]<br />[% END %]
[% messages.etimezone %]
</div>
</td></tr>
[% END %]
[% END %]
[% id = id + 1 %] [% id = id + 1 %]
[% END %] [% END %]
</table> </table>
@ -96,32 +47,15 @@
<table class="domains"> <table class="domains">
<tr class="table_header"> <tr class="table_header">
<td>domain</td> <td style="width:270px;" >domain</td>
<td class="tdcenter" style="width:40px;" >local</td>
<td class="tdcenter" style="width:40px;" >cc</td>
<td style="width:150px;" >timezone</td>
<td style="width:40px;" />
<td style="width:60px;" /> <td style="width:60px;" />
</tr> </tr>
<form action="/domain/do_create_domain" method="post"> <form action="/domain/do_create_domain" method="post">
<tr> <tr>
<td> <td>
<input type="text" size="20" name="domain" title="string, SIP domain" <input type="text" size="30" name="domain" title="string, SIP domain"
id="domainaddtxt" value="[% arefill.domain %]" /> id="domainaddtxt" value="[% arefill.domain %]" />
</td> </td>
<td class="tdcenter">
<input type="checkbox" class="checkbox" title="check if domain contains local users"
name="local" [% IF arefill.local %]checked="checked"[% END %] />
</td>
<td class="tdcenter">
<input type="text" class="irealshort" title="integer, country code"
name="cc" value="[% arefill.cc %]" />
</td>
<td>
<input type="text" class="imedium" title="string, timezone in continent/capital format"
name="timezone" value="[% arefill.timezone %]" />
</td>
<td />
<td> <td>
<div class="postlink"> <div class="postlink">
<label for="domainadd">add</label> <label for="domainadd">add</label>
@ -129,15 +63,6 @@
</div> </div>
</td> </td>
</tr> </tr>
[% IF messages.acc || messages.atimezone %]
<tr><td colspan="5">
<div class="errormsg">
[% messages.acc %]
[% IF messages.acc && messages.atimezone %]<br />[% END %]
[% messages.atimezone %]
</div>
</td></tr>
[% END %]
</form> </form>
</table> </table>

Loading…
Cancel
Save