[TikiWiki-commits] [Git][tikiwiki/tiki][master] 4 commits: [ENH][UX] User tasks: user tasks public module - not displaying tasks

Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a3f050667455_381997a4-3f0@gitlab-sidekiq-low-urgency-cpu-bound-v2-7646c8b49f-tp99l.mail>

Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
dfa562b6 by christer77 at 2026-06-26T22:44:35+00:00
[ENH][UX] User tasks: user tasks public module - not displaying tasks

- - - - -
cde72b23 by christer77 at 2026-06-26T22:44:35+00:00
case management info is null

- - - - -
8b0d3b4f by Aksanti Bahiga tacite at 2026-06-26T22:44:35+00:00
Fix user tasks public module based on review feedback

- - - - -
00362646 by marcellintacite at 2026-06-26T22:44:35+00:00
[FIX] TaskLink modifier: improve UX for missing and unauthorized tasks

- - - - -


3 changed files:

- lib/smarty_tiki/Modifier/TaskLink.php
- modules/mod-func-user_tasks_public.php
- templates/modules/mod-user_tasks_public.tpl


Changes:

=====================================
lib/smarty_tiki/Modifier/TaskLink.php
=====================================
@@ -21,13 +21,28 @@ class TaskLink
         $info = $tasklib->get_task($user, $taskId);
         $description = "";
 
-        $my_length = strlen($info['description']);
+        if (empty($info)) {
+            // Bypass permission checks to see if the task exists but the user lacks access,
+            // returning an appropriate translated message instead of silently hiding the link.
+            $adminInfo = $tasklib->get_task($user, $taskId, null, true);
+            if (empty($adminInfo)) {
+                return '<span class="tasklink-missing">[' . tra("Task missing") . ']</span>';
+            } else {
+                return '<span class="tasklink-denied">[' . tra("Task access denied") . ']</span>';
+            }
+        }
+        $info_description = '';
+        if (isset($info['description']) && $info['description'] !== null) {
+            $info_description = $info['description'];
+        }
+
+        $my_length = strlen($info_description);
         $my_pos = 0;
         $line = 0;
         if ($my_length > 0) {
             do {
                 $line++;
-                $my_pos = strpos($info['description'], "\n", ($my_pos + 1));
+                $my_pos = strpos($info_description, "\n", ($my_pos + 1));
             } while (($line <= 15) && ($my_pos != ''));
         }
 
@@ -35,10 +50,10 @@ class TaskLink
             if ($line < 15) {
                 $my_pos = 1300;
             }
-            $description .= substr($info['description'], 0, min(1300, $my_pos + 1));
+            $description .= substr($info_description, 0, min(1300, $my_pos + 1));
             $append = "<br /><center><span class=\'highlight\'>" . tra("Text cut here") . "</span></center>";
         } else {
-            $description = $info['description'];
+            $description = $info_description;
             $append = '';
         }
 


=====================================
modules/mod-func-user_tasks_public.php
=====================================
@@ -32,6 +32,7 @@ function module_user_tasks_public($mod_reference, $module_params)
     global $user, $tiki_p_tasks, $prefs;
     $smarty = TikiLib::lib('smarty');
     $tikilib = TikiLib::lib('tiki');
+    $access = TikiLib::lib('access');
     if ($user && isset($tiki_p_tasks) && $tiki_p_tasks == 'y') {
         global $tasklib;
         require_once 'lib/tasks/tasklib.php';


=====================================
templates/modules/mod-user_tasks_public.tpl
=====================================
@@ -23,7 +23,7 @@
                 {section name=iix loop=$public_tasks}
                     <tr>
                         <td class="prio{$public_tasks[iix].priority}">
-                            {if isset($modTasks[ix].percentage)}({$public_tasks[iix].percentage}%) {/if}{$public_tasks[iix].taskId|tasklink:linkmodule}
+                            {if isset($public_tasks[iix].percentage)}({$public_tasks[iix].percentage}%) {/if}{$public_tasks[iix].taskId|tasklink:linkmodule}
                             <br>{$public_tasks[iix].user|username}
                         </td>
                     </tr>



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/compare/775aea0b4cb4dd25f692c9b719f28dafc52d9195...0036264602729bb4682149010fb897801bad37bb

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/compare/775aea0b4cb4dd25f692c9b719f28dafc52d9195...0036264602729bb4682149010fb897801bad37bb
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
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.