event-tickets-with-ticket-scanner
Last commit date
3rd
1 week ago
css
1 week ago
img
1 week ago
includes
1 week ago
js
1 week ago
languages
1 week ago
ticket
1 week ago
vendors
1 week ago
SASO_EVENTTICKETS.php
1 week ago
backend.js
1 week ago
changelog-features.json
1 week ago
changelog.txt
1 week ago
db.php
1 week ago
index.php
1 week ago
init_file.php
1 week ago
order_details.js
1 week ago
pwa-sw.js
1 week ago
readme.txt
1 week ago
saso-eventtickets-validator.js
1 week ago
sasoEventtickets_AdminSettings.php
1 week ago
sasoEventtickets_Authtoken.php
1 week ago
sasoEventtickets_Base.php
1 week ago
sasoEventtickets_Core.php
1 week ago
sasoEventtickets_Frontend.php
1 week ago
sasoEventtickets_Messenger.php
1 week ago
sasoEventtickets_Options.php
1 week ago
sasoEventtickets_PDF.php
1 week ago
sasoEventtickets_Seating.php
1 week ago
sasoEventtickets_Ticket.php
1 week ago
sasoEventtickets_TicketBadge.php
1 week ago
sasoEventtickets_TicketDesigner.php
1 week ago
sasoEventtickets_TicketQR.php
1 week ago
ticket_events.js
1 week ago
ticket_scanner.js
1 week ago
validator.js
1 week ago
version-notices.json
1 week ago
vollstart-cross-promo.php
1 week ago
wc_backend.js
1 week ago
wc_frontend.js
1 week ago
woocommerce-hooks.php
1 week ago
sasoEventtickets_Options.php
1144 lines
| 1 | <?php |
| 2 | include_once(plugin_dir_path(__FILE__)."init_file.php"); |
| 3 | class sasoEventtickets_Options { |
| 4 | private $_options; |
| 5 | private $MAIN; |
| 6 | private $_prefix; |
| 7 | private ?bool $_migrationComplete = null; |
| 8 | private ?array $_dbValuesCache = null; |
| 9 | |
| 10 | public function __construct($MAIN, $_prefix) { |
| 11 | $this->MAIN = $MAIN; |
| 12 | $this->_prefix = $_prefix; |
| 13 | } |
| 14 | |
| 15 | /** |
| 16 | * Check if options have been migrated from wp_options to custom table. |
| 17 | * Result is cached for the duration of the request. |
| 18 | */ |
| 19 | private function _isMigrationComplete(): bool { |
| 20 | if ($this->_migrationComplete === null) { |
| 21 | $this->_migrationComplete = (get_option('saso_eventtickets_options_migrated', '0') === '1'); |
| 22 | } |
| 23 | return $this->_migrationComplete; |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * Reset migration cache — called after migration completes within the same request. |
| 28 | */ |
| 29 | public function resetMigrationCache(): void { |
| 30 | $this->_migrationComplete = null; |
| 31 | $this->_dbValuesCache = null; |
| 32 | if (is_array($this->_options)) { |
| 33 | foreach ($this->_options as $idx => $option) { |
| 34 | $this->_options[$idx]['_isLoaded'] = false; |
| 35 | } |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Bulk-load all options from the custom table in a single query. |
| 41 | * Populates _dbValuesCache so subsequent getOption() calls are instant. |
| 42 | */ |
| 43 | private function _loadAllFromCustomTable(): void { |
| 44 | if ($this->_dbValuesCache === null) { |
| 45 | global $wpdb; |
| 46 | $table = $this->MAIN->getDB()->getTabelle('options'); |
| 47 | $rows = $wpdb->get_results("SELECT option_key, option_value FROM {$table}", ARRAY_A); |
| 48 | $this->_dbValuesCache = []; |
| 49 | if (is_array($rows)) { |
| 50 | foreach ($rows as $row) { |
| 51 | $this->_dbValuesCache[$row['option_key']] = $row['option_value']; |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | foreach ($this->_options as $idx => $option) { |
| 56 | if ($option['_isLoaded']) continue; |
| 57 | $this->_applyDbCacheToOption($idx); |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Load all options from wp_options (legacy, pre-migration behavior). |
| 63 | */ |
| 64 | private function _loadAllFromWpOptions(): void { |
| 65 | foreach ($this->_options as $idx => $option) { |
| 66 | if ($option['_isLoaded'] == false) { |
| 67 | $v = get_option($option['id'], $option['default']); |
| 68 | if (!is_array($v)) { |
| 69 | $v = stripslashes($v); |
| 70 | } |
| 71 | $this->_options[$idx]['value'] = $v; |
| 72 | $this->_options[$idx]['_isLoaded'] = true; |
| 73 | } |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Load a single option by its index. Uses bulk cache if available, |
| 79 | * otherwise a single DB query. Called by getOption() for lazy loading. |
| 80 | */ |
| 81 | private function _loadSingleOption(int $idx): void { |
| 82 | $option = $this->_options[$idx]; |
| 83 | if ($this->_isMigrationComplete()) { |
| 84 | // Fast path: bulk cache already populated by getOptions() |
| 85 | if ($this->_dbValuesCache !== null) { |
| 86 | $this->_applyDbCacheToOption($idx); |
| 87 | } else { |
| 88 | // Single DB query — only when getOptions() was never called |
| 89 | global $wpdb; |
| 90 | $table = $this->MAIN->getDB()->getTabelle('options'); |
| 91 | $v = $wpdb->get_var($wpdb->prepare( |
| 92 | "SELECT option_value FROM {$table} WHERE option_key = %s", |
| 93 | $option['key'] |
| 94 | )); |
| 95 | if ($v !== null) { |
| 96 | $decoded = json_decode($v, true); |
| 97 | $this->_options[$idx]['value'] = is_array($decoded) ? $decoded : stripslashes($v); |
| 98 | } |
| 99 | $this->_options[$idx]['_isLoaded'] = true; |
| 100 | } |
| 101 | } else { |
| 102 | $v = get_option($option['id'], $option['default']); |
| 103 | if (!is_array($v)) { |
| 104 | $v = stripslashes($v); |
| 105 | } |
| 106 | $this->_options[$idx]['value'] = $v; |
| 107 | $this->_options[$idx]['_isLoaded'] = true; |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * Apply a cached DB value to a single option (from bulk cache). |
| 113 | */ |
| 114 | private function _applyDbCacheToOption(int $idx): void { |
| 115 | $key = $this->_options[$idx]['key']; |
| 116 | if (isset($this->_dbValuesCache[$key])) { |
| 117 | $v = $this->_dbValuesCache[$key]; |
| 118 | $decoded = json_decode($v, true); |
| 119 | if (is_array($decoded)) { |
| 120 | $v = $decoded; |
| 121 | } else if (!is_array($v)) { |
| 122 | $v = stripslashes($v); |
| 123 | } |
| 124 | $this->_options[$idx]['value'] = $v; |
| 125 | } |
| 126 | $this->_options[$idx]['_isLoaded'] = true; |
| 127 | } |
| 128 | |
| 129 | /** |
| 130 | * Write a single option to the custom table (INSERT or UPDATE). |
| 131 | */ |
| 132 | private function _writeToCustomTable(string $key, $value): void { |
| 133 | global $wpdb; |
| 134 | $table = $this->MAIN->getDB()->getTabelle('options'); |
| 135 | $storeValue = is_array($value) ? json_encode($value) : (string) $value; |
| 136 | |
| 137 | $wpdb->replace($table, [ |
| 138 | 'option_key' => $key, |
| 139 | 'option_value' => $storeValue, |
| 140 | 'updated_at' => wp_date('Y-m-d H:i:s'), |
| 141 | 'updated_by' => get_current_user_id(), |
| 142 | ]); |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * Delete a single option from the custom table. |
| 147 | */ |
| 148 | private function _deleteFromCustomTable(string $key): void { |
| 149 | global $wpdb; |
| 150 | $table = $this->MAIN->getDB()->getTabelle('options'); |
| 151 | $wpdb->delete($table, ['option_key' => $key]); |
| 152 | } |
| 153 | |
| 154 | /** |
| 155 | * Log an option change to the history table. |
| 156 | * Only logs if the value actually changed. |
| 157 | */ |
| 158 | private function _logOptionChange(string $key, $oldValue, $newValue): void { |
| 159 | $oldStr = is_array($oldValue) ? json_encode($oldValue) : (string) $oldValue; |
| 160 | $newStr = is_array($newValue) ? json_encode($newValue) : (string) $newValue; |
| 161 | if ($oldStr === $newStr) { |
| 162 | return; |
| 163 | } |
| 164 | global $wpdb; |
| 165 | $table = $this->MAIN->getDB()->getTabelle('options_history'); |
| 166 | $wpdb->insert($table, [ |
| 167 | 'option_key' => $key, |
| 168 | 'old_value' => $oldStr, |
| 169 | 'new_value' => $newStr, |
| 170 | 'changed_by' => get_current_user_id(), |
| 171 | 'changed_at' => wp_date('Y-m-d H:i:s'), |
| 172 | ]); |
| 173 | } |
| 174 | |
| 175 | public function initOptions() { |
| 176 | |
| 177 | $order_status = []; |
| 178 | if (function_exists("wc_get_order_statuses")) { |
| 179 | $order_status = wc_get_order_statuses(); |
| 180 | } |
| 181 | |
| 182 | $this->_options = []; |
| 183 | |
| 184 | $this->_options[] = $this->getOptionsObject('h99', esc_html__("Display options", 'event-tickets-with-ticket-scanner'),"","heading"); |
| 185 | $this->_options[] = $this->getOptionsObject('displayFirstStepsHelp', esc_html__("Display the first steps helper info", 'event-tickets-with-ticket-scanner'), esc_html__("If activated then an information widget will be shown at the admin area to guide you through the first steps.", 'event-tickets-with-ticket-scanner'),"checkbox", true, [], true); |
| 186 | $this->_options[] = $this->getOptionsObject('wizardCompleted', esc_html__("Setup wizard completed", 'event-tickets-with-ticket-scanner'), esc_html__("Stores the plugin version when the setup wizard was completed. Clear this value to show the wizard again.", 'event-tickets-with-ticket-scanner'),"text", "", [], false); |
| 187 | $this->_options[] = $this->getOptionsObject('premiumWizardCompleted', esc_html__("Premium wizard completed", 'event-tickets-with-ticket-scanner'), esc_html__("Stores the plugin version when the premium wizard was completed. Clear this value to show the wizard again.", 'event-tickets-with-ticket-scanner'),"text", "", [], false); |
| 188 | $this->_options[] = $this->getOptionsObject('versionNoticeSeen', esc_html__("Version notice seen", 'event-tickets-with-ticket-scanner'), esc_html__("Stores the plugin version when the version notice was dismissed. Clear this value to show the notice again.", 'event-tickets-with-ticket-scanner'),"text", "", [], false); |
| 189 | $this->_options[] = $this->getOptionsObject('displayDateFormat', esc_html__("Your own date format", 'event-tickets-with-ticket-scanner'), esc_html__("If left empty, default will be 'Y/m/d'. Using the php date function format. Y=year, m=month, d=day H:hours, i:minutes, s=seconds", 'event-tickets-with-ticket-scanner'),"text", "Y/m/d", [], true); |
| 190 | $this->_options[] = $this->getOptionsObject('displayTimeFormat', esc_html__("Your own time format", 'event-tickets-with-ticket-scanner'), esc_html__("If left empty, default will be 'H:i'. Using the php date function format. H=hours with leading 0, i=minutes with leading zero, s=seconds", 'event-tickets-with-ticket-scanner'),"text", "H:i", [], true); |
| 191 | //$this->_options[] = $this->getOptionsObject('displayDateFormatDatePicker', esc_html__("Date format of the date picker", 'event-tickets-with-ticket-scanner'), esc_html__("If left empty, default will be 'yy-mm-dd'. Using the jquery datepicker format.", 'event-tickets-with-ticket-scanner'). __("<ul><li>d - day of month (no leading zero)</li><li>dd - day of month (two digit)</li><li>o - day of the year (no leading zeros)</li><li>oo - day of the year (three digit)</li><li>D - day name short</li><li>DD - day name long</li><li>m - month of year (no leading zero)</li><li>mm - month of year (two digit)</li><li>M - month name short</li><li>MM - month name long</li><li>y - year (two digit)</li><li>yy - year (four digit)</li></ul>", 'event-tickets-with-ticket-scanner'),"text", "yy-mm-dd", [], true); |
| 192 | $this->_options[] = $this->getOptionsObject('displayAdminAreaColumnConfirmedCount', esc_html__("Display the column 'confirmed count' of the ticket", 'event-tickets-with-ticket-scanner'), esc_html__("If active, then a new column within the admin area for each ticket will be shown with the confirmed count value.", 'event-tickets-with-ticket-scanner'), "checkbox"); |
| 193 | $this->_options[] = $this->getOptionsObject('displayAdminAreaColumnRedeemedInfo', esc_html__("Display a column with the information how often the ticket is redeemed", 'event-tickets-with-ticket-scanner'), esc_html__("If active, then a new column within the admin area for each ticket will be shown with the redeem ticket information. This feature can be very slow.", 'event-tickets-with-ticket-scanner'), "checkbox"); |
| 194 | $this->_options[] = $this->getOptionsObject('displayAdminAreaColumnBillingName', esc_html__("Display a column with the name of the buyer", 'event-tickets-with-ticket-scanner'), __('If active, then a new column within the admin area for each ticket will be shown with the billing name. <b>This feature can be very slow.</b>', 'event-tickets-with-ticket-scanner'),"checkbox"); |
| 195 | $this->_options[] = $this->getOptionsObject('displayAdminAreaColumnBillingCompany', esc_html__("Display a column with the billing company of the order", 'event-tickets-with-ticket-scanner'), __('If active, then a new column within the admin area for each ticket will be shown with the billing company. <b>This feature can be very slow.</b>', 'event-tickets-with-ticket-scanner'),"checkbox"); |
| 196 | |
| 197 | $this->_options[] = $this->getOptionsObject('h0a', "Access","","heading"); |
| 198 | $this->_options[] = $this->getOptionsObject('allowOnlySepcificRoleAccessToAdmin', "Allow only specific roles access to the admin area","If active, then only the administrator and the choosen roles area allowed to access this admin area.","checkbox", true, [], true, 'https://youtu.be/YRC-isNcWu4'); |
| 199 | $all_roles = wp_roles()->roles; |
| 200 | $editable_roles = apply_filters('editable_roles', $all_roles); |
| 201 | $additional = [ "multiple"=>1, "values"=>[["label"=>"No role execept Administrator allowed", "value"=>"-"]] ]; |
| 202 | foreach($editable_roles as $key => $value) { |
| 203 | if ($key == "administrator") continue; |
| 204 | $additional['values'][] = ["label"=>$value['name'], "value"=>$key]; |
| 205 | } |
| 206 | $this->_options[] = $this->getOptionsObject('adminAreaAllowedRoles', "Allow the specific role to access the backend of the event ticket", "If a role is chosen, then the user with this role is allowed to access the event ticket admin area. This will not exclude the 'administrator', if the option is activated.", "dropdown", "-", $additional, false); |
| 207 | $this->_options[] = $this->getOptionsObject('wcTicketAllowOnlyLoggedinToDownload', "Allow only logged in users to download their tickets","If active, then only logged in users can download and see the ticket, calendar file and the bagde.","checkbox", false, [], true, ''); |
| 208 | $this->_options[] = $this->getOptionsObject('wcTicketAllowOnlyLoggedinToDownloadRedirectURL', "URL where not logged in users should be redirected to","If option wcTicketAllowOnlyLoggedinToDownload is active, then the not logged in users will be redirected to this URL. If the URL is empty, then a message will be shown.","text", '', [], false, ''); |
| 209 | |
| 210 | $options = []; |
| 211 | $options[] = [ |
| 212 | 'key'=>'h12a', |
| 213 | 'label'=>__("Ticket scanner", 'event-tickets-with-ticket-scanner'), |
| 214 | 'desc'=>"", |
| 215 | 'type'=>"heading" |
| 216 | ]; |
| 217 | $all_roles = wp_roles()->roles; |
| 218 | $editable_roles = $all_roles; |
| 219 | $additional = [ "values"=>[["label"=>esc_attr__("No login required to access scanner", 'event-tickets-with-ticket-scanner'), "value"=>"-"]] ]; |
| 220 | foreach($editable_roles as $key => $value) { |
| 221 | $additional['values'][] = ["label"=>translate_user_role($value['name']), "value"=>$key]; |
| 222 | } |
| 223 | $options[] = [ |
| 224 | 'key'=>'wcTicketScannerAllowedRoles', |
| 225 | 'label'=>__("Allow the specific role to access the ticket scanner", 'event-tickets-with-ticket-scanner'), |
| 226 | 'desc'=>__("If a role is chosen, then the user with this role is allowed to use the ticket scanner. This will not exclude the 'administrator', if the option is activated.", 'event-tickets-with-ticket-scanner'), |
| 227 | 'type'=>"dropdown", |
| 228 | 'def'=>"-", |
| 229 | 'additional'=>$additional, |
| 230 | 'isPublic'=>false, |
| 231 | '_doc_video'=>'https://youtu.be/VsgAYhgf_iA' |
| 232 | ]; |
| 233 | $options[] = ['key'=>'wcTicketOnlyLoggedInScannerAllowed', 'label'=>__('Allow logged in user as adminstrator to open the ticket scanner', 'event-tickets-with-ticket-scanner'), 'desc'=>__('If active, only logged-in user can scan a ticket. It is also testing if the user is an administrator.', 'event-tickets-with-ticket-scanner'), 'type'=>'checkbox', '_doc'=>['video'=>'https://youtu.be/rnv4HULJNHM']]; |
| 234 | $options[] = ['key'=>'wcTicketAllowRedeemOnlyPaid', 'label'=>__('Allow to redeem ticket only if it is paid', 'event-tickets-with-ticket-scanner'), 'desc'=>__('If active, only paid and not refunded or cancelled tickets can be redeemed by the ticket scanner. Normal users can anyway not redeem unpaid tickets by themself.', 'event-tickets-with-ticket-scanner'), 'type'=>'checkbox', 'def'=>false, '_doc_video'=>'https://youtu.be/nS2J7CYb6eM']; |
| 235 | $options[] = ['key'=>'wcTicketScanneCountRetrieveAsConfirmed', 'label'=>__('Count each ticket scan with the ticket scanner as a confirmed status check', 'event-tickets-with-ticket-scanner'), 'desc'=>__('If active, each ticket scan will be counted treated as a confirmed validation check and increase the confirmed status check counter. Only if the ticket is active.', 'event-tickets-with-ticket-scanner'), 'type'=>'checkbox', '_doc_video'=>'https://youtu.be/BUuV9FDR7ww']; |
| 236 | $options[] = ['key'=>'wcTicketScannerDisplayConfirmedCount', 'label'=>__('Display confirmed status checks on the ticket scanner view', 'event-tickets-with-ticket-scanner'), 'desc'=>__('If active, the confirmed validation checks are displayed whith the retrieved ticket on the ticket scanner.', 'event-tickets-with-ticket-scanner'), 'type'=>'checkbox']; |
| 237 | $options[] = ['key'=>'wcTicketDontAllowRedeemTicketBeforeStart', 'label'=>__('Do not allow tickets to be redeemed before starting date', 'event-tickets-with-ticket-scanner'), 'desc'=>__('If active, the ticket can only be redeemed at the start date and during the event.', 'event-tickets-with-ticket-scanner'), 'type'=>'checkbox', '_doc_video'=>'https://youtu.be/GBJqyxmu3jE']; |
| 238 | $options[] = ['key'=>'wcTicketOffsetAllowRedeemTicketBeforeStart', 'label'=>__('How many hours before the event can the ticket be redeemed?', 'event-tickets-with-ticket-scanner'), 'desc'=>__('The hours will be subtracted from the starting time of the event. Only used if the option "wcTicketDontAllowRedeemTicketBeforeStart" is active.', 'event-tickets-with-ticket-scanner'), 'type'=>'number', 'def'=>1, "additional"=>["min"=>0], '_doc_video'=>'https://youtu.be/RL6d-hTJxes']; |
| 239 | $options[] = ['key'=>'wcTicketAllowRedeemTicketAfterEnd', 'label'=>__('Allow tickets to be redeemed after ending date and time', 'event-tickets-with-ticket-scanner'), 'desc'=>__('If active, the ticket can be redeemed after the end date and time of the event. If the product has no end date, it will be ignored. If the product just have a date and no time, then the time will be set to 23:59 for the test.', 'event-tickets-with-ticket-scanner'), 'type'=>'checkbox', '_doc_video'=>'https://youtu.be/gVXnsBsEGNI']; |
| 240 | $options[] = [ |
| 241 | 'key'=>'wcTicketScannerCVVMaskInput', |
| 242 | 'label'=>__("Scanner: mask the CVV input field", 'event-tickets-with-ticket-scanner'), |
| 243 | 'desc'=>__("If active (default), the security-code input on the ticket scanner shows the typed characters as dots, helping against shoulder-surfing from people queuing behind. Disable for verbal entry where the staff types what the customer says.", 'event-tickets-with-ticket-scanner'), |
| 244 | 'type'=>"checkbox", |
| 245 | 'def'=>true |
| 246 | ]; |
| 247 | $options[] = [ |
| 248 | 'key'=>'wcTicketScannerCVVOneStageFlow', |
| 249 | 'label'=>__("Scanner: use compact one-stage CVV flow", 'event-tickets-with-ticket-scanner'), |
| 250 | 'desc'=>__("If active, the security-code input and the redeem button appear on the same screen. If inactive (default), the scanner shows a two-stage flow: first hand the device to the customer to enter the code, then the staff sees a confirmation and redeems.", 'event-tickets-with-ticket-scanner'), |
| 251 | 'type'=>"checkbox", |
| 252 | 'def'=>false |
| 253 | ]; |
| 254 | $options[] = ['key'=>'ticketScannerDontRememberCamChoice', 'label'=>__('Do not store the chosen cam device id on your browser', 'event-tickets-with-ticket-scanner'), 'desc'=>__('To speed up the scanning start, the camera device id is stored within the browser for the ticket scanner. If you do not want this, you can deactivate this option. Additionally you can use the button within the ticket scanner at the bottom to clear the stored device id from your browser.', 'event-tickets-with-ticket-scanner'), 'type'=>'checkbox', '_doc_video'=>'https://youtu.be/myaUMHgGHZg']; |
| 255 | $options[] = ['key'=>'ticketScannerDontShowOptionControls', 'label'=>__('Do not show the option controls', 'event-tickets-with-ticket-scanner'), 'desc'=>__('Hide the options of the ticket scanner from the ticket scanner view. So the person who is scanning cannot change the options. The presets are taking as default. If not active, the users choice on the ticket scanner will be used.', 'event-tickets-with-ticket-scanner'), 'type'=>'checkbox', '_doc_video'=>'https://youtu.be/CnmTN1K-Z1o']; |
| 256 | $options[] = ['key'=>'ticketScannerDontShowBtnPDF', 'label'=>__('Do not show the PDF download button', 'event-tickets-with-ticket-scanner'), 'desc'=>__('Hide the PDF button on the ticket scanner.', 'event-tickets-with-ticket-scanner'), 'type'=>'checkbox', '_doc_video'=>'https://youtu.be/0P9nEVbKy0M']; |
| 257 | $options[] = ['key'=>'ticketScannerDontShowBtnBadge', 'label'=>__('Do not show the Badge download button', 'event-tickets-with-ticket-scanner'), 'desc'=>__('Hide the Badge button on the ticket scanner.', 'event-tickets-with-ticket-scanner'), 'type'=>'checkbox', '_doc_video'=>'https://youtu.be/0P9nEVbKy0M']; |
| 258 | $options[] = ['key'=>'ticketScannerPWA', 'label'=>__('Enable PWA (Progressive Web App) for Ticket Scanner', 'event-tickets-with-ticket-scanner'), 'desc'=>__('If active, the ticket scanner can be installed as an app on mobile devices. It will be available from the home screen and open without browser chrome.', 'event-tickets-with-ticket-scanner'), 'type'=>'checkbox', 'def'=>false]; |
| 259 | $options[] = ['key'=>'ticketScannerThemeColor', 'label'=>__('Scanner theme color', 'event-tickets-with-ticket-scanner'), 'desc'=>__('This color is used for the "Scan next Ticket" button, the loading spinner animation, and the PWA status bar (if PWA is enabled). Change it to match your brand. Default is #2e74b5 (blue).', 'event-tickets-with-ticket-scanner'), 'type'=>'color', 'def'=>'#2e74b5']; |
| 260 | $options[] = ['key'=>'ticketScannerShowSeatingPlan', 'label'=>__('Show seating plan button on ticket scanner', 'event-tickets-with-ticket-scanner'), 'desc'=>__('If active, a button will be shown to display the seating plan with the scanned seat highlighted. Only visible if the ticket has a seat assigned and the plan is visual.', 'event-tickets-with-ticket-scanner'), 'type'=>'checkbox', 'def'=>true]; |
| 261 | $options[] = ['key'=>'ticketScannerShowVenueImage', 'label'=>__('Show venue image button on ticket scanner', 'event-tickets-with-ticket-scanner'), 'desc'=>__('If active, a button will be shown to display the venue image. Only visible if the ticket has a seat assigned and the plan has a venue image.', 'event-tickets-with-ticket-scanner'), 'type'=>'checkbox', 'def'=>true]; |
| 262 | $options[] = ['key'=>'ticketScannerStartCamWithoutButtonClicked', 'label'=>__('Preset: Start cam to scan next ticket immediately', 'event-tickets-with-ticket-scanner'), 'desc'=>__('If active, the ticket scanner will skip the scan-next-button and start the cam immediately.', 'event-tickets-with-ticket-scanner'), 'type'=>'checkbox', '_doc_video'=>'https://youtu.be/itsipS8HNbw']; |
| 263 | $options[] = ['key'=>'ticketScannerScanAndRedeemImmediately', 'label'=>__('Preset: Scan and Redeem immediately', 'event-tickets-with-ticket-scanner'), 'desc'=>__('If active, the ticket scanner will be preset with the option to scan the ticket and redeem it with the scan.', 'event-tickets-with-ticket-scanner'), 'type'=>'checkbox', '_doc_video'=>'https://youtu.be/wzWTwWJg7QA']; |
| 264 | $options[] = ['key'=>'ticketScannerHideTicketInformation', 'label'=>__('Preset: Hide ticket information', 'event-tickets-with-ticket-scanner'), 'desc'=>__('If active, the ticket information wil not be shown.', 'event-tickets-with-ticket-scanner'), 'type'=>'checkbox', '_doc_video'=>'https://youtu.be/StDkB_u0PZc']; |
| 265 | $options[] = ['key'=>'ticketScannerHideTicketInformationShowShortDesc', 'label'=>__('Preset: Display short description if ticket information is hidden', 'event-tickets-with-ticket-scanner'), 'desc'=>__('If active, the ticket short description will be shown at the top after the ticket is retrieved. It is only executed if the ticket information is hidden.', 'event-tickets-with-ticket-scanner'), 'type'=>'checkbox', '_doc_video'=>'']; |
| 266 | $options[] = ['key'=>'ticketScannerVibrate', 'label'=>__('Preset: Haptic feedback (vibration) on scan result', 'event-tickets-with-ticket-scanner'), 'desc'=>__('If active, the device will vibrate when a ticket is redeemed. Short vibration for success, triple pulse for failure. Only works on devices that support vibration (most Android phones).', 'event-tickets-with-ticket-scanner'), 'type'=>'checkbox', 'def'=>true]; |
| 267 | $additional = [ "multiple"=>0, "values"=>[ ["label"=>__('Do not change the order status', 'event-tickets-with-ticket-scanner'), "value"=>"1"] ] ]; |
| 268 | foreach($order_status as $key => $value) { |
| 269 | $additional['values'][] = ["label"=>$value, "value"=>$key]; |
| 270 | } |
| 271 | $options[] = [ |
| 272 | 'key'=>'ticketScannerSetOrderStatusAfterRedeem', |
| 273 | 'label'=>__("Choose the new order status if you redeem successfully a ticket", 'event-tickets-with-ticket-scanner'), |
| 274 | 'desc'=>__("In doubt, do not play with it. :) If an order status is choosen and the ticket is redeemed successfully, then the order status will be set to your choice. If none is selected then nothing happens with the order.", 'event-tickets-with-ticket-scanner'), |
| 275 | 'type'=>"dropdown", |
| 276 | 'additional'=>$additional, |
| 277 | 'isPublic'=>false |
| 278 | ]; |
| 279 | $options[] = [ |
| 280 | 'key'=>'ticketScannerSetOrderStatusAfterTicketView', |
| 281 | 'label'=>__("Choose the new order status if your customer view the ticket details and/or download the PDF ticket", 'event-tickets-with-ticket-scanner'), |
| 282 | 'desc'=>__("In doubt, do not play with it. :) If an order status is choosen and the ticket is viewed online or the PDF is downloaded, then the order status will be set to your choice. This includes the order detail view and the download of the order PDF ticket. If none is selected then nothing happens with the order. <b>Warning: </b> If you change the order to eg. refunded and the option is activate, then the order will be set to your new order, just because your customer was downloading the PDF ticket! For almost all uses cases this option makes no sense - it is just for a few special use cases needed.", 'event-tickets-with-ticket-scanner'), |
| 283 | 'type'=>"dropdown", |
| 284 | 'additional'=>$additional, |
| 285 | 'isPublic'=>false |
| 286 | ]; |
| 287 | $options[] = ['key'=>'ticketScannerDisplayTimes', 'label'=>__('Display server and ticket times on the ticket scannner', 'event-tickets-with-ticket-scanner'), 'desc'=>__('If active, then the server time, time zone and ticket times are displayed additional to the ticket scanner info. Ticket times, only if available.', 'event-tickets-with-ticket-scanner'), 'type'=>'checkbox']; |
| 288 | |
| 289 | $options[] = [ |
| 290 | 'key'=>'h12b3', |
| 291 | 'label'=>__("Compatibility Mode", 'event-tickets-with-ticket-scanner'), |
| 292 | 'desc'=>__("These settings can help to make it work, in case you adjusted your server and/or Wordpress settings.", 'event-tickets-with-ticket-scanner'), |
| 293 | 'type'=>"heading" |
| 294 | ]; |
| 295 | $options[] = ['key'=>'wcTicketCompatibilityModeURLPath', 'label'=>__("Ticket detail URL path", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If left empty, default will be using the default ticket detail page from within the plugin folder. On some installations this leads to a 403 problem. If the the default ticket detail view of the plugin is not working try to set the ticket detail URL path. Make sure that the URL path does not exists, otherwise the page will be shown instead of the ticket. Example of a URL path 'event-tickets/myticket' or 'event-tickets/ticket-details/'. Any leading and trailing slash '/' will be ignored.", 'event-tickets-with-ticket-scanner'), 'type'=>"text", '_doc_video'=>'https://youtu.be/ZWDsHs_SYc8']; |
| 296 | $options[] = ['key'=>'wcTicketCompatibilityMode', 'label'=>__("Compatibility mode for ticket URL"), 'desc'=>__("If your theme is showing the 404 title or the ticket is not rendered at all, then you can try to use this compatibility mode. If active, then the URL /ticket/XYZ will be /ticket/?code=XYZ URL for the link to the ticket detail and ticket PDF page. Some themes causing issues with the normal mode."), 'type'=>"checkbox", '_doc_video'=>'https://youtu.be/KhJXtuBnr10']; |
| 297 | $options[] = ['key'=>'wcTicketCompatibilityUseURL', 'label'=>__("Compatibility mode for ticket images using URL instead of file location"), 'desc'=>__("If your images on the PDF are not shown then this option trigger not to use the file location but an URL to your image. <b>Note:</b> Your firewall need to allow your system to call itsself to download the image that will be added to the PDF."), 'type'=>"checkbox", '_doc_video'=>'']; |
| 298 | $options[] = ['key'=>'wcTicketActivateOBFlush', 'label'=>__("Activate ob_end_flush"), 'desc'=>__("Some plugins and/or themes are injecting a ob (caching) operation and this can harm the PDF generation. If you experience, that your PDF ticket is not rendered, you can try to activate this option. But it can slow down a bit your wordpress installation!"), 'type'=>"checkbox", '_doc_video'=>'https://youtu.be/8ynFKPc-xKE']; |
| 299 | $options[] = ['key'=>'wcTicketCompatibilityModeRestURL', 'label'=>__("Rest Service URL path", 'event-tickets-with-ticket-scanner'), 'desc'=>__("In case your ticket scanner cannot call the Rest service, because your setup is using a different location for the wordpress system, then you can add here the URL to your system. If left empty, default will be using the default retrieved from your server. You can add only FQDN, like 'https://yourdomain'. This will be concatenated to the /wp-json/...", 'event-tickets-with-ticket-scanner'), 'type'=>"text", '_doc_video'=>'https://youtu.be/I8CVpGNwLtI']; |
| 300 | |
| 301 | $options[] = [ |
| 302 | 'key'=>'hWallet', |
| 303 | 'label'=>__("Digital Wallets", 'event-tickets-with-ticket-scanner'), |
| 304 | 'desc'=>__("Allow your customers to add tickets to digital wallets.", 'event-tickets-with-ticket-scanner'), |
| 305 | 'type'=>"heading" |
| 306 | ]; |
| 307 | $walletDesc = __("If active, customers can add their tickets to the Vollstart Wallet app (wallet.vollstart.com). A button will appear on the ticket detail page and in order emails. The wallet app allows customers to collect tickets from multiple shops in one place. <b>Your data stays private</b> — ticket data flows directly from your shop to the customer's browser. Vollstart never receives or stores any ticket data.", 'event-tickets-with-ticket-scanner') . ' <a href="https://vollstart.com/vollstart-wallet/" target="_blank">' . __("Learn more about security & privacy", 'event-tickets-with-ticket-scanner') . '</a>'; |
| 308 | if (apply_filters('rest_enabled', true) === false || (defined('REST_API_VERSION') === false && !class_exists('WP_REST_Server'))) { |
| 309 | $walletDesc .= '<br><span style="color:#d63638;"><b>' . __("Warning: The WordPress REST API appears to be disabled. The Vollstart Wallet requires the REST API to function.", 'event-tickets-with-ticket-scanner') . '</b></span>'; |
| 310 | } |
| 311 | $options[] = ['key'=>'walletVollstartEnable', 'label'=>__("Enable Vollstart Wallet", 'event-tickets-with-ticket-scanner'), 'desc'=>$walletDesc, 'type'=>"checkbox", 'def'=>false]; |
| 312 | |
| 313 | $options[] = [ |
| 314 | 'key'=>'h12', |
| 315 | 'label'=>__("Woocommerce ticket sale", 'event-tickets-with-ticket-scanner'), |
| 316 | 'desc'=>__("You can assign a list to a product and this will generate or re-use a ticket from this list as a ticket number. It will be printed on the purchase information to the customer.", 'event-tickets-with-ticket-scanner'), |
| 317 | 'type'=>"heading" |
| 318 | ]; |
| 319 | //$options[] = ['key'=>'wcTicketDontShowRedeemBtnOnTicket', 'label'=>__("Do not show the redeem button on the ticket detail view for the client", 'event-tickets-with-ticket-scanner'),'desc'=>__("If active, it will not add the self-redeem button on the ticket detail view.", 'event-tickets-with-ticket-scanner'),'type'=>"checkbox", 'def'=>'', 'additional'=>[]]; |
| 320 | $options[] = ['key'=>'wcTicketShowRedeemBtnOnTicket', 'label'=>__("Show the redeem button on the ticket detail view for the client", 'event-tickets-with-ticket-scanner'),'desc'=>__("If active, it will add the self-redeem button on the ticket detail view.", 'event-tickets-with-ticket-scanner'),'type'=>"checkbox", 'def'=>'', 'additional'=>[], '_doc_video'=>'https://youtu.be/IH5Uqf023FE']; |
| 321 | $options[] = ['key'=>'wcTicketShowInputFieldsOnCheckoutPage', 'label'=>__("Show the input fields on the checkout page", 'event-tickets-with-ticket-scanner'),'desc'=>__("If active, it will add the input fields to ask for values configured on the product. Eg. name, date picker.", 'event-tickets-with-ticket-scanner'),'type'=>"checkbox", 'def'=>false, 'additional'=>[]]; |
| 322 | $options[] = ['key'=>'wcTicketPrefixTextCode', 'label'=>__("Text that will be added before the ticket number on the PDF invoice, order table and order details", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If left empty, default will be 'Ticket number:'", 'event-tickets-with-ticket-scanner'), 'type'=>"text", 'def'=>__("Ticket number:", 'event-tickets-with-ticket-scanner'), 'additional'=>[], 'isPublic'=>false, '_doc_video'=>'https://youtu.be/uP6l8_6qLG4']; |
| 323 | $options[] = ['key'=>'wcTicketDontDisplayPDFButtonOnDetail', 'label'=>__("Hide the PDF download button on ticket detail page", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will not display the PDF download button on the ticket detail view. But the PDF can still be generated with the URL.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/nF1fNu3HGOQ']; |
| 324 | // ── View access toggles ──────────────────────────────────────── |
| 325 | // Unlike the "Hide button" options above (which only hide a button while |
| 326 | // the URL stays reachable), these actually block rendering of a view. |
| 327 | // When off, output() shows a "deactivated" message / 403 instead. |
| 328 | // All default ON = current behaviour, so existing installs are unaffected. |
| 329 | $options[] = ['key'=>'h_view_access', 'label'=>__("View access (security)", 'event-tickets-with-ticket-scanner'), 'desc'=>__("Each output reachable through the ticket link can be switched off individually. When off, the view is no longer rendered and a short \"deactivated\" notice (or 403 for downloads) is shown instead. Turn views off you don't use to reduce the public surface of the ticket link — important if you also enable redeeming by plain ticket number. Note: links you already sent (e.g. in emails) to a disabled view will stop working.", 'event-tickets-with-ticket-scanner'), 'type'=>"heading"]; |
| 330 | $options[] = ['key'=>'wcTicketShowView', 'label'=>__("Show the ticket detail view", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If off, the HTML ticket detail page is no longer rendered and a \"deactivated\" notice is shown instead.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>true]; |
| 331 | $options[] = ['key'=>'wcTicketShowPDFView', 'label'=>__("Show the PDF ticket view", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If off, the ticket PDF can no longer be generated through the ticket link (403).", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>true]; |
| 332 | $options[] = ['key'=>'wcTicketShowICSView', 'label'=>__("Show the calendar (ICS) file", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If off, the ICS calendar file can no longer be downloaded through the ticket link (403).", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>true]; |
| 333 | $options[] = ['key'=>'wcTicketShowBadgeView', 'label'=>__("Show the badge PDF", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If off, the badge PDF can no longer be downloaded through the ticket link (403).", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>true]; |
| 334 | $options[] = ['key'=>'wcTicketShowOnePDFView', 'label'=>__("Show the \"all tickets in one PDF\" view", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If off, the combined \"all tickets of an order as one PDF\" download is no longer generated through the order link (403).", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>true]; |
| 335 | $options[] = ['key'=>'wcTicketShowCongressView', 'label'=>__("Show the event portal / congress view", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If off, the congress / event-portal page reachable through the ticket link is no longer rendered and a \"deactivated\" notice is shown instead.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>true]; |
| 336 | $options[] = ['key'=>'wcTicketAllowRedeemByTicketNumber', 'label'=>__("Allow redemption by plain ticket number", 'event-tickets-with-ticket-scanner'), 'desc'=>__("Off by default. If active, a ticket can <b>additionally</b> be redeemed using only the plain ticket number printed on the card. The full public ticket id keeps working <b>always</b> — the plain number is just accepted on top. Warning: for the plain number the copy protection (order/idcode check) does not apply — anyone who can read or guess the number could redeem it. Unsafe together with ticket reuse (option-ID <code>wcassignmentReuseNotusedCodes</code>).", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>false]; |
| 337 | $options[] = ['key'=>'wcTicketDisplayOrderTicketsViewLinkOnMail', 'label'=>__("Display the order detail view link with all tickets in one page in the purchase order email", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, a link to see all tickets QR codes within the purchase email to the client. This speeds up the entrance for groups and family ticket purchase. It wil be below the order details table.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"1", '_doc_video'=>'https://youtu.be/iNgJLj8a2iE']; |
| 338 | $options[] = ['key'=>'wcTicketDisplayOrderTicketsViewLinkOnCheckout', 'label'=>__("Display the order detail view link with all tickets in one page on the checkout page", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, a link to see all tickets QR codes within the checkout page will be placed. Only if the purchase has tickets. This speeds up the entrance for groups and family ticket purchase. It wil be above the order details table.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", '_doc_video'=>'https://youtu.be/P71ImAU0u3U']; |
| 339 | $options[] = ['key'=>'wcTicketDisplayDownloadAllTicketsPDFButtonOnMail', 'label'=>__("Display all tickets in one PDF download button/link on purchase order email", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, a link to download all tickets as one PDF within the purchase email to the client. It will be below the order details table.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/LCjfoNT9pcY']; |
| 340 | $options[] = ['key'=>'wcTicketDisplayDownloadAllTicketsPDFButtonOnCheckout', 'label'=>__("Display all tickets in one PDF download button/link on the checkout page", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, a link to download all tickets as one PDF on the checkout page above the order details will be placed. Only if the purchase has tickets.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/pZUuVDqhPiI']; |
| 341 | $options[] = ['key'=>'wcTicketDisplayDownloadAllTicketsPDFButtonOnOrderdetail', 'label'=>__("Display all tickets in one PDF download button/link on the order detail view", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, a link to download all tickets as one PDF on the order detail page below the tickets will be placed. Only if the purchase has tickets.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>""]; |
| 342 | $options[] = ['key'=>'wcTicketDontDisplayPDFButtonOnMail', 'label'=>__("Hide the PDF download button/link on purchase order email", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will not display the PDF download option for a single ticket on the purchase email to the client. But the PDF can still be generated with the URL.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/8ZttYE1RFWY']; |
| 343 | $options[] = ['key'=>'wcTicketDontDisplayDetailLinkOnMail', 'label'=>__("Hide the ticket detail page link on purchase order email", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will not display the URWeL to the ticket detail page on the purchase email to the client.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/yIiiI3qRKWY']; |
| 344 | $options[] = ['key'=>'wcTicketLabelPDFDownloadHeading', 'label'=>__("Heading for the Ticket Download section within the purchase order email", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If left empty, default will be 'Download Tickets' as the heading for the section below the order details table.", 'event-tickets-with-ticket-scanner'), 'type'=>"text", 'def'=>__("Download Tickets", 'event-tickets-with-ticket-scanner'), '_doc_video'=>'https://youtu.be/9B0X8OunLyE', '_do_not_trim'=>true]; |
| 345 | $options[] = ['key'=>'wcTicketLabelPDFDownload', 'label'=>__("Text that will be added as the PDF Ticket download label", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If left empty, default will be 'Download PDF Ticket' on the button and on the link within the purchase email.", 'event-tickets-with-ticket-scanner'), 'type'=>"text", 'def'=>__("Download PDF Ticket", 'event-tickets-with-ticket-scanner'), '_doc_video'=>'https://youtu.be/TDo86oywJpw']; |
| 346 | $options[] = ['key'=>'wcTicketLabelOrderDetailView', 'label'=>__("Text that will be added as the Order Ticket detail view label", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If left empty, default will be 'Open Tickets' on the link within the purchase email.", 'event-tickets-with-ticket-scanner'), 'type'=>"text", 'def'=>__("Open Tickets", 'event-tickets-with-ticket-scanner'), '_doc_video'=>'https://youtu.be/p2OslJXaOQk']; |
| 347 | $options[] = ['key'=>'wcTicketSetOrderToCompleteIfAllOrderItemsAreTickets', 'label'=>__("Set the order automatically to completed, if all purchased products are tickets", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active and all items of the order are tickets, then it will set the order status to completed if the order status is 'processing' and all purchased items in the order are tickets.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/roFt6yf7V6Y']; |
| 348 | $options[] = ['key'=>'wcTicketHideTicketAfterEventEnd', 'label'=>__("Hide ticket product after the event", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, then the plugin will search, once per day at 0:05, all ticket products that are public. Checks if the event date is set and expireed, and then set it to 'hidden' if so. <b>Important: this is not working for day chooser tickets date, where your customer can select the event date! The system will use the end date, that is set on the end date value, to hide the product.</b>", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/vKQjVjfUnGc']; |
| 349 | $options[] = ['key'=>'wcTicketLabelCartForName', 'label'=>__("Label for error message on cart for missing text value", 'event-tickets-with-ticket-scanner'), 'desc'=>__("You can use the placeholder {PRODUCT_NAME} for the product name. If left empty, default will be 'The product {PRODUCT_NAME} requires a value for checkout.' as the error message on the cart.", 'event-tickets-with-ticket-scanner'), 'type'=>"text", 'def'=>__('The product "{PRODUCT_NAME}" requires a value for checkout.', 'event-tickets-with-ticket-scanner')]; |
| 350 | $options[] = ['key'=>'wcTicketLabelCartForValue', 'label'=>__("Label for error message on cart for not choosen dropdown value", 'event-tickets-with-ticket-scanner'), 'desc'=>__("You can use the placeholder {PRODUCT_NAME} for the product name. If left empty, default will be 'The product {PRODUCT_NAME} requires a value from the dropdown for checkout.' as the error message on the cart.", 'event-tickets-with-ticket-scanner'), 'type'=>"text", 'def'=>__('The product "{PRODUCT_NAME}" requires a value from the dropdown for checkout.', 'event-tickets-with-ticket-scanner')]; |
| 351 | $options[] = ['key'=>'wcTicketLabelCartForDaychooser', 'label'=>__("Label for error message on cart for not choosen a date", 'event-tickets-with-ticket-scanner'), 'desc'=>__("You can use the placeholder {PRODUCT_NAME} and {count} for the product name. If left empty, default will be 'The product {PRODUCT_NAME} requires a value from the dropdown for checkout.' as the error message on the cart.", 'event-tickets-with-ticket-scanner'), 'type'=>"text", 'def'=>__('The product "{PRODUCT_NAME}" requires a valid date.', 'event-tickets-with-ticket-scanner')]; |
| 352 | $options[] = ['key'=>'wcTicketLabelCartForDaychooserInvalidDate', 'label'=>__("Label for error message on cart for wrong date", 'event-tickets-with-ticket-scanner'), 'desc'=>__("You can use the placeholder {PRODUCT_NAME} and {count} for the product name. If left empty, default will be 'The product {PRODUCT_NAME} requires a valid date.' as the error message on the cart.", 'event-tickets-with-ticket-scanner'), 'type'=>"text", 'def'=>__('The product "{PRODUCT_NAME}" requires a valid date.', 'event-tickets-with-ticket-scanner')]; |
| 353 | $options[] = ['key'=>'wcTicketLabelCartForDaychooserPassedDate', 'label'=>__("Label for error message on cart if the date is in the past", 'event-tickets-with-ticket-scanner'), 'desc'=>__("You can use the placeholder {PRODUCT_NAME} and {count} for the product name. If left empty, default will be 'The product {PRODUCT_NAME} requires a date from today or in the future.' as the error message on the cart.", 'event-tickets-with-ticket-scanner'), 'type'=>"text", 'def'=>__('The product {PRODUCT_NAME} requires a date from today or in the future.', 'event-tickets-with-ticket-scanner')]; |
| 354 | |
| 355 | $options[] = [ |
| 356 | 'key'=>'h12b2', |
| 357 | 'label'=>__("Ticket PDF settings", 'event-tickets-with-ticket-scanner'), |
| 358 | 'desc'=>"", |
| 359 | 'type'=>"heading" |
| 360 | ]; |
| 361 | $options[] = ['key'=>'wcTicketPDFFontSize', 'label'=>__("Font size for text on the ticket PDF", 'event-tickets-with-ticket-scanner'), 'desc'=>__("Please choose a font size between 6pt and 16pt.", 'event-tickets-with-ticket-scanner'), 'type'=>"dropdown", 'def'=>10, "additional"=>[ "values"=>[["label"=>"6pt", "value"=>6], ["label"=>"7pt", "value"=>7], ["label"=>"8pt", "value"=>8], ["label"=>"9pt", "value"=>9], ["label"=>"10pt", "value"=>10], ["label"=>"11pt", "value"=>11], ["label"=>"12pt", "value"=>12], ["label"=>"13pt", "value"=>13], ["label"=>"14pt", "value"=>14], ["label"=>"15pt", "value"=>15], ["label"=>"16pt", "value"=>16]]], '_doc_video'=>'https://youtu.be/dhdPDE_zuwY']; |
| 362 | |
| 363 | $font_families = $this->MAIN->getNewPDFObject()->getPossibleFontFamiles(); |
| 364 | $font_infos = $this->MAIN->getNewPDFObject()->getFontInfos(); |
| 365 | $font_def = $font_families["default"]; |
| 366 | $additional = [ "values"=>[] ]; |
| 367 | sort($font_families["fonts"]); |
| 368 | foreach($font_families["fonts"] as $font) { |
| 369 | $label = ["label"=>$font, "value"=>$font]; |
| 370 | if (isset($font_infos[$font]) && isset($font_infos[$font]['name'])) { |
| 371 | $label['label'] .= " (".$font_infos[$font]['name'].")"; |
| 372 | } |
| 373 | if (isset($font_infos[$font]) && isset($font_infos[$font]['lang_support']) && !empty($font_infos[$font]['lang_support'])) { |
| 374 | $label['label'] .= " - ".$font_infos[$font]['lang_support']; |
| 375 | } |
| 376 | $additional['values'][] = $label; |
| 377 | } |
| 378 | $options[] = ['key'=>'wcTicketPDFFontFamily', 'label'=>__("Font family for text on the ticket PDF", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If you need special characters you might change the font.", 'event-tickets-with-ticket-scanner'), 'type'=>"dropdown", 'def'=>$font_def, "additional"=>$additional, '_doc_video'=>'https://youtu.be/e-8tS_kv3SU' ]; |
| 379 | $options[] = ['key'=>'wcTicketPDFStripHTML', 'label'=>__("Strip HTML from text", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If you experience issues with the rendered PDF, then you can change the settings here to strip some not garanteed supported elements or choose even to display the HTML code (helps for debug purpose).", 'event-tickets-with-ticket-scanner'), 'type'=>"dropdown", 'def'=>2, "additional"=>[ "values"=>[["label"=>__("No HTML strip", 'event-tickets-with-ticket-scanner'), "value"=>1], ["label"=>__("Remove unsupported HTML (default)", 'event-tickets-with-ticket-scanner'), "value"=>2], ["label"=>__("Show HTML Tags as text (Debugging)", 'event-tickets-with-ticket-scanner'), "value"=>3]]], '_doc_video'=>'https://youtu.be/nLKu9cxH95w' ]; |
| 380 | $options[] = ['key'=>'wcTicketPDFDisplayVariantName', 'label'=>__("Display product variant name", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, the variant name(s) will be display below the title without its variant id. Just the variant value. If more than one variant is choosen, then the delimiter will be a blank space.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", '_doc_video'=>'https://youtu.be/mGIgFK_tpH0' ]; |
| 381 | $options[] = ['key'=>'wcTicketDisplayShortDesc', 'label'=>__("Display the short description of the product on the ticket", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will be printed on the ticket detail view.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", 'additional'=>[], '_doc_video'=>'https://youtu.be/5iawZi4_KOk']; |
| 382 | $options[] = ['key'=>'wcTicketDisplayCustomerNote', 'label'=>__("Display the customer note of the order on the ticket", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will be printed on the ticket detail view.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", 'additional'=>[], '_doc_video'=>'https://youtu.be/muzZWYo0eaE']; |
| 383 | $options[] = ['key'=>'wcTicketDontDisplayCustomer', 'label'=>__("Hide the customer name and address on the ticket", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will not print the customer information on the ticket detail view.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", 'additional'=>[], '_doc_video'=>'https://youtu.be/wkDLm421pQ8']; |
| 384 | $options[] = ['key'=>'wcTicketDontDisplayPayment', 'label'=>__("Hide the payment method on the ticket", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will not print the payment details on the ticket detail view.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", 'additional'=>[], '_doc_video'=>'https://youtu.be/iLvQQ9BvSZI']; |
| 385 | $options[] = ['key'=>'wcTicketDontDisplayPrice', 'label'=>__("Hide your ticket price.", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, the ticket price will not be displayed on the ticket and the PDF ticket. The ticket scanner will still display the price.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/vV_1D0DgQ8g']; |
| 386 | // is already defined on the payment options $options[] = ['key'=>'wcTicketDisplayUsedCouponCode', 'label'=>__("Display the used coupon code.", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, the used coupon code will be added to the PDF ticket.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>""]; |
| 387 | $options[] = ['key'=>'wcTicketDisplayProductAddons', 'label'=>__('Display the add ons of the purchased items of the order on the ticket', 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will print all the add on products of the order on the ticket. You can use the woocommerce (from another plugin) function 'wc_product_addons_get_product_addons', if it exists, otherwise the default template will iterate over the meta property '_product_addons'.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", 'additional'=>[], '_doc_video'=>'https://youtu.be/UgUk591MxSc']; |
| 388 | $options[] = ['key'=>'wcTicketDisplayPurchasedItemFromOrderOnTicket', 'label'=>__('Display the purchased items of the order on the ticket', 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will print all the products of the order on the ticket. The ticket product will be excluded from the list.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", 'additional'=>[]]; |
| 389 | $options[] = ['key'=>'wcTicketDisplayPurchasedTicketQuantity', 'label'=>__("Display the quantity of the purchased item on the ticket.", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will print the amount of the purchased tickets on the ticket.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", 'additional'=>[], '_doc_video'=>'https://youtu.be/cvjU_AtCBlw']; |
| 390 | $options[] = ['key'=>'wcTicketDisplayTicketListName', 'label'=>__("Display the ticket list name on the ticket.", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will print the name of the ticket list.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", 'additional'=>[], '_doc_video'=>'https://youtu.be/txjtMQlTwQY']; |
| 391 | $options[] = ['key'=>'wcTicketDisplayTicketListDesc', 'label'=>__("Display the ticket list description on the ticket.", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will print the description of the ticket list on the ticket.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", 'additional'=>[], '_doc_video'=>'https://youtu.be/LpnQksmZm6w']; |
| 392 | $options[] = ['key'=>'wcTicketPrefixTextTicketQuantity', 'label'=>__("Text that will be added to the PDF if the option <b>'Display the quantity of the purchased tickets'</b> is activated.", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If left empty, default will be '{TICKET_POSITION} of {TICKET_TOTAL_AMOUNT} Tickets'. {TICKET_POSITION} will be replaced with the position within the quantity of the item purchase. {TICKET_TOTAL_AMOUNT} will be replaced with the quantity of the purchased tickets for the order.", 'event-tickets-with-ticket-scanner'), 'type'=>"text", 'def'=>__("{TICKET_POSITION} of {TICKET_TOTAL_AMOUNT} Tickets", 'event-tickets-with-ticket-scanner'), 'additional'=>[], 'isPublic'=>false, '_doc_video'=>'https://youtu.be/lBUQVkkMR90']; |
| 393 | $options[] = ['key'=>'wcTicketDisplayTicketUserValue', 'label'=>__("Display the registered user value on the ticket.", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will print the registered user value on the ticket. The value and the label for it are only displayed, if the registered user value is not empty.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", 'additional'=>[], '_doc_video'=>'https://youtu.be/z4aNIMfeJFU']; |
| 394 | $options[] = ['key'=>'wcTicketDontDisplayBlogName', 'label'=>__("Hide your wordpress name", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will not display the wordpress name.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/XG2NQaOZ9MQ']; |
| 395 | $options[] = ['key'=>'wcTicketDontDisplayBlogDesc', 'label'=>__("Hide your blog description", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will not display the wordpress description.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/qAjqxS0ju14']; |
| 396 | $options[] = ['key'=>'wcTicketDontDisplayBlogURL', 'label'=>__("Hide your wordpress URL", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will not display the wordpress URL.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/4-bT1REPGgY']; |
| 397 | $options[] = ['key'=>'wcTicketAdditionalTextBottom', 'label'=>__("You can display additional text on the PDF ticket", 'event-tickets-with-ticket-scanner'), 'desc'=>__('If you enter text here, then it will be added to the PDF ticket at the bottom part. You can add some corporate details if needed.', 'event-tickets-with-ticket-scanner'), 'type'=>"vtext", 'def'=>"", "additional"=>["rows"=>5, "height"=>"180"], '_doc_video'=>'https://youtu.be/abpt3we8g-A']; |
| 398 | $options[] = ['key'=>'wcTicketTicketLogo', 'label'=>__("Display a small logo (max. 300x300px) at the bottom in the center", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If a media file is chosen, the logo will be placed on the ticket PDF.", 'event-tickets-with-ticket-scanner'), 'type'=>"media", 'def'=>"" |
| 399 | , 'additional'=>[ |
| 400 | 'max'=>['width'=>200,'height'=>200], |
| 401 | 'button'=>esc_attr__('Choose logo for the ticket PDF', 'event-tickets-with-ticket-scanner'), |
| 402 | 'msg_error'=>[ |
| 403 | 'width'=>__('Too big! Choose an image with smaller size. Max 300px width, otherwise it will look not good on your ticket.', 'event-tickets-with-ticket-scanner') |
| 404 | ] |
| 405 | ], '_doc_video'=>'https://youtu.be/h73JTqf20og' |
| 406 | ]; |
| 407 | $options[] = ['key'=>'wcTicketTicketBanner', 'label'=>__("Display a banner image at the top of the PDF", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If a media file is chosen, the banner will be placed on the ticket PDF.", 'event-tickets-with-ticket-scanner'), 'type'=>"media", 'def'=>"" |
| 408 | , 'additional'=>[ |
| 409 | 'min'=>['width'=>600], |
| 410 | 'button'=>esc_attr__('Choose banner image for the ticket PDF', 'event-tickets-with-ticket-scanner'), |
| 411 | 'msg_error_min'=>[ |
| 412 | 'width'=>__('Too small! Choose an image with bigger size. Min 600px width, otherwise it will look not good on your ticket.', 'event-tickets-with-ticket-scanner') |
| 413 | ] |
| 414 | ] |
| 415 | , '_doc_video'=>'https://youtu.be/k75miUvm1cc' |
| 416 | ]; |
| 417 | $options[] = ['key'=>'wcTicketTicketBG', 'label'=>__("Display a background image at the center of the PDF", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If a media file is chosen, the image will be placed on the ticket PDF.", 'event-tickets-with-ticket-scanner'), 'type'=>"media", 'def'=>"" |
| 418 | , 'additional'=>[ |
| 419 | 'button'=>esc_attr__('Choose background image for the ticket PDF', 'event-tickets-with-ticket-scanner') |
| 420 | ] |
| 421 | , '_doc_video'=>'https://youtu.be/o-avTDm8gKY' |
| 422 | ]; |
| 423 | $options[] = ['key'=>'wcTicketTicketAttachPDFOnTicket', 'label'=>__("Attach additional PDF to the PDF ticket", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If a PDF file is chosen, the PDF will be attached to the PDF ticket.", 'event-tickets-with-ticket-scanner'), 'type'=>"media", 'def'=>"" |
| 424 | , 'additional'=>[ |
| 425 | 'type_filter'=>'*', |
| 426 | 'button'=>esc_attr__('Choose PDF to be added to the ticket PDF', 'event-tickets-with-ticket-scanner') |
| 427 | ] |
| 428 | , '_doc_video'=>'https://www.youtube.com/watch?v=YvpcNsfjNC8' |
| 429 | ]; |
| 430 | |
| 431 | $options[] = [ |
| 432 | 'key'=>'h120', |
| 433 | 'label'=>__("Seating Plan settings", 'event-tickets-with-ticket-scanner'), |
| 434 | 'desc'=>"", |
| 435 | 'type'=>"heading" |
| 436 | ]; |
| 437 | $additional = [ "values"=>[] ]; |
| 438 | $options[] = [ |
| 439 | 'key'=>'seatingBlockTimeout', |
| 440 | 'label'=>__("Seat reservation timeout (minutes)", 'event-tickets-with-ticket-scanner'), |
| 441 | 'desc'=>__("How long a seat is reserved for a customer before it becomes available again. Default is 15 minutes.", 'event-tickets-with-ticket-scanner'), |
| 442 | 'type'=>"dropdown", |
| 443 | 'def'=>15, |
| 444 | 'additional'=>["values"=> |
| 445 | [ |
| 446 | ["label"=>'5 ' . __('minutes', 'event-tickets-with-ticket-scanner'), "value"=>5], |
| 447 | ["label"=>'10 ' . __('minutes', 'event-tickets-with-ticket-scanner'), "value"=>10], |
| 448 | ["label"=>'15 ' . __('minutes', 'event-tickets-with-ticket-scanner') . ' (' . __('default', 'event-tickets-with-ticket-scanner') . ')', "value"=>15], |
| 449 | ["label"=>'20 ' . __('minutes', 'event-tickets-with-ticket-scanner'), "value"=>20], |
| 450 | ["label"=>'30 ' . __('minutes', 'event-tickets-with-ticket-scanner'), "value"=>30], |
| 451 | ["label"=>'45 ' . __('minutes', 'event-tickets-with-ticket-scanner'), "value"=>45], |
| 452 | ["label"=>'60 ' . __('minutes', 'event-tickets-with-ticket-scanner'), "value"=>60] |
| 453 | ] |
| 454 | ] |
| 455 | ]; |
| 456 | $options[] = [ |
| 457 | 'key'=>'seatingHideExpirationTime', |
| 458 | 'label'=>__("Hide seat reservation expiration time", 'event-tickets-with-ticket-scanner'), |
| 459 | 'desc'=>__("If active, the countdown timer showing when the seat reservation expires will be hidden. This can help prevent automated bots from exploiting the reservation system.", 'event-tickets-with-ticket-scanner'), |
| 460 | 'type'=>"checkbox", |
| 461 | 'def'=>false |
| 462 | ]; |
| 463 | $options[] = [ |
| 464 | 'key'=>'seatingLockSelectedSeats', |
| 465 | 'label'=>__("Lock selected seats (no deselection)", 'event-tickets-with-ticket-scanner'), |
| 466 | 'desc'=>__("If active, once a seat is selected it cannot be deselected by clicking on it again. Only replacement by selecting another seat is possible. Useful when integrating with third-party systems that need time to sync.", 'event-tickets-with-ticket-scanner'), |
| 467 | 'type'=>"checkbox", |
| 468 | 'def'=>false |
| 469 | ]; |
| 470 | $options[] = [ |
| 471 | 'key'=>'seatingRemoveExpiredFromCart', |
| 472 | 'label'=>__("Auto-remove cart items with expired seat reservations", 'event-tickets-with-ticket-scanner'), |
| 473 | 'desc'=>__("If active, cart items with expired seat reservations will be automatically removed from the cart. This prevents accidental purchases without selected seats.", 'event-tickets-with-ticket-scanner'), |
| 474 | 'type'=>"checkbox", |
| 475 | 'def'=>false |
| 476 | ]; |
| 477 | $options[] = [ |
| 478 | 'key'=>'seatingSeparateCartItems', |
| 479 | 'label'=>__("Create separate cart items for each seat", 'event-tickets-with-ticket-scanner'), |
| 480 | 'desc'=>__("If active, each seat selection creates a separate cart item (quantity 1). If inactive (default), seats are combined in one cart item like the date picker.", 'event-tickets-with-ticket-scanner'), |
| 481 | 'type'=>"checkbox", |
| 482 | 'def'=>false |
| 483 | ]; |
| 484 | $options[] = [ |
| 485 | 'key'=>'seatingBlockOnAddToCart', |
| 486 | 'label'=>__("Reserve seat only when adding to cart", 'event-tickets-with-ticket-scanner'), |
| 487 | 'desc'=>__("If active, seats are only reserved when adding to cart (not when selecting in the seat map). This reduces unnecessary reservations but increases the risk that a seat becomes unavailable.", 'event-tickets-with-ticket-scanner'), |
| 488 | 'type'=>"checkbox", |
| 489 | 'def'=>false |
| 490 | ]; |
| 491 | $options[] = [ |
| 492 | 'key'=>'seatingHeartbeatStaleTimeout', |
| 493 | 'label'=>__("Heartbeat stale timeout (seconds)", 'event-tickets-with-ticket-scanner'), |
| 494 | 'desc'=>__("If a user's browser stops sending heartbeats (e.g., closed tab), consider their seat reservation as stale/free after this many seconds. Set to 0 to disable (only use regular expiration). Default: 60 seconds.", 'event-tickets-with-ticket-scanner'), |
| 495 | 'type'=>"dropdown", |
| 496 | 'def'=>60, |
| 497 | 'additional'=>['values'=>[ |
| 498 | ["label"=>__('Disabled (use regular expiration)', 'event-tickets-with-ticket-scanner'), "value"=>0], |
| 499 | ["label"=>__('30 seconds', 'event-tickets-with-ticket-scanner'), "value"=>30], |
| 500 | ["label"=>__('60 seconds (default)', 'event-tickets-with-ticket-scanner'), "value"=>60], |
| 501 | ["label"=>__('90 seconds', 'event-tickets-with-ticket-scanner'), "value"=>90], |
| 502 | ["label"=>__('120 seconds', 'event-tickets-with-ticket-scanner'), "value"=>120] |
| 503 | ]] |
| 504 | ]; |
| 505 | $options[] = [ |
| 506 | 'key'=>'seatingHidePlanNameInScanner', |
| 507 | 'label'=>__("Hide seating plan name in ticket scanner", 'event-tickets-with-ticket-scanner'), |
| 508 | 'desc'=>__("If active, the seating plan name will not be displayed in the ticket scanner. Only the seat label and category will be shown.", 'event-tickets-with-ticket-scanner'), |
| 509 | 'type'=>"checkbox", |
| 510 | 'def'=>false |
| 511 | ]; |
| 512 | $options[] = [ |
| 513 | 'key'=>'seatingShowDescInScanner', |
| 514 | 'label'=>__("Show seat description in ticket scanner", 'event-tickets-with-ticket-scanner'), |
| 515 | 'desc'=>__("If active, the seat description will be displayed in the ticket scanner when scanning a ticket.", 'event-tickets-with-ticket-scanner'), |
| 516 | 'type'=>"checkbox", |
| 517 | 'def'=>false |
| 518 | ]; |
| 519 | $options[] = [ |
| 520 | 'key'=>'seatingShowDescOnTicket', |
| 521 | 'label'=>__("Show seat description on ticket (PDF/Designer)", 'event-tickets-with-ticket-scanner'), |
| 522 | 'desc'=>__("If active, the seat description will be displayed on the ticket PDF and ticket detail page.", 'event-tickets-with-ticket-scanner'), |
| 523 | 'type'=>"checkbox", |
| 524 | 'def'=>false |
| 525 | ]; |
| 526 | $options[] = [ |
| 527 | 'key'=>'seatingShowDescInCart', |
| 528 | 'label'=>__("Show seat description in cart", 'event-tickets-with-ticket-scanner'), |
| 529 | 'desc'=>__("If active, the seat description will be displayed in the cart and checkout.", 'event-tickets-with-ticket-scanner'), |
| 530 | 'type'=>"checkbox", |
| 531 | 'def'=>false |
| 532 | ]; |
| 533 | $options[] = [ |
| 534 | 'key'=>'seatingShowDescInChooser', |
| 535 | 'label'=>__("Show seat description in seating plan chooser", 'event-tickets-with-ticket-scanner'), |
| 536 | 'desc'=>__("If active, the seat description will be displayed when hovering or selecting a seat in the seating plan on the product page.", 'event-tickets-with-ticket-scanner'), |
| 537 | 'type'=>"checkbox", |
| 538 | 'def'=>false |
| 539 | ]; |
| 540 | $options[] = ['key'=>'h16', 'label'=>__("Ticket Designer", 'event-tickets-with-ticket-scanner'), 'desc'=>__("You can design your ticket look & feel. You are able to preview your ticket design within the second ticket design textarea. This template will be used on the ticket detail view, ticket PDF", 'event-tickets-with-ticket-scanner'), 'type'=>"heading"]; |
| 541 | $options[] = ['key'=>'wcTicketTemplateUseDefault', 'label'=>__("Use the default template for the ticket", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, then the ticket template code will not be used. Best for beginners, who do not want to adjust the ticket template code. If the ticket template code is empty, then it will also use the default template code.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/sV1L2MJtq8M']; |
| 542 | $options[] = ['key'=>'h16_desc', 'label'=>__('The plugin is using the Twig template engine (3.22.0). This is a well documented tempklate engine that gives you a great freedom.<br><a target="_blank" href="https://twig.symfony.com/doc/3.x/">Open Documentation of Twig</a>', 'event-tickets-with-ticket-scanner'), 'desc'=>"You can use the following variables:<ul><li>PRODUCT</li><li>PRODUCT_PARENT</li><li>PRODUCT_ORIGINAL (in case you use WPML plugin, might be helpful - all the event tickets settings are on the original product)</li><li>PRODUCT_PARENT_ORIGINAL (in case you use WPML plugin, might be helpful - all the event tickets settings are on the original parent product - for variant/variable product)</li><li>OPTIONS</li><li>TICKET</li><li>ORDER</li><li>ORDER_ITEM</li><li>CODEOBJ</li><li>METAOBJ</li><li>LISTOBJ</li><li>LIST_METAOBJ</li><li>is_variation</li><li>forPDFOutput</li><li>isScanner</li><li>WPDB</li></ul>ACF support: you can use the function get_field to retrieve an ACF field value. You need to provide the product_id. e.g. {{ get_field('some_value', PRODUCT_PARENT.get_id)|escape }} or {{ get_field('some_value', PRODUCT_PARENT.get_id)|escape('wp_kses_post')|raw }} and so on.", 'type'=>"desc"]; |
| 543 | $options[] = ['key'=>'wcTicketPDFZeroMargin', 'label'=>__("Do not use padding within the PDF ticket", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, then the PDF content will start directly from the beginning of the paper. You need to add your own padding and margin within the template.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/2Ek2qkjHNAY']; |
| 544 | $options[] = ['key'=>'wcTicketPDFFullBleed', 'label'=>__("Full bleed mode (no margins at all)", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, removes ALL margins, paddings and cell spacings from the PDF. Use this for edge-to-edge background images. Requires 'Do not use padding' to be active. Warning: This may affect existing ticket designs!", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>""]; |
| 545 | $options[] = ['key'=>'wcTicketPDFBackgroundColor', 'label'=>__("Ticket background color", 'event-tickets-with-ticket-scanner'), 'desc'=>__("This color will be used as the background color for the ticket PDF. Useful when you don't have a background image or as a fallback. Leave empty or white (#FFFFFF) for no background color.", 'event-tickets-with-ticket-scanner'), 'type'=>"color", 'def'=>"#FFFFFF"]; |
| 546 | $options[] = ['key'=>'wcTicketPDFisRTL', 'label'=>__("BETA Use RTL for PDF", 'event-tickets-with-ticket-scanner'), 'desc'=>__("This feature is in Beta. This means, good results are not guaranteed, still optimizing this. If active, the PDF will be generated with RTL option active.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/7xmNgRmcrH0']; |
| 547 | $options[] = ['key'=>'wcTicketSizeWidth', 'label'=>__('Size in mm for the width', 'event-tickets-with-ticket-scanner'), 'desc'=>__('Will be used to set the width of the PDF. If empty or zero or lower than 20, the default of 210 will be used.', 'event-tickets-with-ticket-scanner'), 'type'=>'number', 'def'=>210, "additional"=>["min"=>20], '_doc_video'=>'https://youtu.be/c2XtUY2l1OM']; |
| 548 | $options[] = ['key'=>'wcTicketSizeHeight', 'label'=>__('Size in mm for the height', 'event-tickets-with-ticket-scanner'), 'desc'=>__('Will be used to set the height of the PDF. If empty or zero or lower than 20, the default of 297 will be used.', 'event-tickets-with-ticket-scanner'), 'type'=>'number', 'def'=>297, "additional"=>["min"=>20], '_doc_video'=>'https://youtu.be/c2XtUY2l1OM']; |
| 549 | $options[] = ['key'=>'wcTicketQRSize', 'label'=>__('Size for the QR code image on the PDF', 'event-tickets-with-ticket-scanner'), 'desc'=>__('Will be used to set the width and height of the QR code image on the PDF ticket. If empty or zero, the default of 50 will be used.', 'event-tickets-with-ticket-scanner'), 'type'=>'number', 'def'=>50, "additional"=>["min"=>0], '_doc_video'=>'https://youtu.be/c2XtUY2l1OM']; |
| 550 | $options[] = ['key'=>'wcTicketDesignerTemplate', 'label'=>__("The TWIG HTML value for the ticket. Use <b>{QRCODE_INLINE}</b> to place the QR-Code anywhere", 'event-tickets-with-ticket-scanner'), 'desc'=>__('If left empty, default will be used. Check out this additional information about how you could use it: <a href="https://vollstart.com/posts/events/documentation/option-wcticketdesignertemplate/" target="_blank">Option Documentation</a>', 'event-tickets-with-ticket-scanner'), 'type'=>"textarea", 'def'=>$this->MAIN->getTicketDesignerHandler()->getDefaultTemplate(), "additional"=>["rows"=>30], '_doc_video'=>'https://youtu.be/aAfZIwFE7Zk']; |
| 551 | |
| 552 | $options[] = ['key'=>'h16a', 'label'=>__("Ticket Designer Test", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"heading"]; |
| 553 | $options[] = ['key'=>'wcTicketPDFZeroMarginTest', 'label'=>__("Do not use padding within the <b>test</b> PDF ticket", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, then the PDF content will start directly from the beginning of the paper. You need to add your own padding and margin within the template.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/jewIPLsu5nw']; |
| 554 | $options[] = ['key'=>'wcTicketPDFFullBleedTest', 'label'=>__("Full bleed mode for <b>test</b> (no margins at all)", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, removes ALL margins, paddings and cell spacings from the test PDF. Use this for edge-to-edge background images.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>""]; |
| 555 | $options[] = ['key'=>'wcTicketPDFBackgroundColorTest', 'label'=>__("Ticket background color for <b>test</b>", 'event-tickets-with-ticket-scanner'), 'desc'=>__("This color will be used as the background color for the test ticket PDF. Useful when you don't have a background image.", 'event-tickets-with-ticket-scanner'), 'type'=>"color", 'def'=>"#FFFFFF"]; |
| 556 | $options[] = ['key'=>'wcTicketPDFisRTLTest', 'label'=>__("BETA Use RTL for PDF <b>test</b>", 'event-tickets-with-ticket-scanner'), 'desc'=>__("This feature is in Beta. This means, good results are not guaranteed, still optimizing this. If active, the PDF will be generated with RTL option active.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>""]; |
| 557 | $options[] = ['key'=>'wcTicketSizeWidthTest', 'label'=>__('Size in mm for the width of the <b>test</b>', 'event-tickets-with-ticket-scanner'), 'desc'=>__('Will be used to set the width of the PDF. If empty or zero, the default of 80 will be used.', 'event-tickets-with-ticket-scanner'), 'type'=>'number', 'def'=>210, "additional"=>["min"=>20], '_doc_video'=>'https://youtu.be/ylgo0rvn9SA']; |
| 558 | $options[] = ['key'=>'wcTicketSizeHeightTest', 'label'=>__('Size in mm for the height of the <b>test</b>', 'event-tickets-with-ticket-scanner'), 'desc'=>__('Will be used to set the height of the PDF. If empty or zero, the default of 120 will be used.', 'event-tickets-with-ticket-scanner'), 'type'=>'number', 'def'=>297, "additional"=>["min"=>20], '_doc_video'=>'https://youtu.be/ylgo0rvn9SA']; |
| 559 | $options[] = ['key'=>'wcTicketQRSizeTest', 'label'=>__('Size for the QR code image on the <b>test PDF</b>', 'event-tickets-with-ticket-scanner'), 'desc'=>__('Will be used to set the width and height of the QR code image on the PDF ticket. If empty or zero, the default of 50 will be used.', 'event-tickets-with-ticket-scanner'), 'type'=>'number', 'def'=>50, "additional"=>["min"=>0], '_doc_video'=>'https://youtu.be/ylgo0rvn9SA']; |
| 560 | $options[] = ['key'=>'wcTicketDesignerTemplateTest', 'label'=>__("The template screen <b>test code</b> - TWIG HTML value for the testing the ticket. Use <b>{QRCODE_INLINE}</b> to place the QR-Code anywhere", 'event-tickets-with-ticket-scanner'), 'desc'=>__('Only for administrator role. Within the admin ticket detail view, you can start the ticket detail page to view this template code. The easiest way is to open the preview in another browser window. Everytime you did a change and clicked out of the textarea, you can reload your ticket preview browser window to see the changes in effect. If you leave it empty, then the default template will be used.', 'event-tickets-with-ticket-scanner'), 'type'=>"editor", 'def'=>"", "additional"=>["rows"=>30,"height"=>"500px"], '_doc_video'=>'https://youtu.be/y5mp7JLTLgo']; |
| 561 | |
| 562 | $options[] = [ |
| 563 | 'key'=>'h12b1', |
| 564 | 'label'=>__("Ticket Translations", 'event-tickets-with-ticket-scanner'), |
| 565 | 'desc'=>'<a href="https://youtu.be/7ifrGSGTz3E" target="_blank">Video Explainer Part1</a> and <a href="https://youtu.be/SmrdxjwRocY" target="_blank">Video Explainer Part2</a>', |
| 566 | 'type'=>"heading", |
| 567 | '_doc_video'=>'' |
| 568 | ]; |
| 569 | $options[] = ['key'=>'wcTicketHeading', 'label'=>__("Ticket title", 'event-tickets-with-ticket-scanner'), 'desc'=>__("This is the title of the ticket", 'event-tickets-with-ticket-scanner'), 'type'=>"text", 'def'=>__("Ticket", 'event-tickets-with-ticket-scanner')]; |
| 570 | $options[] = ['key'=>'wcTicketTransExpired', 'label'=>__("Label 'EXPIRED' on the event date", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"text", 'def'=>__("EXPIRED", 'event-tickets-with-ticket-scanner')]; |
| 571 | $options[] = ['key'=>'wcTicketTransLocation', 'label'=>__("Label 'Location' heading on for the event location", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"text", 'def'=>__("Location", 'event-tickets-with-ticket-scanner')]; |
| 572 | $options[] = ['key'=>'wcTicketTransSeat', 'label'=>__("Label 'Seat' heading for the seat information", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"text", 'def'=>__("Seat", 'event-tickets-with-ticket-scanner')]; |
| 573 | $options[] = ['key'=>'wcTicketTransCustomer', 'label'=>__("Label 'Customer' heading on the customer details", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"text", 'def'=>__("Customer", 'event-tickets-with-ticket-scanner')]; |
| 574 | $options[] = ['key'=>'wcTicketTransPaymentDetail', 'label'=>__("Label 'Payment details' heading on the payment details", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"text", 'def'=>__("Payment details", 'event-tickets-with-ticket-scanner')]; |
| 575 | $options[] = ['key'=>'wcTicketTransPaymentDetailPaidAt', 'label'=>__("Label 'Order paid at' on the payment details", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"text", 'def'=>__("Order paid at:", 'event-tickets-with-ticket-scanner')]; |
| 576 | $options[] = ['key'=>'wcTicketTransPaymentDetailCompletedAt', 'label'=>__("Label 'Order completed at' on the payment details", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"text", 'def'=>__("Order completed at:", 'event-tickets-with-ticket-scanner')]; |
| 577 | $options[] = ['key'=>'wcTicketTransPaymentDetailPaidVia', 'label'=>__("Label 'Paid via' on the payment details", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"text", 'def'=>__("Paid via:", 'event-tickets-with-ticket-scanner')]; |
| 578 | $options[] = ['key'=>'wcTicketTransPaymentDetailFreeTicket', 'label'=>__("Label 'Free ticket' on the payment details", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"text", 'def'=>__("Free ticket", 'event-tickets-with-ticket-scanner')]; |
| 579 | $options[] = ['key'=>'wcTicketTransPaymentDetailCouponUsed', 'label'=>__("Label 'Coupon used' on the payment details", 'event-tickets-with-ticket-scanner'), 'desc'=>__("It will display which coupon was used.", 'event-tickets-with-ticket-scanner'), 'type'=>"text", 'def'=>__("Coupon used:", 'event-tickets-with-ticket-scanner')]; |
| 580 | $options[] = ['key'=>'wcTicketTransTicket', 'label'=>__("Label 'Ticket' for the ticket number", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"text", 'def'=>__("Ticket:", 'event-tickets-with-ticket-scanner')]; |
| 581 | $options[] = ['key'=>'wcTicketTransPrice', 'label'=>__("Label 'Price' for the paid price", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"text", 'def'=>__("Price:", 'event-tickets-with-ticket-scanner')]; |
| 582 | $options[] = ['key'=>'wcTicketTransProductPrice', 'label'=>__("Label 'Original price' for the ticket number", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"text", 'def'=>__("Original price:", 'event-tickets-with-ticket-scanner')]; |
| 583 | $options[] = ['key'=>'wcTicketTransTicketRedeemed', 'label'=>__("Label 'Ticket redeemed' for the customer notice", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"text", 'def'=>__("Ticket redeemed", 'event-tickets-with-ticket-scanner')]; |
| 584 | $options[] = ['key'=>'wcTicketTransRedeemDate', 'label'=>__("Label 'Redeemed at' for the customer notice", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"text", 'def'=>__("Last Redeemed:", 'event-tickets-with-ticket-scanner')]; |
| 585 | $options[] = ['key'=>'wcTicketTransTicketValid', 'label'=>__("Label 'Ticket valid' for the customer notice", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"text", 'def'=>__("Ticket valid", 'event-tickets-with-ticket-scanner')]; |
| 586 | $options[] = ['key'=>'wcTicketTransRefreshPage', 'label'=>__("Label 'Refresh page' for the button", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"text", 'def'=>__("Refresh page", 'event-tickets-with-ticket-scanner')]; |
| 587 | $options[] = ['key'=>'wcTicketTransRedeemQuestion', 'label'=>__("Label 'Do you want to redeem the ticket?' for the question to your client", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"text", 'def'=>__("Do you want to redeem the ticket? Typically this is done at the entrance. This will mark this ticket as redeemed.", 'event-tickets-with-ticket-scanner')]; |
| 588 | $options[] = ['key'=>'wcTicketTransBtnRedeemTicket', 'label'=>sprintf(/* translators: %s: default value */__("Label '%s' for the button to your client", 'event-tickets-with-ticket-scanner'), __("Redeem Ticket", 'event-tickets-with-ticket-scanner')), 'desc'=>"", 'type'=>"text", 'def'=>__("Redeem Ticket", 'event-tickets-with-ticket-scanner')]; |
| 589 | $options[] = ['key'=>'wcTicketTransTicketExpired', 'label'=>sprintf(/* translators: %s: default value */__("Label Error '%s' for the customer notice", 'event-tickets-with-ticket-scanner'), __("Ticket expired", 'event-tickets-with-ticket-scanner')), 'desc'=>"", 'type'=>"text", 'def'=>__("Ticket expired", 'event-tickets-with-ticket-scanner')]; |
| 590 | $options[] = ['key'=>'wcTicketTransTicketIsStolen', 'label'=>__("Label Error 'Ticket is STOLEN' for the customer notice", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"text", 'def'=>__("Ticket is STOLEN", 'event-tickets-with-ticket-scanner')]; |
| 591 | $options[] = ['key'=>'wcTicketTransTicketNotValid', 'label'=>__("Label Error 'Ticket is not valid' for the customer notice", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"text", 'def'=>__("Ticket is not valid", 'event-tickets-with-ticket-scanner')]; |
| 592 | $options[] = ['key'=>'wcTicketTransTicketNumberWrong', 'label'=>__("Label Error 'Ticket number is wrong' for the customer notice", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"text", 'def'=>__("Ticket number is wrong", 'event-tickets-with-ticket-scanner')]; |
| 593 | $options[] = ['key'=>'wcTicketTransRedeemMaxAmount', 'label'=>__("Text for max redeem amount for the customer notice on the PDF ticket", 'event-tickets-with-ticket-scanner'), 'desc'=>sprintf(/* translators: %s: max amount ticket redeem */__("This text will be added to the PDF ticket only if the ticket can be redeemed more than one time! Use the placeholder %s to display the amount.", 'event-tickets-with-ticket-scanner'), '{MAX_REDEEM_AMOUNT}'), 'type'=>"text", 'def'=>sprintf(/* translators: %s: max amount ticket redeem */__("You can redeem this ticket <b>%s times</b> within the valid period.", 'event-tickets-with-ticket-scanner'), '{MAX_REDEEM_AMOUNT}')]; |
| 594 | $options[] = ['key'=>'wcTicketTransRedeemedAmount', 'label'=>__("Text for redeemed amount for the customer notice on the ticket", 'event-tickets-with-ticket-scanner'), 'desc'=>sprintf(/* translators: 1: amount redeemed ticket 2: max amount ticket redeem */__('This text will be added to the ticket scanner and ticket detail page view. Only if the ticket can be redeemed more than one time! Use the placeholders %1$s and %2$s and to display the amounts.', 'event-tickets-with-ticket-scanner'), '{REDEEMED_AMOUNT}', '{MAX_REDEEM_AMOUNT}'), 'type'=>"text", 'def'=>sprintf(/* translators: 1: amount redeemed ticket 2: max amount ticket redeem */__('You have used this ticket %1$s of %2$s.', 'event-tickets-with-ticket-scanner'), '{REDEEMED_AMOUNT}', '{MAX_REDEEM_AMOUNT}')]; |
| 595 | $options[] = ['key'=>'wcTicketTransTicketNotValidToEarly', 'label'=>__("Label Error 'Event did not started yet' for the customer notice", 'event-tickets-with-ticket-scanner'), 'desc'=>"Will be shown on the ticket scanner, if the ticket is too early scanned.", 'type'=>"text", 'def'=>__("Event did not started yet", 'event-tickets-with-ticket-scanner')]; |
| 596 | $options[] = ['key'=>'wcTicketTransTicketNotValidToLate', 'label'=>__("Label Error 'Too late. Event started already' for the ticket scanner", 'event-tickets-with-ticket-scanner'), 'desc'=>"Will be shown on the ticket scanner, if the ticket is too late scanned.", 'type'=>"text", 'def'=>__("Too late. Event started already", 'event-tickets-with-ticket-scanner')]; |
| 597 | $options[] = ['key'=>'wcTicketTransTicketNotValidToLateEndEvent', 'label'=>__("Label Error 'Too late. Event ended already' for the ticket scanner", 'event-tickets-with-ticket-scanner'), 'desc'=>"Will be shown on the ticket scanner, if the ticket is too late scanned.", 'type'=>"text", 'def'=>__("Too late. Event ended already", 'event-tickets-with-ticket-scanner')]; |
| 598 | $options[] = ['key'=>'wcTicketTransDisplayTicketUserValue', 'label'=>__("Label User registered value on the ticket", 'event-tickets-with-ticket-scanner'), 'desc'=>"Will be shown on the ticket, if the corresponding ticket option is activated and the registered user value is not empty.", 'type'=>"text", 'def'=>__("User value:", 'event-tickets-with-ticket-scanner')]; |
| 599 | |
| 600 | $badgeHTMLDefault = $this->MAIN->getTicketBadgeHandler()->getDefaultTemplate(); |
| 601 | $desc = $this->MAIN->getTicketBadgeHandler()->getReplacementTagsExplanation(); |
| 602 | $options[] = ['key'=>'h15', 'label'=>__("Ticket Badge", 'event-tickets-with-ticket-scanner'), 'desc'=>__("You can download a badge for each ticket. This badge can be give to your customer so they can wear it as a name badge. You can download the badge PDF within the ticket detail view.", 'event-tickets-with-ticket-scanner'), 'type'=>"heading"]; |
| 603 | $options[] = ['key'=>'wcTicketBadgeDisplayButtonOnDetail', 'label'=>__("Show ticket badge download button on ticket detail page", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will display the ticket badge file download button on the ticket detail view.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/w0F14PVbWig']; |
| 604 | $options[] = ['key'=>'wcTicketBadgeLabelDownload', 'label'=>__("Text that will be added as the ticket badge file download label", 'event-tickets-with-ticket-scanner'), 'desc'=>sprintf(/* translators: %s: default value */__('If left empty, default will be "%s"', 'event-tickets-with-ticket-scanner'), __("Download ticket badge", 'event-tickets-with-ticket-scanner')), 'type'=>"text", 'def'=>__("Download ticket badge", 'event-tickets-with-ticket-scanner'), '_doc_video'=>'https://youtu.be/w0F14PVbWig']; |
| 605 | $options[] = ['key'=>'wcTicketBadgeAttachLinkToMail', 'label'=>__("Attach the ticket badge download link to the WooCommerce mails", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, the ticket badge download link will be added to the mails.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/S-s6MG50ccA']; |
| 606 | $options[] = ['key'=>'wcTicketBadgeAttachFileToMail', 'label'=>__("Attach the ticket badge file to the WooCommerce mails", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, the ticket badge file will be added as an attachment to the mails.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/gzmFvj30wmY']; |
| 607 | $options[] = ['key'=>'wcTicketBadgeAttachFileToMailAsOnePDF', 'label'=>__("Attach all ticket badges of an order to the WooCommerce mails as one PDF", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, the ticket badge files are merged into one PDF and will be added as an attachment to the mails.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/MVwIATKAKJw']; |
| 608 | $options[] = ['key'=>'wcTicketBadgePDFisRTL', 'label'=>__("BETA Use RTL for PDF", 'event-tickets-with-ticket-scanner'), 'desc'=>__("This feature is in Beta. This means, good results are not guaranteed, still optimizing this. If active, the PDF will be generated with RTL option active.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>""]; |
| 609 | $options[] = ['key'=>'wcTicketBadgeSizeWidth', 'label'=>__('Size in mm for the width', 'event-tickets-with-ticket-scanner'), 'desc'=>__('Will be used to set the width of the PDF for the badge. If empty or zero, the default of 80 will be used.', 'event-tickets-with-ticket-scanner'), 'type'=>'number', 'def'=>80, "additional"=>["min"=>20], '_doc_video'=>'https://youtu.be/dbgyRvkmXL0']; |
| 610 | $options[] = ['key'=>'wcTicketBadgeSizeHeight', 'label'=>__('Size in mm for the height', 'event-tickets-with-ticket-scanner'), 'desc'=>__('Will be used to set the height of the PDF for the badge. If empty or zero, the default of 120 will be used.', 'event-tickets-with-ticket-scanner'), 'type'=>'number', 'def'=>120, "additional"=>["min"=>20], '_doc_video'=>'https://youtu.be/dbgyRvkmXL0']; |
| 611 | $options[] = ['key'=>'wcTicketBadgeQRSize', 'label'=>__('Size for the QR code image on the PDF', 'event-tickets-with-ticket-scanner'), 'desc'=>__('Will be used to set the width and height of the QR code image on the PDF ticket. If empty or zero, the default of 50 will be used.', 'event-tickets-with-ticket-scanner'), 'type'=>'number', 'def'=>50, "additional"=>["min"=>0], '_doc_video'=>'https://youtu.be/dbgyRvkmXL0']; |
| 612 | $options[] = ['key'=>'wcTicketBadgeBG', 'label'=>__("Display a background image image at the center of the PDF.", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If a media file is choosen, the image will be placed on the ticket flyer.", 'event-tickets-with-ticket-scanner'), 'type'=>"media", 'def'=>"" |
| 613 | , 'additional'=>[ |
| 614 | 'button'=>esc_attr__('Choose background image for the ticket badge', 'event-tickets-with-ticket-scanner') |
| 615 | ] |
| 616 | , '_doc_video'=>'https://youtu.be/Lzz34dWWvWI' |
| 617 | ]; |
| 618 | $options[] = ['key'=>'wcTicketBadgeText', 'label'=>__("The HTML value for the PDF", 'event-tickets-with-ticket-scanner'), 'desc'=>__('If left empty, default will be used.', 'event-tickets-with-ticket-scanner'), 'type'=>"vtext", 'def'=>$badgeHTMLDefault, "additional"=>["rows"=>10, "height"=>"260", "tags"=>$this->MAIN->getTicketBadgeHandler()->getReplacementTags()], '_doc_video'=>'https://youtu.be/xmn1t8QPxwQ']; |
| 619 | $options[] = ['key'=>'h15_desc', 'label'=>__("Possible Tags", 'event-tickets-with-ticket-scanner'), 'desc'=>$desc, 'type'=>"desc"]; |
| 620 | |
| 621 | $options[] = ['key'=>'h12d', 'label'=>__("Calendar file (ICS)", 'event-tickets-with-ticket-scanner'), 'desc'=>__("The ICS calendar file will cointain the event info and date (if added). This allows your customer to add the event easily from within the email to their calendar. Will work on most mail client.", 'event-tickets-with-ticket-scanner'), 'type'=>"heading"]; |
| 622 | $options[] = ['key'=>'wcTicketDontDisplayICSButtonOnDetail', 'label'=>__("Hide the ICS calendar file download button on ticket detail page", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will not display the calendar file download button on the ticket detail view. It will be only shown if the ticket product has a starting date.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/ieTQLrQqd2U']; |
| 623 | $options[] = ['key'=>'wcTicketLabelICSDownload', 'label'=>__("Text that will be added as the ICS calendar file download label", 'event-tickets-with-ticket-scanner'), 'desc'=>sprintf(/* translators: %s: default value */__('If left empty, default will be "%s"', 'event-tickets-with-ticket-scanner'), __("Download calendar file", 'event-tickets-with-ticket-scanner')), 'type'=>"text", 'def'=>__("Download calendar file", 'event-tickets-with-ticket-scanner'), '_doc_video'=>'https://youtu.be/4Xs7XlqZbcQ']; |
| 624 | $options[] = ['key'=>'wcTicketAttachICSToMail', 'label'=>__("Attach the ICS calendar file to the WooCommerce mails", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, the ICS calendar file will be added as an attachment to the mails (order complete, customer note, customer invoice and processing order)", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/H6RUH4B3KJk']; |
| 625 | $options[] = ['key'=>'wcTicketDisplayDateOnMail', 'label'=>__("Show the event date on purchase order email", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active and a date is set on the product, then it will display the date of the event on the purchase email to the client.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/B8CqwD1XUSY']; |
| 626 | $options[] = ['key'=>'wcTicketDisplayDateOnPrdDetail', 'label'=>__("Show the event date on the product detail page for your customer", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active and a date is set on the product, then it will display the date of the event on the product detail page to the client.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/uIk49qlTMIg']; |
| 627 | $options[] = ['key'=>'wcTicketHideDateOnPDF', 'label'=>__("Hide the event date on the ticket", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active the event date is not shown on the ticket.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/Vbj4pTx-Z4o']; |
| 628 | $options[] = ['key'=>'wcTicketHideSeatOnPDF', 'label'=>__("Hide the seat information on the ticket", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active the seat information is not shown on the ticket.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>""]; |
| 629 | $options[] = ['key'=>'wcTicketICSOrganizerEmail', 'label'=>__("Email address for organizer entry", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If set then the organizer tag will be added to the ICS file. The organizer name will be your website name", 'event-tickets-with-ticket-scanner'), 'type'=>"text", '_doc_video'=>'https://youtu.be/bC_NyPMv2_c']; |
| 630 | |
| 631 | $options[] = [ |
| 632 | 'key'=>'h12b', |
| 633 | 'label'=>__("Ticket Redirect", 'event-tickets-with-ticket-scanner'), |
| 634 | 'desc'=>__("If you customer redeem their own ticket, you can redirect them to another page. For this, the feature 'Do not show the redeem button on the ticket detail view for the client' has to be NOT checked.<br>If you also use the user redirect, then this option will be evaluated first!", 'event-tickets-with-ticket-scanner'), |
| 635 | 'type'=>"heading" |
| 636 | ]; |
| 637 | $options[] = ['key'=>'wcTicketRedirectUser', 'label'=>__("Activate redirect the user after redeeming their own ticket.", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, the user will be redirected to the URL your provide below.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/1BMrPGWWLo8']; |
| 638 | $options[] = ['key'=>'wcTicketRedirectUserURL', 'label'=>__("URL to redirect the user, if the ticket was redeemed.", 'event-tickets-with-ticket-scanner'), 'desc'=>__("The URL can be relative like '/page/' or absolute 'https//domain/url/'.<br>You can use these placeholder for your URL:<ul><li><b>{USERID}</b>: Will be replaced with the userid if the user is loggedin or empty</li><li><b>{CODE}</b>: Will be replaced with the ticket number (without the delimiters)</li><li><b>{CODEDISPLAY}</b>: Will be replaced with the ticket number (WITH the delimiters)</li><li><b>{IP}</b>: The IP address of the user</li><li><b>{LIST}</b>: Name of the list if assigned</li><li><b>{LIST_DESC}</b>: Description of the assigned list</li><li><a href='#replacementtags'>More tags here</a></li></ul>", 'event-tickets-with-ticket-scanner'), 'type'=>"text", 'def'=>"", '_doc_video'=>'https://youtu.be/k_sewEOiSb8']; |
| 639 | |
| 640 | $options[] = [ |
| 641 | 'key'=>'h12c', |
| 642 | 'label'=>__("Event Flyer", 'event-tickets-with-ticket-scanner'), |
| 643 | 'desc'=>__("You can download a PDF flyer for your event within the product detail view. Control the components to be displayed.", 'event-tickets-with-ticket-scanner'), |
| 644 | 'type'=>"heading" |
| 645 | ]; |
| 646 | $options[] = ['key'=>'wcTicketFlyerDontDisplayBlogName', 'label'=>__("Hide your wordpress name.", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will not display the wordpress name.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/wR-v9mUNwzE']; |
| 647 | $options[] = ['key'=>'wcTicketFlyerDontDisplayBlogDesc', 'label'=>__("Hide your wordpress description.", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will not display the wordpress description.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/O4Cca8m8EWU']; |
| 648 | $options[] = ['key'=>'wcTicketFlyerDontDisplayBlogURL', 'label'=>__("Hide your wordpress URL.", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, it will not display the wordpress URL.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/vu2cr-xMNP8']; |
| 649 | $options[] = ['key'=>'wcTicketFlyerDontDisplayPrice', 'label'=>__("Hide your ticket price.", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If active, the ticket price will not be displayed.", 'event-tickets-with-ticket-scanner'), 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/cR3n1T5MOYM']; |
| 650 | $options[] = ['key'=>'wcTicketFlyerLogo', 'label'=>__("Display a small logo (max. 300x300px) at the bottom in the center.", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If a media file is choosen, the logo will be placed on the flyer.", 'event-tickets-with-ticket-scanner'), 'type'=>"media", '_doc_video'=>'https://youtu.be/Cc8xOsBq3wc', 'def'=>"" |
| 651 | , 'additional'=>[ |
| 652 | 'max'=>['width'=>200,'height'=>200], |
| 653 | 'button'=>esc_attr__('Choose logo for the ticket flyer', 'event-tickets-with-ticket-scanner'), |
| 654 | 'msg_error'=>[ |
| 655 | 'width'=>__('Too big! Choose an image with smaller size. Max 300px width, otherwise it will look not good on your flyer.', 'event-tickets-with-ticket-scanner') |
| 656 | ] |
| 657 | ] |
| 658 | ]; |
| 659 | $options[] = ['key'=>'wcTicketFlyerBanner', 'label'=>__("Display a banner image at the top of the PDF.", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If a media file is choosen, the banner will be placed on the flyer.", 'event-tickets-with-ticket-scanner'), 'type'=>"media", '_doc_video'=>'https://youtu.be/Cc8xOsBq3wc', 'def'=>"" |
| 660 | , 'additional'=>[ |
| 661 | 'min'=>['width'=>600], |
| 662 | 'button'=>esc_attr__('Choose banner image for the ticket flyer', 'event-tickets-with-ticket-scanner'), |
| 663 | 'msg_error_min'=>[ |
| 664 | 'width'=>__('Too small! Choose an image with bigger size. Min 600px width, otherwise it will look not good on your flyer.', 'event-tickets-with-ticket-scanner') |
| 665 | ] |
| 666 | ] |
| 667 | ]; |
| 668 | $options[] = ['key'=>'wcTicketFlyerBG', 'label'=>__("Display a background image at the center of the PDF.", 'event-tickets-with-ticket-scanner'), 'desc'=>__("If a media file is choosen, the image will be placed on the ticket flyer.", 'event-tickets-with-ticket-scanner'), 'type'=>"media", '_doc_video'=>'https://youtu.be/Cc8xOsBq3wc', 'def'=>"" |
| 669 | , 'additional'=>[ |
| 670 | 'button'=>esc_attr__('Choose background image for the ticket flyer', 'event-tickets-with-ticket-scanner') |
| 671 | ] |
| 672 | ]; |
| 673 | |
| 674 | $options[] = ['key'=>'h20', 'label'=>__("User profile", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"heading"]; |
| 675 | $options[] = ['key'=>'wcTicketUserProfileDisplayRegisteredNumbers', 'label'=>__("Display registered ticket numbers within the user profile", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/Cc8xOsBq3wc']; |
| 676 | $options[] = ['key'=>'wcTicketUserProfileDisplayBoughtNumbers', 'label'=>__("Display bought ticket numbers within the user profile", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/SVu7tNXLZUs']; |
| 677 | $options[] = ['key'=>'wcTicketUserProfileDisplayTicketDetailURL', 'label'=>__("Display the ticket detail page URL", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"checkbox", 'def'=>"", '_doc_video'=>'https://youtu.be/GSpNww6kQ5c']; |
| 678 | $options[] = ['key'=>'wcTicketUserProfileDisplayRedeemAmount', 'label'=>__("Display the redeem information for the ticket", 'event-tickets-with-ticket-scanner'), 'desc'=>"", 'type'=>"checkbox", 'def'=>""]; |
| 679 | |
| 680 | foreach($options as $o) { |
| 681 | $this->_options[] = $this->getOptionsObject( |
| 682 | $o['key'], $o['label'], $o['desc'], $o['type'], |
| 683 | isset($o['def']) ? $o['def'] : null, |
| 684 | isset($o['additional']) ? $o['additional'] : [], |
| 685 | isset($o['isPublic']) ? $o['isPublic'] : false, |
| 686 | isset($o['_doc_video']) ? $o['_doc_video'] : '', |
| 687 | isset($o['_do_not_trim']) ? $o['_do_not_trim'] : '' |
| 688 | ); |
| 689 | } |
| 690 | |
| 691 | $this->_options[] = $this->getOptionsObject('h0', __("Validator Form for ticket number check", 'event-tickets-with-ticket-scanner'),"","heading"); |
| 692 | $this->_options[] = $this->getOptionsObject('textValidationButtonLabel', __("Your own check button label", 'event-tickets-with-ticket-scanner'), __("If left empty, default will be 'Check'", 'event-tickets-with-ticket-scanner'),"text", "Check", [], true); |
| 693 | $this->_options[] = $this->getOptionsObject('textValidationInputPlaceholder', esc_html__("Your own input field placeholder text", 'event-tickets-with-ticket-scanner'), __("If left empty, default will be 'XXYYYZZ'", 'event-tickets-with-ticket-scanner'),"text", __("XXYYYZZ", 'event-tickets-with-ticket-scanner'), [], true); |
| 694 | $this->_options[] = $this->getOptionsObject('textValidationBtnBgColor', esc_html__("Your own background color of the button", 'event-tickets-with-ticket-scanner'), __("If left empty, default will be <span style='color:#007bff;'>'#007bff'</span>", 'event-tickets-with-ticket-scanner'),"text", "", [], true); |
| 695 | $this->_options[] = $this->getOptionsObject('textValidationBtnBrdColor', esc_html__("Your own border color of the button", 'event-tickets-with-ticket-scanner'), __("If left empty, default will be <span style='color:#007bff;'>'#007bff'</span>", 'event-tickets-with-ticket-scanner'),"text", "", [], true); |
| 696 | $this->_options[] = $this->getOptionsObject('textValidationBtnTextColor', esc_html__("Your own text color of the button", 'event-tickets-with-ticket-scanner'), __("If left empty, default will be 'white'", 'event-tickets-with-ticket-scanner'),"text", "", [], true); |
| 697 | $this->_options[] = $this->getOptionsObject('enableQRScanner', esc_html__("Enable QR code scanner on the validation form", 'event-tickets-with-ticket-scanner'), __("If active, a camera icon will be displayed next to the input field, allowing users to scan QR codes with their device camera. Requires HTTPS.", 'event-tickets-with-ticket-scanner'),"checkbox", true, [], true); |
| 698 | |
| 699 | $this->_options[] = $this->getOptionsObject('h1', "Validation Messages","","heading"); |
| 700 | $this->_options[] = $this->getOptionsObject('textValidationMessage1', __("Your own 'Ticket confirmed' message", 'event-tickets-with-ticket-scanner'), __("If left empty, default will be 'Ticket confirmed'", 'event-tickets-with-ticket-scanner'),"text", __("Ticket confirmed", 'event-tickets-with-ticket-scanner'), [], true); |
| 701 | $this->_options[] = $this->getOptionsObject('textValidationMessage0', __("Your own 'Ticket not found' message", 'event-tickets-with-ticket-scanner'), __("If left empty, default will be 'Ticket not found'", 'event-tickets-with-ticket-scanner'),"text", __("Ticket not found", 'event-tickets-with-ticket-scanner'), [], true); |
| 702 | $this->_options[] = $this->getOptionsObject('textValidationMessage2', __("Your own 'Ticket inactive' message", 'event-tickets-with-ticket-scanner'), __("If left empty, default will be 'Please contact support for further investigation'", 'event-tickets-with-ticket-scanner'),"text", __("Please contact support for further investigation", 'event-tickets-with-ticket-scanner'), [], true); |
| 703 | $this->_options[] = $this->getOptionsObject('textValidationMessage3', __("Your own 'Ticket is already registered to a user' message", 'event-tickets-with-ticket-scanner'), __("If left empty, default will be 'Is registered to a user'", 'event-tickets-with-ticket-scanner'),"text", __("Is registered to a user", 'event-tickets-with-ticket-scanner'), [], true); |
| 704 | $this->_options[] = $this->getOptionsObject('textValidationMessage4', __("Your own 'Ticket expired' message", 'event-tickets-with-ticket-scanner'), __("If left empty, default will be 'Ticket expired'", 'event-tickets-with-ticket-scanner'),"text", __("Ticket expired", 'event-tickets-with-ticket-scanner'), [], true); |
| 705 | $this->_options[] = $this->getOptionsObject('textValidationMessage6', __("Your own 'Ticket and CVV is not valid' message", 'event-tickets-with-ticket-scanner'), __("If left empty, default will be 'Ticket and CVV is not valid'.", 'event-tickets-with-ticket-scanner'),"text", __("Ticket and CVV is not valid", 'event-tickets-with-ticket-scanner'), [], true); |
| 706 | $this->_options[] = $this->getOptionsObject('textValidationMessage7', __("Your own 'Ticket stolen' message", 'event-tickets-with-ticket-scanner'), __("If left empty, default will be 'Ticket stolen'. You could set it to be more precise e.g.: 'The Ticket is reported as stolen'", 'event-tickets-with-ticket-scanner'),"text", __("Ticket is stolen", 'event-tickets-with-ticket-scanner'), [], true); |
| 707 | $this->_options[] = $this->getOptionsObject('textValidationMessage8', __("Your own 'Ticket is redeemed' message", 'event-tickets-with-ticket-scanner'), __("If left empty, default will be 'Ticket is redeemed'", 'event-tickets-with-ticket-scanner'), "text",__("Ticket is redeemed", 'event-tickets-with-ticket-scanner'), [], true); |
| 708 | |
| 709 | $this->_options[] = $this->getOptionsObject('h2', __("Logged in user only", 'event-tickets-with-ticket-scanner'),"","heading"); |
| 710 | $this->_options[] = $this->getOptionsObject('onlyForLoggedInWPuser', __("Allow only logged in wordpress user to enter a ticket number for validation", 'event-tickets-with-ticket-scanner'), __("If active and the user is not logged in, then the input fields will be disabled", 'event-tickets-with-ticket-scanner'), "checkbox", "", [], true); |
| 711 | $this->_options[] = $this->getOptionsObject('onlyForLoggedInWPuserMessage', __("Your own 'Only for logged in user' message", 'event-tickets-with-ticket-scanner'), __("If left empty, default will be 'You need to log in to use the ticket validator'", 'event-tickets-with-ticket-scanner'),"text", __("You need to log in to use the ticket validator", 'event-tickets-with-ticket-scanner'), [], true, 'https://youtu.be/_EpIfAJoXio'); |
| 712 | |
| 713 | /* // brauchen wir später mit der Übertragung und auch gut, wenn einer Tickets ohne order verkauft. erstmal deaktivieren |
| 714 | $this->_options[] = $this->getOptionsObject('h5', "Register user to ticket","Useful, if you are selling tickets for guest and do not have their name on it","heading"); |
| 715 | $this->_options[] = $this->getOptionsObject('allowUserRegisterCode', "Allow your users to register themself for a code.","If active, the user will get the option to register with an 'email address' (or your registration value text) to the code. <b>IMPORTANT</b>: If activate, the redirect option will executed after the registration.", "checkbox", "", [], true); |
| 716 | $this->_options[] = $this->getOptionsObject('textRegisterButton', "Your own button label 'Register for this code'","If left empty, default will be 'Register for this code'","text", "Register for this code", [], true); |
| 717 | $this->_options[] = $this->getOptionsObject('textRegisterValue', "Your own label for the user registration value question","If left empty, default will be 'Enter your email address'","text", "Enter your email address", [], true); |
| 718 | $this->_options[] = $this->getOptionsObject('textRegisterSaved', "Your own message for the 'user registration value is stored' operation","If left empty, default will be 'Your code is registered to you'","text", "Your code is registered to you", [], true); |
| 719 | $this->_options[] = $this->getOptionsObject('allowUserRegisterCodeWPuserid', "Track wordpress userid","If active and the user is logged in, then the userid will be stored to the registration information."); |
| 720 | $this->_options[] = $this->getOptionsObject('allowUserRegisterSkipValueQuestion', "Skip asking for the registration value, if the user is logged in","If active and the user is logged in, then question of 'Register for this code' will be not shown and the 'is stored text' will be displayed immediately.", "checkbox", "", [], true); |
| 721 | |
| 722 | $this->_options[] = $this->getOptionsObject('h6', "Display registered information of a ticket","","heading"); |
| 723 | $this->_options[] = $this->getOptionsObject('displayUserRegistrationOfCode', "Display the collected information of a registration to a ticket.", 'Usefull if your codes are certificatins and you want if somebody type in the ticket number to see who it belongs to.'); |
| 724 | $this->_options[] = $this->getOptionsObject('displayUserRegistrationPreText', "Your own pre-text for the display of the collected information","If not empty, it will be added one line above the registered information to the ticket","text", ""); |
| 725 | $this->_options[] = $this->getOptionsObject('displayUserRegistrationAfterText', "Your own after-text for the display of the collected information","If not empty, it will be added one line below the registered information to the ticket","text", ""); |
| 726 | */ |
| 727 | |
| 728 | $this->_options[] = $this->getOptionsObject('h8', __("User redirection", 'event-tickets-with-ticket-scanner'),"","heading"); |
| 729 | $this->_options[] = $this->getOptionsObject('userJSRedirectActiv', __("Activate redirect the user after a valid ticket was found.", 'event-tickets-with-ticket-scanner'), __("If active, the user will be redirected to the URL your provide below.", 'event-tickets-with-ticket-scanner'), "checkbox", "", [], true, 'https://youtu.be/C9W8q7fsDMc'); |
| 730 | $this->_options[] = $this->getOptionsObject('userJSRedirectIfSameUserRegistered', __("Redirect already registered tickets and the user is the same.", 'event-tickets-with-ticket-scanner'), __("If active, the user will be redirected to the URL your provide below, even if the ticket is registered already and user checking is the same user that is registered to the ticket. It will not be executed, if the 'one time usage restriction is active'. The user needs to be logged in for the system to recognize the user.", 'event-tickets-with-ticket-scanner'), "checkbox", "", [], true, 'https://youtu.be/r82u5GB-RPY'); |
| 731 | $this->_options[] = $this->getOptionsObject('userJSRedirectURL', __("URL to redirect the user, if the ticket is valid.", 'event-tickets-with-ticket-scanner'), __("The URL can be relative like '/page/' or absolute 'https//domain/url/'.<br>You can use these placeholder for your URL:<ul><li><b>{USERID}</b>: Will be replaced with the userid if the user is loggedin or empty</li><li><b>{CODE}</b>: Will be replaced with the ticket number (without the delimiters)</li><li><b>{CODEDISPLAY}</b>: Will be replaced with the ticket number (WITH the delimiters)</li><li><b>{IP}</b>: The IP address of the user</li><li><b>{LIST}</b>: Name of the list if assigned</li><li><b>{LIST_DESC}</b>: Description of the assigned list</li><li><a href='#replacementtags'>More tags here</a></li></ul>", 'event-tickets-with-ticket-scanner'), "text", "", [], false, 'https://youtu.be/r82u5GB-RPY'); |
| 732 | $this->_options[] = $this->getOptionsObject('userJSRedirectBtnLabel', __("Button label to click for the user to be redirected", 'event-tickets-with-ticket-scanner'), __("Only if filled out, the button will be displayed. If you left this field empty, then the user will be redirected immediately if the ticket is valid, without a button to click.", 'event-tickets-with-ticket-scanner'),"text", "", [], false, 'https://youtu.be/iyqCa8UN4ZU'); |
| 733 | |
| 734 | $this->_options[] = $this->getOptionsObject('h9', __("Webhooks", 'event-tickets-with-ticket-scanner'),"","heading"); |
| 735 | $this->_options[] = $this->getOptionsObject('webhooksActiv', __("Activate webhooks to call a service with the validation check.", 'event-tickets-with-ticket-scanner'), __("If active, each validation request from a user will trigger an URL from the server side to another URL. Be carefull. This could slow down the validation check. It depends how fast your service URLs are responding.", 'event-tickets-with-ticket-scanner')."<br>".__("The URL can be relative like '/page/' or absolute 'https//domain/url/'.<br>You can use these placeholder for your URL:<ul><li><b>{USERID}</b>: Will be replaced with the userid if the user is loggedin or empty</li><li><b>{CODE}</b>: Will be replaced with the ticket number (without the delimiters)</li><li><b>{CODEDISPLAY}</b>: Will be replaced with the ticket number (WITH the delimiters)</li><li><b>{IP}</b>: The IP address of the user</li><li><b>{LIST}</b>: Name of the list if assigned</li><li><b>{LIST_DESC}</b>: Description of the assigned list</li><li><a href='#replacementtags'>More tags here</a></li></ul>", 'event-tickets-with-ticket-scanner'), "checkbox", null, [], false, 'https://youtu.be/mcPFTaNBKhM'); |
| 736 | $this->_options[] = $this->getOptionsObject('webhookURLinactive', __("URL to your service if the checked ticket <b>is inactive</b>.", 'event-tickets-with-ticket-scanner'), __("Only triggered, if not empty.", 'event-tickets-with-ticket-scanner'), "text", "", [], false, 'https://youtu.be/dnqcfX7neoA'); |
| 737 | $this->_options[] = $this->getOptionsObject('webhookURLvalid', __("URL to your service if the checked ticket <b>is valid</b>.", 'event-tickets-with-ticket-scanner'), __("Only triggered, if not empty.", 'event-tickets-with-ticket-scanner'), "text", "", [], false, 'https://youtu.be/quOVvR3lQYk'); |
| 738 | $this->_options[] = $this->getOptionsObject('webhookURLinvalid', __("URL to your service if the checked ticket <b>is invalid</b> (not found).", 'event-tickets-with-ticket-scanner'), __("Only triggered, if not empty.", 'event-tickets-with-ticket-scanner'), "text", "", [], false, 'https://youtu.be/GVi0u9r4RrY'); |
| 739 | $this->_options[] = $this->getOptionsObject('webhookURLregister', __("URL to your service if <b>someone register to this ticket</b>.", 'event-tickets-with-ticket-scanner'), __("Only triggered, if not empty.", 'event-tickets-with-ticket-scanner'), "text", "", [], false, 'https://youtu.be/0MahVL76wn4'); |
| 740 | $this->_options[] = $this->getOptionsObject('webhookURLisregistered', __("URL to your service if the checked ticket is already <b>registered to someone</b>.", 'event-tickets-with-ticket-scanner'), __("Only triggered, if not empty.", 'event-tickets-with-ticket-scanner'), "text", "", [], false, 'https://youtu.be/cs1HFXWPz2s'); |
| 741 | $this->_options[] = $this->getOptionsObject('webhookURLsetused', __("URL to your service if the checked ticket is valid and is <b>marked to be used the first time</b>.", 'event-tickets-with-ticket-scanner'), __("Only triggered, if not empty.", 'event-tickets-with-ticket-scanner'), "text", "", [], false, 'https://youtu.be/DxCXj4twTWE'); |
| 742 | $this->_options[] = $this->getOptionsObject('webhookURLmarkedused', __("URL to your service if the checked ticket is already <b>marked as used and checked again</b>.", 'event-tickets-with-ticket-scanner'), __("Only triggered, if not empty.", 'event-tickets-with-ticket-scanner'), "text", "", [], false, 'https://youtu.be/5oMK7O8gSUo'); |
| 743 | $this->_options[] = $this->getOptionsObject('webhookURLrestrictioncodeused', __("URL to your service if an order item is bought using a restriction code.", 'event-tickets-with-ticket-scanner'), __("Only triggered, if not empty.", 'event-tickets-with-ticket-scanner'), "text", "", [], false, 'https://youtu.be/4NS1ehjXqb0'); |
| 744 | //$this->_options[] = $this->getOptionsObject('webhookURLaddwcinfotocode', __("URL to your service if a code received WooCommerce data, if a 'code was purchased'.", 'event-tickets-with-ticket-scanner'), __("Only triggered, if not empty.", 'event-tickets-with-ticket-scanner'), "text", ""); |
| 745 | //$this->_options[] = $this->getOptionsObject('webhookURLwcremove', __("URL to your service if the WooCommerce data is removed from the code.'.", 'event-tickets-with-ticket-scanner'),__("Only triggered, if not empty.", 'event-tickets-with-ticket-scanner'), "text", ""); |
| 746 | $this->_options[] = $this->getOptionsObject('webhookURLaddwcticketsold', __("URL to your service if the WooCommerce ticket is sold.", 'event-tickets-with-ticket-scanner'), __("Only triggered, if not empty. This webhook is called for each ticket number within a purchase, if the ticket has an order assigned to it.", 'event-tickets-with-ticket-scanner'), "text", "", [], false, 'https://youtu.be/JraL989cKH4'); |
| 747 | $this->_options[] = $this->getOptionsObject('webhookURLaddwcticketinfoset', __("URL to your service if the WooCommerce ticket data is set for this ticket number.", 'event-tickets-with-ticket-scanner'), __("Only triggered, if not empty.", 'event-tickets-with-ticket-scanner'), "text", "", [], false, 'https://youtu.be/BWgYVtIkV70'); |
| 748 | $this->_options[] = $this->getOptionsObject('webhookURLaddwcticketredeemed', __("URL to your service if the WooCommerce ticket is redeemed.", 'event-tickets-with-ticket-scanner'), __("Only triggered, if not empty.", 'event-tickets-with-ticket-scanner'), "text", "", [], false, 'https://youtu.be/xiUZwo2tO-U'); |
| 749 | $this->_options[] = $this->getOptionsObject('webhookURLaddwcticketunredeemed', __("URL to your service if the WooCommerce ticket is un-redeemed.", 'event-tickets-with-ticket-scanner'), __("Only triggered, if not empty.", 'event-tickets-with-ticket-scanner'), "text", "", [], false, 'https://youtu.be/tt5V7Q1ADf4'); |
| 750 | $this->_options[] = $this->getOptionsObject('webhookURLaddwcticketinforemoved', __("URL to your service if the WooCommerce ticket data is removed from the ticket number.", 'event-tickets-with-ticket-scanner'), __("Only triggered, if not empty.", 'event-tickets-with-ticket-scanner'), "text", "", [], false, 'https://youtu.be/HD3TB8t9MBI'); |
| 751 | |
| 752 | $this->_options[] = $this->getOptionsObject('h10', __("Woocommerce product ticket assignment", 'event-tickets-with-ticket-scanner'),"","heading"); |
| 753 | if (!$this->MAIN->isPremium()) { |
| 754 | $this->_options[] = $this->getOptionsObject('wcassignmentTextNoCodePossible', __("Text that will be used, if you do not have <b>premium</b> and run out of free ticket amount. This text will be added to the WooCoomerce purchase information instead of the ticket number", 'event-tickets-with-ticket-scanner'), __("If left empty, default will be 'Please contact our support for the ticket'", 'event-tickets-with-ticket-scanner'),"text", __("Please contact our support for the ticket", 'event-tickets-with-ticket-scanner'), [], true); |
| 755 | } |
| 756 | $this->_options[] = $this->getOptionsObject('wcRestrictFreeCodeByOrderRefund', __("Clear the ticket number if the order was deleted, canceled or refunded", 'event-tickets-with-ticket-scanner'), __("If the order is deleted, cancelled or the status is set to 'refunded', then the WooCommerce order information is removed from the ticket number(s). If the option 'one time usage' is active, then the ticket number will be unmarked as used.", 'event-tickets-with-ticket-scanner'), "checkbox", true, [], false, 'https://youtu.be/KARe2flFweU'); |
| 757 | $this->_options[] = $this->getOptionsObject('wcassignmentOrderItemRefund', __("Clear the ticket number if the order item was partially refunded", 'event-tickets-with-ticket-scanner'), __("If the order item is refunded, then the ticket(s) will be removed. If the option 'one time usage' is active, then the ticket number will be unmarked as used.", 'event-tickets-with-ticket-scanner'), "checkbox", false, [], false, 'https://youtu.be/twAenbYVCNg'); |
| 758 | $this->_options[] = $this->getOptionsObject('wcassignmentExtendTicketWithSubscription', __("Extend the ticket on orders from subscriptions", 'event-tickets-with-ticket-scanner'), __("If active and the product is a subscription product then no new ticket will be issued, but the ticket from the first order is extended. This makes only sense if you use the expiration feature and the woocommerce subscription plugin. The subscriptions order ids are stored to the ticket and can be viewed in the ticket details. The original order is still bound to the ticket, because the public ticket number will contain the order id. The public ticket number is used on the ticket and QR code by default, so you can use the old qr code. The ticket redeem operations will be resetted. If you have expiration active (premium feature), then the expiration information on the ticket will be renewed. The subscription order ids are listed in the ticket detail view (click on the plus symbol next to the ticket in the admin view). ", 'event-tickets-with-ticket-scanner'), "checkbox", false, [], false, ''); |
| 759 | $this->_options[] = $this->getOptionsObject('wcassignmentReuseNotusedCodes', __("Reuse ticket from the ticket list assigned to the woocommerce product, that are not already used by a woocommerce purchase.", 'event-tickets-with-ticket-scanner'),__("If active, the system will try to use an existing ticket from the ticket list that is free. If no free ticket number could be found, a new ticket will be created and assigned to the purchase.<br><br>⚠️ Unsafe together with \"Allow redemption by plain ticket number\" (option-ID <code>wcTicketAllowRedeemByTicketNumber</code>): reused numbers circulate across several purchases, so an old card with the same number could be redeemed again. The full ticket id prevents this automatically; only the additionally accepted plain number is affected.", 'event-tickets-with-ticket-scanner'), "checkbox", true, [], false, 'https://youtu.be/74fEg7FC6Qw'); |
| 760 | $this->_options[] = $this->getOptionsObject('wcassignmentDoNotPutCVVOnEmail', __("Do not print the ticket number CVV on the confirmation to the customer.", 'event-tickets-with-ticket-scanner'), __("If active, the assigned CVV will not be printed on the email", 'event-tickets-with-ticket-scanner'), "checkbox", "", [], false, 'https://youtu.be/kfsm0jXJwv0'); |
| 761 | $this->_options[] = $this->getOptionsObject('wcassignmentDoNotPutCVVOnPDF', __("Do not print the ticket number CVV on the PDF invoice woocommerce purchase.", 'event-tickets-with-ticket-scanner'), __("If active, the assigned CVV will not be printed on the PDF", 'event-tickets-with-ticket-scanner'), "checkbox", "", [], false, 'https://youtu.be/eAWq5bAVEVM'); |
| 762 | $this->_options[] = $this->getOptionsObject('wcassignmentDoNotPutOnEmail', __("Do not put the ticket in the emails to the customer", 'event-tickets-with-ticket-scanner'), __("If active, the assigned ticket number and other ticket related information will not be put in the email", 'event-tickets-with-ticket-scanner'), "checkbox", "", []); |
| 763 | $this->_options[] = $this->getOptionsObject('wcassignmentDoNotPutOnPDF', __("Do not print the ticket on the PDF invoice woocommerce purchase.", 'event-tickets-with-ticket-scanner'), __("If active, the assigned ticket will not be printed on the PDF", 'event-tickets-with-ticket-scanner'), "checkbox", "", []); |
| 764 | $this->_options[] = $this->getOptionsObject('wcassignmentUseGlobalSerialFormatter', __("Set the ticket number formatter pattern for new sales.", 'event-tickets-with-ticket-scanner'), __("If active, the a new ticket will generated using the following settings", 'event-tickets-with-ticket-scanner'), "checkbox", "", [], false, 'https://youtu.be/hB6wW4_o2qc'); |
| 765 | $this->_options[] = $this->getOptionsObject('wcassignmentUseGlobalSerialFormatter_values', "","", "text", "", ["doNotRender"=>1]); |
| 766 | |
| 767 | $this->_options[] = $this->getOptionsObject('h13', __("Display ticket number to your loggedin user", 'event-tickets-with-ticket-scanner'), sprintf(/* translators: %s: shortcode */__("You can display the tickets assigned to an user with this shortcode %s.", 'event-tickets-with-ticket-scanner'), '<b>[sasoEventTicketsValidator_code]</b>'),"heading"); |
| 768 | $this->_options[] = $this->getOptionsObject('userDisplayCodePrefix', __("Text that will be added before the ticket number(s) for the user are displayed.", 'event-tickets-with-ticket-scanner'), "","text", __("Your ticket number(s):", 'event-tickets-with-ticket-scanner'), [], false, 'https://youtu.be/Ur-WvEROXUY'); |
| 769 | $this->_options[] = $this->getOptionsObject('userDisplayCodePrefixAlways', __("Display the prefix text always.", 'event-tickets-with-ticket-scanner'), __("If active, your prefix text will be rendered always. Even if the user is not logged in or do not have any tickets assigned to her yet.", 'event-tickets-with-ticket-scanner'), "checkbox", "", [], false, 'https://youtu.be/DbSor75q8Qk'); |
| 770 | $this->_options[] = $this->getOptionsObject('userDisplayCodeSeperator', __("Text or letter to be used as a seperator for ticket numbers of the user.", 'event-tickets-with-ticket-scanner'), __("If the user has more than one ticket number assigned to her, then this text will be used to seperate them for display the numbers. If left empty, then it will be ', ' as a default.", 'event-tickets-with-ticket-scanner'),"text", ", ", [], false, 'https://youtu.be/RESdZnylRD8'); |
| 771 | |
| 772 | $this->_options[] = $this->getOptionsObject('h14', __("QR code", 'event-tickets-with-ticket-scanner'), __("You can generate QR code images for your ticket numbers.", 'event-tickets-with-ticket-scanner'),"heading"); |
| 773 | $this->_options[] = $this->getOptionsObject('qrTicketPDFPadding', __("Padding for your QR code on the PDF", 'event-tickets-with-ticket-scanner'), __("For dark backgrounds it could be helpfull to add a white border to the QR code. The size lets you add a border. If you need one, then 4 is a good value.", 'event-tickets-with-ticket-scanner'), "number", 0, ['min'=>0], false, 'https://youtu.be/t0jDO6Km5Pk'); |
| 774 | $this->_options[] = $this->getOptionsObject('qrDirectURL', __("URL for the QR image", 'event-tickets-with-ticket-scanner'), __("The URL should be absolute, if you like to provide the generated QR image to your customers. The image can be retrieved within the event ticket area. The ticket number detail contains a button for it.<br>You can use these placeholder for your URL:<ul><li><b>{CODE}</b>: Will be replaced with the number (without the delimiters)</li><li><b>{CODEDISPLAY}</b>: Will be replaced with the number (WITH the delimiters)</li><b>{LIST}</b>: Name of the list if assigned</li><li><b>{LIST_DESC}</b>: Description of the assigned list</li><li><a href='#replacementtags'>You could use more tags.</a> But it is not recommend, since the QR code is generated within the admin area.</li></ul>", 'event-tickets-with-ticket-scanner'), "text", "", [], false, 'https://youtu.be/bYfviB7x9Xc'); |
| 775 | $this->_options[] = $this->getOptionsObject('ticketQRUseURLToTicketScanner', __("Add to the ticket QR code the full URL to the ticket scanner with the public ticket id", 'event-tickets-with-ticket-scanner'), __("If active, then the URL to your ticket scanner with the public ticket id will be used instead of only the public ticket id.", 'event-tickets-with-ticket-scanner'), "checkbox", "", [], false, 'https://youtu.be/zjpqpnvXxT0'); |
| 776 | $this->_options[] = $this->getOptionsObject('qrUseOwnQRContent', __("Use my QR content - I will use my own ticket scanner", 'event-tickets-with-ticket-scanner'), __("If active, then the QR content will use the following content. You will not be able to scan the tickets with the ticket scanner, because the format cannot be recognized by the plugin ticket scanner.", 'event-tickets-with-ticket-scanner'), "checkbox", "", [], false, 'https://youtu.be/eYdlEeBs1Rw'); |
| 777 | $this->_options[] = $this->getOptionsObject('qrOwnQRContent', __("My QR content", 'event-tickets-with-ticket-scanner'), __("Please make sure that you do not enter too many information, the more you add the finer the QR reader need to be able to scan.<br>You can use these placeholder for your content:<ul><li><b>{CODE}</b>: Will be replaced with the number (without the delimiters)</li><li><b>{CODEDISPLAY}</b>: Will be replaced with the number (WITH the delimiters)</li><b>{LIST}</b>: Name of the list if assigned</li><li><b>{LIST_DESC}</b>: Description of the assigned list</li><li><a href='#replacementtags'>You could use more tags.</a> But it is not recommend, since the QR code is generated within the admin area.</li></ul>", 'event-tickets-with-ticket-scanner'), "textarea", "{WC_TICKET__PUBLIC_TICKET_ID}", ["rows"=>5], false, 'https://youtu.be/LGhf7lfsHY4'); |
| 778 | $this->_options[] = $this->getOptionsObject('qrAttachQRImageToEmail', __("Attach QR image to purchase email", 'event-tickets-with-ticket-scanner'), __("If active, then the QR as an image will be attached to the purchase email. The settings are taken from the ticket settings for purchase email.", 'event-tickets-with-ticket-scanner'), "checkbox", "", [], false, 'https://youtu.be/8RzYNBgOHxw'); |
| 779 | $this->_options[] = $this->getOptionsObject('qrAttachQRPdfToEmail', __("Attach QR pdf to purchase email", 'event-tickets-with-ticket-scanner'), __("If active, then the QR as an pdf will be attached to the purchase email. The settings are taken from the ticket settings for purchase email.", 'event-tickets-with-ticket-scanner'), "checkbox", "", [], false, 'https://youtu.be/lIer7r3U5q0'); |
| 780 | $this->_options[] = $this->getOptionsObject('qrAttachQRFilesToMailAsOnePDF', __("Attach QR PDF to purchase email as one PDF instead of single PDFs", 'event-tickets-with-ticket-scanner'), __("If active, the ticket QR code files are merged into one PDF and will be added as an attachment to the mails.", 'event-tickets-with-ticket-scanner'), "checkbox", "", [], false, 'https://youtu.be/8ZsXV95XGnw'); |
| 781 | |
| 782 | $this->_options[] = $this->getOptionsObject('hCongress', __("Congress-Modus", 'event-tickets-with-ticket-scanner'), "", "heading"); |
| 783 | $this->_options[] = $this->getOptionsObject( |
| 784 | 'congressDefaultLabel', |
| 785 | __("Default portal label", 'event-tickets-with-ticket-scanner'), |
| 786 | __("The generic name for the info portal when a portal has no own label set (e.g. \"Infos\", \"Congress\", \"Opera\", \"Zoo\"). Shown in the wallet action and the order email.", 'event-tickets-with-ticket-scanner'), |
| 787 | "text", |
| 788 | __("Infos", 'event-tickets-with-ticket-scanner') |
| 789 | ); |
| 790 | $this->_options[] = $this->getOptionsObject( |
| 791 | 'congressModeActive', |
| 792 | __("Congress page active", 'event-tickets-with-ticket-scanner'), |
| 793 | __("Shows the congress information page publicly to ticket holders. The page is only displayed when the ticket's product has a congress assigned to it. The congress admin area (Congresses menu) is always available regardless of this setting.", 'event-tickets-with-ticket-scanner'), |
| 794 | "checkbox", |
| 795 | true |
| 796 | ); |
| 797 | $this->_options[] = $this->getOptionsObject( |
| 798 | 'congressAccessHoursBefore', |
| 799 | __("Congress access — hours before event start", 'event-tickets-with-ticket-scanner'), |
| 800 | __("How many hours before a congress' event start the page becomes accessible. Only applies when the congress has an event start time set. 0 = no early restriction (accessible immediately).", 'event-tickets-with-ticket-scanner'), |
| 801 | "number", |
| 802 | 0, |
| 803 | ['min'=>0] |
| 804 | ); |
| 805 | $this->_options[] = $this->getOptionsObject( |
| 806 | 'congressRetentionDaysAfter', |
| 807 | __("Congress access — days available after event end", 'event-tickets-with-ticket-scanner'), |
| 808 | __("How many days after a congress' event end the page stays available. Only applies when the congress has an event end time set. 0 = available forever (no automatic expiry).", 'event-tickets-with-ticket-scanner'), |
| 809 | "number", |
| 810 | 0, |
| 811 | ['min'=>0] |
| 812 | ); |
| 813 | $this->_options[] = $this->getOptionsObject( |
| 814 | 'congressEmailLinkActive', |
| 815 | __("Add congress link to the order email", 'event-tickets-with-ticket-scanner'), |
| 816 | __("If active, a link to the congress page is added to the WooCommerce order email for every ticket whose product has a congress assigned.", 'event-tickets-with-ticket-scanner'), |
| 817 | "checkbox", |
| 818 | "" |
| 819 | ); |
| 820 | $this->_options[] = $this->getOptionsObject( |
| 821 | 'congressEmailLinkLabel', |
| 822 | __("Label for the congress link in the email", 'event-tickets-with-ticket-scanner'), |
| 823 | __("The clickable text for the congress link in the order email. If left empty, a default is used.", 'event-tickets-with-ticket-scanner'), |
| 824 | "text", |
| 825 | __("Open your congress page", 'event-tickets-with-ticket-scanner') |
| 826 | ); |
| 827 | $this->_options[] = $this->getOptionsObject( |
| 828 | 'congressShowWalletLink', |
| 829 | __("Show 'Add to Wallet' link on the congress page", 'event-tickets-with-ticket-scanner'), |
| 830 | __("If active, the congress page offers the ticket holder a link to add/open the ticket in the Vollstart Wallet app.", 'event-tickets-with-ticket-scanner'), |
| 831 | "checkbox", |
| 832 | "" |
| 833 | ); |
| 834 | |
| 835 | if (!$this->MAIN->isPremium()) { |
| 836 | $this->_options[] = $this->getOptionsObject( |
| 837 | 'h_contact_premium', |
| 838 | __("Contact sharing (Premium only)", 'event-tickets-with-ticket-scanner'), |
| 839 | __("Let congress attendees enter and exchange contact details (badge scan). Available in the premium version.", 'event-tickets-with-ticket-scanner'), |
| 840 | "heading" |
| 841 | ); |
| 842 | } |
| 843 | |
| 844 | // Premium-Options (inkl. License-Key-Eingabefeld) anzeigen wenn Premium-Plugin installiert ist, |
| 845 | // unabhängig vom Subscription-Validierungsstatus. Sonst kann der User seinen Key nicht eingeben. |
| 846 | if (method_exists($this->MAIN->getPremiumFunctions(), '_initOptions')) { |
| 847 | $this->_options = $this->MAIN->getPremiumFunctions()->_initOptions($this->_options); |
| 848 | } elseif ($this->MAIN->isOldPremiumDetected() || $this->MAIN->isStarterOrStopDetected()) { |
| 849 | // Old premium, Starter, or Stop plugin detected — show license key field so user can enter/update |
| 850 | // their key, which PUC (in the premium plugin) needs to check for updates. |
| 851 | $serial = trim(get_option("saso-event-tickets-premium_serial", "")); |
| 852 | |
| 853 | // Different description based on plugin type |
| 854 | if ($this->MAIN->isStarterOrStopDetected()) { |
| 855 | $is_stop = defined('SASO_EVENTTICKETS_STOP_VERSION'); |
| 856 | if ($is_stop) { |
| 857 | $desc = __("Your subscription has expired. Please renew your license to continue using Premium features.", 'event-tickets-with-ticket-scanner'); |
| 858 | } else { |
| 859 | $desc = __("Enter your Premium license key, then update to the latest Premium version within the Plugins page.", 'event-tickets-with-ticket-scanner'); |
| 860 | } |
| 861 | } else { |
| 862 | $desc = __("Enter your Premium license key. After updating the Premium plugin to version 1.6.0+, all premium features will be restored.", 'event-tickets-with-ticket-scanner'); |
| 863 | } |
| 864 | |
| 865 | $serialOption = $this->getOptionsObject( |
| 866 | 'serial', |
| 867 | __("Premium License Key", 'event-tickets-with-ticket-scanner'), |
| 868 | $desc, |
| 869 | "text", |
| 870 | $serial |
| 871 | ); |
| 872 | array_unshift($this->_options, $serialOption); |
| 873 | } |
| 874 | |
| 875 | return $this->_options; |
| 876 | } |
| 877 | public function getOptionsObject($key, $label, $desc="",$type="checkbox",$def=null,$additional=[], $isPublic=false, $doc_video='', $do_not_trim=false) { |
| 878 | if ($def == null) { |
| 879 | switch($type) { |
| 880 | case "number": |
| 881 | case "checkbox": |
| 882 | $def = 0; |
| 883 | break; |
| 884 | default: |
| 885 | $def = ""; |
| 886 | } |
| 887 | } |
| 888 | return [ |
| 889 | 'key'=>$key, |
| 890 | 'id'=>$this->_prefix.$key, |
| 891 | 'label'=>$label, |
| 892 | 'desc'=>$desc, |
| 893 | 'value'=>$def, |
| 894 | 'type'=>$type, |
| 895 | 'default'=>$def, |
| 896 | 'additional'=>$additional, |
| 897 | 'isPublic'=>$isPublic, |
| 898 | '_isLoaded'=>false, |
| 899 | '_doc_video'=>$doc_video, |
| 900 | '_do_not_trim'=>$do_not_trim |
| 901 | ]; |
| 902 | } |
| 903 | public function loadOptionFromWP($option_id, $default=null, $prefix=null) { |
| 904 | if ($prefix == null) $prefix = $this->_prefix; |
| 905 | // For framework options post-migration, read from custom table |
| 906 | if ($this->_isMigrationComplete() && $prefix === $this->_prefix) { |
| 907 | $option = $this->getOption($option_id); |
| 908 | if ($option !== null) { |
| 909 | return $this->_getOptionValue($option); |
| 910 | } |
| 911 | } |
| 912 | return get_option($prefix.$option_id, $default); |
| 913 | } |
| 914 | /** |
| 915 | * Get ALL options with values loaded. Triggers bulk DB load. |
| 916 | * Use for admin pages where all options are displayed. |
| 917 | * For reading a single option, use getOptionValue() instead (lazy, single query). |
| 918 | */ |
| 919 | public function getOptions() { |
| 920 | if ($this->_isMigrationComplete()) { |
| 921 | $this->_loadAllFromCustomTable(); |
| 922 | } else { |
| 923 | $this->_loadAllFromWpOptions(); |
| 924 | } |
| 925 | return $this->_options; |
| 926 | } |
| 927 | public function getOptionsKeys() { |
| 928 | $keys = []; |
| 929 | foreach($this->_options as $option) { |
| 930 | $keys[] = $option["key"]; |
| 931 | } |
| 932 | return $keys; |
| 933 | } |
| 934 | public function getOptionsOnlyPublic() { |
| 935 | $ret = []; |
| 936 | $options = $this->getOptions(); |
| 937 | foreach($options as $option) { |
| 938 | if ($option['isPublic'] == true) { |
| 939 | $ret[] = $option; |
| 940 | } |
| 941 | } |
| 942 | return $ret; |
| 943 | } |
| 944 | /** |
| 945 | * Get a single option by key. Lazy: loads only this option from DB if not yet cached. |
| 946 | * Does NOT trigger a bulk load — use getOptions() for that (admin page). |
| 947 | */ |
| 948 | public function getOption($key) { |
| 949 | $key = trim($key); |
| 950 | if (empty($key)) return null; |
| 951 | foreach ($this->_options as $idx => $option) { |
| 952 | if ($option['key'] === $key) { |
| 953 | if (!$option['_isLoaded']) { |
| 954 | $this->_loadSingleOption($idx); |
| 955 | } |
| 956 | return $this->_options[$idx]; |
| 957 | } |
| 958 | } |
| 959 | return null; |
| 960 | } |
| 961 | private function _setOptionValuesByKey(string $key, string $field, $value): void { |
| 962 | foreach ($this->_options as $idx => $option) { |
| 963 | if ($option['key'] === $key) { |
| 964 | $this->_options[$idx][$field] = $value; |
| 965 | break; |
| 966 | } |
| 967 | } |
| 968 | } |
| 969 | public function resetAllOptionValuesToDefault() { |
| 970 | $allOption = $this->getOptions(); |
| 971 | foreach ($allOption as $key => $singleOption) { |
| 972 | $data = []; |
| 973 | $key= $singleOption['key']; |
| 974 | $default= $singleOption['default']; |
| 975 | $data = array("key"=>$key, "value"=>$default); |
| 976 | $this->changeOption($data); |
| 977 | } |
| 978 | do_action( $this->MAIN->_do_action_prefix.'options_resetAllOptionValuesToDefault', $allOption ); |
| 979 | return true; |
| 980 | } |
| 981 | public function deleteAllOptionValues() { |
| 982 | if ($this->_isMigrationComplete()) { |
| 983 | global $wpdb; |
| 984 | $table = $this->MAIN->getDB()->getTabelle('options'); |
| 985 | $wpdb->query("TRUNCATE TABLE {$table}"); |
| 986 | } else { |
| 987 | $allOption = $this->getOptions(); |
| 988 | foreach ($allOption as $option) { |
| 989 | delete_option($option['id']); |
| 990 | } |
| 991 | } |
| 992 | do_action($this->MAIN->_do_action_prefix.'options_deleteAllOptionValues', $this->_options); |
| 993 | $this->_options = []; |
| 994 | $this->_dbValuesCache = null; |
| 995 | $this->initOptions(); |
| 996 | return true; |
| 997 | } |
| 998 | public function deleteOption($key) { |
| 999 | foreach ($this->_options as $idx => $value) { |
| 1000 | if ($value['key'] == $key) { |
| 1001 | $this->_logOptionChange($key, $value['value'], ''); |
| 1002 | if ($this->_isMigrationComplete()) { |
| 1003 | $this->_deleteFromCustomTable($key); |
| 1004 | } else { |
| 1005 | delete_option($value['id']); |
| 1006 | } |
| 1007 | if ($this->_dbValuesCache !== null) { |
| 1008 | unset($this->_dbValuesCache[$key]); |
| 1009 | } |
| 1010 | unset($this->_options[$idx]); |
| 1011 | do_action($this->MAIN->_do_action_prefix.'options_deleteOption', $key); |
| 1012 | return true; |
| 1013 | } |
| 1014 | } |
| 1015 | return false; |
| 1016 | } |
| 1017 | public function changeOption($data) { |
| 1018 | $option = $this->getOption($data['key']); |
| 1019 | if ($option != null) { |
| 1020 | $oldValue = $option['value']; |
| 1021 | if ($option['type'] == "checkbox") { |
| 1022 | $v = intval($data['value']); |
| 1023 | } else { |
| 1024 | if (is_array($data['value'])) { |
| 1025 | array_walk($data['value'], "trim"); |
| 1026 | } else { |
| 1027 | if (isset($option['_do_not_trim']) && $option['_do_not_trim']) { |
| 1028 | $data['value'] = $data['value']; |
| 1029 | } else { |
| 1030 | $data['value'] = trim($data['value']); |
| 1031 | } |
| 1032 | } |
| 1033 | $v = $data['value']; |
| 1034 | } |
| 1035 | if ($this->_isMigrationComplete()) { |
| 1036 | $this->_writeToCustomTable($data['key'], $v); |
| 1037 | } else { |
| 1038 | update_option($option['id'], $v, false); |
| 1039 | } |
| 1040 | $this->_setOptionValuesByKey($data['key'], 'value', $v); |
| 1041 | // Keep bulk cache in sync so future reads stay consistent |
| 1042 | if ($this->_dbValuesCache !== null) { |
| 1043 | $this->_dbValuesCache[$data['key']] = is_array($v) ? json_encode($v) : (string) $v; |
| 1044 | } |
| 1045 | $this->_logOptionChange($data['key'], $oldValue, $v); |
| 1046 | } |
| 1047 | // When license key is changed via basic plugin (old premium compat), also store in the |
| 1048 | // option that PUC and the license check read from. |
| 1049 | if ($data['key'] === 'serial' && ($this->MAIN->isOldPremiumDetected() || $this->MAIN->isStarterOrStopDetected())) { |
| 1050 | $newSerial = trim($data['value']); |
| 1051 | update_option("saso-event-tickets-premium_serial", $newSerial); |
| 1052 | |
| 1053 | // If a valid-format serial was entered, trigger an immediate update |
| 1054 | // check so the user doesn't have to manually click "Update" to |
| 1055 | // replace the starter/stop plugin with the real premium. |
| 1056 | if (!empty($newSerial) && preg_match('/^(abo_|lts_)?[A-Z0-9]{3,}-[A-Z0-9]{3,}-[A-Z0-9]{3,}-[A-Z0-9]{3,}$/i', $newSerial)) { |
| 1057 | $this->MAIN->autoUpgradePremiumAfterLicenseSave(); |
| 1058 | } |
| 1059 | } |
| 1060 | // Suppress all license-related admin banners for 60s while the license |
| 1061 | // check/upgrade runs. Prevents the scary red "expired"/"Starter plugin" |
| 1062 | // banners from re-appearing on the next page render before the license |
| 1063 | // server has confirmed the new serial. |
| 1064 | if ($data['key'] === 'serial' && !empty(trim((string) $data['value']))) { |
| 1065 | set_transient('saso_license_just_saved', 1, 60); |
| 1066 | } |
| 1067 | do_action( $this->MAIN->_do_action_prefix.'changeOption', $data); |
| 1068 | } |
| 1069 | public function getOptionValue($name, $def="") { |
| 1070 | $option = $this->getOption($name); |
| 1071 | if ($option == null) return $def; |
| 1072 | return $this->_getOptionValue($option); |
| 1073 | } |
| 1074 | private function _getOptionValue($option) { |
| 1075 | $ret = ""; |
| 1076 | if ($option == null) return $ret; |
| 1077 | |
| 1078 | if (is_array($option['value'])) { |
| 1079 | $ret = $option['value']; |
| 1080 | if (count($option['value']) == "") $ret = $option['default']; |
| 1081 | } else { |
| 1082 | if (isset($option['_do_not_trim']) && $option['_do_not_trim']) { |
| 1083 | $ret = $option['value'] == "" ? $option['default'] : $option['value']; |
| 1084 | } else { |
| 1085 | $ret = trim($option['value']) == "" ? $option['default'] : $option['value']; |
| 1086 | } |
| 1087 | } |
| 1088 | return $ret; |
| 1089 | } |
| 1090 | public function isOptionCheckboxActive($optionname) { |
| 1091 | $option = $this->getOption($optionname); |
| 1092 | if ($option == null) return false; |
| 1093 | $val = $this->_getOptionValue($option); |
| 1094 | if (intval($val) == 1 || boolval($val) == true || $val == "true" || $val == "yes") return true; |
| 1095 | return false; |
| 1096 | } |
| 1097 | |
| 1098 | public function getOptionDateFormat() { |
| 1099 | $date_format = $this->getOptionValue('displayDateFormat'); |
| 1100 | try { |
| 1101 | $d = wp_date($date_format); |
| 1102 | } catch(Exception $e) { |
| 1103 | $date_format = 'Y/m/d'; |
| 1104 | } |
| 1105 | return $date_format; |
| 1106 | } |
| 1107 | public function getOptionTimeFormat() { |
| 1108 | $date_format = $this->getOptionValue('displayTimeFormat'); |
| 1109 | try { |
| 1110 | $d = wp_date($date_format); |
| 1111 | } catch(Exception $e) { |
| 1112 | $date_format = 'H:i'; |
| 1113 | } |
| 1114 | return $date_format; |
| 1115 | } |
| 1116 | public function getOptionDateTimeFormat() { |
| 1117 | $date_format = $this->getOptionDateFormat(); |
| 1118 | $time_format = $this->getOptionTimeFormat(); |
| 1119 | // check if the date values are working |
| 1120 | try { |
| 1121 | $d = wp_date($date_format." ".$time_format); |
| 1122 | } catch(Exception $e) { |
| 1123 | $date_format = 'Y/m/d'; |
| 1124 | } |
| 1125 | return $date_format." ".$time_format; |
| 1126 | } |
| 1127 | |
| 1128 | public function get_wcTicketAttachTicketToMailOf() { |
| 1129 | $ret = [ |
| 1130 | "customer_processing_order", |
| 1131 | "customer_completed_order" |
| 1132 | ]; |
| 1133 | if ($this->MAIN->isPremium()) { |
| 1134 | $ret = $this->getOptionValue("wcTicketAttachTicketToMailOf"); |
| 1135 | if (!is_array($ret)) { |
| 1136 | $ret = [$ret]; |
| 1137 | } |
| 1138 | } |
| 1139 | $ret = apply_filters( $this->MAIN->_add_filter_prefix.'options_get_wcTicketAttachTicketToMailOf', $ret ); |
| 1140 | return $ret; |
| 1141 | } |
| 1142 | |
| 1143 | } |
| 1144 | ?> |