[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Webmail: email move-to-tracker wrong trigger, wrong folder choices when...

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68ca7ef19c3e8_2cdeb70552ca@gitlab-sidekiq-low-urgency-cpu-bound-v2-5dd8cccbbd-vzdx7.mail>

Victor Emanouilov pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
c39d98f1 by Merci Jacob at 2025-09-17T09:19:40+00:00
[FIX] Webmail: email move-to-tracker wrong trigger, wrong folder choices when field useFolders is disabled, and update Cypht
---
* [UPD] update  cypht

* [FIX] Webmail: moving email to a folder other than inbox indicates success but email is not moved — when field useFolders option is disabled

* [FIX] Webmail: the "No items found" element should not trigger the move action, and fix a spelling mistake from "futre" to "future"

See merge request tikiwiki/tiki!8583

- - - - -


5 changed files:

- lib/core/Services/Tracker/Controller.php
- lib/core/Tracker/Field/AbstractItemField.php
- lib/cypht/modules/tiki/js_modules/autoMoveReplyToTrackerItem.js
- lib/cypht/modules/tiki/js_modules/utils/moveToTracker.utils.js
- vendor_bundled/composer.lock


Changes:

=====================================
lib/core/Services/Tracker/Controller.php
=====================================
@@ -3248,26 +3248,36 @@ class Services_Tracker_Controller
             throw new Services_Exception_NotFound();
         }
 
+        /** @var Tracker_Field_EmailFolder $fieldHandler */
         $fieldHandler = $item->getDefinition()->getFieldFactory()->getHandler($field, $item->getData());
 
         if (! method_exists($fieldHandler, 'getFolders')) {
             throw new ServicesExceptionBadRequest(tr('Incorrect field type'));
         }
 
+        $trackerField = $fieldHandler->getTrackerFieldInstance();
         $folders = [];
 
-        foreach ($fieldHandler->getFolders() as $name => $label) {
-            if (empty($name)) {
-                continue;
+        if ($trackerField->getOption('useFolders')) {
+            foreach ($fieldHandler->getFolders() as $name => $label) {
+                if (empty($name)) {
+                    continue;
+                }
+                $folders[] = [
+                    'name' => $name,
+                    'label' => $label,
+                ];
             }
+        } else {
             $folders[] = [
-                'name' => $name,
-                'label' => $label,
+                'name' => 'inbox',
+                'label' => $trackerField->getOption('inboxName'),
             ];
         }
 
         return [
             'folders' => $folders,
+            'useFolders' => $trackerField->getOption('useFolders')
         ];
     }
 }


=====================================
lib/core/Tracker/Field/AbstractItemField.php
=====================================
@@ -599,7 +599,7 @@ abstract class AbstractItemField implements ItemFieldInterface, IndexableInterfa
     /**
      * Get the tracker field object corresponding to this tracker item field object
      */
-    protected function getTrackerFieldInstance(): AbstractTrackerField
+    public function getTrackerFieldInstance(): AbstractTrackerField
     {
         return $this->trackerField;
     }


=====================================
lib/cypht/modules/tiki/js_modules/autoMoveReplyToTrackerItem.js
=====================================
@@ -38,7 +38,7 @@ function autoMoveReplyToTrackerItem() {
 function promptFutureReplyAutoMove() {
     return new Promise((resolve) => {
         $.openModal({
-            title: tr("Move futre replies"),
+            title: tr("Move future replies"),
             content: `<p class="fw-bold">${tr("Do you want to automatically move future replies to this tracker item?")}</p>`,
             buttons: [
                 {


=====================================
lib/cypht/modules/tiki/js_modules/utils/moveToTracker.utils.js
=====================================
@@ -15,7 +15,7 @@ function getItemHtml(item) {
 }
 
 function getEmptyItemHtml() {
-    return `<div class="item p-2 rounded bg-secondary-subtle text-muted">
+    return `<div class="p-2 rounded bg-secondary-subtle text-muted">
         ${$.fn.getIcon("exclamation-triangle").prop("outerHTML")} ${tr("No items found.")}
     </div>`;
 }
@@ -91,6 +91,13 @@ async function showFolderPicker(itemElement) {
                 });
                 dropdown.append(folderItem);
             });
+
+            if (!res.useFolders) {
+                dropdown.append(`
+                    <div class="dropdown-divider"></div>
+                    <div class="text-warning small py-2 px-4">${$.fn.getIcon("exclamation-triangle").prop("outerHTML")} ${tr("To see more folders, configure them in the field options.")}</div>
+                `);
+            }
         }).fail(() => {
             dropdown.empty();
             showMessage(tr("An error occurred while fetching folders."), "error");


=====================================
vendor_bundled/composer.lock
=====================================
@@ -2862,12 +2862,12 @@
             "source": {
                 "type": "git",
                 "url": "https://github.com/cypht-org/cypht.git",
-                "reference": "90cb5b615b198a5f24db05dbc489751c58811d08"
+                "reference": "00593ecc63a260f3e7081c6c4e95039e6fb18982"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/cypht-org/cypht/zipball/90cb5b615b198a5f24db05dbc489751c58811d08",
-                "reference": "90cb5b615b198a5f24db05dbc489751c58811d08",
+                "url": "https://api.github.com/repos/cypht-org/cypht/zipball/00593ecc63a260f3e7081c6c4e95039e6fb18982",
+                "reference": "00593ecc63a260f3e7081c6c4e95039e6fb18982",
                 "shasum": ""
             },
             "require": {
@@ -2943,7 +2943,7 @@
                 "source": "https://github.com/cypht-org/cypht/",
                 "wiki": "https://github.com/cypht-org/cypht/wiki"
             },
-            "time": "2025-09-12T13:39:52+00:00"
+            "time": "2025-09-15T06:35:12+00:00"
         },
         {
             "name": "jean85/pretty-package-versions",



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/c39d98f13c0d48b3877d01fa1cc0fac2fed2be67

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/c39d98f13c0d48b3877d01fa1cc0fac2fed2be67
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.