148 Commits

Author SHA1 Message Date
FusionPBX
7f89f4d98e Fix transactions to save the domain_uuid
Symptom
Advanced -> Transactions showed as global when it should have shown the correct domain. This was failing when saving a new record.
2025-07-03 09:23:34 -06:00
FusionPBX
4079b0a690 Fix the user_uuid using database::new() 2025-07-03 08:17:46 -06:00
frytimo
ba1dc820eb suppress access on null php notice in new is_connected method (#7228) 2025-01-23 13:44:36 -07:00
frytimo
5ef71889fe add is_connected method to database (#7226) 2025-01-23 11:52:44 -07:00
FusionPBX
5815699489 Add more debug details and return false 2025-01-22 20:36:29 -07:00
FusionPBX
5d4d7a0fd6 Enhance message array debug details 2025-01-22 20:08:59 -07:00
FusionPBX
9dbc493844 Replace exit; with return false; 2025-01-22 19:27:58 -07:00
frytimo
2cbb4dbc31 remove instances where a pointer is used in a foreach loop for value (#7108) 2024-08-22 12:41:10 -06:00
FusionPBX
ba3ab5a8c9 Use parent_name as its more intuitive
Also replace $this->name with $this->app_name
2024-08-06 17:07:16 -06:00
FusionPBX
c960575796 Update database.php 2024-08-06 11:28:32 -06:00
FusionPBX
46bbb31391 Update database.php
- preset empty values for variables and arrays
- use $table_name instead of $this->name
2024-08-06 02:52:55 -06:00
FusionPBX
b3f31af5a8 If data is global then domain_uuid set to null
This means transaction is global. If there is a domain_uuid use the domain ID from the data.
2024-08-01 18:02:15 -06:00
Antonio Fernandez
dcf1f9d17c Update database.php (#7053)
Fix for table_exists method on mysql
2024-07-18 12:10:05 -06:00
frytimo
a863faaae2 fix the user_uuid missing from transaction tables (#7026)
Co-authored-by: Tim Fry <tim@fusionpbx.com>
2024-06-27 11:26:16 -06:00
frytimo
f0a80426eb add function to return the config object used to create the database object (#6998)
Co-authored-by: Tim Fry <tim@fusionpbx.com>
2024-06-08 09:57:33 -06:00
FusionPBX
d9c92c00e9 Update database.php add comments 2024-05-02 06:40:30 -06:00
FusionPBX
0c08780ca2 Update database.php 2024-04-27 19:29:50 -06:00
frytimo
0b8edef82c Config class rewrite (#6965)
* Use a singleton pattern in the database class to re-use the database object inside the permission_exists function.
2024-04-27 19:22:20 -06:00
FusionPBX
2a1e36ca02 Add apps as a class variable
- Use self:$apps
- Replace $_SESSION['apps']
2024-04-19 11:07:30 -06:00
FusionPBX
768937b624 Update database.php
- Allow sending $params into the constructor.
- Add paramaters: domain_uuid and user_uuid
- Replace $user_uuid and the session variable with $this->user_uuid
- Use the SESSION as an alternative to the parameter
2024-04-19 09:48:05 -06:00
frytimo
758cb2ec60 set to compare instead of assignment in the message error checking (#6933) 2024-03-28 22:07:04 -06:00
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