Contacts: Updates for PHP 8.1

This commit is contained in:
fusionate
2023-06-04 00:51:12 +00:00
parent f5f3ef680e
commit a4a56d06e3
5 changed files with 78 additions and 26 deletions

View File

@@ -1700,6 +1700,30 @@ $text['message-access_denied']['zh-cn'] = "拒绝访问";
$text['message-access_denied']['ja-jp'] = "アクセス拒否";
$text['message-access_denied']['ko-kr'] = "접근 불가";
$text['message-uploaded']['en-us'] = "File Uploaded";
$text['message-uploaded']['en-gb'] = "File Uploaded";
$text['message-uploaded']['ar-eg'] = "ملف محمول";
$text['message-uploaded']['de-at'] = "Datei hochgeladen";
$text['message-uploaded']['de-ch'] = "Datei hochgeladen";
$text['message-uploaded']['de-de'] = "Datei hochgeladen";
$text['message-uploaded']['es-cl'] = "Subida de Archivos";
$text['message-uploaded']['es-mx'] = "Subida de Archivos";
$text['message-uploaded']['fr-ca'] = "Fichier téléchargé";
$text['message-uploaded']['fr-fr'] = "Fichier téléchargé";
$text['message-uploaded']['he-il'] = "הקובץ הועלה";
$text['message-uploaded']['it-it'] = "File Caricato";
$text['message-uploaded']['nl-nl'] = "Bestand opsturen";
$text['message-uploaded']['pl-pl'] = "Dodany Plik";
$text['message-uploaded']['pt-br'] = "Arquivo Enviado";
$text['message-uploaded']['pt-pt'] = "Arquivo Enviado";
$text['message-uploaded']['ro-ro'] = "Fișier încărcat";
$text['message-uploaded']['ru-ru'] = "Файл загружен";
$text['message-uploaded']['sv-se'] = "File Uppladdade";
$text['message-uploaded']['uk-ua'] = "файл Завантажено";
$text['message-uploaded']['zh-cn'] = "文件已上传";
$text['message-uploaded']['ja-jp'] = "ファイルがアップロードされました";
$text['message-uploaded']['ko-kr'] = "업로드된 파일";
$text['label-voice']['en-us'] = "Voice";
$text['label-voice']['en-gb'] = "Voice";
$text['label-voice']['ar-eg'] = "صوت";
@@ -7174,6 +7198,31 @@ $text['label-click_to_call']['zh-cn'] = "点击通话";
$text['label-click_to_call']['ja-jp'] = "電話するにはクリック";
$text['label-click_to_call']['ko-kr'] = "클릭 투 콜";
$text['label-search']['en-us'] = "Search...";
$text['label-search']['en-gb'] = "Search...";
$text['label-search']['ar-eg'] = "يبحث";
$text['label-search']['de-at'] = "Suchen...";
$text['label-search']['de-ch'] = "Suchen...";
$text['label-search']['de-de'] = "Suchen...";
$text['label-search']['el-gr'] = "Αναζήτηση...";
$text['label-search']['es-cl'] = "Buscar...";
$text['label-search']['es-mx'] = "Buscar...";
$text['label-search']['fr-ca'] = "Chercher...";
$text['label-search']['fr-fr'] = "Chercher...";
$text['label-search']['he-il'] = "לחפש";
$text['label-search']['it-it'] = "Ricerca...";
$text['label-search']['nl-nl'] = "Zoeken...";
$text['label-search']['pl-pl'] = "Wyszukaj...";
$text['label-search']['pt-br'] = "Pesquisar...";
$text['label-search']['pt-pt'] = "Pesquisar...";
$text['label-search']['ro-ro'] = "Căutare...";
$text['label-search']['ru-ru'] = "Поиск...";
$text['label-search']['sv-se'] = "Sök...";
$text['label-search']['uk-ua'] = "Пошук...";
$text['label-search']['zh-cn'] = "搜索";
$text['label-search']['ja-jp'] = "検索";
$text['label-search']['ko-kr'] = "찾다";
$text['label-setting']['en-us'] = "Setting";
$text['label-setting']['en-gb'] = "Setting";
$text['label-setting']['ar-eg'] = "جلسة";

View File

