Author: hair
Date: 2008-06-05 14:08:17-0700
New Revision: 10593
Modified:
trunk/src/java/org/tigris/scarab/tools/ScarabRequestTool.java
trunk/src/webapp/WEB-INF/templates/screens/IssueList.vm
Log:
Issue SCB2536: ("Per Module" atribute names are not displayed in issue lists)
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&rev=10593&p1=trunk/src/java/org/tigris/scarab/tools/ScarabRequestTool.java&p2=trunk/src/java/org/tigris/scarab/tools/ScarabRequestTool.java&r1=10592&r2=10593
==============================================================================
--- trunk/src/java/org/tigris/scarab/tools/ScarabRequestTool.java (original)
+++ trunk/src/java/org/tigris/scarab/tools/ScarabRequestTool.java 2008-06-05 14:08:17-0700
@@ -116,6 +116,7 @@
import org.tigris.scarab.om.RModuleAttributeManager;
import org.tigris.scarab.om.RModuleIssueType;
import org.tigris.scarab.om.RModuleIssueTypePeer;
+import org.tigris.scarab.om.RModuleUserAttribute;
import org.tigris.scarab.om.ROptionOption;
import org.tigris.scarab.om.ReportManager;
import org.tigris.scarab.om.ScarabUser;
@@ -665,6 +666,9 @@
.getDefaultRModuleUserAttributes(
currentList.getIssueType());
}
+
+ // TODO repeat the above when single module but two or more issuetypes
+ // TODO looking for common default attributes.
}
if (issueListColumns == null) {
@@ -688,6 +692,44 @@
}
/**
+ * Find the best name for an attribute against the current mitList.
+ * If all issuetypes current in the mitList use the same name for the attribute this name is returned.
+ * Otherwise the global name is returned.
+ *
+ * @param rModuleUserAttribute the attribute a name is requested for
+ * @return the name to use
+ * @throws TorqueException
+ */
+ public String getRModuleUserAttributeDisplayName(RModuleUserAttribute rModuleUserAttribute) throws TorqueException
+ {
+
+ String result = null;
+
+ final String globalName = rModuleUserAttribute.getAttribute().getName();
+ final ScarabUser user = (ScarabUser)data.getUser();
+ final MITList mitlist = user.getCurrentMITList();
+
+ for(Iterator it = mitlist.getIssueTypeIds().iterator(); it.hasNext();)
+ {
+ final IssueType issueType = IssueTypeManager.getInstance((Integer) it.next());
+ final String name = mitlist.getModule()
+ .getRModuleAttribute(rModuleUserAttribute.getAttribute(), issueType)
+ .getDisplayValue();
+
+ if(null == result)
+ {
+ result = name;
+ }
+
+ if(!result.equals(name))
+ {
+ result = globalName;
+ }
+ }
+ return result;
+ }
+
+ /**
* First attempts to get the RModuleUserAttributes from the user.
* If it is empty, then it will try to get the defaults from the module.
* If anything fails, it will return an empty list.
Modified: trunk/src/webapp/WEB-INF/templates/screens/IssueList.vm
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/WEB-INF/templates/screens/IssueList.vm?view=diff&rev=10593&p1=trunk/src/webapp/WEB-INF/templates/screens/IssueList.vm&p2=trunk/src/webapp/WEB-INF/templates/screens/IssueList.vm&r1=10592&r2=10593
==============================================================================
--- trunk/src/webapp/WEB-INF/templates/screens/IssueList.vm (original)
+++ trunk/src/webapp/WEB-INF/templates/screens/IssueList.vm 2008-06-05 14:08:17-0700
@@ -135,11 +135,7 @@
#else
#set ($sort = "sortColumn")
#set ($sortData = $pref.AttributeId)
- #if ($mitlist.isSingleModuleIssueType())
- #set ($value = $mitlist.Module.getRModuleAttribute($pref.Attribute, $mitlist.IssueType).DisplayValue)
- #else
- #set ($value = $pref.Attribute.Name)
- #end
+ #set ($value = $scarabR.getRModuleUserAttributeDisplayName($pref))
#end
<th>
#prepIssueListPageLink()
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.