127 Commits

Author SHA1 Message Date
FusionPBX
4ed611a187 When the toggle field and values are empty then use defaults 2023-08-15 21:37:05 -06:00
FusionPBX
4bf775897e Replace GLOB_BRACE as its not supported by all systems. 2023-08-14 11:27:40 -06:00
fusionate
ceb0637c83 Database [Class]: Update for PHP 8.1 2023-07-05 23:12:00 +00:00
FusionPBX
ec04006971 Change the scope of the database variables 2023-06-28 15:29:28 -06:00
FusionPBX
bcf7cbaad2 Save database errors to the message variable 2023-06-19 16:08:54 -06:00
markjcrane
1452bde1ac Update the database class to find the require.php 2023-06-17 22:29:15 -06:00
markjcrane
32051873be Use __dir__ to find resources/require.php 2023-06-16 22:49:09 -06:00
fusionate
8b982dd6e3 Database [Class]: Modify copy() method to support enable and description fields without the table name. 2023-06-09 19:42:10 +00:00
FusionPBX
7979ff145b Use $this->message
Reason for using this message rather than local message variable is that it get changed and the information we want is preserved in the class variable.
2023-05-26 09:55:18 -06:00
fusionate
6119f7de7d Database [Class]: Update for PHP 8.1 2023-05-25 15:40:20 +00:00
markjcrane
251feddff8 Return this->message variable as array. 2023-05-24 23:00:08 -06:00
fusionate
dfdcba5a0c Database [Class]: Update for PHP 8.1 2023-05-23 02:42:19 +00:00
markjcrane
7ee2b7c4b3 Add parentheses to empty string detection 2023-05-22 16:26:01 -06:00
markjcrane
a419fa985b Use isset when empty as it could be numeric. 2023-05-22 16:16:58 -06:00
fusionate
67e77560a6 Database [Class]: Updates for PHP 8.1 2023-05-21 01:13:45 +00:00
fusionate
878e83fc80 Database [Class]: Updates for PHP 8.1 2023-05-20 23:57:07 +00:00
FusionPBX
25fdc12f18 Strict identical condition required
Otherwise this condition matches a numeric value of 0.
2023-05-19 15:29:38 -06:00
FusionPBX
778b5832be database save method returns result details 2023-05-18 16:29:03 -06:00
markjcrane
0dec70827d Change approach for handling the user_uuid 2023-05-18 00:49:20 -06:00
fusionate
1618c84e07 Database [Class]: Fix typo. 2023-05-17 20:36:48 +00:00
markjcrane
6d7e125743 Fix all PHP 8.1 messages for upgrade.php 2023-05-17 10:07:49 -06:00
FusionPBX
64c159931c Update database.php strlen replace with isset
Used isset instead of empty because empty treats a numeric value of 0 as empty.
2023-05-13 22:13:40 -06:00
FusionPBX
7a8b2b7d79 Update database.php prevent more php 8.1 warnings. 2023-05-13 12:35:17 -06:00
FusionPBX
b732c0afe9 [Bug] value of 0 treated as empty
When empty is used its treating 0 as an empty value and then the value is set to null.  Will work on the changes further to prevent this problem.
2023-05-09 11:14:41 -06:00
FusionPBX
bc0c2ea588 $db variable needed by schema class 2023-05-09 08:39:42 -06:00
FusionPBX
9e4e8558e5 Remove debug 2023-05-08 22:30:39 -06:00
frytimo
fef8165be2 Frytimo pr patches for php8.1 (#6630)
* Passing null to parameter #2 ($string) of type string is deprecated

* Passing null to parameter #1 ($string) of type string is deprecated

* php 8.1 fixes

* php 8.1 fixes - replace strlen($var) > 0 with !empty($var)

* php 8.1 fixes - replace ${var} with {$var}

* php 8.1 fixes - replace ${var} with {$var}

* php 8.1 fixes - replace ${var} with {$var}

* php 8.1 fixes - replace ${var} with {$var}

* php 8.1 fixes - strlower with null

* php 8.1 fixes - strreplace with null

* php 8.1 fixes - passing null to base64_decode

* php 8.1 fixes - check for false and check for null on $this->dir

* php 8.1 fixes - remove assignment of $db variable to modules object

* php 8.1 fixes - avoid sending null to substr

* php 8.1 fixes - change ${var} to {$var}

* php 8.1 fixes - check for null before preg_replace

* php 8.1 fixes - remove setting db variable on domains object

* php 8.1 fixes - set empty string if $row['domain_setting_subcategory'] is null

* php 8.1 fixes - set empty string if $_REQUEST['show'] is not available

* php 8.1 fixes

* php 8.1 fixes - correct $_POST checking syntax

* php 8.1 fixes - correct $_POST variables

* php 8.1 fixes

* Use brackets consistently

* Update user_setting_edit.php

* Change to not empty

* Update device.php

* Update text.php

---------

Co-authored-by: Tim Fry <tim@voipstratus.com>
Co-authored-by: FusionPBX <markjcrane@gmail.com>
2023-05-05 10:46:37 -06:00
frytimo
69bd42af05 remove unneeded destruct methods as GC has higher performance (#6631)
Co-authored-by: Tim Fry <tim@voipstratus.com>
2023-04-27 20:18:53 -06:00
frytimo
8e86fe6243 Remove '&' on new (#6559)
Remove '&' on static function new.
2023-02-21 09:39:15 -07:00
FusionPBX
52308e2f15 Set new_json from the array
Fixes the new_json value that is added to the database transactions table.
2022-12-29 23:55:11 -07:00
FusionPBX
f714ef6798 Fix problems with the app_uuid and domain_uuid
app_uuid was null, and domain_uuid getting the wrong uuid.
2022-12-22 13:04:24 -07:00
FusionPBX
a83982ea1b Set where and order_by to public 2022-12-14 09:58:27 -07:00
FusionPBX
d3ee256286 Remove these as they break PHP 7.0
Doesn't just break PHP 5.6 it also breaks PHP 7.0
2022-11-01 15:52:56 -06:00
FusionPBX
87ccce1867 Fix the sub data insert. 2022-10-18 13:04:16 -06:00
FusionPBX
878e5a10eb Update database method connect to use config.conf 2022-10-10 19:43:07 -06:00
markjcrane
d50bcb476a Replace root.php 2022-10-10 16:35:14 -06:00
FusionPBX
aeec91fae8 Fix insert on for child data
Add a few try catch,
Add ; to the end of a few SQL queries
2022-09-30 12:46:44 -06:00
FusionPBX
a355dda5b7 Fix a copy error.
Fixed the copy issue when the data includes insert_user, insert_update, update_user and update_date.
2022-09-20 13:56:54 -06:00
FusionPBX
e29877e958 Move unset parameters outside of the debug
Unset of the parameters is required or can have parameters that interfere with other queries.
2022-09-19 09:30:20 -06:00
FusionPBX
4400618830 Sub array data use the child table name.
In Destination edit it was using the dialplan table name instead of child dialplan details table.
2022-09-18 04:47:17 -06:00
FusionPBX
50b66f8bea If the domain_uuid is null the data is global.
This error broken dialplan edit when saving a global dialplan.
2022-09-18 03:08:18 -06:00
FusionPBX
d5bd5957a4 Minor edit add a few spaces. 2022-09-18 02:59:58 -06:00
FusionPBX
7c2017bd03 On insert and update add the user and date 2022-09-18 02:57:43 -06:00
FusionPBX
2ff62f638b Add a few minor changes for code consistency. 2022-09-18 02:13:33 -06:00
frytimo
ba3b60b07b Move database methods to static and document database class (#6474)
* Add new static method to created newly connected database object

* Document database class and clean up and document some of the methods.
This removes the methods that should not be in each instance and places
them in the single instance class as to occupy less resources and be
able to create database objects more efficiently.

* More docs & removed the ability to set any value within the object.

Co-authored-by: Tim Fry <tim@voipstratus.com>
2022-09-17 15:44:21 -06:00
frytimo
6bb6ae6b2b Fix PHP warning for PDO::setAttribute() requires 2 parameters (#6464)
Co-authored-by: Tim Fry <tim@voipstratus.com>
2022-08-24 14:09:33 -06:00
FusionPBX
ea9b9ce621 Update additional occurances of PDO::PGSQL_ATTR_DISABLE_PREPARES 2022-08-18 17:53:33 -06:00
FusionPBX
2783cbd251 Update database.php 2022-08-18 17:39:51 -06:00
FusionPBX
98b19d1f22 Only add PDO::PGSQL_ATTR_DISABLE_PREPARES for versions of PHP that support it. 2022-08-18 17:37:43 -06:00
FusionPBX
8431d419ca Reduce round trips to the database server.
Add PDO attribute:  PDO::PGSQL_ATTR_DISABLE_PREPARES
https://prototype.php.net/manual/en/ref.pdo-pgsql.php
2022-08-08 16:58:52 -06:00