Limit links in infolog list

This commit is contained in:
nathan 2024-10-04 09:42:44 -06:00
parent 1379855543
commit b7215be0f1
2 changed files with 19 additions and 3 deletions

View File

@ -43,7 +43,7 @@ export class Et2LinkString extends Et2Widget(LitElement) implements et2_IDetache
padding: 0px;
}
et2-link, et2-link::part(base) {
et2-link, et2-link::part(base), et2-description {
display: inline;
}
@ -268,7 +268,9 @@ export class Et2LinkString extends Et2Widget(LitElement) implements et2_IDetache
return this._loadingPromise.then(() =>
{
const moreCount = this._totalResults - this._link_list.length;
const more = this.egw().lang("%1 more...", moreCount);
const more = html`
<et2-description statustext="${this.egw().lang("%1 more...", moreCount)}">...
</et2-description>`;
return html`${moreCount > 0 ? more : nothing}`;
});
}

View File

@ -225,10 +225,24 @@ class infolog_ui
{
$show_links = $this->prefs['show_links'];
}
$only_app = '';
switch($show_links)
{
case 'links':
$only_app = '!' . Link::VFS_APPNAME;
break;
case 'attach':
$only_app = Link::VFS_APPNAME;
break;
default:
$only_app = '';
break;
}
if(($show_links != 'none' && $show_links != 'no_describtion' ||
$this->prefs['show_times'] || isset($GLOBALS['egw_info']['user']['apps']['timesheet'])) &&
(isset($info['links']) || ($info['links'] = Link::get_links('infolog', $info['info_id'], '', 'link_lastmod DESC', true, true))))
(isset($info['links']) || ($info['links'] = Link::get_links('infolog', $info['info_id'], $only_app, 'link_lastmod DESC', true, true, 20))))
{
$info['filelinks']['total'] = $show_links == 'attach' ? count($info['links']) : Link::$row_count;
$timesheets = array();
foreach($info['links'] as $link)
{