Scarab commit: svn commit: r10264 - branches/release/b21/src: conf/classes java/org/tigris/scarab/om java/org/tigris/scarab/screens java/org/tigris/scarab/tools/localization webapp/WEB-INF/templates/screens

[email protected]
Newsgroups gmane.comp.java.scarab.cvs
Message-ID <[email protected]>
Author: jorgeuriarte
Date: 2006-08-27 08:37:01-0700
New Revision: 10264

Added:
   branches/release/b21/src/java/org/tigris/scarab/screens/IssueTypeList.java
Modified:
   branches/release/b21/src/conf/classes/ScarabBundle_en.properties
   branches/release/b21/src/conf/classes/ScarabBundle_es.properties
   branches/release/b21/src/java/org/tigris/scarab/om/AbstractScarabUser.java
   branches/release/b21/src/java/org/tigris/scarab/tools/localization/L10NKeySet.java
   branches/release/b21/src/webapp/WEB-INF/templates/screens/IssueTypeList.vm
   branches/release/b21/src/webapp/WEB-INF/templates/screens/QueryMatrix.vm

Log:
Fixed problem when homepage was querymatrix but no module was selected.
Also; the querymatrix will not be displayed if no issuetypes are availaible,
showing an alert message.



Modified: branches/release/b21/src/conf/classes/ScarabBundle_en.properties
Url: http://scarab.tigris.org/source/browse/scarab/branches/release/b21/src/conf/classes/ScarabBundle_en.properties?view=diff&rev=10264&p1=branches/release/b21/src/conf/classes/ScarabBundle_en.properties&p2=branches/release/b21/src/conf/classes/ScarabBundle_en.properties&r1=10263&r2=10264
==============================================================================
--- branches/release/b21/src/conf/classes/ScarabBundle_en.properties	(original)
+++ branches/release/b21/src/conf/classes/ScarabBundle_en.properties	2006-08-27 08:37:01-0700
@@ -724,6 +724,7 @@
 StartListFromSaved=Build new list
 SavedListsOfIssueTypes=Saved lists of issue types
 NoIssueTypeSelected=No issue types have been selected.  Please select from the list below.
+NoIssueTypesAssociatedToModule=No issue type have been associated to this module. Please contact the administrator.
 SelectSaveXModuleQuery=Saved issue type lists...
 SelectSaveXModuleReport=Saved issue type lists...
 NoSavedIssueTypeLists=There are no saved issue type lists

Modified: branches/release/b21/src/conf/classes/ScarabBundle_es.properties
Url: http://scarab.tigris.org/source/browse/scarab/branches/release/b21/src/conf/classes/ScarabBundle_es.properties?view=diff&rev=10264&p1=branches/release/b21/src/conf/classes/ScarabBundle_es.properties&p2=branches/release/b21/src/conf/classes/ScarabBundle_es.properties&r1=10263&r2=10264
==============================================================================
--- branches/release/b21/src/conf/classes/ScarabBundle_es.properties	(original)
+++ branches/release/b21/src/conf/classes/ScarabBundle_es.properties	2006-08-27 08:37:01-0700
@@ -704,6 +704,7 @@
 StartListFromSaved = Construir nueva lista
 SavedListsOfIssueTypes = Listas guardadas
 NoIssueTypeSelected = No se seleccionaron tipos de petición.
+NoIssueTypesAssociatedToModule=No se ha asociado ningún tipo de petición a este módulo. Contacte con el administrador.
 SelectSaveXModuleQuery = Selecciona una consulta sobre varios módulos guardada...
 SelectSaveXModuleReport = Listas de tipos de petición guardadas...
 NoSavedIssueTypeLists = No hay listas de tipos de petición guardadas

Modified: branches/release/b21/src/java/org/tigris/scarab/om/AbstractScarabUser.java
Url: http://scarab.tigris.org/source/browse/scarab/branches/release/b21/src/java/org/tigris/scarab/om/AbstractScarabUser.java?view=diff&rev=10264&p1=branches/release/b21/src/java/org/tigris/scarab/om/AbstractScarabUser.java&p2=branches/release/b21/src/java/org/tigris/scarab/om/AbstractScarabUser.java&r1=10263&r2=10264
==============================================================================
--- branches/release/b21/src/java/org/tigris/scarab/om/AbstractScarabUser.java	(original)
+++ branches/release/b21/src/java/org/tigris/scarab/om/AbstractScarabUser.java	2006-08-27 08:37:01-0700
@@ -766,7 +766,11 @@
                 UserPreference up = UserPreferenceManager.getInstance(uid);
                 homePage = up.getHomePage();
 
