mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-30 04:07:07 +09:00
Some UI & usability improvements (#2215)
This commit is contained in:
1 parent
47d73224fd
commit
96dcfce0c6
4 files changed
+26
-6
No files matched your search
@@ -56,7 +56,7 @@
|
||||
{% if unpaid_invoices.total > 0 %}
|
||||
{% for i, invoice in unpaid_invoices.list %}
|
||||
<tr>
|
||||
<td>{{ "Invoice #%05s"|format(invoice.id) }}</td>
|
||||
<td>{{ 'Invoice'|trans }} #{{ invoice.serie ~ "%05s"|format(invoice.nr) }}</td>
|
||||
<td>{{ invoice.created_at|format_date }}</td>
|
||||
<td>{{ invoice.due_at|format_date }}</td>
|
||||
<td>{{ invoice.total | money(invoice.currency) }}</td>
|
||||
@@ -89,7 +89,7 @@
|
||||
{% if paid_invoices.total > 0 %}
|
||||
{% for i, invoice in paid_invoices.list %}
|
||||
<tr>
|
||||
<td>{{ "Invoice #%05s"|format(invoice.id) }}</td>
|
||||
<td>{{ 'Invoice'|trans }} #{{ invoice.serie ~ "%05s"|format(invoice.nr) }}</td>
|
||||
<td>{{ invoice.created_at|format_date }}</td>
|
||||
<td>{{ invoice.paid_at|format_date }}</td>
|
||||
<td>{{ invoice.total | money(invoice.currency) }}</td>
|
||||
|
||||
@@ -555,12 +555,18 @@ class Service implements InjectionAwareInterface
|
||||
}
|
||||
}
|
||||
|
||||
if (method_exists($se, 'generateOrderTitle')) {
|
||||
$generatedOrderTitle = $se->generateOrderTitle($config);
|
||||
} else {
|
||||
$generatedOrderTitle = null;
|
||||
}
|
||||
|
||||
$order = $this->di['db']->dispense('ClientOrder');
|
||||
$order->client_id = $client->id;
|
||||
$order->product_id = $product->id;
|
||||
$order->group_id = ($parent_order) ? $parent_order->group_id : uniqid();
|
||||
$order->group_master = ($parent_order) ? 0 : 1;
|
||||
$order->title = $data['title'] ?? $product->title;
|
||||
$order->title = $generatedOrderTitle ?? $data['title'] ?? $product->title;
|
||||
$order->currency = $currency->code;
|
||||
$order->quantity = $qty;
|
||||
$order->service_type = $product->type;
|
||||
|
||||
@@ -27,13 +27,15 @@ class Service implements \FOSSBilling\InjectionAwareInterface
|
||||
|
||||
public function getCartProductTitle($product, array $data)
|
||||
{
|
||||
if (isset($data['action']) && $data['action'] == 'register'
|
||||
if (
|
||||
isset($data['action']) && $data['action'] == 'register'
|
||||
&& isset($data['register_tld']) && isset($data['register_sld'])
|
||||
) {
|
||||
return __trans('Domain :domain registration', [':domain' => $data['register_sld'] . $data['register_tld']]);
|
||||
}
|
||||
|
||||
if (isset($data['action']) && $data['action'] == 'transfer'
|
||||
if (
|
||||
isset($data['action']) && $data['action'] == 'transfer'
|
||||
&& isset($data['transfer_tld']) && isset($data['transfer_sld'])
|
||||
) {
|
||||
return __trans('Domain :domain transfer', [':domain' => $data['transfer_sld'] . $data['transfer_tld']]);
|
||||
@@ -137,6 +139,18 @@ class Service implements \FOSSBilling\InjectionAwareInterface
|
||||
}
|
||||
}
|
||||
|
||||
public function generateOrderTitle(array $config): ?string
|
||||
{
|
||||
switch ($config['action']) {
|
||||
case 'transfer':
|
||||
return $config['transfer_sld'] . $config['transfer_tld'];
|
||||
case 'register':
|
||||
return $config['register_sld'] . $config['register_tld'];
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates domain service object from order.
|
||||
*
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-info text-center">
|
||||
{{ 'No results found for'|trans }} <strong>{{ request.q }}</strong>
|
||||
{{ 'No results found for:'|trans }} <strong>{{ request.q }}</strong>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user