Scarab commit: svn commit: r10765 - trunk/src: conf/conf java/org/tigris/scarab/actions/admin java/org/tigris/scarab/notification java/org/tigris/scarab/om java/org/tigris/scarab/tools schema sql webapp/WEB-INF/templates/navigations webapp/WEB-INF/templates/screens/admin webapp/WEB-INF/templates/screens/notifications

Hussayn Dabbous <[email protected]>
Newsgroups gmane.comp.java.scarab.cvs
Message-ID <[email protected]>
Author: dabbous
Date: 2009-06-28 14:22:09-0700
New Revision: 10765

Added:
   trunk/src/java/org/tigris/scarab/actions/admin/BaseConditionEdit.java
   trunk/src/java/org/tigris/scarab/actions/admin/NotificationEdit.java
   trunk/src/webapp/WEB-INF/templates/screens/admin/NotificationEdit.vm
Modified:
   trunk/src/conf/conf/TurbineResources.properties
   trunk/src/java/org/tigris/scarab/actions/admin/ConditionEdit.java
   trunk/src/java/org/tigris/scarab/notification/Notification.java
   trunk/src/java/org/tigris/scarab/om/NotificationStatusManager.java
   trunk/src/java/org/tigris/scarab/tools/ScarabUserTool.java
   trunk/src/schema/scarab-schema.xml
   trunk/src/sql/scarab-jira-templates-data.sql
   trunk/src/webapp/WEB-INF/templates/navigations/Administration.vm
   trunk/src/webapp/WEB-INF/templates/navigations/CommonLinks.vm
   trunk/src/webapp/WEB-INF/templates/screens/notifications/NotificationCustomize.vm

Log:
SCB2976, several fixes:
- Needed to split up the ConditionEditor, because of access rules (notification conditions need user enter__issue while all other condition editors need modify__module)
- Added entries to the Turbine properties and split up the frontend GUI to NotificationEdit.vm and ConditionEdit.vm.
- Added appropriate splitup of classes (ConditionEdit.java NotificationEdit.java both now siblings of BaseConditionEdit.java)
- Added entries to the Datrabase default data generators (now ant create-db works again)
- Now NotificationCount is displayed in the navigation bar (you can directly see, if you have pending notifications)
- SCARAB_ATTRIBUTE.FIELDSIZE was required, changed that to optional

Modified: trunk/src/conf/conf/TurbineResources.properties
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/conf/conf/TurbineResources.properties?view=diff&pathrev=10765&r1=10764&r2=10765
==============================================================================
--- trunk/src/conf/conf/TurbineResources.properties	(original)
+++ trunk/src/conf/conf/TurbineResources.properties	2009-06-28 14:22:09-0700
@@ -725,6 +725,7 @@
 services.ScarabSecurity.screen.admin.ManageArtifactTypes.vm=Module__Configure
 services.ScarabSecurity.screen.admin.ModuleAttributeEdit.vm=Module__Configure
 services.ScarabSecurity.screen.admin.ConditionEdit.vm=Module__Configure
+services.ScarabSecurity.screen.admin.NotificationEdit.vm=Issue__Enter
 services.ScarabSecurity.screen.admin.ArtifactTypeEdit.vm=Module__Configure
 services.ScarabSecurity.screen.admin.ArtifactTypeSelect.vm=Module__Configure
 services.ScarabSecurity.screen.admin.AttributeGroupEdit.vm=Module__Configure
@@ -788,6 +789,7 @@
 services.ScarabSecurity.action.admin.ManageUser=Domain__Admin
 services.ScarabSecurity.action.admin.ModuleAttributeEdit=Module__Configure
 services.ScarabSecurity.action.admin.ConditionEdit=Module__Configure
+services.ScarabSecurity.action.admin.NotificationEdit=Issue__Enter
 services.ScarabSecurity.action.admin.UpdateSearchIndex=Domain__Edit
 services.ScarabSecurity.action.admin.SetInfoMessage=Domain__Edit
 

Added: trunk/src/java/org/tigris/scarab/actions/admin/BaseConditionEdit.java
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/java/org/tigris/scarab/actions/admin/BaseConditionEdit.java?view=markup&pathrev=10765
==============================================================================
--- (empty file)
+++ trunk/src/java/org/tigris/scarab/actions/admin/BaseConditionEdit.java	2009-06-28 14:22:09-0700
@@ -0,0 +1,204 @@
+package org.tigris.scarab.actions.admin;

+

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

+ * Copyright (c) 2000-2002 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 java.util.List;

+

+import org.apache.fulcrum.intake.model.Group;

+import org.apache.fulcrum.security.entity.User;

+import org.apache.torque.TorqueException;

+import org.apache.torque.util.Criteria;

+import org.apache.turbine.RunData;

+import org.apache.turbine.TemplateContext;

+import org.apache.turbine.tool.IntakeTool;

+import org.tigris.scarab.actions.base.RequireLoginFirstAction;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

+import org.tigris.scarab.util.ScarabConstants;

+

+public class BaseConditionEdit extends RequireLoginFirstAction

