From 4570a5a264709f084f1ca6f49c99e98820919298 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 31 Aug 2022 13:34:15 -0600 Subject: [PATCH] Mail: Fix folder ACL - Set searchUrl in template so it can be found during initialization. Using modifications to clear it. - Passing initial value to avoid a query --- mail/inc/class.mail_acl.inc.php | 5 +++-- mail/js/app.js | 2 +- mail/templates/default/acl.xet | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/mail/inc/class.mail_acl.inc.php b/mail/inc/class.mail_acl.inc.php index 6462fecae7..9adfdf8d84 100644 --- a/mail/inc/class.mail_acl.inc.php +++ b/mail/inc/class.mail_acl.inc.php @@ -139,11 +139,11 @@ class mail_acl } if (!$this->imap->isAdminConnection) { - $tmpl->setElementAttribute('mailbox', 'autocomplete_url', 'mail.mail_compose.ajax_searchFolder'); - $tmpl->setElementAttribute('mailbox', 'autocomplete_params', array('mailaccount' => $acc_id)); + $tmpl->setElementAttribute('mailbox', 'searchOptions', array('mailaccount' => $acc_id)); } else { + $tmpl->setElementAttribute('mailbox', 'searchUrl', ''); //Todo: Implement autocomplete_url function with admin stuffs consideration } // Unset the content if folder is changed, in order to read acl rights for new selected folder @@ -253,6 +253,7 @@ class mail_acl } } $readonlys = $sel_options = array(); + $sel_options['mailbox'] = [['value' => $mailbox, 'label' => $mailbox]]; $sel_options['acl'] = $this->aclRightsAbbrvs; //Make the account owner's fields all readonly as owner has all rights and should not be able to change them diff --git a/mail/js/app.js b/mail/js/app.js index 46fc32d187..5495795005 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -4439,7 +4439,7 @@ app.classes.mail = AppJS.extend( if (mailbox) { - if (mailbox.taglist.getValue().length > 0) + if (mailbox.value.length > 0) { this.et2._inst.submit(); } diff --git a/mail/templates/default/acl.xet b/mail/templates/default/acl.xet index f134bdfc21..0208c4b933 100755 --- a/mail/templates/default/acl.xet +++ b/mail/templates/default/acl.xet @@ -14,7 +14,9 @@ - +