Skip to content

Commit

Permalink
Merge pull request #2322 from LibreSign/backport/2321/stable28
Browse files Browse the repository at this point in the history
[stable28] Remove unused code
  • Loading branch information
vitormattos authored Feb 18, 2024
2 parents 8c3d68f + 863f60a commit e667924
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 19 deletions.
10 changes: 1 addition & 9 deletions lib/Db/AccountFileMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ private function getUserAccountFile(array $filter = [], bool $count = false): Pa
->selectAlias('u.uid_lower', 'account_uid')
->selectAlias('u.displayname', 'account_displayname')
->selectAlias('f.created_at', 'request_date')
->selectAlias($qb->func()->max('sr.signed'), 'status_date')
->from($this->getTableName(), 'af')
->join('af', 'libresign_file', 'f', 'f.id = af.file_id')
->join('af', 'users', 'u', 'af.user_id = u.uid')
Expand Down Expand Up @@ -176,7 +175,7 @@ private function getUserAccountFile(array $filter = [], bool $count = false): Pa
/**
* @return (((int|mixed|string)[]|false|mixed|null|string)[]|mixed)[]
*
* @psalm-return array{file: array{name: mixed, status: mixed, statusText: null|string, status_date: false|mixed|string, request_date: false|string, requested_by: array{displayName: mixed, uid: mixed}, file: array{type: 'pdf', nodeId: int, url: string}, callback: mixed, uuid: mixed}}
* @psalm-return array{file: array{name: mixed, status: mixed, statusText: null|string, request_date: false|string, requested_by: array{displayName: mixed, uid: mixed}, file: array{type: 'pdf', nodeId: int, url: string}, callback: mixed, uuid: mixed}}
*/
private function formatListRow(array $row, string $url): array {
$row['account'] = [
Expand All @@ -191,16 +190,10 @@ private function formatListRow(array $row, string $url): array {
$row['request_date'] = (new \DateTime())
->setTimestamp((int) $row['request_date'])
->format('Y-m-d H:i:s');
if (!empty($row['status_date'])) {
$row['status_date'] = (new \DateTime())
->setTimestamp((int) $row['status_date'])
->format('Y-m-d H:i:s');
}
$row['file'] = [
'name' => $row['name'],
'status' => $row['status'],
'statusText' => $this->fileMapper->getTextOfStatus((int) $row['status']),
'status_date' => $row['status_date'],
'request_date' => $row['request_date'],
'requested_by' => [
'displayName' => $row['account_displayname'],
Expand All @@ -218,7 +211,6 @@ private function formatListRow(array $row, string $url): array {
$row['node_id'],
$row['name'],
$row['status'],
$row['status_date'],
$row['request_date'],
$row['account_displayname'],
$row['account_uid'],
Expand Down
6 changes: 0 additions & 6 deletions lib/Db/SignRequestMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ private function getFilesAssociatedFilesWithMeStmt(string $userId, ?string $emai
->selectAlias('u.uid_lower', 'requested_by_uid')
->selectAlias('u.displayname', 'requested_by_dislpayname')
->selectAlias('f.created_at', 'request_date')
->selectAlias($qb->func()->max('sr.signed'), 'status_date')
->from('libresign_file', 'f')
->leftJoin('f', 'libresign_sign_request', 'sr', 'sr.file_id = f.id')
->leftJoin('f', 'libresign_identify_method', 'im', $qb->expr()->eq('sr.id', 'im.sign_request_id'))
Expand Down Expand Up @@ -523,11 +522,6 @@ private function formatListRow(array $row, string $url): array {
$row['request_date'] = (new \DateTime())
->setTimestamp((int) $row['request_date'])
->format('Y-m-d H:i:s');
if (!empty($row['status_date'])) {
$row['status_date'] = (new \DateTime())
->setTimestamp((int) $row['status_date'])
->format('Y-m-d H:i:s');
}
$row['type'] = 'pdf';
$row['url'] = $url . $row['uuid'];
$row['nodeId'] = (int) $row['node_id'];
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/features/file/list.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Feature: file-list
"name": "document",
"callback": null,
"request_date": "<IGNORED>",
"status_date": null,
"requested_by": {
"uid": "admin",
"displayName": null
Expand Down Expand Up @@ -91,7 +90,6 @@ Feature: file-list
"name": "document",
"callback": null,
"request_date": "<IGNORED>",
"status_date": null,
"requested_by": {
"uid": "admin",
"displayName": null
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/features/sign/request.feature
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ Feature: request-signature
"name": "document",
"callback": null,
"request_date": "<IGNORED>",
"status_date": null,
"requested_by": {
"uid": "admin",
"displayName": null
Expand Down Expand Up @@ -398,7 +397,6 @@ Feature: request-signature
"name": "document",
"callback": null,
"request_date": "<IGNORED>",
"status_date": null,
"requested_by": {
"uid": "admin",
"displayName": null
Expand Down

0 comments on commit e667924

Please sign in to comment.