mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-09 21:43:22 +09:00
Bugfixes (#1978)
* Fixed public tickets * Resolved the most common reported errors
This commit is contained in:
1 parent
be9f4b9d64
commit
da4cd44590
5 files changed
+24
-21
No files matched your search
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Copyright 2022-2023 FOSSBilling
|
||||
* Copyright 2011-2021 BoxBilling, Inc.
|
||||
@@ -240,9 +241,18 @@ class Service implements InjectionAwareInterface
|
||||
private function fieldsJsonDecode($fields)
|
||||
{
|
||||
foreach ($fields as $key => $r) {
|
||||
$fields[$key]['options'] = json_decode($r['options'], true);
|
||||
$fields[$key]['default_value'] = (json_decode($r['default_value'])) ? (json_decode($r['default_value'], true)) : $r['default_value'];
|
||||
}
|
||||
if (!empty($r['options'])) {
|
||||
$fields[$key]['options'] = json_decode($r['options'], true);
|
||||
} else {
|
||||
$fields[$key]['options'] = [];
|
||||
}
|
||||
|
||||
if(!empty($r['default_value'])){
|
||||
$fields[$key]['default_value'] = (json_decode($r['default_value'])) ? (json_decode($r['default_value'], true)) : $r['default_value'];
|
||||
} else {
|
||||
$fields[$key]['default_value'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Copyright 2022-2023 FOSSBilling
|
||||
* Copyright 2011-2021 BoxBilling, Inc.
|
||||
@@ -1545,7 +1546,7 @@ class Service implements InjectionAwareInterface
|
||||
];
|
||||
|
||||
foreach ($sourceData as $label => $data) {
|
||||
if (empty(trim($data))) {
|
||||
if ($data !== null && empty(trim($data))) {
|
||||
unset($sourceData[$label]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post" action="" id="public-ticket-create" class="form span6">
|
||||
<form method="post" action="{{ 'api/guest/support/ticket_create'|link}} " id="public-ticket-create" class="api-form" data-api-jsonp="onTicketCreate">
|
||||
<input type="hidden" name="CSRFToken" value="{{ CSRFToken }}"/>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="name">{{ 'Name'|trans }}</label>
|
||||
@@ -82,18 +82,9 @@
|
||||
<script>
|
||||
$(function () {
|
||||
$('#anti-spam').remove();
|
||||
|
||||
$('#public-ticket-create').on('submit', function (event) {
|
||||
$('.wait').show();
|
||||
bb.post(
|
||||
'guest/support/ticket_create',
|
||||
$(this).serialize(),
|
||||
function (result) {
|
||||
bb.redirect("{{ 'support/contact-us/conversation'|link }}" + '/' + result);
|
||||
}
|
||||
);
|
||||
return false;
|
||||
});
|
||||
});
|
||||
function onTicketCreate(result){
|
||||
bb.redirect("{{ 'support/contact-us/conversation'|link }}" + '/' + result);
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -48,8 +48,8 @@
|
||||
</table>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<button class="btn btn-primary btn-small ms-3" href="{{ 'api/guest/support/ticket_close'|link({ 'hash': ticket.hash, 'CSRFToken': CSRFToken })}}" id="new-ticket-button" data-api-reload="1"> {{ 'Close ticket'|trans }}</button>
|
||||
<a class="btn btn-info btn-small ms-2" href="#reply-to">{{ 'Reply'|trans }}</a>
|
||||
<button class="btn btn-primary btn-small ms-2 w-25" href="{{ 'api/guest/support/ticket_close'|link({ 'hash': ticket.hash, 'CSRFToken': CSRFToken })}}" id="new-ticket-button" data-api-reload="1"> {{ 'Close ticket'|trans }}</button>
|
||||
<a class="btn btn-info btn-small ms-2 w-25" href="#reply-to">{{ 'Reply'|trans }}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@@ -85,7 +85,7 @@
|
||||
<input type="hidden" name="hash" value="{{ ticket.hash }}" />
|
||||
|
||||
<textarea name="message" cols="5" rows="10" class="form-control" required="required" id="ticket-reply-text"></textarea>
|
||||
<button class="btn btn-primary btn-large" type="submit" id="submit-support-message" value="{{ 'Post'|trans }}" onclick="">{{ 'Post'|trans }}</button>
|
||||
<button class="btn btn-primary btn-large mt-1" type="submit" id="submit-support-message" value="{{ 'Post'|trans }}" onclick="">{{ 'Post'|trans }}</button>
|
||||
</form>
|
||||
{% elseif ticket.status == 'closed' %}
|
||||
<div class="alert alert-white text-center">{{ 'Ticket was closed and cannot be reopened.'|trans }}</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Copyright 2022-2023 FOSSBilling
|
||||
* Copyright 2011-2021 BoxBilling, Inc.
|
||||
@@ -420,7 +421,7 @@ class Service implements InjectionAwareInterface
|
||||
|
||||
protected function isRouteAdmin()
|
||||
{
|
||||
if (str_starts_with($_SERVER['REQUEST_URI'], ADMIN_PREFIX)) {
|
||||
if (str_starts_with($_SERVER['REQUEST_URI'] ?? $_SERVER['PATH_INFO'], ADMIN_PREFIX)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user