Skip to content

Commit 68eed77

Browse files
committed
fixes for performance widgets
1 parent 3e2bef8 commit 68eed77

6 files changed

Lines changed: 14 additions & 8 deletions

File tree

lhc_web/design/defaulttheme/js/svelte/public/build/main.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lhc_web/design/defaulttheme/js/svelte/public/build/main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lhc_web/design/defaulttheme/js/svelte/src/Widgets/Parts/WidgetBodyPending.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,9 @@
380380
{#each $lhcList[type].list as chat}
381381
<tr>
382382
<td>
383-
{chat.name}
383+
<div class="abbr-list" title={chat.name}>
384+
{chat.name}
385+
</div>
384386
</td>
385387
{#if $lhcList[type].cl}
386388
{#each $lhcList[type].cl as col}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php if ($currentUser->hasAccessTo('lhstatistic','op_performance')) : ?>
2-
<lhc-widget <?php if (isset($customCardNoId)) : ?>no_panel_id="true"<?php endif;?> <?php if (isset($customCardNoCollapse)) : ?>no_collapse="true"<?php endif; ?> column_1_width="15%" <?php if ($currentUser->hasAccessTo('lhstatistic','performance_settings')) : ?>custom_settings_url="statistic/performancesettings/op"<?php endif;?> card_icon="account_box" no_link="true" hide_2_column="true" no_counter="true" hide_third_column="true" <?php if (isset($rightPanelMode)) : ?>right_panel_mode="true"<?php endif; ?> <?php if (isset($hideCardHeader)) : ?>hide_header="true"<?php endif;?> sort_identifier="op_performance_sort" icon_class="chat-active" limit_list_identifier="limitop" type="op_performance" expand_identifier="opp_widget_exp" list_identifier="op-performance" height_identifier="opp_m_h" panel_list_identifier="depp-panel-list" optionsPanel='<?php echo json_encode(array('limitid' => 'limitdp', 'hide_department_filter' => true, 'limits_width' => 12))?>' www_dir_flags="<?php echo erLhcoreClassDesign::design('images/flags');?>"></lhc-widget>
2+
<lhc-widget <?php if (isset($customCardNoId)) : ?>no_panel_id="true"<?php endif;?> <?php if (isset($customCardNoCollapse)) : ?>no_collapse="true"<?php endif; ?> column_1_width="15%" <?php if ($currentUser->hasAccessTo('lhstatistic','performance_settings')) : ?>custom_settings_url="statistic/performancesettings/op"<?php endif;?> card_icon="account_box" no_link="true" hide_2_column="true" no_counter="true" hide_third_column="true" <?php if (isset($rightPanelMode)) : ?>right_panel_mode="true"<?php endif; ?> <?php if (isset($hideCardHeader)) : ?>hide_header="true"<?php endif;?> sort_identifier="op_performance_sort" icon_class="chat-active" limit_list_identifier="limitop" type="op_performance" expand_identifier="opp_widget_exp" list_identifier="op-performance" height_identifier="opp_m_h" panel_list_identifier="depp-panel-list" optionsPanel='<?php echo json_encode(array('limitid' => 'limitop', 'hide_department_filter' => true, 'limits_width' => 12))?>' www_dir_flags="<?php echo erLhcoreClassDesign::design('images/flags');?>"></lhc-widget>
33
<?php endif; ?>

lhc_web/lib/core/lhchat/lhchat.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,7 +1663,7 @@ public static function hasAccessToRead($chat, $params = [])
16631663
return true;
16641664
}
16651665

1666-
public static function formatSeconds($seconds, $biggestReturn = false) {
1666+
public static function formatSeconds($seconds, $biggestReturn = false, $shortFormat = false) {
16671667

16681668
$y = floor($seconds / (86400*365.25));
16691669
$d = floor(($seconds - ($y*(86400*365.25))) / 86400);
@@ -1674,6 +1674,7 @@ public static function formatSeconds($seconds, $biggestReturn = false) {
16741674
$parts = array();
16751675
$hasYears = false;
16761676
$hasDays = false;
1677+
$hasHours = false;
16771678

16781679
if ($y > 0)
16791680
{
@@ -1690,14 +1691,15 @@ public static function formatSeconds($seconds, $biggestReturn = false) {
16901691
if ($h > 0 && $hasYears == false)
16911692
{
16921693
$parts[] = $h . ' h.';
1694+
$hasHours = true;
16931695
}
16941696

16951697
if ($m > 0 && $hasDays == false && $hasYears == false)
16961698
{
16971699
$parts[] = $m . ' m.';
16981700
}
16991701

1700-
if ($s > 0 && $hasDays == false && $hasYears == false)
1702+
if ($s > 0 && $hasDays == false && $hasYears == false && ($shortFormat === false || $hasHours == false))
17011703
{
17021704
$parts[] = $s . ' s.';
17031705
}

lhc_web/lib/vendor_lhc/LiveHelperChat/Models/Statistic/PerformanceWidgets.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ public static function getOpPerformance(array $params): array {
104104
foreach ($performanceColumns as $columnPerformance) {
105105
if (!isset($rowPerformance[$columnPerformance])) {
106106
$rowPerformance[$columnPerformance] = '';
107-
} elseif (($columnPerformance === 'ton' || $columnPerformance === 'toff') && $rowPerformance[$columnPerformance] !== '') {
108-
$rowPerformance[$columnPerformance] = \erLhcoreClassChat::formatSeconds((int)$rowPerformance[$columnPerformance]);
107+
} elseif (in_array($columnPerformance,['ton','toff','aart','frt']) && $rowPerformance[$columnPerformance] !== '') {
108+
$rowPerformance[$columnPerformance] = \erLhcoreClassChat::formatSeconds((int)$rowPerformance[$columnPerformance], false, true);
109109
}
110110
}
111111
}
@@ -217,6 +217,8 @@ public static function getDepPerformance(array $params): array {
217217
foreach ($performanceColumns as $columnPerformance) {
218218
if (!isset($rowPerformance[$columnPerformance])) {
219219
$rowPerformance[$columnPerformance] = '';
220+
} elseif (in_array($columnPerformance,['aart','frt','wt']) && $rowPerformance[$columnPerformance] !== '') {
221+
$rowPerformance[$columnPerformance] = \erLhcoreClassChat::formatSeconds((int)$rowPerformance[$columnPerformance], false, true);
220222
}
221223
}
222224
}

0 commit comments

Comments
 (0)