Skip to content

Commit

Permalink
Merge pull request #2608 from LibreSign/backport/2607/stable28
Browse files Browse the repository at this point in the history
[stable28] Replace TCPDI by TCPDF
  • Loading branch information
vitormattos authored Mar 28, 2024
2 parents 3ffe45c + 322c2ae commit 6ddb9c6
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 265 deletions.
11 changes: 2 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
"license": "AGPL",
"require": {
"endroid/qr-code": "^4.6",
"iio/libmergepdf": "dev-move-tcpdi-parser-to-package",
"jsignpdf/jsignpdf-php": "^1.2",
"mikehaertl/php-pdftk": "^0.13.0",
"pagerfanta/pagerfanta": "^3.6",
"smalot/pdfparser": "^2.4",
"symfony/console": "^5.4",
"tecnickcom/tcpdf": "^6.4",
"tecnickcom/tcpdf": "^6.7",
"wobeto/email-blur": "^1.0"
},
"require-dev": {
Expand Down Expand Up @@ -62,11 +61,5 @@
"psr-4": {
"OCP\\": "vendor/nextcloud/ocp/OCP"
}
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/LibreCodeCoop/libmergepdf"
}
]
}
}
181 changes: 5 additions & 176 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions lib/Db/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
namespace OCA\Libresign\Db;

use OCP\AppFramework\Db\Entity;
use stdClass;

/**
* @method void setId(int $id)
Expand All @@ -45,8 +46,7 @@
* @method string getCallback()
* @method void setStatus(int $status)
* @method int getStatus()
* @method void setPages(int $pages)
* @method int getPages()
* @method string getMetadata()
*/
class File extends Entity {
/** @var integer */
Expand Down Expand Up @@ -97,4 +97,16 @@ public function __construct() {
$this->addType('status', 'integer');
$this->addType('metadata', 'string');
}

public function setMetadata($metadata): void {
if (is_array($metadata)) {
$metadata = json_encode($metadata);
}
$this->metadata = (string) $metadata;
$this->markFieldUpdated('metadata');
}

public function getMetadataDecoded(): ?stdClass {
return json_decode($this->metadata);
}
}
2 changes: 1 addition & 1 deletion lib/Db/SignRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* @method void setDisplayName(string $displayName)
* @method string getDisplayName()
* @method void setMetadata(array $metadata)
* @method string getMetadata()
* @method array getMetadata()
*/
class SignRequest extends Entity {
/** @var integer */
Expand Down
3 changes: 0 additions & 3 deletions lib/Db/SignRequestMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ public function incrementNotificationCounter(SignRequest $signRequest, string $m
try {
$fromDatabase = $this->getById($signRequest->getId());
$metadata = $fromDatabase->getMetadata();
if (!empty($metadata)) {
$metadata = json_decode($metadata, true);
}
if (!isset($metadata['notify'])) {
$this->firstNotification = true;
}
Expand Down
Loading

0 comments on commit 6ddb9c6

Please sign in to comment.