Scarab commit: svn commit: r10685 - trunk/src/java/org/tigris/scarab/tools/ScarabRequestTool.java

Hussayn Dabbous <[email protected]>
Newsgroups gmane.comp.java.scarab.cvs
Message-ID <[email protected]>
Author: dabbous
Date: 2009-01-28 14:08:39-0800
New Revision: 10685

Modified:
   trunk/src/java/org/tigris/scarab/tools/ScarabRequestTool.java

Log:
fixed a display bug in the 'associate users to issue' editor

Modified: trunk/src/java/org/tigris/scarab/tools/ScarabRequestTool.java
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/java/org/tigris/scarab/tools/ScarabRequestTool.java?view=diff&pathrev=10685&r1=10684&r2=10685
==============================================================================
--- trunk/src/java/org/tigris/scarab/tools/ScarabRequestTool.java	(original)
+++ trunk/src/java/org/tigris/scarab/tools/ScarabRequestTool.java	2009-01-28 14:08:39-0800
@@ -694,27 +694,36 @@
     /**
      * Find the best name for an attribute against the current mitList.
      *
+     * This method is called from velocity:
+     * 
+     * reports/SelectUsers.vm
+     * screens/IssueList.vm
+     * screens/UserList.vm
+     * 
      * @param attribute the attribute a name is requested for
      * @return the name to use
      * @throws TorqueException
      */
     public String getRModuleAttributeDisplayName(final Attribute attribute) throws TorqueException
     {
-
         final ScarabUser user = (ScarabUser)data.getUser();
-
-        return getRModuleAttributeDisplayName(attribute, user.getCurrentMITList());
+        MITList mitList = user.getCurrentMITList();
+        return getRModuleAttributeDisplayName(attribute, mitList);
     }
 
     /**
-     * Find the best name for an attribute against the current mitList.
+     * Find the best name for an attribute against the given mitList.
      *
+     * This method is called from velocity:
+     * 
+     * macros/GlobalMacros.vm
+     * 
      * @param attribute the attribute a name is requested for
      * @param mitlist use a custom MITList instead of the user's current mitlist
      * @return the name to use
      * @throws TorqueException
      */
-    private String getRModuleAttributeDisplayName(final Attribute attribute, final MITList mitlist)
+    public String getRModuleAttributeDisplayName(final Attribute attribute, final MITList mitlist)
             throws TorqueException
     {
         return mitlist.getAttributeDisplayName(attribute);
@@ -2777,11 +2786,17 @@
         return true;
     }
 
+    /**
+     * Calculate a MITList from a list of given issues
+     * @param issues
+     * @return
+     * @throws Exception
+     */
     public MITList getMITList(List issues)
-        throws Exception
+    throws Exception
     {
-        return MITListManager
-            .getInstanceFromIssueList(issues, (ScarabUser)data.getUser());
+        ScarabUser user = getCurrentUser();
+        return MITListManager.getInstanceFromIssueList(issues, user);
     }
 
     /**

------------------------------------------------------
http://scarab.tigris.org/ds/viewMessage.do?dsForumId=3577&dsMessageId=1064796
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.