+{

+

+    public void doDelete(RunData data, TemplateContext context) throws TorqueException, Exception

+    {

+        IntakeTool intake = getIntakeTool(context);

+        Group attrGroup = intake.get("ConditionEdit", IntakeTool.DEFAULT_KEY);

+        data.getParameters().remove(attrGroup.get("ConditionsArray").getKey());

+        updateObject(data, context, null);

+    }

+

+    private void delete(RunData data, TemplateContext context) throws TorqueException, Exception

+    {

+        int nObjectType = data.getParameters().getInt("obj_type");

+        Criteria crit = new Criteria();

+        switch (nObjectType)

+        {

+            case ScarabConstants.TRANSITION_OBJECT:

+            	Integer tranId = data.getParameters().getInteger("transition_id");

+            	crit.add(ConditionPeer.TRANSITION_ID, tranId);

+            	TransitionManager.getMethodResult().remove(TransitionManager.getInstance(tranId), TransitionManager.GET_CONDITIONS);

+                break;

+            case ScarabConstants.GLOBAL_ATTRIBUTE_OBJECT:

+                crit.add(ConditionPeer.ATTRIBUTE_ID, data.getParameters().getInt("attId"));

+            	crit.add(ConditionPeer.MODULE_ID, 0);

+            	crit.add(ConditionPeer.ISSUE_TYPE_ID, 0);

+                break;

+            case ScarabConstants.MODULE_ATTRIBUTE_OBJECT:

+        		crit.add(ConditionPeer.ATTRIBUTE_ID, data.getParameters().getInt("attId"));

+            	crit.add(ConditionPeer.MODULE_ID, data.getParameters().getInt("module_id"));

+            	crit.add(ConditionPeer.ISSUE_TYPE_ID, data.getParameters().getInt("issueTypeId"));

+        		break;

+            case ScarabConstants.NOTIFICATION_ATTRIBUTE_OBJECT:

+                ScarabRequestTool scarabR = getScarabRequestTool(context);

+                ScarabUser user = (ScarabUser)data.getUser();

+                if(user == null)

+                {

+                    throw new TorqueException("No user found in RunData during Notification customization (constraints on attributes)");

+                }

+                Module module = scarabR.getCurrentModule();

+                if(module == null)

+                {

+                    throw new TorqueException("No module found in RunData during Notification customization (constraints on attributes)");

+                }

+                NotificationRulePeer.deleteConditions(user, module);

+                return;

+        }

+        ConditionPeer.doDelete(crit);

+    	ConditionManager.clear();

+    	TransitionManager.clear();

+    }

+    

+    private void updateObject(RunData data, TemplateContext context, Integer aConditions[]) throws Exception

+    {

+        ScarabRequestTool scarabR = getScarabRequestTool(context);

+        Integer operator = data.getParameters().getInteger("combineWith");

+        switch (data.getParameters().getInt("obj_type"))

+        {

+            case ScarabConstants.TRANSITION_OBJECT:

+                Transition transition = scarabR.getTransition(data.getParameters().getInteger("transition_id"));

+            	transition.setConditionsArray(aConditions, operator);

+            	transition.save();

+            	TransitionManager.getMethodResult().remove(transition, TransitionManager.GET_CONDITIONS);

+                AttributeManager.clear();        

+                break;

+            case ScarabConstants.GLOBAL_ATTRIBUTE_OBJECT:

+                Attribute attribute = scarabR.getAttribute(data.getParameters().getInteger("attId"));

+            	attribute.setConditionsArray(aConditions, operator);

+            	attribute.save();

+                AttributeManager.clear();        

+                break;

+            case ScarabConstants.MODULE_ATTRIBUTE_OBJECT:

+            	RModuleAttribute rma = RModuleAttributePeer.retrieveByPK(data.getParameters().getInteger("moduleId"), data.getParameters().getInteger("attId"), data.getParameters().getInteger("issueTypeId"));

+                rma.setConditionsArray(aConditions, operator);

+                RModuleAttributeManager.clear();

+                ConditionManager.clear();

+                rma.save(); /** TODO: do we need it? **/

+                AttributeManager.clear();        

+        		break;

+        	case ScarabConstants.BLOCKED_MODULE_ISSUE_TYPE_OBJECT:

+        	    RModuleIssueType rmit = RModuleIssueTypePeer.retrieveByPK(scarabR.getCurrentModule().getModuleId(), data.getParameters().getInteger("issuetypeid"));

+        		rmit.setConditionsArray(aConditions, operator);

+        	    rmit.save();

+        	    RModuleIssueTypeManager.clear();

+        	    ConditionManager.clear();

+                AttributeManager.clear();        

+        	    break;

+        	case ScarabConstants.NOTIFICATION_ATTRIBUTE_OBJECT:

+                ScarabUser user = (ScarabUser)data.getUser();

+                if(user == null)

+                {

+                    throw new TorqueException("No user found in RunData during Notification customization (constraints on attributes)");

+                }

+                Module module = scarabR.getCurrentModule();

+                if(module == null)

+                {

+                    throw new TorqueException("No module found in RunData during Notification customization (constraints on attributes)");

+                }

+                NotificationRulePeer.saveConditions(user, module, aConditions, operator);

+        	    break;

+        }

+    }

+    

+    public void doSave(RunData data, TemplateContext context) throws Exception

+    {

+        this.delete(data, context);

+        IntakeTool intake = getIntakeTool(context);

+        Group attrGroup = intake.get("ConditionEdit", IntakeTool.DEFAULT_KEY);

+        Integer aConditions[] = ((Integer[])attrGroup.get("ConditionsArray").getValue());

+        updateObject(data, context, aConditions);

+            

+    }

+    

+    public void doCancel(RunData data, TemplateContext context) throws Exception

+    {

+        String lastTemplate = getCancelTemplate(data);

+        if (lastTemplate != null)

+        {

+            setTarget(data, lastTemplate);

+        }

+        else

+        {

+            super.doCancel(data, context);

+        }

+    }

+}

+


Modified: trunk/src/java/org/tigris/scarab/actions/admin/ConditionEdit.java
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/java/org/tigris/scarab/actions/admin/ConditionEdit.java?view=diff&pathrev=10765&r1=10764&r2=10765
==============================================================================
--- trunk/src/java/org/tigris/scarab/actions/admin/ConditionEdit.java	(original)
+++ trunk/src/java/org/tigris/scarab/actions/admin/ConditionEdit.java	2009-06-28 14:22:09-0700
@@ -46,159 +46,8 @@
  * individuals on behalf of Collab.Net.
  */
 
