[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [FIX] Cypht: Update error message display

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69147945220a0_2ce30306995@gitlab-sidekiq-low-urgency-cpu-bound-v2-f8dc7c8b7-9rhnt.mail>

Victor Emanouilov pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
39673186 by Steven ngesera at 2025-11-12T12:02:53+00:00
[FIX] Cypht: Update error message display
---
* [FIX]Cypht: Update error message display
---
* [FIX]Cypht:Update error message disp
lay

See merge request tikiwiki/tiki!8072

See merge request tikiwiki/tiki!8932

- - - - -


6 changed files:

- lib/cypht/modules/tiki/calendar_modules.php
- lib/cypht/modules/tiki/functions.php
- lib/cypht/modules/tiki/general_modules.php
- lib/cypht/modules/tiki/groupmail_modules.php
- lib/cypht/modules/tiki/sievefilters_modules.php
- lib/cypht/modules/tiki/tracker_modules.php


Changes:

=====================================
lib/cypht/modules/tiki/calendar_modules.php
=====================================
@@ -244,19 +244,19 @@ class Hm_Handler_add_to_calendar extends Hm_Handler_Module
 
         list($success, $form) = $this->process_form(['calendar_id']);
         if (! $success) {
-            Hm_Msgs::add("ERRNo calendar selected");
+            Hm_Msgs::add("No calendar selected", "warning");
             return;
         }
 
         $calendar = TikiLib::lib('calendar')->get_calendar($form['calendar_id']);
         if (! $calendar) {
-            Hm_Msgs::add("ERRSelected calendar is unavailable");
+            Hm_Msgs::add("Selected calendar is unavailable", "danger");
             return;
         }
 
         $perms = Perms::get('calendar', $form['calendar_id']);
         if (! $perms->add_events) {
-            Hm_Msgs::add("ERRInsufficient permissions to create the event in the selected calendar");
+            Hm_Msgs::add("Insufficient permissions to create the event in the selected calendar", "danger");
             return;
         }
 
@@ -306,13 +306,13 @@ class Hm_Handler_update_in_calendar extends Hm_Handler_Module
         $existing = TikiLib::lib('calendar')->find_by_uid(null, $data['uid']);
 
         if (! $existing) {
-            Hm_Msgs::add("ERRExisting event could not be found in your calendar");
+            Hm_Msgs::add("Existing event could not be found in your calendar", "danger");
             return;
         }
 
         $perms = Perms::get('event', $existing['calitemId']);
         if (! $perms->change_events) {
-            Hm_Msgs::add("ERRInsufficient permissions to update the event in the calendar");
+            Hm_Msgs::add("Insufficient permissions to update the event in the calendar", "danger");
             return;
         }
 


=====================================
lib/cypht/modules/tiki/functions.php
=====================================
@@ -26,13 +26,13 @@ if (! hm_exists('tiki_parse_message')) {
 
         $field = $trk->get_field_info($fieldId);
         if (! $field) {
-            Hm_Msgs::add('ERRTracker field not found');
+            Hm_Msgs::add('Tracker field not found', 'danger');
             return;
         }
 
         $item = $trk->get_item_info($itemId);
         if (! $item) {
-            Hm_Msgs::add('ERRTracker item not found');
+            Hm_Msgs::add('Tracker item not found', 'danger');
             return;
         }
         $item[$field['fieldId']] = $trk->get_item_value(null, $item['itemId'], $field['fieldId']);
@@ -41,7 +41,7 @@ if (! hm_exists('tiki_parse_message')) {
         $data = $handler->getFieldData();
 
         if (! isset($data['emails']) || ! is_array($data['emails'])) {
-            Hm_Msgs::add('ERRTracker field storage is broken or you are using the wrong field type');
+            Hm_Msgs::add('Tracker field storage is broken or you are using the wrong field type', 'danger');
             return;
         }
 
@@ -66,12 +66,12 @@ if (! hm_exists('tiki_parse_message')) {
         }
 
         if (! $email) {
-            Hm_Msgs::add('ERREmail not found in related tracker item');
+            Hm_Msgs::add('Email not found in related tracker item', 'warning');
             return;
         }
 
         if (empty($email['message_raw'])) {
-            Hm_Msgs::add('ERREmail could not be parsed');
+            Hm_Msgs::add('Email could not be parsed', 'warning');
             return;
         }
 
@@ -312,7 +312,7 @@ if (! hm_exists('tiki_send_email_through_cypht')) {
         // smtp server details
         $smtp_details = Hm_SMTP_List::dump($smtp_id, true);
         if (! $smtp_details) {
-            Hm_Msgs::add('ERRCould not use the configured SMTP server');
+            Hm_Msgs::add('Could not use the configured SMTP server', 'danger');
             return false;
         }
 
@@ -328,7 +328,7 @@ if (! hm_exists('tiki_send_email_through_cypht')) {
         // try to connect
         $smtp = Hm_SMTP_List::connect($smtp_id, false);
         if (! $smtp->authed()) {
-            Hm_Msgs::add("ERRFailed to authenticate to the SMTP server");
+            Hm_Msgs::add("Failed to authenticate to the SMTP server", "danger");
             return false;
         }
 
@@ -342,14 +342,14 @@ if (! hm_exists('tiki_send_email_through_cypht')) {
         // get smtp recipients
         $recipients = $mime->get_recipient_addresses();
         if (empty($recipients)) {
-            Hm_Msgs::add("ERRNo valid receipts found");
+            Hm_Msgs::add("No valid receipts found", "warning");
             return false;
         }
 
         // send the message
         $err_msg = $smtp->send_message($from, $recipients, $mime->get_mime_msg());
         if ($err_msg) {
-            Hm_Msgs::add(sprintf("ERR%s", $err_msg));
+            Hm_Msgs::add(sprintf("%s", $err_msg, "danger"));
             return false;
         }
 


=====================================
lib/cypht/modules/tiki/general_modules.php
=====================================
@@ -81,7 +81,7 @@ class Hm_Handler_add_file_attachment extends Hm_Handler_Module
                 'size' => $tikifile->filesize
             ];
             if (! attach_file($tikifile->getContents(), $file, $this->config->get('attachment_dir'), $draft_id, $this)) {
-                Hm_Msgs::add('ERRAn error occurred attaching the file gallery file.');
+                Hm_Msgs::add('An error occurred attaching the file gallery file.', 'danger');
             }
         }
     }


=====================================
lib/cypht/modules/tiki/groupmail_modules.php
=====================================
@@ -149,7 +149,7 @@ class Hm_Handler_take_groupmail extends Hm_Handler_Module
         // check if already taken
         $itemid = $trklib->get_item_id($this->get('trackerId'), $this->get('messageFId'), $realmsgid);
         if ($itemid > 0) {
-            Hm_Msgs::add('ERR' . tr('Sorry, that mail has been taken by another operator.'));
+            Hm_Msgs::add(tr('Sorry, that mail has been taken by another operator.'), 'warning');
             return;
         } else {
             $charset = $prefs['default_mail_charset'];
@@ -248,7 +248,7 @@ class Hm_Handler_put_back_groupmail extends Hm_Handler_Module
             $trklib->remove_tracker_item($itemid);
             $this->out('item_removed', true);
         } else {
-            Hm_Msgs::add('ERR' . tr('Tracker item not found!'));
+            Hm_Msgs::add(tr('Tracker item not found!'), 'danger');
         }
     }
 }


=====================================
lib/cypht/modules/tiki/sievefilters_modules.php
=====================================
@@ -31,7 +31,7 @@ class Hm_Output_tiki_filters_cron extends Hm_Output_Module
                 }
                 return false;
             } catch (Exception $e) {
-                Hm_Msgs::add("ERRSieve: {$e->getMessage()}");
+                Hm_Msgs::add("Sieve: {$e->getMessage()}", "danger");
                 return false;
             }
         });