@@ -95,18 +95,18 @@
//format array
$allowed_extensions = array_keys(json_decode($_SESSION['contact']['allowed_attachment_types']['text'], true));
$array['contact_attachments'][$index]['contact_attachment_uuid'] = $action == 'update' ? $contact_attachment_uuid : uuid();
$array['contact_attachments'][$index]['domain_uuid'] = $_SESSION['domain_uuid'] ?? '';
$array['contact_attachments'][$index]['contact_uuid'] = $contact_uuid;
$array['contact_attachments'][$index]['attachment_primary'] = $allowed_primary_attachment ? 1 : 0;
$array['contact_attachments'][0]['contact_attachment_uuid'] = $action == 'update' ? $contact_attachment_uuid : uuid();
$array['contact_attachments'][0]['domain_uuid'] = $_SESSION['domain_uuid'] ?? '';
$array['contact_attachments'][0]['contact_uuid'] = $contact_uuid;
$array['contact_attachments'][0]['attachment_primary'] = $allowed_primary_attachment ? 1 : 0;
if ($attachment['error'] == '0' && in_array(strtolower(pathinfo($attachment['name'], PATHINFO_EXTENSION)), $allowed_extensions)) {
$array['contact_attachments'][$index]['attachment_filename'] = $attachment['name'];
$array['contact_attachments'][$index]['attachment_content'] = base64_encode(file_get_contents($attachment['tmp_name']));
$array['contact_attachments'][0]['attachment_filename'] = $attachment['name'];
$array['contact_attachments'][0]['attachment_content'] = base64_encode(file_get_contents($attachment['tmp_name']));
}
$array['contact_attachments'][$index]['attachment_description'] = $attachment_description;
$array['contact_attachments'][0]['attachment_description'] = $attachment_description;
if ($action == 'add') {
$array['contact_attachments'][$index]['attachment_uploaded_date'] = 'now()';
$array['contact_attachments'][$index]['attachment_uploaded_user_uuid'] = $_SESSION['user_uuid'];
$array['contact_attachments'][0]['attachment_uploaded_date'] = 'now()';
$array['contact_attachments'][0]['attachment_uploaded_user_uuid'] = $_SESSION['user_uuid'];
}
//save data
@@ -117,7 +117,7 @@
unset($array);
//redirect
message::add($text['message-message_'.($action == 'update' ? 'updated' : 'added')]);
message::add($text['message-'.($action == 'update' ? 'update' : 'uploaded')]);
header('Location: contact_edit.php?id='.$contact_uuid);
exit;

View File