-import java.util.List;
-
-import org.apache.fulcrum.intake.model.Group;
-import org.apache.fulcrum.security.entity.User;
-import org.apache.torque.TorqueException;
-import org.apache.torque.util.Criteria;
-import org.apache.turbine.RunData;
-import org.apache.turbine.TemplateContext;
-import org.apache.turbine.tool.IntakeTool;
-import org.tigris.scarab.actions.base.RequireLoginFirstAction;
-import org.tigris.scarab.om.Attribute;
-import org.tigris.scarab.om.AttributeManager;
-import org.tigris.scarab.om.Condition;
-import org.tigris.scarab.om.ConditionManager;
-import org.tigris.scarab.om.ConditionPeer;
-import org.tigris.scarab.om.Module;
-import org.tigris.scarab.om.NotificationRulePeer;
-import org.tigris.scarab.om.RModuleAttribute;
-import org.tigris.scarab.om.RModuleAttributeManager;
-import org.tigris.scarab.om.RModuleAttributePeer;
-import org.tigris.scarab.om.RModuleIssueType;
-import org.tigris.scarab.om.RModuleIssueTypeManager;
-import org.tigris.scarab.om.RModuleIssueTypePeer;
-import org.tigris.scarab.om.ScarabUser;
-import org.tigris.scarab.om.Transition;
-import org.tigris.scarab.om.TransitionManager;
-import org.tigris.scarab.tools.ScarabRequestTool;
-import org.tigris.scarab.util.ScarabConstants;
-
-public class ConditionEdit extends RequireLoginFirstAction
+public class ConditionEdit extends BaseConditionEdit
 {
-
-    public void doDelete(RunData data, TemplateContext context) throws TorqueException, Exception
-    {
-        IntakeTool intake = getIntakeTool(context);
-        Group attrGroup = intake.get("ConditionEdit", IntakeTool.DEFAULT_KEY);
-        data.getParameters().remove(attrGroup.get("ConditionsArray").getKey());
-        updateObject(data, context, null);
-    }
-
-    private void delete(RunData data, TemplateContext context) throws TorqueException, Exception
-    {
-        int nObjectType = data.getParameters().getInt("obj_type");
-        Criteria crit = new Criteria();
-        switch (nObjectType)
-        {
-            case ScarabConstants.TRANSITION_OBJECT:
-            	Integer tranId = data.getParameters().getInteger("transition_id");
-            	crit.add(ConditionPeer.TRANSITION_ID, tranId);
-            	TransitionManager.getMethodResult().remove(TransitionManager.getInstance(tranId), TransitionManager.GET_CONDITIONS);
-                break;
-            case ScarabConstants.GLOBAL_ATTRIBUTE_OBJECT:
-                crit.add(ConditionPeer.ATTRIBUTE_ID, data.getParameters().getInt("attId"));
-            	crit.add(ConditionPeer.MODULE_ID, 0);
-            	crit.add(ConditionPeer.ISSUE_TYPE_ID, 0);
-                break;
-            case ScarabConstants.MODULE_ATTRIBUTE_OBJECT:
-        		crit.add(ConditionPeer.ATTRIBUTE_ID, data.getParameters().getInt("attId"));
-            	crit.add(ConditionPeer.MODULE_ID, data.getParameters().getInt("module_id"));
-            	crit.add(ConditionPeer.ISSUE_TYPE_ID, data.getParameters().getInt("issueTypeId"));
-        		break;
-            case ScarabConstants.NOTIFICATION_ATTRIBUTE_OBJECT:
-                ScarabRequestTool scarabR = getScarabRequestTool(context);
-                ScarabUser user = (ScarabUser)data.getUser();
-                if(user == null)
-                {
-                    throw new TorqueException("No user found in RunData during Notification customization (constraints on attributes)");
-                }
-                Module module = scarabR.getCurrentModule();
-                if(module == null)
-                {
-                    throw new TorqueException("No module found in RunData during Notification customization (constraints on attributes)");
-                }
-                NotificationRulePeer.deleteConditions(user, module);
-                return;
-        }
-        ConditionPeer.doDelete(crit);
-    	ConditionManager.clear();
-    	TransitionManager.clear();
-    }
-    
-    private void updateObject(RunData data, TemplateContext context, Integer aConditions[]) throws Exception
-    {
-        ScarabRequestTool scarabR = getScarabRequestTool(context);
-        Integer operator = data.getParameters().getInteger("combineWith");
-        switch (data.getParameters().getInt("obj_type"))
-        {
-            case ScarabConstants.TRANSITION_OBJECT:
-                Transition transition = scarabR.getTransition(data.getParameters().getInteger("transition_id"));
-            	transition.setConditionsArray(aConditions, operator);
-            	transition.save();
-            	TransitionManager.getMethodResult().remove(transition, TransitionManager.GET_CONDITIONS);
-                AttributeManager.clear();        
-                break;
-            case ScarabConstants.GLOBAL_ATTRIBUTE_OBJECT:
-                Attribute attribute = scarabR.getAttribute(data.getParameters().getInteger("attId"));
-            	attribute.setConditionsArray(aConditions, operator);
-            	attribute.save();
-                AttributeManager.clear();        
-                break;
-            case ScarabConstants.MODULE_ATTRIBUTE_OBJECT:
-            	RModuleAttribute rma = RModuleAttributePeer.retrieveByPK(data.getParameters().getInteger("moduleId"), data.getParameters().getInteger("attId"), data.getParameters().getInteger("issueTypeId"));
-                rma.setConditionsArray(aConditions, operator);
-                RModuleAttributeManager.clear();
-                ConditionManager.clear();
-                rma.save(); /** TODO: do we need it? **/
-                AttributeManager.clear();        
-        		break;
-        	case ScarabConstants.BLOCKED_MODULE_ISSUE_TYPE_OBJECT:
-        	    RModuleIssueType rmit = RModuleIssueTypePeer.retrieveByPK(scarabR.getCurrentModule().getModuleId(), data.getParameters().getInteger("issuetypeid"));
-        		rmit.setConditionsArray(aConditions, operator);
-        	    rmit.save();
-        	    RModuleIssueTypeManager.clear();
-        	    ConditionManager.clear();
-                AttributeManager.clear();        
-        	    break;
-        	case ScarabConstants.NOTIFICATION_ATTRIBUTE_OBJECT:
-                ScarabUser user = (ScarabUser)data.getUser();
-                if(user == null)
-                {
-                    throw new TorqueException("No user found in RunData during Notification customization (constraints on attributes)");
-                }
-                Module module = scarabR.getCurrentModule();
-                if(module == null)
-                {
-                    throw new TorqueException("No module found in RunData during Notification customization (constraints on attributes)");
-                }
-                NotificationRulePeer.saveConditions(user, module, aConditions, operator);
-        	    break;
-        }
-    }
-    
-    public void doSave(RunData data, TemplateContext context) throws Exception
-    {
-        this.delete(data, context);
-        IntakeTool intake = getIntakeTool(context);
-        Group attrGroup = intake.get("ConditionEdit", IntakeTool.DEFAULT_KEY);
-        Integer aConditions[] = ((Integer[])attrGroup.get("ConditionsArray").getValue());
-        updateObject(data, context, aConditions);
-            
-    }
-    
-    public void doCancel(RunData data, TemplateContext context) throws Exception
-    {
-        String lastTemplate = getCancelTemplate(data);
-        if (lastTemplate != null)
-        {
-            setTarget(data, lastTemplate);
-        }
-        else
-        {
-            super.doCancel(data, context);
-        }
-    }
+    // This class is used as permission control point for velocity.
+    // COnditionEdit can be called from a user with Module_modify permission
 }
