From 863de97270ae156daf7b59d724070f6726ec6ae5 Mon Sep 17 00:00:00 2001 From: frytimo Date: Thu, 27 Feb 2025 22:47:27 -0400 Subject: [PATCH 01/73] Update grandstream template loop (#7281) --- resources/templates/provision/grandstream/grp2612/{$mac}.xml | 2 +- resources/templates/provision/grandstream/grp2612w/{$mac}.xml | 2 +- resources/templates/provision/grandstream/grp2613/{$mac}.xml | 2 +- resources/templates/provision/grandstream/grp2614/{$mac}.xml | 2 +- resources/templates/provision/grandstream/grp2615/{$mac}.xml | 2 +- resources/templates/provision/grandstream/grp2616/{$mac}.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/templates/provision/grandstream/grp2612/{$mac}.xml b/resources/templates/provision/grandstream/grp2612/{$mac}.xml index d6d6634ac2..ba1ea01ede 100644 --- a/resources/templates/provision/grandstream/grp2612/{$mac}.xml +++ b/resources/templates/provision/grandstream/grp2612/{$mac}.xml @@ -4565,7 +4565,7 @@ - + {$row.device_key_value} {/foreach} diff --git a/resources/templates/provision/grandstream/grp2612w/{$mac}.xml b/resources/templates/provision/grandstream/grp2612w/{$mac}.xml index 423013911b..7a6765af35 100644 --- a/resources/templates/provision/grandstream/grp2612w/{$mac}.xml +++ b/resources/templates/provision/grandstream/grp2612w/{$mac}.xml @@ -4560,7 +4560,7 @@ - + {$row.device_key_value} {/foreach} diff --git a/resources/templates/provision/grandstream/grp2613/{$mac}.xml b/resources/templates/provision/grandstream/grp2613/{$mac}.xml index 8fe7f212a0..ab148d963c 100644 --- a/resources/templates/provision/grandstream/grp2613/{$mac}.xml +++ b/resources/templates/provision/grandstream/grp2613/{$mac}.xml @@ -4566,7 +4566,7 @@ - + {$row.device_key_value} {/foreach} diff --git a/resources/templates/provision/grandstream/grp2614/{$mac}.xml b/resources/templates/provision/grandstream/grp2614/{$mac}.xml index d6d6634ac2..ba1ea01ede 100644 --- a/resources/templates/provision/grandstream/grp2614/{$mac}.xml +++ b/resources/templates/provision/grandstream/grp2614/{$mac}.xml @@ -4565,7 +4565,7 @@ - + {$row.device_key_value} {/foreach} diff --git a/resources/templates/provision/grandstream/grp2615/{$mac}.xml b/resources/templates/provision/grandstream/grp2615/{$mac}.xml index 01b07777d0..5311dec42e 100644 --- a/resources/templates/provision/grandstream/grp2615/{$mac}.xml +++ b/resources/templates/provision/grandstream/grp2615/{$mac}.xml @@ -4558,7 +4558,7 @@ - + {$row.device_key_value} {/foreach} diff --git a/resources/templates/provision/grandstream/grp2616/{$mac}.xml b/resources/templates/provision/grandstream/grp2616/{$mac}.xml index d6d6634ac2..ba1ea01ede 100644 --- a/resources/templates/provision/grandstream/grp2616/{$mac}.xml +++ b/resources/templates/provision/grandstream/grp2616/{$mac}.xml @@ -4565,7 +4565,7 @@ - + {$row.device_key_value} {/foreach} From f8e1e815460bc58c502e76cd6ae79f658a92ef22 Mon Sep 17 00:00:00 2001 From: frytimo Date: Fri, 28 Feb 2025 00:09:31 -0400 Subject: [PATCH 02/73] fix wrong logical check (#7282) Forgot to remove the '!' (not) operator from the cache check when re-organizing the update cache function --- resources/classes/auto_loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/classes/auto_loader.php b/resources/classes/auto_loader.php index 63042eb2d7..1b5ed65549 100644 --- a/resources/classes/auto_loader.php +++ b/resources/classes/auto_loader.php @@ -55,7 +55,7 @@ class auto_loader { public function update_cache(string $file = ''): bool { //guard against writing an empty file - if (!empty($this->classes)) { + if (empty($this->classes)) { return false; } From c1296f26e0840c4321605082378e9d793899c09c Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Thu, 27 Feb 2025 23:16:42 -0700 Subject: [PATCH 03/73] Update users.php --- core/users/users.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/users/users.php b/core/users/users.php index 7f0890e625..fa6e34b052 100644 --- a/core/users/users.php +++ b/core/users/users.php @@ -52,7 +52,7 @@ $users = $_POST['users'] ?? ''; } -S//process the http post data by action +//process the http post data by action if (!empty($action) && is_array($users) && @sizeof($users) != 0) { switch ($action) { case 'copy': @@ -321,4 +321,4 @@ S//process the http post data by action //include the footer require_once "resources/footer.php"; -?> \ No newline at end of file +?> From 3de202b987d243b133455b1b278db8352706ff67 Mon Sep 17 00:00:00 2001 From: fusionate Date: Fri, 28 Feb 2025 09:36:42 -0700 Subject: [PATCH 04/73] Contact - Attachment: Store image files in same format as uploaded. --- core/contacts/contact_attachment_edit.php | 46 ++++++++++++++--------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/core/contacts/contact_attachment_edit.php b/core/contacts/contact_attachment_edit.php index 23642505a0..62b05e1d08 100644 --- a/core/contacts/contact_attachment_edit.php +++ b/core/contacts/contact_attachment_edit.php @@ -70,15 +70,15 @@ //get the attachment type if (empty($attachment) || sizeof($attachment) == 0) { - $attachment_type = strtolower(pathinfo($_POST['attachment_filename'], PATHINFO_EXTENSION)); + $attachment_extension = strtolower(pathinfo($_POST['attachment_filename'], PATHINFO_EXTENSION)); } else { - $attachment_type = strtolower(pathinfo($attachment['name'], PATHINFO_EXTENSION)); + $attachment_extension = strtolower(pathinfo($attachment['name'], PATHINFO_EXTENSION)); } //unflag others as primary $allowed_primary_attachment = false; - if ($attachment_primary && ($attachment_type == 'jpg' || $attachment_type == 'jpeg' || $attachment_type == 'gif' || $attachment_type == 'png')) { + if ($attachment_primary && ($attachment_extension == 'jpg' || $attachment_extension == 'jpeg' || $attachment_extension == 'gif' || $attachment_extension == 'png')) { $sql = "update v_contact_attachments set attachment_primary = 0 "; $sql .= "where domain_uuid = :domain_uuid "; $sql .= "and contact_uuid = :contact_uuid "; @@ -94,29 +94,41 @@ //get the allowed extensions $allowed_extensions = array_keys(json_decode($_SESSION['contact']['allowed_attachment_types']['text'], true)); - //get the attachment extension - $attachment_extension = strtolower(pathinfo($attachment['name'], PATHINFO_EXTENSION)); - //check the allowed extensions if ($attachment['error'] == '0' && in_array($attachment_extension, $allowed_extensions)) { //get the attachment content $attachment_content = file_get_contents($attachment['tmp_name']); - //list of image extensions - $image_extensions = array('png','jpg','jpeg','gif','bmp', 'webp'); - //read the image from the string then output the image without meta data - if (in_array($attachment_extension, $image_extensions)) { + if (in_array($attachment_extension, ['png','jpg','jpeg','gif','bmp', 'webp'])) { //create the image object from the content string $image = imagecreatefromstring($attachment_content); - imagealphablending($image, FALSE); - imagesavealpha($image, TRUE); //start output buffering to capture the image data ob_start(); //output the image without the EXIF data - imagepng($image); + switch ($attachment_extension) { + case 'png': + imagealphablending($image, FALSE); + imagesavealpha($image, TRUE); + imagepng($image); + break; + case 'jpg': + case 'jpeg': + imagejpeg($image); + break; + case 'gif': + imagesavealpha($image, TRUE); + imagegif($image); + break; + case 'bmp': + imagebmp($image); + break; + case 'webp': + imagewebp($image); + break; + } //get the image from the buffer $attachment_content = ob_get_contents(); @@ -215,11 +227,11 @@ echo " ".$text['label-attachment']."\n"; echo "\n"; echo "\n"; - $attachment_type = strtolower(pathinfo($attachment_filename ?? '', PATHINFO_EXTENSION)); + $attachment_extension = strtolower(pathinfo($attachment_filename ?? '', PATHINFO_EXTENSION)); if ($action == 'update') { echo "\n"; - if ($attachment_type == 'jpg' || $attachment_type == 'jpeg' || $attachment_type == 'gif' || $attachment_type == 'png') { - echo ""; + if ($attachment_extension == 'jpg' || $attachment_extension == 'jpeg' || $attachment_extension == 'gif' || $attachment_extension == 'png') { + echo ""; } else { echo "".$attachment_filename.""; @@ -233,7 +245,7 @@ echo "\n"; echo "\n"; - if ($action == 'update' && ($attachment_type == 'jpg' || $attachment_type == 'jpeg' || $attachment_type == 'gif' || $attachment_type == 'png')) { + if ($action == 'update' && ($attachment_extension == 'jpg' || $attachment_extension == 'jpeg' || $attachment_extension == 'gif' || $attachment_extension == 'png')) { echo "\n"; echo "\n"; echo " ".$text['label-attachment_filename']."\n"; From f6df4fd0b3c4d85bde70189bd408e7a34009f0a9 Mon Sep 17 00:00:00 2001 From: fusionate Date: Fri, 28 Feb 2025 11:03:05 -0700 Subject: [PATCH 05/73] Contacts - List: Only retrieve a single Primary attachment, in the chance that multiple exist. --- core/contacts/contacts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/contacts/contacts.php b/core/contacts/contacts.php index abdbdbfe2f..5e5722524b 100644 --- a/core/contacts/contacts.php +++ b/core/contacts/contacts.php @@ -245,7 +245,7 @@ //get the list $sql = "select *, "; - $sql .= "(select a.contact_attachment_uuid from v_contact_attachments as a where a.contact_uuid = c.contact_uuid and a.attachment_primary = 1) as contact_attachment_uuid "; + $sql .= "(select a.contact_attachment_uuid from v_contact_attachments as a where a.contact_uuid = c.contact_uuid and a.attachment_primary = 1 limit 1) as contact_attachment_uuid "; $sql .= "from v_contacts as c "; $sql .= "where true "; if ($show != "all" || !permission_exists('contact_all')) { From 06e69bf5df8150d0bcc46427f4abe4ea72562420 Mon Sep 17 00:00:00 2001 From: fusionate Date: Fri, 28 Feb 2025 14:36:41 -0700 Subject: [PATCH 06/73] Contact - Attachments: Prevent access without authentication. --- core/contacts/contact_attachment.php | 1 + 1 file changed, 1 insertion(+) diff --git a/core/contacts/contact_attachment.php b/core/contacts/contact_attachment.php index 11b7bac938..f07714ca1e 100644 --- a/core/contacts/contact_attachment.php +++ b/core/contacts/contact_attachment.php @@ -26,6 +26,7 @@ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; + require_once "resources/check_auth.php"; //add multi-lingual support $language = new text; From b4de6f5e4b94f5cca8b9a1a43925c3d2a3ad4470 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 28 Feb 2025 17:09:35 -0700 Subject: [PATCH 07/73] Use status voicemail Moved voicemail status after missed calls. This way, it will show the status of voicemail when it goes to voicemail. There is still a field in the CDR for missed_call and this will still be set to true. --- app/xml_cdr/resources/classes/xml_cdr.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index 9cf18165ce..8d9f14e136 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -612,12 +612,6 @@ if (!class_exists('xml_cdr')) { if ($xml->variables->hangup_cause == 'NO_ANSWER') { $status = 'no_answer'; } - if (substr($destination_number, 0, 3) == '*99') { - $status = 'voicemail'; - } - if (isset($xml->variables->voicemail_message_seconds) && $xml->variables->voicemail_message_seconds > 0) { - $status = 'voicemail'; - } if ($xml->variables->hangup_cause == 'ORIGINATOR_CANCEL') { $status = 'cancelled'; } @@ -633,12 +627,18 @@ if (!class_exists('xml_cdr')) { if ($xml->variables->cc_side == 'agent' && $xml->variables->billsec == 0) { $status = 'no_answer'; } - if (!isset($status) && $xml->variables->billsec == 0) { + if (!isset($status) && $xml->variables->billsec == 0) { $status = 'no_answer'; } if ($missed_call == 'true') { $status = 'missed'; } + if (substr($destination_number, 0, 3) == '*99') { + $status = 'voicemail'; + } + if (!empty($xml->variables->voicemail_message_seconds)) { + $status = 'voicemail'; + } //set the key $key = 'xml_cdr'; From e4ddb4561e1d3d7be46d9e92958042b2fbc6d78e Mon Sep 17 00:00:00 2001 From: chansizzle <14916599+chansizzle@users.noreply.github.com> Date: Fri, 28 Feb 2025 17:22:22 -0700 Subject: [PATCH 08/73] fix email category mispelling (#7280) --- app/switch/resources/scripts/app/emergency/index.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/switch/resources/scripts/app/emergency/index.lua b/app/switch/resources/scripts/app/emergency/index.lua index f4bffd0936..009e72c2f0 100644 --- a/app/switch/resources/scripts/app/emergency/index.lua +++ b/app/switch/resources/scripts/app/emergency/index.lua @@ -94,7 +94,7 @@ local sql = "SELECT * FROM v_email_templates "; sql = sql .. "WHERE template_category = :category "; sql = sql .. "AND template_subcategory = :subcategory "; sql = sql .. "AND template_enabled = :status "; - local params = {category = 'plugins', subcategory = 'emergency', status = 'true'} + local params = {category = 'plugin', subcategory = 'emergency', status = 'true'} dbh:query(sql, params, function(row) subject = row.template_subject; body = row.template_body; From de516ed210cde73aed08e36c43a2396340b0198c Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 1 Mar 2025 20:59:48 -0700 Subject: [PATCH 09/73] Minor version update 5.4.2 --- core/software/resources/classes/software.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/software/resources/classes/software.php b/core/software/resources/classes/software.php index 7fe0436ccd..7a84332caf 100644 --- a/core/software/resources/classes/software.php +++ b/core/software/resources/classes/software.php @@ -12,7 +12,7 @@ if (!class_exists('software')) { * version */ public static function version() { - return '5.4.1'; + return '5.4.2'; } /** From 06c20ef292841cb5db8c4bf93ad4cde245c7a914 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 1 Mar 2025 22:25:06 -0700 Subject: [PATCH 10/73] Fix contact notes with line feeds. When saving contact notes, it would add extra line feeds. The escaping caused this issue. --- core/contacts/contact_edit.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/contacts/contact_edit.php b/core/contacts/contact_edit.php index e95f3c1393..5e8e288bee 100644 --- a/core/contacts/contact_edit.php +++ b/core/contacts/contact_edit.php @@ -2719,8 +2719,9 @@ if (permission_exists('contact_note_view')) { $x = 0; foreach($contact_notes as $row) { $contact_note = $row['contact_note']; - $contact_note = escape($contact_note); - $contact_note = str_replace("\n","
",$contact_note); + if (!empty($contact_note)) { + $contact_note = htmlspecialcars($contact_note, ENT_QUOTES, 'UTF-8'); + } if (permission_exists('contact_note_add')) { $list_row_url = "contact_note_edit.php?contact_uuid=".escape($row['contact_uuid'])."&id=".escape($row['contact_note_uuid']); } From 48e44814de5300a5fc034d5241f5cc630cff2ed7 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 2 Mar 2025 10:38:34 -0700 Subject: [PATCH 11/73] Update email_send.php --- app/email_queue/resources/jobs/email_send.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/email_queue/resources/jobs/email_send.php b/app/email_queue/resources/jobs/email_send.php index bdfa84c3d1..82a0180358 100755 --- a/app/email_queue/resources/jobs/email_send.php +++ b/app/email_queue/resources/jobs/email_send.php @@ -298,7 +298,7 @@ //echo "Body: ".$email_body."\n"; //update the message transcription - if (isset($voicemail_transcription_enabled) && $voicemail_transcription_enabled == 'true' && isset($transcribe_message)) { + if (isset($voicemail_transcription_enabled) && $voicemail_transcription_enabled && isset($transcribe_message)) { $sql = "update v_voicemail_messages "; $sql .= "set message_transcription = :message_transcription "; $sql .= "where voicemail_message_uuid = :voicemail_message_uuid; "; From a15488a708eebce27a0471e2e65ccc46e7c1bb19 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 2 Mar 2025 10:45:31 -0700 Subject: [PATCH 12/73] Update the condition for validate certificate for a boolean value --- resources/classes/email.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/resources/classes/email.php b/resources/classes/email.php index 81cf026dd3..dc419897b0 100644 --- a/resources/classes/email.php +++ b/resources/classes/email.php @@ -445,7 +445,7 @@ if (!class_exists('email')) { $smtp['password'] = $this->settings->get('email','smtp_password'); $smtp['from'] = $this->settings->get('voicemail','smtp_from') ?? $this->settings->get('email','smtp_from'); $smtp['from_name'] = $this->settings->get('voicemail','smtp_from_name') ?? $this->settings->get('email','smtp_from_name'); - $smtp['validate_certificate'] = $this->settings->get('email','smtp_validate_certificate'); + $smtp['validate_certificate'] = $this->settings->get('email','smtp_validate_certificate', true); $smtp['crypto_method'] = $this->settings->get('email','smtp_crypto_method') ?? null; //override the domain-specific smtp server settings, if any @@ -506,7 +506,7 @@ if (!class_exists('email')) { $mail->SMTPSecure = $smtp['secure']; } - if ($smtp_secure && isset($smtp['validate_certificate']) && $smtp['validate_certificate'] == "false") { + if ($smtp_secure && isset($smtp['validate_certificate']) && !$smtp['validate_certificate']) { //bypass certificate check e.g. for self-signed certificates $smtp_options['ssl']['verify_peer'] = false; $smtp_options['ssl']['verify_peer_name'] = false; @@ -638,5 +638,3 @@ $email->attachments = $email_attachments; $response = $mail->error; $sent = $email->send(); */ - -?> From 7d62cc1e639e3ec668b2046c3b51916ffa9b11f6 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 3 Mar 2025 12:29:56 -0700 Subject: [PATCH 13/73] Fix the server 2 address and sip transport --- .../provision/grandstream/gxp2130/{$mac}.xml | 2 ++ .../provision/grandstream/gxp2135/{$mac}.xml | 6 ++++++ .../provision/grandstream/gxp2140/{$mac}.xml | 15 ++++++++++----- .../provision/grandstream/gxp2160/{$mac}.xml | 15 ++++++++++----- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/resources/templates/provision/grandstream/gxp2130/{$mac}.xml b/resources/templates/provision/grandstream/gxp2130/{$mac}.xml index 9162c1b7e3..4de008c7a4 100644 --- a/resources/templates/provision/grandstream/gxp2130/{$mac}.xml +++ b/resources/templates/provision/grandstream/gxp2130/{$mac}.xml @@ -180,6 +180,7 @@ + {if $row.sip_transport == ''}1{/if} {if $row.sip_transport == 'udp'}0{/if} {if $row.sip_transport == 'tcp'}1{/if} @@ -913,6 +914,7 @@ {if $grandstream_lan_port_vlan == '0'}No{else}Yes{/if} + diff --git a/resources/templates/provision/grandstream/gxp2135/{$mac}.xml b/resources/templates/provision/grandstream/gxp2135/{$mac}.xml index c17ee0a6e9..3038d56bbb 100644 --- a/resources/templates/provision/grandstream/gxp2135/{$mac}.xml +++ b/resources/templates/provision/grandstream/gxp2135/{$mac}.xml @@ -38,7 +38,11 @@ {$row.server_address}:{$row.sip_port} {/if} + {if isset($row.server_address_secondary)} {$row.server_address_secondary}:{$row.sip_port} + {else} + + {/if} {if $row.sip_transport != 'dns srv' && isset($row.outbound_proxy_primary)} @@ -176,6 +180,7 @@ + {if $row.sip_transport == ''}1{/if} {if $row.sip_transport == 'udp'}0{/if} {if $row.sip_transport == 'tcp'}1{/if} @@ -909,6 +914,7 @@ {if $grandstream_lan_port_vlan == '0'}No{else}Yes{/if} + diff --git a/resources/templates/provision/grandstream/gxp2140/{$mac}.xml b/resources/templates/provision/grandstream/gxp2140/{$mac}.xml index bb5a7f2856..ca8998d462 100644 --- a/resources/templates/provision/grandstream/gxp2140/{$mac}.xml +++ b/resources/templates/provision/grandstream/gxp2140/{$mac}.xml @@ -38,7 +38,11 @@ {$row.server_address}:{$row.sip_port} {/if} + {if isset($row.server_address_secondary)} {$row.server_address_secondary}:{$row.sip_port} + {else} + + {/if} {if $row.sip_transport != 'dns srv' && isset($row.outbound_proxy_primary)} @@ -176,10 +180,11 @@ - {if $row.sip_transport == ''}TCP{/if} - {if $row.sip_transport == 'udp'}UDP{/if} - {if $row.sip_transport == 'tcp'}TCP{/if} - {if $row.sip_transport == 'tls'}Tls{/if} + + {if $row.sip_transport == ''}1{/if} + {if $row.sip_transport == 'udp'}0{/if} + {if $row.sip_transport == 'tcp'}1{/if} + {if $row.sip_transport == 'tls'}2{/if} @@ -3318,4 +3323,4 @@ {/foreach} - \ No newline at end of file + diff --git a/resources/templates/provision/grandstream/gxp2160/{$mac}.xml b/resources/templates/provision/grandstream/gxp2160/{$mac}.xml index 5bfc894586..6ece8ae8f7 100644 --- a/resources/templates/provision/grandstream/gxp2160/{$mac}.xml +++ b/resources/templates/provision/grandstream/gxp2160/{$mac}.xml @@ -38,7 +38,11 @@ {$row.server_address}:{$row.sip_port} {/if} + {if isset($row.server_address_secondary)} {$row.server_address_secondary}:{$row.sip_port} + {else} + + {/if} {if $row.sip_transport != 'dns srv' && isset($row.outbound_proxy_primary)} @@ -176,10 +180,11 @@ - {if $row.sip_transport == ''}TCP{/if} - {if $row.sip_transport == 'udp'}UDP{/if} - {if $row.sip_transport == 'tcp'}TCP{/if} - {if $row.sip_transport == 'tls'}Tls{/if} + + {if $row.sip_transport == ''}1{/if} + {if $row.sip_transport == 'udp'}0{/if} + {if $row.sip_transport == 'tcp'}1{/if} + {if $row.sip_transport == 'tls'}2{/if} @@ -3318,4 +3323,4 @@ {/foreach} - \ No newline at end of file + From 7b3b3aa5f906e905975de785a9d87474fa8fab1a Mon Sep 17 00:00:00 2001 From: fusionate Date: Mon, 3 Mar 2025 14:08:05 -0700 Subject: [PATCH 14/73] Menu: New option to set icon colors. --- core/menu/app_config.php | 4 ++++ core/menu/app_languages.php | 27 +++++++++++++++++++++++++++ core/menu/menu_item_edit.php | 12 +++++++++++- core/menu/menu_item_list.php | 8 +++++--- resources/classes/menu.php | 15 +++++++++------ resources/fontawesome/fa_icons.php | 2 +- themes/default/css.php | 1 - 7 files changed, 57 insertions(+), 12 deletions(-) diff --git a/core/menu/app_config.php b/core/menu/app_config.php index df80515875..bf46c8ab0c 100644 --- a/core/menu/app_config.php +++ b/core/menu/app_config.php @@ -184,6 +184,10 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "menu_item_icon_color"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "menu_item_category"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['search'] = "true"; diff --git a/core/menu/app_languages.php b/core/menu/app_languages.php index 723f57d730..35cd87c29e 100644 --- a/core/menu/app_languages.php +++ b/core/menu/app_languages.php @@ -540,6 +540,33 @@ $text['label-icon']['zh-cn'] = "图标"; $text['label-icon']['ja-jp'] = "アイコン"; $text['label-icon']['ko-kr'] = "아이콘"; +$text['label-icon_color']['en-us'] = "Icon Color"; +$text['label-icon_color']['en-gb'] = "Icon Color"; +$text['label-icon_color']['ar-eg'] = "لون الأيقونة"; +$text['label-icon_color']['de-at'] = "Symbolfarbe"; +$text['label-icon_color']['de-ch'] = "Symbolfarbe"; +$text['label-icon_color']['de-de'] = "Symbolfarbe"; +$text['label-icon_color']['el-gr'] = "Χρώμα εικονιδίου"; +$text['label-icon_color']['es-cl'] = "Color del icono"; +$text['label-icon_color']['es-mx'] = "Color del icono"; +$text['label-icon_color']['fr-ca'] = "Couleur de l'icône"; +$text['label-icon_color']['fr-fr'] = "Couleur de l'icône"; +$text['label-icon_color']['he-il'] = "צבע סמל"; +$text['label-icon_color']['it-it'] = "Colore dell'icona"; +$text['label-icon_color']['ka-ge'] = "ხატულა ფერი"; +$text['label-icon_color']['nl-nl'] = "Icoon Kleur"; +$text['label-icon_color']['pl-pl'] = "Kolor ikony"; +$text['label-icon_color']['pt-br'] = "Cor do ícone"; +$text['label-icon_color']['pt-pt'] = "Cor do ícone"; +$text['label-icon_color']['ro-ro'] = "Culoarea pictogramei"; +$text['label-icon_color']['ru-ru'] = "Цвет значка"; +$text['label-icon_color']['sv-se'] = "Ikon färg"; +$text['label-icon_color']['uk-ua'] = "Колір значка"; +$text['label-icon_color']['tr-tr'] = "Simge Rengi"; +$text['label-icon_color']['zh-cn'] = "图标颜色"; +$text['label-icon_color']['ja-jp'] = "アイコンの色"; +$text['label-icon_color']['ko-kr'] = "아이콘 색상"; + $text['label-groups']['en-us'] = "Groups"; $text['label-groups']['en-gb'] = "Groups"; $text['label-groups']['ar-eg'] = "المجموعات"; diff --git a/core/menu/menu_item_edit.php b/core/menu/menu_item_edit.php index dba0d09a89..a5e24a849e 100644 --- a/core/menu/menu_item_edit.php +++ b/core/menu/menu_item_edit.php @@ -51,6 +51,7 @@ $menu_item_link = ''; $menu_item_category = ''; $menu_item_icon = ''; + $menu_item_icon_color = ''; $menu_item_description = ''; $menu_item_protected = ''; $menu_item_parent_uuid = null; @@ -102,6 +103,7 @@ $menu_item_link = $_POST["menu_item_link"] ?? ''; $menu_item_category = $_POST["menu_item_category"] ?? ''; $menu_item_icon = $_POST["menu_item_icon"] ?? ''; + $menu_item_icon_color = $_POST["menu_item_icon_color"] ?? ''; $menu_item_description = $_POST["menu_item_description"] ?? ''; $menu_item_protected = $_POST["menu_item_protected"] ?? ''; $menu_item_parent_uuid = $_POST["menu_item_parent_uuid"] ?? null; @@ -173,6 +175,7 @@ $array['menu_items'][0]['menu_item_link'] = $menu_item_link; $array['menu_items'][0]['menu_item_category'] = $menu_item_category; $array['menu_items'][0]['menu_item_icon'] = $menu_item_icon; + $array['menu_items'][0]['menu_item_icon_color'] = $menu_item_icon_color; $array['menu_items'][0]['menu_item_description'] = $menu_item_description; $array['menu_items'][0]['menu_item_protected'] = $menu_item_protected; $array['menu_items'][0]['menu_item_uuid'] = $menu_item_uuid; @@ -198,6 +201,7 @@ $array['menu_items'][0]['menu_item_link'] = $menu_item_link; $array['menu_items'][0]['menu_item_category'] = $menu_item_category; $array['menu_items'][0]['menu_item_icon'] = $menu_item_icon; + $array['menu_items'][0]['menu_item_icon_color'] = $menu_item_icon_color; $array['menu_items'][0]['menu_item_description'] = $menu_item_description; $array['menu_items'][0]['menu_item_protected'] = $menu_item_protected; $array['menu_items'][0]['menu_item_uuid'] = $menu_item_uuid; @@ -313,6 +317,7 @@ $menu_item_link = $row["menu_item_link"]; $menu_item_category = $row["menu_item_category"]; $menu_item_icon = $row["menu_item_icon"]; + $menu_item_icon_color = $row["menu_item_icon_color"]; $menu_item_description = $row["menu_item_description"]; $menu_item_protected = $row["menu_item_protected"]; $menu_item_parent_uuid = $row["menu_item_parent_uuid"]; @@ -430,7 +435,7 @@ echo "\n"; echo " \n"; echo " "; echo " "; + echo " "; + echo " "; + echo " "; + echo " "; + echo " "; echo " "; echo " \n"; - if (permission_exists('bridge_edit') && !empty($list_row_edit_button) && $list_row_edit_button == 'true') { + if (permission_exists('bridge_edit') && $list_row_edit_button) { echo " \n"; } echo "\n"; @@ -270,7 +270,7 @@ } echo " \n"; echo " \n"; - if (permission_exists('bridge_edit') && !empty($list_row_edit_button) && $list_row_edit_button == 'true') { + if (permission_exists('bridge_edit') && $list_row_edit_button) { echo " \n"; diff --git a/app/call_block/call_block.php b/app/call_block/call_block.php index 6ed672bc6d..3d6ae3c27e 100644 --- a/app/call_block/call_block.php +++ b/app/call_block/call_block.php @@ -46,7 +46,7 @@ $show = $_GET["show"] ?? ''; //set from session variables - $list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false'; + $list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL); //get posted data if (!empty($_POST['call_blocks'])) { @@ -301,7 +301,7 @@ echo th_order_by('call_block_enabled', $text['label-enabled'], $order_by, $order, null, "class='center'"); echo th_order_by('insert_date', $text['label-date-added'], $order_by, $order, null, "class='shrink no-wrap'"); echo "\n"; - if (permission_exists('call_block_edit') && $list_row_edit_button == 'true') { + if (permission_exists('call_block_edit') && $list_row_edit_button) { echo " \n"; } echo "\n"; @@ -385,7 +385,7 @@ echo " \n"; echo " \n"; echo " \n"; - if (permission_exists('call_block_edit') && $list_row_edit_button == 'true') { + if (permission_exists('call_block_edit') && $list_row_edit_button) { echo " \n"; diff --git a/app/call_broadcast/call_broadcast.php b/app/call_broadcast/call_broadcast.php index 6e6cd20c00..aac61a9d67 100644 --- a/app/call_broadcast/call_broadcast.php +++ b/app/call_broadcast/call_broadcast.php @@ -47,7 +47,7 @@ $show = $_GET["show"] ?? ''; //set from session variables - $list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false'; + $list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL); //get posted data if (!empty($_POST['call_broadcasts'])) { @@ -219,7 +219,7 @@ echo th_order_by('broadcast_concurrent_limit', $text['label-concurrent-limit'], $order_by, $order); echo th_order_by('broadcast_start_time', $text['label-start_time'], $order_by, $order); echo th_order_by('broadcast_description', $text['label-description'], $order_by, $order); - if (permission_exists('call_broadcast_edit') && $list_row_edit_button == 'true') { + if (permission_exists('call_broadcast_edit') && $list_row_edit_button) { echo " \n"; } echo "\n"; @@ -266,7 +266,7 @@ } echo " \n"; echo " \n"; - if (permission_exists('call_broadcast_edit') && $list_row_edit_button == 'true') { + if (permission_exists('call_broadcast_edit') && $list_row_edit_button) { echo " \n"; diff --git a/app/call_centers/call_center_agents.php b/app/call_centers/call_center_agents.php index 9d76bf34bb..634b1468ac 100644 --- a/app/call_centers/call_center_agents.php +++ b/app/call_centers/call_center_agents.php @@ -43,7 +43,7 @@ $text = $language->get(); //set from session variables - $list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false'; + $list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL); //get posted data if (!empty($_POST['call_center_agents'])) { @@ -206,7 +206,7 @@ //echo th_order_by('agent_wrap_up_time', $text['label-wrap_up_time'], $order_by, $order); //echo th_order_by('agent_reject_delay_time', $text['label-reject_delay_time'], $order_by, $order); //echo th_order_by('agent_busy_delay_time', $text['label-busy_delay_time'], $order_by, $order); - if (permission_exists('call_center_agent_edit') && $list_row_edit_button == 'true') { + if (permission_exists('call_center_agent_edit') && $list_row_edit_button) { echo " \n"; } echo "\n"; @@ -270,7 +270,7 @@ //echo " \n"; //echo " \n"; //echo " \n"; - if (permission_exists('call_center_agent_edit') && $list_row_edit_button == 'true') { + if (permission_exists('call_center_agent_edit') && $list_row_edit_button) { echo " \n"; diff --git a/app/call_centers/call_center_queues.php b/app/call_centers/call_center_queues.php index 52ef61e629..50b9e93ee3 100644 --- a/app/call_centers/call_center_queues.php +++ b/app/call_centers/call_center_queues.php @@ -46,7 +46,7 @@ $show = $_GET["show"] ?? ''; //set from session variables - $list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false'; + $list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL); //get posted data if (!empty($_POST['call_center_queues']) && is_array($_POST['call_center_queues'])) { @@ -219,7 +219,7 @@ //echo th_order_by('queue_abandoned_resume_allowed', $text['label-abandoned_resume_allowed'], $order_by, $order); //echo th_order_by('queue_tier_rule_wait_multiply_level', $text['label-tier_rule_wait_multiply_level'], $order_by, $order); echo th_order_by('queue_description', $text['label-description'], $order_by, $order, null, "class='hide-sm-dn'"); - if (permission_exists('call_center_queue_edit') && $list_row_edit_button == 'true') { + if (permission_exists('call_center_queue_edit') && $list_row_edit_button) { echo " \n"; } echo "\n"; @@ -273,7 +273,7 @@ //echo " \n"; //echo " \n"; echo " \n"; - if (permission_exists('call_center_queue_edit') && $list_row_edit_button == 'true') { + if (permission_exists('call_center_queue_edit') && $list_row_edit_button) { echo " \n"; diff --git a/app/call_centers/waveform.php b/app/call_centers/waveform.php index 3408037311..f51a6a97fc 100644 --- a/app/call_centers/waveform.php +++ b/app/call_centers/waveform.php @@ -96,8 +96,8 @@ Waveform::$colorB = !empty($_SESSION['theme']['audio_player_waveform_color_b_leg']['text']) ? color_to_rgba_array($_SESSION['theme']['audio_player_waveform_color_b_leg']['text']) : [0,125,232,0.6]; // array rgba, right (b-leg) wave color Waveform::$backgroundColor = !empty($_SESSION['theme']['audio_player_waveform_color_background']['text']) ? color_to_rgba_array($_SESSION['theme']['audio_player_waveform_color_background']['text']) : [0,0,0,0]; // array rgba, default: transparent Waveform::$axisColor = !empty($_SESSION['theme']['audio_player_waveform_color_axis']['text']) ? color_to_rgba_array($_SESSION['theme']['audio_player_waveform_color_axis']['text']) : [0,0,0,0.3]; // array rgba - Waveform::$singlePhase = empty($_SESSION['theme']['audio_player_waveform_single_phase']['boolean']) || $_SESSION['theme']['audio_player_waveform_single_phase']['boolean'] !== 'true' ? false : true; // positive phase only - left (a-leg) top, right (b-leg) bottom - Waveform::$singleAxis = empty($_SESSION['theme']['audio_player_waveform_single_axis']['boolean']) || $_SESSION['theme']['audio_player_waveform_single_axis']['boolean'] !== 'false' ? true : false; // combine channels into single axis + Waveform::$singlePhase = filter_var($_SESSION['theme']['audio_player_waveform_single_phase']['boolean'] ?? false, FILTER_VALIDATE_BOOL); // positive phase only - left (a-leg) top, right (b-leg) bottom + Waveform::$singleAxis = filter_var($_SESSION['theme']['audio_player_waveform_single_axis']['boolean'] ?? false, FILTER_VALIDATE_BOOL); // combine channels into single axis $height = !empty($_SESSION['theme']['audio_player_waveform_height']['text']) && is_numeric(str_replace('px','',$_SESSION['theme']['audio_player_waveform_height']['text'])) ? 2.2 * (int) str_replace('px','',$_SESSION['theme']['audio_player_waveform_height']['text']) : null; $wf = $waveform->getWaveform($temp_filename, 1600, $height ?? 180); // input: png filename returns boolean true/false, or 'base64' returns base64 string } diff --git a/app/call_flows/call_flows.php b/app/call_flows/call_flows.php index 2cbd2d6a53..85d5182497 100644 --- a/app/call_flows/call_flows.php +++ b/app/call_flows/call_flows.php @@ -46,7 +46,7 @@ $show = $_GET["show"] ?? ''; //set from session variables - $list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false'; + $list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL); //get search $search = $_REQUEST['search'] ?? null; @@ -235,7 +235,7 @@ } echo th_order_by('call_flow_enabled', $text['label-enabled'], $order_by, $order, null, "class='center'"); echo th_order_by('call_flow_description', $text['label-call_flow_description'], $order_by, $order, null, "class='hide-sm-dn'"); - if (permission_exists('call_flow_edit') && $list_row_edit_button == 'true') { + if (permission_exists('call_flow_edit') && $list_row_edit_button) { echo " \n"; } echo "\n"; @@ -291,7 +291,7 @@ echo escape($row['call_flow_enabled']); } echo " \n"; - if (permission_exists('call_flow_edit') && $list_row_edit_button == 'true') { + if (permission_exists('call_flow_edit') && $list_row_edit_button) { echo " \n"; diff --git a/app/call_flows/waveform.php b/app/call_flows/waveform.php index 3408037311..f51a6a97fc 100644 --- a/app/call_flows/waveform.php +++ b/app/call_flows/waveform.php @@ -96,8 +96,8 @@ Waveform::$colorB = !empty($_SESSION['theme']['audio_player_waveform_color_b_leg']['text']) ? color_to_rgba_array($_SESSION['theme']['audio_player_waveform_color_b_leg']['text']) : [0,125,232,0.6]; // array rgba, right (b-leg) wave color Waveform::$backgroundColor = !empty($_SESSION['theme']['audio_player_waveform_color_background']['text']) ? color_to_rgba_array($_SESSION['theme']['audio_player_waveform_color_background']['text']) : [0,0,0,0]; // array rgba, default: transparent Waveform::$axisColor = !empty($_SESSION['theme']['audio_player_waveform_color_axis']['text']) ? color_to_rgba_array($_SESSION['theme']['audio_player_waveform_color_axis']['text']) : [0,0,0,0.3]; // array rgba - Waveform::$singlePhase = empty($_SESSION['theme']['audio_player_waveform_single_phase']['boolean']) || $_SESSION['theme']['audio_player_waveform_single_phase']['boolean'] !== 'true' ? false : true; // positive phase only - left (a-leg) top, right (b-leg) bottom - Waveform::$singleAxis = empty($_SESSION['theme']['audio_player_waveform_single_axis']['boolean']) || $_SESSION['theme']['audio_player_waveform_single_axis']['boolean'] !== 'false' ? true : false; // combine channels into single axis + Waveform::$singlePhase = filter_var($_SESSION['theme']['audio_player_waveform_single_phase']['boolean'] ?? false, FILTER_VALIDATE_BOOL); // positive phase only - left (a-leg) top, right (b-leg) bottom + Waveform::$singleAxis = filter_var($_SESSION['theme']['audio_player_waveform_single_axis']['boolean'] ?? false, FILTER_VALIDATE_BOOL); // combine channels into single axis $height = !empty($_SESSION['theme']['audio_player_waveform_height']['text']) && is_numeric(str_replace('px','',$_SESSION['theme']['audio_player_waveform_height']['text'])) ? 2.2 * (int) str_replace('px','',$_SESSION['theme']['audio_player_waveform_height']['text']) : null; $wf = $waveform->getWaveform($temp_filename, 1600, $height ?? 180); // input: png filename returns boolean true/false, or 'base64' returns base64 string } diff --git a/app/call_forward/call_forward.php b/app/call_forward/call_forward.php index 45c6c2abbd..e7de481ed3 100644 --- a/app/call_forward/call_forward.php +++ b/app/call_forward/call_forward.php @@ -296,8 +296,8 @@ echo " \n"; } echo " \n"; - $list_row_edit_button = $_SESSION['theme']['list_row_edit_button']['boolean'] ?? 'false'; - if ( $list_row_edit_button === 'true') { + $list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL); + if ($list_row_edit_button) { echo " \n"; } echo "\n"; @@ -402,7 +402,7 @@ echo " \n"; } echo " \n"; - if ($list_row_edit_button === 'true') { + if ($list_row_edit_button) { echo " \n"; diff --git a/app/call_forward/call_forward_edit.php b/app/call_forward/call_forward_edit.php index a1b2bc6e72..a6e48e8f7c 100644 --- a/app/call_forward/call_forward_edit.php +++ b/app/call_forward/call_forward_edit.php @@ -341,7 +341,7 @@ */ //send feature event notify to the phone - if (!empty($_SESSION['device']['feature_sync']['boolean']) && $_SESSION['device']['feature_sync']['boolean'] == "true") { + if (filter_var($_SESSION['device']['feature_sync']['boolean'] ?? false, FILTER_VALIDATE_BOOL)) { $ring_count = ceil($call_timeout / 6); $feature_event_notify = new feature_event_notify; $feature_event_notify->domain_name = $_SESSION['domain_name']; @@ -358,7 +358,7 @@ else { $feature_event_notify->forward_all_destination = $forward_all_destination; } - + if ($forward_busy_destination == "") { $feature_event_notify->forward_busy_destination = "0"; } @@ -504,7 +504,7 @@ } //prepare the autocomplete - if(!empty($_SESSION['follow_me']['follow_me_autocomplete']['boolean']) && $_SESSION['follow_me']['follow_me_autocomplete']['boolean'] == 'true') { + if(filter_var($_SESSION['follow_me']['follow_me_autocomplete']['boolean'] ?? false, FILTER_VALIDATE_BOOLEAN)) { echo "\n"; echo "\n"; echo " - \n"; + echo " function get_destinations(id, destination_type, action, search) {\n"; + echo " var xhttp = new XMLHttpRequest();\n"; + echo " xhttp.onreadystatechange = function() {\n"; + echo " if (this.readyState == 4 && this.status == 200) {\n"; + echo " document.getElementById(id).innerHTML = this.responseText;\n"; + echo " }\n"; + echo " };\n"; + echo " if (action) {\n"; + echo " xhttp.open(\"GET\", \"/app/destinations/resources/destinations.php?destination_type=\"+destination_type+\"&action=\"+action, true);\n"; + echo " }\n"; + echo " else {\n"; + echo " xhttp.open(\"GET\", \"/app/destinations/resources/destinations.php?destination_type=\"+destination_type, true);\n"; + echo " }\n"; + echo " xhttp.send();\n"; + echo " }\n"; + echo "\n"; //get the destinations $destinations = $this->get($destination_type); @@ -1308,7 +1302,7 @@ if (!class_exists('destinations')) { } //method } //class -} + /* $obj = new destinations; //$destinations = $obj->destinations; @@ -1319,5 +1313,3 @@ echo $obj->select('ivr', 'example4', ''); echo $obj->select('ivr', 'example5', ''); echo $obj->select('ivr', 'example6', ''); */ - -?> diff --git a/app/dialplans/resources/classes/dialplan.php b/app/dialplans/resources/classes/dialplan.php index 5c5b1cee7b..0147b6b313 100644 --- a/app/dialplans/resources/classes/dialplan.php +++ b/app/dialplans/resources/classes/dialplan.php @@ -25,7 +25,6 @@ */ //define the dialplan class - if (!class_exists('dialplan')) { class dialplan { //variables @@ -1580,6 +1579,3 @@ } //class - } - -?> diff --git a/app/email_queue/resources/classes/email_queue.php b/app/email_queue/resources/classes/email_queue.php index 77bc6542ee..a7efc72c7e 100644 --- a/app/email_queue/resources/classes/email_queue.php +++ b/app/email_queue/resources/classes/email_queue.php @@ -2,12 +2,7 @@ /** * email_queue class - * - * @method null delete - * @method null toggle - * @method null copy */ -if (!class_exists('email_queue')) { class email_queue { /** @@ -225,6 +220,3 @@ if (!class_exists('email_queue')) { } } -} - -?> diff --git a/app/email_queue/resources/jobs/email_queue.php b/app/email_queue/resources/jobs/email_queue.php index 9e1d3952eb..0167e54796 100755 --- a/app/email_queue/resources/jobs/email_queue.php +++ b/app/email_queue/resources/jobs/email_queue.php @@ -11,7 +11,6 @@ //includes files require_once "resources/pdo.php"; - include "resources/classes/permissions.php"; require $_SERVER['DOCUMENT_ROOT']."/app/email_queue/resources/functions/transcribe.php"; //increase limits diff --git a/app/email_queue/resources/jobs/email_send.php b/app/email_queue/resources/jobs/email_send.php index 82a0180358..a0b3f8d213 100755 --- a/app/email_queue/resources/jobs/email_send.php +++ b/app/email_queue/resources/jobs/email_send.php @@ -10,7 +10,6 @@ } //include files - include "resources/classes/permissions.php"; include_once "resources/phpmailer/class.phpmailer.php"; include_once "resources/phpmailer/class.smtp.php"; diff --git a/app/email_queue/resources/service/email_queue.php b/app/email_queue/resources/service/email_queue.php index f12a023502..684dbc7b8e 100644 --- a/app/email_queue/resources/service/email_queue.php +++ b/app/email_queue/resources/service/email_queue.php @@ -9,9 +9,6 @@ exit; } -//include files - include "resources/classes/permissions.php"; - //increase limits set_time_limit(0); ini_set('max_execution_time', 0); diff --git a/app/event_guard/resources/classes/event_guard.php b/app/event_guard/resources/classes/event_guard.php index 02bafd1bc2..69ff9aefcf 100644 --- a/app/event_guard/resources/classes/event_guard.php +++ b/app/event_guard/resources/classes/event_guard.php @@ -26,12 +26,7 @@ /** * event_guard_logs class - * - * @method null delete - * @method null toggle - * @method null copy */ -if (!class_exists('event_guard')) { class event_guard { /** @@ -303,6 +298,3 @@ if (!class_exists('event_guard')) { } } -} - -?> diff --git a/app/extension_settings/resources/classes/extension_settings.php b/app/extension_settings/resources/classes/extension_settings.php index b473669e9d..15c5b2cc01 100644 --- a/app/extension_settings/resources/classes/extension_settings.php +++ b/app/extension_settings/resources/classes/extension_settings.php @@ -26,12 +26,7 @@ /** * extension_settings class - * - * @method null delete - * @method null toggle - * @method null copy */ -if (!class_exists('extension_settings')) { class extension_settings { /** @@ -272,6 +267,3 @@ if (!class_exists('extension_settings')) { } } -} - -?> diff --git a/app/extensions/extension_copy.php b/app/extensions/extension_copy.php index 9148d21b6b..0aeca685a4 100644 --- a/app/extensions/extension_copy.php +++ b/app/extensions/extension_copy.php @@ -186,7 +186,6 @@ //synchronize configuration if (is_writable($_SESSION['switch']['extensions']['dir'])) { - require_once "app/extensions/resources/classes/extension.php"; $ext = new extension; $ext->xml(); unset($ext); diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index 0bddf373df..f99c45b1b6 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -850,7 +850,6 @@ //synchronize configuration if (is_writable($switch_extensions)) { - require_once "app/extensions/resources/classes/extension.php"; $ext = new extension; $ext->xml(); unset($ext); @@ -2037,7 +2036,6 @@ echo " ".$text['label-hold_music']."\n"; echo "\n"; echo "\n"; echo "\n"; @@ -1104,7 +1099,7 @@ if (!defined('STDIN')) { for ($f = 1; $f <= 3; $f++) { echo " 1) ? "style='display: none;'" : null).">"; echo " "; - echo button::create(['type'=>'button','label'=>$text['button-clear'],'icon'=>$setting->get('theme','button_icon_reset'),'onclick'=>"reset_file_input('fax_files_".$f."'); document.getElementById('file_list_".$f."').innerHTML='';"]); + echo button::create(['type'=>'button','label'=>$text['button-clear'],'icon'=>$settings->get('theme','button_icon_reset'),'onclick'=>"reset_file_input('fax_files_".$f."'); document.getElementById('file_list_".$f."').innerHTML='';"]); echo "
"; echo " "; echo "
\n"; @@ -1119,9 +1114,9 @@ if (!defined('STDIN')) { echo "\n"; echo "\n"; echo "\n"; if (permission_exists('fax_subject')) { - $cover_subject_required = $setting->get('fax','cover_subject_required') ?? ''; + $cover_subject_required = $settings->get('fax','cover_subject_required') ?? ''; $class = ($cover_subject_required == 'true') ? 'vncellreq' : 'vncell'; $required = ($cover_subject_required == 'true') ? 'required' : ''; echo "\n"; @@ -1160,7 +1155,7 @@ if (!defined('STDIN')) { } if (permission_exists('fax_message')) { - $cover_message_required = $setting->get('fax','cover_message_required') ?? ''; + $cover_message_required = $settings->get('fax','cover_message_required') ?? ''; $class = ($cover_message_required == 'true') ? 'vncellreq' : 'vncell'; $required = ($cover_message_required == 'true') ? 'required' : ''; echo "\n"; @@ -1168,7 +1163,7 @@ if (!defined('STDIN')) { echo " ".$text['label-fax-message']."\n"; echo "\n"; echo "\n"; @@ -1181,7 +1176,7 @@ if (!defined('STDIN')) { echo " ".$text['label-fax-footer']."\n"; echo "\n"; echo "\n"; @@ -1228,4 +1223,4 @@ function showgrid($pdf) { } } */ -?> \ No newline at end of file +?> From b0a630e80a8ed1e5fc79be49c8c5cd5ed3e07a02 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Thu, 13 Mar 2025 11:25:15 -0600 Subject: [PATCH 68/73] Use no-wrap class --- app/xml_cdr/xml_cdr.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/xml_cdr/xml_cdr.php b/app/xml_cdr/xml_cdr.php index 75da41fbfa..3d0c019940 100644 --- a/app/xml_cdr/xml_cdr.php +++ b/app/xml_cdr/xml_cdr.php @@ -695,7 +695,7 @@ $col_count++; } if ($permission['xml_cdr_caller_destination']) { - echo "\n"; + echo "\n"; $col_count++; } if ($permission['xml_cdr_destination']) { @@ -913,7 +913,7 @@ } //extension if ($permission['xml_cdr_extension']) { - $content .= " \n"; + $content .= " \n"; } //domain name if ($permission['xml_cdr_all'] && $_REQUEST['show'] == "all") { From e6bfaf21ee349a743b66bef88d2bce1e9d24a062 Mon Sep 17 00:00:00 2001 From: chansizzle <14916599+chansizzle@users.noreply.github.com> Date: Thu, 13 Mar 2025 11:30:42 -0600 Subject: [PATCH 69/73] Remove escaping character typo (#7311) escaping character not needed on the template_subject --- core/email_templates/app_defaults.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/email_templates/app_defaults.php b/core/email_templates/app_defaults.php index f3280dd25d..47f422f0ee 100644 --- a/core/email_templates/app_defaults.php +++ b/core/email_templates/app_defaults.php @@ -510,7 +510,7 @@ $array['email_templates'][$x]['template_language'] = 'en-gb'; $array['email_templates'][$x]['template_category'] = 'plugin'; $array['email_templates'][$x]['template_subcategory'] = 'emergency'; - $array['email_templates'][$x]['template_subject'] = '\${event}'; + $array['email_templates'][$x]['template_subject'] = '${event}'; $array['email_templates'][$x]['template_body'] = "\n"; $array['email_templates'][$x]['template_body'] .= "\n"; $array['email_templates'][$x]['template_body'] .= "From: \${caller_id_name} \${caller_id_number}
\n"; @@ -530,7 +530,7 @@ $array['email_templates'][$x]['template_language'] = 'en-us'; $array['email_templates'][$x]['template_category'] = 'plugin'; $array['email_templates'][$x]['template_subcategory'] = 'emergency'; - $array['email_templates'][$x]['template_subject'] = '\${event}'; + $array['email_templates'][$x]['template_subject'] = '${event}'; $array['email_templates'][$x]['template_body'] = "\n"; $array['email_templates'][$x]['template_body'] .= "\n"; $array['email_templates'][$x]['template_body'] .= "From: \${caller_id_name} \${caller_id_number}
\n"; From 17b938698e289a8478dd90dc780391e296a010f5 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Thu, 13 Mar 2025 13:08:36 -0600 Subject: [PATCH 70/73] Start with the require.php --- app/fax/fax_send.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/app/fax/fax_send.php b/app/fax/fax_send.php index a3918a49d5..6a1996df08 100644 --- a/app/fax/fax_send.php +++ b/app/fax/fax_send.php @@ -28,22 +28,25 @@ Corey Moullas */ +//includes files + require_once dirname(__DIR__, 2) . "/resources/require.php"; + //check if windows if (stristr(PHP_OS, 'WIN')) { $IS_WINDOWS = true; } else { $IS_WINDOWS = false; } -//executed via command line -if (defined('STDIN')) { +//command line + if (defined('STDIN')) { - //add multi-lingual support - $language = new text; - $text = $language->get($settings->get('domain','language','en-us'), 'app/fax'); + //add multi-lingual support + $language = new text; + $text = $language->get($settings->get('domain','language','en-us'), 'app/fax'); -} -//executed via browser -else { + } - //includes files - require_once dirname(__DIR__, 2) . "/resources/require.php"; +//web server + if (!defined('STDIN')) { + + //additional include require_once "resources/check_auth.php"; //set the domain_uuid and domain_name From 77d2b3099a6a6a9dc111789ad13dbb3ad2a1d258 Mon Sep 17 00:00:00 2001 From: frytimo Date: Thu, 13 Mar 2025 17:32:51 -0300 Subject: [PATCH 71/73] Create get methods for domain_uuid and user_uuid (#7144) * create get methods for domain_uuid and user_uuid --- resources/classes/settings.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/resources/classes/settings.php b/resources/classes/settings.php index 77eec854a0..f0105c68a9 100644 --- a/resources/classes/settings.php +++ b/resources/classes/settings.php @@ -160,6 +160,28 @@ class settings { } } + /** + * Returns the domain_uuid in this object used to load the settings + * @return string UUID of the domain used to load the object or an empty string + */ + public function get_domain_uuid(): string { + if (!empty($this->domain_uuid)) { + return $this->domain_uuid; + } + return ""; + } + + /** + * Returns the user_uuid in this object used to load the settings + * @return string UUID of the user used to load the object or an empty string + */ + public function get_user_uuid(): string { + if (!empty($this->user_uuid)) { + return $this->user_uuid; + } + return ""; + } + /** * set the default, domain, user, device or device profile settings * @param string $table_prefix prefix for the table. From 5dffd4d6e09a53445f89f2adf6f5be8d796d592f Mon Sep 17 00:00:00 2001 From: Alex <40072887+alexdcrane@users.noreply.github.com> Date: Thu, 13 Mar 2025 13:49:30 -0700 Subject: [PATCH 72/73] Add CDR column_overflow default setting (#7314) * Add cdr column_overflow default setting * Update app_config.php * Update xml_cdr.php * Update default_setting_edit.php * Update template.php * Update app_languages.php * Update css.php --- app/xml_cdr/app_config.php | 8 +++ app/xml_cdr/xml_cdr.php | 18 +++++- core/default_settings/app_languages.php | 55 ++++++++++++++++++- .../default_settings/default_setting_edit.php | 10 +++- themes/default/css.php | 2 +- themes/default/template.php | 2 +- 6 files changed, 89 insertions(+), 6 deletions(-) diff --git a/app/xml_cdr/app_config.php b/app/xml_cdr/app_config.php index c01ea17d31..7d0753c8d4 100644 --- a/app/xml_cdr/app_config.php +++ b/app/xml_cdr/app_config.php @@ -413,6 +413,14 @@ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Limit allowed range of addresses for CDR over HTTP POST."; $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "4750feaf-70d0-4425-af37-036060ce7d37"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "cdr"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "column_overflow"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "hidden"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Hide overflowing columns or use horizontal scroll bar"; + $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "7b9a5a95-a964-4fa1-b1b6-7641ca478405"; $apps[$x]['default_settings'][$y]['default_setting_category'] = "cdr"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "summary_style"; diff --git a/app/xml_cdr/xml_cdr.php b/app/xml_cdr/xml_cdr.php index 3d0c019940..e886af0094 100644 --- a/app/xml_cdr/xml_cdr.php +++ b/app/xml_cdr/xml_cdr.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2024 + Portions created by the Initial Developer are Copyright (C) 2008-2025 the Initial Developer. All Rights Reserved. Contributor(s): @@ -658,6 +658,22 @@ $param = substr($param, 1); //remove leading '&' $param = substr($param, 0, strrpos($param, '&order_by=')); //remove trailing order by +//column overflow setting + echo "\n"; + //show the results echo "
\n"; echo "\n"; diff --git a/core/default_settings/app_languages.php b/core/default_settings/app_languages.php index 129f90f951..405a9938c5 100644 --- a/core/default_settings/app_languages.php +++ b/core/default_settings/app_languages.php @@ -1514,4 +1514,57 @@ $text['label-custom']['zh-cn'] = "风俗"; $text['label-custom']['ja-jp'] = "カスタム"; $text['label-custom']['ko-kr'] = "관습"; -?> \ No newline at end of file +$text['label-hidden']['en-us'] = "Hidden"; +$text['label-hidden']['en-gb'] = "Hidden"; +$text['label-hidden']['ar-eg'] = "مخفي"; +$text['label-hidden']['de-at'] = "Versteckt"; +$text['label-hidden']['de-ch'] = "Versteckt"; +$text['label-hidden']['de-de'] = "Versteckt"; +$text['label-hidden']['el-gr'] = "Κρυφό"; +$text['label-hidden']['es-cl'] = "Oculto"; +$text['label-hidden']['es-mx'] = "Oculto"; +$text['label-hidden']['fr-ca'] = "Caché"; +$text['label-hidden']['fr-fr'] = "Caché"; +$text['label-hidden']['he-il'] = "הסתר"; +$text['label-hidden']['it-it'] = "Nascosto"; +$text['label-hidden']['ka-ge'] = "დამალული"; +$text['label-hidden']['nl-nl'] = "Verborgen"; +$text['label-hidden']['pl-pl'] = "Ukryty"; +$text['label-hidden']['pt-br'] = "Oculto"; +$text['label-hidden']['pt-pt'] = "Oculto"; +$text['label-hidden']['ro-ro'] = "Ascuns"; +$text['label-hidden']['ru-ru'] = "Скрыто"; +$text['label-hidden']['sv-se'] = "Dold"; +$text['label-hidden']['uk-ua'] = "Сховано"; +$text['label-hidden']['zh-cn'] = "隐藏"; +$text['label-hidden']['ja-jp'] = "隠し"; +$text['label-hidden']['ko-kr'] = "숨겨짐"; + +$text['label-scroll']['en-us'] = "Scroll"; +$text['label-scroll']['en-gb'] = "Scroll"; +$text['label-scroll']['ar-eg'] = "تمرير"; +$text['label-scroll']['de-at'] = "Scrollen"; +$text['label-scroll']['de-ch'] = "Scrollen"; +$text['label-scroll']['de-de'] = "Scrollen"; +$text['label-scroll']['el-gr'] = "Κύλιση"; +$text['label-scroll']['es-cl'] = "Desplazar"; +$text['label-scroll']['es-mx'] = "Desplazar"; +$text['label-scroll']['fr-ca'] = "Faire défiler"; +$text['label-scroll']['fr-fr'] = "Faire défiler"; +$text['label-scroll']['he-il'] = "גלול"; +$text['label-scroll']['it-it'] = "Scorrere"; +$text['label-scroll']['ka-ge'] = "გადატანა"; +$text['label-scroll']['nl-nl'] = "Scrollen"; +$text['label-scroll']['pl-pl'] = "Przewiń"; +$text['label-scroll']['pt-br'] = "Deslocar"; +$text['label-scroll']['pt-pt'] = "Deslocar"; +$text['label-scroll']['ro-ro'] = "Derulați"; +$text['label-scroll']['ru-ru'] = "Прокрутить"; +$text['label-scroll']['sv-se'] = "Rulla"; +$text['label-scroll']['uk-ua'] = "Прокрутити"; +$text['label-scroll']['zh-cn'] = "滚动"; +$text['label-scroll']['ja-jp'] = "スクロール"; +$text['label-scroll']['ko-kr'] = "스크롤"; + + +?> diff --git a/core/default_settings/default_setting_edit.php b/core/default_settings/default_setting_edit.php index cb2b3e718a..0a7f540f1a 100644 --- a/core/default_settings/default_setting_edit.php +++ b/core/default_settings/default_setting_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2023 + Portions created by the Initial Developer are Copyright (C) 2008-2025 the Initial Developer. All Rights Reserved. Contributor(s): @@ -67,7 +67,7 @@ if (!empty($_REQUEST['search'])) { $search = $_REQUEST['search']; } - + //get http post variables and set them to php variables if (!empty($_REQUEST)) { $default_setting_category = strtolower($_REQUEST["default_setting_category"] ?? ''); @@ -720,6 +720,12 @@ echo " \n"; echo " \n"; } + elseif ($category == "cdr" && $subcategory == "column_overflow" && $name == "text" ) { + echo " \n"; + } elseif (is_json($default_setting_value)) { echo " \n"; } diff --git a/themes/default/css.php b/themes/default/css.php index 5a49932170..eda404db3a 100644 --- a/themes/default/css.php +++ b/themes/default/css.php @@ -2906,7 +2906,6 @@ else { //default: white div.card { margin-bottom: 15px; - overflow-x: auto; - + {*//link to custom css file *} {if !empty($settings.theme.custom_css)} From 7639f0755c792c1aa18d77f0c715ddd70b406c89 Mon Sep 17 00:00:00 2001 From: Alex <40072887+alexdcrane@users.noreply.github.com> Date: Thu, 13 Mar 2025 13:58:15 -0700 Subject: [PATCH 73/73] Update xml_cdr.php (#7315) * Update xml_cdr.php * Update css.php * Update template.php --- app/xml_cdr/xml_cdr.php | 4 ++-- themes/default/css.php | 2 +- themes/default/template.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/xml_cdr/xml_cdr.php b/app/xml_cdr/xml_cdr.php index e886af0094..2c749db521 100644 --- a/app/xml_cdr/xml_cdr.php +++ b/app/xml_cdr/xml_cdr.php @@ -664,11 +664,11 @@ echo ".hide-sm-dn, .hide-md-dn, .hide-lg-dn {\n"; echo " all: revert;\n"; echo "}\n"; - echo ".list {\n"; + echo "div.card {\n"; echo " overflow-x: scroll;\n"; echo "}\n"; } else { - echo ".list {\n"; + echo "div.card {\n"; echo " overflow-x: hidden;\n"; echo "}\n"; } diff --git a/themes/default/css.php b/themes/default/css.php index eda404db3a..5a49932170 100644 --- a/themes/default/css.php +++ b/themes/default/css.php @@ -2906,6 +2906,7 @@ else { //default: white div.card { margin-bottom: 15px; + overflow-x: auto; - + {*//link to custom css file *} {if !empty($settings.theme.custom_css)}
\n"; - echo " \n"; echo " \n"; foreach ($font_awesome_icons as $icon) { $selected = $menu_item_icon == implode(' ', $icon['classes']) ? "selected" : null; @@ -470,6 +475,11 @@ echo "
".$text['label-icon_color']."
".$text['label-parent_menu'].""; diff --git a/core/menu/menu_item_list.php b/core/menu/menu_item_list.php index 282fe7e9bf..9da3c1c654 100644 --- a/core/menu/menu_item_list.php +++ b/core/menu/menu_item_list.php @@ -104,6 +104,7 @@ $menu_item_title = $row2['menu_item_title']; $menu_item_link = $row2['menu_item_link']; $menu_item_icon = $row2['menu_item_icon']; + $menu_item_icon_color = $row2['menu_item_icon_color']; //get the groups that have been assigned to the menu $sql = "select "; @@ -149,7 +150,7 @@ } //format icon - $menu_item_icon = !empty($menu_item_icon) ? "" : null; + $menu_item_icon = !empty($menu_item_icon) ? "" : null; //display the content of the list if (permission_exists('menu_item_edit')) { @@ -291,6 +292,7 @@ $menu_item_title = $row['menu_item_title']; $menu_item_link = $row['menu_item_link']; $menu_item_icon = $row['menu_item_icon']; + $menu_item_icon_color = $row['menu_item_icon_color']; $menu_item_protected = $row['menu_item_protected']; //get the groups that have been assigned to the menu @@ -336,7 +338,7 @@ } //format icon - $menu_item_icon = !empty($menu_item_icon) ? "" : null; + $menu_item_icon = !empty($menu_item_icon) ? "" : null; //display the content of the list if (permission_exists('menu_item_edit')) { @@ -437,4 +439,4 @@ echo "\n"; -?> +?> \ No newline at end of file diff --git a/resources/classes/menu.php b/resources/classes/menu.php index 86c8b8983c..9df1c94320 100644 --- a/resources/classes/menu.php +++ b/resources/classes/menu.php @@ -427,6 +427,7 @@ if (!class_exists('menu')) { $menu_item_parent_uuid = $uuid_array[$menu['parent_uuid']] ?? null; $menu_item_category = $menu['category']; $menu_item_icon = $menu['icon'] ?? null; + $menu_item_icon_color = $menu['icon_color'] ?? null; $menu_item_path = $menu['path']; $menu_item_order = $menu['order'] ?? null; $menu_item_description = $menu['desc'] ?? null; @@ -471,6 +472,7 @@ if (!class_exists('menu')) { $array['menu_items'][$x]['menu_item_link'] = $menu_item_path; $array['menu_items'][$x]['menu_item_category'] = $menu_item_category; $array['menu_items'][$x]['menu_item_icon'] = $menu_item_icon; + $array['menu_items'][$x]['menu_item_icon_color'] = $menu_item_icon_color; if (!empty($menu_item_order)) { $array['menu_items'][$x]['menu_item_order'] = $menu_item_order; } @@ -745,7 +747,7 @@ if (!class_exists('menu')) { //get the menu from the database $sql = "select i.menu_item_link, l.menu_item_title as menu_language_title, "; $sql .= "i.menu_item_title, i.menu_item_protected, i.menu_item_category, "; - $sql .= "i.menu_item_icon, i.menu_item_uuid, i.menu_item_parent_uuid "; + $sql .= "i.menu_item_icon, i.menu_item_icon_color, i.menu_item_uuid, i.menu_item_parent_uuid "; $sql .= "from v_menu_items as i, v_menu_languages as l "; $sql .= "where i.menu_item_uuid = l.menu_item_uuid "; $sql .= "and l.menu_language = :menu_language "; @@ -814,7 +816,7 @@ if (!class_exists('menu')) { } //get the child menu from the database - $sql = "select i.menu_item_link, l.menu_item_title as menu_language_title, i.menu_item_title, i.menu_item_protected, i.menu_item_category, i.menu_item_icon, i.menu_item_uuid, i.menu_item_parent_uuid "; + $sql = "select i.menu_item_link, l.menu_item_title as menu_language_title, i.menu_item_title, i.menu_item_protected, i.menu_item_category, i.menu_item_icon, i.menu_item_icon_color, i.menu_item_uuid, i.menu_item_parent_uuid "; $sql .= "from v_menu_items as i, v_menu_languages as l "; $sql .= "where i.menu_item_uuid = l.menu_item_uuid "; $sql .= "and l.menu_language = :menu_language "; @@ -854,6 +856,7 @@ if (!class_exists('menu')) { $menu_item_link = $row['menu_item_link']; $menu_item_category = $row['menu_item_category']; $menu_item_icon = $row['menu_item_icon']; + $menu_item_icon_color = $row['menu_item_icon_color']; $menu_item_uuid = $row['menu_item_uuid']; $menu_item_parent_uuid = $row['menu_item_parent_uuid']; @@ -1010,7 +1013,7 @@ if (!class_exists('menu')) { $mod_a_3 = ($menu_parent['menu_item_category'] == 'external') ? "target='_blank' " : null; if ($this->settings->get('theme', 'menu_main_icons', true) === true) { if (!empty($menu_parent['menu_item_icon']) && substr($menu_parent['menu_item_icon'], 0, 3) == 'fa-') { // font awesome icon - $menu_main_icon = ""; + $menu_main_icon = ""; } else { $menu_main_icon = null; @@ -1043,7 +1046,7 @@ if (!class_exists('menu')) { $menu_sub_icon = null; if ($this->settings->get('theme', 'menu_sub_icons', true) !== false) { if (!empty($menu_sub['menu_item_icon']) && substr($menu_sub['menu_item_icon'], 0, 3) == 'fa-') { // font awesome icon - $menu_sub_icon = ""; + $menu_sub_icon = ""; } else { $menu_sub_icon = null; @@ -1211,7 +1214,7 @@ if (!class_exists('menu')) { $html .= " \n"; } if (!empty($menu_item_main['menu_item_icon']) && substr($menu_item_main['menu_item_icon'], 0, 3) == 'fa-') { // font awesome icon - $html .= ""; + $html .= ""; } $html .= "".$menu_item_main['menu_language_title'].""; $html .= "\n"; @@ -1222,7 +1225,7 @@ if (!class_exists('menu')) { $menu_sub_icon = null; if ($this->settings->get('theme', 'menu_sub_icons', true) !== false) { if (!empty($menu_item_sub['menu_item_icon']) && substr($menu_item_sub['menu_item_icon'], 0, 3) == 'fa-') { // font awesome icon - $menu_sub_icon = ""; + $menu_sub_icon = ""; } else { $menu_sub_icon = null; diff --git a/resources/fontawesome/fa_icons.php b/resources/fontawesome/fa_icons.php index 9b2e128fed..558cea25d0 100644 --- a/resources/fontawesome/fa_icons.php +++ b/resources/fontawesome/fa_icons.php @@ -113,6 +113,6 @@ if ( !empty($font_awesome_icons) && is_array($font_awesome_icons) ) { foreach ($font_awesome_icons as $icon) { - echo "\n"; + echo "\n"; } } \ No newline at end of file diff --git a/themes/default/css.php b/themes/default/css.php index b2d13c6882..746d7a87f4 100644 --- a/themes/default/css.php +++ b/themes/default/css.php @@ -772,7 +772,6 @@ else { //default: white display: inline-block; font-size: 8pt; margin: 0 0 0 8px; - opacity: 0.30; } div.menu_side_sub > a.menu_side_item_sub > span.fas, From 150eeccd5e0a175e55cab6ba1caa09eabb5332ea Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 3 Mar 2025 18:43:29 -0700 Subject: [PATCH 15/73] Add grandstream_transfer_mode_via_vpk --- resources/templates/provision/grandstream/gxp2170/{$mac}.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/templates/provision/grandstream/gxp2170/{$mac}.xml b/resources/templates/provision/grandstream/gxp2170/{$mac}.xml index 282c33c4d4..a7e742435a 100644 --- a/resources/templates/provision/grandstream/gxp2170/{$mac}.xml +++ b/resources/templates/provision/grandstream/gxp2170/{$mac}.xml @@ -2138,7 +2138,11 @@ + {if isset($grandstream_transfer_mode_via_vpk)} + {$grandstream_transfer_mode_via_vpk} + {else} BlindTransfer + {/if} Yes From 6baa6973f36fcc91ea3460030646f33799d195d1 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 3 Mar 2025 18:47:28 -0700 Subject: [PATCH 16/73] Add grandstream_transfer_mode_via_vpk --- resources/templates/provision/grandstream/gxp2160/{$mac}.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/templates/provision/grandstream/gxp2160/{$mac}.xml b/resources/templates/provision/grandstream/gxp2160/{$mac}.xml index 6ece8ae8f7..5241c940a7 100644 --- a/resources/templates/provision/grandstream/gxp2160/{$mac}.xml +++ b/resources/templates/provision/grandstream/gxp2160/{$mac}.xml @@ -2138,7 +2138,11 @@ + {if isset($grandstream_transfer_mode_via_vpk)} + {$grandstream_transfer_mode_via_vpk} + {else} BlindTransfer + {/if} Yes From 9fcfc7276a3fc6c57998196a27f22a2664a029ff Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 3 Mar 2025 18:50:44 -0700 Subject: [PATCH 17/73] Add grandstream_transfer_mode_via_vpk --- resources/templates/provision/grandstream/gxp2140/{$mac}.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/templates/provision/grandstream/gxp2140/{$mac}.xml b/resources/templates/provision/grandstream/gxp2140/{$mac}.xml index ca8998d462..bfea8b4834 100644 --- a/resources/templates/provision/grandstream/gxp2140/{$mac}.xml +++ b/resources/templates/provision/grandstream/gxp2140/{$mac}.xml @@ -2138,7 +2138,11 @@ + {if isset($grandstream_transfer_mode_via_vpk)} + {$grandstream_transfer_mode_via_vpk} + {else} BlindTransfer + {/if} Yes From c47eac110ac28246b1483cade1c65b6ecd8d6ae9 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 3 Mar 2025 18:50:58 -0700 Subject: [PATCH 18/73] Add grandstream_transfer_mode_via_vpk --- resources/templates/provision/grandstream/gxp2135/{$mac}.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/templates/provision/grandstream/gxp2135/{$mac}.xml b/resources/templates/provision/grandstream/gxp2135/{$mac}.xml index 3038d56bbb..e0d1b4748f 100644 --- a/resources/templates/provision/grandstream/gxp2135/{$mac}.xml +++ b/resources/templates/provision/grandstream/gxp2135/{$mac}.xml @@ -2138,7 +2138,11 @@ + {if isset($grandstream_transfer_mode_via_vpk)} {$grandstream_transfer_mode_via_vpk} + {else} + BlindTransfer + {/if} Yes From bb02c97c64a79cca7d866319bc6d1bc683102a81 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 3 Mar 2025 18:51:19 -0700 Subject: [PATCH 19/73] Add grandstream_transfer_mode_via_vpk --- resources/templates/provision/grandstream/gxp2130/{$mac}.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/templates/provision/grandstream/gxp2130/{$mac}.xml b/resources/templates/provision/grandstream/gxp2130/{$mac}.xml index 4de008c7a4..efb75a3402 100644 --- a/resources/templates/provision/grandstream/gxp2130/{$mac}.xml +++ b/resources/templates/provision/grandstream/gxp2130/{$mac}.xml @@ -2138,7 +2138,11 @@ + {if isset($grandstream_transfer_mode_via_vpk)} + {$grandstream_transfer_mode_via_vpk} + {else} BlindTransfer + {/if} Yes From 1b19e40be4a17689024510062a660618e45d6ee8 Mon Sep 17 00:00:00 2001 From: Antonio Fernandez Date: Tue, 4 Mar 2025 12:53:23 -0500 Subject: [PATCH 20/73] Consistent email wording (#7283) --- app/extensions/app_languages.php | 52 ++++++++++++++++---------------- app/voicemails/app_languages.php | 52 ++++++++++++++++---------------- 2 files changed, 52 insertions(+), 52 deletions(-) diff --git a/app/extensions/app_languages.php b/app/extensions/app_languages.php index ee1eee2d55..36b623abf6 100644 --- a/app/extensions/app_languages.php +++ b/app/extensions/app_languages.php @@ -2698,32 +2698,32 @@ $text['description-voicemail_password']['zh-cn'] = "在此处输入数字语音 $text['description-voicemail_password']['ja-jp'] = "ここに数値のボイスメール パスワードを入力します。"; $text['description-voicemail_password']['ko-kr'] = "여기에 숫자 음성사서함 암호를 입력합니다."; -$text['description-voicemail_mail_to']['en-us'] = "Enter the email address to send voicemail to (optional)."; -$text['description-voicemail_mail_to']['en-gb'] = "Enter the email address to send voicemail to (optional)."; -$text['description-voicemail_mail_to']['ar-eg'] = "أدخل العنوان الإلكتروني لإرسال البريد الصوتي إلى (اختياري)."; -$text['description-voicemail_mail_to']['de-at'] = "Geben Sie die Email Adresse an, an die Ihre Mailbox Nachricht gesendet werden soll (optional)."; -$text['description-voicemail_mail_to']['de-ch'] = "Geben Sie die Email Adresse an, an die Ihre Mailbox Nachricht gesendet werden soll (optional)."; -$text['description-voicemail_mail_to']['de-de'] = "Geben Sie die Email Adresse an, an die Ihre Mailbox Nachricht gesendet werden soll (optional)."; -$text['description-voicemail_mail_to']['el-gr'] = "Εισαγάγετε τη διεύθυνση email στην οποία θα στείλετε αυτόματο τηλεφωνητή (προαιρετικό)."; -$text['description-voicemail_mail_to']['es-cl'] = "Ingrese una dirección de correo electrónico para enviar el correo de voz (opcional)."; -$text['description-voicemail_mail_to']['es-mx'] = "Ingrese una dirección de correo electrónico para enviar el correo de voz (opcional)."; -$text['description-voicemail_mail_to']['fr-ca'] = "Insérer le courriel où sera envoyé le message de notification (optionnel)."; -$text['description-voicemail_mail_to']['fr-fr'] = "Insérer le courriel où sera envoyé le message de notification (optionnel)."; -$text['description-voicemail_mail_to']['he-il'] = "היכנס לכתובת הדואר האלקטרוני כדי לשלוח הודעות קוליות (אופציונלי)."; -$text['description-voicemail_mail_to']['it-it'] = "Inserire l'indirizzo email a cui recapitare i messaggi vocali (opzionale)."; -$text['description-voicemail_mail_to']['ka-ge'] = "შეიყვანეთ ელფოსტის მისამართი, რომელზეც ხმოვანი ფოსტა გამოიგზავნება (არასავალდებულო)."; -$text['description-voicemail_mail_to']['nl-nl'] = "Voer het E-mail adres om de voicemail naar te sturen (optioneel)."; -$text['description-voicemail_mail_to']['pl-pl'] = "Dodaj adres email na który będą wysyłane pliki poczty głosowej"; -$text['description-voicemail_mail_to']['pt-br'] = "Insira o endereço de email para enviar o correio de voz (opcional)."; -$text['description-voicemail_mail_to']['pt-pt'] = "Introduza o endereço de email para enviar o correio de voz (opcional)."; -$text['description-voicemail_mail_to']['ro-ro'] = "Introduceți adresa de e-mail la care trimiteți mesajul vocal (opțional)."; -$text['description-voicemail_mail_to']['ru-ru'] = "Введите адрес электронной почты, чтобы отправить голосовую почту (опционально)."; -$text['description-voicemail_mail_to']['sv-se'] = "Ange E-post adressen för röstbrevlådan (valfritt)."; -$text['description-voicemail_mail_to']['uk-ua'] = "Введіть адресу електронної пошти для відправки голосового повідомлення (за бажанням)."; -$text['description-voicemail_mail_to']['tr-tr'] = "Sesli mesajın gönderileceği e-posta adresini girin (isteğe bağlı)."; -$text['description-voicemail_mail_to']['zh-cn'] = "输入要向其发送语音邮件的电子邮件地址(可选)。"; -$text['description-voicemail_mail_to']['ja-jp'] = "ボイスメールの送信先の電子メール アドレスを入力します (オプション)。"; -$text['description-voicemail_mail_to']['ko-kr'] = "음성 메일을 보낼 이메일 주소를 입력합니다(선택 사항)."; +$text['description-voicemail_mail_to']['en-us'] = "Enter the email address to send voicemail to (optional). Multiple addresses may be separated by commas."; +$text['description-voicemail_mail_to']['en-gb'] = "Enter the email address to send voicemail to (optional). Multiple addresses may be separated by commas."; +$text['description-voicemail_mail_to']['ar-eg'] = "أدخل عنوان البريد الإلكتروني لإرسال البريد الصوتي إليه (اختياري). يمكن فصل العناوين المتعددة بفواصل."; +$text['description-voicemail_mail_to']['de-at'] = "Geben Sie die E-Mail-Adresse ein, an die die Voicemail gesendet werden soll (optional). Mehrere Adressen können durch Kommas getrennt werden."; +$text['description-voicemail_mail_to']['de-ch'] = "Geben Sie die E-Mail-Adresse ein, an die die Voicemail gesendet werden soll (optional). Mehrere Adressen können durch Kommas getrennt werden."; +$text['description-voicemail_mail_to']['de-de'] = "Geben Sie die E-Mail-Adresse ein, an die die Voicemail gesendet werden soll (optional). Mehrere Adressen können durch Kommas getrennt werden."; +$text['description-voicemail_mail_to']['el-gr'] = "Εισαγάγετε τη διεύθυνση email για αποστολή του φωνητικού μηνύματος (προαιρετικό). Πολλαπλές διευθύνσεις μπορούν να διαχωριστούν με κόμματα."; +$text['description-voicemail_mail_to']['es-cl'] = "Ingrese la dirección de correo electrónico para enviar el correo de voz (opcional). Se pueden separar múltiples direcciones con comas."; +$text['description-voicemail_mail_to']['es-mx'] = "Ingrese la dirección de correo electrónico para enviar el correo de voz (opcional). Se pueden separar múltiples direcciones con comas."; +$text['description-voicemail_mail_to']['fr-ca'] = "Entrez l'adresse e-mail à laquelle envoyer la messagerie vocale (facultatif). Plusieurs adresses peuvent être séparées par des virgules."; +$text['description-voicemail_mail_to']['fr-fr'] = "Entrez l'adresse e-mail à laquelle envoyer la messagerie vocale (facultatif). Plusieurs adresses peuvent être séparées par des virgules."; +$text['description-voicemail_mail_to']['he-il'] = "הזן את כתובת האימייל לשליחת הדואר הקולי (אופציונלי). ניתן להפריד בין כתובות מרובות באמצעות פסיקים."; +$text['description-voicemail_mail_to']['it-it'] = "Inserisci l'indirizzo email a cui inviare la segreteria telefonica (opzionale). Più indirizzi possono essere separati da virgole."; +$text['description-voicemail_mail_to']['ka-ge'] = "შეიყვანეთ ელ.ფოსტის მისამართი, რომელზეც გაიგზავნება ხმოვანი ფოსტა (არასავალდებულო). შესაძლებელია მრავალი მისამართის მძიმით გამოყოფა."; +$text['description-voicemail_mail_to']['nl-nl'] = "Voer het e-mailadres in om de voicemail naartoe te sturen (optioneel). Meerdere adressen kunnen worden gescheiden door komma's."; +$text['description-voicemail_mail_to']['pl-pl'] = "Wprowadź adres e-mail, na który ma zostać wysłana poczta głosowa (opcjonalnie). Wiele adresów można oddzielić przecinkami."; +$text['description-voicemail_mail_to']['pt-br'] = "Digite o endereço de e-mail para enviar o correio de voz (opcional). Vários endereços podem ser separados por vírgulas."; +$text['description-voicemail_mail_to']['pt-pt'] = "Digite o endereço de e-mail para enviar o correio de voz (opcional). Vários endereços podem ser separados por vírgulas."; +$text['description-voicemail_mail_to']['ro-ro'] = "Introduceți adresa de e-mail la care se va trimite mesageria vocală (opțional). Mai multe adrese pot fi separate prin virgule."; +$text['description-voicemail_mail_to']['ru-ru'] = "Введите адрес электронной почты для отправки голосовой почты (необязательно). Несколько адресов можно разделять запятыми."; +$text['description-voicemail_mail_to']['sv-se'] = "Ange e-postadressen som röstbrevet ska skickas till (valfritt). Flera adresser kan separeras med kommatecken."; +$text['description-voicemail_mail_to']['uk-ua'] = "Введіть адресу електронної пошти для надсилання голосової пошти (необов’язково). Декілька адрес можна розділити комами."; +$text['description-voicemail_mail_to']['tr-tr'] = "Sesli mesajın gönderileceği e-posta adresini girin (isteğe bağlı). Birden fazla adres virgülle ayrılabilir."; +$text['description-voicemail_mail_to']['zh-cn'] = "输入要发送语音邮件的电子邮件地址(可选)。多个地址可用逗号分隔。"; +$text['description-voicemail_mail_to']['ja-jp'] = "ボイスメールを送信するメールアドレスを入力してください(オプション)。複数のアドレスはコンマで区切ることができます。"; +$text['description-voicemail_mail_to']['ko-kr'] = "보이스메일을 보낼 이메일 주소를 입력하세요(선택 사항). 여러 개의 주소는 쉼표로 구분할 수 있습니다."; $text['description-voicemail_local_after_email']['en-us'] = "Choose whether to keep the voicemail in the system after sending the email notification."; $text['description-voicemail_local_after_email']['en-gb'] = "Choose whether to keep the voicemail in the system after sending the email notification."; diff --git a/app/voicemails/app_languages.php b/app/voicemails/app_languages.php index 6c0ec4839a..0b1f9520e6 100644 --- a/app/voicemails/app_languages.php +++ b/app/voicemails/app_languages.php @@ -1755,32 +1755,32 @@ $text['description-voicemail_alternate_greet_id']['zh-cn'] = "默认问候语中 $text['description-voicemail_alternate_greet_id']['ja-jp'] = "デフォルトのグリーティングで使用される代替グリーティング ID。"; $text['description-voicemail_alternate_greet_id']['ko-kr'] = "기본 인사말에 사용되는 대체 인사말 ID입니다."; -$text['description-voicemail_mail_to']['en-us'] = "Enter the email address to send voicemail to. Multiple addresses may be separated by commas."; -$text['description-voicemail_mail_to']['en-gb'] = "Enter the email address to send voicemail to. Multiple addresses may be separated by commas."; -$text['description-voicemail_mail_to']['ar-eg'] = "أدخل عنوان البريد الإلكتروني لإرسال بريد صوتي إليه. يمكن فصل العناوين المتعددة بفاصلات."; -$text['description-voicemail_mail_to']['de-at'] = "Geben Sie die Email Adresse an, an die Ihre Mailbox Nachricht gesendet werden soll (optional)."; -$text['description-voicemail_mail_to']['de-ch'] = "Geben Sie die Email Adresse an, an die Ihre Mailbox Nachricht gesendet werden soll (optional)."; -$text['description-voicemail_mail_to']['de-de'] = "Geben Sie die Email Adresse an, an die Ihre Mailbox Nachricht gesendet werden soll (optional)."; -$text['description-voicemail_mail_to']['el-gr'] = "Εισαγάγετε τη διεύθυνση email στην οποία θα στείλετε αυτόματο τηλεφωνητή. Πολλές διευθύνσεις μπορούν να διαχωριστούν με κόμμα."; -$text['description-voicemail_mail_to']['es-cl'] = "Ingrese las direcciones de correo a quien desee enviar el correo de voz."; -$text['description-voicemail_mail_to']['es-mx'] = "Ingrese las direcciones de correo a quien desee enviar el correo de voz."; -$text['description-voicemail_mail_to']['fr-ca'] = "Saisissez l'adresse e-mail à laquelle envoyer le message vocal. Plusieurs adresses peuvent être séparées par des virgules."; -$text['description-voicemail_mail_to']['fr-fr'] = "Saisissez l'adresse e-mail à laquelle envoyer le message vocal. Plusieurs adresses peuvent être séparées par des virgules."; -$text['description-voicemail_mail_to']['he-il'] = "הזן את כתובת הדואר האלקטרוני שאליה יש לשלוח דואר קולי. כתובות מרובות עשויות להיות מופרדות בפסיקים."; -$text['description-voicemail_mail_to']['it-it'] = "Inserire l'indirizzo email a cui spedire i messaggi vocali."; -$text['description-voicemail_mail_to']['ka-ge'] = "შეიყვანეთ ელფოსტის მისამართი, სადაც ხმოვანი ფოსტა გაიგზავნება. ერთზე მეტი მისამართი მძიმით უნდა გამოჰყოთ."; -$text['description-voicemail_mail_to']['nl-nl'] = "Voer het E-mail adres om de boodschap naar te sturen."; -$text['description-voicemail_mail_to']['pl-pl'] = "Dodaj adres email na który będą wysyłane pliki poczty głosowej"; -$text['description-voicemail_mail_to']['pt-br'] = "Insira o endereço de email para enviar o correio de voz (opcional)"; -$text['description-voicemail_mail_to']['pt-pt'] = "Introduza o endereço de email para enviar o correio de voz."; -$text['description-voicemail_mail_to']['ro-ro'] = "Introduceți adresa de e-mail la care trimiteți mesajul vocal. Adresele multiple pot fi separate prin virgule."; -$text['description-voicemail_mail_to']['ru-ru'] = "Введите адрес электронной почты для отправки голосовой почты."; -$text['description-voicemail_mail_to']['sv-se'] = "Ange E-post adressen dit meddelande skall skickas."; -$text['description-voicemail_mail_to']['uk-ua'] = "Введіть адресу E-Mail на яку надіслати голосове повідомлення"; -$text['description-voicemail_mail_to']['tr-tr'] = "Sesli mesajın gönderileceği e-posta adresini girin. Birden fazla adres virgülle ayrılabilir."; -$text['description-voicemail_mail_to']['zh-cn'] = "输入要向其发送语音邮件的电子邮件地址。 多个地址可以用逗号分隔。"; -$text['description-voicemail_mail_to']['ja-jp'] = "ボイスメールの送信先の電子メール アドレスを入力します。 複数のアドレスはカンマで区切ることができます。"; -$text['description-voicemail_mail_to']['ko-kr'] = "음성 메일을 보낼 이메일 주소를 입력합니다. 여러 주소는 쉼표로 구분할 수 있습니다."; +$text['description-voicemail_mail_to']['en-us'] = "Enter the email address to send voicemail to (optional). Multiple addresses may be separated by commas."; +$text['description-voicemail_mail_to']['en-gb'] = "Enter the email address to send voicemail to (optional). Multiple addresses may be separated by commas."; +$text['description-voicemail_mail_to']['ar-eg'] = "أدخل عنوان البريد الإلكتروني لإرسال البريد الصوتي إليه (اختياري). يمكن فصل العناوين المتعددة بفواصل."; +$text['description-voicemail_mail_to']['de-at'] = "Geben Sie die E-Mail-Adresse ein, an die die Voicemail gesendet werden soll (optional). Mehrere Adressen können durch Kommas getrennt werden."; +$text['description-voicemail_mail_to']['de-ch'] = "Geben Sie die E-Mail-Adresse ein, an die die Voicemail gesendet werden soll (optional). Mehrere Adressen können durch Kommas getrennt werden."; +$text['description-voicemail_mail_to']['de-de'] = "Geben Sie die E-Mail-Adresse ein, an die die Voicemail gesendet werden soll (optional). Mehrere Adressen können durch Kommas getrennt werden."; +$text['description-voicemail_mail_to']['el-gr'] = "Εισαγάγετε τη διεύθυνση email για αποστολή του φωνητικού μηνύματος (προαιρετικό). Πολλαπλές διευθύνσεις μπορούν να διαχωριστούν με κόμματα."; +$text['description-voicemail_mail_to']['es-cl'] = "Ingrese la dirección de correo electrónico para enviar el correo de voz (opcional). Se pueden separar múltiples direcciones con comas."; +$text['description-voicemail_mail_to']['es-mx'] = "Ingrese la dirección de correo electrónico para enviar el correo de voz (opcional). Se pueden separar múltiples direcciones con comas."; +$text['description-voicemail_mail_to']['fr-ca'] = "Entrez l'adresse e-mail à laquelle envoyer la messagerie vocale (facultatif). Plusieurs adresses peuvent être séparées par des virgules."; +$text['description-voicemail_mail_to']['fr-fr'] = "Entrez l'adresse e-mail à laquelle envoyer la messagerie vocale (facultatif). Plusieurs adresses peuvent être séparées par des virgules."; +$text['description-voicemail_mail_to']['he-il'] = "הזן את כתובת האימייל לשליחת הדואר הקולי (אופציונלי). ניתן להפריד בין כתובות מרובות באמצעות פסיקים."; +$text['description-voicemail_mail_to']['it-it'] = "Inserisci l'indirizzo email a cui inviare la segreteria telefonica (opzionale). Più indirizzi possono essere separati da virgole."; +$text['description-voicemail_mail_to']['ka-ge'] = "შეიყვანეთ ელ.ფოსტის მისამართი, რომელზეც გაიგზავნება ხმოვანი ფოსტა (არასავალდებულო). შესაძლებელია მრავალი მისამართის მძიმით გამოყოფა."; +$text['description-voicemail_mail_to']['nl-nl'] = "Voer het e-mailadres in om de voicemail naartoe te sturen (optioneel). Meerdere adressen kunnen worden gescheiden door komma's."; +$text['description-voicemail_mail_to']['pl-pl'] = "Wprowadź adres e-mail, na który ma zostać wysłana poczta głosowa (opcjonalnie). Wiele adresów można oddzielić przecinkami."; +$text['description-voicemail_mail_to']['pt-br'] = "Digite o endereço de e-mail para enviar o correio de voz (opcional). Vários endereços podem ser separados por vírgulas."; +$text['description-voicemail_mail_to']['pt-pt'] = "Digite o endereço de e-mail para enviar o correio de voz (opcional). Vários endereços podem ser separados por vírgulas."; +$text['description-voicemail_mail_to']['ro-ro'] = "Introduceți adresa de e-mail la care se va trimite mesageria vocală (opțional). Mai multe adrese pot fi separate prin virgule."; +$text['description-voicemail_mail_to']['ru-ru'] = "Введите адрес электронной почты для отправки голосовой почты (необязательно). Несколько адресов можно разделять запятыми."; +$text['description-voicemail_mail_to']['sv-se'] = "Ange e-postadressen som röstbrevet ska skickas till (valfritt). Flera adresser kan separeras med kommatecken."; +$text['description-voicemail_mail_to']['uk-ua'] = "Введіть адресу електронної пошти для надсилання голосової пошти (необов’язково). Декілька адрес можна розділити комами."; +$text['description-voicemail_mail_to']['tr-tr'] = "Sesli mesajın gönderileceği e-posta adresini girin (isteğe bağlı). Birden fazla adres virgülle ayrılabilir."; +$text['description-voicemail_mail_to']['zh-cn'] = "输入要发送语音邮件的电子邮件地址(可选)。多个地址可用逗号分隔。"; +$text['description-voicemail_mail_to']['ja-jp'] = "ボイスメールを送信するメールアドレスを入力してください(オプション)。複数のアドレスはコンマで区切ることができます。"; +$text['description-voicemail_mail_to']['ko-kr'] = "보이스메일을 보낼 이메일 주소를 입력하세요(선택 사항). 여러 개의 주소는 쉼표로 구분할 수 있습니다."; $text['description-voicemail_local_after_email']['en-us'] = "Choose whether to keep the voicemail in the system after sending the email notification."; $text['description-voicemail_local_after_email']['en-gb'] = "Choose whether to keep the voicemail in the system after sending the email notification."; From d529021b3fd2e51c8958e9d04d1733f7e5577554 Mon Sep 17 00:00:00 2001 From: frytimo Date: Tue, 4 Mar 2025 14:25:47 -0400 Subject: [PATCH 21/73] Use boolean setting as true boolean (#7284) * use boolean setting as true boolean * Update settings class to use the php filter_var function for boolean Using the built-in filter type for boolean seems like a better option as they are faster, already hardened, and more widely tested. I found this better method used originally by Mark J. Crane in 2022 in the content.php page so I included it here. * Update settings class to use the php filter_var function for boolean Using the built-in filter type for boolean seems like a better option as they are faster, already hardened, and more widely tested. I found this better method used originally by Mark J. Crane in 2022 in the content.php page so I included it here. --- .../resources/content.php | 4 +- app/bridges/bridges.php | 6 +-- app/call_block/call_block.php | 6 +-- app/call_broadcast/call_broadcast.php | 6 +-- app/call_centers/call_center_agents.php | 6 +-- app/call_centers/call_center_queues.php | 6 +-- app/call_centers/waveform.php | 4 +- app/call_flows/call_flows.php | 6 +-- app/call_flows/waveform.php | 4 +- app/call_forward/call_forward.php | 6 +-- app/call_forward/call_forward_edit.php | 6 +-- .../resources/classes/call_forward.php | 2 +- .../resources/classes/do_not_disturb.php | 2 +- .../resources/classes/follow_me.php | 2 +- app/call_recordings/waveform.php | 4 +- app/conference_centers/conference_centers.php | 6 +-- app/conference_centers/conference_rooms.php | 6 +-- .../conference_session_details.php | 6 +-- .../conference_sessions.php | 6 +-- app/conference_centers/waveform.php | 4 +- .../conference_control_details.php | 6 +-- .../conference_controls.php | 6 +-- .../conference_profile_params.php | 6 +-- .../conference_profiles.php | 6 +-- app/conferences/conferences.php | 6 +-- .../conferences_active_inc.php | 2 +- .../database_transactions.php | 6 +-- app/destinations/destination_imports.php | 2 +- app/destinations/destinations.php | 8 ++-- app/devices/device_profiles.php | 4 +- app/devices/device_vendor_functions.php | 4 +- app/devices/device_vendors.php | 4 +- app/dialplans/dialplan_xml.php | 6 +-- app/dialplans/dialplans.php | 22 +++++------ app/email_queue/email_queue.php | 4 +- app/email_queue/email_queue_edit.php | 8 ++-- app/event_guard/event_guard_logs.php | 4 +- app/extension_settings/extension_settings.php | 6 +-- app/extensions/extensions.php | 4 +- app/fax/fax.php | 4 +- app/fax/fax_logs.php | 4 +- app/gateways/gateways.php | 8 ++-- app/ivr_menus/ivr_menu_edit.php | 2 +- app/ivr_menus/ivr_menus.php | 6 +-- app/ivr_menus/waveform.php | 4 +- app/modules/modules.php | 6 +-- app/music_on_hold/waveform.php | 4 +- .../number_translations.php | 6 +-- app/phrases/phrases.php | 4 +- app/pin_numbers/pin_numbers.php | 4 +- app/recordings/waveform.php | 4 +- app/registrations/registrations.php | 6 +-- app/ring_groups/ring_groups.php | 4 +- app/ring_groups/waveform.php | 4 +- app/sip_profiles/sip_profiles.php | 6 +-- .../sofia_global_settings.php | 6 +-- app/streams/streams.php | 4 +- .../resources/dashboard/system_counts.php | 4 +- app/system/system.php | 6 +-- app/time_conditions/time_conditions.php | 4 +- app/vars/vars.php | 6 +-- .../voicemail_greetings.php | 4 +- app/voicemail_greetings/waveform.php | 4 +- app/voicemails/voicemail_edit.php | 16 ++++---- app/voicemails/waveform.php | 4 +- app/xml_cdr/resources/classes/xml_cdr.php | 2 +- .../resources/dashboard/missed_calls.php | 4 +- .../resources/dashboard/recent_calls.php | 4 +- app/xml_cdr/waveform.php | 4 +- app/xml_cdr/xml_cdr_inc.php | 2 +- core/contacts/contact_addresses.php | 2 +- core/contacts/contact_attachments.php | 2 +- core/contacts/contact_edit.php | 4 +- core/contacts/contact_emails.php | 6 +-- core/contacts/contact_extensions.php | 6 +-- core/contacts/contact_phones.php | 4 +- core/contacts/contact_relations.php | 6 +-- core/contacts/contact_settings.php | 6 +-- core/contacts/contact_times.php | 6 +-- core/contacts/contact_urls.php | 4 +- core/contacts/contacts.php | 6 +-- core/dashboard/dashboard.php | 4 +- core/databases/databases.php | 6 +-- core/default_settings/default_settings.php | 6 +-- core/domain_settings/domain_settings.php | 6 +-- core/domains/domains.php | 6 +-- core/email_templates/email_template_edit.php | 6 +-- core/email_templates/email_templates.php | 6 +-- core/groups/groups.php | 6 +-- core/menu/menu.php | 8 ++-- core/menu/menu_item_list.php | 8 ++-- core/user_settings/user_settings.php | 6 +-- core/users/user_edit.php | 8 ++-- core/users/users.php | 6 +-- logout.php | 2 +- resources/classes/settings.php | 38 ++----------------- resources/footer.php | 4 +- resources/php.php | 2 +- themes/default/css.php | 18 ++++----- 99 files changed, 265 insertions(+), 295 deletions(-) diff --git a/app/basic_operator_panel/resources/content.php b/app/basic_operator_panel/resources/content.php index 341a59e444..db831c2a64 100644 --- a/app/basic_operator_panel/resources/content.php +++ b/app/basic_operator_panel/resources/content.php @@ -353,7 +353,7 @@ if (is_array($activity)) { } else { //unregistered extension - if (!empty($_SESSION['operator_panel']['show_unregistered']['boolean']) && $_SESSION['operator_panel']['show_unregistered']['boolean'] == 'true') { + if (filter_var($_SESSION['operator_panel']['show_unregistered']['boolean'] ?? false, FILTER_VALIDATE_BOOL)) { $css_class = "ur_ext"; } else { @@ -551,7 +551,7 @@ if (is_array($activity)) { if (in_array($extension, $_SESSION['user']['extensions'])) { $user_extensions[] = $block; - } elseif (!empty($ext['call_group']) && filter_var($_SESSION['operator_panel']['group_extensions']['boolean'], FILTER_VALIDATE_BOOLEAN)) { + } elseif (!empty($ext['call_group']) && filter_var($_SESSION['operator_panel']['group_extensions']['boolean'] ?? false, FILTER_VALIDATE_BOOLEAN)) { $grouped_extensions[$ext['call_group']][] = $block; } else { $other_extensions[] = $block; diff --git a/app/bridges/bridges.php b/app/bridges/bridges.php index 95cf85dcef..0b263b3e60 100644 --- a/app/bridges/bridges.php +++ b/app/bridges/bridges.php @@ -47,7 +47,7 @@ $show = $_GET["show"] ?? ''; //set from session variables - $list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false'; + $list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL); //get the http post data if (!empty($_POST['bridges'])) { @@ -226,7 +226,7 @@ echo th_order_by('bridge_destination', $text['label-bridge_destination'], $order_by, $order); echo th_order_by('bridge_enabled', $text['label-bridge_enabled'], $order_by, $order, null, "class='center'"); echo " ".$text['label-bridge_description']." 
".escape($row['bridge_description'])."\n"; echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]); echo " ".$text['label-description']." 
".$row['date_formatted']." ".$row['time_formatted']."".escape($row['call_block_description']).""; echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]); echo "  
".escape($broadcast_start_time ?? '')."".escape($row['broadcast_description']).""; echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]); echo "  
".$row[agent_wrap_up_time]."".$row[agent_reject_delay_time]."".$row[agent_busy_delay_time].""; echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]); echo "  
".escape($row[queue_abandoned_resume_allowed])." ".escape($row[queue_tier_rule_wait_multiply_level])." ".escape($row['queue_description']).""; echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]); echo "  
".escape($row['call_flow_description'])." "; echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]); echo " " . $text['label-dnd'] . "" . $text['label-description'] . " 
" . escape($row['description']) . " "; echo button::create(['type' => 'button', 'title' => $text['button-edit'], 'icon' => $_SESSION['theme']['button_icon_edit'], 'link' => $list_row_url]); echo " \n"; - require_once "app/music_on_hold/resources/classes/switch_music_on_hold.php"; $options = ''; $moh = new switch_music_on_hold; echo $moh->select('hold_music', $hold_music ?? '', $options); diff --git a/app/extensions/resources/classes/extension.php b/app/extensions/resources/classes/extension.php index 8a8eab1afa..53d0f9f90a 100644 --- a/app/extensions/resources/classes/extension.php +++ b/app/extensions/resources/classes/extension.php @@ -25,7 +25,6 @@ */ //define the directory class -if (!class_exists('extension')) { class extension { /** @@ -795,6 +794,3 @@ if (!class_exists('extension')) { } } -} - -?> diff --git a/app/fax/fax_emails.php b/app/fax/fax_emails.php index a22080e67c..8a52178671 100644 --- a/app/fax/fax_emails.php +++ b/app/fax/fax_emails.php @@ -29,7 +29,6 @@ require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/functions/object_to_array.php"; require_once "resources/functions/parse_message.php"; -require_once "resources/classes/text.php"; //get accounts to monitor $sql = "select d.domain_name, f.* "; diff --git a/app/fax/resources/classes/fax.php b/app/fax/resources/classes/fax.php index d3b6b8748d..e1a24157ce 100644 --- a/app/fax/resources/classes/fax.php +++ b/app/fax/resources/classes/fax.php @@ -25,7 +25,6 @@ */ //define the fax class -if (!class_exists('fax')) { class fax { /** @@ -725,7 +724,6 @@ if (!class_exists('fax')) { } } //class -} /* $o = new fax; @@ -738,5 +736,3 @@ $c->destination_number = $fax_destination_number; $c->fax_description = $fax_description; $c->dialplan(); */ - -?> \ No newline at end of file diff --git a/app/fax_queue/resources/classes/fax_queue.php b/app/fax_queue/resources/classes/fax_queue.php index f5d2897ef1..0f2378a066 100644 --- a/app/fax_queue/resources/classes/fax_queue.php +++ b/app/fax_queue/resources/classes/fax_queue.php @@ -26,12 +26,7 @@ /** * fax_queue class - * - * @method null delete - * @method null toggle - * @method null copy */ -if (!class_exists('fax_queue')) { class fax_queue { /** @@ -274,6 +269,3 @@ if (!class_exists('fax_queue')) { } } } -} - -?> diff --git a/app/fax_queue/resources/service/fax_queue.php b/app/fax_queue/resources/service/fax_queue.php index 6084254ebf..db9eb1e654 100644 --- a/app/fax_queue/resources/service/fax_queue.php +++ b/app/fax_queue/resources/service/fax_queue.php @@ -8,7 +8,6 @@ //includes files require_once dirname(__DIR__, 4) . "/resources/require.php"; require_once "resources/pdo.php"; - include "resources/classes/permissions.php"; //increase limits set_time_limit(0); diff --git a/app/fifo/resources/classes/fifo.php b/app/fifo/resources/classes/fifo.php index 4338f3f48e..450f5cd4c3 100644 --- a/app/fifo/resources/classes/fifo.php +++ b/app/fifo/resources/classes/fifo.php @@ -2,12 +2,7 @@ /** * fifo class - * - * @method null delete - * @method null toggle - * @method null copy */ -if (!class_exists('fifo')) { class fifo { /** @@ -283,6 +278,3 @@ if (!class_exists('fifo')) { } } -} - -?> \ No newline at end of file diff --git a/app/gateways/resources/classes/gateways.php b/app/gateways/resources/classes/gateways.php index cbfba52633..83ab122ad9 100644 --- a/app/gateways/resources/classes/gateways.php +++ b/app/gateways/resources/classes/gateways.php @@ -25,7 +25,6 @@ */ //define the gateways class -if (!class_exists('gateways')) { class gateways { /** @@ -583,6 +582,3 @@ if (!class_exists('gateways')) { } } -} - -?> \ No newline at end of file diff --git a/app/ivr_menus/resources/classes/ivr_menu.php b/app/ivr_menus/resources/classes/ivr_menu.php index 50a0fde239..2d91d84c15 100644 --- a/app/ivr_menus/resources/classes/ivr_menu.php +++ b/app/ivr_menus/resources/classes/ivr_menu.php @@ -25,7 +25,6 @@ */ //define the ivr_menu class -if (!class_exists('ivr_menu')) { class ivr_menu { /** @@ -489,6 +488,3 @@ if (!class_exists('ivr_menu')) { } } -} - -?> diff --git a/app/ivr_menus/waveform.php b/app/ivr_menus/waveform.php index 0c93872262..8b760cd949 100644 --- a/app/ivr_menus/waveform.php +++ b/app/ivr_menus/waveform.php @@ -27,7 +27,6 @@ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/check_auth.php"; - require_once "resources/classes/waveform.php"; use maximal\audio\Waveform; diff --git a/app/modules/resources/classes/modules.php b/app/modules/resources/classes/modules.php index 28b83949e0..8559b657b4 100644 --- a/app/modules/resources/classes/modules.php +++ b/app/modules/resources/classes/modules.php @@ -25,7 +25,6 @@ */ //define the modules class -if (!class_exists('modules')) { class modules { /** @@ -1101,10 +1100,8 @@ if (!class_exists('modules')) { } //class -} /* -require_once "resources/classes/modules.php"; $mod = new modules; $mod->dir = $_SESSION['switch']['mod']['dir']; echo $mod->dir."\n"; @@ -1138,5 +1135,3 @@ echo $mod->dir."\n"; //print_r($result); //echo "\n"; */ - -?> diff --git a/app/music_on_hold/music_on_hold.php b/app/music_on_hold/music_on_hold.php index 95c4443a81..ae92335afb 100644 --- a/app/music_on_hold/music_on_hold.php +++ b/app/music_on_hold/music_on_hold.php @@ -308,7 +308,6 @@ $cache = new cache; $cache->delete("configuration:local_stream.conf"); - //require_once "app/music_on_hold/resources/classes/switch_music_on_hold.php"; $music = new switch_music_on_hold; $music->reload(); diff --git a/app/music_on_hold/resources/classes/switch_music_on_hold.php b/app/music_on_hold/resources/classes/switch_music_on_hold.php index 71d628eca2..55d90e86b1 100644 --- a/app/music_on_hold/resources/classes/switch_music_on_hold.php +++ b/app/music_on_hold/resources/classes/switch_music_on_hold.php @@ -27,7 +27,6 @@ */ //define the switch_music_on_hold class -if (!class_exists('switch_music_on_hold')) { class switch_music_on_hold { /** @@ -85,7 +84,6 @@ if (!class_exists('switch_music_on_hold')) { } //recordings if (is_dir($_SERVER["PROJECT_ROOT"].'/app/recordings')) { - require_once "app/recordings/resources/classes/switch_recordings.php"; $recordings_c = new switch_recordings; $recordings = $recordings_c->list_recordings(); if (is_array($recordings) && sizeof($recordings) > 0) { @@ -447,12 +445,9 @@ if (!class_exists('switch_music_on_hold')) { } //method } //class -} + //build and save the XML - //require_once "app/music_on_hold/resources/classes/switch_music_on_hold.php"; //$moh = new switch_music_on_hold; //$moh->xml(); //$moh->save(); - -?> \ No newline at end of file diff --git a/app/music_on_hold/waveform.php b/app/music_on_hold/waveform.php index 68087e5dde..47fafbd10c 100644 --- a/app/music_on_hold/waveform.php +++ b/app/music_on_hold/waveform.php @@ -27,7 +27,6 @@ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/check_auth.php"; - require_once "resources/classes/waveform.php"; use maximal\audio\Waveform; diff --git a/app/number_translations/resources/classes/number_translations.php b/app/number_translations/resources/classes/number_translations.php index 22a2836401..c0abf97057 100644 --- a/app/number_translations/resources/classes/number_translations.php +++ b/app/number_translations/resources/classes/number_translations.php @@ -25,7 +25,6 @@ */ //define the number translations class -if (!class_exists('number_translations')) { class number_translations { /** @@ -414,11 +413,8 @@ if (!class_exists('number_translations')) { } //method } //class -} /* $obj = new number_translations; $obj->delete(); */ - -?> \ No newline at end of file diff --git a/app/phrases/resources/classes/phrases.php b/app/phrases/resources/classes/phrases.php index 2ed6f0f893..8fa677fe8a 100644 --- a/app/phrases/resources/classes/phrases.php +++ b/app/phrases/resources/classes/phrases.php @@ -25,7 +25,6 @@ */ //define the phrases class -if (!class_exists('phrases')) { class phrases { /** @@ -431,6 +430,3 @@ if (!class_exists('phrases')) { } //method } //class -} - -?> \ No newline at end of file diff --git a/app/pin_numbers/resources/classes/pin_numbers.php b/app/pin_numbers/resources/classes/pin_numbers.php index c0be87493e..817f21caab 100644 --- a/app/pin_numbers/resources/classes/pin_numbers.php +++ b/app/pin_numbers/resources/classes/pin_numbers.php @@ -25,7 +25,6 @@ */ //define the pin numbers class -if (!class_exists('pin_numbers')) { class pin_numbers { /** @@ -245,6 +244,3 @@ if (!class_exists('pin_numbers')) { } } -} - -?> \ No newline at end of file diff --git a/app/recordings/resources/classes/switch_recordings.php b/app/recordings/resources/classes/switch_recordings.php index dc3988ef67..f50fa1e80e 100644 --- a/app/recordings/resources/classes/switch_recordings.php +++ b/app/recordings/resources/classes/switch_recordings.php @@ -26,7 +26,6 @@ */ //define the switch_recordings class -if (!class_exists('switch_recordings')) { class switch_recordings { /** @@ -158,6 +157,3 @@ if (!class_exists('switch_recordings')) { } //method } //class -} - -?> diff --git a/app/recordings/waveform.php b/app/recordings/waveform.php index f5136b2927..07a15a5555 100644 --- a/app/recordings/waveform.php +++ b/app/recordings/waveform.php @@ -27,7 +27,6 @@ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/check_auth.php"; - require_once "resources/classes/waveform.php"; use maximal\audio\Waveform; diff --git a/app/registrations/registrations.php b/app/registrations/registrations.php index 8840050198..18720eb38d 100644 --- a/app/registrations/registrations.php +++ b/app/registrations/registrations.php @@ -88,7 +88,6 @@ $registrations = $obj->get($profile ?? null); //order the array - require_once "resources/classes/array_order.php"; $order = new array_order(); $registrations = $order->sort($registrations, 'sip-auth-realm', 'user'); diff --git a/app/ring_groups/resources/classes/ring_groups.php b/app/ring_groups/resources/classes/ring_groups.php index ceab17b711..5a9786e256 100644 --- a/app/ring_groups/resources/classes/ring_groups.php +++ b/app/ring_groups/resources/classes/ring_groups.php @@ -25,7 +25,6 @@ */ //define the ring groups class -if (!class_exists('ring_groups')) { class ring_groups { /** @@ -512,6 +511,3 @@ if (!class_exists('ring_groups')) { } } -} - -?> diff --git a/app/ring_groups/waveform.php b/app/ring_groups/waveform.php index 0c93872262..8b760cd949 100644 --- a/app/ring_groups/waveform.php +++ b/app/ring_groups/waveform.php @@ -27,7 +27,6 @@ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/check_auth.php"; - require_once "resources/classes/waveform.php"; use maximal\audio\Waveform; diff --git a/app/sip_profiles/resources/classes/sip_profiles.php b/app/sip_profiles/resources/classes/sip_profiles.php index 5d90bb5de8..2ab414a2c3 100644 --- a/app/sip_profiles/resources/classes/sip_profiles.php +++ b/app/sip_profiles/resources/classes/sip_profiles.php @@ -25,7 +25,6 @@ */ //define the sip profiles class -if (!class_exists('sip_profiles')) { class sip_profiles { /** @@ -434,6 +433,3 @@ if (!class_exists('sip_profiles')) { } } -} - -?> \ No newline at end of file diff --git a/app/sofia_global_settings/resources/classes/sofia_global_settings.php b/app/sofia_global_settings/resources/classes/sofia_global_settings.php index 289efda183..f9a1c838b3 100644 --- a/app/sofia_global_settings/resources/classes/sofia_global_settings.php +++ b/app/sofia_global_settings/resources/classes/sofia_global_settings.php @@ -26,12 +26,7 @@ /** * sofia_global_settings class - * - * @method null delete - * @method null toggle - * @method null copy */ -if (!class_exists('sofia_global_settings')) { class sofia_global_settings { /** @@ -247,6 +242,3 @@ if (!class_exists('sofia_global_settings')) { } } -} - -?> \ No newline at end of file diff --git a/app/streams/resources/classes/streams.php b/app/streams/resources/classes/streams.php index 05340cdfee..2256892d8f 100644 --- a/app/streams/resources/classes/streams.php +++ b/app/streams/resources/classes/streams.php @@ -25,7 +25,6 @@ */ //define the streams class -if (!class_exists('streams')) { class streams { /** @@ -244,6 +243,3 @@ if (!class_exists('streams')) { } } -} - -?> \ No newline at end of file diff --git a/app/switch/resources/classes/presence.php b/app/switch/resources/classes/presence.php index b455c24a6d..c645f8eac4 100644 --- a/app/switch/resources/classes/presence.php +++ b/app/switch/resources/classes/presence.php @@ -23,12 +23,7 @@ /** * presence class - * - * @method boolean active - * @method array show */ - -if (!class_exists('presence')) { class presence { /** @@ -84,7 +79,6 @@ if (!class_exists('presence')) { return $array; } } -} //examples /* @@ -97,11 +91,9 @@ if (!class_exists('presence')) { echo "active: true\n"; } else { - echo "active: false\n"; + echo "active: false\n"; } //show active the presence $presence = new presence; $array = $presence->show(); */ - -?> diff --git a/app/switch/resources/classes/ringbacks.php b/app/switch/resources/classes/ringbacks.php index db05aeb98a..d206eac70b 100644 --- a/app/switch/resources/classes/ringbacks.php +++ b/app/switch/resources/classes/ringbacks.php @@ -25,7 +25,6 @@ Matthew Vale */ -if (!class_exists('ringbacks')) { class ringbacks { //define variables @@ -85,18 +84,15 @@ if (!class_exists('ringbacks')) { */ //get the tones - require_once "resources/classes/tones.php"; $tones = new tones; $this->tones_list = $tones->tones_list(); //get music on hold and recordings if (is_dir($_SERVER["PROJECT_ROOT"].'/app/music_on_hold')) { - require_once "app/music_on_hold/resources/classes/switch_music_on_hold.php"; $music = new switch_music_on_hold; $this->music_list = $music->get(); } if (is_dir($_SERVER["PROJECT_ROOT"].'/app/recordings')) { - require_once "app/recordings/resources/classes/switch_recordings.php"; $recordings = new switch_recordings; $this->recordings_list = $recordings->list_recordings(); } @@ -232,6 +228,3 @@ if (!class_exists('ringbacks')) { return $select; } } -} - -?> diff --git a/app/switch/resources/classes/switch_files.php b/app/switch/resources/classes/switch_files.php index 80b1b24436..c98091a624 100644 --- a/app/switch/resources/classes/switch_files.php +++ b/app/switch/resources/classes/switch_files.php @@ -26,12 +26,7 @@ /** * switch class provides methods for copying switch_files - * - * @method string correct_path - * @method string copy_scripts - * @method string copy_languages */ -if (!class_exists('switch_files')) { class switch_files { /** @@ -158,7 +153,6 @@ if (!class_exists('switch_files')) { } } -} /* //example use @@ -168,5 +162,3 @@ if (!class_exists('switch_files')) { $obj->copy_scripts(); $obj->copy_languages(); */ - -?> diff --git a/app/time_conditions/resources/classes/time_conditions.php b/app/time_conditions/resources/classes/time_conditions.php index 98a5e757df..c4be826b78 100644 --- a/app/time_conditions/resources/classes/time_conditions.php +++ b/app/time_conditions/resources/classes/time_conditions.php @@ -25,7 +25,6 @@ */ //define the time conditions class - if (!class_exists('time_conditions')) { class time_conditions { /** @@ -346,6 +345,3 @@ } //class - } - -?> diff --git a/app/vars/resources/classes/vars.php b/app/vars/resources/classes/vars.php index 3f137327d5..7018b3da36 100644 --- a/app/vars/resources/classes/vars.php +++ b/app/vars/resources/classes/vars.php @@ -25,7 +25,6 @@ */ //define the vars class -if (!class_exists('vars')) { class vars { /** @@ -258,6 +257,3 @@ if (!class_exists('vars')) { } } -} - -?> \ No newline at end of file diff --git a/app/voicemail_greetings/resources/classes/voicemail_greetings.php b/app/voicemail_greetings/resources/classes/voicemail_greetings.php index b8ae36fb28..74b50cd0d2 100644 --- a/app/voicemail_greetings/resources/classes/voicemail_greetings.php +++ b/app/voicemail_greetings/resources/classes/voicemail_greetings.php @@ -25,7 +25,6 @@ */ //define the voicemail greetings class -if (!class_exists('voicemail_greetings')) { class voicemail_greetings { /** @@ -166,6 +165,3 @@ if (!class_exists('voicemail_greetings')) { } //method } //class -} - -?> \ No newline at end of file diff --git a/app/voicemail_greetings/waveform.php b/app/voicemail_greetings/waveform.php index 59e8032d78..78325752ef 100644 --- a/app/voicemail_greetings/waveform.php +++ b/app/voicemail_greetings/waveform.php @@ -27,7 +27,6 @@ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/check_auth.php"; - require_once "resources/classes/waveform.php"; use maximal\audio\Waveform; diff --git a/app/voicemails/resources/classes/voicemail.php b/app/voicemails/resources/classes/voicemail.php index 771d07ed97..cfeca41e78 100644 --- a/app/voicemails/resources/classes/voicemail.php +++ b/app/voicemails/resources/classes/voicemail.php @@ -1581,7 +1581,6 @@ } //example voicemail messages - //require_once "app/voicemails/resources/classes/voicemail.php"; //$voicemail = new voicemail; //$voicemail->voicemail_uuid = $voicemail_uuid; //$voicemail->order_by = $order_by; diff --git a/app/voicemails/resources/dashboard/voicemails.php b/app/voicemails/resources/dashboard/voicemails.php index a8e88448c4..6f062a54ca 100644 --- a/app/voicemails/resources/dashboard/voicemails.php +++ b/app/voicemails/resources/dashboard/voicemails.php @@ -23,9 +23,6 @@ //voicemail echo "
\n"; -//required class - require_once "app/voicemails/resources/classes/voicemail.php"; - //get the voicemail $vm = new voicemail; $vm->domain_uuid = $_SESSION['domain_uuid']; diff --git a/app/voicemails/voicemail_message_toggle.php b/app/voicemails/voicemail_message_toggle.php index 46227bbd55..da1afc7c0c 100644 --- a/app/voicemails/voicemail_message_toggle.php +++ b/app/voicemails/voicemail_message_toggle.php @@ -47,7 +47,6 @@ //toggle the voicemail message $toggled = 0; if (is_array($voicemail_messages) && sizeof($voicemail_messages) > 0) { - require_once "resources/classes/voicemail.php"; foreach ($voicemail_messages as $voicemail_uuid => $voicemail_message_uuids) { foreach ($voicemail_message_uuids as $voicemail_message_uuid) { if (is_uuid($voicemail_uuid) && is_uuid($voicemail_message_uuid)) { diff --git a/app/voicemails/waveform.php b/app/voicemails/waveform.php index 645ef6c003..effb3842f5 100644 --- a/app/voicemails/waveform.php +++ b/app/voicemails/waveform.php @@ -27,7 +27,6 @@ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/check_auth.php"; - require_once "resources/classes/waveform.php"; use maximal\audio\Waveform; diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index 8996ca6e9d..432570f92d 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -26,10 +26,7 @@ /** * xml_cdr class provides methods for adding cdr records to the database - * - * @method boolean add */ -if (!class_exists('xml_cdr')) { class xml_cdr { /** @@ -2370,4 +2367,3 @@ if (!class_exists('xml_cdr')) { } } //class -} diff --git a/app/xml_cdr/waveform.php b/app/xml_cdr/waveform.php index b37c596109..885087ec78 100644 --- a/app/xml_cdr/waveform.php +++ b/app/xml_cdr/waveform.php @@ -27,7 +27,6 @@ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/check_auth.php"; - require_once "resources/classes/waveform.php"; use maximal\audio\Waveform; diff --git a/core/authentication/resources/classes/authentication.php b/core/authentication/resources/classes/authentication.php index 790f319709..9cdc02ebae 100644 --- a/core/authentication/resources/classes/authentication.php +++ b/core/authentication/resources/classes/authentication.php @@ -96,7 +96,6 @@ class authentication { //process the plugin if (file_exists($plugin)) { //run the plugin - include_once $plugin; $object = new $class_name(); $object->domain_name = $this->domain_name; $object->domain_uuid = $this->domain_uuid; diff --git a/core/authentication/resources/classes/plugins/email.php b/core/authentication/resources/classes/plugins/email.php index 900c467b36..aa0bfd4a38 100644 --- a/core/authentication/resources/classes/plugins/email.php +++ b/core/authentication/resources/classes/plugins/email.php @@ -26,8 +26,6 @@ /** * plugin_email - * - * @method email time based one time password authenticate the user */ class plugin_email { @@ -521,5 +519,3 @@ class plugin_email { } } - -?> diff --git a/core/authentication/resources/classes/plugins/ldap.php b/core/authentication/resources/classes/plugins/ldap.php index dfd499602f..de85f39089 100644 --- a/core/authentication/resources/classes/plugins/ldap.php +++ b/core/authentication/resources/classes/plugins/ldap.php @@ -209,5 +209,3 @@ class plugin_ldap { return $result; } } - -?> \ No newline at end of file diff --git a/core/authentication/resources/classes/plugins/totp.php b/core/authentication/resources/classes/plugins/totp.php index 0524335a63..ccf7b8b410 100644 --- a/core/authentication/resources/classes/plugins/totp.php +++ b/core/authentication/resources/classes/plugins/totp.php @@ -439,5 +439,3 @@ class plugin_totp { } } - -?> diff --git a/core/contacts/contacts_vcard.php b/core/contacts/contacts_vcard.php index 59dcb42b97..f9434275df 100644 --- a/core/contacts/contacts_vcard.php +++ b/core/contacts/contacts_vcard.php @@ -42,7 +42,6 @@ if (!empty($_GET)) { $text = $language->get(); //create the vcard object - require_once "resources/classes/vcard.php"; $vcard = new vcard(); //get the contact id diff --git a/core/contacts/resources/classes/contacts.php b/core/contacts/resources/classes/contacts.php index c29f0243a8..cd3de9d6d7 100644 --- a/core/contacts/resources/classes/contacts.php +++ b/core/contacts/resources/classes/contacts.php @@ -25,7 +25,6 @@ */ //define the contacts class -if (!class_exists('contacts')) { class contacts { const APP_NAME = "contacts"; @@ -277,6 +276,3 @@ if (!class_exists('contacts')) { } //method } //class -} - -?> \ No newline at end of file diff --git a/core/dashboard/resources/classes/dashboard.php b/core/dashboard/resources/classes/dashboard.php index 34f973bd95..6ecb1ba8fa 100644 --- a/core/dashboard/resources/classes/dashboard.php +++ b/core/dashboard/resources/classes/dashboard.php @@ -26,12 +26,7 @@ /** * dashboard class - * - * @method null delete - * @method null toggle - * @method null copy */ -if (!class_exists('dashboard')) { class dashboard { /** @@ -247,6 +242,3 @@ if (!class_exists('dashboard')) { } } -} - -?> diff --git a/core/databases/resources/classes/databases.php b/core/databases/resources/classes/databases.php index 8b9edee5e2..0b5a29d78c 100644 --- a/core/databases/resources/classes/databases.php +++ b/core/databases/resources/classes/databases.php @@ -25,7 +25,6 @@ */ //define the databases class -if (!class_exists('databases')) { class databases { /** @@ -169,6 +168,3 @@ if (!class_exists('databases')) { } } -} - -?> \ No newline at end of file diff --git a/core/default_settings/resources/classes/default_settings.php b/core/default_settings/resources/classes/default_settings.php index 499614b5b3..73deb9801d 100644 --- a/core/default_settings/resources/classes/default_settings.php +++ b/core/default_settings/resources/classes/default_settings.php @@ -26,12 +26,7 @@ /** * default_settings class - * - * @method null delete - * @method null toggle - * @method null copy */ -if (!class_exists('default_settings')) { class default_settings { /** @@ -327,6 +322,3 @@ if (!class_exists('default_settings')) { } //method } //class -} - -?> diff --git a/core/domain_settings/resources/classes/domain_settings.php b/core/domain_settings/resources/classes/domain_settings.php index 04a7c66626..b384ab062d 100644 --- a/core/domain_settings/resources/classes/domain_settings.php +++ b/core/domain_settings/resources/classes/domain_settings.php @@ -25,7 +25,6 @@ */ //define the domain settings class -if (!class_exists('domain_settings')) { class domain_settings { /** @@ -386,6 +385,3 @@ if (!class_exists('domain_settings')) { } //method } //class -} - -?> diff --git a/core/domains/domain_edit.php b/core/domains/domain_edit.php index bc40710efb..760b8f90ba 100644 --- a/core/domains/domain_edit.php +++ b/core/domains/domain_edit.php @@ -486,7 +486,6 @@ //recreate dialplan and extension xml files if (is_readable($_SESSION['switch']['extensions']['dir'])) { - require_once $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/extensions/resources/classes/extension.php"; $extension = new extension; $extension->xml(); } diff --git a/core/email_templates/resources/classes/email_templates.php b/core/email_templates/resources/classes/email_templates.php index 027e76ee03..af7240421a 100644 --- a/core/email_templates/resources/classes/email_templates.php +++ b/core/email_templates/resources/classes/email_templates.php @@ -25,7 +25,6 @@ */ //define the email templates class -if (!class_exists('email_templates')) { class email_templates { /** @@ -244,6 +243,3 @@ if (!class_exists('email_templates')) { } } -} - -?> \ No newline at end of file diff --git a/core/events/resources/classes/events.php b/core/events/resources/classes/events.php index e3fbb373cb..dd72242c6d 100644 --- a/core/events/resources/classes/events.php +++ b/core/events/resources/classes/events.php @@ -2,9 +2,6 @@ /** * events class provides an event system - * - * @method void load_plugins - * @method dynamic __call */ class events { @@ -31,11 +28,7 @@ class events { //create the database connection //includes files - require_once dirname(__DIR__, 4) . "/resources/require.php"; - - //includes files - require_once "resources/classes/database.php"; - $database = new database; + $database = database::new(); $database->connect(); $this->db = $database->db; return $this->db = $database->db; diff --git a/core/groups/permissions_default.php b/core/groups/permissions_default.php index 30a17c6f7e..4b5b41f02e 100644 --- a/core/groups/permissions_default.php +++ b/core/groups/permissions_default.php @@ -43,7 +43,6 @@ $text = $language->get(); //permission restore default - require_once "core/groups/resources/classes/permission.php"; $permission = new permission; $permission->restore(); diff --git a/core/install/resources/classes/install.php b/core/install/resources/classes/install.php index cd9b089cb7..221d7b4c38 100644 --- a/core/install/resources/classes/install.php +++ b/core/install/resources/classes/install.php @@ -1,6 +1,5 @@ diff --git a/core/menu/menu_restore_default.php b/core/menu/menu_restore_default.php index ef46c1e998..df0c5f3c1a 100644 --- a/core/menu/menu_restore_default.php +++ b/core/menu/menu_restore_default.php @@ -51,7 +51,6 @@ } //menu restore default - //require_once "resources/classes/menu.php"; $menu = new menu; $menu->menu_uuid = $menu_uuid; $menu->menu_language = $menu_language; diff --git a/core/software/resources/classes/software.php b/core/software/resources/classes/software.php index 7a84332caf..16f8bac3d0 100644 --- a/core/software/resources/classes/software.php +++ b/core/software/resources/classes/software.php @@ -2,10 +2,7 @@ /** * software class - * - * @method string version */ -if (!class_exists('software')) { class software { /** @@ -25,6 +22,3 @@ if (!class_exists('software')) { } } -} - -?> diff --git a/core/upgrade/index.php b/core/upgrade/index.php index eb56ed9fce..5d7f1499eb 100644 --- a/core/upgrade/index.php +++ b/core/upgrade/index.php @@ -133,7 +133,6 @@ //load an array of the database schema and compare it with the active database if (!empty($action["upgrade_schema"]) && permission_exists("upgrade_schema")) { - require_once "resources/classes/schema.php"; $obj = new schema(); if (isset($action["data_types"]) && $action["data_types"] == 'true') { $obj->data_types = true; diff --git a/core/upgrade/upgrade.php b/core/upgrade/upgrade.php index 376c3b0a22..7fb56cc9d0 100644 --- a/core/upgrade/upgrade.php +++ b/core/upgrade/upgrade.php @@ -189,8 +189,6 @@ //run all app_defaults.php files if ($upgrade_type == 'domains') { - require_once "resources/classes/config.php"; - require_once "resources/classes/domains.php"; $domain = new domains; $domain->display_type = $display_type; $domain->upgrade(); @@ -199,7 +197,6 @@ //upgrade schema and/or data_types if ($upgrade_type == 'schema') { //get the database schema put it into an array then compare and update the database as needed. - require_once "resources/classes/schema.php"; $obj = new schema; if (isset($argv[2]) && $argv[2] == 'data_types') { $obj->data_types = true; diff --git a/core/upgrade/upgrade_domains.php b/core/upgrade/upgrade_domains.php index 99931b27a1..e2d1692b0a 100644 --- a/core/upgrade/upgrade_domains.php +++ b/core/upgrade/upgrade_domains.php @@ -46,8 +46,6 @@ } //run all app_defaults.php files - require_once "resources/classes/config.php"; - require_once "resources/classes/domains.php"; $domain = new domains; $domain->display_type = $display_type; $domain->upgrade(); diff --git a/core/upgrade/upgrade_menu.php b/core/upgrade/upgrade_menu.php index e2497f80f9..f44373c479 100644 --- a/core/upgrade/upgrade_menu.php +++ b/core/upgrade/upgrade_menu.php @@ -273,8 +273,6 @@ function do_upgrade_code_submodules() { * Execute all app_defaults.php files */ function do_upgrade_domains() { - require_once dirname(__DIR__, 2) . "/resources/classes/config.php"; - require_once dirname(__DIR__, 2) . "/resources/classes/domains.php"; $domain = new domains; $domain->display_type = 'text'; $domain->upgrade(); @@ -285,7 +283,6 @@ function do_upgrade_domains() { */ function do_upgrade_schema(bool $data_types = false) { //get the database schema put it into an array then compare and update the database as needed. - require_once dirname(__DIR__, 2) . "/resources/classes/schema.php"; $obj = new schema; $obj->data_types = $data_types; echo $obj->schema('text'); diff --git a/core/upgrade/upgrade_schema.php b/core/upgrade/upgrade_schema.php index aa60ffef8a..807631d935 100644 --- a/core/upgrade/upgrade_schema.php +++ b/core/upgrade/upgrade_schema.php @@ -59,7 +59,6 @@ $text = $language->get(); //get the database schema put it into an array then compare and update the database as needed. - require_once "resources/classes/schema.php"; $obj = new schema; if (isset($argv[1]) && $argv[1] == 'data_types') { $obj->data_types = true; diff --git a/core/user_logs/resources/classes/user_logs.php b/core/user_logs/resources/classes/user_logs.php index 041603f66f..659e3976f2 100644 --- a/core/user_logs/resources/classes/user_logs.php +++ b/core/user_logs/resources/classes/user_logs.php @@ -26,12 +26,7 @@ /** * user_logs class - * - * @method null delete - * @method null toggle - * @method null copy */ -if (!class_exists('user_logs')) { class user_logs { /** @@ -151,6 +146,3 @@ if (!class_exists('user_logs')) { } } -} - -?> diff --git a/core/user_settings/resources/classes/user_settings.php b/core/user_settings/resources/classes/user_settings.php index dea8b87ab3..8819ae58b0 100644 --- a/core/user_settings/resources/classes/user_settings.php +++ b/core/user_settings/resources/classes/user_settings.php @@ -25,7 +25,6 @@ */ //define the user settings class -if (!class_exists('user_settings')) { class user_settings { /** @@ -181,6 +180,3 @@ if (!class_exists('user_settings')) { } //method } //class -} - -?> \ No newline at end of file diff --git a/core/user_settings/user_setting_set.php b/core/user_settings/user_setting_set.php index 90dc47ed26..ef9dc20c86 100644 --- a/core/user_settings/user_setting_set.php +++ b/core/user_settings/user_setting_set.php @@ -107,7 +107,6 @@ Mark J Crane //revoke temporary permissions $p->delete('user_setting_delete', 'temp'); //reset session variables to default - require "resources/classes/domains.php"; $domain = new domains(); $domain->set(); } diff --git a/core/users/resources/classes/users.php b/core/users/resources/classes/users.php index 734ce273d9..f7424b734e 100644 --- a/core/users/resources/classes/users.php +++ b/core/users/resources/classes/users.php @@ -26,12 +26,7 @@ /** * users class - * - * @method null delete - * @method null toggle - * @method null copy */ -if (!class_exists('users')) { class users { /** @@ -315,6 +310,3 @@ if (!class_exists('users')) { } } } -} - -?> diff --git a/resources/classes/auto_loader.php b/resources/classes/auto_loader.php index 1b5ed65549..74aed053e7 100644 --- a/resources/classes/auto_loader.php +++ b/resources/classes/auto_loader.php @@ -1,29 +1,37 @@ - Portions created by the Initial Developer are Copyright (C) 2008-2024 - the Initial Developer. All Rights Reserved. + The Initial Developer of the Original Code is + Mark J Crane + Portions created by the Initial Developer are Copyright (C) 2008-2024 + the Initial Developer. All Rights Reserved. - Contributor(s): - Mark J Crane -*/ + Contributor(s): + Mark J Crane + */ +/** + * Auto Loader class + * Searches for project files when a class is required. Debugging mode can be set using: + * - export DEBUG=1 + * OR + * - debug=true is appended to the url + */ class auto_loader { const FILE = 'autoloader_cache.php'; @@ -37,11 +45,20 @@ class auto_loader { */ private $apcu_enabled; + /** + * Cache path and file name + * @var string + */ + private static $cache_file = null; + public function __construct($project_path = '') { //set if we can use RAM cache $this->apcu_enabled = function_exists('apcu_enabled') && apcu_enabled(); + //set cache location + self::$cache_file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . self::FILE; + //classes must be loaded before this object is registered if (!$this->load_cache()) { //cache miss so load them @@ -61,12 +78,14 @@ class auto_loader { //update RAM cache when available if ($this->apcu_enabled) { - apcu_store(self::CACHE_KEY, $this->classes); + $success = apcu_store(self::CACHE_KEY, $this->classes); + //do not save to drive when we are using apcu + if ($success) return true; } //ensure we have somewhere to put the file if (empty($file)) { - $file = sys_get_temp_dir() . '/' . self::FILE; + $file = self::$cache_file; } //export the classes array using PHP engine @@ -77,13 +96,10 @@ class auto_loader { if ($result !== false) { return true; } + + //file failed to save - send error to syslog when debugging $error_array = error_get_last(); - //send to syslog when debugging - if (!empty($_REQUEST['debug']) && $_REQUEST['debug'] == 'true') { - openlog("PHP", LOG_PID | LOG_PERROR, LOG_LOCAL0); - syslog(LOG_WARNING, "[php][auto_loader] " . $error_array['message']); - closelog(); - } + self::log(LOG_WARNING, $error_array['message'] ?? ''); return false; } @@ -99,21 +115,21 @@ class auto_loader { //use a standard file if (empty($file)) { - $file = sys_get_temp_dir() . '/'. self::FILE; + $file = self::$cache_file; } + //use PHP engine to parse it if (file_exists($file)) { $this->classes = include $file; } - //assign to an array - if (!empty($this->classes)) { - //cache edge case of first time using apcu cache - if ($this->apcu_enabled) { - apcu_store(self::CACHE_KEY, $this->classes); - } - return true; + + //catch edge case of first time using apcu cache + if ($this->apcu_enabled) { + apcu_store(self::CACHE_KEY, $this->classes); } - return false; + + //return true when we have classes and false if the array is still empty + return !empty($this->classes); } public function reload_classes($project_path = '') { @@ -122,26 +138,87 @@ class auto_loader { $project_path = dirname(__DIR__, 2); } - //build the array of all classes - $search_path = []; - $search_path = array_merge($search_path, glob($project_path . '/resources/classes/*.php')); - $search_path = array_merge($search_path, glob($project_path . '/resources/interfaces/*.php')); - $search_path = array_merge($search_path, glob($project_path . '/resources/traits/*.php')); - $search_path = array_merge($search_path, glob($project_path . '/*/*/resources/classes/*.php')); - $search_path = array_merge($search_path, glob($project_path . '/*/*/resources/interfaces/*.php')); - $search_path = array_merge($search_path, glob($project_path . '/*/*/resources/traits/*.php')); + //build the array of all locations for classes in specific order + $search_path = [ + $project_path . '/resources/interfaces/*.php', + $project_path . '/resources/traits/*.php', + $project_path . '/resources/classes/*.php', + $project_path . '/*/*/resources/interfaces/*.php', + $project_path . '/*/*/resources/traits/*.php', + $project_path . '/*/*/resources/classes/*.php', + $project_path . '/core/authentication/resources/classes/plugins/*.php', + ]; + + //get all php files for each path + $files = []; + foreach ($search_path as $path) { + $files = array_merge($files, glob($path)); + } //reset the current array $this->classes = []; - //store the class name (key) and the path (value) - foreach ($search_path as $path) { - $this->classes[basename($path, '.php')] = $path; - } + //store PHP language declared classes, interfaces, and traits + $curr_classes = get_declared_classes(); + $curr_interfaces = get_declared_interfaces(); + $curr_traits = get_declared_traits(); + //store the class name (key) and the path (value) + foreach ($files as $file) { + + //include the new class + try { + include_once $file; + } catch (Exception $e) { + //report the error + self::log(LOG_ERR, "Exception while trying to include file '$file': " . $e->getMessage()); + continue; + } + + //get the new classes + $new_classes = get_declared_classes(); + $new_interfaces = get_declared_interfaces(); + $new_traits = get_declared_traits(); + + //check for a new class + $classes = array_diff($new_classes, $curr_classes); + if (!empty($classes)) { + foreach ($classes as $class) { + $this->classes[$class] = $file; + } + //overwrite previous array with new values + $curr_classes = $new_classes; + } + + //check for a new interface + $interfaces = array_diff($new_interfaces, $curr_interfaces); + if (!empty($interfaces)) { + foreach ($interfaces as $interface) { + $this->classes[$interface] = $file; + } + //overwrite previous array with new values + $curr_interfaces = $new_interfaces; + } + + //check for a new trait + $traits = array_diff($new_traits, $curr_traits); + if (!empty($traits)) { + foreach ($traits as $trait) { + $this->classes[$trait] = $file; + } + //overwrite previous array with new values + $curr_traits = $new_traits; + } + } } - private function loader($class_name) : bool { + /** + * The loader is set to private because only the PHP engine should be calling this method + * @param string $class_name The class name that needs to be loaded + * @return bool True if the class is loaded or false when the class is not found + * @access private + */ + private function loader($class_name): bool { //sanitize the class name $class_name = preg_replace('[^a-zA-Z0-9_]', '', $class_name); @@ -161,32 +238,29 @@ class auto_loader { } //cache miss - if (!empty($_REQUEST['debug']) && $_REQUEST['debug'] == 'true') { - openlog("PHP", LOG_PID | LOG_PERROR, LOG_LOCAL0); - syslog(LOG_WARNING, "[php][auto_loader] class not found in cache: ".$class_name); - closelog(); - } + self::log(LOG_WARNING, "class '$class_name' not found in cache"); //set project path using magic dir constant $project_path = dirname(__DIR__, 2); //build the search path array - $search_path[] = glob($project_path . "/resources/classes/".$class_name.".php"); - $search_path[] = glob($project_path . "/resources/interfaces/".$class_name.".php"); - $search_path[] = glob($project_path . "/resources/traits/".$class_name.".php"); - $search_path[] = glob($project_path . "/*/*/resources/classes/".$class_name.".php"); - $search_path[] = glob($project_path . "/*/*/resources/interfaces/".$class_name.".php"); - $search_path[] = glob($project_path . "/*/*/resources/traits/".$class_name.".php"); + $search_path[] = glob($project_path . "/resources/interfaces/" . $class_name . ".php"); + $search_path[] = glob($project_path . "/resources/traits/" . $class_name . ".php"); + $search_path[] = glob($project_path . "/resources/classes/" . $class_name . ".php"); + $search_path[] = glob($project_path . "/*/*/resources/interfaces/" . $class_name . ".php"); + $search_path[] = glob($project_path . "/*/*/resources/traits/" . $class_name . ".php"); + $search_path[] = glob($project_path . "/*/*/resources/classes/" . $class_name . ".php"); - //find the path - $path = self::autoload_search($search_path); - if (!empty($path)) { + //collapse all entries to only the matched entry + $matches = array_filter($search_path); + if (!empty($matches)) { + $path = array_pop($matches)[0]; - //include the class or interface - include $path; + //include the class, interface, or trait + include_once $path; - //make sure to reload the cache after we found a new class - $this->reload_classes(); + //inject the class in to the array + $this->classes[$class_name] = $path; //update the cache with new classes $this->update_cache(); @@ -196,35 +270,54 @@ class auto_loader { } //send to syslog when debugging - if (!empty($_REQUEST['debug']) && $_REQUEST['debug'] == 'true') { - openlog("PHP", LOG_PID | LOG_PERROR, LOG_LOCAL0); - syslog(LOG_WARNING, "[php][auto_loader] class not found name: ".$class_name); - closelog(); - } + self::log(LOG_ERR, "class '$class_name' not found name"); //return boolean return false; } - public static function autoload_search($array) : string { - foreach($array as $path) { - if (is_array($path) && count($path) != 0) { - foreach($path as $sub_path) { - if (!empty($sub_path) && file_exists($sub_path)) { - return $sub_path; - } - } - } - elseif (!empty($path) && file_exists($path)) { - return $path; - } + /** + * Returns a list of classes loaded by the auto_loader. If no classes have been loaded an empty array is returned. + * @return array List of classes loaded by the auto_loader or empty array + */ + public function get_class_list(): array { + if (!empty($this->classes)) { + return $this->classes; } - return ''; + return []; } - public static function clear_cache() { + public static function clear_cache(string $file = '') { + + //check for apcu cache if (function_exists('apcu_enabled') && apcu_enabled()) { apcu_delete(self::CACHE_KEY); } + + //set default file + if (empty(self::$cache_file)) { + self::$cache_file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . self::FILE; + } + + //set file to clear + if (empty($file)) { + $file = self::$cache_file; + } + + //remove the file when it exists + if (file_exists($file)) { + @unlink($file); + $error_array = error_get_last(); + //send to syslog when debugging with either environment variable or debug in the url + self::log(LOG_WARNING, $error_array['message'] ?? ''); + } + } + + private static function log(int $level, string $message): void { + if (filter_var($_REQUEST['debug'] ?? false, FILTER_VALIDATE_BOOL) || filter_var(getenv('DEBUG') ?? false, FILTER_VALIDATE_BOOL)) { + openlog("PHP", LOG_PID | LOG_PERROR, LOG_LOCAL0); + syslog($level, "[auto_loader] " . $message); + closelog(); + } } } diff --git a/resources/classes/button.php b/resources/classes/button.php index c82b34551b..d7786d7418 100644 --- a/resources/classes/button.php +++ b/resources/classes/button.php @@ -25,7 +25,6 @@ Mark J Crane */ -if (!class_exists('button')) { class button { public static $collapse = 'hide-md-dn'; @@ -127,7 +126,6 @@ if (!class_exists('button')) { $button = $anchor.$button.""; } return $button; - unset($button); } private static function quote($value) { @@ -135,7 +133,6 @@ if (!class_exists('button')) { } } -} /* @@ -236,5 +233,3 @@ if (!class_exists('button')) { */ - -?> \ No newline at end of file diff --git a/resources/classes/database.php b/resources/classes/database.php index f745b8a489..28ceade452 100644 --- a/resources/classes/database.php +++ b/resources/classes/database.php @@ -3279,7 +3279,7 @@ * @see database::__construct() * @see database::connect() */ - public static function new(array $params = []) { + public static function new(array $params = []): static { if (self::$database === null) { self::$database = new database($params); if (!self::$database->is_connected()) { @@ -3326,7 +3326,6 @@ /* //example usage //find - require_once "resources/classes/database.php"; $database = new database; $database->domain_uuid = $_SESSION["domain_uuid"]; $database->type = $db_type; @@ -3343,7 +3342,6 @@ $database->find(); print_r($database->result); //insert - require_once "resources/classes/database.php"; $database = new database; $database->domain_uuid = $_SESSION["domain_uuid"]; $database->table = "v_ivr_menus"; diff --git a/resources/classes/domains.php b/resources/classes/domains.php index 2875616cdd..edb1932425 100644 --- a/resources/classes/domains.php +++ b/resources/classes/domains.php @@ -28,11 +28,7 @@ /** * domains class * - * @method null delete - * @method null toggle - * @method null copy */ -if (!class_exists('domains')) { class domains { /** @@ -786,6 +782,3 @@ if (!class_exists('domains')) { } } -} - -?> diff --git a/resources/classes/email.php b/resources/classes/email.php index dc419897b0..9b046505d6 100644 --- a/resources/classes/email.php +++ b/resources/classes/email.php @@ -27,9 +27,7 @@ /** * email class * - * @method boolean send */ -if (!class_exists('email')) { class email { /** @@ -625,7 +623,7 @@ if (!class_exists('email')) { } } -} + /* $email = new email; diff --git a/resources/classes/groups.php b/resources/classes/groups.php index 2bf85c4e63..138671f38b 100644 --- a/resources/classes/groups.php +++ b/resources/classes/groups.php @@ -27,11 +27,7 @@ /** * groups class provides methods for add, delete groups, and add default groups * - * @method null delete - * @method null toggle - * @method null copy */ -if (!class_exists('groups')) { class groups { /** @@ -534,6 +530,3 @@ if (!class_exists('groups')) { $_SESSION["user"]["group_level"] = $this->group_level; } } -} - -?> \ No newline at end of file diff --git a/resources/classes/menu.php b/resources/classes/menu.php index 9df1c94320..04489265a9 100644 --- a/resources/classes/menu.php +++ b/resources/classes/menu.php @@ -27,7 +27,6 @@ /** * menu class */ -if (!class_exists('menu')) { class menu { /** @@ -1339,4 +1338,3 @@ if (!class_exists('menu')) { } } -} diff --git a/resources/classes/message.php b/resources/classes/message.php index 936f4edd46..61e017753b 100644 --- a/resources/classes/message.php +++ b/resources/classes/message.php @@ -25,7 +25,6 @@ Matthew Vale */ -if (!class_exists('message')) { class message { static function add($message, $mood = null, $delay = null) { @@ -71,6 +70,3 @@ if (!class_exists('message')) { return $html; } } -} - -?> diff --git a/resources/classes/modal.php b/resources/classes/modal.php index e5d61a9f68..0629c4fa69 100644 --- a/resources/classes/modal.php +++ b/resources/classes/modal.php @@ -25,7 +25,6 @@ Mark J Crane */ -if (!class_exists('modal')) { class modal { static function create($array) { @@ -65,11 +64,7 @@ if (!class_exists('modal')) { $modal .= "
"; return $modal; - unset($modal); } } -} - -?> \ No newline at end of file diff --git a/resources/classes/schema.php b/resources/classes/schema.php index 3ec6c2c57f..1bd01703ff 100644 --- a/resources/classes/schema.php +++ b/resources/classes/schema.php @@ -26,8 +26,6 @@ */ //define the schema class -if (!class_exists('schema')) { - class schema { //define variables @@ -473,7 +471,6 @@ if (!class_exists('schema')) { } //get the db variables - //require_once "resources/classes/config.php"; //$config = new config; //$config_exists = $config->exists(); //$config_path = $config->find(); @@ -908,13 +905,10 @@ if (!class_exists('schema')) { } //end function } -} //example use -//require_once "resources/classes/schema.php"; //$obj = new schema; //$obj->db_type = $db_type; //$obj->schema(); //$result_array = $schema->obj['sql']; //print_r($result_array); -?> diff --git a/resources/classes/switch_settings.php b/resources/classes/switch_settings.php index 3457dba41e..e1822954cc 100644 --- a/resources/classes/switch_settings.php +++ b/resources/classes/switch_settings.php @@ -5,7 +5,6 @@ * * @method settings will add missing switch directories to default settings */ -if (!class_exists('switch_settings')) { class switch_settings { public $event_socket_ip_address; @@ -276,6 +275,3 @@ if (!class_exists('switch_settings')) { unset($array); } } -} - -?> diff --git a/resources/classes/template.php b/resources/classes/template.php index 0c932163e3..3b3d2c57f4 100644 --- a/resources/classes/template.php +++ b/resources/classes/template.php @@ -25,7 +25,6 @@ */ //define the template class - if (!class_exists('template')) { class template { public $engine; @@ -90,6 +89,3 @@ } } } - } - -?> \ No newline at end of file diff --git a/resources/classes/tones.php b/resources/classes/tones.php index 397348e660..90a8f9a08d 100644 --- a/resources/classes/tones.php +++ b/resources/classes/tones.php @@ -25,7 +25,6 @@ Matthew Vale */ -if (!class_exists('tones')) { class tones { //define variables @@ -33,7 +32,7 @@ if (!class_exists('tones')) { private $music_list; private $recordings_list; private $default_tone_label; - + //class constructor public function __construct() { //add multi-lingual support @@ -61,11 +60,8 @@ if (!class_exists('tones')) { $this->tones = $tone_list ?? ''; unset($sql, $tones, $tone, $tone_list); } - + public function tones_list() { return $this->tones; } } -} - -?> diff --git a/resources/classes/xml.php b/resources/classes/xml.php index 582595f15a..ac7d883297 100644 --- a/resources/classes/xml.php +++ b/resources/classes/xml.php @@ -1,6 +1,5 @@ diff --git a/resources/switch.php b/resources/switch.php index 906942b404..fa72e0ba13 100644 --- a/resources/switch.php +++ b/resources/switch.php @@ -948,7 +948,6 @@ if (!function_exists('save_switch_xml')) { function save_switch_xml() { if (is_readable($_SESSION['switch']['extensions']['dir'])) { if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/extensions/resources/classes/extension.php")) { - require_once $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."app/extensions/resources/classes/extension.php"; $extension = new extension; $extension->xml(); } @@ -958,7 +957,6 @@ if (!function_exists('save_switch_xml')) { save_setting_xml(); } if (file_exists($_SERVER["PROJECT_ROOT"]."/app/modules/app_config.php")) { - require_once $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/modules/resources/classes/modules.php"; $module = new modules; $module->xml(); //$msg = $module->msg; diff --git a/secure/fax_to_email.php b/secure/fax_to_email.php index a4a3525ddd..50e3f282ac 100644 --- a/secure/fax_to_email.php +++ b/secure/fax_to_email.php @@ -201,9 +201,8 @@ if (!function_exists('fax_split_dtmf')) { //includes files require_once dirname(__DIR__) . "/resources/require.php"; - include "resources/classes/event_socket.php"; - include "resources/phpmailer/class.phpmailer.php"; - include "resources/phpmailer/class.smtp.php"; // optional, gets called from within class.phpmailer.php if not already loaded + include_once "resources/phpmailer/class.phpmailer.php"; + include_once "resources/phpmailer/class.smtp.php"; // optional, gets called from within class.phpmailer.php if not already loaded //set php ini values ini_set('max_execution_time', 900); //15 minutes From 7897ff5b9e64c95459415b8592d66cfc2a570b99 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 12 Mar 2025 14:42:50 -0600 Subject: [PATCH 61/73] Clear the cache --- core/upgrade/upgrade.php | 1 + 1 file changed, 1 insertion(+) diff --git a/core/upgrade/upgrade.php b/core/upgrade/upgrade.php index 7fb56cc9d0..0d999aea99 100644 --- a/core/upgrade/upgrade.php +++ b/core/upgrade/upgrade.php @@ -181,6 +181,7 @@ $auto_loader = new auto_loader(); $auto_loader->reload_classes(); $auto_loader->update_cache(); + $auto_loader->clear_cache(); //get the version of the software if ($upgrade_type == 'version') { From 31a88e3a15d7399fcf198adee00cfa4891336003 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 12 Mar 2025 14:48:33 -0600 Subject: [PATCH 62/73] Update auto_loader.php --- resources/classes/auto_loader.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/resources/classes/auto_loader.php b/resources/classes/auto_loader.php index 74aed053e7..7befa402e8 100644 --- a/resources/classes/auto_loader.php +++ b/resources/classes/auto_loader.php @@ -159,9 +159,9 @@ class auto_loader { $this->classes = []; //store PHP language declared classes, interfaces, and traits - $curr_classes = get_declared_classes(); - $curr_interfaces = get_declared_interfaces(); - $curr_traits = get_declared_traits(); + $current_classes = get_declared_classes(); + $current_interfaces = get_declared_interfaces(); + $current_traits = get_declared_traits(); //store the class name (key) and the path (value) foreach ($files as $file) { @@ -181,33 +181,33 @@ class auto_loader { $new_traits = get_declared_traits(); //check for a new class - $classes = array_diff($new_classes, $curr_classes); + $classes = array_diff($new_classes, $current_classes); if (!empty($classes)) { foreach ($classes as $class) { $this->classes[$class] = $file; } //overwrite previous array with new values - $curr_classes = $new_classes; + $current_classes = $new_classes; } //check for a new interface - $interfaces = array_diff($new_interfaces, $curr_interfaces); + $interfaces = array_diff($new_interfaces, $current_interfaces); if (!empty($interfaces)) { foreach ($interfaces as $interface) { $this->classes[$interface] = $file; } //overwrite previous array with new values - $curr_interfaces = $new_interfaces; + $current_interfaces = $new_interfaces; } //check for a new trait - $traits = array_diff($new_traits, $curr_traits); + $traits = array_diff($new_traits, $current_traits); if (!empty($traits)) { foreach ($traits as $trait) { $this->classes[$trait] = $file; } //overwrite previous array with new values - $curr_traits = $new_traits; + $current_traits = $new_traits; } } } From 95761621a661b39eba26fcf8b7cb9fd62a33d815 Mon Sep 17 00:00:00 2001 From: chansizzle <14916599+chansizzle@users.noreply.github.com> Date: Wed, 12 Mar 2025 17:39:05 -0600 Subject: [PATCH 63/73] improve emergency emailing (#7309) * improve emergency emailing 1. set emergency CID name & number to the outbound CID name & number if emergency CID name & number are not set 2. remove duplicate item in email body 3. change the hardcoded email subject '911 Emergency Call' to be dynamically provided from the event. I do not like seeing the subject '911 Emergency Call' when it is an TEST call. * improve emergency emailing 1. change the hardcoded email subject '911 Emergency Call' to be dynamically provided from the event. I do not like seeing the subject '911 Emergency Call' when it is an TEST call. 2. fix email template misspelling 3. improved email template with bold fonts --- .../resources/scripts/app/emergency/index.lua | 13 +++++++--- core/email_templates/app_defaults.php | 24 +++++++++---------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/app/switch/resources/scripts/app/emergency/index.lua b/app/switch/resources/scripts/app/emergency/index.lua index d33c5eb2a2..53c945a435 100644 --- a/app/switch/resources/scripts/app/emergency/index.lua +++ b/app/switch/resources/scripts/app/emergency/index.lua @@ -118,13 +118,18 @@ if (session and session:ready()) then sip_from_user = session:getVariable("sip_from_user"); emergency_caller_id_name = session:getVariable("emergency_caller_id_name"); emergency_caller_id_number = session:getVariable("emergency_caller_id_number"); + outbound_caller_id_name = session:getVariable("outbound_caller_id_name"); outbound_caller_id_number = session:getVariable("outbound_caller_id_number"); destination_number = session:getVariable("destination_number"); end --set the defaults -if (not emergency_caller_id_name) then emergency_caller_id_name = ''; end -if (not emergency_caller_id_number) then emergency_caller_id_number = '' end +if (not emergency_caller_id_name or emergency_caller_id_name == '') then + emergency_caller_id_name = outbound_caller_id_name +end +if (not emergency_caller_id_number or emergency_caller_id_number == '') then + emergency_caller_id_number = outbound_caller_id_number +end --no emergency emails found under domain, using default local sql = "SELECT default_setting_value "; @@ -181,6 +186,9 @@ end local t = dbh:first_row(sql); call_date = t.call_date; +-- replace the hardcoded template subject with the event +subject = event; + --send the email if (#to > 0) then --prepare the body @@ -190,7 +198,6 @@ if (#to > 0) then body = body:gsub("${emergency_caller_id_name}", emergency_caller_id_name); body = body:gsub("${emergency_caller_id_number}", emergency_caller_id_number); body = body:gsub("${sip_from_user}", sip_from_user); - body = body:gsub("${caller_id_number}", caller_id_number); body = body:gsub("${message_date}", call_date); body = body:gsub("${event}", event); body = trim(body); diff --git a/core/email_templates/app_defaults.php b/core/email_templates/app_defaults.php index de95aa70ab..f3280dd25d 100644 --- a/core/email_templates/app_defaults.php +++ b/core/email_templates/app_defaults.php @@ -510,15 +510,15 @@ $array['email_templates'][$x]['template_language'] = 'en-gb'; $array['email_templates'][$x]['template_category'] = 'plugin'; $array['email_templates'][$x]['template_subcategory'] = 'emergency'; - $array['email_templates'][$x]['template_subject'] = '911 Emergency Call'; + $array['email_templates'][$x]['template_subject'] = '\${event}'; $array['email_templates'][$x]['template_body'] = "\n"; $array['email_templates'][$x]['template_body'] .= "\n"; - $array['email_templates'][$x]['template_body'] .= "From \${caller_id_name} \${caller_id_number}
\n"; + $array['email_templates'][$x]['template_body'] .= "From: \${caller_id_name} \${caller_id_number}
\n"; $array['email_templates'][$x]['template_body'] .= "
\n"; - $array['email_templates'][$x]['template_body'] .= "Emergency Name \${emergency_caller_id_name}
\n"; - $array['email_templates'][$x]['template_body'] .= "Emergency Name \${emergency_caller_id_number}
\n"; - $array['email_templates'][$x]['template_body'] .= "Received \${message_date}
\n"; - $array['email_templates'][$x]['template_body'] .= "Event \${event}
\n"; + $array['email_templates'][$x]['template_body'] .= "Emergency Name: \${emergency_caller_id_name}
\n"; + $array['email_templates'][$x]['template_body'] .= "Emergency Number: \${emergency_caller_id_number}
\n"; + $array['email_templates'][$x]['template_body'] .= "Received: \${message_date}
\n"; + $array['email_templates'][$x]['template_body'] .= "Event: \${event}
\n"; $array['email_templates'][$x]['template_body'] .= "\n"; $array['email_templates'][$x]['template_body'] .= "\n"; $array['email_templates'][$x]['template_type'] = 'html'; @@ -530,15 +530,15 @@ $array['email_templates'][$x]['template_language'] = 'en-us'; $array['email_templates'][$x]['template_category'] = 'plugin'; $array['email_templates'][$x]['template_subcategory'] = 'emergency'; - $array['email_templates'][$x]['template_subject'] = '911 Emergency Call'; + $array['email_templates'][$x]['template_subject'] = '\${event}'; $array['email_templates'][$x]['template_body'] = "\n"; $array['email_templates'][$x]['template_body'] .= "\n"; - $array['email_templates'][$x]['template_body'] .= "From \${caller_id_name} \${caller_id_number}
\n"; + $array['email_templates'][$x]['template_body'] .= "From: \${caller_id_name} \${caller_id_number}
\n"; $array['email_templates'][$x]['template_body'] .= "
\n"; - $array['email_templates'][$x]['template_body'] .= "Emergency Name \${emergency_caller_id_name}
\n"; - $array['email_templates'][$x]['template_body'] .= "Emergency Name \${emergency_caller_id_number}
\n"; - $array['email_templates'][$x]['template_body'] .= "Received \${message_date}
\n"; - $array['email_templates'][$x]['template_body'] .= "Event \${event}
\n"; + $array['email_templates'][$x]['template_body'] .= "Emergency Name: \${emergency_caller_id_name}
\n"; + $array['email_templates'][$x]['template_body'] .= "Emergency Number: \${emergency_caller_id_number}
\n"; + $array['email_templates'][$x]['template_body'] .= "Received: \${message_date}
\n"; + $array['email_templates'][$x]['template_body'] .= "Event: \${event}
\n"; $array['email_templates'][$x]['template_body'] .= "\n"; $array['email_templates'][$x]['template_body'] .= "\n"; $array['email_templates'][$x]['template_type'] = 'html'; From bed7c8827f663bbcaa216c0d0fa02817e0826f9c Mon Sep 17 00:00:00 2001 From: frytimo Date: Wed, 12 Mar 2025 23:50:14 -0300 Subject: [PATCH 64/73] fix missing quotes on parameter default value (#7310) --- resources/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/functions.php b/resources/functions.php index cc791db9df..43b4219938 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -2118,7 +2118,7 @@ //define email button (src: https://buttons.cm) if (!function_exists('email_button')) { - function email_button($text = 'Click Here!', $link = URL, $bg_color = '#dddddd', $fg_color = '#000000', $radius = '') { + function email_button($text = 'Click Here!', $link = 'URL', $bg_color = '#dddddd', $fg_color = '#000000', $radius = '') { // default button radius $radius = !empty($radius) ? $radius : '3px'; From 6c6814b29e22b3c93b7d8e73342fcf0f22c78c5c Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 12 Mar 2025 23:39:24 -0600 Subject: [PATCH 65/73] Remove syntax that breaks older PHP Removed :static to support PHP 7.4 --- resources/classes/database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/classes/database.php b/resources/classes/database.php index 28ceade452..692dcb56cd 100644 --- a/resources/classes/database.php +++ b/resources/classes/database.php @@ -3279,7 +3279,7 @@ * @see database::__construct() * @see database::connect() */ - public static function new(array $params = []): static { + public static function new(array $params = []) { if (self::$database === null) { self::$database = new database($params); if (!self::$database->is_connected()) { From ee28c6d2039c4079eabed70b972330adecda3882 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Thu, 13 Mar 2025 10:06:36 -0600 Subject: [PATCH 66/73] Fix Call Detail Records with invalid xml --- app/xml_cdr/resources/classes/xml_cdr.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index 432570f92d..58047adfd4 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -339,6 +339,12 @@ //replace xml tag name with $xml_string = preg_replace('/(<\/?)(set )([^>]*>)/', '$1$3', $xml_string); + //replace xml tag name <^^,default_language> with + $xml_string = preg_replace('/(<\/?)(\^\^,)([^>]*>)/', '$1$3', $xml_string); + + //replace xml tag name with + $xml_string = preg_replace('/(<\/?)(nolocal:)([^>]*>)/', '$1$3', $xml_string); + //disable xml entities if (PHP_VERSION_ID < 80000) { libxml_disable_entity_loader(true); } From b5592e84c79d7255e6a2842771525d8cf29ff593 Mon Sep 17 00:00:00 2001 From: Alex <40072887+alexdcrane@users.noreply.github.com> Date: Thu, 13 Mar 2025 10:04:40 -0700 Subject: [PATCH 67/73] Fix fatal error on fax send (#7313) --- app/fax/fax_send.php | 83 +++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 44 deletions(-) diff --git a/app/fax/fax_send.php b/app/fax/fax_send.php index 9c6b59e9f7..a3918a49d5 100644 --- a/app/fax/fax_send.php +++ b/app/fax/fax_send.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2024 + Portions created by the Initial Developer are Copyright (C) 2008-2025 the Initial Developer. All Rights Reserved. Contributor(s): @@ -36,7 +36,7 @@ if (defined('STDIN')) { //add multi-lingual support $language = new text; - $text = $language->get($setting->get('domain','language','en-us'), 'app/fax'); + $text = $language->get($settings->get('domain','language','en-us'), 'app/fax'); } //executed via browser @@ -51,11 +51,6 @@ else { $domain_name = $_SESSION['domain_name']; $user_uuid = $_SESSION['user_uuid']; - //initialize the settings object - if (empty($settings)) { - $setting = new settings(["domain_uuid" => $domain_uuid]); - } - //check permissions if (permission_exists('fax_send')) { //access granted @@ -121,12 +116,12 @@ else { } //set the fax directory - if (!empty($setting->get('switch','storage'))) { - $fax_dir = $setting->get('switch','storage').'/fax/'.$domain_name; + if (!empty($settings->get('switch','storage'))) { + $fax_dir = $settings->get('switch','storage').'/fax/'.$domain_name; } //set fax cover font to generate pdf - $fax_cover_font = $setting->get('fax','cover_font') ?? null; + $fax_cover_font = $settings->get('fax','cover_font') ?? null; } //define function correct_path @@ -171,14 +166,14 @@ if (!function_exists('fax_split_dtmf')) { $dir_fax_temp = $fax_dir.'/'.$fax_extension.'/temp'; //make sure the directories exist - if (!empty($setting->get('switch','storage')) && !is_dir($setting->get('switch','storage'))) { - mkdir($setting->get('switch','storage'), 0770); + if (!empty($settings->get('switch','storage')) && !is_dir($settings->get('switch','storage'))) { + mkdir($settings->get('switch','storage'), 0770); } - if (!empty($setting->get('switch','storage')) && !is_dir($setting->get('switch','storage').'/fax')) { - mkdir($setting->get('switch','storage').'/fax', 0770); + if (!empty($settings->get('switch','storage')) && !is_dir($settings->get('switch','storage').'/fax')) { + mkdir($settings->get('switch','storage').'/fax', 0770); } - if (!empty($setting->get('switch','storage')) && !is_dir($setting->get('switch','storage').'/fax/'.$domain_name)) { - mkdir($setting->get('switch','storage').'/fax/'.$domain_name, 0770); + if (!empty($settings->get('switch','storage')) && !is_dir($settings->get('switch','storage').'/fax/'.$domain_name)) { + mkdir($settings->get('switch','storage').'/fax/'.$domain_name, 0770); } if (!is_dir($fax_dir.'/'.$fax_extension)) { mkdir($fax_dir.'/'.$fax_extension, 0770); @@ -301,7 +296,7 @@ if (!function_exists('fax_split_dtmf')) { } //un/authorized file extensions - $allowed_file_extensions = $setting->get('fax','allowed_extension'); + $allowed_file_extensions = $settings->get('fax','allowed_extension'); $disallowed_file_extensions = explode(',','sh,ssh,so,dll,exe,bat,vbs,zip,rar,z,tar,tbz,tgz,gz'); //process uploaded or emailed files (if any) @@ -410,19 +405,19 @@ if (!function_exists('fax_split_dtmf')) { //logo $display_logo = false; - if (empty($setting->get('fax','cover_logo'))) { + if (empty($settings->get('fax','cover_logo'))) { $logo = ''; //explicitly empty } - else if ($setting->get('fax','cover_logo') != '') { - if (substr($setting->get('fax','cover_logo'), 0, 4) == 'http') { - $logo = $setting->get('fax','cover_logo'); + else if ($settings->get('fax','cover_logo') != '') { + if (substr($settings->get('fax','cover_logo'), 0, 4) == 'http') { + $logo = $settings->get('fax','cover_logo'); } - else if (substr($setting->get('fax','cover_logo'), 0, 1) == '/') { - if (substr($setting->get('fax','cover_logo'), 0, strlen($_SERVER['DOCUMENT_ROOT'])) != $_SERVER['DOCUMENT_ROOT']) { - $logo = $_SERVER['DOCUMENT_ROOT'].$setting->get('fax','cover_logo'); + else if (substr($settings->get('fax','cover_logo'), 0, 1) == '/') { + if (substr($settings->get('fax','cover_logo'), 0, strlen($_SERVER['DOCUMENT_ROOT'])) != $_SERVER['DOCUMENT_ROOT']) { + $logo = $_SERVER['DOCUMENT_ROOT'].$settings->get('fax','cover_logo'); } else { - $logo = $setting->get('fax','cover_logo'); + $logo = $settings->get('fax','cover_logo'); } } } @@ -497,7 +492,7 @@ if (!function_exists('fax_split_dtmf')) { $pdf->SetFont($pdf_font, "", 12); $pdf->SetXY($x + 2.0, $y + 1.65); if (defined('STDIN') || ($_REQUEST['submit'] != '' && $_REQUEST['submit'] != 'preview')) { - $date = new DateTime('now', new DateTimeZone( $setting->get('domain','time_zone', date_default_timezone_get() ) )); + $date = new DateTime('now', new DateTimeZone( $settings->get('domain','time_zone', date_default_timezone_get() ) )); $pdf->Write(0.3, $date->format('d M Y @ h:i:s A')); } $pdf->SetXY($x + 2.0, $y + 1.95); @@ -569,7 +564,7 @@ if (!function_exists('fax_split_dtmf')) { } else { //determine cover message box height, and difference, to adjust footer position accordingly - $cover_message_height = $setting->get('fax','cover_message_height'); + $cover_message_height = $settings->get('fax','cover_message_height'); $cover_message_height = (float) ($cover_message_height ?? 6.15); $height_difference = 6.15 - $cover_message_height; @@ -677,7 +672,7 @@ if (!function_exists('fax_split_dtmf')) { } //prepare variables send the fax - $mail_from_address = (!empty($setting->get('fax','smtp_from'))) ? $setting->get('fax','smtp_from') : $setting->get('email','smtp_from'); + $mail_from_address = (!empty($settings->get('fax','smtp_from'))) ? $settings->get('fax','smtp_from') : $settings->get('email','smtp_from'); //get the fax mail to address and fax prefix $sql = "select * from v_fax where fax_uuid = :fax_uuid "; @@ -805,7 +800,7 @@ if (!function_exists('fax_split_dtmf')) { //send the external call $fax_variables = ''; - foreach($setting->get('fax','variable') as $variable) { + foreach($settings->get('fax','variable') as $variable) { $fax_variables .= $variable.","; } } @@ -897,7 +892,7 @@ if (!defined('STDIN')) { $sql .= "and cp.phone_type_fax = 1 "; $sql .= "and cp.phone_number is not null "; $sql .= "and cp.phone_number <> '' "; - if ($setting->get('contact','permissions', false)) { + if ($settings->get('contact','permissions', false)) { if (is_array($user_group_uuids) && @sizeof($user_group_uuids) != 0) { //only show contacts assigned to current user's group(s) and those not assigned to any group $sql .= "and ("; @@ -1013,7 +1008,7 @@ if (!defined('STDIN')) { echo "
\n"; echo "
".$text['header-new_fax']."
\n"; echo "
\n"; - echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$setting->get('theme','button_icon_back'),'id'=>'btn_back','style'=>'margin-right: 15px;','link'=>'fax.php']); + echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$settings->get('theme','button_icon_back'),'id'=>'btn_back','style'=>'margin-right: 15px;','link'=>'fax.php']); if ($domain_enabled == true) { echo button::create(['type'=>'submit','label'=>$text['button-preview'],'icon'=>'eye','name'=>'submit','value'=>'preview']); echo button::create(['type'=>'submit','label'=>$text['button-send'],'icon'=>'paper-plane','id'=>'btn_save','name'=>'submit','value'=>'send','style'=>'margin-left: 15px;']); @@ -1036,7 +1031,7 @@ if (!defined('STDIN')) { echo " ".$text['label-fax-header']."\n"; echo "
\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo " ".$text['description-fax-header']."\n"; echo "
\n"; echo " \n"; echo "
\n"; echo " ".$text['description-fax-resolution']."\n"; @@ -1134,9 +1129,9 @@ if (!defined('STDIN')) { echo "
\n"; echo " \n"; echo "
\n"; echo " ".$text['description-fax-page-size']."\n"; @@ -1144,7 +1139,7 @@ if (!defined('STDIN')) { echo "
\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo " ".$text['description-fax-message']."\n"; echo "
\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo " ".$text['description-fax-footer']."\n"; echo "
".$text['label-caller_destination']."".$text['label-caller_destination']."".$row['extension']." ".escape($row['extension_name'])."".$row['extension']." ".escape($row['extension_name'])."