mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 03:33:49 +00:00
Remove dreprecated app/messages
This commit is contained in:
@@ -1,268 +0,0 @@
|
||||
<?php
|
||||
|
||||
//application details
|
||||
$apps[$x]['name'] = 'Messages';
|
||||
$apps[$x]['uuid'] = '4a20815d-042c-47c8-85df-085333e79b87';
|
||||
$apps[$x]['category'] = '';
|
||||
$apps[$x]['subcategory'] = '';
|
||||
$apps[$x]['version'] = '';
|
||||
$apps[$x]['license'] = 'Mozilla Public License 1.1';
|
||||
$apps[$x]['url'] = 'http://www.fusionpbx.com';
|
||||
$apps[$x]['description']['en-us'] = '';
|
||||
$apps[$x]['description']['en-gb'] = '';
|
||||
|
||||
//permission details
|
||||
$y = 0;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'message_view';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'message_add';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'message_edit';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'message_delete';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'message_all';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'message_media_view';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'message_media_add';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'message_media_edit';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'message_media_delete';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'message_key';
|
||||
//$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
$y++;
|
||||
|
||||
//messages table
|
||||
$y = 0;
|
||||
$apps[$x]['db'][$y]['table']['name'] = 'v_messages';
|
||||
$apps[$x]['db'][$y]['table']['parent'] = '';
|
||||
$z = 0;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'user_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_users';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'user_uuid';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'contact_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_contacts';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'contact_uuid';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_type';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the message type.';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_direction';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the message direction.';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_date';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'timestamptz';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'date';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'timestamp';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the message date.';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_from';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the message from.';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_to';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the message to.';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the message text.';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_json';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
|
||||
|
||||
//message media table
|
||||
$y++;
|
||||
$apps[$x]['db'][$y]['table']['name'] = 'v_message_media';
|
||||
$apps[$x]['db'][$y]['table']['parent'] = 'v_messages';
|
||||
$z = 0;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_media_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_messages';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'message_uuid';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'user_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_users';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'user_uuid';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_media_type';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the message media type.';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_media_url';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the message media url.';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_media_content';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the message media content.';
|
||||
$z++;
|
||||
|
||||
|
||||
//default settings
|
||||
$y=0;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "e26545ef-8609-4bb8-b491-fd2835a56008";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "message";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "http_method";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "POST";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "HTTP method type: POST or GET";
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "7852ec0c-8fca-4c3b-9339-cd9235a0c2be";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "message";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "http_content_type";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "application/json";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Content type for the message content from the Provider API.";
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "5964ad4f-8cdd-4181-b944-d24baa4f925f";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "message";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "http_destination";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "URL for the REST API.";
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "306213fd-5a9e-466d-ab06-63f9fef532d0";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "message";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "http_auth_enabled";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = "boolean";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "true";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "HTTP authentication enabled: true or false";
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "c950b84e-d238-428b-824c-12641e83f68c";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "message";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "http_auth_type";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "basic";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "HTTP authentication type: basic or digest";
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "e9c4a101-9c51-4bbb-aadc-f6a8a467cd97";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "message";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "http_auth_user";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "HTTP authentication username.";
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "f3db9a8e-67de-4375-8634-1a1d526fec5e";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "message";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "http_auth_password";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "HTTP Authentication password.";
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "882007e2-582a-47d6-a830-139c59888ae9";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "message";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "display_last";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "25 messages";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Define the maximum messages, or past time frame of messages, loaded for display.";
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "8c944025-f199-440f-be34-c36ce545809a";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "message";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "refresh_contacts";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "10";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Define how often (in SECONDS) the list of numbers/Contacts is refreshed.";
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "ba8fd4dd-bd0d-40cc-8f7e-b509107a414b";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "message";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "refresh_thread";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "5";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Define how often (in SECONDS) the list of messages in a displayed thread is refreshed.";
|
||||
|
||||
?>
|
||||
@@ -1,52 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2018
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//process this code online once
|
||||
if ($domains_processed == 1) {
|
||||
|
||||
//update default settings
|
||||
$sql = "update v_default_settings set ";
|
||||
$sql .= "default_setting_name = 'text' ";
|
||||
$sql .= "where default_setting_category = 'message' ";
|
||||
$sql .= "and default_setting_subcategory = 'http_auth_password' ";
|
||||
$sql .= "and default_setting_name = 'array' ";
|
||||
$database = new database;
|
||||
$database->execute($sql);
|
||||
unset($sql);
|
||||
|
||||
//update domain settings
|
||||
$sql = "update v_domain_settings set ";
|
||||
$sql .= "domain_setting_name = 'text' ";
|
||||
$sql .= "where domain_setting_category = 'message' ";
|
||||
$sql .= "and domain_setting_subcategory = 'http_auth_password' ";
|
||||
$sql .= "and domain_setting_name = 'array' ";
|
||||
$database = new database;
|
||||
$database->execute($sql);
|
||||
unset($sql);
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,874 +0,0 @@
|
||||
<?php
|
||||
|
||||
//Messages
|
||||
$text['title-messages']['en-us'] = 'Messages';
|
||||
$text['title-messages']['en-gb'] = 'Messages';
|
||||
$text['title-messages']['ar-eg'] = 'Messages';
|
||||
$text['title-messages']['de-at'] = 'Messages';
|
||||
$text['title-messages']['de-ch'] = 'Messages';
|
||||
$text['title-messages']['de-de'] = 'Messages';
|
||||
$text['title-messages']['es-cl'] = 'Messages';
|
||||
$text['title-messages']['es-mx'] = 'Messages';
|
||||
$text['title-messages']['fr-ca'] = 'Messages';
|
||||
$text['title-messages']['fr-fr'] = 'Messages';
|
||||
$text['title-messages']['he-il'] = 'Messages';
|
||||
$text['title-messages']['it-it'] = 'Messages';
|
||||
$text['title-messages']['nl-nl'] = 'Boodschappen';
|
||||
$text['title-messages']['pl-pl'] = 'Messages';
|
||||
$text['title-messages']['pt-br'] = 'Messages';
|
||||
$text['title-messages']['pt-pt'] = 'Messages';
|
||||
$text['title-messages']['ro-ro'] = 'Messages';
|
||||
$text['title-messages']['ru-ru'] = 'Messages';
|
||||
$text['title-messages']['sv-se'] = 'Messages';
|
||||
$text['title-messages']['uk-ua'] = 'Messages';
|
||||
|
||||
$text['title-message']['en-us'] = 'Message';
|
||||
$text['title-message']['en-gb'] = 'Message';
|
||||
$text['title-message']['ar-eg'] = 'Message';
|
||||
$text['title-message']['de-at'] = 'Message';
|
||||
$text['title-message']['de-ch'] = 'Message';
|
||||
$text['title-message']['de-de'] = 'Message';
|
||||
$text['title-message']['es-cl'] = 'Message';
|
||||
$text['title-message']['es-mx'] = 'Message';
|
||||
$text['title-message']['fr-ca'] = 'Message';
|
||||
$text['title-message']['fr-fr'] = 'Message';
|
||||
$text['title-message']['he-il'] = 'Message';
|
||||
$text['title-message']['it-it'] = 'Message';
|
||||
$text['title-message']['nl-nl'] = 'Boodschap';
|
||||
$text['title-message']['pl-pl'] = 'Message';
|
||||
$text['title-message']['pt-br'] = 'Message';
|
||||
$text['title-message']['pt-pt'] = 'Message';
|
||||
$text['title-message']['ro-ro'] = 'Message';
|
||||
$text['title-message']['ru-ru'] = 'Message';
|
||||
$text['title-message']['sv-se'] = 'Message';
|
||||
$text['title-message']['uk-ua'] = 'Message';
|
||||
|
||||
$text['title-message_log']['en-us'] = 'Message Log';
|
||||
$text['title-message_log']['en-gb'] = 'Message Log';
|
||||
$text['title-message_log']['ar-eg'] = 'Message Log';
|
||||
$text['title-message_log']['de-at'] = 'Message Log';
|
||||
$text['title-message_log']['de-ch'] = 'Message Log';
|
||||
$text['title-message_log']['de-de'] = 'Message Log';
|
||||
$text['title-message_log']['es-cl'] = 'Message Log';
|
||||
$text['title-message_log']['es-mx'] = 'Message Log';
|
||||
$text['title-message_log']['fr-ca'] = 'Message Log';
|
||||
$text['title-message_log']['fr-fr'] = 'Message Log';
|
||||
$text['title-message_log']['he-il'] = 'Message Log';
|
||||
$text['title-message_log']['it-it'] = 'Message Log';
|
||||
$text['title-message_log']['nl-nl'] = 'Boodschap log';
|
||||
$text['title-message_log']['pl-pl'] = 'Message Log';
|
||||
$text['title-message_log']['pt-br'] = 'Message Log';
|
||||
$text['title-message_log']['pt-pt'] = 'Message Log';
|
||||
$text['title-message_log']['ro-ro'] = 'Message Log';
|
||||
$text['title-message_log']['ru-ru'] = 'Message Log';
|
||||
$text['title-message_log']['sv-se'] = 'Message Log';
|
||||
$text['title-message_log']['uk-ua'] = 'Message Log';
|
||||
|
||||
$text['label-message_type']['en-us'] = 'Type';
|
||||
$text['label-message_type']['en-gb'] = 'Type';
|
||||
$text['label-message_type']['ar-eg'] = 'Type';
|
||||
$text['label-message_type']['de-at'] = 'Type';
|
||||
$text['label-message_type']['de-ch'] = 'Type';
|
||||
$text['label-message_type']['de-de'] = 'Type';
|
||||
$text['label-message_type']['es-cl'] = 'Type';
|
||||
$text['label-message_type']['es-mx'] = 'Type';
|
||||
$text['label-message_type']['fr-ca'] = 'Type';
|
||||
$text['label-message_type']['fr-fr'] = 'Type';
|
||||
$text['label-message_type']['he-il'] = 'Type';
|
||||
$text['label-message_type']['it-it'] = 'Type';
|
||||
$text['label-message_type']['nl-nl'] = 'Type';
|
||||
$text['label-message_type']['pl-pl'] = 'Type';
|
||||
$text['label-message_type']['pt-br'] = 'Type';
|
||||
$text['label-message_type']['pt-pt'] = 'Type';
|
||||
$text['label-message_type']['ro-ro'] = 'Type';
|
||||
$text['label-message_type']['ru-ru'] = 'Type';
|
||||
$text['label-message_type']['sv-se'] = 'Type';
|
||||
$text['label-message_type']['uk-ua'] = 'Type';
|
||||
|
||||
$text['description-message_type']['en-us'] = 'Enter the message type.';
|
||||
$text['description-message_type']['en-gb'] = 'Enter the message type.';
|
||||
$text['description-message_type']['ar-eg'] = 'Enter the message type.';
|
||||
$text['description-message_type']['de-at'] = 'Enter the message type.';
|
||||
$text['description-message_type']['de-ch'] = 'Enter the message type.';
|
||||
$text['description-message_type']['de-de'] = 'Enter the message type.';
|
||||
$text['description-message_type']['es-cl'] = 'Enter the message type.';
|
||||
$text['description-message_type']['es-mx'] = 'Enter the message type.';
|
||||
$text['description-message_type']['fr-ca'] = 'Enter the message type.';
|
||||
$text['description-message_type']['fr-fr'] = 'Enter the message type.';
|
||||
$text['description-message_type']['he-il'] = 'Enter the message type.';
|
||||
$text['description-message_type']['it-it'] = 'Enter the message type.';
|
||||
$text['description-message_type']['nl-nl'] = 'Voer boodschap type in.';
|
||||
$text['description-message_type']['pl-pl'] = 'Enter the message type.';
|
||||
$text['description-message_type']['pt-br'] = 'Enter the message type.';
|
||||
$text['description-message_type']['pt-pt'] = 'Enter the message type.';
|
||||
$text['description-message_type']['ro-ro'] = 'Enter the message type.';
|
||||
$text['description-message_type']['ru-ru'] = 'Enter the message type.';
|
||||
$text['description-message_type']['sv-se'] = 'Enter the message type.';
|
||||
$text['description-message_type']['uk-ua'] = 'Enter the message type.';
|
||||
|
||||
$text['label-sms']['en-us'] = 'SMS';
|
||||
$text['label-sms']['en-gb'] = 'SMS';
|
||||
$text['label-sms']['ar-eg'] = 'SMS';
|
||||
$text['label-sms']['de-at'] = 'SMS';
|
||||
$text['label-sms']['de-ch'] = 'SMS';
|
||||
$text['label-sms']['de-de'] = 'SMS';
|
||||
$text['label-sms']['es-mx'] = 'SMS';
|
||||
$text['label-sms']['fr-ca'] = 'SMS';
|
||||
$text['label-sms']['fr-fr'] = 'SMS';
|
||||
$text['label-sms']['he-il'] = 'SMS';
|
||||
$text['label-sms']['it-it'] = 'SMS';
|
||||
$text['label-sms']['nl-nl'] = 'SMS';
|
||||
$text['label-sms']['pl-pl'] = 'SMS';
|
||||
$text['label-sms']['pt-br'] = 'SMS';
|
||||
$text['label-sms']['pt-pt'] = 'SMS';
|
||||
$text['label-sms']['ro-ro'] = 'SMS';
|
||||
$text['label-sms']['ru-ru'] = 'SMS';
|
||||
$text['label-sms']['sv-se'] = 'SMS';
|
||||
$text['label-sms']['uk-ua'] = 'SMS';
|
||||
|
||||
$text['label-mms']['en-us'] = 'MMS';
|
||||
$text['label-mms']['en-gb'] = 'MMS';
|
||||
$text['label-mms']['ar-eg'] = 'MMS';
|
||||
$text['label-mms']['de-at'] = 'MMS';
|
||||
$text['label-mms']['de-ch'] = 'MMS';
|
||||
$text['label-mms']['de-de'] = 'MMS';
|
||||
$text['label-mms']['es-mx'] = 'MMS';
|
||||
$text['label-mms']['fr-ca'] = 'MMS';
|
||||
$text['label-mms']['fr-fr'] = 'MMS';
|
||||
$text['label-mms']['he-il'] = 'MMS';
|
||||
$text['label-mms']['it-it'] = 'MMS';
|
||||
$text['label-mms']['nl-nl'] = 'MMS';
|
||||
$text['label-mms']['pl-pl'] = 'MMS';
|
||||
$text['label-mms']['pt-br'] = 'MMS';
|
||||
$text['label-mms']['pt-pt'] = 'MMS';
|
||||
$text['label-mms']['ro-ro'] = 'MMS';
|
||||
$text['label-mms']['ru-ru'] = 'MMS';
|
||||
$text['label-mms']['sv-se'] = 'MMS';
|
||||
$text['label-mms']['uk-ua'] = 'MMS';
|
||||
|
||||
$text['label-sms']['en-us'] = 'SMS';
|
||||
$text['label-sms']['en-gb'] = 'SMS';
|
||||
$text['label-sms']['ar-eg'] = 'SMS';
|
||||
$text['label-sms']['de-at'] = 'SMS';
|
||||
$text['label-sms']['de-ch'] = 'SMS';
|
||||
$text['label-sms']['de-de'] = 'SMS';
|
||||
$text['label-sms']['es-mx'] = 'SMS';
|
||||
$text['label-sms']['fr-ca'] = 'SMS';
|
||||
$text['label-sms']['fr-fr'] = 'SMS';
|
||||
$text['label-sms']['he-il'] = 'SMS';
|
||||
$text['label-sms']['it-it'] = 'SMS';
|
||||
$text['label-sms']['nl-nl'] = 'SMS';
|
||||
$text['label-sms']['pl-pl'] = 'SMS';
|
||||
$text['label-sms']['pt-br'] = 'SMS';
|
||||
$text['label-sms']['pt-pt'] = 'SMS';
|
||||
$text['label-sms']['ro-ro'] = 'SMS';
|
||||
$text['label-sms']['ru-ru'] = 'SMS';
|
||||
$text['label-sms']['sv-se'] = 'SMS';
|
||||
$text['label-sms']['uk-ua'] = 'SMS';
|
||||
|
||||
$text['label-sip']['en-us'] = 'SIP';
|
||||
$text['label-sip']['en-gb'] = 'SIP';
|
||||
$text['label-sip']['ar-eg'] = 'SIP';
|
||||
$text['label-sip']['de-at'] = 'SIP';
|
||||
$text['label-sip']['de-ch'] = 'SIP';
|
||||
$text['label-sip']['de-de'] = 'SIP';
|
||||
$text['label-sip']['es-mx'] = 'SIP';
|
||||
$text['label-sip']['fr-ca'] = 'SIP';
|
||||
$text['label-sip']['fr-fr'] = 'SIP';
|
||||
$text['label-sip']['he-il'] = 'SIP';
|
||||
$text['label-sip']['it-it'] = 'SIP';
|
||||
$text['label-sip']['nl-nl'] = 'SIP';
|
||||
$text['label-sip']['pl-pl'] = 'SIP';
|
||||
$text['label-sip']['pt-br'] = 'SIP';
|
||||
$text['label-sip']['pt-pt'] = 'SIP';
|
||||
$text['label-sip']['ro-ro'] = 'SIP';
|
||||
$text['label-sip']['ru-ru'] = 'SIP';
|
||||
$text['label-sip']['sv-se'] = 'SIP';
|
||||
$text['label-sip']['uk-ua'] = 'SIP';
|
||||
|
||||
$text['label-chat']['en-us'] = 'Chat';
|
||||
$text['label-chat']['en-gb'] = 'Chat';
|
||||
$text['label-chat']['ar-eg'] = 'Chat';
|
||||
$text['label-chat']['de-at'] = 'Chat';
|
||||
$text['label-chat']['de-ch'] = 'Chat';
|
||||
$text['label-chat']['de-de'] = 'Chat';
|
||||
$text['label-chat']['es-mx'] = 'Chat';
|
||||
$text['label-chat']['fr-ca'] = 'Chat';
|
||||
$text['label-chat']['fr-fr'] = 'Chat';
|
||||
$text['label-chat']['he-il'] = 'Chat';
|
||||
$text['label-chat']['it-it'] = 'Chat';
|
||||
$text['label-chat']['nl-nl'] = 'Chat';
|
||||
$text['label-chat']['pl-pl'] = 'Chat';
|
||||
$text['label-chat']['pt-br'] = 'Chat';
|
||||
$text['label-chat']['pt-pt'] = 'Chat';
|
||||
$text['label-chat']['ro-ro'] = 'Chat';
|
||||
$text['label-chat']['ru-ru'] = 'Chat';
|
||||
$text['label-chat']['sv-se'] = 'Chat';
|
||||
$text['label-chat']['uk-ua'] = 'Chat';
|
||||
|
||||
$text['label-message']['en-us'] = 'Message';
|
||||
$text['label-message']['en-gb'] = 'Message';
|
||||
$text['label-message']['ar-eg'] = 'Message';
|
||||
$text['label-message']['de-at'] = 'Message';
|
||||
$text['label-message']['de-ch'] = 'Message';
|
||||
$text['label-message']['de-de'] = 'Message';
|
||||
$text['label-message']['es-mx'] = 'Message';
|
||||
$text['label-message']['fr-ca'] = 'Message';
|
||||
$text['label-message']['fr-fr'] = 'Message';
|
||||
$text['label-message']['he-il'] = 'Message';
|
||||
$text['label-message']['it-it'] = 'Message';
|
||||
$text['label-message']['nl-nl'] = 'Boodschap';
|
||||
$text['label-message']['pl-pl'] = 'Message';
|
||||
$text['label-message']['pt-br'] = 'Message';
|
||||
$text['label-message']['pt-pt'] = 'Message';
|
||||
$text['label-message']['ro-ro'] = 'Message';
|
||||
$text['label-message']['ru-ru'] = 'Message';
|
||||
$text['label-message']['sv-se'] = 'Message';
|
||||
$text['label-message']['uk-ua'] = 'Message';
|
||||
|
||||
$text['label-messages']['en-us'] = 'Messages';
|
||||
$text['label-messages']['en-gb'] = 'Messages';
|
||||
$text['label-messages']['ar-eg'] = 'Messages';
|
||||
$text['label-messages']['de-at'] = 'Messages';
|
||||
$text['label-messages']['de-ch'] = 'Messages';
|
||||
$text['label-messages']['de-de'] = 'Messages';
|
||||
$text['label-messages']['es-mx'] = 'Messages';
|
||||
$text['label-messages']['fr-ca'] = 'Messages';
|
||||
$text['label-messages']['fr-fr'] = 'Messages';
|
||||
$text['label-messages']['he-il'] = 'Messages';
|
||||
$text['label-messages']['it-it'] = 'Messages';
|
||||
$text['label-messages']['nl-nl'] = 'Boodschappen';
|
||||
$text['label-messages']['pl-pl'] = 'Messages';
|
||||
$text['label-messages']['pt-br'] = 'Messages';
|
||||
$text['label-messages']['pt-pt'] = 'Messages';
|
||||
$text['label-messages']['ro-ro'] = 'Messages';
|
||||
$text['label-messages']['ru-ru'] = 'Messages';
|
||||
$text['label-messages']['sv-se'] = 'Messages';
|
||||
$text['label-messages']['uk-ua'] = 'Messages';
|
||||
|
||||
$text['label-message_direction']['en-us'] = 'Direction';
|
||||
$text['label-message_direction']['en-gb'] = 'Direction';
|
||||
$text['label-message_direction']['ar-eg'] = 'Direction';
|
||||
$text['label-message_direction']['de-at'] = 'Direction';
|
||||
$text['label-message_direction']['de-ch'] = 'Direction';
|
||||
$text['label-message_direction']['de-de'] = 'Direction';
|
||||
$text['label-message_direction']['es-cl'] = 'Direction';
|
||||
$text['label-message_direction']['es-mx'] = 'Direction';
|
||||
$text['label-message_direction']['fr-ca'] = 'Direction';
|
||||
$text['label-message_direction']['fr-fr'] = 'Direction';
|
||||
$text['label-message_direction']['he-il'] = 'Direction';
|
||||
$text['label-message_direction']['it-it'] = 'Direction';
|
||||
$text['label-message_direction']['nl-nl'] = 'Richting';
|
||||
$text['label-message_direction']['pl-pl'] = 'Direction';
|
||||
$text['label-message_direction']['pt-br'] = 'Direction';
|
||||
$text['label-message_direction']['pt-pt'] = 'Direction';
|
||||
$text['label-message_direction']['ro-ro'] = 'Direction';
|
||||
$text['label-message_direction']['ru-ru'] = 'Direction';
|
||||
$text['label-message_direction']['sv-se'] = 'Direction';
|
||||
$text['label-message_direction']['uk-ua'] = 'Direction';
|
||||
|
||||
$text['description-message_direction']['en-us'] = 'Enter the message direction.';
|
||||
$text['description-message_direction']['en-gb'] = 'Enter the message direction.';
|
||||
$text['description-message_direction']['ar-eg'] = 'Enter the message direction.';
|
||||
$text['description-message_direction']['de-at'] = 'Enter the message direction.';
|
||||
$text['description-message_direction']['de-ch'] = 'Enter the message direction.';
|
||||
$text['description-message_direction']['de-de'] = 'Enter the message direction.';
|
||||
$text['description-message_direction']['es-cl'] = 'Enter the message direction.';
|
||||
$text['description-message_direction']['es-mx'] = 'Enter the message direction.';
|
||||
$text['description-message_direction']['fr-ca'] = 'Enter the message direction.';
|
||||
$text['description-message_direction']['fr-fr'] = 'Enter the message direction.';
|
||||
$text['description-message_direction']['he-il'] = 'Enter the message direction.';
|
||||
$text['description-message_direction']['it-it'] = 'Enter the message direction.';
|
||||
$text['description-message_direction']['nl-nl'] = 'Voer de boodschap richting in.';
|
||||
$text['description-message_direction']['pl-pl'] = 'Enter the message direction.';
|
||||
$text['description-message_direction']['pt-br'] = 'Enter the message direction.';
|
||||
$text['description-message_direction']['pt-pt'] = 'Enter the message direction.';
|
||||
$text['description-message_direction']['ro-ro'] = 'Enter the message direction.';
|
||||
$text['description-message_direction']['ru-ru'] = 'Enter the message direction.';
|
||||
$text['description-message_direction']['sv-se'] = 'Enter the message direction.';
|
||||
$text['description-message_direction']['uk-ua'] = 'Enter the message direction.';
|
||||
|
||||
$text['label-outbound']['en-us'] = 'Outbound';
|
||||
$text['label-outbound']['en-gb'] = 'Outbound';
|
||||
$text['label-outbound']['ar-eg'] = 'Outbound';
|
||||
$text['label-outbound']['de-at'] = 'Outbound';
|
||||
$text['label-outbound']['de-ch'] = 'Outbound';
|
||||
$text['label-outbound']['de-de'] = 'Outbound';
|
||||
$text['label-outbound']['es-mx'] = 'Outbound';
|
||||
$text['label-outbound']['fr-ca'] = 'Outbound';
|
||||
$text['label-outbound']['fr-fr'] = 'Outbound';
|
||||
$text['label-outbound']['he-il'] = 'Outbound';
|
||||
$text['label-outbound']['it-it'] = 'Outbound';
|
||||
$text['label-outbound']['nl-nl'] = 'Uitgaand';
|
||||
$text['label-outbound']['pl-pl'] = 'Outbound';
|
||||
$text['label-outbound']['pt-br'] = 'Outbound';
|
||||
$text['label-outbound']['pt-pt'] = 'Outbound';
|
||||
$text['label-outbound']['ro-ro'] = 'Outbound';
|
||||
$text['label-outbound']['ru-ru'] = 'Outbound';
|
||||
$text['label-outbound']['sv-se'] = 'Outbound';
|
||||
$text['label-outbound']['uk-ua'] = 'Outbound';
|
||||
|
||||
$text['label-inbound']['en-us'] = 'Inbound';
|
||||
$text['label-inbound']['en-gb'] = 'Inbound';
|
||||
$text['label-inbound']['ar-eg'] = 'Inbound';
|
||||
$text['label-inbound']['de-at'] = 'Inbound';
|
||||
$text['label-inbound']['de-ch'] = 'Inbound';
|
||||
$text['label-inbound']['de-de'] = 'Inbound';
|
||||
$text['label-inbound']['es-mx'] = 'Inbound';
|
||||
$text['label-inbound']['fr-ca'] = 'Inbound';
|
||||
$text['label-inbound']['fr-fr'] = 'Inbound';
|
||||
$text['label-inbound']['he-il'] = 'Inbound';
|
||||
$text['label-inbound']['it-it'] = 'Inbound';
|
||||
$text['label-inbound']['nl-nl'] = 'Inkomend';
|
||||
$text['label-inbound']['pl-pl'] = 'Inbound';
|
||||
$text['label-inbound']['pt-br'] = 'Inbound';
|
||||
$text['label-inbound']['pt-pt'] = 'Inbound';
|
||||
$text['label-inbound']['ro-ro'] = 'Inbound';
|
||||
$text['label-inbound']['ru-ru'] = 'Inbound';
|
||||
$text['label-inbound']['sv-se'] = 'Inbound';
|
||||
$text['label-inbound']['uk-ua'] = 'Inbound';
|
||||
|
||||
$text['label-new_message']['en-us'] = 'New Message';
|
||||
$text['label-new_message']['en-gb'] = 'New Message';
|
||||
$text['label-new_message']['ar-eg'] = 'New Message';
|
||||
$text['label-new_message']['de-at'] = 'New Message';
|
||||
$text['label-new_message']['de-ch'] = 'New Message';
|
||||
$text['label-new_message']['de-de'] = 'New Message';
|
||||
$text['label-new_message']['es-mx'] = 'New Message';
|
||||
$text['label-new_message']['fr-ca'] = 'New Message';
|
||||
$text['label-new_message']['fr-fr'] = 'New Message';
|
||||
$text['label-new_message']['he-il'] = 'New Message';
|
||||
$text['label-new_message']['it-it'] = 'New Message';
|
||||
$text['label-new_message']['nl-nl'] = 'Nieuwe boodschap';
|
||||
$text['label-new_message']['pl-pl'] = 'New Message';
|
||||
$text['label-new_message']['pt-br'] = 'New Message';
|
||||
$text['label-new_message']['pt-pt'] = 'New Message';
|
||||
$text['label-new_message']['ro-ro'] = 'New Message';
|
||||
$text['label-new_message']['ru-ru'] = 'New Message';
|
||||
$text['label-new_message']['sv-se'] = 'New Message';
|
||||
$text['label-new_message']['uk-ua'] = 'New Message';
|
||||
|
||||
$text['label-log']['en-us'] = 'Log';
|
||||
$text['label-log']['en-gb'] = 'Log';
|
||||
$text['label-log']['ar-eg'] = 'Log';
|
||||
$text['label-log']['de-at'] = 'Log';
|
||||
$text['label-log']['de-ch'] = 'Log';
|
||||
$text['label-log']['de-de'] = 'Log';
|
||||
$text['label-log']['es-mx'] = 'Log';
|
||||
$text['label-log']['fr-ca'] = 'Log';
|
||||
$text['label-log']['fr-fr'] = 'Log';
|
||||
$text['label-log']['he-il'] = 'Log';
|
||||
$text['label-log']['it-it'] = 'Log';
|
||||
$text['label-log']['nl-nl'] = 'Log';
|
||||
$text['label-log']['pl-pl'] = 'Log';
|
||||
$text['label-log']['pt-br'] = 'Log';
|
||||
$text['label-log']['pt-pt'] = 'Log';
|
||||
$text['label-log']['ro-ro'] = 'Log';
|
||||
$text['label-log']['ru-ru'] = 'Log';
|
||||
$text['label-log']['sv-se'] = 'Log';
|
||||
$text['label-log']['uk-ua'] = 'Log';
|
||||
|
||||
$text['label-contacts']['en-us'] = 'Contacts';
|
||||
$text['label-contacts']['en-gb'] = 'Contacts';
|
||||
$text['label-contacts']['ar-eg'] = 'Contacts';
|
||||
$text['label-contacts']['de-at'] = 'Contacts';
|
||||
$text['label-contacts']['de-ch'] = 'Contacts';
|
||||
$text['label-contacts']['de-de'] = 'Contacts';
|
||||
$text['label-contacts']['es-mx'] = 'Contacts';
|
||||
$text['label-contacts']['fr-ca'] = 'Contacts';
|
||||
$text['label-contacts']['fr-fr'] = 'Contacts';
|
||||
$text['label-contacts']['he-il'] = 'Contacts';
|
||||
$text['label-contacts']['it-it'] = 'Contacts';
|
||||
$text['label-contacts']['nl-nl'] = 'Kontacten';
|
||||
$text['label-contacts']['pl-pl'] = 'Contacts';
|
||||
$text['label-contacts']['pt-br'] = 'Contacts';
|
||||
$text['label-contacts']['pt-pt'] = 'Contacts';
|
||||
$text['label-contacts']['ro-ro'] = 'Contacts';
|
||||
$text['label-contacts']['ru-ru'] = 'Contacts';
|
||||
$text['label-contacts']['sv-se'] = 'Contacts';
|
||||
$text['label-contacts']['uk-ua'] = 'Contacts';
|
||||
|
||||
$text['label-message_date']['en-us'] = 'Date';
|
||||
$text['label-message_date']['en-gb'] = 'Date';
|
||||
$text['label-message_date']['ar-eg'] = 'Date';
|
||||
$text['label-message_date']['de-at'] = 'Date';
|
||||
$text['label-message_date']['de-ch'] = 'Date';
|
||||
$text['label-message_date']['de-de'] = 'Date';
|
||||
$text['label-message_date']['es-cl'] = 'Date';
|
||||
$text['label-message_date']['es-mx'] = 'Date';
|
||||
$text['label-message_date']['fr-ca'] = 'Date';
|
||||
$text['label-message_date']['fr-fr'] = 'Date';
|
||||
$text['label-message_date']['he-il'] = 'Date';
|
||||
$text['label-message_date']['it-it'] = 'Date';
|
||||
$text['label-message_date']['nl-nl'] = 'Datum';
|
||||
$text['label-message_date']['pl-pl'] = 'Date';
|
||||
$text['label-message_date']['pt-br'] = 'Date';
|
||||
$text['label-message_date']['pt-pt'] = 'Date';
|
||||
$text['label-message_date']['ro-ro'] = 'Date';
|
||||
$text['label-message_date']['ru-ru'] = 'Date';
|
||||
$text['label-message_date']['sv-se'] = 'Date';
|
||||
$text['label-message_date']['uk-ua'] = 'Date';
|
||||
|
||||
$text['description-message_date']['en-us'] = 'Enter the message date.';
|
||||
$text['description-message_date']['en-gb'] = 'Enter the message date.';
|
||||
$text['description-message_date']['ar-eg'] = 'Enter the message date.';
|
||||
$text['description-message_date']['de-at'] = 'Enter the message date.';
|
||||
$text['description-message_date']['de-ch'] = 'Enter the message date.';
|
||||
$text['description-message_date']['de-de'] = 'Enter the message date.';
|
||||
$text['description-message_date']['es-cl'] = 'Enter the message date.';
|
||||
$text['description-message_date']['es-mx'] = 'Enter the message date.';
|
||||
$text['description-message_date']['fr-ca'] = 'Enter the message date.';
|
||||
$text['description-message_date']['fr-fr'] = 'Enter the message date.';
|
||||
$text['description-message_date']['he-il'] = 'Enter the message date.';
|
||||
$text['description-message_date']['it-it'] = 'Enter the message date.';
|
||||
$text['description-message_date']['nl-nl'] = 'Voer een boodschapdatum in.';
|
||||
$text['description-message_date']['pl-pl'] = 'Enter the message date.';
|
||||
$text['description-message_date']['pt-br'] = 'Enter the message date.';
|
||||
$text['description-message_date']['pt-pt'] = 'Enter the message date.';
|
||||
$text['description-message_date']['ro-ro'] = 'Enter the message date.';
|
||||
$text['description-message_date']['ru-ru'] = 'Enter the message date.';
|
||||
$text['description-message_date']['sv-se'] = 'Enter the message date.';
|
||||
$text['description-message_date']['uk-ua'] = 'Enter the message date.';
|
||||
|
||||
$text['label-message_from']['en-us'] = 'From';
|
||||
$text['label-message_from']['en-gb'] = 'From';
|
||||
$text['label-message_from']['ar-eg'] = 'From';
|
||||
$text['label-message_from']['de-at'] = 'From';
|
||||
$text['label-message_from']['de-ch'] = 'From';
|
||||
$text['label-message_from']['de-de'] = 'From';
|
||||
$text['label-message_from']['es-cl'] = 'From';
|
||||
$text['label-message_from']['es-mx'] = 'From';
|
||||
$text['label-message_from']['fr-ca'] = 'From';
|
||||
$text['label-message_from']['fr-fr'] = 'From';
|
||||
$text['label-message_from']['he-il'] = 'From';
|
||||
$text['label-message_from']['it-it'] = 'From';
|
||||
$text['label-message_from']['nl-nl'] = 'Van';
|
||||
$text['label-message_from']['pl-pl'] = 'From';
|
||||
$text['label-message_from']['pt-br'] = 'From';
|
||||
$text['label-message_from']['pt-pt'] = 'From';
|
||||
$text['label-message_from']['ro-ro'] = 'From';
|
||||
$text['label-message_from']['ru-ru'] = 'From';
|
||||
$text['label-message_from']['sv-se'] = 'From';
|
||||
$text['label-message_from']['uk-ua'] = 'From';
|
||||
|
||||
$text['description-message_from']['en-us'] = 'Enter the message from.';
|
||||
$text['description-message_from']['en-gb'] = 'Enter the message from.';
|
||||
$text['description-message_from']['ar-eg'] = 'Enter the message from.';
|
||||
$text['description-message_from']['de-at'] = 'Enter the message from.';
|
||||
$text['description-message_from']['de-ch'] = 'Enter the message from.';
|
||||
$text['description-message_from']['de-de'] = 'Enter the message from.';
|
||||
$text['description-message_from']['es-cl'] = 'Enter the message from.';
|
||||
$text['description-message_from']['es-mx'] = 'Enter the message from.';
|
||||
$text['description-message_from']['fr-ca'] = 'Enter the message from.';
|
||||
$text['description-message_from']['fr-fr'] = 'Enter the message from.';
|
||||
$text['description-message_from']['he-il'] = 'Enter the message from.';
|
||||
$text['description-message_from']['it-it'] = 'Enter the message from.';
|
||||
$text['description-message_from']['nl-nl'] = 'Voer boodschap van in.';
|
||||
$text['description-message_from']['pl-pl'] = 'Enter the message from.';
|
||||
$text['description-message_from']['pt-br'] = 'Enter the message from.';
|
||||
$text['description-message_from']['pt-pt'] = 'Enter the message from.';
|
||||
$text['description-message_from']['ro-ro'] = 'Enter the message from.';
|
||||
$text['description-message_from']['ru-ru'] = 'Enter the message from.';
|
||||
$text['description-message_from']['sv-se'] = 'Enter the message from.';
|
||||
$text['description-message_from']['uk-ua'] = 'Enter the message from.';
|
||||
|
||||
$text['label-message_to']['en-us'] = 'To';
|
||||
$text['label-message_to']['en-gb'] = 'To';
|
||||
$text['label-message_to']['ar-eg'] = 'To';
|
||||
$text['label-message_to']['de-at'] = 'To';
|
||||
$text['label-message_to']['de-ch'] = 'To';
|
||||
$text['label-message_to']['de-de'] = 'To';
|
||||
$text['label-message_to']['es-cl'] = 'To';
|
||||
$text['label-message_to']['es-mx'] = 'To';
|
||||
$text['label-message_to']['fr-ca'] = 'To';
|
||||
$text['label-message_to']['fr-fr'] = 'To';
|
||||
$text['label-message_to']['he-il'] = 'To';
|
||||
$text['label-message_to']['it-it'] = 'To';
|
||||
$text['label-message_to']['nl-nl'] = 'Aan';
|
||||
$text['label-message_to']['pl-pl'] = 'To';
|
||||
$text['label-message_to']['pt-br'] = 'To';
|
||||
$text['label-message_to']['pt-pt'] = 'To';
|
||||
$text['label-message_to']['ro-ro'] = 'To';
|
||||
$text['label-message_to']['ru-ru'] = 'To';
|
||||
$text['label-message_to']['sv-se'] = 'To';
|
||||
$text['label-message_to']['uk-ua'] = 'To';
|
||||
|
||||
$text['description-message_to']['en-us'] = 'Enter the message to.';
|
||||
$text['description-message_to']['en-gb'] = 'Enter the message to.';
|
||||
$text['description-message_to']['ar-eg'] = 'Enter the message to.';
|
||||
$text['description-message_to']['de-at'] = 'Enter the message to.';
|
||||
$text['description-message_to']['de-ch'] = 'Enter the message to.';
|
||||
$text['description-message_to']['de-de'] = 'Enter the message to.';
|
||||
$text['description-message_to']['es-cl'] = 'Enter the message to.';
|
||||
$text['description-message_to']['es-mx'] = 'Enter the message to.';
|
||||
$text['description-message_to']['fr-ca'] = 'Enter the message to.';
|
||||
$text['description-message_to']['fr-fr'] = 'Enter the message to.';
|
||||
$text['description-message_to']['he-il'] = 'Enter the message to.';
|
||||
$text['description-message_to']['it-it'] = 'Enter the message to.';
|
||||
$text['description-message_to']['nl-nl'] = 'Voer de boodschap aan in.';
|
||||
$text['description-message_to']['pl-pl'] = 'Enter the message to.';
|
||||
$text['description-message_to']['pt-br'] = 'Enter the message to.';
|
||||
$text['description-message_to']['pt-pt'] = 'Enter the message to.';
|
||||
$text['description-message_to']['ro-ro'] = 'Enter the message to.';
|
||||
$text['description-message_to']['ru-ru'] = 'Enter the message to.';
|
||||
$text['description-message_to']['sv-se'] = 'Enter the message to.';
|
||||
$text['description-message_to']['uk-ua'] = 'Enter the message to.';
|
||||
|
||||
$text['label-message_text']['en-us'] = 'Text';
|
||||
$text['label-message_text']['en-gb'] = 'Text';
|
||||
$text['label-message_text']['ar-eg'] = 'Text';
|
||||
$text['label-message_text']['de-at'] = 'Text';
|
||||
$text['label-message_text']['de-ch'] = 'Text';
|
||||
$text['label-message_text']['de-de'] = 'Text';
|
||||
$text['label-message_text']['es-cl'] = 'Text';
|
||||
$text['label-message_text']['es-mx'] = 'Text';
|
||||
$text['label-message_text']['fr-ca'] = 'Text';
|
||||
$text['label-message_text']['fr-fr'] = 'Text';
|
||||
$text['label-message_text']['he-il'] = 'Text';
|
||||
$text['label-message_text']['it-it'] = 'Text';
|
||||
$text['label-message_text']['nl-nl'] = 'Tekst';
|
||||
$text['label-message_text']['pl-pl'] = 'Text';
|
||||
$text['label-message_text']['pt-br'] = 'Text';
|
||||
$text['label-message_text']['pt-pt'] = 'Text';
|
||||
$text['label-message_text']['ro-ro'] = 'Text';
|
||||
$text['label-message_text']['ru-ru'] = 'Text';
|
||||
$text['label-message_text']['sv-se'] = 'Text';
|
||||
$text['label-message_text']['uk-ua'] = 'Text';
|
||||
|
||||
$text['label-message_media']['en-us'] = 'Media';
|
||||
$text['label-message_media']['en-gb'] = 'Media';
|
||||
$text['label-message_media']['ar-eg'] = 'Media';
|
||||
$text['label-message_media']['de-at'] = 'Media';
|
||||
$text['label-message_media']['de-ch'] = 'Media';
|
||||
$text['label-message_media']['de-de'] = 'Media';
|
||||
$text['label-message_media']['es-cl'] = 'Media';
|
||||
$text['label-message_media']['es-mx'] = 'Media';
|
||||
$text['label-message_media']['fr-ca'] = 'Media';
|
||||
$text['label-message_media']['fr-fr'] = 'Media';
|
||||
$text['label-message_media']['he-il'] = 'Media';
|
||||
$text['label-message_media']['it-it'] = 'Media';
|
||||
$text['label-message_media']['nl-nl'] = 'Media';
|
||||
$text['label-message_media']['pl-pl'] = 'Media';
|
||||
$text['label-message_media']['pt-br'] = 'Media';
|
||||
$text['label-message_media']['pt-pt'] = 'Media';
|
||||
$text['label-message_media']['ro-ro'] = 'Media';
|
||||
$text['label-message_media']['ru-ru'] = 'Media';
|
||||
$text['label-message_media']['sv-se'] = 'Media';
|
||||
$text['label-message_media']['uk-ua'] = 'Media';
|
||||
|
||||
$text['description-message_text']['en-us'] = 'Enter the message text.';
|
||||
$text['description-message_text']['en-gb'] = 'Enter the message text.';
|
||||
$text['description-message_text']['ar-eg'] = 'Enter the message text.';
|
||||
$text['description-message_text']['de-at'] = 'Enter the message text.';
|
||||
$text['description-message_text']['de-ch'] = 'Enter the message text.';
|
||||
$text['description-message_text']['de-de'] = 'Enter the message text.';
|
||||
$text['description-message_text']['es-cl'] = 'Enter the message text.';
|
||||
$text['description-message_text']['es-mx'] = 'Enter the message text.';
|
||||
$text['description-message_text']['fr-ca'] = 'Enter the message text.';
|
||||
$text['description-message_text']['fr-fr'] = 'Enter the message text.';
|
||||
$text['description-message_text']['he-il'] = 'Enter the message text.';
|
||||
$text['description-message_text']['it-it'] = 'Enter the message text.';
|
||||
$text['description-message_text']['nl-nl'] = 'Voer de boodschap tekst in.';
|
||||
$text['description-message_text']['pl-pl'] = 'Enter the message text.';
|
||||
$text['description-message_text']['pt-br'] = 'Enter the message text.';
|
||||
$text['description-message_text']['pt-pt'] = 'Enter the message text.';
|
||||
$text['description-message_text']['ro-ro'] = 'Enter the message text.';
|
||||
$text['description-message_text']['ru-ru'] = 'Enter the message text.';
|
||||
$text['description-message_text']['sv-se'] = 'Enter the message text.';
|
||||
$text['description-message_text']['uk-ua'] = 'Enter the message text.';
|
||||
|
||||
$text['label-message_media_type']['en-us'] = 'Media Type';
|
||||
$text['label-message_media_type']['en-gb'] = 'Media Type';
|
||||
$text['label-message_media_type']['ar-eg'] = 'Media Type';
|
||||
$text['label-message_media_type']['de-at'] = 'Media Type';
|
||||
$text['label-message_media_type']['de-ch'] = 'Media Type';
|
||||
$text['label-message_media_type']['de-de'] = 'Media Type';
|
||||
$text['label-message_media_type']['es-cl'] = 'Media Type';
|
||||
$text['label-message_media_type']['es-mx'] = 'Media Type';
|
||||
$text['label-message_media_type']['fr-ca'] = 'Media Type';
|
||||
$text['label-message_media_type']['fr-fr'] = 'Media Type';
|
||||
$text['label-message_media_type']['he-il'] = 'Media Type';
|
||||
$text['label-message_media_type']['it-it'] = 'Media Type';
|
||||
$text['label-message_media_type']['nl-nl'] = 'Media Type';
|
||||
$text['label-message_media_type']['pl-pl'] = 'Media Type';
|
||||
$text['label-message_media_type']['pt-br'] = 'Media Type';
|
||||
$text['label-message_media_type']['pt-pt'] = 'Media Type';
|
||||
$text['label-message_media_type']['ro-ro'] = 'Media Type';
|
||||
$text['label-message_media_type']['ru-ru'] = 'Media Type';
|
||||
$text['label-message_media_type']['sv-se'] = 'Media Type';
|
||||
$text['label-message_media_type']['uk-ua'] = 'Media Type';
|
||||
|
||||
$text['description-message_media_type']['en-us'] = 'Enter the message media type.';
|
||||
$text['description-message_media_type']['en-gb'] = 'Enter the message media type.';
|
||||
$text['description-message_media_type']['ar-eg'] = 'Enter the message media type.';
|
||||
$text['description-message_media_type']['de-at'] = 'Enter the message media type.';
|
||||
$text['description-message_media_type']['de-ch'] = 'Enter the message media type.';
|
||||
$text['description-message_media_type']['de-de'] = 'Enter the message media type.';
|
||||
$text['description-message_media_type']['es-cl'] = 'Enter the message media type.';
|
||||
$text['description-message_media_type']['es-mx'] = 'Enter the message media type.';
|
||||
$text['description-message_media_type']['fr-ca'] = 'Enter the message media type.';
|
||||
$text['description-message_media_type']['fr-fr'] = 'Enter the message media type.';
|
||||
$text['description-message_media_type']['he-il'] = 'Enter the message media type.';
|
||||
$text['description-message_media_type']['it-it'] = 'Enter the message media type.';
|
||||
$text['description-message_media_type']['nl-nl'] = 'Voer de boodschap media type in.';
|
||||
$text['description-message_media_type']['pl-pl'] = 'Enter the message media type.';
|
||||
$text['description-message_media_type']['pt-br'] = 'Enter the message media type.';
|
||||
$text['description-message_media_type']['pt-pt'] = 'Enter the message media type.';
|
||||
$text['description-message_media_type']['ro-ro'] = 'Enter the message media type.';
|
||||
$text['description-message_media_type']['ru-ru'] = 'Enter the message media type.';
|
||||
$text['description-message_media_type']['sv-se'] = 'Enter the message media type.';
|
||||
$text['description-message_media_type']['uk-ua'] = 'Enter the message media type.';
|
||||
|
||||
$text['label-message_media_url']['en-us'] = 'Media URL';
|
||||
$text['label-message_media_url']['en-gb'] = 'Media URL';
|
||||
$text['label-message_media_url']['ar-eg'] = 'Media URL';
|
||||
$text['label-message_media_url']['de-at'] = 'Media URL';
|
||||
$text['label-message_media_url']['de-ch'] = 'Media URL';
|
||||
$text['label-message_media_url']['de-de'] = 'Media URL';
|
||||
$text['label-message_media_url']['es-cl'] = 'Media URL';
|
||||
$text['label-message_media_url']['es-mx'] = 'Media URL';
|
||||
$text['label-message_media_url']['fr-ca'] = 'Media URL';
|
||||
$text['label-message_media_url']['fr-fr'] = 'Media URL';
|
||||
$text['label-message_media_url']['he-il'] = 'Media URL';
|
||||
$text['label-message_media_url']['it-it'] = 'Media URL';
|
||||
$text['label-message_media_url']['nl-nl'] = 'Media URL';
|
||||
$text['label-message_media_url']['pl-pl'] = 'Media URL';
|
||||
$text['label-message_media_url']['pt-br'] = 'Media URL';
|
||||
$text['label-message_media_url']['pt-pt'] = 'Media URL';
|
||||
$text['label-message_media_url']['ro-ro'] = 'Media URL';
|
||||
$text['label-message_media_url']['ru-ru'] = 'Media URL';
|
||||
$text['label-message_media_url']['sv-se'] = 'Media URL';
|
||||
$text['label-message_media_url']['uk-ua'] = 'Media URL';
|
||||
|
||||
$text['description-message_media_url']['en-us'] = 'Enter the message media url.';
|
||||
$text['description-message_media_url']['en-gb'] = 'Enter the message media url.';
|
||||
$text['description-message_media_url']['ar-eg'] = 'Enter the message media url.';
|
||||
$text['description-message_media_url']['de-at'] = 'Enter the message media url.';
|
||||
$text['description-message_media_url']['de-ch'] = 'Enter the message media url.';
|
||||
$text['description-message_media_url']['de-de'] = 'Enter the message media url.';
|
||||
$text['description-message_media_url']['es-cl'] = 'Enter the message media url.';
|
||||
$text['description-message_media_url']['es-mx'] = 'Enter the message media url.';
|
||||
$text['description-message_media_url']['fr-ca'] = 'Enter the message media url.';
|
||||
$text['description-message_media_url']['fr-fr'] = 'Enter the message media url.';
|
||||
$text['description-message_media_url']['he-il'] = 'Enter the message media url.';
|
||||
$text['description-message_media_url']['it-it'] = 'Enter the message media url.';
|
||||
$text['description-message_media_url']['nl-nl'] = 'Voer de boodschap media url in.';
|
||||
$text['description-message_media_url']['pl-pl'] = 'Enter the message media url.';
|
||||
$text['description-message_media_url']['pt-br'] = 'Enter the message media url.';
|
||||
$text['description-message_media_url']['pt-pt'] = 'Enter the message media url.';
|
||||
$text['description-message_media_url']['ro-ro'] = 'Enter the message media url.';
|
||||
$text['description-message_media_url']['ru-ru'] = 'Enter the message media url.';
|
||||
$text['description-message_media_url']['sv-se'] = 'Enter the message media url.';
|
||||
$text['description-message_media_url']['uk-ua'] = 'Enter the message media url.';
|
||||
|
||||
$text['label-message_media_content']['en-us'] = 'Message Media Content';
|
||||
$text['label-message_media_content']['en-gb'] = 'Message Media Content';
|
||||
$text['label-message_media_content']['ar-eg'] = 'Message Media Content';
|
||||
$text['label-message_media_content']['de-at'] = 'Message Media Content';
|
||||
$text['label-message_media_content']['de-ch'] = 'Message Media Content';
|
||||
$text['label-message_media_content']['de-de'] = 'Message Media Content';
|
||||
$text['label-message_media_content']['es-cl'] = 'Message Media Content';
|
||||
$text['label-message_media_content']['es-mx'] = 'Message Media Content';
|
||||
$text['label-message_media_content']['fr-ca'] = 'Message Media Content';
|
||||
$text['label-message_media_content']['fr-fr'] = 'Message Media Content';
|
||||
$text['label-message_media_content']['he-il'] = 'Message Media Content';
|
||||
$text['label-message_media_content']['it-it'] = 'Message Media Content';
|
||||
$text['label-message_media_content']['nl-nl'] = 'Boodschap Media inhoud.';
|
||||
$text['label-message_media_content']['pl-pl'] = 'Message Media Content';
|
||||
$text['label-message_media_content']['pt-br'] = 'Message Media Content';
|
||||
$text['label-message_media_content']['pt-pt'] = 'Message Media Content';
|
||||
$text['label-message_media_content']['ro-ro'] = 'Message Media Content';
|
||||
$text['label-message_media_content']['ru-ru'] = 'Message Media Content';
|
||||
$text['label-message_media_content']['sv-se'] = 'Message Media Content';
|
||||
$text['label-message_media_content']['uk-ua'] = 'Message Media Content';
|
||||
|
||||
$text['description-message_media_content']['en-us'] = 'Enter the message media content.';
|
||||
$text['description-message_media_content']['en-gb'] = 'Enter the message media content.';
|
||||
$text['description-message_media_content']['ar-eg'] = 'Enter the message media content.';
|
||||
$text['description-message_media_content']['de-at'] = 'Enter the message media content.';
|
||||
$text['description-message_media_content']['de-ch'] = 'Enter the message media content.';
|
||||
$text['description-message_media_content']['de-de'] = 'Enter the message media content.';
|
||||
$text['description-message_media_content']['es-cl'] = 'Enter the message media content.';
|
||||
$text['description-message_media_content']['es-mx'] = 'Enter the message media content.';
|
||||
$text['description-message_media_content']['fr-ca'] = 'Enter the message media content.';
|
||||
$text['description-message_media_content']['fr-fr'] = 'Enter the message media content.';
|
||||
$text['description-message_media_content']['he-il'] = 'Enter the message media content.';
|
||||
$text['description-message_media_content']['it-it'] = 'Enter the message media content.';
|
||||
$text['description-message_media_content']['nl-nl'] = 'Voer de boodschap media inhoud in.';
|
||||
$text['description-message_media_content']['pl-pl'] = 'Enter the message media content.';
|
||||
$text['description-message_media_content']['pt-br'] = 'Enter the message media content.';
|
||||
$text['description-message_media_content']['pt-pt'] = 'Enter the message media content.';
|
||||
$text['description-message_media_content']['ro-ro'] = 'Enter the message media content.';
|
||||
$text['description-message_media_content']['ru-ru'] = 'Enter the message media content.';
|
||||
$text['description-message_media_content']['sv-se'] = 'Enter the message media content.';
|
||||
$text['description-message_media_content']['uk-ua'] = 'Enter the message media content.';
|
||||
|
||||
$text['label-message_json']['en-us'] = 'JSON';
|
||||
$text['label-message_json']['en-gb'] = 'JSON';
|
||||
$text['label-message_json']['ar-eg'] = 'JSON';
|
||||
$text['label-message_json']['de-at'] = 'JSON';
|
||||
$text['label-message_json']['de-ch'] = 'JSON';
|
||||
$text['label-message_json']['de-de'] = 'JSON';
|
||||
$text['label-message_json']['es-cl'] = 'JSON';
|
||||
$text['label-message_json']['es-mx'] = 'JSON';
|
||||
$text['label-message_json']['fr-ca'] = 'JSON';
|
||||
$text['label-message_json']['fr-fr'] = 'JSON';
|
||||
$text['label-message_json']['he-il'] = 'JSON';
|
||||
$text['label-message_json']['it-it'] = 'JSON';
|
||||
$text['label-message_json']['nl-nl'] = 'JSON';
|
||||
$text['label-message_json']['pl-pl'] = 'JSON';
|
||||
$text['label-message_json']['pt-br'] = 'JSON';
|
||||
$text['label-message_json']['pt-pt'] = 'JSON';
|
||||
$text['label-message_json']['ro-ro'] = 'JSON';
|
||||
$text['label-message_json']['ru-ru'] = 'JSON';
|
||||
$text['label-message_json']['sv-se'] = 'JSON';
|
||||
$text['label-message_json']['uk-ua'] = 'JSON';
|
||||
|
||||
$text['label-refresh_pause']['en-us'] = "Pause Refresh";
|
||||
$text['label-refresh_pause']['en-gb'] = "Pause Refresh";
|
||||
$text['label-refresh_pause']['ar-eg'] = "Pause Refresh";
|
||||
$text['label-refresh_pause']['de-at'] = "Seite neu laden deaktivieren"; //copied from de-de
|
||||
$text['label-refresh_pause']['de-ch'] = "Seite neu laden deaktivieren"; //copied from de-de
|
||||
$text['label-refresh_pause']['de-de'] = "Seite neu laden deaktivieren";
|
||||
$text['label-refresh_pause']['es-cl'] = "Actualizar Pausa";
|
||||
$text['label-refresh_pause']['es-mx'] = "Actualizar Pausa"; //copied from es-cl
|
||||
$text['label-refresh_pause']['fr-ca'] = "Pause Actualiser"; //copied from fr-fr
|
||||
$text['label-refresh_pause']['fr-fr'] = "Pause Actualiser";
|
||||
$text['label-refresh_pause']['he-il'] = "עצור רענון";
|
||||
$text['label-refresh_pause']['it-it'] = "Pausa";
|
||||
$text['label-refresh_pause']['nl-nl'] = "Ververs pause";
|
||||
$text['label-refresh_pause']['pl-pl'] = "Pauzuj odświeżanie";
|
||||
$text['label-refresh_pause']['pt-br'] = "Pausar atualização";
|
||||
$text['label-refresh_pause']['pt-pt'] = "Pausa Atualizar";
|
||||
$text['label-refresh_pause']['ro-ro'] = "Pause Refresh";
|
||||
$text['label-refresh_pause']['ru-ru'] = "Приостановить обновление";
|
||||
$text['label-refresh_pause']['sv-se'] = "Paus Uppdatera";
|
||||
$text['label-refresh_pause']['uk-ua'] = "пауза Оновити";
|
||||
|
||||
$text['label-refresh_enable']['en-us'] = "Enable Refresh";
|
||||
$text['label-refresh_enable']['en-gb'] = "Enable Refresh";
|
||||
$text['label-refresh_enable']['ar-eg'] = "Enable Refresh";
|
||||
$text['label-refresh_enable']['de-at'] = "Seite neu laden aktivieren"; //copied from de-de
|
||||
$text['label-refresh_enable']['de-ch'] = "Seite neu laden aktivieren"; //copied from de-de
|
||||
$text['label-refresh_enable']['de-de'] = "Seite neu laden aktivieren";
|
||||
$text['label-refresh_enable']['es-cl'] = "Activar Actualizar";
|
||||
$text['label-refresh_enable']['es-mx'] = "Activar Actualizar"; //copied from es-cl
|
||||
$text['label-refresh_enable']['fr-ca'] = "Activer Actualiser"; //copied from fr-fr
|
||||
$text['label-refresh_enable']['fr-fr'] = "Activer Actualiser";
|
||||
$text['label-refresh_enable']['he-il'] = "אפשר רענון";
|
||||
$text['label-refresh_enable']['it-it'] = "Riprendi";
|
||||
$text['label-refresh_enable']['nl-nl'] = "Zet ververs aan";
|
||||
$text['label-refresh_enable']['pl-pl'] = "Włącz odświeżanie";
|
||||
$text['label-refresh_enable']['pt-br'] = "Habilitar atualização";
|
||||
$text['label-refresh_enable']['pt-pt'] = "Habilitar Atualização";
|
||||
$text['label-refresh_enable']['ro-ro'] = "Enable Refresh";
|
||||
$text['label-refresh_enable']['ru-ru'] = "Включить обновление";
|
||||
$text['label-refresh_enable']['sv-se'] = "Aktivera Uppdatering";
|
||||
$text['label-refresh_enable']['uk-ua'] = "включити Оновити";
|
||||
|
||||
$text['description-enter_response']['en-us'] = 'Enter Response...';
|
||||
$text['description-enter_response']['en-gb'] = 'Enter Response...';
|
||||
$text['description-enter_response']['ar-eg'] = 'Enter Response...';
|
||||
$text['description-enter_response']['de-at'] = 'Enter Response...';
|
||||
$text['description-enter_response']['de-ch'] = 'Enter Response...';
|
||||
$text['description-enter_response']['de-de'] = 'Enter Response...';
|
||||
$text['description-enter_response']['es-cl'] = 'Enter Response...';
|
||||
$text['description-enter_response']['es-mx'] = 'Enter Response...';
|
||||
$text['description-enter_response']['fr-ca'] = 'Enter Response...';
|
||||
$text['description-enter_response']['fr-fr'] = 'Enter Response...';
|
||||
$text['description-enter_response']['he-il'] = 'Enter Response...';
|
||||
$text['description-enter_response']['it-it'] = 'Enter Response...';
|
||||
$text['description-enter_response']['nl-nl'] = 'Voer antwoord in...';
|
||||
$text['description-enter_response']['pl-pl'] = 'Enter Response...';
|
||||
$text['description-enter_response']['pt-br'] = 'Enter Response...';
|
||||
$text['description-enter_response']['pt-pt'] = 'Enter Response...';
|
||||
$text['description-enter_response']['ro-ro'] = 'Enter Response...';
|
||||
$text['description-enter_response']['ru-ru'] = 'Enter Response...';
|
||||
$text['description-enter_response']['sv-se'] = 'Enter Response...';
|
||||
$text['description-enter_response']['uk-ua'] = 'Enter Response...';
|
||||
|
||||
$text['label-ctrl_enter']['en-us'] = 'Ctrl + Enter';
|
||||
$text['label-ctrl_enter']['en-gb'] = 'Ctrl + Enter';
|
||||
$text['label-ctrl_enter']['ar-eg'] = 'Ctrl + Enter';
|
||||
$text['label-ctrl_enter']['de-at'] = 'Ctrl + Enter';
|
||||
$text['label-ctrl_enter']['de-ch'] = 'Ctrl + Enter';
|
||||
$text['label-ctrl_enter']['de-de'] = 'Ctrl + Enter';
|
||||
$text['label-ctrl_enter']['es-cl'] = 'Ctrl + Enter';
|
||||
$text['label-ctrl_enter']['es-mx'] = 'Ctrl + Enter';
|
||||
$text['label-ctrl_enter']['fr-ca'] = 'Ctrl + Enter';
|
||||
$text['label-ctrl_enter']['fr-fr'] = 'Ctrl + Enter';
|
||||
$text['label-ctrl_enter']['he-il'] = 'Ctrl + Enter';
|
||||
$text['label-ctrl_enter']['it-it'] = 'Ctrl + Enter';
|
||||
$text['label-ctrl_enter']['nl-nl'] = 'Ctrl + Enter';
|
||||
$text['label-ctrl_enter']['pl-pl'] = 'Ctrl + Enter';
|
||||
$text['label-ctrl_enter']['pt-br'] = 'Ctrl + Enter';
|
||||
$text['label-ctrl_enter']['pt-pt'] = 'Ctrl + Enter';
|
||||
$text['label-ctrl_enter']['ro-ro'] = 'Ctrl + Enter';
|
||||
$text['label-ctrl_enter']['ru-ru'] = 'Ctrl + Enter';
|
||||
$text['label-ctrl_enter']['sv-se'] = 'Ctrl + Enter';
|
||||
$text['label-ctrl_enter']['uk-ua'] = 'Ctrl + Enter';
|
||||
|
||||
$text['button-close']['en-us'] = 'Close';
|
||||
$text['button-close']['en-gb'] = 'Close';
|
||||
$text['button-close']['ar-eg'] = 'Close';
|
||||
$text['button-close']['de-at'] = 'Close';
|
||||
$text['button-close']['de-ch'] = 'Close';
|
||||
$text['button-close']['de-de'] = 'Close';
|
||||
$text['button-close']['es-cl'] = 'Close';
|
||||
$text['button-close']['es-mx'] = 'Close';
|
||||
$text['button-close']['fr-ca'] = 'Close';
|
||||
$text['button-close']['fr-fr'] = 'Close';
|
||||
$text['button-close']['he-il'] = 'Close';
|
||||
$text['button-close']['it-it'] = 'Close';
|
||||
$text['button-close']['nl-nl'] = 'Sluiten';
|
||||
$text['button-close']['pl-pl'] = 'Close';
|
||||
$text['button-close']['pt-br'] = 'Close';
|
||||
$text['button-close']['pt-pt'] = 'Close';
|
||||
$text['button-close']['ro-ro'] = 'Close';
|
||||
$text['button-close']['ru-ru'] = 'Close';
|
||||
$text['button-close']['sv-se'] = 'Close';
|
||||
$text['button-close']['uk-ua'] = 'Close';
|
||||
|
||||
$text['label-view_contact']['en-us'] = 'View Contact';
|
||||
$text['label-view_contact']['en-gb'] = 'View Contact';
|
||||
$text['label-view_contact']['ar-eg'] = 'View Contact';
|
||||
$text['label-view_contact']['de-at'] = 'View Contact';
|
||||
$text['label-view_contact']['de-ch'] = 'View Contact';
|
||||
$text['label-view_contact']['de-de'] = 'View Contact';
|
||||
$text['label-view_contact']['es-cl'] = 'View Contact';
|
||||
$text['label-view_contact']['es-mx'] = 'View Contact';
|
||||
$text['label-view_contact']['fr-ca'] = 'View Contact';
|
||||
$text['label-view_contact']['fr-fr'] = 'View Contact';
|
||||
$text['label-view_contact']['he-il'] = 'View Contact';
|
||||
$text['label-view_contact']['it-it'] = 'View Contact';
|
||||
$text['label-view_contact']['nl-nl'] = 'Toon kontact';
|
||||
$text['label-view_contact']['pl-pl'] = 'View Contact';
|
||||
$text['label-view_contact']['pt-br'] = 'View Contact';
|
||||
$text['label-view_contact']['pt-pt'] = 'View Contact';
|
||||
$text['label-view_contact']['ro-ro'] = 'View Contact';
|
||||
$text['label-view_contact']['ru-ru'] = 'View Contact';
|
||||
$text['label-view_contact']['sv-se'] = 'View Contact';
|
||||
$text['label-view_contact']['uk-ua'] = 'View Contact';
|
||||
|
||||
$text['label-send_email']['en-us'] = 'Send Email';
|
||||
$text['label-send_email']['en-gb'] = 'Send Email';
|
||||
$text['label-send_email']['ar-eg'] = 'Send Email';
|
||||
$text['label-send_email']['de-at'] = 'Send Email';
|
||||
$text['label-send_email']['de-ch'] = 'Send Email';
|
||||
$text['label-send_email']['de-de'] = 'Send Email';
|
||||
$text['label-send_email']['es-cl'] = 'Send Email';
|
||||
$text['label-send_email']['es-mx'] = 'Send Email';
|
||||
$text['label-send_email']['fr-ca'] = 'Send Email';
|
||||
$text['label-send_email']['fr-fr'] = 'Send Email';
|
||||
$text['label-send_email']['he-il'] = 'Send Email';
|
||||
$text['label-send_email']['it-it'] = 'Send Email';
|
||||
$text['label-send_email']['nl-nl'] = 'Zend E-mail';
|
||||
$text['label-send_email']['pl-pl'] = 'Send Email';
|
||||
$text['label-send_email']['pt-br'] = 'Send Email';
|
||||
$text['label-send_email']['pt-pt'] = 'Send Email';
|
||||
$text['label-send_email']['ro-ro'] = 'Send Email';
|
||||
$text['label-send_email']['ru-ru'] = 'Send Email';
|
||||
$text['label-send_email']['sv-se'] = 'Send Email';
|
||||
$text['label-send_email']['uk-ua'] = 'Send Email';
|
||||
|
||||
?>
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
$apps[$x]['menu'][0]['title']['en-us'] = 'Messages';
|
||||
$apps[$x]['menu'][0]['title']['en-gb'] = 'Messages';
|
||||
$apps[$x]['menu'][0]['title']['es-cl'] = '';
|
||||
$apps[$x]['menu'][0]['title']['fr-fr'] = '';
|
||||
$apps[$x]['menu'][0]['title']['fr-ca'] = '';
|
||||
$apps[$x]['menu'][0]['title']['nl-nl'] = 'Boodschappen';
|
||||
$apps[$x]['menu'][0]['title']['pl'] = '';
|
||||
$apps[$x]['menu'][0]['title']['sv-se'] = '';
|
||||
$apps[$x]['menu'][0]['title']['uk'] = '';
|
||||
$apps[$x]['menu'][0]['title']['de-at'] = '';
|
||||
$apps[$x]['menu'][0]['uuid'] = 'b2f6a2e0-cf25-4bd5-8079-6385f6871047';
|
||||
$apps[$x]['menu'][0]['parent_uuid'] = 'fd29e39c-c936-f5fc-8e2b-611681b266b5';
|
||||
$apps[$x]['menu'][0]['category'] = 'internal';
|
||||
$apps[$x]['menu'][0]['path'] = '/app/messages/messages.php';
|
||||
$apps[$x]['menu'][0]['groups'][] = 'superadmin';
|
||||
//$apps[$x]['menu'][0]['groups'][] = 'admin';
|
||||
//$apps[$x]['menu'][0]['groups'][] = 'user';
|
||||
|
||||
?>
|
||||
@@ -1,187 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2018
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
|
||||
//default authorized to false
|
||||
$authorized = false;
|
||||
|
||||
//get the user settings
|
||||
$sql = "select user_uuid, domain_uuid from v_user_settings ";
|
||||
$sql .= "where user_setting_category = 'message' ";
|
||||
$sql .= "and user_setting_subcategory = 'key' ";
|
||||
$sql .= "and user_setting_value = :user_setting_value ";
|
||||
$sql .= "and user_setting_enabled = 'true' ";
|
||||
$parameters['user_setting_value'] = $_GET['key'];
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
if (is_array($row) && @sizeof($row) != 0 && is_uuid($row['user_uuid'])) {
|
||||
$domain_uuid = $row['domain_uuid'];
|
||||
$user_uuid = $row['user_uuid'];
|
||||
$authorized = true;
|
||||
}
|
||||
unset($sql, $parameters, $row);
|
||||
|
||||
//authorization failed
|
||||
if (!$authorized) {
|
||||
//log the failed auth attempt to the system, to be available for fail2ban.
|
||||
openlog('FusionPBX', LOG_NDELAY, LOG_AUTH);
|
||||
syslog(LOG_WARNING, '['.$_SERVER['REMOTE_ADDR']."] authentication failed for ".$_GET['key']);
|
||||
closelog();
|
||||
|
||||
//send http 404
|
||||
header("HTTP/1.0 404 Not Found");
|
||||
echo "<html>\n";
|
||||
echo "<head><title>404 Not Found</title></head>\n";
|
||||
echo "<body bgcolor=\"white\">\n";
|
||||
echo "<center><h1>404 Not Found</h1></center>\n";
|
||||
echo "<hr><center>nginx/1.12.1</center>\n";
|
||||
echo "</body>\n";
|
||||
echo "</html>\n";
|
||||
exit();
|
||||
}
|
||||
|
||||
//get the raw input data
|
||||
$json = file_get_contents('php://input');
|
||||
|
||||
//decode the json into array
|
||||
$message = json_decode($json, true);
|
||||
|
||||
//get the source phone number
|
||||
$phone_number = preg_replace('{[\D]}', '', $message['from']);
|
||||
|
||||
//get the contact uuid
|
||||
$sql = "select c.contact_uuid ";
|
||||
$sql .= "from v_contacts as c, v_contact_phones as p ";
|
||||
$sql .= "where p.contact_uuid = c.contact_uuid ";
|
||||
$sql .= "and p.phone_number = :phone_number ";
|
||||
$sql .= "and c.domain_uuid = :domain_uuid ";
|
||||
$parameters['phone_number'] = $phone_number;
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$contact_uuid = $database->select($sql, $parameters, 'column');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//build message array
|
||||
$message_uuid = uuid();
|
||||
$array['messages'][0]['message_uuid'] = $message_uuid;
|
||||
$array['messages'][0]['domain_uuid'] = $domain_uuid;
|
||||
$array['messages'][0]['user_uuid'] = $user_uuid;
|
||||
$array['messages'][0]['contact_uuid'] = $contact_uuid;
|
||||
$array['messages'][0]['message_uuid'] = $message_uuid;
|
||||
$array['messages'][0]['message_type'] = is_array($message['media']) ? 'mms' : 'sms';
|
||||
$array['messages'][0]['message_direction'] = 'inbound';
|
||||
$array['messages'][0]['message_date'] = 'now()';
|
||||
$array['messages'][0]['message_from'] = $message['from'];
|
||||
$array['messages'][0]['message_to'] = $message['to'];
|
||||
$array['messages'][0]['message_text'] = $message['text'];
|
||||
$array['messages'][0]['message_json'] = $json;
|
||||
|
||||
//add the required permission
|
||||
$p = new permissions;
|
||||
$p->add("message_add", "temp");
|
||||
|
||||
//build message media array (if necessary)
|
||||
if (is_array($message['media'])) {
|
||||
foreach($message['media'] as $index => $media_url) {
|
||||
$media_type = pathinfo($media_url, PATHINFO_EXTENSION);
|
||||
if ($media_type !== 'xml') {
|
||||
$array['message_media'][$index]['message_media_uuid'] = uuid();
|
||||
$array['message_media'][$index]['message_uuid'] = $message_uuid;
|
||||
$array['message_media'][$index]['domain_uuid'] = $domain_uuid;
|
||||
$array['message_media'][$index]['user_uuid'] = $user_uuid;
|
||||
$array['message_media'][$index]['message_media_type'] = $media_type;
|
||||
$array['message_media'][$index]['message_media_url'] = $media_url;
|
||||
$array['message_media'][$index]['message_media_content'] = base64_encode(file_get_contents($media_url));
|
||||
}
|
||||
}
|
||||
|
||||
$p->add("message_media_add", "temp");
|
||||
}
|
||||
|
||||
//save message to the database
|
||||
$database = new database;
|
||||
$database->app_name = 'messages';
|
||||
$database->app_uuid = '4a20815d-042c-47c8-85df-085333e79b87';
|
||||
$database->save($array);
|
||||
$result = $database->message;
|
||||
|
||||
//remove the temporary permission
|
||||
$p->delete("message_add", "temp");
|
||||
$p->delete("message_media_add", "temp");
|
||||
|
||||
//convert the array to json
|
||||
$array_json = json_encode($array);
|
||||
|
||||
//get the list of extensions using the user_uuid
|
||||
$sql = "select * from v_domains as d, v_extensions as e ";
|
||||
$sql .= "where extension_uuid in ( ";
|
||||
$sql .= " select extension_uuid ";
|
||||
$sql .= " from v_extension_users ";
|
||||
$sql .= " where user_uuid = :user_uuid ";
|
||||
$sql .= ") ";
|
||||
$sql .= "and e.domain_uuid = d.domain_uuid ";
|
||||
$sql .= "and e.enabled = 'true' ";
|
||||
$parameters['user_uuid'] = $user_uuid;
|
||||
$database = new database;
|
||||
$extensions = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//create the event socket connection
|
||||
if (is_array($extensions)) {
|
||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
}
|
||||
|
||||
//send the sip message
|
||||
if (is_array($extensions) && @sizeof($extensions) != 0) {
|
||||
foreach ($extensions as $row) {
|
||||
$domain_name = $row['domain_name'];
|
||||
$extension = $row['extension'];
|
||||
$number_alias = $row['number_alias'];
|
||||
|
||||
//send the sip messages
|
||||
$command = "luarun app/messages/resources/send.lua ".$message["from"]."@".$domain_name." ".$extension."@".$domain_name." '".$message["text"]."'";
|
||||
|
||||
//send the command
|
||||
$response = event_socket_request($fp, "api ".$command);
|
||||
$response = event_socket_request($fp, "api log notice ".$command);
|
||||
}
|
||||
}
|
||||
unset($extensions, $row);
|
||||
|
||||
//set the file
|
||||
//$file = '/tmp/sms.txt';
|
||||
|
||||
//save the file
|
||||
//file_put_contents($file, $json);
|
||||
|
||||
//save the data to the file system
|
||||
//file_put_contents($file, $json."\n");
|
||||
//file_put_contents($file, $array_json."\nfrom: ".$message["from"]." to: ".$message["to"]." text: ".$message["text"]."\n$sql_test\njson: ".$json."\n".$saved_result."\n");
|
||||
|
||||
?>
|
||||
@@ -1,387 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2018-2020
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
|
||||
//check permissions
|
||||
if (permission_exists('message_add') || permission_exists('message_edit')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//action add or update
|
||||
if (is_uuid($_REQUEST["id"])) {
|
||||
$action = "update";
|
||||
$message_uuid = $_REQUEST["id"];
|
||||
}
|
||||
else {
|
||||
$action = "add";
|
||||
}
|
||||
|
||||
//get http post variables and set them to php variables
|
||||
if (is_array($_POST)) {
|
||||
$message_uuid = $_POST["message_uuid"];
|
||||
$user_uuid = $_POST["user_uuid"];
|
||||
$message_type = $_POST["message_type"];
|
||||
$message_direction = $_POST["message_direction"];
|
||||
$message_date = $_POST["message_date"];
|
||||
$message_from = $_POST["message_from"];
|
||||
$message_to = $_POST["message_to"];
|
||||
$message_text = $_POST["message_text"];
|
||||
$message_media_type = $_POST["message_media_type"];
|
||||
$message_media_url = $_POST["message_media_url"];
|
||||
$message_media_content = $_POST["message_media_content"];
|
||||
$message_json = $_POST["message_json"];
|
||||
}
|
||||
|
||||
//process the user data and save it to the database
|
||||
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
//get the uuid from the POST
|
||||
if ($action == "update") {
|
||||
$message_uuid = $_POST["message_uuid"];
|
||||
}
|
||||
|
||||
//process the http post data by submitted action
|
||||
if ($_POST['action'] != '' && is_uuid($message_uuid)) {
|
||||
$array[0]['checked'] = 'true';
|
||||
$array[0]['uuid'] = $message_uuid;
|
||||
|
||||
switch ($_POST['action']) {
|
||||
case 'delete':
|
||||
if (permission_exists('message_delete')) {
|
||||
$obj = new messages;
|
||||
$obj->delete($array);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
header('Location: messages_log.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
//validate the token
|
||||
$token = new token;
|
||||
if (!$token->validate($_SERVER['PHP_SELF'])) {
|
||||
message::add($text['message-invalid_token'],'negative');
|
||||
header('Location: messages_log.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
//check for all required data
|
||||
$msg = '';
|
||||
if (strlen($message_type) == 0) { $msg .= $text['message-required']." ".$text['label-message_type']."<br>\n"; }
|
||||
if (strlen($message_direction) == 0) { $msg .= $text['message-required']." ".$text['label-message_direction']."<br>\n"; }
|
||||
if (strlen($message_date) == 0) { $msg .= $text['message-required']." ".$text['label-message_date']."<br>\n"; }
|
||||
if (strlen($message_from) == 0) { $msg .= $text['message-required']." ".$text['label-message_from']."<br>\n"; }
|
||||
if (strlen($message_to) == 0) { $msg .= $text['message-required']." ".$text['label-message_to']."<br>\n"; }
|
||||
//if (strlen($message_text) == 0) { $msg .= $text['message-required']." ".$text['label-message_text']."<br>\n"; }
|
||||
//if (strlen($message_media_type) == 0) { $msg .= $text['message-required']." ".$text['label-message_media_type']."<br>\n"; }
|
||||
//if (strlen($message_media_url) == 0) { $msg .= $text['message-required']." ".$text['label-message_media_url']."<br>\n"; }
|
||||
//if (strlen($message_media_content) == 0) { $msg .= $text['message-required']." ".$text['label-message_media_content']."<br>\n"; }
|
||||
//if (strlen($message_json) == 0) { $msg .= $text['message-required']." ".$text['label-message_json']."<br>\n"; }
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/persist_form_var.php";
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table><tr><td>\n";
|
||||
echo $msg."<br />";
|
||||
echo "</td></tr></table>\n";
|
||||
persistformvar($_POST);
|
||||
echo "</div>\n";
|
||||
require_once "resources/footer.php";
|
||||
return;
|
||||
}
|
||||
|
||||
//add the message_uuid
|
||||
if (!is_uuid($_POST["message_uuid"])) {
|
||||
$message_uuid = uuid();
|
||||
}
|
||||
|
||||
//prepare the array
|
||||
$array['messages'][0]['domain_uuid'] = $_SESSION["domain_uuid"];;
|
||||
$array['messages'][0]['user_uuid'] = $user_uuid;
|
||||
$array['messages'][0]['message_uuid'] = $message_uuid;
|
||||
$array['messages'][0]['message_type'] = $message_type;
|
||||
$array['messages'][0]['message_direction'] = $message_direction;
|
||||
$array['messages'][0]['message_date'] = $message_date;
|
||||
$array['messages'][0]['message_from'] = $message_from;
|
||||
$array['messages'][0]['message_to'] = $message_to;
|
||||
$array['messages'][0]['message_text'] = $message_text;
|
||||
$array['messages'][0]['message_uuid'] = $message_uuid;
|
||||
|
||||
//save to the data
|
||||
$database = new database;
|
||||
$database->app_name = 'messages';
|
||||
$database->app_uuid = '4a20815d-042c-47c8-85df-085333e79b87';
|
||||
$database->save($array);
|
||||
|
||||
//redirect the user
|
||||
if (isset($action)) {
|
||||
if ($action == "add") {
|
||||
message::add($text['message-add']);
|
||||
}
|
||||
if ($action == "update") {
|
||||
message::add($text['message-update']);
|
||||
}
|
||||
header('Location: message_edit.php?id='.$message_uuid);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//pre-populate the form
|
||||
if (is_array($_GET) && $_POST["persistformvar"] != "true") {
|
||||
$message_uuid = $_GET["id"];
|
||||
$sql = "select * from v_messages ";
|
||||
$sql .= "where message_uuid = :message_uuid ";
|
||||
$parameters['message_uuid'] = $message_uuid;
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
if (is_array($row) && @sizeof($row) != 0) {
|
||||
$user_uuid = $row["user_uuid"];
|
||||
$message_type = $row["message_type"];
|
||||
$message_direction = $row["message_direction"];
|
||||
$message_date = $row["message_date"];
|
||||
$message_from = $row["message_from"];
|
||||
$message_to = $row["message_to"];
|
||||
$message_text = $row["message_text"];
|
||||
$message_media_type = $row["message_media_type"];
|
||||
$message_media_url = $row["message_media_url"];
|
||||
$message_media_content = $row["message_media_content"];
|
||||
$message_json = $row["message_json"];
|
||||
}
|
||||
unset($sql, $parameters);
|
||||
}
|
||||
|
||||
//get the users
|
||||
$sql = "select user_uuid, username from v_users ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql .= "and user_enabled = 'true' ";
|
||||
$sql .= "order by username asc ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$users = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//create token
|
||||
$object = new token;
|
||||
$token = $object->create($_SERVER['PHP_SELF']);
|
||||
|
||||
//include the header
|
||||
$document['title'] = $text['title-message'];
|
||||
require_once "resources/header.php";
|
||||
|
||||
//show the content
|
||||
echo "<form name='frm' id='frm' method='post'>\n";
|
||||
|
||||
echo "<div class='action_bar' id='action_bar'>\n";
|
||||
echo " <div class='heading'><b>".$text['title-message']."</b></div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','link'=>'messages_log.php']);
|
||||
if ($action == 'update' && permission_exists('message_delete')) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'name'=>'btn_delete','style'=>'margin-left: 15px;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
|
||||
}
|
||||
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','style'=>'margin-left: 15px;']);
|
||||
echo " </div>\n";
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
if ($action == 'update' && permission_exists('message_delete')) {
|
||||
echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'delete','onclick'=>"modal_close();"])]);
|
||||
}
|
||||
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-username']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td width='70%' class='vtable' style='position: relative;' align='left'>\n";
|
||||
echo " <select class='formfld' name='user_uuid'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
foreach($users as $row) {
|
||||
echo " <option value='".escape($row['user_uuid'])."' ".($row['user_uuid'] == $user_uuid ? "selected='selected'" : null).">".escape($row['username'])."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-username']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-message_type']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
||||
echo " <select class='formfld' name='message_type'>\n";
|
||||
echo " <option value='sms' ".($message_type == 'sms' ? "selected='selected'" : null).">".$text['label-sms']."</option>\n";
|
||||
echo " <option value='mms' ".($message_type == 'mms' ? "selected='selected'" : null).">".$text['label-mms']."</option>\n";
|
||||
echo " <option value='chat' ".($message_type == 'chat' ? "selected='selected'" : null).">".$text['label-chat']."</option>\n";
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-message_type']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-message_direction']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
||||
echo " <select class='formfld' name='message_direction'>\n";
|
||||
echo " <option value='inbound' ".($message_direction == 'inbound' ? "selected='selected'" : null).">".$text['label-inbound']."</option>\n";
|
||||
echo " <option value='outbound' ".($message_direction == 'outbound' ? "selected='selected'" : null).">".$text['label-outbound']."</option>\n";
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-message_direction']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-message_date']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='message_date' maxlength='255' value=\"".escape($message_date)."\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-message_date']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-message_from']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='message_from' maxlength='255' value=\"".escape($message_from)."\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-message_from']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-message_to']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='message_to' maxlength='255' value=\"".escape($message_to)."\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-message_to']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-message_text']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
||||
echo " <textarea class='formfld' style='min-width: 40%; height: 100px;' name='message_text'>".escape($message_text)."</textarea>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-message_text']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
if (strlen($message_media_type) > 0) {
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " \n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
||||
$image_source = 'data: '.mime_content_type($message_media_type).';base64,'.$message_media_content;
|
||||
echo "<img src='".$image_source."' width='100%'>";
|
||||
echo "<br />\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
if ($_GET['debug'] == 'true') {
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-message_media_type']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='message_media_type' maxlength='255' value=\"".escape($message_media_type)."\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-message_media_type']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-message_media_url']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='message_media_url' maxlength='255' value=\"".escape($message_media_url)."\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-message_media_url']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-message_media_content']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='message_media_content' maxlength='255' value=\"".escape($message_media_content)."\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-message_media_content']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-message_json']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' style='position: relative;' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='message_json' maxlength='255' value=\"".escape($message_json)."\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-message_json']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
echo "</table>\n";
|
||||
echo "<br /><br />\n";
|
||||
|
||||
echo "<input type='hidden' name='message_uuid' value='".escape($message_uuid)."'>\n";
|
||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
|
||||
echo "</form>";
|
||||
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
@@ -1,99 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2016-2018
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//get media uuid
|
||||
$message_media_uuid = $_GET['id'];
|
||||
$message_media_source = escape($_GET['src']);
|
||||
$action = $_GET['action'];
|
||||
|
||||
//get media
|
||||
if (is_uuid($message_media_uuid)) {
|
||||
|
||||
$sql = "select message_media_type, message_media_url, message_media_content ";
|
||||
$sql .= "from v_message_media ";
|
||||
$sql .= "where message_media_uuid = :message_media_uuid ";
|
||||
if (is_uuid($_SESSION['user_uuid'])) {
|
||||
$sql .= "and user_uuid = :user_uuid ";
|
||||
$parameters['user_uuid'] = $_SESSION['user_uuid'];
|
||||
}
|
||||
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
|
||||
$parameters['message_media_uuid'] = $message_media_uuid;
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$media = $database->select($sql, $parameters, 'row');
|
||||
unset($sql, $parameters);
|
||||
|
||||
switch (strtolower($media['message_media_type'])) {
|
||||
case 'jpg':
|
||||
case 'jpeg': $content_type = 'image/jpg'; break;
|
||||
case 'png': $content_type = 'image/png'; break;
|
||||
case 'gif': $content_type = 'image/gif'; break;
|
||||
case 'aac': $content_type = 'audio/aac'; break;
|
||||
case 'wav': $content_type = 'audio/wav'; break;
|
||||
case 'mp3': $content_type = 'audio/mpeg'; break;
|
||||
case 'mp2': $content_type = 'video/mpeg'; break;
|
||||
case 'm4v': $content_type = 'video/mp4'; break;
|
||||
case 'pdf': $content_type = 'application/pdf'; break;
|
||||
case 'doc': $content_type = 'application/vnd.ms-word'; break;
|
||||
case 'docx': $content_type = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; break;
|
||||
case 'xls': $content_type = 'application/vnd.ms-excel'; break;
|
||||
case 'xlsx': $content_type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; break;
|
||||
case 'ppt': $content_type = 'application/vnd.ms-powerpoint'; break;
|
||||
case 'pptx': $content_type = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'; break;
|
||||
case 'zip': $content_tyep = 'application/zip'; break;
|
||||
default: $content_type = 'application/octet-stream'; break;
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
case 'download':
|
||||
header("Content-type: ".$content_type."; charset=utf-8");
|
||||
$filename = $message_media_source != '' ? $message_media_source."_".$message_media_uuid.".".strtolower($media['message_media_type']) : $media['message_media_url'];
|
||||
header("Content-Disposition: attachment; filename=\"".$filename."\"");
|
||||
header("Content-Length: ".strlen(base64_decode($media['message_media_content'])));
|
||||
echo base64_decode($media['message_media_content']);
|
||||
break;
|
||||
case 'display':
|
||||
echo " <table cellpadding='0' cellspacing='0' border='0' width='100%' height='100%'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td align='center' valign='middle'>\n";
|
||||
echo " <img src=\"data:".$content_type.";base64,".$media['message_media_content']."\" style='width: auto; max-width: 95%; height: auto; max-height: 800px; box-shadow: 0px 1px 20px #888; cursor: pointer;' onclick=\"$('#message_media_layer').fadeOut(200);\" oncontextmenu=\"window.open('message_media.php?id=".$message_media_uuid."&src=".$message_media_source."&action=download'); return false;\" title=\"Click to Close, Right-Click to Save\">\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,188 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2018
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
|
||||
//check permissions
|
||||
require_once "resources/check_auth.php";
|
||||
if (!permission_exists('message_add') && !permission_exists('message_edit')) {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//define the http request
|
||||
function http_request($url, $method, $headers = null, $content) {
|
||||
$options = array(
|
||||
'http'=>array(
|
||||
'method'=>$method,
|
||||
'header'=>$headers,
|
||||
'content'=>$content
|
||||
));
|
||||
$context = stream_context_create($options);
|
||||
$response = file_get_contents($url, false, $context);
|
||||
if ($response === false) {
|
||||
throw new Exception("Problem reading data from $url, $php_errormsg");
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
//get http post variables and set them to php variables
|
||||
if (is_array($_POST)) {
|
||||
$message_from = $_POST["message_from"];
|
||||
$message_to = $_POST["message_to"];
|
||||
$message_text = $_POST["message_text"];
|
||||
$message_media = $_FILES["message_media"];
|
||||
}
|
||||
|
||||
//process the user data and save it to the database
|
||||
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
//get the source phone number
|
||||
$phone_number = preg_replace('{[\D]}', '', $message_to);
|
||||
|
||||
//error check
|
||||
if (
|
||||
!is_numeric($message_from) ||
|
||||
!is_numeric($message_to) ||
|
||||
$message_text == '') {
|
||||
exit;
|
||||
}
|
||||
|
||||
// handle media (if any)
|
||||
if (is_array($message_media) && @sizeof($message_media) != 0) {
|
||||
// reorganize media array, ignore errored files
|
||||
$f = 0;
|
||||
foreach ($message_media['error'] as $index => $error) {
|
||||
if ($error == 0) {
|
||||
$tmp_media[$f]['uuid'] = uuid();
|
||||
$tmp_media[$f]['name'] = $message_media['name'][$index];
|
||||
$tmp_media[$f]['type'] = $message_media['type'][$index];
|
||||
$tmp_media[$f]['tmp_name'] = $message_media['tmp_name'][$index];
|
||||
$tmp_media[$f]['size'] = $message_media['size'][$index];
|
||||
$f++;
|
||||
}
|
||||
}
|
||||
$message_media = $tmp_media;
|
||||
unset($tmp_media, $f);
|
||||
}
|
||||
$message_type = is_array($message_media) && @sizeof($message_media) != 0 ? 'mms' : 'sms';
|
||||
|
||||
//get the contact uuid
|
||||
$sql = "select c.contact_uuid ";
|
||||
$sql .= "from v_contacts as c, v_contact_phones as p ";
|
||||
$sql .= "where p.contact_uuid = c.contact_uuid ";
|
||||
$sql .= "and p.phone_number like :phone_number ";
|
||||
$sql .= "and c.domain_uuid = :domain_uuid ";
|
||||
$parameters['phone_number'] = '%'.$phone_number.'%';
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$contact_uuid = $database->select($sql, $parameters, 'column');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//build the message array
|
||||
$message_uuid = uuid();
|
||||
$array['messages'][0]['domain_uuid'] = $_SESSION["domain_uuid"];
|
||||
$array['messages'][0]['message_uuid'] = $message_uuid;
|
||||
$array['messages'][0]['user_uuid'] = $_SESSION["user_uuid"];
|
||||
$array['messages'][0]['contact_uuid'] = $contact_uuid;
|
||||
$array['messages'][0]['message_type'] = $message_type;
|
||||
$array['messages'][0]['message_direction'] = 'outbound';
|
||||
$array['messages'][0]['message_date'] = 'now()';
|
||||
$array['messages'][0]['message_from'] = $message_from;
|
||||
$array['messages'][0]['message_to'] = $message_to;
|
||||
$array['messages'][0]['message_text'] = $message_text;
|
||||
|
||||
//build message media array (if necessary)
|
||||
$p = new permissions;
|
||||
if (is_array($message_media) && @sizeof($message_media) != 0) {
|
||||
foreach($message_media as $index => $media) {
|
||||
$array['message_media'][$index]['message_media_uuid'] = $media['uuid'];
|
||||
$array['message_media'][$index]['message_uuid'] = $message_uuid;
|
||||
$array['message_media'][$index]['domain_uuid'] = $_SESSION["domain_uuid"];
|
||||
$array['message_media'][$index]['user_uuid'] = $_SESSION["user_uuid"];
|
||||
$array['message_media'][$index]['message_media_type'] = strtolower(pathinfo($media['name'], PATHINFO_EXTENSION));
|
||||
$array['message_media'][$index]['message_media_url'] = $media['name'];
|
||||
$array['message_media'][$index]['message_media_content'] = base64_encode(file_get_contents($media['tmp_name']));
|
||||
}
|
||||
|
||||
$p->add('message_media_add', 'temp');
|
||||
}
|
||||
|
||||
//save to the data
|
||||
$database = new database;
|
||||
$database->app_name = 'messages';
|
||||
$database->app_uuid = '4a20815d-042c-47c8-85df-085333e79b87';
|
||||
$database->save($array);
|
||||
unset($array);
|
||||
|
||||
//remove any temporary permissions
|
||||
$p->delete('message_media_add', 'temp');
|
||||
|
||||
//santize the from
|
||||
$message_from = preg_replace('{[\D]}', '', $message_from);
|
||||
|
||||
//prepare message to send
|
||||
$message['to'] = $message_to;
|
||||
$message['text'] = $message_text;
|
||||
if (is_array($message_media) && @sizeof($message_media) != 0) {
|
||||
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? 'https://' : 'http://';
|
||||
foreach ($message_media as $index => $media) {
|
||||
$path = $protocol.$_SERVER['HTTP_HOST'].'/app/messages/message_media.php?id='.$media['uuid'].'&action=download&.'.strtolower(pathinfo($media['name'], PATHINFO_EXTENSION));
|
||||
$message['media'][] = $path;
|
||||
}
|
||||
}
|
||||
$http_content = json_encode($message);
|
||||
|
||||
//settings needed for REST API
|
||||
$http_method = $_SESSION['message']['http_method']['text'];
|
||||
$http_content_type = $_SESSION['message']['http_content_type']['text'];
|
||||
$http_destination = $_SESSION['message']['http_destination']['text'];
|
||||
$http_auth_enabled = $_SESSION['message']['http_auth_enabled']['boolean'];
|
||||
$http_auth_type = $_SESSION['message']['http_auth_type']['text'];
|
||||
$http_auth_user = $_SESSION['message']['http_auth_user']['text'];
|
||||
$http_auth_password = $_SESSION['message']['http_auth_password']['text'];
|
||||
|
||||
//exchange variable name with their values
|
||||
$http_destination = str_replace("\${from}", $message_from, $http_destination);
|
||||
|
||||
//send the message to the provider
|
||||
$headers[] = "Content-type: ".trim($http_content_type);
|
||||
if ($http_auth_type == 'basic') {
|
||||
$headers[] = "Authorization: Basic ".base64_encode($http_auth_user.':'.$http_auth_password);
|
||||
}
|
||||
$response = http_request($http_destination, $http_method, $headers, $http_content);
|
||||
|
||||
//redirect the user
|
||||
return true;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,362 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2016-2020
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
|
||||
//check permissions
|
||||
if (!permission_exists('message_view')) {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//get (from) destinations
|
||||
$sql = "select destination_number from v_destinations ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql .= "and destination_type_text = 1 ";
|
||||
$sql .= "and destination_enabled = 'true' ";
|
||||
$sql .= "order by destination_number asc ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$rows = $database->select($sql, $parameters, 'all');
|
||||
if (is_array($rows) && @sizeof($rows)) {
|
||||
foreach ($rows as $row) {
|
||||
$destinations[] = $row['destination_number'];
|
||||
}
|
||||
}
|
||||
unset($sql, $parameters, $rows, $row);
|
||||
|
||||
//get self (primary contact attachment) image
|
||||
if (!is_array($_SESSION['tmp']['messages']['contact_me'])) {
|
||||
$sql = "select attachment_filename as filename, attachment_content as image ";
|
||||
$sql .= "from v_contact_attachments ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql .= "and contact_uuid = :contact_uuid ";
|
||||
$sql .= "and attachment_primary = 1 ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$parameters['contact_uuid'] = $_SESSION['user']['contact_uuid'];
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
$_SESSION['tmp']['messages']['contact_me'] = $row;
|
||||
unset($sql, $parameters, $row);
|
||||
}
|
||||
|
||||
//additional includes
|
||||
$document['title'] = $text['title-messages'];
|
||||
require_once "resources/header.php";
|
||||
|
||||
//resize thread window on window resize
|
||||
echo "<script language='JavaScript' type='text/javascript'>\n";
|
||||
echo " $(document).ready(function() {\n";
|
||||
echo " $(window).on('resizeEnd', function() {\n";
|
||||
echo " $('div#thread_messages').animate({ 'max-height': $(window).height() - 480 }, 200);\n";
|
||||
echo " });\n";
|
||||
echo " });\n";
|
||||
echo "</script>\n";
|
||||
|
||||
//styles
|
||||
echo "<style>\n";
|
||||
|
||||
echo " #message_new_layer {\n";
|
||||
echo " z-index: 999999;\n";
|
||||
echo " position: absolute;\n";
|
||||
echo " left: 0;\n";
|
||||
echo " top: 0;\n";
|
||||
echo " right: 0;\n";
|
||||
echo " bottom: 0;\n";
|
||||
echo " text-align: center;\n";
|
||||
echo " vertical-align: middle;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " #message_new_container {\n";
|
||||
echo " display: block;\n";
|
||||
echo " background-color: #fff;\n";
|
||||
echo " padding: 20px 30px;\n";
|
||||
if (http_user_agent('mobile')) {
|
||||
echo " margin: 0;\n";
|
||||
}
|
||||
else {
|
||||
echo " margin: auto 30%;\n";
|
||||
}
|
||||
echo " text-align: left;\n";
|
||||
echo " -webkit-box-shadow: 0px 1px 20px #888;\n";
|
||||
echo " -moz-box-shadow: 0px 1px 20px #888;\n";
|
||||
echo " box-shadow: 0px 1px 20px #888;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " #message_media_layer {\n";
|
||||
echo " z-index: 999999;\n";
|
||||
echo " position: absolute;\n";
|
||||
echo " left: 0;\n";
|
||||
echo " top: 0;\n";
|
||||
echo " right: 0;\n";
|
||||
echo " bottom: 0;\n";
|
||||
echo " text-align: center;\n";
|
||||
echo " vertical-align: middle;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " td.contact_selected {\n";
|
||||
echo " border-right: 5px solid ".($SESSION['theme']['table_row_border_color']['text'] != '' ? $SESSION['theme']['table_row_border_color']['text'] : '#c5d1e5').";\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " .contact_list_image {\n";
|
||||
echo " float: left;\n";
|
||||
echo " width: 75px;\n";
|
||||
echo " height: 75px;\n";
|
||||
echo " margin: 3px 8px 3px 2px;\n";
|
||||
echo " border: 1px solid ".($SESSION['theme']['table_row_border_color']['text'] != '' ? $SESSION['theme']['table_row_border_color']['text'] : '#c5d1e5').";\n";
|
||||
echo " background-repeat: no-repeat;\n";
|
||||
echo " background-size: cover;\n";
|
||||
echo " background-position: center center;\n";
|
||||
echo " border-radius: 11px;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo "</style>\n";
|
||||
|
||||
//cache self (primary contact attachment) image
|
||||
if (is_array($_SESSION['tmp']['messages']['contact_me']) && sizeof($_SESSION['tmp']['messages']['contact_me']) != 0) {
|
||||
$attachment_type = strtolower(pathinfo($_SESSION['tmp']['messages']['contact_me']['filename'], PATHINFO_EXTENSION));
|
||||
echo "<img id='src_message-bubble-image-me' style='display: none;' src='data:image/".$attachment_type.";base64,".$_SESSION['tmp']['messages']['contact_me']['image']."'>\n";
|
||||
}
|
||||
|
||||
//new message layer
|
||||
if (permission_exists('message_add')) {
|
||||
echo "<div id='message_new_layer' style='display: none;'>\n";
|
||||
echo " <table cellpadding='0' cellspacing='0' border='0' width='100%' height='100%'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td align='center' valign='middle'>\n";
|
||||
echo " <form id='message_new' method='post' enctype='multipart/form-data' action='message_send.php'>\n";
|
||||
echo " <span id='message_new_container'>\n";
|
||||
echo " <b>".$text['label-new_message']."</b><br /><br />\n";
|
||||
echo " <table width='100%'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td class='vncell'>".$text['label-message_from']."</td>\n";
|
||||
echo " <td class='vtable'>\n";
|
||||
if (is_array($destinations) && sizeof($destinations) != 0) {
|
||||
echo " <select class='formfld' name='message_from' id='message_new_from' onchange=\"$('#message_new_to').trigger('focus');\">\n";
|
||||
foreach ($destinations as $destination) {
|
||||
echo " <option value='".$destination."'>".format_phone($destination)."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
}
|
||||
else {
|
||||
echo " <input type='text' class='formfld' name='message_from' id='message_new_from'>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td class='vncell'>".$text['label-message_to']."</td>\n";
|
||||
echo " <td class='vtable'>\n";
|
||||
echo " <input type='text' class='formfld' name='message_to' id='message_new_to'>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td class='vncell'>".$text['label-message_text']."</td>\n";
|
||||
echo " <td class='vtable'>\n";
|
||||
echo " <textarea class='formfld' style='width: 100%; height: 80px;' name='message_text' name='message_new_text'></textarea>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td class='vncell'>".$text['label-message_media']."</td>\n";
|
||||
echo " <td class='vtable'>\n";
|
||||
echo " <input type='file' class='formfld' multiple='multiple' name='message_media[]' id='message_new_media'>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
echo " <center style='margin-top: 15px;'>\n";
|
||||
echo button::create(['type'=>'reset','label'=>$text['button-clear'],'icon'=>$_SESSION['theme']['button_icon_reset'],'style'=>'float: left;','onclick'=>"$('#message_new').reset();"]);
|
||||
echo button::create(['type'=>'button','label'=>$text['button-close'],'icon'=>$_SESSION['theme']['button_icon_cancel'],'onclick'=>"$('#message_new_layer').fadeOut(200);"]);
|
||||
echo button::create(['type'=>'submit','label'=>$text['button-send'],'icon'=>'paper-plane','style'=>'float: right;']);
|
||||
echo " </center>\n";
|
||||
echo " </span>\n";
|
||||
echo " </form>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
echo "</div>\n";
|
||||
}
|
||||
|
||||
//message media layer
|
||||
echo "<div id='message_media_layer' style='display: none;'></div>\n";
|
||||
|
||||
//show the content
|
||||
echo "<div class='action_bar' id='action_bar'>\n";
|
||||
echo " <div class='heading'><b>".$text['title-messages']."</b></div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
if (permission_exists('message_add')) {
|
||||
echo button::create(['type'=>'button','label'=>$text['label-new_message'],'icon'=>$_SESSION['theme']['button_icon_add'],'id'=>'btn_add','onclick'=>"$('#message_new_layer').fadeIn(200); unload_thread();"]);
|
||||
}
|
||||
echo button::create(['type'=>'button','label'=>$text['label-log'],'icon'=>'list','link'=>'messages_log.php']);
|
||||
echo " </div>\n";
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <th width='30%'>".$text['label-contacts']."</th>\n";
|
||||
echo " <th style='white-space: nowrap;'><nobr>".$text['label-messages']."<nobr></th>\n";
|
||||
echo " <th width='70%' style='text-align: right; font-weight: normal;' id='contact_current_name'></th>\n";
|
||||
echo " </tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td id='contacts' valign='top'><center>···</center></td>\n";
|
||||
echo " <td id='thread' colspan='2' valign='top' style='border-left: 1px solid #c5d1e5; padding: 15px 0 15px 15px;'><center>···</center></td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "<input type='hidden' id='contact_current_number' value=''>\n";
|
||||
|
||||
//js to load messages for clicked number
|
||||
echo "<script>\n";
|
||||
|
||||
$refresh_contacts = is_numeric($_SESSION['message']['refresh_contacts']['numeric']) && $_SESSION['message']['refresh_contacts']['numeric'] > 0 ? $_SESSION['message']['refresh_contacts']['numeric'] : 10; //default (seconds)
|
||||
$refresh_thread = is_numeric($_SESSION['message']['refresh_thread']['numeric']) && $_SESSION['message']['refresh_thread']['numeric'] > 0 ? $_SESSION['message']['refresh_thread']['numeric'] : 5; //default (seconds)
|
||||
echo " var contacts_refresh = ".($refresh_contacts * 1000).";\n";
|
||||
echo " var thread_refresh = ".($refresh_thread * 1000).";\n";
|
||||
echo " var timer_contacts;\n";
|
||||
echo " var timer_thread;\n";
|
||||
|
||||
echo " function refresh_contacts() {\n";
|
||||
echo " clearTimeout(timer_contacts);\n";
|
||||
echo " $('#contacts').load('messages_contacts.php?sel=' + $('#contact_current_number').val(), function(){\n";
|
||||
echo " timer_contacts = setTimeout(refresh_contacts, contacts_refresh);\n";
|
||||
echo " });\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " function load_thread(number, contact_uuid) {\n";
|
||||
echo " clearTimeout(timer_thread);\n";
|
||||
echo " $('#thread').load('messages_thread.php?number=' + encodeURIComponent(number) + '&contact_uuid=' + encodeURIComponent(contact_uuid), function(){\n";
|
||||
echo " $('div#thread_messages').animate({ 'max-height': $(window).height() - 470 }, 200, function() {\n";
|
||||
echo " $('#thread_messages').scrollTop(Number.MAX_SAFE_INTEGER);\n"; //chrome
|
||||
echo " $('span#thread_bottom')[0].scrollIntoView(true);\n"; //others
|
||||
//note: the order of the above two lines matters!
|
||||
if (!http_user_agent('mobile')) {
|
||||
echo " if ($('#message_new_layer').is(':hidden')) {\n";
|
||||
echo " $('#message_text').trigger('focus');\n";
|
||||
echo " }\n";
|
||||
}
|
||||
echo " refresh_contacts();\n";
|
||||
echo " timer_thread = setTimeout(refresh_thread_start, thread_refresh, number, contact_uuid);\n";
|
||||
echo " });\n";
|
||||
echo " });\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " function unload_thread() {\n";
|
||||
echo " clearTimeout(timer_thread);\n";
|
||||
echo " $('#thread').html('<center>···</center>');\n";
|
||||
echo " $('#contact_current_number').val('');\n";
|
||||
echo " $('#contact_current_name').html('');\n";
|
||||
echo " refresh_contacts();\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " function refresh_thread(number, contact_uuid, onsent) {\n";
|
||||
echo " $('#thread_messages').load('messages_thread.php?refresh=true&number=' + encodeURIComponent(number) + '&contact_uuid=' + encodeURIComponent(contact_uuid), function(){\n";
|
||||
echo " $('div#thread_messages').animate({ 'max-height': $(window).height() - 470 }, 200, function() {\n";
|
||||
echo " $('#thread_messages').scrollTop(Number.MAX_SAFE_INTEGER);\n"; //chrome
|
||||
echo " $('span#thread_bottom')[0].scrollIntoView(true);\n"; //others
|
||||
//note: the order of the above two lines matters!
|
||||
if (!http_user_agent('mobile')) {
|
||||
echo " if ($('#message_new_layer').is(':hidden')) {\n";
|
||||
echo " $('#message_text').trigger('focus');\n";
|
||||
echo " }\n";
|
||||
}
|
||||
echo " if (onsent != 'true') {\n";
|
||||
echo " timer_thread = setTimeout(refresh_thread, thread_refresh, number, contact_uuid);\n";
|
||||
echo " }\n";
|
||||
echo " });\n";
|
||||
echo " });\n";
|
||||
echo " }\n";
|
||||
|
||||
//refresh controls
|
||||
echo " function refresh_contacts_stop() {\n";
|
||||
echo " clearTimeout(timer_contacts);\n";
|
||||
echo " document.getElementById('contacts_refresh_state').innerHTML = \"<img src='resources/images/refresh_paused.png' style='width: 16px; height: 16px; border: none; margin-top: 1px; cursor: pointer;' onclick='refresh_contacts_start();' alt='".$text['label-refresh_enable']."' title='".$text['label-refresh_enable']."'>\";\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " function refresh_contacts_start() {\n";
|
||||
echo " if (document.getElementById('contacts_refresh_state')) {\n";
|
||||
echo " document.getElementById('contacts_refresh_state').innerHTML = \"<img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' onclick='refresh_contacts_stop();' alt='".$text['label-refresh_pause']."' title='".$text['label-refresh_pause']."'>\";\n";
|
||||
echo " refresh_contacts();\n";
|
||||
echo " }\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " function refresh_thread_stop(number, contact_uuid) {\n";
|
||||
echo " clearTimeout(timer_thread);\n";
|
||||
?> document.getElementById('thread_refresh_state').innerHTML = "<img src='resources/images/refresh_paused.png' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' onclick=\"refresh_thread_start('" + number + "', '" + contact_uuid + "');\" alt=\"<?php echo $text['label-refresh_enable']; ?>\" title=\"<?php echo $text['label-refresh_enable']; ?>\">";<?php
|
||||
echo " }\n";
|
||||
|
||||
echo " function refresh_thread_start(number, contact_uuid) {\n";
|
||||
echo " if (document.getElementById('thread_refresh_state')) {\n";
|
||||
?> document.getElementById('thread_refresh_state').innerHTML = "<img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' onclick=\"refresh_thread_stop('" + number + "', '" + contact_uuid + "');\" alt=\"<?php echo $text['label-refresh_pause']; ?>\" title=\"<?php echo $text['label-refresh_pause']; ?>\">";<?php
|
||||
echo " refresh_thread(number, contact_uuid);\n";
|
||||
echo " }\n";
|
||||
echo " }\n";
|
||||
|
||||
//define form submit function
|
||||
if (permission_exists('message_add')) {
|
||||
echo " $('#message_new').submit(function(event) {\n";
|
||||
echo " event.preventDefault();\n";
|
||||
echo " $.ajax({\n";
|
||||
echo " url: $(this).attr('action'),\n";
|
||||
echo " type: $(this).attr('method'),\n";
|
||||
echo " data: new FormData(this),\n";
|
||||
echo " processData: false,\n";
|
||||
echo " contentType: false,\n";
|
||||
echo " cache: false,\n";
|
||||
echo " success: function(){\n";
|
||||
echo " if ($.isNumeric($('#message_new_to').val())) {\n";
|
||||
echo " $('#contact_current_number').val($('#message_new_to').val());\n";
|
||||
echo " load_thread($('#message_new_to').val());\n";
|
||||
echo " }\n";
|
||||
echo " $('#message_new_layer').fadeOut(400);\n";
|
||||
echo " document.getElementById('message_new').reset();\n";
|
||||
echo " refresh_contacts();\n";
|
||||
echo " }\n";
|
||||
echo " });\n";
|
||||
echo " });\n";
|
||||
}
|
||||
|
||||
//open message media in layer
|
||||
echo " function display_media(id, src) {\n";
|
||||
echo " $('#message_media_layer').load('message_media.php?id=' + id + '&src=' + src + '&action=display', function(){\n";
|
||||
echo " $('#message_media_layer').fadeIn(200);\n";
|
||||
echo " });\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " refresh_contacts();\n";
|
||||
|
||||
echo "</script>\n";
|
||||
|
||||
unset($messages, $message, $numbers, $number);
|
||||
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
@@ -1,243 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2016-2019
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
|
||||
//check permissions
|
||||
if (!permission_exists('message_view')) {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//get selected number/contact
|
||||
$current_contact = $_GET['sel'];
|
||||
|
||||
//get the list
|
||||
if (isset($_SESSION['message']['display_last']['text']) && $_SESSION['message']['display_last']['text'] != '') {
|
||||
$array = explode(' ',$_SESSION['message']['display_last']['text']);
|
||||
if (is_array($array) && is_numeric($array[0]) && $array[0] > 0) {
|
||||
if ($array[1] == 'messages') {
|
||||
$limit = limit_offset($array[0], 0);
|
||||
}
|
||||
else {
|
||||
$since = "and message_date >= :message_date ";
|
||||
$parameters['message_date'] = date("Y-m-d H:i:s", strtotime('-'.$_SESSION['message']['display_last']['text']));
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($limit == '' && $since == '') { $limit = limit_offset(25, 0); } //default (message count)
|
||||
$sql = "select message_direction, message_from, message_to, contact_uuid ";
|
||||
$sql .= "from v_messages ";
|
||||
$sql .= "where user_uuid = :user_uuid ";
|
||||
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
|
||||
$sql .= $since;
|
||||
$sql .= "order by message_date desc ";
|
||||
$sql .= $limit;
|
||||
$parameters['user_uuid'] = $_SESSION['user_uuid'];
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$messages = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//parse out numbers
|
||||
if (is_array($messages) && @sizeof($messages) != 0) {
|
||||
$numbers = [];
|
||||
foreach($messages as $message) {
|
||||
$number_from = preg_replace('{[\D]}', '', $message['message_from']);
|
||||
$number_to = preg_replace('{[\D]}', '', $message['message_to']);
|
||||
if (!in_array($number_from, $numbers)) {
|
||||
$numbers[] = $number_from;
|
||||
}
|
||||
if (!in_array($number_to, $numbers)) {
|
||||
$numbers[] = $number_to;
|
||||
}
|
||||
switch ($message['message_direction']) {
|
||||
case 'inbound':
|
||||
if (!is_uuid($contact[$number_from]['contact_uuid'])) {
|
||||
$contact[$number_from]['contact_uuid'] = $message['contact_uuid'];
|
||||
}
|
||||
break;
|
||||
case 'outbound':
|
||||
if (!is_uuid($contact[$number_to]['contact_uuid'])) {
|
||||
$contact[$number_to]['contact_uuid'] = $message['contact_uuid'];
|
||||
}
|
||||
break;
|
||||
}
|
||||
unset($number_from, $number_to);
|
||||
}
|
||||
}
|
||||
unset($messages, $message);
|
||||
|
||||
//get contact details, if uuid available
|
||||
if (is_array($contact) && sizeof($contact) != 0) {
|
||||
foreach ($contact as $number => $field) {
|
||||
if (is_uuid($field['contact_uuid'])) {
|
||||
$sql = "select c.contact_name_given, c.contact_name_family, ";
|
||||
$sql .= "(select ce.email_address from v_contact_emails as ce where ce.contact_uuid = c.contact_uuid and ce.email_primary = 1) as contact_email ";
|
||||
$sql .= "from v_contacts as c ";
|
||||
$sql .= "where c.contact_uuid = :contact_uuid ";
|
||||
$sql .= "and (c.domain_uuid = :domain_uuid or c.domain_uuid is null) ";
|
||||
$parameters['contact_uuid'] = $field['contact_uuid'];
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
if (is_array($row) && @sizeof($row) != 0) {
|
||||
$contact[$number]['contact_uuid'] = $field['contact_uuid'];
|
||||
$contact[$number]['contact_name_given'] = $row['contact_name_given'];
|
||||
$contact[$number]['contact_name_family'] = $row['contact_name_family'];
|
||||
$contact[$number]['contact_email'] = $row['contact_email'];
|
||||
}
|
||||
unset($sql, $parameters, $row);
|
||||
}
|
||||
else {
|
||||
unset($contact[$number]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//get destinations and remove from numbers array
|
||||
$sql = "select destination_number from v_destinations ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql .= "and destination_enabled = 'true' ";
|
||||
$sql .= "order by destination_number asc ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$rows = $database->select($sql, $parameters, 'all');
|
||||
if (is_array($rows) && @sizeof($rows)) {
|
||||
foreach ($rows as $row) {
|
||||
$destinations[] = $row['destination_number'];
|
||||
}
|
||||
}
|
||||
unset($sql, $parameters, $rows, $row);
|
||||
|
||||
if (
|
||||
is_array($numbers) &&
|
||||
@sizeof($numbers) != 0 &&
|
||||
is_array($destinations) &&
|
||||
@sizeof($destinations) != 0 &&
|
||||
!is_null(array_diff($numbers, $destinations))
|
||||
) {
|
||||
$numbers = array_diff($numbers, $destinations);
|
||||
}
|
||||
|
||||
//get contact (primary attachment) images and cache them
|
||||
if (is_array($numbers) && @sizeof($numbers) != 0) {
|
||||
foreach ($numbers as $number) {
|
||||
$contact_uuids[] = $contact[$number]['contact_uuid'];
|
||||
}
|
||||
if (is_array($contact_uuids) && @sizeof($contact_uuids) != 0) {
|
||||
$sql = "select contact_uuid as uuid, attachment_filename as filename, attachment_content as image ";
|
||||
$sql .= "from v_contact_attachments ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql .= "and (";
|
||||
foreach ($contact_uuids as $index => $contact_uuid) {
|
||||
$sql_where[] = "contact_uuid = :contact_uuid_".$index;
|
||||
$parameters['contact_uuid_'.$index] = $contact_uuid;
|
||||
}
|
||||
$sql .= implode(' or ', $sql_where);
|
||||
$sql .= ") ";
|
||||
$sql .= "and attachment_primary = 1 ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$contact_ems = $database->select($sql, $parameters, 'all');
|
||||
if (is_array($contact_ems) && @sizeof($contact_ems) != 0) {
|
||||
foreach ($contact_ems as $contact_em) {
|
||||
$_SESSION['tmp']['messages']['contact_em'][$contact_em['uuid']]['filename'] = $contact_em['filename'];
|
||||
$_SESSION['tmp']['messages']['contact_em'][$contact_em['uuid']]['image'] = $contact_em['image'];
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($sql, $sql_where, $parameters, $contact_uuids, $contact_ems, $contact_em);
|
||||
}
|
||||
|
||||
//contacts list
|
||||
if (is_array($numbers) && @sizeof($numbers) != 0) {
|
||||
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
foreach($numbers as $number) {
|
||||
if ($current_contact != '' && $number == $current_contact) {
|
||||
echo "<tr><td valign='top' class='row_style0 contact_selected' style='cursor: default;'>\n";
|
||||
$selected = true;
|
||||
}
|
||||
else {
|
||||
echo "<tr><td valign='top' class='row_style1' onclick=\"load_thread('".urlencode($number)."', '".$contact[$number]['contact_uuid']."');\">\n";
|
||||
$selected = false;
|
||||
}
|
||||
//contact image
|
||||
if (is_array($_SESSION['tmp']['messages']['contact_em'][$contact[$number]['contact_uuid']]) && sizeof($_SESSION['tmp']['messages']['contact_em'][$contact[$number]['contact_uuid']]) != 0) {
|
||||
$attachment_type = strtolower(pathinfo($_SESSION['tmp']['messages']['contact_em'][$contact[$number]['contact_uuid']]['filename'], PATHINFO_EXTENSION));
|
||||
echo "<img id='src_message-bubble-image-em_".$contact[$number]['contact_uuid']."' style='display: none;' src='data:image/".$attachment_type.";base64,".$_SESSION['tmp']['messages']['contact_em'][$contact[$number]['contact_uuid']]['image']."'>\n";
|
||||
echo "<img id='contact_image_".$contact[$number]['contact_uuid']."' class='contact_list_image' src='data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'>\n";
|
||||
}
|
||||
//contact name/number
|
||||
if ($contact[$number]['contact_name_given'] != '' || $contact[$number]['contact_name_family'] != '') {
|
||||
echo "<div style='float: right; margin-top: 8px; margin-right: ".($selected ? '-1' : '4')."px;' title=\"".$text['label-view_contact']."\"><a href='/app/contacts/contact_edit.php?id=".$contact[$number]['contact_uuid']."' target='_blank'><i class='fas fa-user'></i></a></div>\n";
|
||||
echo "<div style='display: table;'>\n";
|
||||
echo " <strong style='display: inline-block; margin: 8px 0 5px 0; white-space: nowrap;'>".escape($contact[$number]['contact_name_given'].' '.$contact[$number]['contact_name_family']).'</strong><br>';
|
||||
echo " <span style='font-size: 80%; white-space: nowrap;'><a href='callto:".escape($number)."'><i class='fas fa-phone-alt' style='margin-right: 5px;'></i>".escape(format_phone($number)).'</a></span><br>';
|
||||
if (valid_email($contact[$number]['contact_email'])) {
|
||||
echo "<span style='font-size: 80%; white-space: nowrap;'><a href='mailto:".escape($contact[$number]['contact_email'])."'><i class='fas fa-envelope' style='margin-right: 5px;'></i>".$text['label-send_email']."</a></span><br>";
|
||||
}
|
||||
if ($selected) {
|
||||
$contact_name = escape($contact[$number]['contact_name_given'].' '.$contact[$number]['contact_name_family']);
|
||||
$contact_html = (permission_exists('contact_view') ? "<a href='".PROJECT_PATH."/app/contacts/contact_edit.php?id=".$contact[$number]['contact_uuid']."' target='_blank'>".$contact_name."</a>" : $contact_name)." : <a href='callto:".escape($number)."'>".escape(format_phone($number))."</a>";
|
||||
echo "<script>$('#contact_current_name').html(\"".$contact_html."\");</script>\n";
|
||||
}
|
||||
echo "</div>\n";
|
||||
}
|
||||
else {
|
||||
echo escape(format_phone($number));
|
||||
if ($selected) {
|
||||
echo "<script>$('#contact_current_name').html(\"<a href='callto:".escape($number)."'>".escape(format_phone($number))."</a>\");</script>\n";
|
||||
}
|
||||
}
|
||||
echo "</td></tr>\n";
|
||||
}
|
||||
echo "</table>\n";
|
||||
|
||||
echo "<script>\n";
|
||||
foreach ($numbers as $number) {
|
||||
if (is_array($_SESSION['tmp']['messages']['contact_em'][$contact[$number]['contact_uuid']]) && @sizeof($_SESSION['tmp']['messages']['contact_em'][$contact[$number]['contact_uuid']]) != 0) {
|
||||
echo "$('img#contact_image_".$contact[$number]['contact_uuid']."').css('backgroundImage', 'url(' + $('img#src_message-bubble-image-em_".$contact[$number]['contact_uuid']."').attr('src') + ')');\n";
|
||||
}
|
||||
}
|
||||
echo "</script>\n";
|
||||
}
|
||||
else {
|
||||
echo "<div style='padding: 15px;'><center>···</center>";
|
||||
}
|
||||
|
||||
echo "<center>\n";
|
||||
echo " <span id='contacts_refresh_state'><img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' onclick=\"refresh_contacts_stop();\" alt=\"".$text['label-refresh_pause']."\" title=\"".$text['label-refresh_pause']."\"></span> ";
|
||||
echo "</center>\n";
|
||||
|
||||
?>
|
||||
@@ -1,263 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2016-2020
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
require_once "resources/paging.php";
|
||||
|
||||
//check permissions
|
||||
if (permission_exists('message_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//get the http post data
|
||||
if (is_array($_POST['messages'])) {
|
||||
$action = $_POST['action'];
|
||||
$search = $_POST['search'];
|
||||
$messages = $_POST['messages'];
|
||||
}
|
||||
|
||||
//process the http post data by action
|
||||
if ($action != '' && is_array($messages) && @sizeof($messages) != 0) {
|
||||
switch ($action) {
|
||||
case 'delete':
|
||||
if (permission_exists('message_delete')) {
|
||||
$obj = new messages;
|
||||
$obj->delete($messages);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
header('Location: messages_log.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
}
|
||||
|
||||
//get variables used to control the order
|
||||
$order_by = $_GET["order_by"];
|
||||
$order = $_GET["order"];
|
||||
|
||||
//add the search term
|
||||
$search = strtolower($_GET["search"]);
|
||||
if (strlen($search) > 0) {
|
||||
$sql_search = " (";
|
||||
$sql_search .= "lower(message_type) like :search ";
|
||||
$sql_search .= "or lower(message_direction) like :search ";
|
||||
$sql_search .= "or lower(message_from) like :search ";
|
||||
$sql_search .= "or lower(message_to) like :search ";
|
||||
$sql_search .= "or lower(message_text) like :search ";
|
||||
$sql_search .= ") ";
|
||||
$parameters['search'] = '%'.$search.'%';
|
||||
}
|
||||
|
||||
//prepare to page the results
|
||||
$sql = "select count(*) from v_messages ";
|
||||
if ($_GET['show'] == "all" && permission_exists('message_all')) {
|
||||
if (isset($sql_search)) {
|
||||
$sql .= "where ".$sql_search;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$sql .= "where user_uuid = :user_uuid ";
|
||||
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
|
||||
if (isset($sql_search)) {
|
||||
$sql .= "and ".$sql_search;
|
||||
}
|
||||
$parameters['user_uuid'] = $_SESSION['user_uuid'];
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
}
|
||||
$database = new database;
|
||||
$num_rows = $database->select($sql, $parameters, 'column');
|
||||
|
||||
//prepare to page the results
|
||||
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
||||
$param = "&search=".$search;
|
||||
if ($_GET['show'] == "all" && permission_exists('message_all')) {
|
||||
$param .= "&show=all";
|
||||
}
|
||||
if (isset($_GET['page'])) {
|
||||
$page = is_numeric($_GET['page']) ? $_GET['page'] : 0;
|
||||
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
|
||||
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true);
|
||||
$offset = $rows_per_page * $page;
|
||||
}
|
||||
|
||||
//get the list
|
||||
$sql = str_replace('count(*)', '*', $sql);
|
||||
$sql .= "order by message_date desc ";
|
||||
$sql .= limit_offset($rows_per_page, $offset);
|
||||
$database = new database;
|
||||
$messages = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//create token
|
||||
$object = new token;
|
||||
$token = $object->create($_SERVER['PHP_SELF']);
|
||||
|
||||
//include header
|
||||
$document['title'] = $text['title-message_log'];
|
||||
require_once "resources/header.php";
|
||||
|
||||
//define the checkbox_toggle function
|
||||
echo "<script type=\"text/javascript\">\n";
|
||||
echo " function checkbox_toggle(item) {\n";
|
||||
echo " var inputs = document.getElementsByTagName(\"input\");\n";
|
||||
echo " for (var i = 0, max = inputs.length; i < max; i++) {\n";
|
||||
echo " if (inputs[i].type === 'checkbox') {\n";
|
||||
echo " if (document.getElementById('checkbox_all').checked == true) {\n";
|
||||
echo " inputs[i].checked = true;\n";
|
||||
echo " }\n";
|
||||
echo " else {\n";
|
||||
echo " inputs[i].checked = false;\n";
|
||||
echo " }\n";
|
||||
echo " }\n";
|
||||
echo " }\n";
|
||||
echo " }\n";
|
||||
echo "</script>\n";
|
||||
|
||||
//show the content
|
||||
echo "<div class='action_bar' id='action_bar'>\n";
|
||||
echo " <div class='heading'><b>".$text['title-message_log']." (".$num_rows.")</b></div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','link'=>'messages.php']);
|
||||
if (permission_exists('message_delete') && $messages) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'name'=>'btn_delete','style'=>'margin-left: 15px;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
|
||||
}
|
||||
echo "<form id='form_search' class='inline' method='get'>\n";
|
||||
if (permission_exists('message_all')) {
|
||||
if ($_GET['show'] == 'all') {
|
||||
echo " <input type='hidden' name='show' value='all'>\n";
|
||||
}
|
||||
else {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?show=all']);
|
||||
}
|
||||
}
|
||||
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown='list_search_reset();'>";
|
||||
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search','style'=>($search != '' ? 'display: none;' : null)]);
|
||||
echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'messages_log.php','style'=>($search == '' ? 'display: none;' : null)]);
|
||||
if ($paging_controls_mini != '') {
|
||||
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>\n";
|
||||
}
|
||||
echo " </form>\n";
|
||||
echo " </div>\n";
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
if (permission_exists('message_delete') && $messages) {
|
||||
echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('delete'); list_form_submit('form_list');"])]);
|
||||
}
|
||||
|
||||
echo "<form id='form_list' method='post'>\n";
|
||||
echo "<input type='hidden' id='action' name='action' value=''>\n";
|
||||
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
|
||||
|
||||
echo "<table class='list'>\n";
|
||||
echo "<tr class='list-header'>\n";
|
||||
if (permission_exists('message_delete')) {
|
||||
echo " <th class='checkbox'>\n";
|
||||
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle();' ".($messages ?: "style='visibility: hidden;'").">\n";
|
||||
echo " </th>\n";
|
||||
}
|
||||
echo th_order_by('message_type', $text['label-message_type'], $order_by, $order);
|
||||
echo th_order_by('message_direction', $text['label-message_direction'], $order_by, $order);
|
||||
echo th_order_by('message_date', $text['label-message_date'], $order_by, $order);
|
||||
echo th_order_by('message_from', $text['label-message_from'], $order_by, $order);
|
||||
echo th_order_by('message_to', $text['label-message_to'], $order_by, $order);
|
||||
echo th_order_by('message_text', $text['label-message_text'], $order_by, $order, null, "class='pct-20 hide-xs'");
|
||||
if (permission_exists('message_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
|
||||
if (is_array($messages) && @sizeof($messages) != 0) {
|
||||
$x = 0;
|
||||
foreach ($messages as $row) {
|
||||
if (permission_exists('message_edit')) {
|
||||
$list_row_url = "message_edit.php?id=".urlencode($row['message_uuid']);
|
||||
}
|
||||
echo "<tr class='list-row' href='".$list_row_url."'>\n";
|
||||
if (permission_exists('message_delete')) {
|
||||
echo " <td class='checkbox'>\n";
|
||||
echo " <input type='checkbox' name='messages[$x][checked]' id='checkbox_".$x."' value='true' onclick=\"if (!this.checked) { document.getElementById('checkbox_all').checked = false; }\">\n";
|
||||
echo " <input type='hidden' name='messages[$x][uuid]' value='".escape($row['message_uuid'])."' />\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo " <td>";
|
||||
switch ($row['message_type']) {
|
||||
case 'sms': echo $text['label-sms']; break;
|
||||
case 'mms': echo $text['label-mms']; break;
|
||||
case 'chat': echo $text['label-chat']; break;
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td>";
|
||||
switch ($row['message_direction']) {
|
||||
case "inbound": echo $text['label-inbound']; break;
|
||||
case "outbound": echo $text['label-outbound']; break;
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td>";
|
||||
$message_date = explode(' ', $row['message_date']);
|
||||
$message_date = escape($message_date[0])." <span class='hide-sm-dn'>".$message_date[1]."</span>";
|
||||
if (permission_exists('message_edit')) {
|
||||
echo "<a href='".$list_row_url."'>".$message_date."</a>";
|
||||
}
|
||||
else {
|
||||
echo $message_date;
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td>".escape(format_phone($row['message_from']))." </td>\n";
|
||||
echo " <td>".escape(format_phone($row['message_to']))." </td>\n";
|
||||
echo " <td class='description overflow hide-xs'>".escape($row['message_text'])." </td>\n";
|
||||
if (permission_exists('message_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
$x++;
|
||||
}
|
||||
unset($messages);
|
||||
}
|
||||
|
||||
echo "</table>\n";
|
||||
echo "<br />\n";
|
||||
echo "<div align='center'>".$paging_controls."</div>\n";
|
||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
echo "</form>\n";
|
||||
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
@@ -1,350 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2016-2020
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
|
||||
//check permissions
|
||||
if (!permission_exists('message_view')) {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//get number of messages to load
|
||||
$number = preg_replace('{[\D]}', '', $_GET['number']);
|
||||
$contact_uuid = (is_uuid($_GET['contact_uuid'])) ? $_GET['contact_uuid'] : null;
|
||||
|
||||
//set refresh flag
|
||||
$refresh = $_GET['refresh'] == 'true' ? true : false;
|
||||
|
||||
//get messages
|
||||
if (isset($_SESSION['message']['display_last']['text']) && $_SESSION['message']['display_last']['text'] != '') {
|
||||
$array = explode(' ',$_SESSION['message']['display_last']['text']);
|
||||
if (is_array($array) && is_numeric($array[0]) && $array[0] > 0) {
|
||||
if ($array[1] == 'messages') {
|
||||
$limit = limit_offset($array[0], 0);
|
||||
}
|
||||
else {
|
||||
$since = "and message_date >= :message_date ";
|
||||
$parameters['message_date'] = date("Y-m-d H:i:s", strtotime('-'.$_SESSION['message']['display_last']['text']));
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($limit == '' && $since == '') { $limit = limit_offset(25, 0); } //default (message count)
|
||||
$sql = "select ";
|
||||
$sql .= "message_uuid, ";
|
||||
$sql .= "domain_uuid, ";
|
||||
$sql .= "user_uuid, ";
|
||||
$sql .= "contact_uuid, ";
|
||||
$sql .= "message_type, ";
|
||||
$sql .= "message_direction, ";
|
||||
if ($_SESSION['domain']['time_zone']['name'] != '') {
|
||||
$sql .= "message_date at time zone :time_zone as message_date, ";
|
||||
}
|
||||
else {
|
||||
$sql .= "message_date, ";
|
||||
}
|
||||
$sql .= "message_from, ";
|
||||
$sql .= "message_to, ";
|
||||
$sql .= "message_text ";
|
||||
$sql .= "from v_messages ";
|
||||
$sql .= "where user_uuid = :user_uuid ";
|
||||
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
|
||||
$sql .= $since;
|
||||
$sql .= "and (message_from like :message_number or message_to like :message_number) ";
|
||||
$sql .= "order by message_date desc ";
|
||||
$sql .= $limit;
|
||||
if ($_SESSION['domain']['time_zone']['name'] != '') {
|
||||
$parameters['time_zone'] = $_SESSION['domain']['time_zone']['name'];
|
||||
}
|
||||
$parameters['user_uuid'] = $_SESSION['user_uuid'];
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$parameters['message_number'] = '%'.$number;
|
||||
$database = new database;
|
||||
$messages = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
if (is_array($messages) && @sizeof($messages) != 0) {
|
||||
$messages = array_reverse($messages);
|
||||
|
||||
//get media (if any)
|
||||
$sql = "select ";
|
||||
$sql .= "message_uuid, ";
|
||||
$sql .= "message_media_uuid, ";
|
||||
$sql .= "message_media_type, ";
|
||||
$sql .= "length(decode(message_media_content,'base64')) as message_media_size ";
|
||||
$sql .= "from v_message_media ";
|
||||
$sql .= "where user_uuid = :user_uuid ";
|
||||
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
|
||||
$sql .= "and ( ";
|
||||
foreach ($messages as $index => $message) {
|
||||
$message_uuids[] = "message_uuid = :message_uuid_".$index;
|
||||
$parameters['message_uuid_'.$index] = $message['message_uuid'];
|
||||
}
|
||||
$sql .= implode(' or ', $message_uuids);
|
||||
$sql .= ") ";
|
||||
$sql .= "and message_media_type <> 'txt' ";
|
||||
$parameters['user_uuid'] = $_SESSION['user_uuid'];
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$rows = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters, $index);
|
||||
|
||||
//prep media array
|
||||
if (is_array($rows) && @sizeof($rows) != 0) {
|
||||
foreach ($rows as $index => $row) {
|
||||
$message_media[$row['message_uuid']][$index]['uuid'] = $row['message_media_uuid'];
|
||||
$message_media[$row['message_uuid']][$index]['type'] = $row['message_media_type'];
|
||||
$message_media[$row['message_uuid']][$index]['size'] = $row['message_media_size'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//css styles
|
||||
echo "<style>\n";
|
||||
echo " .message-bubble {\n";
|
||||
echo " display: table;\n";
|
||||
echo " padding: 10px;\n";
|
||||
echo " border: 1px solid;\n";
|
||||
echo " margin-bottom: 10px;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " .message-bubble-em {\n";
|
||||
echo " margin-right: 30%;\n";
|
||||
echo " border-radius: 0 20px 20px 20px;\n";
|
||||
echo " border-color: #cffec7;\n";
|
||||
echo " background-color: #ecffe9;\n";
|
||||
echo " clear: both;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " .message-bubble-me {\n";
|
||||
echo " float: right;\n";
|
||||
echo " margin-left: 30%;\n";
|
||||
echo " border-radius: 20px 20px 0 20px;\n";
|
||||
echo " border-color: #cbf0ff;\n";
|
||||
echo " background-color: #e5f7ff;\n";
|
||||
echo " clear: both;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " img.message-bubble-image-em {\n";
|
||||
echo " width: 100px;\n";
|
||||
echo " height: auto;\n";
|
||||
echo " border-radius: 0 11px 11px 11px;\n";
|
||||
echo " border: 1px solid #cffec7;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " img.message-bubble-image-me {\n";
|
||||
echo " width: 100px;\n";
|
||||
echo " height: auto;\n";
|
||||
echo " border-radius: 11px 11px 0 11px;\n";
|
||||
echo " border: 1px solid #cbf0ff;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " div.message-bubble-image-em {\n";
|
||||
echo " float: left;\n";
|
||||
echo " margin-right: 15px;\n";
|
||||
echo " text-align: left;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " div.message-bubble-image-me {\n";
|
||||
echo " float: right;\n";
|
||||
echo " margin-left: 15px;\n";
|
||||
echo " text-align: right;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " .message-text {\n";
|
||||
echo " padding-bottom: 5px;\n";
|
||||
echo " font-size: 90%;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " .message-bubble-when {\n";
|
||||
echo " font-size: 71%;\n";
|
||||
echo " font-style: italic;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " .message-media-link-em {\n";
|
||||
echo " display: inline-block;\n";
|
||||
echo " margin: 5px 10px 5px 0;\n";
|
||||
echo " padding: 8px;\n";
|
||||
echo " background: #cffec7;\n";
|
||||
echo " border-radius: 7px;\n";
|
||||
echo " text-align: center;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " .message-media-link-me {\n";
|
||||
echo " display: inline-block;\n";
|
||||
echo " margin: 5px 10px 5px 0;\n";
|
||||
echo " padding: 8px;\n";
|
||||
echo " background: #cbf0ff;\n";
|
||||
echo " border-radius: 7px;\n";
|
||||
echo " text-align: center;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo "</style>\n";
|
||||
|
||||
if (!$refresh) {
|
||||
echo "<div id='thread_messages' style='min-height: 300px; overflow: auto; padding-right: 15px;'>\n";
|
||||
}
|
||||
|
||||
//output messages
|
||||
if (is_array($messages) && @sizeof($messages) != 0) {
|
||||
foreach ($messages as $message) {
|
||||
//parse from message
|
||||
if ($message['message_direction'] == 'inbound') {
|
||||
$message_from = $message['message_to'];
|
||||
$media_source = format_phone($message['message_from']);
|
||||
}
|
||||
if ($message['message_direction'] == 'outbound') {
|
||||
$message_from = $message['message_from'];
|
||||
$media_source = format_phone($message['message_to']);
|
||||
}
|
||||
|
||||
//message bubble
|
||||
echo "<span class='message-bubble message-bubble-".($message['message_direction'] == 'inbound' ? 'em' : 'me')."'>";
|
||||
//contact image em
|
||||
if ($message['message_direction'] == 'inbound') {
|
||||
if (is_array($_SESSION['tmp']['messages']['contact_em'][$contact_uuid]) && @sizeof($_SESSION['tmp']['messages']['contact_em'][$contact_uuid]) != 0) {
|
||||
echo "<div class='message-bubble-image-em'>\n";
|
||||
echo " <img class='message-bubble-image-em'><br />\n";
|
||||
echo "</div>\n";
|
||||
}
|
||||
}
|
||||
//contact image me
|
||||
else {
|
||||
if (is_array($_SESSION['tmp']['messages']['contact_me']) && @sizeof($_SESSION['tmp']['messages']['contact_me']) != 0) {
|
||||
echo "<div class='message-bubble-image-me'>\n";
|
||||
echo " <img class='message-bubble-image-me'><br />\n";
|
||||
echo "</div>\n";
|
||||
}
|
||||
}
|
||||
echo "<div style='display: table;'>\n";
|
||||
//message
|
||||
if ($message['message_text'] != '') {
|
||||
echo "<div class='message-text'>".str_replace("\n",'<br />',escape($message['message_text']))."</div>\n";
|
||||
}
|
||||
//attachments
|
||||
if (is_array($message_media[$message['message_uuid']]) && @sizeof($message_media[$message['message_uuid']]) != 0) {
|
||||
|
||||
foreach ($message_media[$message['message_uuid']] as $media) {
|
||||
if ($media['type'] != 'txt') {
|
||||
if ($media['type'] == 'jpg' || $media['type'] == 'jpeg' || $media['type'] == 'gif' || $media['type'] == 'png') {
|
||||
echo "<a href='#' onclick=\"display_media('".$media['uuid']."','".$media_source."');\" class='message-media-link-".($message['message_direction'] == 'inbound' ? 'em' : 'me')."'>";
|
||||
}
|
||||
else {
|
||||
echo "<a href='message_media.php?id=".$media['uuid']."&src=".$media_source."&action=download' class='message-media-link-".($message['message_direction'] == 'inbound' ? 'em' : 'me')."'>";
|
||||
}
|
||||
echo "<img src='resources/images/attachment.png' style='width: 16px; height: 16px; border: none; margin-right: 10px;'>";
|
||||
echo "<span style='font-size: 85%; white-space: nowrap;'>".strtoupper($media['type']).' · '.strtoupper(byte_convert($media['size']))."</span>";
|
||||
echo "</a>\n";
|
||||
}
|
||||
}
|
||||
echo "<br />\n";
|
||||
}
|
||||
//message when
|
||||
echo "<span class='message-bubble-when'>".(date('m-d-Y') != format_when_local($message['message_date'],'d') ? format_when_local($message['message_date']) : format_when_local($message['message_date'],'t'))."</span>\n";
|
||||
echo "</div>\n";
|
||||
echo "</span>\n";
|
||||
}
|
||||
echo "<span id='thread_bottom'></span>\n";
|
||||
}
|
||||
|
||||
echo "<script>\n";
|
||||
//set current contact
|
||||
echo " $('#contact_current_number').val('".$number."');\n";
|
||||
//set bubble contact images from src images
|
||||
echo " $('img.message-bubble-image-em').attr('src', $('img#src_message-bubble-image-em_".$contact_uuid."').attr('src'));\n";
|
||||
echo " $('img.message-bubble-image-me').attr('src', $('img#src_message-bubble-image-me').attr('src'));\n";
|
||||
echo "</script>\n";
|
||||
|
||||
if (!$refresh) {
|
||||
echo "</div>\n";
|
||||
|
||||
if (permission_exists('message_add')) {
|
||||
//output input form
|
||||
echo "<form id='message_compose' method='post' enctype='multipart/form-data' action='message_send.php'>\n";
|
||||
echo "<input type='hidden' name='message_from' value='".$message_from."'>\n";
|
||||
echo "<input type='hidden' name='message_to' value='".$number."'>\n";
|
||||
echo "<textarea class='formfld' id='message_text' name='message_text' style='width: 100%; max-width: 100%; min-height: 55px; border: 1px solid #cbcbcb; resize: vertical; padding: 5px 8px; margin-top: 10px; margin-bottom: 5px;' placeholder=\"".$text['description-enter_response']."\"></textarea>";
|
||||
echo "<table cellpadding='0' cellspacing='0' border='0' width='100%' style='margin-top: 5px;'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td><img src='resources/images/attachment.png' style='min-width: 20px; height: 20px; border: none; padding-right: 5px;'></td>\n";
|
||||
echo " <td width='100%'><input type='file' class='formfld' multiple='multiple' name='message_media[]' id='message_new_media'></td>\n";
|
||||
echo " </td>\n";
|
||||
echo "</table>\n";
|
||||
echo "<table cellpadding='0' cellspacing='0' border='0' width='100%' style='margin-top: 15px;'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td align='left' width='50%'>";
|
||||
echo button::create(['label'=>$text['button-clear'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'reset','onclick'=>"$('#message_text').trigger('focus');"]);
|
||||
echo " </td>\n";
|
||||
echo " <td align='center'><span id='thread_refresh_state'><img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; cursor: pointer;' onclick=\"refresh_thread_stop('".$number."','".$contact_uuid."');\" alt=\"".$text['label-refresh_pause']."\" title=\"".$text['label-refresh_pause']."\"></span></td>\n";
|
||||
echo " <td align='right' width='50%'>";
|
||||
echo button::create(['type'=>'submit','label'=>$text['button-send'],'title'=>$text['label-ctrl_enter'],'icon'=>'paper-plane']);
|
||||
echo " </td>\n";
|
||||
echo " </td>\n";
|
||||
echo "</table>\n";
|
||||
echo "</form>\n";
|
||||
|
||||
//js to load messages for clicked number
|
||||
echo "<script>\n";
|
||||
//define form submit function
|
||||
echo " $('#message_compose').submit(function(event) {\n";
|
||||
echo " event.preventDefault();\n";
|
||||
echo " $.ajax({\n";
|
||||
echo " url: $(this).attr('action'),\n";
|
||||
echo " type: $(this).attr('method'),\n";
|
||||
echo " data: new FormData(this),\n";
|
||||
echo " processData: false,\n";
|
||||
echo " contentType: false,\n";
|
||||
echo " cache: false,\n";
|
||||
echo " success: function(){\n";
|
||||
echo " document.getElementById('message_compose').reset();\n";
|
||||
if (!http_user_agent('mobile')) {
|
||||
echo " if ($('#message_new_layer').is(':hidden')) {\n";
|
||||
echo " $('#message_text').trigger('focus');\n";
|
||||
echo " }\n";
|
||||
}
|
||||
echo " refresh_thread('".$number."', '".$contact_uuid."', 'true');\n";
|
||||
echo " }\n";
|
||||
echo " });\n";
|
||||
echo " });\n";
|
||||
//enable ctrl+enter to send
|
||||
echo " $('#message_text').keydown(function (event) {\n";
|
||||
echo " if ((event.keyCode == 10 || event.keyCode == 13) && event.ctrlKey) {\n";
|
||||
echo " $('#message_compose').submit();\n";
|
||||
echo " }\n";
|
||||
echo " });\n";
|
||||
|
||||
echo "</script>\n";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,125 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2020
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//define the messages class
|
||||
if (!class_exists('messages')) {
|
||||
class messages {
|
||||
|
||||
/**
|
||||
* declare private variables
|
||||
*/
|
||||
private $app_name;
|
||||
private $app_uuid;
|
||||
private $permission_prefix;
|
||||
private $list_page;
|
||||
private $table;
|
||||
private $uuid_prefix;
|
||||
|
||||
/**
|
||||
* called when the object is created
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
//assign private variables
|
||||
$this->app_name = 'messages';
|
||||
$this->app_uuid = '4a20815d-042c-47c8-85df-085333e79b87';
|
||||
$this->permission_prefix = 'message_';
|
||||
$this->list_page = 'messages_log.php';
|
||||
$this->table = 'messages';
|
||||
$this->uuid_prefix = 'message_';
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* called when there are no references to a particular object
|
||||
* unset the variables used in the class
|
||||
*/
|
||||
public function __destruct() {
|
||||
foreach ($this as $key => $value) {
|
||||
unset($this->$key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* delete records
|
||||
*/
|
||||
public function delete($records) {
|
||||
if (permission_exists($this->permission_prefix.'delete')) {
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//validate the token
|
||||
$token = new token;
|
||||
if (!$token->validate($_SERVER['PHP_SELF'])) {
|
||||
message::add($text['message-invalid_token'],'negative');
|
||||
header('Location: '.$this->list_page);
|
||||
exit;
|
||||
}
|
||||
|
||||
//delete multiple records
|
||||
if (is_array($records) && @sizeof($records) != 0) {
|
||||
|
||||
//build the delete array
|
||||
foreach ($records as $x => $record) {
|
||||
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
|
||||
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid'];
|
||||
$array[$this->table][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$array['message_media'][$x][$this->uuid_prefix.'uuid'] = $record['uuid'];
|
||||
$array['message_media'][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
}
|
||||
}
|
||||
|
||||
//delete the checked rows
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p->add('message_media_delete', 'temp');
|
||||
|
||||
//execute delete
|
||||
$database = new database;
|
||||
$database->app_name = $this->app_name;
|
||||
$database->app_uuid = $this->app_uuid;
|
||||
$database->delete($array);
|
||||
unset($array);
|
||||
|
||||
//revoke temporary permissions
|
||||
$p->delete('message_media_delete', 'temp');
|
||||
|
||||
//set message
|
||||
message::add($text['message-delete']);
|
||||
}
|
||||
unset($records);
|
||||
}
|
||||
}
|
||||
} //method
|
||||
|
||||
} //class
|
||||
}
|
||||
|
||||
?>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 501 B |
@@ -1,90 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
// make sure the PATH_SEPARATOR is defined
|
||||
umask(2);
|
||||
if (!defined("PATH_SEPARATOR")) {
|
||||
if (strpos($_ENV["OS"], "Win") !== false) {
|
||||
define("PATH_SEPARATOR", ";");
|
||||
} else {
|
||||
define("PATH_SEPARATOR", ":");
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html';
|
||||
|
||||
// make sure the document_root is set
|
||||
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]);
|
||||
if(PHP_SAPI == 'cli'){
|
||||
chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME));
|
||||
$script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]);
|
||||
$dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME));
|
||||
if (file_exists('/project_root.php')) {
|
||||
$path = '/';
|
||||
} else {
|
||||
$i = 1;
|
||||
$path = '';
|
||||
while ($i < count($dirs)) {
|
||||
$path .= '/' . $dirs[$i];
|
||||
if (file_exists($path. '/project_root.php')) {
|
||||
break;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$_SERVER["DOCUMENT_ROOT"] = $path;
|
||||
}else{
|
||||
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
|
||||
}
|
||||
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
|
||||
// try to detect if a project path is being used
|
||||
if (!defined('PROJECT_PATH')) {
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) {
|
||||
define('PROJECT_PATH', '/fusionpbx');
|
||||
} elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) {
|
||||
define('PROJECT_PATH', '');
|
||||
} else {
|
||||
$dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME)));
|
||||
$i = 1;
|
||||
$path = $_SERVER["DOCUMENT_ROOT"];
|
||||
while ($i < count($dirs)) {
|
||||
$path .= '/' . $dirs[$i];
|
||||
if (file_exists($path. '/project_root.php')) {
|
||||
break;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if(!file_exists($path. '/project_root.php')){
|
||||
die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance");
|
||||
}
|
||||
$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
|
||||
define('PROJECT_PATH', $project_path);
|
||||
}
|
||||
$_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH);
|
||||
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]);
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user