-

Added: trunk/src/java/org/tigris/scarab/actions/admin/NotificationEdit.java
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/java/org/tigris/scarab/actions/admin/NotificationEdit.java?view=markup&pathrev=10765
==============================================================================
--- (empty file)
+++ trunk/src/java/org/tigris/scarab/actions/admin/NotificationEdit.java	2009-06-28 14:22:09-0700
@@ -0,0 +1,83 @@
+package org.tigris.scarab.actions.admin;

+

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

+ * Copyright (c) 2000-2002 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 java.util.List;

+

+import org.apache.fulcrum.intake.model.Group;

+import org.apache.fulcrum.security.entity.User;

+import org.apache.torque.TorqueException;

+import org.apache.torque.util.Criteria;

+import org.apache.turbine.RunData;

+import org.apache.turbine.TemplateContext;

+import org.apache.turbine.tool.IntakeTool;

+import org.tigris.scarab.actions.base.RequireLoginFirstAction;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

+import org.tigris.scarab.util.ScarabConstants;

+

+public class NotificationEdit extends BaseConditionEdit

+{

+    // This class is used as permission control point for velocity.

+    // NotificationEdit can be called from a user with Issue_Write permissions

+}

+


Modified: trunk/src/java/org/tigris/scarab/notification/Notification.java
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/java/org/tigris/scarab/notification/Notification.java?view=diff&pathrev=10765&r1=10764&r2=10765
==============================================================================
--- trunk/src/java/org/tigris/scarab/notification/Notification.java	(original)
+++ trunk/src/java/org/tigris/scarab/notification/Notification.java	2009-06-28 14:22:09-0700
@@ -228,8 +228,13 @@
      **/

     public boolean sendConditionsMatch() throws TorqueException 

     {

-        Map<String,AttributeValue> attributeValues =  issue.getModuleOptionAttributeValuesMap();

         List<Condition> conditions = getConditions();

+        if(conditions.size() == 0)

+        {

+            return true; // no conditions defined, hence no constraints, hence return true

+        }

+        

+        Map<String,AttributeValue> attributeValues =  issue.getModuleOptionAttributeValuesMap();

         Integer operator = getConditionOperator();

         

         Iterator<Condition> iter = conditions.iterator();


Modified: trunk/src/java/org/tigris/scarab/om/NotificationStatusManager.java
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/java/org/tigris/scarab/om/NotificationStatusManager.java?view=diff&pathrev=10765&r1=10764&r2=10765
==============================================================================
--- trunk/src/java/org/tigris/scarab/om/NotificationStatusManager.java	(original)
+++ trunk/src/java/org/tigris/scarab/om/NotificationStatusManager.java	2009-06-28 14:22:09-0700
@@ -46,6 +46,7 @@
  * individuals on behalf of CollabNet.
  */
 
+import java.util.Iterator;
 import java.util.List;
 
 import org.apache.torque.Torque;
@@ -83,7 +84,7 @@
      * @return
      * @throws TorqueException
      */
-    public static List getNotificationsFor(ScarabUser user) throws TorqueException
+    public static List<NotificationStatus> getNotificationsFor(ScarabUser user) throws TorqueException
     {
         //NotificationStatusManager.getInstance().
         List result = null;
@@ -94,6 +95,28 @@
         return result;
     }
     
-    
+    /**
+     * Get the number of pending issues for the given module/user pair
+     * @throws TorqueException 
+     */
+    public static int getNotificationCount(Module module, ScarabUser user) throws TorqueException
+    {
+        List<NotificationStatus> notifications = getNotificationsFor(user);
+        int count = 0;
+        Iterator<NotificationStatus> iter = notifications.iterator();
+        int currentModuleId = module.getModuleId();
+        while(iter.hasNext())
+        {
+            NotificationStatus status = iter.next();
+            long issueId  = status.getIssueId();
+            Issue issue   = IssueManager.getInstance(issueId);
+            int moduleId  = issue.getModuleId();
+            if(moduleId == currentModuleId)
+            {
+                count++;
+            }
+        }
+        return count;
+    }
     
 }

Modified: trunk/src/java/org/tigris/scarab/tools/ScarabUserTool.java
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/java/org/tigris/scarab/tools/ScarabUserTool.java?view=diff&pathrev=10765&r1=10764&r2=10765
==============================================================================
--- trunk/src/java/org/tigris/scarab/tools/ScarabUserTool.java	(original)
+++ trunk/src/java/org/tigris/scarab/tools/ScarabUserTool.java	2009-06-28 14:22:09-0700
@@ -6,6 +6,8 @@
 

 import org.apache.torque.TorqueException;

 import org.apache.turbine.RunData;

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

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

 import org.tigris.scarab.om.ScarabUser;

 import org.tigris.scarab.om.ScarabUserManager;

 import org.tigris.scarab.util.Log;

@@ -115,5 +117,10 @@
         return ScarabUserManager.anonymousAccessAllowed();

     }

     

+    public static int getNotificationCount(Module module, ScarabUser user) throws TorqueException

+    {

+        return NotificationStatusManager.getNotificationCount(module, user);

+    }

+

 

 }


