|
| 1 | +<?php |
| 2 | +/* Copyright (C) 2021-2023 EVARISK <[email protected]> |
| 3 | + * |
| 4 | + * This program is free software; you can redistribute it and/or modify |
| 5 | + * it under the terms of the GNU General Public License as published by |
| 6 | + * the Free Software Foundation; either version 3 of the License, or |
| 7 | + * (at your option) any later version. |
| 8 | + * |
| 9 | + * This program is distributed in the hope that it will be useful, |
| 10 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | + * GNU General Public License for more details. |
| 13 | + * |
| 14 | + * You should have received a copy of the GNU General Public License |
| 15 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 16 | + */ |
| 17 | + |
| 18 | +/** |
| 19 | + * \file class/saturneqrcode.class.php |
| 20 | + * \ingroup saturne |
| 21 | + * \brief This file is a CRUD class file for SaturneQRCode (Create/Read/Update/Delete). |
| 22 | + */ |
| 23 | + |
| 24 | +// Load Saturne libraries. |
| 25 | +require_once __DIR__ . '/saturneobject.class.php'; |
| 26 | + |
| 27 | +class SaturneQRCode extends SaturneObject |
| 28 | +{ |
| 29 | + /** |
| 30 | + * @var DoliDB Database handler |
| 31 | + */ |
| 32 | + public $db; |
| 33 | + |
| 34 | + /** |
| 35 | + * @var string Module name |
| 36 | + */ |
| 37 | + public $module = 'saturne'; |
| 38 | + |
| 39 | + /** |
| 40 | + * @var string Element type of object |
| 41 | + */ |
| 42 | + public $element = 'saturne_qrcode'; |
| 43 | + |
| 44 | + /** |
| 45 | + * @var string Name of table without prefix where object is stored This is also the key used for extrafields management |
| 46 | + */ |
| 47 | + public $table_element = 'saturne_qrcode'; |
| 48 | + |
| 49 | + /** |
| 50 | + * @var int Does this object support multicompany module ? |
| 51 | + * 0 = No test on entity, 1 = Test with field entity, 'field@table' = Test with link by field@table |
| 52 | + */ |
| 53 | + public $ismultientitymanaged = 1; |
| 54 | + |
| 55 | + /** |
| 56 | + * @var int Does object support extrafields ? 0 = No, 1 = Yes |
| 57 | + */ |
| 58 | + public $isextrafieldmanaged = 1; |
| 59 | + |
| 60 | + /** |
| 61 | + * @var string Last output from end job execution |
| 62 | + */ |
| 63 | + public $output = ''; |
| 64 | + |
| 65 | + /** |
| 66 | + * @var string Name of icon for certificate Must be a 'fa-xxx' fontawesome code (or 'fa-xxx_fa_color_size') or 'certificate@saturne' if picto is file 'img/object_certificatepng' |
| 67 | + */ |
| 68 | + public string $picto = 'fontawesome_fa-forward_fas_#d35968'; |
| 69 | + |
| 70 | + /** |
| 71 | + * @var array Array with all fields and their property Do not use it as a static var It may be modified by constructor |
| 72 | + */ |
| 73 | + public $fields = [ |
| 74 | + 'rowid' => ['type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'comment' => 'Id'], |
| 75 | + 'entity' => ['type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 0, 'index' => 1], |
| 76 | + 'date_creation' => ['type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 0], |
| 77 | + 'tms' => ['type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 50, 'notnull' => 1, 'visible' => 0], |
| 78 | + 'import_key' => ['type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 0, 'index' => 0], |
| 79 | + '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']], |
| 80 | + 'module_name' => ['type' => 'varchar(128)', 'label' => 'ModuleName', 'enabled' => 1, 'position' => 90, 'notnull' => 0, 'visible' => 0], |
| 81 | + 'url' => ['type' => 'text', 'label' => 'Url', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'visible' => 0, 'index' => 0], |
| 82 | + 'encoded_qr_code' => ['type' => 'text', 'label' => 'EncodedData', 'enabled' => 1, 'position' => 90, 'notnull' => 0, 'visible' => 0, 'index' => 0], |
| 83 | + 'fk_user_creat' => ['type' => 'integer:User:user/class/userclassphp', 'label' => 'UserAuthor', 'picto' => 'user', 'enabled' => 1, 'position' => 220, 'notnull' => 1, 'visible' => 0, 'foreignkey' => 'userrowid'], |
| 84 | + ]; |
| 85 | + |
| 86 | + /** |
| 87 | + * @var int ID |
| 88 | + */ |
| 89 | + public int $rowid; |
| 90 | + |
| 91 | + /** |
| 92 | + * @var int Entity |
| 93 | + */ |
| 94 | + public $entity; |
| 95 | + |
| 96 | + /** |
| 97 | + * @var int|string Creation date |
| 98 | + */ |
| 99 | + public $date_creation; |
| 100 | + |
| 101 | + /** |
| 102 | + * @var int|string Timestamp |
| 103 | + */ |
| 104 | + public $tms; |
| 105 | + |
| 106 | + /** |
| 107 | + * @var string Import key |
| 108 | + */ |
| 109 | + public $import_key; |
| 110 | + |
| 111 | + /** |
| 112 | + * @var int Status |
| 113 | + */ |
| 114 | + public $status; |
| 115 | + |
| 116 | + /** |
| 117 | + * @var string Module name |
| 118 | + */ |
| 119 | + public $module_name; |
| 120 | + |
| 121 | + /** |
| 122 | + * @var string URL |
| 123 | + */ |
| 124 | + public $url; |
| 125 | + |
| 126 | + /** |
| 127 | + * @var string QR Code encoded |
| 128 | + */ |
| 129 | + public $encoded_qr_code; |
| 130 | + |
| 131 | + /** |
| 132 | + * @var int User creator |
| 133 | + */ |
| 134 | + public $fk_user_creat; |
| 135 | + |
| 136 | + /** |
| 137 | + * Constructor |
| 138 | + * |
| 139 | + * @param DoliDb $db Database handler |
| 140 | + * @param string $moduleNameLowerCase Module name |
| 141 | + * @param string $objectType Object element type |
| 142 | + */ |
| 143 | + public function __construct(DoliDB $db, string $moduleNameLowerCase = 'saturne', string $objectType = 'saturne_qrcode') |
| 144 | + { |
| 145 | + parent::__construct($db, $moduleNameLowerCase, $objectType); |
| 146 | + } |
| 147 | +} |
| 148 | + |
| 149 | +?> |
0 commit comments