Skip to content

Commit 6a26b61

Browse files
committed
Remove Phone Masking option in favor of Country Codes
1 parent 218fd2d commit 6a26b61

File tree

6 files changed

+13
-45
lines changed

6 files changed

+13
-45
lines changed

admin_settings_default.php

-22
Original file line numberDiff line numberDiff line change
@@ -218,28 +218,6 @@
218218
</div>
219219
</div>
220220

221-
<div class="form-group">
222-
<label>Phone Mask</label>
223-
<div class="input-group">
224-
<div class="input-group-prepend">
225-
<span class="input-group-text"><i class="fa fa-phone"></i></span>
226-
</div>
227-
<select class="form-control select2" name="phone_mask">
228-
<?php
229-
$sql = mysqli_query($mysqli, "SELECT config_phone_mask FROM settings WHERE company_id = 1");
230-
while ($row = mysqli_fetch_array($sql)) {
231-
$phone_mask = intval($row['config_phone_mask']);
232-
} ?>
233-
<option <?php if ($phone_mask == 1) { echo "selected"; }?> value=1>
234-
US Format - e.g. (412) 888-9999
235-
</option>
236-
<option <?php if ($phone_mask == 0) { echo "selected"; }?> value=0>
237-
Non-US Format - e.g. 4128889999
238-
</option>
239-
</select>
240-
</div>
241-
</div>
242-
243221
<hr>
244222

245223
<button type="submit" name="edit_default_settings" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Save</button>

database_updates.php

+8-3
Original file line numberDiff line numberDiff line change
@@ -3419,10 +3419,15 @@ function processFile($file_path, $file_name, $mysqli) {
34193419
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.1'");
34203420
}
34213421

3422-
// if (CURRENT_DATABASE_VERSION == '2.1.1') {
3423-
// // Insert queries here required to update to DB version 2.1.2
3422+
if (CURRENT_DATABASE_VERSION == '2.1.1') {
3423+
mysqli_query($mysqli, "ALTER TABLE `settings` DROP `config_phone_mask`");
3424+
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.2'");
3425+
}
3426+
3427+
// if (CURRENT_DATABASE_VERSION == '2.1.2') {
3428+
// // Insert queries here required to update to DB version 2.1.3
34243429
// // Then, update the database to the next sequential version
3425-
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.2'");
3430+
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.3'");
34263431
// }
34273432

34283433
} else {

db.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -2499,4 +2499,4 @@ CREATE TABLE `vendors` (
24992499
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
25002500
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
25012501

2502-
-- Dump completed on 2025-03-24 12:48:58
2502+
-- Dump completed on 2025-03-26 11:10:26

post/admin/admin_settings_default.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
$calendar = intval($_POST['calendar']);
1717
$net_terms = intval($_POST['net_terms']);
1818
$hourly_rate = floatval($_POST['hourly_rate']);
19-
$phone_mask = intval($_POST['phone_mask']);
2019

21-
mysqli_query($mysqli,"UPDATE settings SET config_start_page = '$start_page', config_default_expense_account = $expense_account, config_default_payment_account = $payment_account, config_default_payment_method = '$payment_method', config_default_expense_payment_method = '$expense_payment_method', config_default_transfer_from_account = $transfer_from_account, config_default_transfer_to_account = $transfer_to_account, config_default_calendar = $calendar, config_default_net_terms = $net_terms, config_default_hourly_rate = $hourly_rate, config_phone_mask = $phone_mask WHERE company_id = 1");
20+
mysqli_query($mysqli,"UPDATE settings SET config_start_page = '$start_page', config_default_expense_account = $expense_account, config_default_payment_account = $payment_account, config_default_payment_method = '$payment_method', config_default_expense_payment_method = '$expense_payment_method', config_default_transfer_from_account = $transfer_from_account, config_default_transfer_to_account = $transfer_to_account, config_default_calendar = $calendar, config_default_net_terms = $net_terms, config_default_hourly_rate = $hourly_rate WHERE company_id = 1");
2221

2322
// Logging
2423
logAction("Settings", "Edit", "$session_name edited default settings");

scripts/setup_cli.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ function getOptionOrPrompt($key, $promptMessage, $required = false, $default = '
328328

329329
// Finalizing
330330
mysqli_query($mysqli,"UPDATE companies SET company_locale = '$locale', company_currency = '$currency_code' WHERE company_id = 1");
331-
mysqli_query($mysqli,"UPDATE settings SET config_timezone = '$timezone', config_phone_mask = 1 WHERE company_id = 1");
331+
mysqli_query($mysqli,"UPDATE settings SET config_timezone = '$timezone' WHERE company_id = 1");
332332
mysqli_query($mysqli,"INSERT INTO accounts SET account_name = 'Cash', account_currency_code = '$currency_code'");
333333

334334
// Telemetry (optional if interactive)

setup.php

+2-16
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,10 @@
344344
$locale = sanitizeInput($_POST['locale']);
345345
$currency_code = sanitizeInput($_POST['currency_code']);
346346
$timezone = sanitizeInput($_POST['timezone']);
347-
$phone_mask = intval($_POST['phone_mask']);
348347

349348
mysqli_query($mysqli,"UPDATE companies SET company_locale = '$locale', company_currency = '$currency_code' WHERE company_id = 1");
350349

351-
mysqli_query($mysqli,"UPDATE settings SET config_timezone = '$timezone', config_phone_mask = $phone_mask WHERE company_id = 1");
350+
mysqli_query($mysqli,"UPDATE settings SET config_timezone = '$timezone' WHERE company_id = 1");
352351

353352
// Create Default Cash Account
354353
mysqli_query($mysqli,"INSERT INTO accounts SET account_name = 'Cash', account_currency_code = '$currency_code'");
@@ -1058,7 +1057,7 @@ function return_bytes($val) {
10581057
<div class="input-group-prepend">
10591058
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
10601059
</div>
1061-
<input type="text" class="form-control" name="phone" placeholder="Phone Number">
1060+
<input type="tel" class="form-control" name="phone" placeholder="Phone Number">
10621061
</div>
10631062
</div>
10641063

@@ -1146,19 +1145,6 @@ function return_bytes($val) {
11461145
</div>
11471146
</div>
11481147

1149-
<div class="form-group">
1150-
<label>Phone Mask</label>
1151-
<div class="input-group">
1152-
<div class="input-group-prepend">
1153-
<span class="input-group-text"><i class="fa fa-phone"></i></span>
1154-
</div>
1155-
<select class="form-control select2" name="phone_mask">
1156-
<option value="1">US Format - e.g. (412) 888-9999</option>
1157-
<option value="0">Non-US Format - e.g. 4128889999</option>
1158-
</select>
1159-
</div>
1160-
</div>
1161-
11621148
<hr>
11631149

11641150
<button type="submit" name="add_localization_settings" class="btn btn-primary text-bold">

0 commit comments

Comments
 (0)