Skip to content

Commit 6e3aefb

Browse files
committed
#1045 [QRCode] fix: PSR12 & useless fields
1 parent 29599e6 commit 6e3aefb

File tree

5 files changed

+9
-20
lines changed

5 files changed

+9
-20
lines changed

admin/qrcode.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
/* Copyright (C) 2021-2023 EVARISK
2+
/* Copyright (C) 2024 EVARISK
33
*
44
* This program is free software: you can redistribute it and/or modify
55
* it under the terms of the GNU General Public License as published by
@@ -16,9 +16,9 @@
1616
*/
1717

1818
/**
19-
* \file admin/redirections.php
19+
* \file admin/qrcode.php
2020
* \ingroup saturne
21-
* \brief Saturne redirections page
21+
* \brief Saturne qrcode page
2222
*/
2323

2424
// Load Saturne environment
@@ -39,7 +39,7 @@
3939
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
4040
require_once DOL_DOCUMENT_ROOT . '/includes/tecnickcom/tcpdf/tcpdf_barcodes_2d.php';
4141

42-
// Load Module libraries
42+
// Load Saturne libraries
4343
require_once __DIR__ . '/../lib/saturne.lib.php';
4444
require_once __DIR__ . '/../class/saturneqrcode.class.php';
4545

@@ -54,7 +54,7 @@
5454

5555
// Get parameters
5656
$action = GETPOST('action', 'alpha');
57-
$url = GETPOST('url', 'alpha');
57+
$url = GETPOST('url', 'alpha');
5858

5959
// Initialize Redirection Manager
6060
$saturneQRCode = new SaturneQRCode($db);
@@ -74,10 +74,9 @@
7474
header('Location: ' . $_SERVER['PHP_SELF']);
7575
exit;
7676
}
77-
$saturneQRCode->url = $url;
77+
$saturneQRCode->url = $url;
7878
$saturneQRCode->encoded_qr_code = $saturneQRCode->getQRCodeBase64($url);
79-
$saturneQRCode->module_name = 'saturne';
80-
$saturneQRCode->status = 1;
79+
$saturneQRCode->module_name = 'saturne';
8180
$saturneQRCode->create($user);
8281

8382
setEventMessage('QRCodeCreated');
@@ -87,7 +86,7 @@
8786

8887
if ($action == 'update') {
8988
$saturneQRCode->fetch(GETPOST('id'));
90-
$saturneQRCode->url = GETPOST('url');
89+
$saturneQRCode->url = GETPOST('url');
9190
$saturneQRCode->encoded_qr_code = $saturneQRCode->getQRCodeBase64($saturneQRCode->url);
9291
$saturneQRCode->update($user);
9392

class/saturneqrcode.class.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ class SaturneQRCode extends SaturneObject
7979
'date_creation' => ['type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 0],
8080
'tms' => ['type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 50, 'notnull' => 1, 'visible' => 0],
8181
'import_key' => ['type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 0, 'index' => 0],
82-
'status' => ['type' => 'smallint', 'label' => 'Status', 'enabled' => 1, 'position' => 70, 'notnull' => 1, 'visible' => 2, 'default' => 0, 'index' => 1, 'validate' => 1, 'arrayofkeyval' => [0 => 'StatusDraft', 1 => 'ValidatePendingSignature', 2 => 'Expired', 3 => 'Archived']],
8382
'module_name' => ['type' => 'varchar(128)', 'label' => 'ModuleName', 'enabled' => 1, 'position' => 90, 'notnull' => 0, 'visible' => 0],
8483
'url' => ['type' => 'text', 'label' => 'Url', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'visible' => 0, 'index' => 0],
8584
'encoded_qr_code' => ['type' => 'text', 'label' => 'EncodedData', 'enabled' => 1, 'position' => 90, 'notnull' => 0, 'visible' => 0, 'index' => 0],
@@ -111,11 +110,6 @@ class SaturneQRCode extends SaturneObject
111110
*/
112111
public $import_key;
113112

114-
/**
115-
* @var int Status
116-
*/
117-
public $status;
118-
119113
/**
120114
* @var string Module name
121115
*/

lib/saturne_functions.lib.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ function saturne_load_langs(array $domains = [])
348348
global $langs, $moduleNameLowerCase;
349349

350350
$langs->loadLangs(['saturne@saturne', 'object@saturne', 'signature@saturne', 'medias@saturne', $moduleNameLowerCase . '@' . $moduleNameLowerCase]);
351-
352351
if (!empty($domains)) {
353352
foreach ($domains as $domain) {
354353
$langs->load($domain);

sql/qrcode/llx_saturne_qrcode.key.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@
1414
-- along with this program. If not, see https://www.gnu.org/licenses/.
1515

1616
ALTER TABLE llx_saturne_qrcode ADD INDEX idx_saturne_object_qrcode_rowid (rowid);
17-
ALTER TABLE llx_saturne_qrcode ADD INDEX idx_saturne_object_qrcode_ref (ref);
18-
ALTER TABLE llx_saturne_qrcode ADD INDEX idx_saturne_object_qrcode_status (status);
1917
ALTER TABLE llx_saturne_qrcode ADD CONSTRAINT llx_saturne_qrcode_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user (rowid);

sql/qrcode/llx_saturne_qrcode.sql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-- Copyright (C) 2021-2023 EVARISK <[email protected]>
1+
-- Copyright (C) 2024 EVARISK <[email protected]>
22
--
33
-- This program is free software: you can redistribute it and/or modify
44
-- it under the terms of the GNU General Public License as published by
@@ -19,7 +19,6 @@ CREATE TABLE llx_saturne_qrcode(
1919
date_creation datetime NOT NULL,
2020
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
2121
import_key varchar(14),
22-
status integer DEFAULT 1 NOT NULL,
2322
module_name varchar(255),
2423
url text,
2524
encoded_qr_code longtext,

0 commit comments

Comments
 (0)