Merge branch 'master' into review-bugfixed

This commit is contained in:
Moriz Wahl 2021-08-12 14:45:09 +02:00
commit f174f93879
4 changed files with 21 additions and 15 deletions

View File

@ -340,17 +340,13 @@ class AppRequestsController extends AppController
$limit = $count;
$offset = 0;
$skip_first_transaction = false;
if($page == 1) {
$limit--;
} else {
if($page > 1) {
$offset = (( $page - 1 ) * $count) - 1;
}
if($offset) {
$limit++;
$skip_first_transaction = true;
if($orderDirection == 'ASC') {
$offset--;
}
if($offset && $orderDirection == 'ASC') {
$offset--;
}
//echo "limit: $limit, offset: $offset, skip first transaction: $skip_first_transaction<br>";
@ -363,6 +359,11 @@ class AppRequestsController extends AppController
//->page($page)
->offset($offset)
;
$state_user_transactions_count = $stateUserTransactionsQuery->count();
if($state_user_transactions_count > $offset + $limit) {
$skip_first_transaction = true;
}
$decay = true;
if($page > 1) {
$decay = false;
@ -388,7 +389,7 @@ class AppRequestsController extends AppController
'state' => 'success',
'transactions' => $transactions,
'transactionExecutingCount' => $session->read('Transactions.executing'),
'count' => $stateUserTransactionsQuery->count(),
'count' => $state_user_transactions_count,
'gdtSum' => $gdtSum,
'timeUsed' => microtime(true) - $startTime
];
@ -409,8 +410,6 @@ class AppRequestsController extends AppController
public function listGDTTransactions($page = 1, $count = 25, $orderDirection = 'ASC', $session_id = 0)
{
$timeBegin = microtime(true);
$gdtSum = 0;
$gdtCount = -1;
$this->viewBuilder()->setLayout('ajax');
$login_result = $this->requestLogin($session_id, false);
@ -432,8 +431,6 @@ class AppRequestsController extends AppController
'orderDirection' => $orderDirection
], 'GdtEntries' . DS . 'listPerEmailApi');
$transactions = [];
$result = ['state' => 'success'];
if('success' == $gdtEntries['state']) {
$timeEnd = microtime(true);
$gdtEntries['data']['timeUsed'] = $timeEnd - $timeBegin;

View File

@ -84,3 +84,11 @@ std::string PageRequestMessagedHandler::getBaseUrl()
}
return "https://" + mHost + mLoginServerPath;
}
std::string PageRequestMessagedHandler::getHost()
{
if (ServerConfig::g_ServerSetupType == ServerConfig::SERVER_TYPE_TEST) {
return "http://" + mHost;
}
return "https://" + mHost;
}

View File

@ -29,6 +29,7 @@ protected:
unsigned long long getLastGetAsU64(const std::string& uri);
std::string getBaseUrl();
std::string getHost();
Profiler mTimeProfiler;
std::string mHost;

View File

@ -299,7 +299,7 @@
</a>
</div>
<div class="reset-pwd-link">
<a href="<%= getBaseUrl() %>/resetPassword"><%= langCatalog->gettext("Passwort vergessen") %></a>
<a href="<%= getHost() %>/vue/password"><%= langCatalog->gettext("Passwort vergessen") %></a>
</div>
</div>
</div>