=====================================
lib/cypht/modules/tiki/tracker_modules.php
=====================================
@@ -110,7 +110,7 @@ class Hm_Handler_move_to_tracker extends Hm_Handler_Module
             $folder = hex2bin($matches[2]);
             $mailbox = Hm_IMAP_List::get_connected_mailbox($imap_server_id, $this->cache);
             if (! $mailbox->authed()) {
-                Hm_Msgs::add('ERRCould not authenticate with mail server');
+                Hm_Msgs::add('Could not authenticate with mail server', 'danger');
                 return;
             }
 
@@ -122,7 +122,7 @@ class Hm_Handler_move_to_tracker extends Hm_Handler_Module
         } elseif (preg_match("/^tracker_folder_/", $form['list_path'], $matches)) {
             $email = tiki_parse_message($form['list_path'], $msg_ids[0]);
             if (! $email) {
-                Hm_Msgs::add('ERRMessage could not be loaded');
+                Hm_Msgs::add('Message could not be loaded', 'danger');
                 return;
             }
             if (isset($form['folder']) && $form['folder'] != 'archive') {
@@ -190,7 +190,7 @@ class Hm_Handler_move_to_tracker extends Hm_Handler_Module
                 bind_tracker_item_update_event($mailbox, $folder, $form, $ids);
             }
         } else {
-            Hm_Msgs::add('ERRMessage from this source could not be moved');
+            Hm_Msgs::add('Message from this source could not be moved', 'danger');
             return;
         }
 
@@ -198,13 +198,13 @@ class Hm_Handler_move_to_tracker extends Hm_Handler_Module
         $item = $trk->get_item_info($form['tracker_item_id']);
 
         if (! $item) {
-            Hm_Msgs::add('ERRTracker item not found');
+            Hm_Msgs::add('Tracker item not found', 'danger');
             return;
         }
 
         $field = $trk->get_field_info($form['tracker_field_id']);
         if (! $field) {
-            Hm_Msgs::add('ERRTracker field not found');
+            Hm_Msgs::add('Tracker field not found', 'danger');
             return;
         }
 