-                if ("query".equals(homePage)) 
+                if (module == null)
+                {
+                    homePage = "SelectModule.vm";
+                }
+                else if ("query".equals(homePage))
                 {
                     homePage = getQueryTarget();
                 }

Added: branches/release/b21/src/java/org/tigris/scarab/screens/IssueTypeList.java
Url: http://scarab.tigris.org/source/browse/scarab/branches/release/b21/src/java/org/tigris/scarab/screens/IssueTypeList.java?view=auto&rev=10264
==============================================================================
--- (empty file)
+++ branches/release/b21/src/java/org/tigris/scarab/screens/IssueTypeList.java	2006-08-27 08:37:01-0700
@@ -0,0 +1,84 @@
+package org.tigris.scarab.screens;

+

+/* ================================================================

+ * Copyright (c) 2006 CollabNet.  All rights reserved.

+ * 

+ * Redistribution and use in source and binary forms, with or without

+ * modification, are permitted provided that the following conditions are

+ * met:

+ * 

+ * 1. Redistributions of source code must retain the above copyright

+ * notice, this list of conditions and the following disclaimer.

+ * 

+ * 2. Redistributions in binary form must reproduce the above copyright

+ * notice, this list of conditions and the following disclaimer in the

+ * documentation and/or other materials provided with the distribution.

+ * 

+ * 3. The end-user documentation included with the redistribution, if

+ * any, must include the following acknowlegement: "This product includes

+ * software developed by Collab.Net <http://www.Collab.Net/>."

+ * Alternately, this acknowlegement may appear in the software itself, if

+ * and wherever such third-party acknowlegements normally appear.

+ * 

+ * 4. The hosted project names must not be used to endorse or promote

+ * products derived from this software without prior written

+ * permission. For written permission, please contact [email protected].

+ * 

+ * 5. Products derived from this software may not use the "Tigris" or 

+ * "Scarab" names nor may "Tigris" or "Scarab" appear in their names without 

+ * prior written permission of Collab.Net.

+ * 

+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED

+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.

+ * IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY

+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL

+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE

+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS

+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER

+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR

+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF

+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ *

+ * ====================================================================

+ * 

+ * This software consists of voluntary contributions made by many

+ * individuals on behalf of Collab.Net.

+ */ 

+

+import org.apache.turbine.RunData;

+import org.apache.turbine.TemplateContext;

+import org.tigris.scarab.om.Module;

+import org.tigris.scarab.tools.ScarabRequestTool;

+import org.tigris.scarab.tools.localization.L10NKeySet;

+

+/**

+ * Screen class for the IssueTypeList.vm template.

+ * 

+ * @author jorgeuriarte

+ *

+ */

+public class IssueTypeList extends Default

+{

+

+    /**

+     * Checks if makes any sense displaying the issuetype list, depending on current module

+     * existing and really having associated issuetypes.

+     */

+    protected void doBuildTemplate(RunData data, TemplateContext context) throws Exception

+    {

+        ScarabRequestTool scarabR = getScarabRequestTool(context);

+        Module module = scarabR.getCurrentModule();

+        if (null == module || module.getIssueTypes() == null || module.getIssueTypes().size() == 0)

+        {

+            scarabR.setAlertMessage(L10NKeySet.NoIssueTypesAssociatedToModule);

+            context.put("issueTypesAvailaible", Boolean.FALSE);

+        }

+        else

+        {

+            context.put("issueTypesAvailaible", Boolean.TRUE);

+        }

+        super.doBuildTemplate(data, context);

+    }

+

+}


