[TikiWiki-commits] [Git][tikiwiki/tiki][master] [ENH] Webmail: Add possibility to move search emails to trackers

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <692692e88106_2a17b59c36720@gitlab-sidekiq-low-urgency-cpu-bound-v2-7c89b74ff5-zk2f6.mail>

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


Commits:
368ac860 by Josaphat Imani at 2025-11-26T05:33:00+00:00
[ENH] Webmail: Add possibility to move search emails to trackers
---
* [ENH] Webmail: Add possibility to move search emails to trackers

See merge request tikiwiki/tiki!9071

- - - - -


5 changed files:

- lib/cypht/modules/tiki/js_modules/moveToTracker.js
- lib/cypht/modules/tiki/js_modules/route_handlers.js
- lib/cypht/modules/tiki/setup.php
- lib/cypht/modules/tiki/site.js
- lib/cypht/modules/tiki/tracker_modules.php


Changes:

=====================================
lib/cypht/modules/tiki/js_modules/moveToTracker.js
=====================================
@@ -34,7 +34,8 @@ function showMoveToTrackerModal(onSuccess) {
                 } else {
                     suggestedItems.append(items.map(item => getItemHtml(item)).join('\n'));
                     suggestedItems.find('.item').on('click', function () {
-                        handleItemClick.call(this, modal, getMsgUid(), getListPathParam(), true, onSuccess);
+                        const listPath = getListPathParam() ?? getPageNameParam();
+                        handleItemClick.call(this, modal, getMsgUid(), listPath, true, onSuccess);
                     });
                 }
             });
@@ -49,7 +50,8 @@ function getMsgUid () {
     } else {
         $('input[type=checkbox]').each(function() {
             if (this.checked && this.id.search('imap') != -1) {
-                if (['sent', 'unread', 'combined_inbox', 'flagged'].includes(getListPathParam())) {
+                const listPath = getListPathParam() ?? getPageNameParam();
+                if (['sent', 'unread', 'combined_inbox', 'flagged', 'search'].includes(listPath)) {
                     ids.push(this.id);
                 } else {
                     ids.push(this.id.split('_')[2]);


=====================================
lib/cypht/modules/tiki/js_modules/route_handlers.js
=====================================
@@ -64,6 +64,15 @@ applySettingsPageHandlers = (function (originalHandlers) {
     };
 })(applySettingsPageHandlers);
 
+applySearchPageHandlers = (function (originalHandlers) {
+    return function (...params) {
+        const handlerOutput = originalHandlers(...params);
+        tiki_setup_move_to_trackers();
+
+        return handlerOutput;
+    };
+})(applySearchPageHandlers);
+
 applyComposePageHandlers = (function (originalHandlers) {
     return function (...params) {
         const handlerOutput = originalHandlers(...params);


=====================================
lib/cypht/modules/tiki/setup.php
=====================================
@@ -134,6 +134,7 @@ add_handler('compose', 'tiki_archive_replied', true, 'smtp', 'tiki_delete_draft'
 add_handler('compose', 'check_path_redirect_after_sent', true, 'smtp', 'tiki_archive_replied', 'after');
 add_handler('compose', 'tiki_compose_from_draft', true, 'smtp', 'load_smtp_servers_from_config', 'after');
 add_output('message_list', 'add_multiple_move_to_trackers', true, 'imap', 'imap_custom_controls', 'after');
+add_output('search', 'add_multiple_move_to_trackers', true, 'imap', 'search_move_copy_controls', 'after');
 add_output('message_list', 'add_multiple_item_to_trackers', true, 'imap', 'imap_custom_controls', 'after');
 add_handler('ajax_smtp_save_draft', 'tiki_presave_draft', true, 'smtp', 'smtp_save_draft', 'before');
 add_handler('ajax_smtp_save_draft', 'tiki_save_draft', true, 'smtp', 'smtp_save_draft', 'after');


=====================================
lib/cypht/modules/tiki/site.js
=====================================
@@ -192,9 +192,9 @@ var tiki_Hm_Ajax_Request = function() {
     var new_request = new Hm_Ajax_Request();
     new_request.fail = function(xhr, not_callable) {
         if (xhr.status && xhr.status == 500) {
-            Hm_Notices.show(['ERRInternal Server Error - check server log file for details.']);
+            Hm_Notices.show('Internal Server Error - check server log file for details.', 'danger');
         } else if (not_callable === true) {
-            Hm_Notices.show(['ERRCould not perform action - your session probably expired. Please reload page.']);
+            Hm_Notices.show('Could not perform action - your session probably expired. Please reload page.', 'danger');
         } else {
             $('.offline').show();
         }
@@ -293,7 +293,7 @@ var tiki_setup_move_to_trackers = function(callback_handler = null) {
         } else {
             $('input[type=checkbox]').each(function() {
                 if (this.checked && this.id.search('imap') != -1) {
-                    if (['sent', 'unread', 'combined_inbox', 'flagged'].includes(getListPathParam())) {
+                    if (['sent', 'unread', 'combined_inbox', 'flagged', 'search'].includes(getListPathParam() ?? getPageNameParam())) {
                         ids.push(this.id);
                     } else {
                         ids.push(this.id.split('_')[2]);


=====================================
lib/cypht/modules/tiki/tracker_modules.php
=====================================
@@ -158,7 +158,7 @@ class Hm_Handler_move_to_tracker extends Hm_Handler_Module
                     ]);
                 }
             }, ['email' => $email]);
-        } elseif (in_array($form['list_path'], ['sent', 'unread', 'combined_inbox', 'flagged'])) {
+        } elseif (in_array($form['list_path'], ['sent', 'unread', 'combined_inbox', 'flagged', 'search'])) {
             $imaps = [];
             $ids = [];
             foreach ($msg_ids as $msg_id) {



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

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/368ac8608f44fec8e62cc40d9de787287b5fc2c6
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.