mirror of https://github.com/sipwise/www_admin.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
218 lines
8.9 KiB
218 lines
8.9 KiB
[% IF account.id %]
|
|
<h3> VoIP Account
|
|
<a class="noarrow" href="detail?account_id=[% account.id %]">
|
|
#[% account.id %]</a>
|
|
</h3>
|
|
[% ELSE %]
|
|
<h3>New VoIP Account</h3>
|
|
[% END %]
|
|
|
|
[% UNLESS account.terminate_timestamp || Catalyst.session.admin.read_only %]
|
|
<div class="actions">
|
|
[% IF billing_features %]
|
|
<a href="detail?account_id=[% account.id %]&edit_account=1" class="aaction">edit</a>
|
|
[% END %]
|
|
[% IF edit_account %]
|
|
[% IF account.id %]
|
|
<a href="detail?account_id=[% account.id %]" class="aaction">cancel</a>
|
|
[% ELSE %]
|
|
[% IF account.customer_id %]
|
|
<a href="/customer/detail?customer_id=[% account.customer_id %]#contract" class="aaction">cancel</a>
|
|
[% ELSE %]
|
|
<a href="/account" class="aaction">cancel</a>
|
|
[% END %]
|
|
[% END %]
|
|
[% ELSE %]
|
|
[% IF account.status == "pending" %]
|
|
<a href="activate?account_id=[% account.id %]" class="aaction">activate</a>
|
|
[% ELSE %]
|
|
[% IF account.is_locked %]
|
|
<a href="lock?account_id=[% account.id %]&lock=none" class="aaction">unlock</a>
|
|
[% ELSE %]
|
|
<a href="lock?account_id=[% account.id %]&lock=global" class="aaction">lock</a>
|
|
[% END %]
|
|
<a href="terminate?account_id=[% account.id %]" class="aaction">terminate</a>
|
|
<a href="delete?account_id=[% account.id %]" class="aaction">delete</a>
|
|
[% END %]
|
|
[% END %]
|
|
</div>
|
|
[% END %]
|
|
<div class="p1">
|
|
[% IF account.is_locked %]
|
|
<div class="alert">Account is locked!</div>
|
|
[% END %]
|
|
[% IF account.status == "pending" %]
|
|
<div class="alert">Account is in pending state!</div>
|
|
[% END %]
|
|
[% IF messages.accmsg %]<div class="goodmsg">[% messages.accmsg %]</div>[% END %]
|
|
[% IF messages.accerr %]<div class="errormsg">[% messages.accerr %]</div>[% END %]
|
|
<form action="save_account" method="post">
|
|
<input type="hidden" name="account_id" value="[% account.id %]" />
|
|
<table>
|
|
<tr><td class="tdkey">ContractID:</td><td>[% account.id %]</td></tr>
|
|
|
|
[% IF billing_features %]
|
|
<tr>
|
|
<td class="tdkey">CustomerID:</td>
|
|
<td>
|
|
[% IF edit_account %]
|
|
<input type="text" name="customer_id" value="[% account.customer_id %]"
|
|
title="unique ID of the customer the account belongs to, integer, optional" />
|
|
[% ELSE %]
|
|
[% IF account.customer_id %]
|
|
<a href="/customer/detail?customer_id=[% account.customer_id %]">[% account.customer_id %]</a>
|
|
[% END %]
|
|
[% END %]
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="tdkey">product:</td>
|
|
<td>
|
|
[% IF edit_account %]
|
|
<select size="1" name="product">
|
|
[% FOREACH product = products %]
|
|
<option value="[% product.handle %]"
|
|
[% IF product.handle == account.product %]
|
|
selected="selected"
|
|
[% END %]>[% product.data.name %]</option>
|
|
[% END %]
|
|
</select>
|
|
[% ELSE %]
|
|
[% account.product_name %]
|
|
[% END %]
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="tdkey">billing profile:</td>
|
|
<td>
|
|
[% IF edit_account %]
|
|
<select size="1" name="billing_profile">
|
|
[% FOREACH profile = billing_profiles %]
|
|
<option value="[% profile.handle %]"
|
|
[% IF profile.handle == account.billing_profile %]
|
|
selected="selected"
|
|
[% END %]>[% profile.data.name %]</option>
|
|
[% END %]
|
|
</select>
|
|
[% ELSE %]
|
|
[% account.billing_profile_name %]
|
|
[% END %]
|
|
</td>
|
|
</tr>
|
|
[% END %]
|
|
|
|
<tr><td class="tdkey">created:</td><td>[% account.create_timestamp %]</td></tr>
|
|
<tr><td class="tdkey">modified:</td><td>[% account.modify_timestamp %]</td></tr>
|
|
[% IF account.terminate_timestamp %]
|
|
<tr><td class="tdkey">terminated:</td><td><div class="alert">[% account.terminate_timestamp %]</div></td></tr>
|
|
[% END %]
|
|
</table>
|
|
[% IF edit_account %]
|
|
<input type="submit" class="but" value="Save »" />
|
|
[% END %]
|
|
</form>
|
|
</div>
|
|
|
|
[% IF billing_features && account.id %]
|
|
<h3>Account Balance</h3>
|
|
|
|
[% UNLESS account.terminate_timestamp || Catalyst.session.admin.read_only || edit_account %]
|
|
<div class="actions">
|
|
<a href="detail?account_id=[% account.id %]&edit_balance=1" class="aaction">edit</a>
|
|
[% IF edit_balance %]
|
|
<a href="detail?account_id=[% account.id %]" class="aaction">cancel</a>
|
|
[% END %]
|
|
</div>
|
|
[% END %]
|
|
<div class="p1">
|
|
[% IF messages.balmsg %]<div class="goodmsg">[% messages.balmsg %]</div>[% END %]
|
|
[% IF messages.balerr %]<div class="errormsg">[% messages.balerr %]</div>[% END %]
|
|
Current totals
|
|
<form action="update_balance" method="post">
|
|
<input type="hidden" name="account_id" value="[% account.id %]" />
|
|
<table>
|
|
<tr>
|
|
<td class="tdkey">cash:</td>
|
|
<td class="nowrap">€ [% account.balance.cash_balance %]</td>
|
|
<td>
|
|
[% IF edit_balance %]
|
|
<div class="account_add">
|
|
add
|
|
<input type="text" name="add_cash" value="[% balanceadd.cash %]"
|
|
title="amount of money to add, float" />
|
|
Euro</div>
|
|
[% END %]
|
|
</td>
|
|
</tr>
|
|
[% IF messages.addcash %]<tr><td /><td /><td><div class="errormsg">[% messages.addcash %]</div></td></tr>[% END %]
|
|
<tr>
|
|
<td class="tdkey">free time:</td>
|
|
<td class="nowrap">[% account.balance.free_time_balance %] s</td>
|
|
<td>
|
|
[% IF edit_balance %]
|
|
<div class="account_add">
|
|
add
|
|
<input type="text" name="add_time" value="[% balanceadd.free_time %]"
|
|
title="amount of free time in seconds to add, integer" />
|
|
seconds
|
|
</div>
|
|
[% END %]
|
|
</td>
|
|
</tr>
|
|
[% IF messages.addtime %]<tr><td /><td /><td><div class="errormsg">[% messages.addtime %]</div></td></tr>[% END %]
|
|
</table>
|
|
[% IF edit_balance %]
|
|
<input type="submit" class="but" value="Save »" />
|
|
[% END %]
|
|
</form>
|
|
</div>
|
|
<div class="p1">
|
|
Spent this billing interval
|
|
<table>
|
|
<tr><td class="tdkey">cash:</td><td>€ [% account.balance.cash_balance_interval %]</td></tr>
|
|
<tr><td class="tdkey">free time:</td><td>[% account.balance.free_time_balance_interval %] s</td></tr>
|
|
</table>
|
|
</div>
|
|
[% END %]
|
|
|
|
[% IF account.id %]
|
|
<h3>Subscribers</h3>
|
|
|
|
[% UNLESS Catalyst.session.admin.read_only || edit_account %]
|
|
<div class="actions">
|
|
<a href="/subscriber/detail?account_id=[% account.id %]&new=1" class="aaction">create new</a>
|
|
</div>
|
|
[% END %]
|
|
<div class="p1">
|
|
[% IF account.subscribers %]
|
|
<table>
|
|
<tr class="table_header">
|
|
<td>SIP URI</td>
|
|
<td>Primary Number</td>
|
|
<td>Registered Devices</td>
|
|
</tr>
|
|
[% FOREACH subscriber = account.subscribers %]
|
|
<tr>
|
|
<td>
|
|
[% IF subscriber.subscriber_id %]
|
|
<a href="/subscriber/detail?subscriber_id=[% subscriber.subscriber_id %]">
|
|
[% subscriber.username %]@[% subscriber.domain %]</a>
|
|
[% ELSE %]
|
|
[% subscriber.username %]@[% subscriber.domain %]
|
|
[% END %]
|
|
</td>
|
|
<td>[% IF subscriber.sn %]+[% subscriber.cc %] [% subscriber.ac %] [% subscriber.sn %][% END %]</td>
|
|
<td>[% subscriber.registered_contacts %]</td>
|
|
</tr>
|
|
[% END %]
|
|
</table>
|
|
[% ELSE %]
|
|
<div>
|
|
This account does not have any subscribers yet.
|
|
</div>
|
|
[% END %]
|
|
</div>
|
|
|
|
[% END %]
|
|
|