Modified: trunk/src/schema/scarab-schema.xml
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/schema/scarab-schema.xml?view=diff&pathrev=10765&r1=10764&r2=10765
==============================================================================
--- trunk/src/schema/scarab-schema.xml	(original)
+++ trunk/src/schema/scarab-schema.xml	2009-06-28 14:22:09-0700
@@ -127,21 +127,21 @@
 		<column name="ATTACHMENT_TYPE_NAME" javaName="Name" required="true" type="VARCHAR" size="255" description="Name."/>
 		<column name="SEARCHABLE" default="0" type="BOOLEANINT" javaType="primitive" description="Flag marking text/searchable attachments"/>
 	</table>
-	<table name="SCARAB_ATTRIBUTE" idMethod="idbroker" javaName="Attribute" description="Possible attributes of an issue. Example: Operating System. Example: Severity">
-		<column name="ATTRIBUTE_ID" primaryKey="true" required="true" type="INTEGER" description="Unique identifier."/>
-        <column name="ATTRIBUTE_NAME" javaName="Name" required="true" type="VARCHAR" size="255" description="Name."/>
-		<column name="STYLE" javaName="Style" required="false" type="VARCHAR" size="255" description="optional string added as markup for css class or style information"/>
-        <column name="FORMAT" javaName="Format" required="false" type="VARCHAR" size="255" description="An optional Format String."/>
-        <column name="HINT" javaName="Hint" required="false" type="VARCHAR" size="255" description="An optional Hint string for the Format."/>
-        <column name="FIELDSIZE" javaName="FieldSize" required="true" type="INTEGER" description="Maximum size of Display field"/>
-        <column name="ATTRIBUTE_TYPE_ID" javaName="TypeId" required="true" type="INTEGER" description="Type."/>
-		<column name="PERMISSION" required="false" type="VARCHAR" size="255" description="A permission related to this attribute."/>
-		<column name="REQUIRED_OPTION_ID" required="false" type="INTEGER" description="A required option for this attribute to be active."/>
-		<column name="DESCRIPTION" javaName="Description" required="true" type="VARCHAR" size="255" description="Description."/>
-		<column name="ACTION" required="false" type="VARCHAR" size="255" description="For user attributes, whether the user will be emailed, will get a mail as cc, or neither."/>
-		<column name="CREATED_BY" javaName="CreatedBy" required="false" type="INTEGER" description="Person that set value to the column of the table initially."/>
-		<column name="CREATED_DATE" javaName="CreatedDate" required="false" type="TIMESTAMP" description="Date of the initial set of the column of the table."/>
-		<column name="DELETED" required="false" type="BOOLEANINT" default="0" javaType="primitive" description="Flag, which marks that attribute has been deleted."/>
+	<table name="SCARAB_ATTRIBUTE"    idMethod="idbroker" javaName="Attribute" description="Possible attributes of an issue. Example: Operating System. Example: Severity">
+		<column name="ATTRIBUTE_ID"   primaryKey="true"       required="true"  type="INTEGER" description="Unique identifier."/>
+        <column name="ATTRIBUTE_NAME" javaName="Name"         required="true"  type="VARCHAR" size="255" description="Name."/>
+		<column name="STYLE"          javaName="Style"        required="false" type="VARCHAR" size="255" description="optional string added as markup for css class or style information"/>
+        <column name="FORMAT"         javaName="Format"       required="false" type="VARCHAR" size="255" description="An optional Format String."/>
+        <column name="HINT"           javaName="Hint"         required="false" type="VARCHAR" size="255" description="An optional Hint string for the Format."/>
+        <column name="FIELDSIZE"      javaName="FieldSize"    required="false" type="INTEGER" default="0" description="Maximum size of Display field"/>
+        <column name="ATTRIBUTE_TYPE_ID" javaName="TypeId"    required="true"  type="INTEGER" description="Type."/>
+		<column name="PERMISSION"                             required="false" type="VARCHAR" size="255" description="A permission related to this attribute."/>
+		<column name="REQUIRED_OPTION_ID"                     required="false" type="INTEGER" description="A required option for this attribute to be active."/>
+		<column name="DESCRIPTION"     javaName="Description" required="true"  type="VARCHAR" size="255" description="Description."/>
+		<column name="ACTION"                                 required="false" type="VARCHAR" size="255" description="For user attributes, whether the user will be emailed, will get a mail as cc, or neither."/>
+		<column name="CREATED_BY"      javaName="CreatedBy"   required="false" type="INTEGER"    description="Person that set value to the column of the table initially."/>
+		<column name="CREATED_DATE"    javaName="CreatedDate" required="false" type="TIMESTAMP"  description="Date of the initial set of the column of the table."/>
+		<column name="DELETED"                                required="false" type="BOOLEANINT" default="0" javaType="primitive" description="Flag, which marks that attribute has been deleted."/>
 		<foreign-key foreignTable="SCARAB_ATTRIBUTE_TYPE">
 			<reference local="ATTRIBUTE_TYPE_ID" foreign="ATTRIBUTE_TYPE_ID"/>
 		</foreign-key>

Modified: trunk/src/sql/scarab-jira-templates-data.sql
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/sql/scarab-jira-templates-data.sql?view=diff&pathrev=10765&r1=10764&r2=10765
==============================================================================
--- trunk/src/sql/scarab-jira-templates-data.sql	(original)
+++ trunk/src/sql/scarab-jira-templates-data.sql	2009-06-28 14:22:09-0700
@@ -20,17 +20,17 @@
 --
 
 -- TODO move this IDs starting from 200
