Skip to content

Commit

Permalink
3.99v
Browse files Browse the repository at this point in the history
  • Loading branch information
remdex committed Apr 27, 2022
1 parent 6bc8f98 commit edef7a8
Show file tree
Hide file tree
Showing 40 changed files with 411 additions and 343 deletions.
2 changes: 1 addition & 1 deletion lhc_web/cli/lib/install.php
Expand Up @@ -1947,7 +1947,7 @@ function step3() {
$db->query("CREATE TABLE `lh_webhook` ( `id` int(11) NOT NULL AUTO_INCREMENT, `event` varchar(50) NOT NULL, `bot_id_alt` int(11) NOT NULL DEFAULT '0', `trigger_id_alt` int(11) NOT NULL DEFAULT '0',`bot_id` int(11) NOT NULL, `trigger_id` int(11) NOT NULL, `disabled` tinyint(1) NOT NULL, `configuration` longtext NOT NULL, `type` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `event_disabled` (`event`,`disabled`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;");
$db->query("CREATE TABLE `lh_incoming_webhook` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL,`identifier` varchar(50) NOT NULL, `scope` varchar(50) NOT NULL, `dep_id` int(11) NOT NULL, `disabled` tinyint(1) NOT NULL, `configuration` longtext NOT NULL, PRIMARY KEY (`id`), KEY `identifier` (`identifier`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;");
$db->query("CREATE TABLE `lh_chat_incoming` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `chat_id` bigint(20) NOT NULL, `utime` bigint(20) NOT NULL, `incoming_id` int(11) NOT NULL, `payload` longtext NOT NULL, `chat_external_id` varchar(50) NOT NULL, PRIMARY KEY (`id`), KEY `chat_id` (`chat_id`), KEY `incoming_ext_id` (`incoming_id`,`chat_external_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;");
$db->query("CREATE TABLE `lh_abstract_chat_column` (`id` int(11) NOT NULL AUTO_INCREMENT,`column_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,`variable` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `position` int(11) NOT NULL, `enabled` tinyint(1) NOT NULL, `online_enabled` tinyint(1) NOT NULL, `chat_enabled` tinyint(1) NOT NULL, `conditions` text COLLATE utf8mb4_unicode_ci NOT NULL,`column_icon` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `column_identifier` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`), KEY `enabled` (`enabled`), KEY `online_enabled` (`online_enabled`), KEY `chat_enabled` (`chat_enabled`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;");
$db->query("CREATE TABLE `lh_abstract_chat_column` (`id` int(11) NOT NULL AUTO_INCREMENT,`column_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `has_popup` tinyint(1) NOT NULL DEFAULT 0, `popup_content` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `icon_mode` tinyint(1) NOT NULL DEFAULT 0, `variable` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `position` int(11) NOT NULL, `enabled` tinyint(1) NOT NULL, `online_enabled` tinyint(1) NOT NULL, `chat_enabled` tinyint(1) NOT NULL, `conditions` text COLLATE utf8mb4_unicode_ci NOT NULL,`column_icon` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `column_identifier` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`), KEY `enabled` (`enabled`), KEY `online_enabled` (`online_enabled`), KEY `chat_enabled` (`chat_enabled`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;");
$db->query("CREATE TABLE `lh_abstract_chat_priority` (`id` int(11) NOT NULL AUTO_INCREMENT,`value` text COLLATE utf8mb4_unicode_ci NOT NULL,`dep_id` int(11) NOT NULL, `dest_dep_id` int(11) NOT NULL DEFAULT 0, `sort_priority` int(11) NOT NULL DEFAULT 0,`priority` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `dep_id` (`dep_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;");

$db->query("CREATE TABLE `lh_canned_msg_dep` (
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lhc_web/design/defaulttheme/js/react/build/all.js

Large diffs are not rendered by default.

Expand Up @@ -214,38 +214,68 @@ class NodeTriggerActionCommand extends Component {
<input className="form-control form-control-sm" type="text" onChange={(e) => this.onchangeAttr({'path':['payload'],'value':e.target.value})} defaultValue={this.props.action.getIn(['content','payload'])} />
</div>
</div>
<div className="col-6">

{this.props.action.getIn(['content','payload_arg_type']) != 'count_filter' && this.props.action.getIn(['content','payload_arg_type']) != 'count' && this.props.action.getIn(['content','payload_arg_type']) != 'ratio' && <div className="col-6">
<div className="form-group">
<label>Chat variable value from group method</label>
<label>Calculated value from group method</label>
<input className="form-control form-control-sm" type="text" onChange={(e) => this.onchangeAttr({'path':['payload_cond_field'],'value':e.target.value})} defaultValue={this.props.action.getIn(['content','payload_cond_field'])} />
</div>
</div>
<div className="col-4">
</div>}

<div className="col-12">
<div className="form-group">
<label>Group field (sentiment)</label>
<input className="form-control form-control-sm" type="text" onChange={(e) => this.onchangeAttr({'path':['payload_arg_field'],'value':e.target.value})} defaultValue={this.props.action.getIn(['content','payload_arg_field'])} />
<label>Group method</label>
<select className="form-control form-control-sm" onChange={(e) => this.onchangeAttr({'path' : ['payload_arg_type'], 'value' : e.target.value})} defaultValue={this.props.action.getIn(['content','payload_arg_type'])}>
<option value="">Select group logic</option>
<optgroup label="Grouping">
<option value="avg">AVG</option>
<option value="sum">SUM</option>
<option value="sum_avg">SUM as comparator and AVG as value</option>
<option value="max">MAX</option>
<option value="min">MIN</option>
<option value="count_max">COUNT MAX (maximum number of grouped record)</option>
</optgroup>
<optgroup label="Counting">
<option value="count">COUNT (total number of messages)</option>
<option value="count_filter">COUNT FILTER (filtered by group value field)</option>
<option value="ratio">RATIO in comparison with all messages</option>
</optgroup>
</select>
</div>
</div>
<div className="col-4">
<label>Group method</label>
<select className="form-control form-control-sm" onChange={(e) => this.onchangeAttr({'path' : ['payload_arg_type'], 'value' : e.target.value})} defaultValue={this.props.action.getIn(['content','payload_arg_type'])}>
<option value="">Select group logic</option>
<option value="count">COUNT (total number of messages)</option>
<option value="avg">AVG</option>
<option value="sum">SUM</option>
<option value="sum_avg">SUM as comparator and AVG as value</option>
<option value="max">MAX</option>
<option value="min">MIN</option>
<option value="count_max">COUNT MAX (maximum number of grouped record)</option>
<option value="count_filter">COUNT FILTER (filtered by group value field)</option>
</select>
</div>
<div className="col-4">

{this.props.action.getIn(['content', 'payload_arg_type']) != 'count' &&
<div className="col-6">
<div className="form-group">
<label>Group field (sentiment)</label>
<input className="form-control form-control-sm" type="text"
onChange={(e) => this.onchangeAttr({
'path': ['payload_arg_field'],
'value': e.target.value
})}
defaultValue={this.props.action.getIn(['content', 'payload_arg_field'])}/>
</div>
</div>
}

{this.props.action.getIn(['content','payload_arg_type']) != 'count' &&
<div className="col-6">
<div className="form-group">
<label>Group value field (sentiment_value)</label>
{(this.props.action.getIn(['content','payload_arg_type']) == 'count_filter' || this.props.action.getIn(['content','payload_arg_type']) == 'ratio') && <label>Filter value</label>}
{this.props.action.getIn(['content','payload_arg_type']) != 'count_filter' && this.props.action.getIn(['content','payload_arg_type']) != 'ratio' && <label>Group value field. Eg (score field of the sentiment)</label>}
<input className="form-control form-control-sm" type="text" onChange={(e) => this.onchangeAttr({'path':['payload_arg_val'],'value':e.target.value})} defaultValue={this.props.action.getIn(['content','payload_arg_val'])} />
</div>
</div>
</div>}

{
['ratio','avg','sum_avg','max','min','count_max'].indexOf(this.props.action.getIn(['content','payload_arg_type'])) !== -1 &&
<div className="col-12">
<div className="form-group">
<label>Use only if value is one of. If not defined all possible values will be used.</label>
<input className="form-control form-control-sm" placeholder="negative,positive" type="text" onChange={(e) => this.onchangeAttr({'path':['payload_arg_val_sum'],'value':e.target.value})} defaultValue={this.props.action.getIn(['content','payload_arg_val_sum'])} />
</div>
</div>}

<div className="col-12">
<label>Messages to include</label>
<div className="form-group">
Expand Down
@@ -1,7 +1,15 @@
<?php if ( $chat->department !== false ) : ?>
<tr>
<td colspan="2" >
<h6 class="font-weight-bold"><i class="material-icons">chat</i>
<h6 class="font-weight-bold">
<?php
$icons_additional = erLhAbstractModelChatColumn::getList(array('ignore_fields' => array('position','conditions','column_identifier','enabled'), 'sort' => false, 'filter' => array('icon_mode' => 1, 'enabled' => 1, 'chat_enabled' => 1)));
$chatItems = [$chat];
erLhcoreClassChat::prefillGetAttributes($chatItems, array(), array(), array('additional_columns' => $icons_additional, 'do_not_clean' => true));
?>
<?php include(erLhcoreClassDesign::designtpl('lhchat/lists/icons_additional.tpl.php')); ?>

<i class="material-icons">chat</i>
<?php if ($chat->chat_initiator == erLhcoreClassModelChat::CHAT_INITIATOR_PROACTIVE) : ?>
<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/adminchat','Proactive chat')?>
<?php else : ?>
Expand Down
4 changes: 4 additions & 0 deletions lhc_web/design/defaulttheme/tpl/lhchat/icondetailed.tpl.php
@@ -0,0 +1,4 @@
<?php $modalHeaderTitle = htmlspecialchars($column->column_name)?>
<?php include(erLhcoreClassDesign::designtpl('lhkernel/modal_header.tpl.php'));?>
<?php echo $column->popup_content?>
<?php include(erLhcoreClassDesign::designtpl('lhkernel/modal_footer.tpl.php'));?>
3 changes: 3 additions & 0 deletions lhc_web/design/defaulttheme/tpl/lhchat/lists.tpl.php
Expand Up @@ -30,6 +30,9 @@
<?php include(erLhcoreClassDesign::designtpl('lhchat/lists/start_row.tpl.php')); ?>
<td><?php if ($chat->can_edit_chat == true) : ?><input ng-checked="check_all_items" class="mb-0" type="checkbox" name="ChatID[]" value="<?php echo $chat->id?>" /><?php endif;?></td>
<td>

<?php include(erLhcoreClassDesign::designtpl('lhchat/lists/icons_additional.tpl.php')); ?>

<?php foreach ($chat->aicons as $aicon) : ?>
<i class="material-icons" style="color: <?php isset($aicon['c']) ? print htmlspecialchars($aicon['c']) : print '#6c757d'?>" title="<?php isset($aicon['t']) ? print htmlspecialchars($aicon['t']) : htmlspecialchars($aicon['i'])?> {{icon.t ? icon.t : icon.i}}"><?php isset($aicon['i']) ? print htmlspecialchars($aicon['i']) : htmlspecialchars($aicon)?></i>
<?php endforeach; ?>
Expand Down
@@ -1,3 +1,3 @@
<td ng-repeat="column in lhc.additionalColumns" ng-if="column.cenabl == true">
<td ng-repeat="column in lhc.additionalColumns" ng-if="column.cenabl == true && !column.iconm">
<div class="abbr-list" ng-repeat="val in column.items">{{chat[val]}}&nbsp;</div>
</td>
@@ -1,3 +1,3 @@
<td ng-repeat="column in lhc.additionalColumns" ng-if="column.oenabl == true">
<td ng-repeat="column in lhc.additionalColumns" ng-if="column.oenabl == true && !column.iconm">
<span ng-repeat="val in column.items">{{ou[val]}}&nbsp;</span>
</td>
@@ -1,3 +1,3 @@
<th width="20%" ng-repeat="column in lhc.additionalColumns" ng-if="column.cenabl == true">
<th width="20%" ng-repeat="column in lhc.additionalColumns" ng-if="column.cenabl == true && !column.iconm">
<i ng-if="column.icon !== ''" class="material-icons">{{column.icon}}</i>{{column.name}}
</th>
5 changes: 4 additions & 1 deletion lhc_web/design/defaulttheme/tpl/lhchat/lists/icon.tpl.php
@@ -1 +1,4 @@
<i ng-if="chat.aicons && (lhc.excludeIcons.length == 0 || lhc.excludeIcons.indexOf(icon.i) === -1)" class="material-icons" ng-style="{'color': icon.c ? icon.c : '#6c757d'}" title="{{icon.t ? icon.t : icon.i}}" ng-repeat="icon in chat.aicons track by $index">{{icon.i || icon}}</i>
<i ng-if="chat.aicons && (lhc.excludeIcons.length == 0 || lhc.excludeIcons.indexOf(icon.i) === -1)" class="material-icons" ng-style="{'color': icon.c ? icon.c : '#6c757d'}" title="{{icon.t ? icon.t : icon.i}}" ng-repeat="icon in chat.aicons track by $index">{{icon.i || icon}}</i>
<i ng-repeat="column in lhc.additionalColumns" ng-if="column.cenabl == true && column.iconm == true" >
<span ng-if="chat[val]" ng-click="column.iconp && lhc.openModal('chat/icondetailed/' + chat.id + '/' + column.id, $event)" class="material-icons" title="{{column.iconp == true ? 'Click for more information | ' : ''}}{{chat[val + '_tt'] ? chat[val + '_tt'] : chat[val]}}" style="color: {{column.icon[chat[val]].color}}" ng-repeat="val in column.items">{{column.icon[chat[val]].icon}}</span>
</i>
@@ -0,0 +1,9 @@
<?php if (isset($icons_additional) && !empty($icons_additional)) : ?>
<?php foreach ($icons_additional as $iconAdditional) : $columnIconData = json_decode($iconAdditional->column_icon,true); ?>
<?php if (isset($chat->{'cc_' . $iconAdditional->id})) : ?>
<span <?php if ($iconAdditional->has_popup) : ?>onclick="lhc.revealModal({'url':WWW_DIR_JAVASCRIPT + 'chat/icondetailed/' + <?php echo $chat->id?> + '/' + <?php echo $iconAdditional->id?>});"<?php endif;?> class="material-icons<?php if ($iconAdditional->has_popup) : ?> action-image<?php endif; ?>" title="<?php isset($chat->{'cc_' . $iconAdditional->id . '_tt'}) ? print htmlspecialchars($chat->{'cc_' . $iconAdditional->id . '_tt'}) : print htmlspecialchars(isset($chat->{'cc_' . $iconAdditional->id}) ? $chat->{'cc_' . $iconAdditional->id} : '')?>" style="color: <?php echo isset($columnIconData[$chat->{'cc_' . $iconAdditional->id}]['color']) ? htmlspecialchars($columnIconData[$chat->{'cc_' . $iconAdditional->id}]['color']) : '#CECECE'?>">
<?php $iconAdditional->column_icon != "" && strpos($iconAdditional->column_icon,'"') !== false ? print htmlspecialchars($columnIconData[$chat->{'cc_' . $iconAdditional->id}]['icon']) : print htmlspecialchars($iconAdditional->column_icon); ?>
</span>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
@@ -1,3 +1,9 @@
<div role="tabpanel" id="tabs">
<ul class="nav nav-pills" role="tablist">
</ul>
<div class="tab-content pl-1">

<div class="tab-pane active">

<div class="row" ng-non-bindable>
<div class="col-sm-7 chat-main-left-column" id="chat-main-column-<?php echo $chat->id;?>">
Expand Down Expand Up @@ -33,4 +39,9 @@
<?php include(erLhcoreClassDesign::designtpl('lhchat/chat_tabs/chat_tabs_container.tpl.php')); ?>
</div>
</div>
<script>ee.emitEvent('adminArchiveChatLoaded', [<?php echo $archive->id?>,<?php echo $chat->id;?>]);</script>
<script>ee.emitEvent('adminArchiveChatLoaded', [<?php echo $archive->id?>,<?php echo $chat->id;?>]);</script>

</div>

</div>
</div>

0 comments on commit edef7a8

Please sign in to comment.