Skip to content

Commit

Permalink
4.47v
Browse files Browse the repository at this point in the history
  • Loading branch information
remdex committed Sep 12, 2024
1 parent 0294c12 commit eec1150
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 6 deletions.
3 changes: 3 additions & 0 deletions lhc_web/design/defaulttheme/tpl/lhchat/listchatconfig.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@
<?php $attribute = 'remember_username';$boolValue = true;?>
<?php include(erLhcoreClassDesign::designtpl('lhchat/part/chat_settings.tpl.php'));?>

<?php $attribute = 'remember_phone_email';$boolValue = true;?>
<?php include(erLhcoreClassDesign::designtpl('lhchat/part/chat_settings.tpl.php'));?>

<?php $attribute = 'cleanup_cronjob';$boolValue = true;?>
<?php include(erLhcoreClassDesign::designtpl('lhchat/part/chat_settings.tpl.php'));?>

Expand Down
9 changes: 9 additions & 0 deletions lhc_web/doc/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
4.47v

1. Blinking title fixes with one page applications.
2. Option to remember phone, email for the next time visitor starts a chats
3. Chat delete event was missing on chat deletion from list.
4. Compatibility with new Facebook Extension including WhatsApp, Instagram, Messenger support.
5. Statistic chart will not include 17 as default work hour.
6. SSO extension compatibility

4.46v

1. More options to parse incoming request for incoming webhooks
Expand Down
7 changes: 7 additions & 0 deletions lhc_web/doc/update_db/structure.json
Original file line number Diff line number Diff line change
Expand Up @@ -9936,6 +9936,13 @@
"explain": "Should we remember username for the next time visitor starts a chat?",
"hidden": "0"
},
{
"identifier": "remember_phone_email",
"value": "1",
"type": "0",
"explain": "Should we remember E-Mail, Phone for the next time visitor starts a chat?",
"hidden": "0"
},
{
"identifier": "inform_unread_message",
"value": "0",
Expand Down
1 change: 1 addition & 0 deletions lhc_web/doc/update_db/update_317.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INSERT INTO `lh_chat_config` (`identifier`,`value`,`type`,`explain`,`hidden`) VALUES ('remember_phone_email','1','0','Should we remember E-Mail, Phone for the next time visitor starts a chat?','0');
4 changes: 2 additions & 2 deletions lhc_web/lib/core/lhcore/lhupdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
class erLhcoreClassUpdate
{

const DB_VERSION = 316;
const LHC_RELEASE = 446;
const DB_VERSION = 317;
const LHC_RELEASE = 447;

public static function doTablesUpdate($definition){
$updateInformation = self::getTablesStatus($definition);
Expand Down
4 changes: 4 additions & 0 deletions lhc_web/modules/lhchat/sendmassmessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@

if ($chatPast instanceof erLhcoreClassModelChat) {
$chat->nick = $chatPast->nick;
if (erLhcoreClassModelChatConfig::fetch('remember_phone_email')->current_value == 1) {
$chat->phone = $chatPast->phone;
$chat->email = $chatPast->email;
}
}

if (erLhcoreClassModelChatConfig::fetch('remember_username')->current_value == 1) {
Expand Down
4 changes: 4 additions & 0 deletions lhc_web/modules/lhchat/sendnotice.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@

if ($chatPast instanceof erLhcoreClassModelChat) {
$chat->nick = $chatPast->nick;
if (erLhcoreClassModelChatConfig::fetch('remember_phone_email')->current_value == 1) {
$chat->phone = $chatPast->phone;
$chat->email = $chatPast->email;
}
}

if (erLhcoreClassModelChatConfig::fetch('remember_username')->current_value == 1) {
Expand Down
1 change: 1 addition & 0 deletions lhc_web/modules/lhinstall/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -1549,6 +1549,7 @@
('export_hash', '{$exportHash}', 0, 'Chats export secret hash', 0),
('do_no_track_ip', 0, 0, 'Do not track visitors IP',0),
('remember_username','1','0','Should we remember username for the next time visitor starts a chat?','0'),
('remember_phone_email','1','0','Should we remember E-Mail, Phone for the next time visitor starts a chat?','0'),
('ignore_typing', 0, 0, 'Do not store what visitor is typing',0),
('encrypt_msg_after', 0, 0, 'After how many days anonymize messages',0),
('encrypt_msg_op', 0, 0, 'Anonymize also operators messages',0),
Expand Down
20 changes: 16 additions & 4 deletions lhc_web/modules/lhwidgetrestapi/submitonline.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,6 @@
$chat->chat_initiator = erLhcoreClassModelChat::CHAT_INITIATOR_PROACTIVE;
}

$userInstance->chat_id = $chat->id;
$userInstance->dep_id = $chat->dep_id;
$userInstance->chat_time = time();

if (!isset($resetMessage)) {
$userInstance->message_seen = 1;
$userInstance->message_seen_ts = time();
Expand All @@ -334,6 +330,22 @@
$userInstance->visitor_tz = $chat->user_tz_identifier;
}

if (erLhcoreClassModelChatConfig::fetch('remember_phone_email')->current_value == 1 && $userInstance->chat_id > 0) {
$chatLegacy = erLhcoreClassModelChat::fetch($userInstance->chat_id);
if (is_object($chatLegacy)) {
if ($chatLegacy->phone != '' && $chat->phone == '') {
$chat->phone = $chatLegacy->phone;
}
if ($chatLegacy->email != '' && $chat->email == '') {
$chat->email = $chatLegacy->email;
}
}
}

$userInstance->dep_id = $chat->dep_id;
$userInstance->chat_time = time();
$userInstance->chat_id = $chat->id;

if (erLhcoreClassModelChatConfig::fetch('remember_username')->current_value == 1) {
if ($chat->nick != 'Visitor') {
$onlineAttr = $userInstance->online_attr_system_array;
Expand Down

0 comments on commit eec1150

Please sign in to comment.