Commit Graph

59 Commits

Author SHA1 Message Date
FusionPBX
16110ecb70 Update schema alter table boolean 2025-09-23 11:49:05 -06:00
FusionPBX
a5845c6065 Update schema.php 2025-09-21 00:04:23 -06:00
FusionPBX
7f9064fadb Update boolean toggle and the database boolean type (#7522)
* Change the data type to boolean

* Use boolean values in SQL and Conditional Statements

* Schema Data Types: Drop views so that alter tables statements complete

* Update settings.php

* Add extension for call_screen_enabled

* Gateway handle boolean
Add the boolean toggle
- distinct_to
- caller_id_in_from
- supress_cng
- extension_in_contact
- contact_in_ping

* Update gateways.php

* Update voicemail_edit.php

* Replace the ${caller_id_name} with the extensions caller id name

* Phrase - Edit: Update slide toggle with new select beneath.

* Update the input toggle style

* Set the input_toggle_style_switch as boolean

* Update the input toggle style

* Theme: Adjust CSS to wrap description text on form fields.

* Add domain_uuid and domain_name to the SQL SELECT

* Unset the parameters to fix the next query

* Gateway: Integrate new slide toggle switch.

* Dashboard: Update the input toggle style (#7499)

* Dashboard: Update the input toggle style

* Update dashboard_widget_edit.php

* Update dashboard_edit.php

* Inbound Route - Add: Integrate new slide toggle switch and boolean.

* User Settings: Integrate new slide toggle switch.

* Call Block Edit: Update the input toggle style (#7500)

* Bridge Edit: Update the input toggle style (#7501)

* Update phrases.php

* Update domain_edit.php

* Domain Settings Edit: Update the input toggle style

* User Edit: Update the input toggle style

* Update install.php

* Remove fields marked as deprecated

* Use boolean in the select statement

* Streams: New slide toggle and boolean.

* Streams: Remove unnecessary default.

* Queues (FIFO): New slide toggle.

* Call Detail Records: Update the input toggle style (#7503)

* Call Detail Records: Update the input toggle style

* Update xml_cdr_extension_summary.php

* Update xml_cdr_extension_summary.php

* Update xml_cdr_extension_summary.php

* Call Centers: Update the input toggle style (#7502)

* Call Centers: Update the input toggle style

* Update call_center_agent_edit.php

* Conference Centers: Update the input toggle style (#7506)

* Conference Centers: Update the input toggle style

* Update app_config.php

* Update conference_center_edit.php

* Use boolean data type (#7505)

* Call Flow Edit: Update the input toggle style (#7504)

* Devices: Update the input toggle style

* IVR Menus: New slide toggle.

* IVR Menu: Remove deprected file.

* SIP Profile - Edit: New slide toggle.

* Device Profiles: Update the input toggle style

* Ring Groups - List: Fix syntax.

* Theme: Fire onchange event when switching slide toggle control.

* Device Vendors: Update the input toggle style

* Update enabled boolean

* Update device_edit.php

* Ring Groups: New slide toggle.

* Update domain_edit.php

* Email Templates: Update the input toggle style

* Header: Correct default value on input toggle style.

* Default/Domain/User Settings: Adjust Select option label for better clarity.

* Use true boolean types for switch theme toggle or drop-down box (#7507)

* Groups: Update the input toggle style

* Conference Controls: Update the input toggle style (#7509)

* Conference Controls: Update the input toggle style

* Update conference_control_edit.php

* Update conference_control_details.php

* Update conference_control_detail_edit.php

* Conferences: Update the input toggle style (#7511)

* Use true boolean types for switch theme toggle or drop-down box (#7513)

* Dialplans: Update the input toggle style
Also updated outbound route add

* Ring Group: Only adjust ring group forward destination top margin when slide toggle enabled.

* Default/Domain/User Settings - List: Adjust for new 'Select Box' label on input_toggle_style value.

* Use true boolean types for switch theme toggle or drop-down box (#7514)

* Call Forward / Follow Me: Minor javascript adjustments to mirror previous behavior.

* Ring Groups [Dashboard]: New slide toggle.

* Get the contacts details with a seperate SQL Query

* Remove debug info

* Destinations: Update the input toggle style

* Conference Profiles: Update the input toggle style (#7515)

* Conference Profiles: Update the input toggle style

* Update conference_profiles.php

* Update conference_profile_params.php

* Update conference_profile_param_edit.php

* Update conference_profile_edit.php

* Extensions: Update the input toggle style

* Contacts: Update the input toggle style (#7517)

* Contacts: Update the input toggle style

* Update contact_address_edit.php

* Update contact_attachment_edit.php

* Update contact_edit.php

* Update contact_email_edit.php

* Update contact_phone_edit.php

* Update contact_relation_edit.php

* Update contact_setting_edit.php

* Update contact_url_edit.php

* Update contacts.php

* Voicemails: New slide toggle.

* Voicemail Greeting: New slide toggle.

* Modules: New slide toggle.

* Recordings: New slide toggle

* Variables: New slide toggle.

* Time Conditions: New slide toggle.

* Extensions - List: Remove invalid column name.

* Extension Settings: New slide toggle.

* Number Translations: New slide toggle and boolean.

* Sofia global settings: Update the input toggle style

* Update alter table convert to boolean

* Fix contact relation search (#7518)

* Sip Profile Edit: Fix setting enabled labels (#7519)

* Sip Profile Edit: Fix setting enabled labels

* Update sip_profile_edit.php

* Update dialplan_edit.php (#7520)

* Update SQL queries to use true/false for contact primary settings (#7521)

* Update SQL queries to use true/false for contact primary settings

* Update contacts_vcard.php

* Update email.php

* Update totp.php

* Update contact_url_edit.php

* Update contact_email_edit.php

* Update contact_address_edit.php

* Update contact_attachment_edit.php

* Update contact_phone_edit.php

* Add a database views method

* Add database view groups

* Add database users view

* Add database call_recordings view

* Update users.php

* Add  database view call block

* Update schema to use the database views method

* Update conference.conf.lua boolean

* Update directory.lua boolean

* Update callcenter.conf.lua agent_status boolean

* Update sofia.conf.lua boolean

* Update number translations lua boolean

* Update directory.lua boolean

* Update group_call.lua fix the cache

* Update reverse-auth-lookup.lua boolean

* Update directory.lua boolean

* Use concat instead of ||

* Update index.lua

---------

Co-authored-by: fusionate <nate@fusionpbx.com>
Co-authored-by: Alex <alex@fusionpbx.com>
Co-authored-by: frytimo <tim@fusionpbx.com>
2025-09-20 18:42:05 -06:00
frytimo
a629504e39 remove unused variables in function call (#7398) 2025-06-26 23:11:33 -06:00
FusionPBX
487bf99086 Update schema.php
- Update db_table_exists
- Update db_column_exists
2025-06-26 09:46:32 -06:00
frytimo
08001488f4 Allow namespace in auto loader (#7307)
* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove closing tag

* remove invalid method params

* remove closing tag

* remove closing tag

* Update auto_loader to load each class file in the project
Update the auto_loader class to use an include statement on each file in the project to load the class within the file. This will allow mismatched names within the file to be loaded and mapped according to the declaration instead of the filename. The class is then checked against the parsed classes from the PHP engine so that namespaces are available and mapped to the file they were declared in. An update was also made to the search algorithm used to find a file that was not already loaded by collapsing the array to have only valid matches to increase performance on a cache miss. Logging within the auto_loader has been moved to a function.
Multiple files were modified to allow the include statement. When the class has the `if(class_exists())` statement, the auto_loader is called to check for the class. This caused an infinite loop scenario so all wrappers have been removed. The auto_loader will now break the loop by directly modifying the internal classes array instead of trying to restart with the 'reload_classes' method.

- APCu is used to cache classes so any loading of the classes is done only once. To clear the APCu cache, restart php-fpm or call the auto_loader::clear_cache() function.
- Cache file is used when APCu is not available. To clear the cache remove it from the tmp folder or call the auto_loader::clear_cache() function.
- All classes must no longer have a class_exists wrapper to benefit from the performance boost.
- Classes should not be directly included when the auto_loader is used.

* remove include statement of class file

* Update destinations.php
2025-03-12 13:55:47 -06:00
frytimo
d6f9b25283 format schema class (#7145)
- format schema class using autoformat
2025-01-28 17:05:00 -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
1b5d66e85e Refresh each subscription publication 2024-02-17 08:34:47 -07:00
frytimo
10e7b485e7 Schema change object property db instead of database->db (#6833) 2023-12-16 07:54:20 -07:00
FusionPBX
968706dac2 Using this->apps more consistently
A previous commit moved from $apps to $this->apps but missed some required uses of the $apps array.
2023-11-08 14:18:24 -07:00
FusionPBX
2ed2ac63ae Add table exists and set row exists 2023-11-03 23:55:35 -06:00
frytimo
372db3cc50 Patch contacts calling multiple schemas (#6826)
* improve performance for contacts app_defaults

* add app_name and app_uuid as constants in class

* performance boost by removing scanning app_defaults twice

* Update app_defaults.php

* Update schema.php

---------

Co-authored-by: FusionPBX <markjcrane@gmail.com>
2023-11-03 14:04:07 -06:00
FusionPBX
e3cfa0d1da Prevent more PHP 8.1 warnings 2023-07-10 18:33:18 -06:00
markjcrane
c92872ab8f Use require instead of require_once on require.php 2023-06-17 09:11:32 -06:00
markjcrane
32051873be Use __dir__ to find resources/require.php 2023-06-16 22:49:09 -06:00
FusionPBX
5755ae3f48 Update schema.php for PHP 8.1 2023-05-13 17:31:27 -06:00
FusionPBX
a2bb8e5f90 Limit subquery to one result
This prevent a cardinality error.
2023-05-12 16:22:50 -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
5e23824940 contacts app_defaults breaks PDO db (#6585) 2023-03-24 09:18:23 -06:00
FusionPBX
0a47fc22b3 Get the DOCUMENT_ROOT and PROJECT_PATH 2022-10-11 17:10:39 -06:00
markjcrane
d50bcb476a Replace root.php 2022-10-10 16:35:14 -06:00
fusionate
96ac8c8334 Upgrade > Schema: Update schema class to use casting for numeric changes. 2020-11-25 15:11:45 -07:00
FusionPBX
64434862b8 Update schema.php
Prevent a plugin from breaking parts of the project.
2020-11-04 10:00:31 -07:00
FusionPBX
69541f560b Update schema.php
Deprecate global upgrade_data_types variable and replace with a $this->data_types
2020-10-21 14:28:15 -06:00
FusionPBX
9f7ca538a3 Update schema.php
Minor changes. Remove extra line feeds and add a semi-colon.
2020-10-21 11:32:46 -06:00
FusionPBX
1d2956cbfb Update schema.php 2020-07-05 14:37:08 -06:00
Nate
f186d1ee9f Schema Class: Fix Data Type check to work properly. 2019-12-02 14:51:02 -07:00
FusionPBX
19e8305a8e Update schema.php 2019-09-10 17:50:41 -06:00
FusionPBX
25a4220c4f Update schema.php 2019-07-27 16:53:42 -06:00
FusionPBX
a80547d1d9 Update schema.php 2019-07-27 16:34:20 -06:00
FusionPBX
75909d85b6 Update schema.php 2019-07-27 09:12:38 -06:00
FusionPBX
ed92a99130 Revert "[4.5] Fix the ALTER TABLE (#4097)"
This reverts commit 8822528227.
2019-05-30 00:56:51 -06:00
Luis Daniel Lucio Quiroz
d39190913d [4.5] Fix the ALTER TABLE (#4097)
* Fix the ALTER TABLE

when $apps[$x]['db'][$y]['fields'][$z]['name'] is an array, you dont try to get the ['text'] index therefore fields such as v_xml_cdr.xml_uuid, v_destinations.destination_type and v_destinations.destination_number wont be created when upgrading.

This patch fixes it

* Update schema.php
2019-05-08 14:02:20 -06:00
Nate
b31b82bd66 Schema Class: Update compatibility with timestamptz field types. 2019-04-02 09:53:57 -06:00
FusionPBX
f1e5fa4848 Update schema.php 2019-02-12 08:47:44 -07:00
FusionPBX
3dbc6e9936 Update schema.php 2018-02-23 10:11:34 -07:00
FusionPBX
2d68fa9118 Update schema.php 2017-02-16 00:03:33 -07:00
FusionPBX
212cd7d025 Update schema.php 2017-01-05 03:58:01 -07:00
FusionPBX
c43c1a556f Update schema.php
Prevent php warnings.
2017-01-05 03:53:02 -07:00
FusionPBX
e2ae375abd Update schema.php 2016-12-18 16:48:24 -07:00
markjcrane
c3b12c217d Cleanup the indentation ... tabs and whitespace after the last pull request. 2016-04-28 16:56:44 -06:00
Harry G. Coin
42a78d8d5e Fix to cure uninitialized variable warnings whenever schema is called.
Also many minor warning bug fixes in schema.php
Might as well take the plunge and go to default show warnings.
Uninitialized variable and small bug fixes install fusionpbx
2016-04-25 21:09:14 -05:00
markjcrane
4b55af24f7 Add class_exists 2016-04-14 23:23:14 -06:00
markjcrane
c2ecb23413 Add a contructor to the dialplan class. 2016-04-14 22:34:10 -06:00
markjcrane
45c391ab76 Update domains and schema classes. 2016-04-14 22:10:47 -06:00
markjcrane
d34d709e37 Schema use $this->$db instead of $db. 2016-04-14 21:51:11 -06:00
markjcrane
1691c3e5f0 Use the new config class in the domains and schema classes. 2015-11-27 19:59:50 -07:00
Nate Jones
996e89c396 Removal of colon next to form label names. 2015-02-15 06:50:00 +00:00
Nate Jones
2448ab3a8e Use the new multi-lingual code on misc files. 2015-01-18 10:33:34 +00:00