Modified: branches/release/b21/src/java/org/tigris/scarab/tools/localization/L10NKeySet.java
Url: http://scarab.tigris.org/source/browse/scarab/branches/release/b21/src/java/org/tigris/scarab/tools/localization/L10NKeySet.java?view=diff&rev=10264&p1=branches/release/b21/src/java/org/tigris/scarab/tools/localization/L10NKeySet.java&p2=branches/release/b21/src/java/org/tigris/scarab/tools/localization/L10NKeySet.java&r1=10263&r2=10264
==============================================================================
--- branches/release/b21/src/java/org/tigris/scarab/tools/localization/L10NKeySet.java	(original)
+++ branches/release/b21/src/java/org/tigris/scarab/tools/localization/L10NKeySet.java	2006-08-27 08:37:01-0700
@@ -168,6 +168,7 @@
     public static final LocalizationKey YouHaveBeenLoggedOut                 = new L10NKey("YouHaveBeenLoggedOut");
     public static final LocalizationKey AutomaticallyLoggedIn                = new L10NKey("AutomaticallyLoggedIn");
     public static final LocalizationKey ConditionallyRequiredUserAttribute   = new L10NKey("ConditionallyRequiredUserAttribute");
+    public static final LocalizationKey NoIssueTypesAssociatedToModule       = new L10NKey("NoIssueTypesAssociatedToModule");
 
     // Experts notifications:
     // The following set is only used in logging. They are intended for

Modified: branches/release/b21/src/webapp/WEB-INF/templates/screens/IssueTypeList.vm
Url: http://scarab.tigris.org/source/browse/scarab/branches/release/b21/src/webapp/WEB-INF/templates/screens/IssueTypeList.vm?view=diff&rev=10264&p1=branches/release/b21/src/webapp/WEB-INF/templates/screens/IssueTypeList.vm&p2=branches/release/b21/src/webapp/WEB-INF/templates/screens/IssueTypeList.vm&r1=10263&r2=10264
==============================================================================
--- branches/release/b21/src/webapp/WEB-INF/templates/screens/IssueTypeList.vm	(original)
+++ branches/release/b21/src/webapp/WEB-INF/templates/screens/IssueTypeList.vm	2006-08-27 08:37:01-0700
@@ -1,9 +1,17 @@
+##
+## This template expects some context variables from the java screen class:
+## - $issueTypesAvailaible: if FALSE, current module has no associated issuetypes
+##                          and so querymatrix cannot be displayed.
+##
+## TODO: Where is this template used from? Is it redundant with QueryMatrix.vm?
+##
+
 #set ($user = $data.User)
 $user.setHomePage("matrix")
 
 
 <div class="app" id="xmodulelist">
-  #if ($user.hasAnySearchableRMITs())
+  #if ($user.hasAnySearchableRMITs() && $issueTypesAvailaible)
     #renderQueryMatrix()
   #else
     <p><em>$l10n.NoMoreIssueTypes</em></p>

Modified: branches/release/b21/src/webapp/WEB-INF/templates/screens/QueryMatrix.vm
Url: http://scarab.tigris.org/source/browse/scarab/branches/release/b21/src/webapp/WEB-INF/templates/screens/QueryMatrix.vm?view=diff&rev=10264&p1=branches/release/b21/src/webapp/WEB-INF/templates/screens/QueryMatrix.vm&p2=branches/release/b21/src/webapp/WEB-INF/templates/screens/QueryMatrix.vm&r1=10263&r2=10264
==============================================================================
--- branches/release/b21/src/webapp/WEB-INF/templates/screens/QueryMatrix.vm	(original)
+++ branches/release/b21/src/webapp/WEB-INF/templates/screens/QueryMatrix.vm	2006-08-27 08:37:01-0700
@@ -1,9 +1,16 @@
+##
+## This template expects some context variables from the java screen class:
+## - $issueTypesAvailaible: if FALSE, current module has no associated issuetypes
+##                          and so querymatrix cannot be displayed.
+##
+## TODO: Where is this template used from? Is it redundant with IssueTypeList.vm?
+##
 #set ($user = $data.User)
 $user.setHomePage("matrix")
 $user.setCurrentMITList(null)
 
 <div class="app" id="xmodulelist">
-  #if ($user.hasAnySearchableRMITs())
+  #if ($user.hasAnySearchableRMITs() && $issueTypesAvailaible)
     #renderQueryMatrix()
   #else
     <p><em>$l10n.NoMoreIssueTypes</em></p>
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.