@@ -241,7 +241,7 @@ class Hm_Handler_move_to_tracker extends Hm_Handler_Module
         if ($errors > 0 && $errors < $total_msg_ids) {
             Hm_Msgs::add('Some messages moved');
         } elseif ($total_msg_ids == $errors) {
-            Hm_Msgs::add('ERRUnable to move/copy selected messages');
+            Hm_Msgs::add('Unable to move/copy selected messages', 'danger');
             return;
         } else {
             Hm_Msgs::add('Messages moved');
@@ -351,12 +351,12 @@ class Hm_Handler_tiki_save_sent extends Hm_Handler_Module
         $trk = TikiLib::lib('trk');
         $item = $trk->get_item_info($itemId);
         if (! $item) {
-            Hm_Msgs::add('ERRTracker item not found');
+            Hm_Msgs::add('Tracker item not found', 'danger');
             return;
         }
         $field = $trk->get_field_info($fieldId);
         if (! $field) {
-            Hm_Msgs::add('ERRTracker field not found');
+            Hm_Msgs::add('Tracker field not found', 'danger');
             return;
         }
         $field['value'] = [
@@ -486,12 +486,12 @@ class Hm_Handler_tiki_save_draft extends Hm_Handler_Module
         $trk = TikiLib::lib('trk');
         $item = $trk->get_item_info($itemId);
         if (! $item) {
-            Hm_Msgs::add('ERRTracker item not found');
+            Hm_Msgs::add('Tracker item not found', 'danger');
             return;
         }
         $field = $trk->get_field_info($fieldId);
         if (! $field) {
-            Hm_Msgs::add('ERRTracker field not found');
+            Hm_Msgs::add('Tracker field not found', 'danger');
             return;
         }
 
@@ -558,7 +558,7 @@ class Hm_Handler_tiki_compose_from_draft extends Hm_Handler_Module
         $field = $trk->get_field_info($fieldId);
 
         if (! $field) {
-            Hm_Msgs::add('ERRTracker field not found');
+            Hm_Msgs::add('Tracker field not found', 'danger');
             return;
         }
 
@@ -606,13 +606,13 @@ class Hm_Handler_tiki_archive_replied extends Hm_Handler_Module
         $trk = TikiLib::lib('trk');
         $item = $trk->get_item_info($itemId);
         if (! $item) {
-            Hm_Msgs::add('ERRTracker item not found');
+            Hm_Msgs::add('Tracker item not found', 'danger');
             return;
         }
 
         $field = $trk->get_field_info($fieldId);
         if (! $field) {
-            Hm_Msgs::add('ERRTracker field not found');
+            Hm_Msgs::add('Tracker field not found', 'danger');
             return;
         }
 
@@ -646,13 +646,13 @@ class Hm_Handler_tiki_delete_message extends Hm_Handler_Module
             $trk = TikiLib::lib('trk');
             $item = $trk->get_item_info($itemId);
             if (! $item) {
-                Hm_Msgs::add('ERRTracker item not found');
+                Hm_Msgs::add('Tracker item not found', 'danger');
                 $this->out('delete_error', true);
                 return;
             }
             $field = $trk->get_field_info($fieldId);
             if (! $field) {
-                Hm_Msgs::add('ERRTracker field not found');
+                Hm_Msgs::add('Tracker field not found', 'danger');
                 $this->out('delete_error', true);
                 return;
             }
@@ -689,13 +689,13 @@ class Hm_Handler_tiki_archive_message extends Hm_Handler_Module
             $trk = TikiLib::lib('trk');
             $item = $trk->get_item_info($itemId);
             if (! $item) {
-                Hm_Msgs::add('ERRTracker item not found');
+                Hm_Msgs::add('Tracker item not found', 'danger');
                 $this->out('archive_error', true);
                 return;
             }
             $field = $trk->get_field_info($fieldId);
             if (! $field) {
-                Hm_Msgs::add('ERRTracker field not found');
+                Hm_Msgs::add('Tracker field not found', 'danger');
                 $this->out('archive_error', true);
                 return;
             }
@@ -920,7 +920,7 @@ class Hm_Handler_tiki_download_message extends Hm_Handler_Module
                 echo $part->getContent();
                 Hm_Functions::cease();
             }
-            Hm_Msgs::add('ERRAn Error occurred trying to download the message');
+            Hm_Msgs::add('An Error occurred trying to download the message', 'danger');
         }
     }
 }
@@ -951,7 +951,7 @@ class Hm_Handler_tiki_process_move extends Hm_Handler_Module
                 }
             }
             if ($moved == 0) {
-                Hm_Msgs::add('ERRUnable to move/copy selected messages');
+                Hm_Msgs::add('Unable to move/copy selected messages', 'danger');
             } elseif ($form['imap_move_action'] == 'move') {
                 Hm_Msgs::add($moved == 1 ? 'Message moved' : $moved . ' messages moved');
             } else {



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

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