-INSERT INTO SCARAB_ATTRIBUTE VALUES (100,'[JIRA] Summary',1,NULL,NULL,'Summary attribute for JIRA issuetypes.\r\nDo not modify or importing JIRA xmls will fail.',NULL,1,'2005-12-06 22:36:13',0);
-INSERT INTO SCARAB_ATTRIBUTE VALUES (101,'[JIRA] Description',12,NULL,NULL,'Decription attribute for JIRA issuetypes.\r\nDo not modify or importing JIRA xmls will fail.',NULL,1,'2005-12-06 22:43:00',0);
-INSERT INTO SCARAB_ATTRIBUTE VALUES (120,'[JIRA] Status',5,NULL,NULL,'Status attribute for JIRA issuetypes. Do not modify or importing JIRA xmls will fail.',NULL,1,'2005-12-09 16:34:01',0);
-INSERT INTO SCARAB_ATTRIBUTE VALUES (103,'[JIRA] Component',5,NULL,NULL,'Component attribute for JIRA issuetypes. Do not modify or importing JIRA xmls will fail.',NULL,NULL,'2001-12-31 13:30:00',0);
-INSERT INTO SCARAB_ATTRIBUTE VALUES (121,'[JIRA] Environment',1,NULL,NULL,'Environment attribute for JIRA issuetypes. Do not modify or importing JIRA xmls will fail.',NULL,1,'2005-12-09 16:36:17',0);
-INSERT INTO SCARAB_ATTRIBUTE VALUES (122,'[JIRA] Priority',5,NULL,NULL,'Priority attribute for JIRA issuetypes. Do not modify or importing JIRA xmls will fail.',NULL,1,'2005-12-09 16:36:40',0);
-INSERT INTO SCARAB_ATTRIBUTE VALUES (123,'[JIRA] Version',5,NULL,NULL,'Version attribute for JIRA issuetypes. Do not modify or importing JIRA xmls will fail.',NULL,1,'2005-12-09 16:37:57',0);
-INSERT INTO SCARAB_ATTRIBUTE VALUES (124,'[JIRA] Due',13,NULL,NULL,'Due attribute for JIRA issuetypes. Do not modify or importing JIRA xmls will fail.',NULL,1,'2005-12-09 16:39:19',0);
-INSERT INTO SCARAB_ATTRIBUTE VALUES (125,'[JIRA] Votes',3,NULL,NULL,'Votes attribute for JIRA issuetypes. Do not modify or importing JIRA xmls will fail.',NULL,1,'2005-12-09 16:40:10',0);
-INSERT INTO SCARAB_ATTRIBUTE VALUES (140,'[JIRA] Assignee',8,'Issue | View',NULL,'Assignee attribute for JIRA issuetypes. Do not modify or importing JIRA xmls will fail.','to',1,'2005-12-10 14:43:31',0);
-INSERT INTO SCARAB_ATTRIBUTE VALUES (141,'[JIRA] Resolution',5,NULL,5,'Resolution attribute for JIRA issuetypes. Do not modify or importing JIRA xmls will fail.',NULL,1,'2005-12-10 14:43:55',0);
+INSERT INTO SCARAB_ATTRIBUTE VALUES (100,'[JIRA] Summary','','','',0,1,NULL,NULL,'Summary attribute for JIRA issuetypes.\r\nDo not modify or importing JIRA xmls will fail.',NULL,1,'2005-12-06 22:36:13',0);
+INSERT INTO SCARAB_ATTRIBUTE VALUES (101,'[JIRA] Description','','','',0,12,NULL,NULL,'Decription attribute for JIRA issuetypes.\r\nDo not modify or importing JIRA xmls will fail.',NULL,1,'2005-12-06 22:43:00',0);
+INSERT INTO SCARAB_ATTRIBUTE VALUES (120,'[JIRA] Status','','','',0,5,NULL,NULL,'Status attribute for JIRA issuetypes. Do not modify or importing JIRA xmls will fail.',NULL,1,'2005-12-09 16:34:01',0);
+INSERT INTO SCARAB_ATTRIBUTE VALUES (103,'[JIRA] Component','','','',0,5,NULL,NULL,'Component attribute for JIRA issuetypes. Do not modify or importing JIRA xmls will fail.',NULL,NULL,'2001-12-31 13:30:00',0);
+INSERT INTO SCARAB_ATTRIBUTE VALUES (121,'[JIRA] Environment','','','',0,1,NULL,NULL,'Environment attribute for JIRA issuetypes. Do not modify or importing JIRA xmls will fail.',NULL,1,'2005-12-09 16:36:17',0);
+INSERT INTO SCARAB_ATTRIBUTE VALUES (122,'[JIRA] Priority','','','',0,5,NULL,NULL,'Priority attribute for JIRA issuetypes. Do not modify or importing JIRA xmls will fail.',NULL,1,'2005-12-09 16:36:40',0);
+INSERT INTO SCARAB_ATTRIBUTE VALUES (123,'[JIRA] Version','','','',0,5,NULL,NULL,'Version attribute for JIRA issuetypes. Do not modify or importing JIRA xmls will fail.',NULL,1,'2005-12-09 16:37:57',0);
+INSERT INTO SCARAB_ATTRIBUTE VALUES (124,'[JIRA] Due','','','',0,13,NULL,NULL,'Due attribute for JIRA issuetypes. Do not modify or importing JIRA xmls will fail.',NULL,1,'2005-12-09 16:39:19',0);
+INSERT INTO SCARAB_ATTRIBUTE VALUES (125,'[JIRA] Votes','','','',0,3,NULL,NULL,'Votes attribute for JIRA issuetypes. Do not modify or importing JIRA xmls will fail.',NULL,1,'2005-12-09 16:40:10',0);
+INSERT INTO SCARAB_ATTRIBUTE VALUES (140,'[JIRA] Assignee','','','',0,8,'Issue | View',NULL,'Assignee attribute for JIRA issuetypes. Do not modify or importing JIRA xmls will fail.','to',1,'2005-12-10 14:43:31',0);
+INSERT INTO SCARAB_ATTRIBUTE VALUES (141,'[JIRA] Resolution','','','',0,5,NULL,5,'Resolution attribute for JIRA issuetypes. Do not modify or importing JIRA xmls will fail.',NULL,1,'2005-12-10 14:43:55',0);
 
 
 --
@@ -52,26 +52,26 @@
 -- Dumping data for table SCARAB_ATTRIBUTE_OPTION
 --
 
-INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (201,120,'Opened',0);
-INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (202,120,'In Progress',0);
-INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (203,120,'Reopened',0);
-INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (204,120,'Resolved',0);
-INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (206,120,'Closed',0);
-INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (207,122,'Major',0);
-INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (208,122,'Minor',0);
-INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (209,122,'Trivial',0);
-INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (210,122,'Undecided',0);
-INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (230,141,'Fixed',0);
-INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (231,141,'Invalid',0);
-INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (232,141,'Wontfix',0);
-INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (233,141,'Later',0);
-INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (234,141,'Remind',0);
-INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (235,141,'Duplicate',0);
-INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (236,141,'Worksforme',0);
-INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (237,141,'Moved',0);
-INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (250,122,'Blocker',0);
-INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (251,141,'Unresolved',0);
-INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (271,122,'Critical',0);
+INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (201,120,'Opened','',0);
+INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (202,120,'In Progress','',0);
+INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (203,120,'Reopened','',0);
+INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (204,120,'Resolved','',0);
+INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (206,120,'Closed','',0);
+INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (207,122,'Major','',0);
+INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (208,122,'Minor','',0);
+INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (209,122,'Trivial','',0);
+INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (210,122,'Undecided','',0);
+INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (230,141,'Fixed','',0);
+INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (231,141,'Invalid','',0);
+INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (232,141,'Wontfix','',0);
+INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (233,141,'Later','',0);
+INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (234,141,'Remind','',0);
+INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (235,141,'Duplicate','',0);
+INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (236,141,'Worksforme','',0);
+INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (237,141,'Moved','',0);
+INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (250,122,'Blocker','',0);
+INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (251,141,'Unresolved','',0);
+INSERT INTO SCARAB_ATTRIBUTE_OPTION VALUES (271,122,'Critical','',0);
 
 --
 -- Dumping data for table SCARAB_R_ATTRIBUTE_ATTRGROUP
@@ -341,13 +341,13 @@
 --
 
 -- TODO move this IDs starting from 200
-INSERT INTO SCARAB_CONDITION VALUES (187,125,NULL,NULL,NULL,237);
-INSERT INTO SCARAB_CONDITION VALUES (186,125,NULL,NULL,NULL,236);
-INSERT INTO SCARAB_CONDITION VALUES (185,125,NULL,NULL,NULL,235);
-INSERT INTO SCARAB_CONDITION VALUES (171,130,NULL,NULL,NULL,204);
-INSERT INTO SCARAB_CONDITION VALUES (184,125,NULL,NULL,NULL,234);
-INSERT INTO SCARAB_CONDITION VALUES (183,125,NULL,NULL,NULL,233);
-INSERT INTO SCARAB_CONDITION VALUES (182,125,NULL,NULL,NULL,232);
-INSERT INTO SCARAB_CONDITION VALUES (181,125,NULL,NULL,NULL,231);
-INSERT INTO SCARAB_CONDITION VALUES (180,125,NULL,NULL,NULL,230);
+INSERT INTO SCARAB_CONDITION VALUES (187,125,NULL,NULL,NULL,NULL,237,0);
+INSERT INTO SCARAB_CONDITION VALUES (186,125,NULL,NULL,NULL,NULL,236,0);
+INSERT INTO SCARAB_CONDITION VALUES (185,125,NULL,NULL,NULL,NULL,235,0);
+INSERT INTO SCARAB_CONDITION VALUES (171,130,NULL,NULL,NULL,NULL,204,0);
+INSERT INTO SCARAB_CONDITION VALUES (184,125,NULL,NULL,NULL,NULL,234,0);
+INSERT INTO SCARAB_CONDITION VALUES (183,125,NULL,NULL,NULL,NULL,233,0);
+INSERT INTO SCARAB_CONDITION VALUES (182,125,NULL,NULL,NULL,NULL,232,0);
+INSERT INTO SCARAB_CONDITION VALUES (181,125,NULL,NULL,NULL,NULL,231,0);
+INSERT INTO SCARAB_CONDITION VALUES (180,125,NULL,NULL,NULL,NULL,230,0);
 

Modified: trunk/src/webapp/WEB-INF/templates/navigations/Administration.vm
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/WEB-INF/templates/navigations/Administration.vm?view=diff&pathrev=10765&r1=10764&r2=10765
==============================================================================
--- trunk/src/webapp/WEB-INF/templates/navigations/Administration.vm	(original)
+++ trunk/src/webapp/WEB-INF/templates/navigations/Administration.vm	2009-06-28 14:22:09-0700
@@ -83,11 +83,7 @@
       <div>$link.setPage("admin,ManageUserSearch.vm").setPathInfo("newSearch","true").setPathInfo($scarabG.Constant.CURRENT_ADMIN_MENU, "5").setLabel("$l10n.Users")</div>
      #end
     #end
-    
-    #if ( $$allowCustomize )
-     <div>$link.setPage("notifications,NotificationCustomize.vm").setLabel("$l10n.EditNotificationRules")</div>    
-    #end
-    
+        
    #end
   </div>
  </div>

Modified: trunk/src/webapp/WEB-INF/templates/navigations/CommonLinks.vm
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/WEB-INF/templates/navigations/CommonLinks.vm?view=diff&pathrev=10765&r1=10764&r2=10765
==============================================================================
--- trunk/src/webapp/WEB-INF/templates/navigations/CommonLinks.vm	(original)
+++ trunk/src/webapp/WEB-INF/templates/navigations/CommonLinks.vm	2009-06-28 14:22:09-0700
@@ -152,7 +152,13 @@
      <div>$link.setPage("reports,ReportList.vm").setLabel("$l10n.Reports")</div>

     #end

     #if (!$data.User.isUserAnonymous())

-      <div>$link.setPage("notifications,NotificationList.vm").setLabel("$l10n.NotificationList")</div>

+      #set ($notificationCount=$scarabU.getNotificationCount($module, $user))

+      <div>

+        $link.setPage("notifications,NotificationList.vm").setLabel("$l10n.NotificationList")

+        #if ($notificationCount > 0)

+           ($notificationCount)

+        #end

+      </div>

     #end

   </div>

 </div>


Added: trunk/src/webapp/WEB-INF/templates/screens/admin/NotificationEdit.vm
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/WEB-INF/templates/screens/admin/NotificationEdit.vm?view=markup&pathrev=10765
==============================================================================
--- (empty file)
+++ trunk/src/webapp/WEB-INF/templates/screens/admin/NotificationEdit.vm	2009-06-28 14:22:09-0700
@@ -0,0 +1,107 @@
+#set ($module = $scarabR.CurrentModule)

