This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  959033fbded9a358dd50a71dae1be002eeee9862 (commit)
      from  4b2994cd5b63dafb49810b8b37468f69b93450b7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=959033fbded9a358dd50a71dae1be002eeee9862

commit 959033fbded9a358dd50a71dae1be002eeee9862
Author: Franck Villaume <[email protected]>
Date:   Sun Sep 4 19:24:12 2016 +0200

    tracker/pm: fix permission check on relation

diff --git a/src/common/tracker/include/ArtifactTypeHtml.class.php 
b/src/common/tracker/include/ArtifactTypeHtml.class.php
index 4d892db..9d6bc5a 100644
--- a/src/common/tracker/include/ArtifactTypeHtml.class.php
+++ b/src/common/tracker/include/ArtifactTypeHtml.class.php
@@ -454,7 +454,7 @@ EOS;
        }
 
        function renderRelatedTasks($group, $ah) {
-
+               global $HTML;
                if (!$group->usesPM()) {
                        return;
                }
@@ -480,7 +480,7 @@ EOS;
                        $title_arr[] = _('End Date');
                        $title_arr[] = _('Status');
                        (($is_admin) ? $title_arr[]=_('Remove Relation') : '');
-                       echo $GLOBALS['HTML']->listTableTop($title_arr);
+                       echo $HTML->listTableTop($title_arr);
 
                        for ($i = 0; $i < $taskcount; $i++) {
                                $taskinfo  = db_fetch_array($ah->relatedtasks, 
$i);
@@ -488,21 +488,23 @@ EOS;
                                $taskid    = $taskinfo['project_task_id'];
                                $projectid = $taskinfo['group_project_id'];
                                $groupid   = $taskinfo['group_id'];
-                               $summary   = 
util_unconvert_htmlspecialchars($taskinfo['summary']);
-                               $startdate = date(_('Y-m-d H:i'), 
$taskinfo['start_date']);
-                               $enddate   = date(_('Y-m-d H:i'), 
$taskinfo['end_date']);
-                               $status   = $taskinfo['status_name'];
-                               echo '<tr>
-                                               
<td>'.util_make_link('/pm/task.php?func=detailtask&project_task_id='.$taskid.'&group_id='.$groupid.'&group_project_id='.$projectid,
 '[T'.$taskid.'] '.$summary).'</td>
-                                               <td><div class="percentbar" 
style="width: 100px;">
-                                                       <div 
style="width:'.round($taskinfo['percent_complete']).'px;"></div></div></td>
-                                               <td>'.$startdate.'</td>
-                                               <td>'.$enddate.'</td>
-                                               <td>'.$status.' 
('.$taskinfo['percent_complete'].'%)</td>'.
-                                       (($is_admin) ? '<td><input 
type="checkbox" name="remlink[]" value="'.$taskid.'" /></td>' : '').
-                                       '</tr>';
+                               if (forge_check_perm('pm', $projectid, 'read')) 
{
+                                       $summary   = 
util_unconvert_htmlspecialchars($taskinfo['summary']);
+                                       $startdate = date(_('Y-m-d H:i'), 
$taskinfo['start_date']);
+                                       $enddate   = date(_('Y-m-d H:i'), 
$taskinfo['end_date']);
+                                       $status   = $taskinfo['status_name'];
+                                       echo '<tr>
+                                                       
<td>'.util_make_link('/pm/task.php?func=detailtask&project_task_id='.$taskid.'&group_id='.$groupid.'&group_project_id='.$projectid,
 '[T'.$taskid.'] '.$summary).'</td>
+                                                       <td><div 
class="percentbar" style="width: 100px;">
+                                                               <div 
style="width:'.round($taskinfo['percent_complete']).'px;"></div></div></td>
+                                                       <td>'.$startdate.'</td>
+                                                       <td>'.$enddate.'</td>
+                                                       <td>'.$status.' 
('.$taskinfo['percent_complete'].'%)</td>'.
+                                               (($is_admin) ? '<td><input 
type="checkbox" name="remlink[]" value="'.$taskid.'" /></td>' : '').
+                                               '</tr>';
+                               }
                        }
-                       echo $GLOBALS['HTML']->listTableBottom();
+                       echo $HTML->listTableBottom();
 
                        echo "\n<hr /><p style=\"text-align:right;\">";
                        printf(_('Average completion rate: %d%%'), 
(int)($totalPercentage/$taskcount));
@@ -512,7 +514,7 @@ EOS;
        }
 
        function renderFiles($group_id, $ah) {
-
+               global $HTML;
                $file_list =& $ah->getFiles();
                $count=count($file_list);
 
@@ -525,7 +527,7 @@ EOS;
                        $title_arr[] = _('Date');
                        $title_arr[] = _('By');
                        $title_arr[] = _('Download');
-                       echo $GLOBALS['HTML']->listTableTop($title_arr);
+                       echo $HTML->listTableTop($title_arr);
 
                        foreach ($file_list as $file) {
                                echo '<tr>';
@@ -540,7 +542,7 @@ EOS;
                                echo '</tr>';
                        }
 
-                       echo $GLOBALS['HTML']->listTableBottom();
+                       echo $HTML->listTableBottom();
                        echo '</td></tr>';
                }
        }

-----------------------------------------------------------------------

Summary of changes:
 .../tracker/include/ArtifactTypeHtml.class.php     | 40 ++++++++++++----------
 1 file changed, 21 insertions(+), 19 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to