@@ -365,10 +365,10 @@
$array['contacts'][0]['contact_phones'][$y]['contact_uuid'] = $contact_uuid;
$array['contacts'][0]['contact_phones'][$y]['contact_phone_uuid'] = $row["contact_phone_uuid"];
$array['contacts'][0]['contact_phones'][$y]['phone_label'] = $row["phone_label"];
$array['contacts'][0]['contact_phones'][$y]['phone_type_voice'] = $row["phone_type_voice"] ?? '';
$array['contacts'][0]['contact_phones'][$y]['phone_type_fax'] = $row["phone_type_fax"];
$array['contacts'][0]['contact_phones'][$y]['phone_type_video'] = $row["phone_type_video"] ?? '';
$array['contacts'][0]['contact_phones'][$y]['phone_type_text'] = $row["phone_type_text"];
$array['contacts'][0]['contact_phones'][$y]['phone_type_voice'] = $row["phone_type_voice"] ?? null;
$array['contacts'][0]['contact_phones'][$y]['phone_type_fax'] = $row["phone_type_fax"] ?? null;
$array['contacts'][0]['contact_phones'][$y]['phone_type_video'] = $row["phone_type_video"] ?? null;
$array['contacts'][0]['contact_phones'][$y]['phone_type_text'] = $row["phone_type_text"] ?? null;
$array['contacts'][0]['contact_phones'][$y]['phone_speed_dial'] = $row["phone_speed_dial"];
$array['contacts'][0]['contact_phones'][$y]['phone_country_code'] = $row["phone_country_code"];
$array['contacts'][0]['contact_phones'][$y]['phone_number'] = $row["phone_number"];
@@ -1067,7 +1067,7 @@
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['title-contact-edit']."</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','collapse'=>'hide-xs','style'=>'margin-right: 15px;','link'=>'contacts.php']);
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','collapse'=>'hide-xs','style'=>'margin-right: 15px;','link'=>'contact_view.php?id='.$contact_uuid]);
if ($action == 'update') {
if (permission_exists('contact_phone_add')) {
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'id'=>'btn_copy','name'=>'btn_copy','style'=>'display: none;','onclick'=>"modal_open('modal-copy','btn_copy');"]);
@@ -1315,6 +1315,7 @@ echo " <div class='label empty_row' style='grid-row: 10 / span 99;'>\n";
echo " &nbsp;\n";
echo " </div>\n";
echo " <div class='field empty_row' style='grid-row: 10 / span 99;'>\n";
echo " &nbsp;\n";
echo " </div>\n";
echo " </div>\n";
@@ -1461,6 +1462,7 @@ echo " <div class='label empty_row' style='grid-row: 8 / span 99;'>\n";
echo " &nbsp;\n";
echo " </div>\n";
echo " <div class='field empty_row' style='grid-row: 8 / span 99;'>\n";
echo " &nbsp;\n";
echo " </div>\n";
echo " </div>\n";
@@ -1725,10 +1727,10 @@ if (permission_exists('contact_phone_view')) {
echo " ".$text['label-phone_type']."\n";
echo " </div>\n";
echo " <div class='field no-wrap'>\n";
echo " <label><input type='checkbox' name='contact_phones[$x][phone_type_voice]' id='phone_type_voice' value='1' ".(($row['phone_type_voice']) ? "checked='checked'" : null)."> ".$text['label-voice']."</label>&nbsp;\n";
echo " <label><input type='checkbox' name='contact_phones[$x][phone_type_fax]' id='phone_type_fax' value='1' ".(($row['phone_type_fax']) ? "checked='checked'" : null)."> ".$text['label-fax']."</label>&nbsp;\n";
echo " <label><input type='checkbox' name='contact_phones[$x][phone_type_video]' id='phone_type_video' value='1' ".(($row['phone_type_video']) ? "checked='checked'" : null)."> ".$text['label-video']."</label>&nbsp;\n";
echo " <label><input type='checkbox' name='contact_phones[$x][phone_type_text]' id='phone_type_text' value='1' ".(($row['phone_type_text']) ? "checked='checked'" : null)."> ".$text['label-text']."</label>\n";
echo " <label style='padding-top: 2px; margin: 0;'><input type='checkbox' name='contact_phones[$x][phone_type_voice]' id='phone_type_voice' value='1' ".(($row['phone_type_voice']) ? "checked='checked'" : null)."> ".$text['label-voice']."</label>&nbsp;\n";
echo " <label style='padding-top: 2px; margin: 0;'><input type='checkbox' name='contact_phones[$x][phone_type_fax]' id='phone_type_fax' value='1' ".(($row['phone_type_fax']) ? "checked='checked'" : null)."> ".$text['label-fax']."</label>&nbsp;\n";
echo " <label style='padding-top: 2px; margin: 0;'><input type='checkbox' name='contact_phones[$x][phone_type_video]' id='phone_type_video' value='1' ".(($row['phone_type_video']) ? "checked='checked'" : null)."> ".$text['label-video']."</label>&nbsp;\n";
echo " <label style='padding-top: 2px; margin: 0;'><input type='checkbox' name='contact_phones[$x][phone_type_text]' id='phone_type_text' value='1' ".(($row['phone_type_text']) ? "checked='checked'" : null)."> ".$text['label-text']."</label>\n";
echo " <br />\n";
//echo $text['description-phone_type']."\n";
echo " </div>\n";
@@ -1796,10 +1798,11 @@ if (permission_exists('contact_phone_view')) {
//echo $text['description-phone_description']."\n";
echo " </div>\n";
echo " <div class='label empty_row' style='grid-row: 9 / span 99;'>\n";
echo " <div class='label empty_row' style='grid-row: 10 / span 99;'>\n";
echo " &nbsp;\n";
echo " </div>\n";
echo " <div class='field empty_row' style='grid-row: 9 / span 99;'>\n";
echo " <div class='field empty_row' style='grid-row: 10 / span 99;'>\n";
echo " &nbsp;\n";
echo " </div>\n";
//if (!empty($contact_phones) && @sizeof($contact_phones) > 1 && permission_exists('contact_phone_delete')) {
@@ -2362,7 +2365,7 @@ if (permission_exists('contact_relation_view')) {
echo " </div>\n";
echo " <div class='field no-wrap'>\n";
echo " <div id='contacts' class='field no-wrap' style=\"width: auto; display: inline;\">\n";
echo " <input class=\"formfld\" type=\"text\" name=\"contact_search\" placeholder=\"search\" style=\"width: 30%;\" onkeyup=\"get_contacts('contact_select_".$x."', 'contact_uuid', this.value);\" maxlength=\"255\" value=\"\">\n";
echo " <input class=\"formfld\" type=\"text\" name=\"contact_search\" placeholder=\"".$text['label-search']."\" style=\"width: calc(30% - 5px);\" onkeyup=\"get_contacts('contact_select_".$x."', 'contact_uuid', this.value);\" maxlength=\"255\" value=\"\">\n";
echo " <select class='formfld' style=\"width: 70%;\" id=\"contact_select_".$x."\" name=\"contact_relations[".$x."][relation_contact_uuid]\" >\n";
echo " <option value='".escape($row['relation_contact_uuid'])."'>".escape($contact_name ?? '')."</option>\n";
echo " </select>\n";

View File

@@ -62,8 +62,8 @@
//get http post variables and set them to php variables
if (!empty($_POST)) {
$contact_note = $_POST["contact_note"];
$last_mod_date = $_POST["last_mod_date"];
$last_mod_user = $_POST["last_mod_user"] ?? '';
$last_mod_date = $_POST["last_mod_date"] ?? null;
$last_mod_user = $_POST["last_mod_user"] ?? null;
}
//process the form data

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2018
Portions created by the Initial Developer are Copyright (C) 2008-2023
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -78,7 +78,7 @@
$contact_setting_subcategory = strtolower($_POST["contact_setting_subcategory"]);
$contact_setting_name = strtolower($_POST["contact_setting_name"]);
$contact_setting_value = $_POST["contact_setting_value"];
$contact_setting_order = $_POST["contact_setting_order"];
$contact_setting_order = $_POST["contact_setting_order"] ?? null;
$contact_setting_enabled = strtolower($_POST["contact_setting_enabled"]);
$contact_setting_description = $_POST["contact_setting_description"];
}