From e43331e48bfbd19787eeddc4171689e4a70fd0d2 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 31 May 2021 17:11:58 +0200 Subject: [PATCH] fix not applied blur on initial load and also disable optimization for CRM-view and the like --- infolog/inc/class.infolog_bo.inc.php | 9 +++++---- infolog/js/app.js | 6 ++++-- infolog/js/app.ts | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/infolog/inc/class.infolog_bo.inc.php b/infolog/inc/class.infolog_bo.inc.php index dfe9bb87a6..455ae547d0 100644 --- a/infolog/inc/class.infolog_bo.inc.php +++ b/infolog/inc/class.infolog_bo.inc.php @@ -1273,8 +1273,9 @@ class infolog_bo unset($q['limit_modified_n_month']); for($n = 1; $n <= self::LIMIT_MODIFIED_RETRY; $n *= 2) { - // apply modified limit only if requested AND we're sorting by modified AND NOT searching - if (!empty($query['limit_modified_n_month']) && empty($query['search']) && + // apply modified limit only if requested AND we're sorting by modified AND NOT (searching, CRM-view, ...) + if (!empty($query['limit_modified_n_month']) && empty($query['search']) && // no search + empty($query['action']) && empty($query['action_id']) && empty($query['info_id']) && // no CRM view $query['order'] === 'info_datemodified' && $query['sort'] === 'DESC' && isset($query['start'])) { @@ -1282,12 +1283,12 @@ class infolog_bo (new Api\DateTime((-$n*$query['limit_modified_n_month']).' month'))->format('server'); } $ret = $this->so->search($q, $no_acl); - $this->total = $q['total']; + $this->total = $query['total'] = $q['total']; if (!isset($q['col_filter'][99]) || count($ret) >= $query['num_rows']) { if (isset($q['col_filter'][99])) { - $this->total = self::LIMIT_MODIFIED_TOTAL; + $this->total = $query['total'] = self::LIMIT_MODIFIED_TOTAL; } break; // --> no modified limit, or got enough rows } diff --git a/infolog/js/app.js b/infolog/js/app.js index e5719c916c..0664ec98f5 100644 --- a/infolog/js/app.js +++ b/infolog/js/app.js @@ -71,6 +71,7 @@ var InfologApp = /** @class */ (function (_super) { * @param {string} _name template name */ InfologApp.prototype.et2_ready = function (_et2, _name) { + var _a; // call parent _super.prototype.et2_ready.call(this, _et2, _name); // CRM View @@ -91,7 +92,7 @@ var InfologApp = /** @class */ (function (_super) { this._get_stylite(function () { this.mailvelopeAvailable(function () { var _a; (_a = app.stylite) === null || _a === void 0 ? void 0 : _a.decrypt_hover(nm); }); }); } // blur count, if limit modified optimization used - if ((nm === null || nm === void 0 ? void 0 : nm.getValue()).total == 9999) { + if (((_a = nm.getController()) === null || _a === void 0 ? void 0 : _a.getTotalCount()) === 9999) { this.blurCount(true); } break; @@ -737,7 +738,8 @@ var InfologApp = /** @class */ (function (_super) { * @param blur */ InfologApp.prototype.blurCount = function (blur) { - document.querySelector('div#infolog-index_nm.et2_nextmatch .header_count').classList.toggle('blur_count', blur); + var _a; + (_a = document.querySelector('div#infolog-index_nm.et2_nextmatch .header_count')) === null || _a === void 0 ? void 0 : _a.classList.toggle('blur_count', blur); }; return InfologApp; }(egw_app_1.EgwApp)); diff --git a/infolog/js/app.ts b/infolog/js/app.ts index 267b3ff3d3..9882ba5821 100644 --- a/infolog/js/app.ts +++ b/infolog/js/app.ts @@ -92,7 +92,7 @@ class InfologApp extends EgwApp this._get_stylite(function() {this.mailvelopeAvailable(function() {app.stylite?.decrypt_hover(nm);});}); } // blur count, if limit modified optimization used - if ((nm?.getValue()).total == 9999) + if (nm.getController()?.getTotalCount() === 9999) { this.blurCount(true); } @@ -884,7 +884,7 @@ class InfologApp extends EgwApp */ blurCount(blur : boolean) { - document.querySelector('div#infolog-index_nm.et2_nextmatch .header_count').classList.toggle('blur_count', blur); + document.querySelector('div#infolog-index_nm.et2_nextmatch .header_count')?.classList.toggle('blur_count', blur); } }