+#set ($groupId = $data.Parameters.getString("groupid"))

+## Set values depending on conditioned notification

+#set ($objType = $data.Parameters.getInteger("obj_type"))

+

+#set ($notification           = $scarabG.getEmptyNotificationFor($user, $module))

+#set ($conditionMsg           = "$l10n.Notifications")

+#set ($ConditionsCurrentValue = "n.a.")

+#set ($optionList             = $scarabR.getSortedAttributeOptionsForModule($module))

+

+#set ($combineWith = 0)

+#set ($attgroup = $intake.ConditionEdit.Default)

+

+<div class="app" id="div3-0-2-0">

+

+<form action="$link.setPage("admin,NotificationEdit.vm")" method="post">

+<input type="hidden" name="obj_type" value="$objType"/>

+<input type="hidden" name="issueTypeId" value="$data.parameters.issueTypeId" />

+<input type="hidden" name="moduleId" value="$module.moduleId" />

+<input type="hidden" name="action" value="admin.NotificationEdit" />

+<input type="hidden" name="groupId" value="$groupId" />

+<input type="hidden" name="$scarabG.Constant.CANCEL_TEMPLATE" value="$data.parameters.cancelTemplate"/>

+

+<div class="functnbar">

+<input type="submit" value="$l10n.Done"  name="eventSubmit_doDone" />&#160;

+<input type="submit" value="$l10n.Cancel"  name="eventSubmit_doCancel" />

+</div>

+

+<h3>$l10n.ConditionDefinition</h3>

+<div class="colbar">

+

+$l10n.ConditionsExplanation1

+$l10n.ConditionsExplanation2<br/>

+$l10n.ConditionsExplanation3

+</ul>

+</div>

+<div class="axial">

+<table cellpadding="3" cellspacing="2" border="0">

+<tr>

+  <th>$l10n.ConditionsSetOn</th>

+  <td>$conditionMsg</td>

+</tr>

+<tr>

+  <th>$l10n.ConditionsCurrentValue</th>

+  <td>

+	#foreach ($o in $notification.Conditions)

+	  $o.attributeOption.attribute.name = $o.attributeOption.name<br/>

+	  #set ($combineWith = $o.get(0).Operator)

+	#end  

+  </td>

+</tr>

+

+<tr>

+    <th nowrap="nowrap">combine attributes with</th>

+    <td>

+        <input type="radio" name="combineWith" value="0" #if ($combineWith==0) checked="checked" #end> $l10n.or</input>

+        <input type="radio" name="combineWith" value="1"#if ($combineWith==1) checked="checked" #end> $l10n.and </input>

+    </td>

+</tr>

+

+<tr>

+  <th>$l10n.ConditionsNewValue</th>

+  <td>

+  <table>

+  <tr>

+#set ($attributeIdPrev = -1)

+#set ($col=1)

+##

+## optionList has been loaded depending on the mode this screen is launched,

+## with ALL the attributes or only those assigned to the RModuleIssueType

+##

+#foreach ($opt in $optionList)

+  #set ($attributeId = $opt.attributeId)

+  #if ($attributeId != $attributeIdPrev)

+    #if ($!attributeIdPrev != -1)

+</select></td>

+      #if ($col == 3)

+        </tr>

+	#set ($col = 0)

+      #end

+      #set ($col = ($col + 1))

+    #end

+    <td><b>$opt.attribute.Name</b><br/>

+<select style="width:150px;" multiple="true" size="10" width="20" name="$attgroup.ConditionsArray.Key">

+  #end

+  <option value="$opt.optionId" #if ($notification.isRequiredIf($opt.optionId)) selected #end>$opt.name</option>

+  #set ($attributeIdPrev = $attributeId)

+#end  

+</select></td></tr>

+</table>

+</td></tr> 

+<tr>

+

+</tr>

+

+</table>

+</div>

+

+<div class="functnbar3">

+   <input type="submit" value="$l10n.Save"  name="eventSubmit_doSave" />

+   <input type="submit" value="$l10n.ClearConditions"  name="eventSubmit_doDelete" onClick="return confirm('$l10n.SureYouWantToClearConditions');" />

+</div>

+

+<div class="functnbar2">

+<input type="submit" value="$l10n.Done"  name="eventSubmit_doDone" />&#160;

+<input type="submit" value="$l10n.Cancel"  name="eventSubmit_doCancel" />

+</div>


Modified: trunk/src/webapp/WEB-INF/templates/screens/notifications/NotificationCustomize.vm
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/WEB-INF/templates/screens/notifications/NotificationCustomize.vm?view=diff&pathrev=10765&r1=10764&r2=10765
==============================================================================
--- trunk/src/webapp/WEB-INF/templates/screens/notifications/NotificationCustomize.vm	(original)
+++ trunk/src/webapp/WEB-INF/templates/screens/notifications/NotificationCustomize.vm	2009-06-28 14:22:09-0700
@@ -97,7 +97,7 @@
 <div class="functnbar3">
   <input type="submit" value="$l10n.Save" name="eventSubmit_doCustomize" />
   <input type="button" value="$l10n.EditConditions" 
-         onClick="location.href='$link.setPage("admin,ConditionEdit.vm").addPathInfo("$scarabG.Constant.CANCEL_TEMPLATE","notifications,NotificationCustomize.vm").addPathInfo("obj_type", "$scarabG.Constant.NOTIFICATION_ATTRIBUTE_OBJECT").addPathInfo("attId", "$rule.RuleId")'" />
+         onClick="location.href='$link.setPage("admin,NotificationEdit.vm").addPathInfo("$scarabG.Constant.CANCEL_TEMPLATE","notifications,NotificationCustomize.vm").addPathInfo("obj_type", "$scarabG.Constant.NOTIFICATION_ATTRIBUTE_OBJECT").addPathInfo("attId", "$rule.RuleId")'" />
 </div> 
 
 ##<p class="paginate">&#171; $l10n.Previous | 1 of 1 | $l10n.Next &#187;</p>


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