Scarab commit: svn commit: r11270 - branches/scarab_11079_legacy_with_ant_maven1/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm

[email protected] Wed, 30 May 2012 03:16:11 -0700 (PDT)
Newsgroups gmane.comp.java.scarab.cvs
Message-ID <[email protected]>
Author: dabbous
Date: 2012-05-30 03:16:10-0700
New Revision: 11270

Modified:
   branches/scarab_11079_legacy_with_ant_maven1/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm

Log:
fixed Display of checkmark for single option attributes

Modified: branches/scarab_11079_legacy_with_ant_maven1/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm
Url: http://scarab.tigris.org/source/browse/scarab/branches/scarab_11079_legacy_with_ant_maven1/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm?view=diff&pathrev=11270&r1=11269&r2=11270
==============================================================================
--- branches/scarab_11079_legacy_with_ant_maven1/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm	(original)
+++ branches/scarab_11079_legacy_with_ant_maven1/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm	2012-05-30 03:16:10-0700
@@ -1,52 +1,67 @@
-#macro (markup $type)

-#set ($pseudoHTML = $scarabG.getTurbineConfiguration().getString("system.mail.pseudohtml").toLowerCase().equals("true"))

-#if($pseudoHTML && $type=='b')*#end#if($pseudoHTML && $type=='u')_#end#if($pseudoHTML && $type=='i')/#end#if(!$pseudoHTML && $type=='s')****#end

-#end

-

-#macro (CanMakeTransitionForOption $fromValue $option $issue $multiple)

-    #set ($selected = false)

-    #set ($canMakeTransition = true)

-    #if ($fromValue && $fromValue.toString() != '')

-      #if (!$multiple.equals("true"))

-        #if ($issue.isTemplate())

-          #set ($canMakeTransition = $scarabG.Workflow.canMakeTransition($data.User, $scarabR.getAttributeOption("0"), $option.getAttributeOption(), $issue))

-        #else

-          #if ($issue.isNew())

-            #set ($values = '0')

-          #else

-            #set ($values = $fromValue)

-          #end

-          #set ($canMakeTransition = $scarabG.Workflow.canMakeTransition($data.User, $scarabR.getAttributeOption($values), $option.getAttributeOption(), $issue))

-        #end 

-      #end

-    #else

-      #set ($canMakeTransition = $scarabG.Workflow.canMakeTransition($data.User, $scarabR.getAttributeOption("0"), $option.getAttributeOption(), $issue))

-    #end

-$canMakeTransition

-#end

-

-#macro (AllowedTransitionsForOption $attrValue $optionFieldName $size $multiple)

-  #set ($count=0)

-  #set ($attrInput = $intake.AttributeValue.mapTo($attrValue))

-  #set ($attr = $attrValue.Attribute)

-  #set ($issue = $attrValue.Issue)

-  #set ($module = $issue.Module)

-  #set ($issueType = $issue.IssueType)

-  #if ($issueType.ParentId > 0)

-     #set ($issueType = $issueType.IssueTypeForTemplateType)

-  #end

-  ## Initialize $newValues in case the second #set has a null RHS.

-  #set ($newValues = '')

-  #set ($newValues = $attrInput.get($optionFieldName).Value)

-  #foreach ($option in $module.getOptionTree($attr, $issueType, false))

-    #set ($canMakeTransition = "#CanMakeTransitionForOption ($newValues $option $issue $multiple)")

-    #if ($canMakeTransition.trim()=="true")

-      #set ($count=$count+1)

-    #end

-  #end

-  $count

-#end

-

+#macro (markup $type)
+#set ($pseudoHTML = $scarabG.getTurbineConfiguration().getString("system.mail.pseudohtml").toLowerCase().equals("true"))
+#if($pseudoHTML && $type=='b')*#end#if($pseudoHTML && $type=='u')_#end#if($pseudoHTML && $type=='i')/#end#if(!$pseudoHTML && $type=='s')****#end
+#end
+
+#macro (CanMakeTransitionForOption $fromValue $option $issue $multiple)
+    #set ($selected = false)
+    #set ($canMakeTransition = true)
+    #if ($fromValue && $fromValue.toString() != '')
+      #if (!$multiple.equals("true"))
+        #if ($issue.isTemplate())
+          #set ($canMakeTransition = $scarabG.Workflow.canMakeTransition($data.User, $scarabR.getAttributeOption("0"), $option.getAttributeOption(), $issue))
+        #else
+          #if ($issue.isNew())
+            #set ($values = '0')
+          #else
+            #set ($values = $fromValue)
+          #end
+          #set ($canMakeTransition = $scarabG.Workflow.canMakeTransition($data.User, $scarabR.getAttributeOption($values), $option.getAttributeOption(), $issue))
+        #end 
+      #end
+    #else
+      #set ($canMakeTransition = $scarabG.Workflow.canMakeTransition($data.User, $scarabR.getAttributeOption("0"), $option.getAttributeOption(), $issue))
+    #end
+$canMakeTransition
+#end
+
+#macro (AllowedTransitionsForOption $attrValue $optionFieldName $size $multiple)
+  #set ($count=0)
+  #set ($attrInput = $intake.AttributeValue.mapTo($attrValue))
+  #set ($attr = $attrValue.Attribute)
+  #set ($issue = $attrValue.Issue)
+  #set ($module = $issue.Module)
+  #set ($issueType = $issue.IssueType)
+  #if ($issueType.ParentId > 0)
+     #set ($issueType = $issueType.IssueTypeForTemplateType)
+  #end
+  ## Initialize $newValues in case the second #set has a null RHS.
+  #set ($newValues = '')
+  #set ($newValues = $attrInput.get($optionFieldName).Value)
+  #foreach ($option in $module.getOptionTree($attr, $issueType, false))
+    #set ($canMakeTransition = "#CanMakeTransitionForOption ($newValues $option $issue $multiple)")
+    #if ($canMakeTransition.trim()=="true")
+      #set ($count=$count+1)
+    #end
+  #end
+  $count
+#end
+
+#macro (AvailableTransitionsForOption $attrValue $optionFieldName $size $multiple)
+  #set ($count=0)
+  #set ($attr = $attrValue.Attribute)
+  #set ($issue = $attrValue.Issue)
+  #set ($module = $issue.Module)
+  #set ($issueType = $issue.IssueType)
+  #if ($issueType.ParentId > 0)
+     #set ($issueType = $issueType.IssueTypeForTemplateType)
+  #end
+  #set ($count  = $module.getOptionTree($attr, $issueType, false).size())
+  $count
+#end
+
+
+
 ## ===================================================================
 ## Helper macro
 ## $string : A string
@@ -63,53 +78,56 @@
 $displayValue
 #end
 
-#macro (attrValueLeafSelect $attrValue $optionFieldName $size $multiple $required)

-  #set ($attrInput = $intake.AttributeValue.mapTo($attrValue))

-  #set ($attr = $attrValue.Attribute)

+#macro (attrValueLeafSelect $attrValue $optionFieldName $size $multiple $required)
+  #set ($attrInput = $intake.AttributeValue.mapTo($attrValue))
+  #set ($attr = $attrValue.Attribute)
   #set ($attributeType = $attr.AttributeType)
   #set ($attributeClassName = $attributeType.ClassName)
-  #set ($issue = $attrValue.Issue)

-  #set ($module = $issue.Module)

-  #set ($issueType = $issue.IssueType)

-  #if ($issueType.ParentId > 0)

-     #set ($issueType = $issueType.IssueTypeForTemplateType)

-  #end

-  ## Initialize $newValues in case the second #set has a null RHS.

-  #set ($newValues = '')

-  #set ($newValues = $attrInput.get($optionFieldName).Value)

-  #set ( $count = "#AllowedTransitionsForOption ( $attrValue $optionFieldName $size $multiple )")

+  #set ($issue = $attrValue.Issue)
+  #set ($module = $issue.Module)
+  #set ($issueType = $issue.IssueType)
+  #if ($issueType.ParentId > 0)
+     #set ($issueType = $issueType.IssueTypeForTemplateType)
+  #end
+  ## Initialize $newValues in case the second #set has a null RHS.
+  #set ($newValues = '')
+  #set ($newValues = $attrInput.get($optionFieldName).Value)
+  #set ( $count = "#AllowedTransitionsForOption ( $attrValue $optionFieldName $size $multiple )")
   #set ($cssId = "#substringAfter($attVal.RModuleAttribute.DisplayValue 'append:')")
   #set ($cssId = $cssId.trim())
-  #if ($count.trim() == "0" )

+  #if ($count.trim() == "0" )
       <input id="$cssId" type="hidden" name="$attrInput.get($optionFieldName).Key" value="$newValues"/>  
       <span id="$cssId:Display">$newValues</span>
-

-  #elseif ($count.trim() == "1" )

-

-    #foreach ($option in $module.getOptionTree($attr, $issueType, false))

-      #set ($canMakeTransition = "#CanMakeTransitionForOption ($newValues $option $issue $multiple)")

-

-      #if ($canMakeTransition.trim()=="true")

-        #if ($templateInfo || (!$required && $newValues && $newValues.toString() == ''))

-          <input id="$cssId" type="hidden" name="$attrInput.get($optionFieldName).Key" value="$newValues"/>

+
+  #elseif ($count.trim() == "1" )
+    #set ($available = "#AvailableTransitionsForOption ( $attrValue $optionFieldName $size $multiple )" )
+
+    #foreach ($option in $module.getOptionTree($attr, $issueType, false))
+      #set ($canMakeTransition = "#CanMakeTransitionForOption ($newValues $option $issue $multiple)")
+
+      #if ($canMakeTransition.trim()=="true")
+        #if ($templateInfo || (!$required && $newValues && $available.trim() == "1"))
+          <input id="$cssId" type="hidden" name="$attrInput.get($optionFieldName).Key" value="$newValues"/>
           #if ($newValues && $newValues != "" && $newValues > 0)
-            #set ($checked = "checked")

-          #end

-          #set ($oc = "javascript:this.form.${attrInput.get($optionFieldName).Key}.value=(this.checked)?$option.OptionId:''")

-	          <input type="checkbox" 

-            name="${attrInput.get($optionFieldName).Key}_tmp" 

-            onclick="$oc" ${checked} />

-        #else

+            #set ($checked = "checked")
+          #else
+            #set ($checked = "")
+          #end
+          #set ($oc = "javascript:this.form.${attrInput.get($optionFieldName).Key}.value=(this.checked)?$option.OptionId:''")
+	    <input type="checkbox" 
+            name="${attrInput.get($optionFieldName).Key}_tmp" 
+            onclick="$oc" ${checked} />
+        #else
           <input id="$cssId" type="hidden" name="$attrInput.get($optionFieldName).Key" value="$option.optionId"/>
-	        #end

+	        #end
 	        #if (!$option.Active)[I]#end <span id="$cssId:Display">$option.DisplayValue</span>
-      #end

-    #end

-

-  #else

-

+      #end
+    #end
+
+  #else
+
     #if ($attributeClassName == "ComboTreeBoxAttribute")
-      <input id="$attrInput.get($optionFieldName).Key" value="$newValues" name="$attrInput.get($optionFieldName).Key" type="hidden"/>  

+      <input id="$attrInput.get($optionFieldName).Key" value="$newValues" name="$attrInput.get($optionFieldName).Key" type="hidden"/>  
       <span style="display:inline;">
         <input id="$attrInput.get($optionFieldName).Key:Display" 
                type="text" size="$attr.FieldSize" 
@@ -118,17 +136,17 @@
         <a class="treeview_button"
            id="$attrInput.get($optionFieldName).Key:Anchor"
            href="javascript:toggleTreePopup('$attrInput.get($optionFieldName).Key')"
-        >&nbsp;&nbsp;&nbsp;&nbsp;</a>

+        >&nbsp;&nbsp;&nbsp;&nbsp;</a>
       </span>
-  

-      #set ($attributeTreePopup = [])

-      #set ($dummy = $attributeTreePopup.add($attrInput.get($optionFieldName).Key) )

-      #set ($dummy = $attributeTreePopup.add($newValues) )

-      #set ($dummy = $attributeTreePopup.add($module.getOptionsTreeAsJSON($data, $newValues.toString(), $attr, $attrValue.Issue, false)) )

-  

-      #set ($dummy = $attributeTreePopupHelper.add($attributeTreePopup) )

-

-    #elseif ($attributeClassName == "ComboBoxAttribute")

+  
+      #set ($attributeTreePopup = [])
+      #set ($dummy = $attributeTreePopup.add($attrInput.get($optionFieldName).Key) )
+      #set ($dummy = $attributeTreePopup.add($newValues) )
+      #set ($dummy = $attributeTreePopup.add($module.getOptionsTreeAsJSON($data, $newValues.toString(), $attr, $attrValue.Issue, false)) )
+  
+      #set ($dummy = $attributeTreePopupHelper.add($attributeTreePopup) )
+
+    #elseif ($attributeClassName == "ComboBoxAttribute")
     
       <select name="$attrInput.get($optionFieldName).Key"
         #if($size.length())size="$size"#end #if($multiple.equals("true"))multiple="multiple"#end>
@@ -173,381 +191,381 @@
           #end
         #end
       </select>
-

+
+    #end
+
+ #end
+#end
+
+#macro (templateAttrValueLeafSelect $attrValue $templAttrValue $optionFieldName $size $multiple)
+  #set ($attrInput = $intake.AttributeValue.mapTo($attrValue))
+  #set ($templAttrInput = $intake.AttributeValue.mapTo($templAttrValue))
+  #set ($attr = $attrValue.Attribute)
+  #set ($issue = $attrValue.Issue)
+  #set ($module = $issue.Module)
+  #if ($attrInput.get($optionFieldName).Value)
+    #set($currentValue = $attrInput.get($optionFieldName).Value)
+  #elseif ($templAttrInput.get($optionFieldName).Value)
+    #set($currentValue = $templAttrInput.get($optionFieldName).Value)
+  #end
+<select name="$attrInput.get($optionFieldName).Key"
+  #if($size.length())size="$size"#end #if($multiple)multiple="multiple"#end>
+  #if ($size.length() == 0)
+  <option value="">$l10n.Choose</option>
+  #end
+  #foreach ($option in $module.getOptionTree($attr, $issue.IssueType))
+    #set ($selected = false)
+    #if ($currentValue && $option.OptionId == $currentValue)
+         #set ($selected = true)
+    #end
+    #set ($canMakeTransition = true)
+    #set ($canMakeTransition = $scarabG.Workflow.canMakeTransition($data.User, $scarabR.getAttributeOption("0"), $option.getAttributeOption(), $issue))
+    #if ($canMakeTransition)
+    <option value="$option.OptionId"#selected($selected)>
+    #foreach ($i in [0..$option.Level])#if($i != 0)&nbsp;&nbsp;&nbsp;&nbsp;#end#end
+          $option.DisplayValue</option>
+    #end
+  #end
+</select>
+#end
+
+#macro (dependTypeLeafSelect $childIssue $type)
+<select name="$type_depend_type_id_$childIssue.IssueId">
+  <option>Choose dependency type</option>
+  #foreach ($dependType in $currentIssue.getAllDependencyTypes())
+    #if ($currentIssue.getDependency($childIssue).TypeId.toString().equals($dependType.DependTypeId.toString()))
+    <option selected="selected" value="$dependType.DependTypeId">$dependType.Name</option>
+    #else
+    <option value="$dependType.DependTypeId">$dependType.Name</option>
     #end
+  #end
+  <option value="none">$l10n.RemoveDependency</option>
+</select>
+#end
 
- #end

-#end

-

-#macro (templateAttrValueLeafSelect $attrValue $templAttrValue $optionFieldName $size $multiple)

-  #set ($attrInput = $intake.AttributeValue.mapTo($attrValue))

-  #set ($templAttrInput = $intake.AttributeValue.mapTo($templAttrValue))

-  #set ($attr = $attrValue.Attribute)

-  #set ($issue = $attrValue.Issue)

-  #set ($module = $issue.Module)

-  #if ($attrInput.get($optionFieldName).Value)

-    #set($currentValue = $attrInput.get($optionFieldName).Value)

-  #elseif ($templAttrInput.get($optionFieldName).Value)

-    #set($currentValue = $templAttrInput.get($optionFieldName).Value)

-  #end

-<select name="$attrInput.get($optionFieldName).Key"

-  #if($size.length())size="$size"#end #if($multiple)multiple="multiple"#end>

-  #if ($size.length() == 0)

-  <option value="">$l10n.Choose</option>

-  #end

-  #foreach ($option in $module.getOptionTree($attr, $issue.IssueType))

-    #set ($selected = false)

-    #if ($currentValue && $option.OptionId == $currentValue)

-         #set ($selected = true)

-    #end

-    #set ($canMakeTransition = true)

-    #set ($canMakeTransition = $scarabG.Workflow.canMakeTransition($data.User, $scarabR.getAttributeOption("0"), $option.getAttributeOption(), $issue))

-    #if ($canMakeTransition)

-    <option value="$option.OptionId"#selected($selected)>

-    #foreach ($i in [0..$option.Level])#if($i != 0)&nbsp;&nbsp;&nbsp;&nbsp;#end#end

-          $option.DisplayValue</option>

-    #end

-  #end

-</select>

-#end

-

-#macro (dependTypeLeafSelect $childIssue $type)

-<select name="$type_depend_type_id_$childIssue.IssueId">

-  <option>Choose dependency type</option>

-  #foreach ($dependType in $currentIssue.getAllDependencyTypes())

-    #if ($currentIssue.getDependency($childIssue).TypeId.toString().equals($dependType.DependTypeId.toString()))

-    <option selected="selected" value="$dependType.DependTypeId">$dependType.Name</option>

-    #else

-    <option value="$dependType.DependTypeId">$dependType.Name</option>

-    #end

-  #end

-  <option value="none">$l10n.RemoveDependency</option>

-</select>

-#end

-

 #macro (attrValueText $attVal $attrValue $size $hint)
-#set ($attrInput = $intake.AttributeValue.mapTo($attrValue))

-        #if ($attVal.Attribute.AttributeType.Name == "long-string")

-           #textAreaMedium("$attrInput.Value.Key" $attrInput.Value)

-        #elseif ($attVal.Attribute.AttributeType.Name == "date")

-           #if ($scarabG.getTurbineConfiguration().getString("scarab.datefields.editable") == "false")

-              #set ($readonly = "readonly")

-           #else

-              #set ($readonly = "")

-           #end

-           #set ($ref = $attrInput.Value.Key)

-           #set ($datevalue = $scarabR.formatDate($attrInput.Value.value))

-           <input

-                type="text"

-                id="$ref"

-                name="$ref"

-                $readonly 

-                value="$datevalue" 

-                size="20" />              

-           <a class="date"

-                id="dateAnchor$ref" 

-                name="dateAnchor$ref" 

-                href="javascript:;" 

-                onClick="calPopup.select(document.getElementById('$ref'),'dateAnchor$ref','$l10n.ShortDatePattern');return false;">

-              </a>

-        #else

-          #if ($attVal.Attribute.AttributeType.Name == "integer")

-            #set ( $fieldName = $attrInput.NumericValue.Key )

-            #set ( $fieldValue= $!attrInput.NumericValue )

-          #else

-            #set ( $fieldName = $attrInput.Value.Key )

-            #set ( $fieldValue= $!attrInput.Value )

-          #end

-          #* #if ($fieldValue.toString().equals("")) #set ($fieldValue = $hint) #end *#

-          <input         

-            type="text" 

-            name="$fieldName" 

-            value="$fieldValue"

-            #if($size > 0) size="$size" #else class="fullWidth" #end /> 

-            #if ( $hint.length() > 0 && !$fieldValue.toString().equals($hint) ) <span class="hint">$hint</span> #end

-            

-        #end

-#end

-

+#set ($attrInput = $intake.AttributeValue.mapTo($attrValue))
+        #if ($attVal.Attribute.AttributeType.Name == "long-string")
+           #textAreaMedium("$attrInput.Value.Key" $attrInput.Value)
+        #elseif ($attVal.Attribute.AttributeType.Name == "date")
+           #if ($scarabG.getTurbineConfiguration().getString("scarab.datefields.editable") == "false")
+              #set ($readonly = "readonly")
+           #else
+              #set ($readonly = "")
+           #end
+           #set ($ref = $attrInput.Value.Key)
+           #set ($datevalue = $scarabR.formatDate($attrInput.Value.value))
+           <input
+                type="text"
+                id="$ref"
+                name="$ref"
+                $readonly 
+                value="$datevalue" 
+                size="20" />              
+           <a class="date"
+                id="dateAnchor$ref" 
+                name="dateAnchor$ref" 
+                href="javascript:;" 
+                onClick="calPopup.select(document.getElementById('$ref'),'dateAnchor$ref','$l10n.ShortDatePattern');return false;">
+              </a>
+        #else
+          #if ($attVal.Attribute.AttributeType.Name == "integer")
+            #set ( $fieldName = $attrInput.NumericValue.Key )
+            #set ( $fieldValue= $!attrInput.NumericValue )
+          #else
+            #set ( $fieldName = $attrInput.Value.Key )
+            #set ( $fieldValue= $!attrInput.Value )
+          #end
+          #* #if ($fieldValue.toString().equals("")) #set ($fieldValue = $hint) #end *#
+          <input         
+            type="text" 
+            name="$fieldName" 
+            value="$fieldValue"
+            #if($size > 0) size="$size" #else class="fullWidth" #end /> 
+            #if ( $hint.length() > 0 && !$fieldValue.toString().equals($hint) ) <span class="hint">$hint</span> #end
+            
+        #end
+#end
+
 #macro (templateAttrValueText $attVal $attrValue $size $templAttrValue)
-#set ($attrInput = $intake.AttributeValue.mapTo($attrValue))

-#set ($value = $templAttrValue.Value)

-#set ($currentValue = "")

-#if ($attrInput.Value.toString().length() > 0)

-     #set ($currentValue = $attrInput.Value)

-#elseif ($value.length() > 0)

-     #set ($currentValue = $value)

-#end

-#if ($attVal.Attribute.AttributeType.Name == "long-string")

-   #textAreaMedium("$attrInput.Value.Key" $currentValue)

-#else

-   <input class="fullWidth" type="text" name="$attrInput.Value.Key" value="$!currentValue" />

-#end

-#end

-

-#macro (attrValueHierarchySelect $attrValue $optionFieldName $size $multiple)

-#set ($attrInput = $intake.AttributeValue.mapTo($attrValue))

-#set ($attr = $attrValue.Attribute)

-#set ($module = $attrValue.Issue.Module)

-## initialize in case the second #set has null RHS

-#set ($values = "")

-#set ($values = $attrInput.get($optionFieldName).Value)

-#set ($selectedEmpty=false)

-#foreach ($value in $values)

-  #if ($value.intValue()==0)

-    #set ($selectedEmpty=true)

-  #end

-#end

-

-<select name="$attrInput.get($optionFieldName).Key"

-#if($size.length() != 0)size="$size"#end #if($multiple)multiple="multiple"#end>

-  #if($size.length() == 0 || $size == "1")

-     <option value="">$l10n.Choose</option>

-  #end

-  <option value="0" #if ($selectedEmpty) selected="selected"#end>$l10n.EmptyOption</option>

-  #foreach ($option in $module.getOptionTree($attr, $attrValue.Issue.IssueType))

-    #set ($selected = false)

-    #if ($values && $values.toString().length() > 0)

-       #if ($multiple.toString().equals("true"))

-         #foreach ($value in $values)

-            #if ($value.equals($option.OptionId))

-               #set ($selected=true)

-            #end

-         #end

-       #else

-         #if ($values.equals($option.OptionId))

-           #set ($selected=true)

-          #end

-       #end

-    #end

-    <option value="$option.OptionId"#selected($selected)>

-#foreach ($i in [0..$option.Level])#if($i != 0)&nbsp;&nbsp;&nbsp;&nbsp;#end#end

-          $option.DisplayValue</option>

-  #end

-</select>

-#end

-

-#macro (attrValueErrorMsg $attrValue $fieldName)

-    #set ($attrInput = $intake.AttributeValue.mapTo($attrValue))

-    #if (!$attrInput.get($fieldName).isValid())

-        <p class="warningmark">

-            ## we ignore the missing resource error because there is no easy way yet

-            ## to provide a parameterized message here. In this situation the java code

-            ## (action or screen class) performs the parameterized localization and the

-            ## line below should simply redisplay the key.

-            <strong>$l10n.getIgnoreMissingResource($attrInput.get($fieldName).Message)</strong>

-        </p>

-    #end

-#end

-

-#macro (confirm $text)

-   <p class="donemark"><em>$text</em></p>

-#end

-

-#macro (info $text)

-   <p class="infomark"><em>$text</em></p>

-#end

-

-#macro (alert $text)

-   <p><strong><pre class="warningmark">$l10n.Alert $text</pre></strong></p>

-#end

-

-#macro (fieldErrorMsg $field $br)

-#if ($field && $field.Message.length() > 0 && !$field.isValid())

-<p class="warningmark"><strong>$l10n.get($field.Message)</strong></p>$br

-#end

-#end

-

-#macro (fieldHint $field)

-#if ($field && $field.Message.length() > 0 && !$field.isValid())

-<div class="warningmark"><strong>$l10n.get($field.Message)</strong></div>

-#end

-#end

-

-

-#macro (actionMessage)

-#if ($data.Message)

-  #confirm($data.Message)

-#end

-#if($scarabR.ConfirmMessage)

-  #confirm($scarabR.ConfirmMessage)  

-#end

-#if($scarabR.InfoMessage)

-  #info($scarabR.InfoMessage)  

-#end

-#if($scarabR.AlertMessage)

-  #alert($scarabR.AlertMessage)  

-#end

-#end

-

-#macro (stdIntakeMsg)

-#if (!$intake.isAllValid())

-<p class="warningmark"><strong>$l10n.CheckForErrors</strong></p>

-#end

-#end

-

-#macro (numericSelect $name $first $last $selected $size)

-    <select name="$name" size="$size">

-        #foreach ($i in [$first..$last])

-            <option value="$i" #if ($i==$selected)selected="selected" #end>$i</option>

-        #end

-    </select>

-#end

-

-#macro (numericOrderSelect $attribute $name $first $last $selected $size)

-    <select id="$name" name="$name" size="$size" onchange="javascript: updatePreferredOrderList(this, '$attribute', '$name'); return true;">

-        #foreach ($i in [$first..$last])

-            <option value="$i" #if ($i==$selected)selected="selected" #end>$i</option>

-        #end

-        <script type="text/javascript"><!--

-            initialisePreferredOrderList("$attribute", "$name", $selected);

-           // -->

-        </script>

-    </select>

-#end

-

-#macro (booleanCheckbox $booleanField)

-#if ($booleanField.Value)

-<input type="checkbox" name="$booleanField.Key" value="true" checked="checked" />

-#else

-<input type="checkbox" name="$booleanField.Key" value="true" />

-#end

-<input type="hidden" name="$booleanField.ValueIfAbsent" value="false" />

-#end

-

-#macro (booleanCheckboxLock $booleanField $locked)

-#if ($locked)

-   #set ($disabled = "disabled=disabled")

-#else

-   #set ($disabled = "")

-#end

-#if ($booleanField.Value)

-<input type="checkbox" name="$booleanField.Key" value="true" checked="checked" $disabled/>

-#else

-<input type="checkbox" name="$booleanField.Key" value="true" $disabled/>

-#end

-<input type="hidden" name="$booleanField.ValueIfAbsent" value="false" $disabled />

-#end

-

-#macro (booleanRadio $booleanField)

-#if ($booleanField.Value)

-<input type="radio" name="$booleanField.Key" value="true" checked="checked" />

-#else

-<input type="radio" name="$booleanField.Key" value="true" />

-#end

-<input type="hidden" name="$booleanField.ValueIfAbsent" value="false" />

-#end

-

-#macro (Radio $field $value $default)

-#if ($field.Value.equals($value))

-<input type="radio" name="$field.Key" value="$value" checked="checked" />

-#elseif (!$field.Value && $value.equals($default))

-<input type="radio" name="$field.Key" value="$value" checked="checked" />

-#else

-<input type="radio" name="$field.Key" value="$value" />

-#end

-#end

-

-#macro (textField $field $size)

-#if ($field.Validator.MaxLength && $field.Validator.MaxLength > 0)

-#set ($maxLength = $field.Validator.MaxLength)

-#end

-<input type="text" name="$field.Key" value="$!field.Value"#if($maxLength) maxlength="$maxLength"#end#if($size.length()) size="$size"#end />

-#end

-

-#macro (userSelectBox $attrValue $size $multiple)

-#set ($attrInput = $intake.AttributeValue.mapTo($attrValue))

-#set ($attr = $attrValue.Attribute)

-#set ($module = $attrValue.Issue.Module)

-#if ($multiple == "true" || $multiple == "multiple")

-<select name="$attrInput.get("UserIds").Key"

-     #if($size.length())size="$size"#end multiple="multiple">

-#else

-<select name="$attrInput.get("UserId").Key"

-     #if($size.length())size="$size"#end>

-#end

- #if ($size.length() == 0)

- <option value="">$l10n.Choose</option>

- #end

-   #foreach ($user in $module.getUsers($attr.Permission))

-   #if ($attrInput.UserId.Value && $user.PrimaryKey == $attrInput.UserId.Value)

-   <option selected="selected" value="$user.PrimaryKey">$user.UserName</option>

-   #else

-   <option value="$user.PrimaryKey">$user.UserName</option>

-   #end

- #end

-</select>

-#end

-

-#macro (templateUserSelectBox $attrValue $templAttrValue $size $multiple)

-#set ($attrInput = $intake.AttributeValue.mapTo($attrValue))

-#set ($templAttrInput = $intake.AttributeValue.mapTo($templAttrValue))

-#set ($attr = $attrValue.Attribute)

-#set ($module = $attrValue.Issue.Module)

-  #set($currentValue = "")

-  #if ($attrInput.UserId.toString().length() > 0)

-    #set($currentValue = $attrInput.UserId)

-  #elseif ($templAttrInput.UserId.toString().length() > 0)

-    #set($currentValue = $templAttrInput.UserId)

-  #end

-#if ($multiple == "true" || $multiple == "multiple")

-<select name="$attrInput.UserId.Key"

-     #if($size.length())size="$size"#end multiple="multiple">

-#else

-<select name="$attrInput.UserId.Key"

-     #if($size.length())size="$size"#end>

-#end

- #if ($size.length() == 0)

- <option value="">$l10n.Choose</option>

- #end

-   #foreach ($user in $module.getUsers($attr.Permission))

-   #if ($user.PrimaryKey.toString().equals($currentValue.toString()))

-   <option selected="selected" value="$user.PrimaryKey">$user.UserName</option>

-   #else

-   <option value="$user.PrimaryKey">$user.UserName</option>

-   #end

- #end

-</select>

-#end

-

-#macro (queryTypeSelectBox $query)

-  #set ($queryGroup = $intake.Query.mapTo($query))

-  <select name="$queryGroup.ScopeId.Key">

-  #foreach ($scope in $scarabR.getScopes())

-    <option value = "$scope.ScopeId" #if($scope.ScopeId.toString().equals("$queryGroup.ScopeId.Value")) selected="selected" #end>

-    $scope.Name

-    </option>

-  #end

-  </select>

-#end

-

-#macro (templateTypeSelectBox $templateInfo)

-  #set ($group = $intake.IssueTemplateInfo.mapTo($templateInfo))

-  <select name="$group.ScopeId.Key">

-  #foreach ($scope in $scarabR.getScopes())

-    <option value = "$scope.ScopeId" #if($scope.ScopeId.toString().equals("$group.ScopeId.Value")) selected="selected" #end>

-    $scope.Name

-    </option>

-  #end

-  </select>

-#end

-

-#macro (frequencySelectBox $id)

-<option value="" >$l10n.Choose</option>

-  #foreach ($frequency in $scarabR.Frequencies)

-    <option value = "$frequency.FrequencyId" #if($frequency.FrequencyId.equals($id)) selected="selected" #end>

-    $frequency.Name

-    </option>

-  #end

-#end

-

-#macro (indexedRows $count)

- #if ($count % 2 > 0)

-    <tr class="a">

- #else

-    <tr class="b">

- #end

-#end

+#set ($attrInput = $intake.AttributeValue.mapTo($attrValue))
+#set ($value = $templAttrValue.Value)
+#set ($currentValue = "")
+#if ($attrInput.Value.toString().length() > 0)
+     #set ($currentValue = $attrInput.Value)
+#elseif ($value.length() > 0)
+     #set ($currentValue = $value)
+#end
+#if ($attVal.Attribute.AttributeType.Name == "long-string")
+   #textAreaMedium("$attrInput.Value.Key" $currentValue)
+#else
+   <input class="fullWidth" type="text" name="$attrInput.Value.Key" value="$!currentValue" />
+#end
+#end
+
+#macro (attrValueHierarchySelect $attrValue $optionFieldName $size $multiple)
+#set ($attrInput = $intake.AttributeValue.mapTo($attrValue))
+#set ($attr = $attrValue.Attribute)
+#set ($module = $attrValue.Issue.Module)
+## initialize in case the second #set has null RHS
+#set ($values = "")
+#set ($values = $attrInput.get($optionFieldName).Value)
+#set ($selectedEmpty=false)
+#foreach ($value in $values)
+  #if ($value.intValue()==0)
+    #set ($selectedEmpty=true)
+  #end
+#end
+
+<select name="$attrInput.get($optionFieldName).Key"
+#if($size.length() != 0)size="$size"#end #if($multiple)multiple="multiple"#end>
+  #if($size.length() == 0 || $size == "1")
+     <option value="">$l10n.Choose</option>
+  #end
+  <option value="0" #if ($selectedEmpty) selected="selected"#end>$l10n.EmptyOption</option>
+  #foreach ($option in $module.getOptionTree($attr, $attrValue.Issue.IssueType))
+    #set ($selected = false)
+    #if ($values && $values.toString().length() > 0)
+       #if ($multiple.toString().equals("true"))
+         #foreach ($value in $values)
+            #if ($value.equals($option.OptionId))
+               #set ($selected=true)
+            #end
+         #end
+       #else
+         #if ($values.equals($option.OptionId))
+           #set ($selected=true)
+          #end
+       #end
+    #end
+    <option value="$option.OptionId"#selected($selected)>
+#foreach ($i in [0..$option.Level])#if($i != 0)&nbsp;&nbsp;&nbsp;&nbsp;#end#end
+          $option.DisplayValue</option>
+  #end
+</select>
+#end
+
+#macro (attrValueErrorMsg $attrValue $fieldName)
+    #set ($attrInput = $intake.AttributeValue.mapTo($attrValue))
+    #if (!$attrInput.get($fieldName).isValid())
+        <p class="warningmark">
+            ## we ignore the missing resource error because there is no easy way yet
+            ## to provide a parameterized message here. In this situation the java code
+            ## (action or screen class) performs the parameterized localization and the
+            ## line below should simply redisplay the key.
+            <strong>$l10n.getIgnoreMissingResource($attrInput.get($fieldName).Message)</strong>
+        </p>
+    #end
+#end
+
+#macro (confirm $text)
+   <p class="donemark"><em>$text</em></p>
+#end
+
+#macro (info $text)
+   <p class="infomark"><em>$text</em></p>
+#end
+
+#macro (alert $text)
+   <p><strong><pre class="warningmark">$l10n.Alert $text</pre></strong></p>
+#end
+
+#macro (fieldErrorMsg $field $br)
+#if ($field && $field.Message.length() > 0 && !$field.isValid())
+<p class="warningmark"><strong>$l10n.get($field.Message)</strong></p>$br
+#end
+#end
+
+#macro (fieldHint $field)
+#if ($field && $field.Message.length() > 0 && !$field.isValid())
+<div class="warningmark"><strong>$l10n.get($field.Message)</strong></div>
+#end
+#end
+
+
+#macro (actionMessage)
+#if ($data.Message)
+  #confirm($data.Message)
+#end
+#if($scarabR.ConfirmMessage)
+  #confirm($scarabR.ConfirmMessage)  
+#end
+#if($scarabR.InfoMessage)
+  #info($scarabR.InfoMessage)  
+#end
+#if($scarabR.AlertMessage)
+  #alert($scarabR.AlertMessage)  
+#end
+#end
+
+#macro (stdIntakeMsg)
+#if (!$intake.isAllValid())
+<p class="warningmark"><strong>$l10n.CheckForErrors</strong></p>
+#end
+#end
+
+#macro (numericSelect $name $first $last $selected $size)
+    <select name="$name" size="$size">
+        #foreach ($i in [$first..$last])
+            <option value="$i" #if ($i==$selected)selected="selected" #end>$i</option>
+        #end
+    </select>
+#end
+
+#macro (numericOrderSelect $attribute $name $first $last $selected $size)
+    <select id="$name" name="$name" size="$size" onchange="javascript: updatePreferredOrderList(this, '$attribute', '$name'); return true;">
+        #foreach ($i in [$first..$last])
+            <option value="$i" #if ($i==$selected)selected="selected" #end>$i</option>
+        #end
+        <script type="text/javascript"><!--
+            initialisePreferredOrderList("$attribute", "$name", $selected);
+           // -->
+        </script>
+    </select>
+#end
+
+#macro (booleanCheckbox $booleanField)
+#if ($booleanField.Value)
+<input type="checkbox" name="$booleanField.Key" value="true" checked="checked" />
+#else
+<input type="checkbox" name="$booleanField.Key" value="true" />
+#end
+<input type="hidden" name="$booleanField.ValueIfAbsent" value="false" />
+#end
+
+#macro (booleanCheckboxLock $booleanField $locked)
+#if ($locked)
+   #set ($disabled = "disabled=disabled")
+#else
+   #set ($disabled = "")
+#end
+#if ($booleanField.Value)
+<input type="checkbox" name="$booleanField.Key" value="true" checked="checked" $disabled/>
+#else
+<input type="checkbox" name="$booleanField.Key" value="true" $disabled/>
+#end
+<input type="hidden" name="$booleanField.ValueIfAbsent" value="false" $disabled />
+#end
+
+#macro (booleanRadio $booleanField)
+#if ($booleanField.Value)
+<input type="radio" name="$booleanField.Key" value="true" checked="checked" />
+#else
+<input type="radio" name="$booleanField.Key" value="true" />
+#end
+<input type="hidden" name="$booleanField.ValueIfAbsent" value="false" />
+#end
+
+#macro (Radio $field $value $default)
+#if ($field.Value.equals($value))
+<input type="radio" name="$field.Key" value="$value" checked="checked" />
+#elseif (!$field.Value && $value.equals($default))
+<input type="radio" name="$field.Key" value="$value" checked="checked" />
+#else
+<input type="radio" name="$field.Key" value="$value" />
+#end
+#end
+
+#macro (textField $field $size)
+#if ($field.Validator.MaxLength && $field.Validator.MaxLength > 0)
+#set ($maxLength = $field.Validator.MaxLength)
+#end
+<input type="text" name="$field.Key" value="$!field.Value"#if($maxLength) maxlength="$maxLength"#end#if($size.length()) size="$size"#end />
+#end
+
+#macro (userSelectBox $attrValue $size $multiple)
+#set ($attrInput = $intake.AttributeValue.mapTo($attrValue))
+#set ($attr = $attrValue.Attribute)
+#set ($module = $attrValue.Issue.Module)
+#if ($multiple == "true" || $multiple == "multiple")
+<select name="$attrInput.get("UserIds").Key"
+     #if($size.length())size="$size"#end multiple="multiple">
+#else
+<select name="$attrInput.get("UserId").Key"
+     #if($size.length())size="$size"#end>
+#end
+ #if ($size.length() == 0)
+ <option value="">$l10n.Choose</option>
+ #end
+   #foreach ($user in $module.getUsers($attr.Permission))
+   #if ($attrInput.UserId.Value && $user.PrimaryKey == $attrInput.UserId.Value)
+   <option selected="selected" value="$user.PrimaryKey">$user.UserName</option>
+   #else
+   <option value="$user.PrimaryKey">$user.UserName</option>
+   #end
+ #end
+</select>
+#end
+
+#macro (templateUserSelectBox $attrValue $templAttrValue $size $multiple)
+#set ($attrInput = $intake.AttributeValue.mapTo($attrValue))
+#set ($templAttrInput = $intake.AttributeValue.mapTo($templAttrValue))
+#set ($attr = $attrValue.Attribute)
+#set ($module = $attrValue.Issue.Module)
+  #set($currentValue = "")
+  #if ($attrInput.UserId.toString().length() > 0)
+    #set($currentValue = $attrInput.UserId)
+  #elseif ($templAttrInput.UserId.toString().length() > 0)
+    #set($currentValue = $templAttrInput.UserId)
+  #end
+#if ($multiple == "true" || $multiple == "multiple")
+<select name="$attrInput.UserId.Key"
+     #if($size.length())size="$size"#end multiple="multiple">
+#else
+<select name="$attrInput.UserId.Key"
+     #if($size.length())size="$size"#end>
+#end
+ #if ($size.length() == 0)
+ <option value="">$l10n.Choose</option>
+ #end
+   #foreach ($user in $module.getUsers($attr.Permission))
+   #if ($user.PrimaryKey.toString().equals($currentValue.toString()))
+   <option selected="selected" value="$user.PrimaryKey">$user.UserName</option>
+   #else
+   <option value="$user.PrimaryKey">$user.UserName</option>
+   #end
+ #end
+</select>
+#end
+
+#macro (queryTypeSelectBox $query)
+  #set ($queryGroup = $intake.Query.mapTo($query))
+  <select name="$queryGroup.ScopeId.Key">
+  #foreach ($scope in $scarabR.getScopes())
+    <option value = "$scope.ScopeId" #if($scope.ScopeId.toString().equals("$queryGroup.ScopeId.Value")) selected="selected" #end>
+    $scope.Name
+    </option>
+  #end
+  </select>
+#end
+
+#macro (templateTypeSelectBox $templateInfo)
+  #set ($group = $intake.IssueTemplateInfo.mapTo($templateInfo))
+  <select name="$group.ScopeId.Key">
+  #foreach ($scope in $scarabR.getScopes())
+    <option value = "$scope.ScopeId" #if($scope.ScopeId.toString().equals("$group.ScopeId.Value")) selected="selected" #end>
+    $scope.Name
+    </option>
+  #end
+  </select>
+#end
+
+#macro (frequencySelectBox $id)
+<option value="" >$l10n.Choose</option>
+  #foreach ($frequency in $scarabR.Frequencies)
+    <option value = "$frequency.FrequencyId" #if($frequency.FrequencyId.equals($id)) selected="selected" #end>
+    $frequency.Name
+    </option>
+  #end
+#end
+
+#macro (indexedRows $count)
+ #if ($count % 2 > 0)
+    <tr class="a">
+ #else
+    <tr class="b">
+ #end
+#end
 
 #macro (indexedColumnsWithIdleHours $count $hours)
  #if    ($hours <=  0) #set ($extra = "")
@@ -581,84 +599,84 @@
  #end
 #end
 
-#macro (indexedRowsWithStyle $count $style)

- #if ($count % 2 > 0)

-    <tr class="a" style=$style">

- #else

-    <tr class="b" style="$style">

- #end

-#end

-

-#macro (indexedRows2 $count)

- #if ($count % 2 > 0)

-    <tr class="b">

- #else

-    <tr class="a">

- #end

-#end

-

-#macro (rows)

- #indexedRows($velocityCount)

-#end

-

-

-#macro (datatitle $title)

-<h3>$title</h3>

-#end

-

-#macro (selected $boolean)

-#if ($boolean) selected="selected"#end

-#end

-

-#macro (checked $boolean)

-#if ($boolean) checked="checked"#end

-#end

-

-

-#macro (option $optionModel)

-<option #selected($optionModel.isSelected()) 

-    value="$optionModel.Value">$optionModel.Name</option>

-#end

-

-#macro (resultsPerPageRadioSelect $resultsPerPage $showAll)

-#if (!$resultsPerPage || $resultsPerPage == 0) 

-  #set ($resultsPerPage = 25)

-#end

-#foreach ($num in [25, 50, 75, 100])

- <input type="radio" value="$num" name="resultsPerPage" #if ($resultsPerPage == $num) checked="checked" #end /> $num

-#end

-#if ($showAll.toString().equals("true"))

- <input type="radio" value="-1" name="resultsPerPage" #if ($resultsPerPage == -1) checked="checked" #end /> $l10n.All

-#end

-#end

-

-#macro (paginate $resultsPerPage $pageNum $sortColumn $sortPolarity)

- <p class="paginate">

- #if($scarabR.PrevPage != 0)

-  #set ($prevLink = $link.setPathInfo("resultsperpage", "$resultsPerPage").setPathInfo("pageNum", "$scarabR.PrevPage").setPathInfo("sortColumn", "$sortColumn").setPathInfo("sortPolarity", "$sortPolarity").setPage($scarabR.getCurrentTemplate()))

-  <a href="$prevLink">$l10n.PaginatePrevious</a> |

- #end

- $pageNum of $scarabR.NbrPages

- #if ($scarabR.NextPage != 0)

-  #set ($nextLink = $link.setPathInfo("resultsperpage", "$resultsPerPage").setPathInfo("pageNum", "$scarabR.NextPage").setPathInfo("sortColumn", "$sortColumn").setPathInfo("sortPolarity", "$sortPolarity").setPage($scarabR.getCurrentTemplate()))

-  | <a href="$nextLink">$l10n.PaginateNext</a>

- #end

- </p>

-#end

-

-## Writes the pagination links for an issue list: "<< Pervious | n of N | Next >>"

-#macro (paginateIssueList $resultsPerPage $pageNum $sortColumn $sortPolarity $searchType)

- #if (!$sortColumn)

-   #set ($sortColumn='null')

- #end

+#macro (indexedRowsWithStyle $count $style)
+ #if ($count % 2 > 0)
+    <tr class="a" style=$style">
+ #else
+    <tr class="b" style="$style">
+ #end
+#end
+
+#macro (indexedRows2 $count)
+ #if ($count % 2 > 0)
+    <tr class="b">
+ #else
+    <tr class="a">
+ #end
+#end
+
+#macro (rows)
+ #indexedRows($velocityCount)
+#end
+
+
+#macro (datatitle $title)
+<h3>$title</h3>
+#end
+
+#macro (selected $boolean)
+#if ($boolean) selected="selected"#end
+#end
+
+#macro (checked $boolean)
+#if ($boolean) checked="checked"#end
+#end
+
+
+#macro (option $optionModel)
+<option #selected($optionModel.isSelected()) 
+    value="$optionModel.Value">$optionModel.Name</option>
+#end
+
+#macro (resultsPerPageRadioSelect $resultsPerPage $showAll)
+#if (!$resultsPerPage || $resultsPerPage == 0) 
+  #set ($resultsPerPage = 25)
+#end
+#foreach ($num in [25, 50, 75, 100])
+ <input type="radio" value="$num" name="resultsPerPage" #if ($resultsPerPage == $num) checked="checked" #end /> $num
+#end
+#if ($showAll.toString().equals("true"))
+ <input type="radio" value="-1" name="resultsPerPage" #if ($resultsPerPage == -1) checked="checked" #end /> $l10n.All
+#end
+#end
+
+#macro (paginate $resultsPerPage $pageNum $sortColumn $sortPolarity)
+ <p class="paginate">
+ #if($scarabR.PrevPage != 0)
+  #set ($prevLink = $link.setPathInfo("resultsperpage", "$resultsPerPage").setPathInfo("pageNum", "$scarabR.PrevPage").setPathInfo("sortColumn", "$sortColumn").setPathInfo("sortPolarity", "$sortPolarity").setPage($scarabR.getCurrentTemplate()))
+  <a href="$prevLink">$l10n.PaginatePrevious</a> |
+ #end
+ $pageNum of $scarabR.NbrPages
+ #if ($scarabR.NextPage != 0)
+  #set ($nextLink = $link.setPathInfo("resultsperpage", "$resultsPerPage").setPathInfo("pageNum", "$scarabR.NextPage").setPathInfo("sortColumn", "$sortColumn").setPathInfo("sortPolarity", "$sortPolarity").setPage($scarabR.getCurrentTemplate()))
+  | <a href="$nextLink">$l10n.PaginateNext</a>
+ #end
+ </p>
+#end
+
+## Writes the pagination links for an issue list: "<< Pervious | n of N | Next >>"
+#macro (paginateIssueList $resultsPerPage $pageNum $sortColumn $sortPolarity $searchType)
+ #if (!$sortColumn)
+   #set ($sortColumn='null')
+ #end
  <span class="paginate">
- #if($scarabR.PrevPage != 0)

-  #set ($prevLink = $link.setPathInfo("resultsperpage", "$resultsPerPage").setPathInfo("pageNum", "$scarabR.PrevPage").setPathInfo("sortColumn", "$sortColumn").setPathInfo("sortPolarity", "$sortPolarity").setPathInfo("searchType", "$searchType").setPage($scarabR.getCurrentTemplate()))

+ #if($scarabR.PrevPage != 0)
+  #set ($prevLink = $link.setPathInfo("resultsperpage", "$resultsPerPage").setPathInfo("pageNum", "$scarabR.PrevPage").setPathInfo("sortColumn", "$sortColumn").setPathInfo("sortPolarity", "$sortPolarity").setPathInfo("searchType", "$searchType").setPage($scarabR.getCurrentTemplate()))
   <a href="$prevLink" title="$l10n.PaginatePrevious" class="previous_element" ></a> |
- #end

- $pageNum of $scarabR.NbrPages

- #if ($scarabR.NextPage != 0)

-  #set ($nextLink = $link.setPathInfo("resultsperpage", "$resultsPerPage").setPathInfo("pageNum", "$scarabR.NextPage").setPathInfo("sortColumn", "$sortColumn").setPathInfo("sortPolarity", "$sortPolarity").setPathInfo("searchType", "$searchType").setPage($scarabR.getCurrentTemplate()))

+ #end
+ $pageNum of $scarabR.NbrPages
+ #if ($scarabR.NextPage != 0)
+  #set ($nextLink = $link.setPathInfo("resultsperpage", "$resultsPerPage").setPathInfo("pageNum", "$scarabR.NextPage").setPathInfo("sortColumn", "$sortColumn").setPathInfo("sortPolarity", "$sortPolarity").setPathInfo("searchType", "$searchType").setPage($scarabR.getCurrentTemplate()))
   | <a href="$nextLink" title="$l10n.PaginateNext" class="next_element"></a>
  #end
  </span>
@@ -677,271 +695,271 @@
  $pageNum of $scarabR.NbrPages
  #if ($scarabR.NextPage != 0)
   #set ($nextLink = $link.setPathInfo("resultsperpage", "$resultsPerPage").setPathInfo("pageNum", "$scarabR.NextPage").setPathInfo("sortColumn", "$sortColumn").setPathInfo("sortPolarity", "$sortPolarity").setPathInfo("searchType", "$searchType").setPathInfo("view","$view").setPage($scarabR.getCurrentTemplate()))
-  | <a href="$nextLink">$l10n.PaginateNext</a>

- #end

- </span>

-#end

-

-#macro (paginateWithSearch $resultsPerPage $pageNum $sortColumn $sortPolarity $searchString $searchField $parameters)

-#set ($cancelTemplate = $data.Parameters.getString("$scarabG.Constant.CANCEL_TEMPLATE", "ViewIssue.vm"))

- <p class="paginate">

- #if($scarabR.PrevPage != 0)

-  #set ($prevLink = $link.setPathInfo("resultsperpage", "$resultsPerPage.toString()").addPathInfo("pageNum", "$scarabR.PrevPage").addPathInfo("sortColumn", "$sortColumn").addPathInfo("sortPolarity", "$sortPolarity").setPage($scarabR.getCurrentTemplate()).addPathInfo("searchString", $searchString).addPathInfo("searchField", $searchField).addPathInfo($scarabG.Constant.CANCEL_TEMPLATE, $cancelTemplate))

- #foreach ($parameter in $parameters)

-   #set ($paramKey = $parameter.get(0))

-   #if ($paramKey.length() > 0)

-       #set ($dummy = $prevLink.addPathInfo($paramKey, $parameter.get(1)))

-   #end

- #end

-  <a href="$prevLink">$l10n.PaginatePrevious</a> |

- #end

- $pageNum of $scarabR.NbrPages

- #if ($scarabR.NextPage != 0)

-  #set ($nextLink = $link.setPathInfo("resultsperpage", "$resultsPerPage.toString()").addPathInfo("pageNum", "$scarabR.NextPage").addPathInfo("sortColumn", "$sortColumn").addPathInfo("sortPolarity", "$sortPolarity").setPage($scarabR.getCurrentTemplate()).addPathInfo("searchString", $searchString).addPathInfo("searchField", $searchField).addPathInfo($scarabG.Constant.CANCEL_TEMPLATE, $cancelTemplate))

- 

- #foreach ($parameter in $parameters)

-   #set ($paramKey = $parameter.get(0))

-   #if ($paramKey.length() > 0)

-     #set ($dummy = $nextLink.addPathInfo($paramKey, $parameter.get(1)))

-   #end

- #end

-  | <a href="$nextLink">$l10n.PaginateNext</a>

- #end

- </p>

-#end

-

-## ---------------------------------------------------------------------------

-## Issue listing and reporting related macros

-## ---------------------------------------------------------------------------

-

-#macro (navigate)

- #if ($scarabR.isIssuePartOfList())

-   <p class="paginate">

-  #set ($prevIssue=$scarabR.PrevIssue)

-  #if($prevIssue)

-   #set ($prevLink = $link.setPathInfo("id", "$prevIssue").setPage($scarabR.getCurrentTemplate()).addPathInfo("posInList", $scarabR.PrevIssuePosInList))

-   <a href="$prevLink">$l10n.PaginatePrevious</a> |

-  #end

-  $scarabR.IssuePosInList of $scarabR.CurrentSearchResultsSize

-  #set ($nextIssue=$scarabR.NextIssue)

-  #if ($nextIssue)

-   #set ($nextLink = $link.setPathInfo("id", "$nextIssue").setPage($scarabR.getCurrentTemplate()).addPathInfo("posInList", $scarabR.NextIssuePosInList))

-    | <a href="$nextLink">$l10n.PaginateNext</a>

-  #end

-  </p>

- #end

-#end

-

-#macro (processQueryResults $action $listSize)

-<select name="next"

-        onchange="javascript:submitFormTo(this.form, '$action');">

-<option value="" selected="selected">$l10n.ProcessResults:</option>

-#set ($module = $scarabR.CurrentModule)

-#if ($user.hasPermission($scarabG.Permission.ISSUE__VIEW, $module))

-  #if ($listSize <= $scarabG.Constant.ISSUE_MAX_VIEW)

-    <option value="viewAll">$l10n.ViewAll</option>

-  #end

-    <option value="viewSelected">$l10n.ViewSelected</option>

-#end

-#if ($user.hasPermission($scarabG.Permission.ISSUE__ASSIGN, $module))

-  #if ($listSize <= $scarabG.Constant.ISSUE_MAX_ASSIGN)

-    <option value="assignAll">$l10n.AssignAll</option>

-  #end

-    <option value="assignSelected">$l10n.AssignSelected</option>

-#end

-#if ($user.hasPermission($scarabG.Permission.ISSUE__ENTER, $module))

-  #if ($listSize <= $scarabG.Constant.ISSUE_MAX_COPY)

-    <option value="copyAll">$l10n.CopyAll</option>

-  #end

-    <option value="copySelected">$l10n.CopySelected</option>

-#end

-#if ($user.hasPermission($scarabG.Permission.ISSUE__MOVE, $module))

-  #if ($listSize <= $scarabG.Constant.ISSUE_MAX_MOVE)

-    <option value="moveAll">$l10n.MoveAll</option>

-  #end

-    <option value="moveSelected">$l10n.MoveSelected</option>

-#end

-</select>

-<noscript>

-<input type="submit" name="$action" value="$l10n.Go" />

-</noscript>

-#end

-

-#macro (exportFormats $action)

-<select name="format"

-        onchange="javascript:submitFormTo(this.form, '$action');">

-<option value="" selected="selected">$l10n.ExportResultsTo</option>

-<option value="excel">$l10n.Excel</option>

-<option value="tsv">$l10n.TabSeparatedValues</option>

-##<option value="xml">XML</option>

-</select>

-<noscript>

-<input type="submit" name="$action" value="$l10n.Go" />

-</noscript>

-#end

-

-#* -------------------------------------------------------------------------

-$paramName - The name to use for the form field.

-

-$format - The current value for the form field which indicates

-selected the radio button.

-------------------------------------------------------------------------- *#

-#macro (exportFormatsRow $paramName $format)

-<tr>

-<th>$l10n.Format</th>

-<td>

- <input type="radio" name="$paramName" value=""

- #if ($!format == '')checked="checked"#end />$l10n.Web

- <input type="radio" name="$paramName" value="excel"

- #if ($format.equalsIgnoreCase('excel'))checked="checked"#end />$l10n.Excel

- <input type="radio" name="$paramName" value="tsv"

- #if ($format.equalsIgnoreCase('tsv'))checked="checked"#end

- />$l10n.TabSeparatedValues

- #* <input type="radio" name="$paramName" value="xml"

- #if ($format.equalsIgnoreCase('xml'))checked="checked"#end />XML *#

-</td>

-</tr>

-#end

-

-#set ($autoresize = $scarabG.getTurbineConfiguration().getString("scarab.dhtml.autoresize_textarea").toLowerCase().equals("true"))

-

-#macro (textAreaSmall $key $value)

- <textarea class="fullWidth" rows="2" wrap="virtual" name="$key">#if ($value)$value#end</textarea>

-#end

-

-#macro (textAreaMedium $key $value)

- <textarea class="fullWidth" #if($autoresize) onblur="outTextArea(this)" onfocus="onTextArea(this)" #else rows="10" #end wrap="virtual" name="$key">#if ($value)$value#end</textarea>

-#end

-

-#macro (textAreaLarge $key $value)

- <textarea class="fullWidth" #if($autoresize) onblur="outTextArea(this)" onfocus="onTextArea(this)"  #else rows="10" #end wrap="virtual" name="$key">#if ($value)$value#end</textarea>

-#end

-

-#macro (attributeCreatedBy $attribute)

-## FIXME: getUser() takes an Object param, not an int (the return type

-## of getCreatedBy()).  Post Beta milestone,

-## SCARAB_ATTRIBUTE.CREATED_BY needs to have its FK reference to

-## TURBINE_USER.USER_ID defined.

-#set ($creatorID = "0")

-#set ($creatorID = $attribute.CreatedBy)

-#if ($creatorID == "0")

-    Default

-#else

-  #set ($createdUser = $scarabR.getUser($attribute.CreatedBy))

-  <a href="mailTo:$createdUser.Email">$!createdUser.Name</a>

-#end

-#end

-

-#macro (userSort $shortName $longName $linkPage $parameters)

-  #if (!$resultsPerPage) #set ($resultsPerPage = 25) #end

-  #if ($sortColumn.equals($shortName))

-    #if ($sortPolarity.equals("desc"))

-      #set ($arrowLink = $link.setPage($linkPage).setPathInfo("sortColumn", "$shortName").setPathInfo("pageNum",$pageNum.toString()).setPathInfo("resultsPerPage", $resultsPerPage.toString()).setPathInfo("sortPolarity", "asc").setPathInfo("searchString", $searchString).setPathInfo("searchField", $searchField))

-      #foreach ($parameter in $parameters)

-        #set ($paramKey = $parameter.get(0))

-        #if ($paramKey.length() > 0)

-          #set ($dummy = $arrowLink.setPathInfo($paramKey, $parameter.get(1)))

-        #end

-      #end

-      <a href="$arrowLink"><img src="$staticLink.setPath("/images/icon_downarrow_on.gif")" width="13" height="8" alt="sort descending" title="sort descending" border="0" /></a>&#160;

-    #else

-      #set ($arrowLink = $link.setPage($linkPage).setPathInfo("sortPolarity", "desc").setPathInfo("sortColumn", "$shortName").setPathInfo("pageNum", $pageNum.toString()).setPathInfo("resultsPerPage", $resultsPerPage.toString()).setPathInfo("searchString", $searchString).setPathInfo("searchField", $searchField))

-      #foreach ($parameter in $parameters)

-        #set ($paramKey = $parameter.get(0))

-        #if ($paramKey.length() > 0)

-          #set ($dummy = $arrowLink.setPathInfo($paramKey, $parameter.get(1)))

-        #end

-      #end

-      <a href="$arrowLink"><img src="$staticLink.setPath("/images/icon_uparrow_on.gif")" width="13" height="8" alt="sort ascending" title="sort ascending" border="0" /></a>&#160;

-    #end $longName

-  #else

-    #set ($sortLink = $link.setPage($linkPage).setPathInfo("sortColumn", "$shortName").setPathInfo("sortPolarity", "$sortPolarity").setPathInfo("pageNum", $pageNum.toString()).setPathInfo("resultsPerPage", $resultsPerPage.toString()).setPathInfo("searchString", $searchString).setPathInfo("searchField", $searchField))

-    #foreach ($parameter in $parameters)

-        #set ($paramKey = $parameter.get(0))

-        #if ($paramKey.length() > 0)

-          #set ($dummy = $sortLink.setPathInfo($paramKey, $parameter.get(1)))

-        #end

-    #end

-    <a href="$sortLink">$longName</a>

-  #end

-#end

-

-#macro (sort $shortName $longName)

-#if (!$resultsPerPage) #set ($resultsPerPage = 25) #end

-     #if ($sortColumn.equals($shortName))

-        #if ($sortPolarity.equals("desc"))

-           #set ($arrowLink = $link.setPage("$scarabR.CurrentTemplate").setPathInfo("sortPolarity", "asc").setPathInfo("sortColumn", "$shortName").setPathInfo("pageNum",$pageNum.toString()).setPathInfo("resultsPerPage", $resultsPerPage.toString()))

-           <a href="$arrowLink"><img src="$staticLink.setPath("/images/icon_downarrow_on.gif")" width="13" height="8" alt="sort descending" title="sort descending" border="0" /></a>&#160;

-        #else

-           #set ($arrowLink = $link.setPage("$scarabR.CurrentTemplate").setPathInfo("sortPolarity", "desc").setPathInfo("sortColumn", "$shortName").setPathInfo("pageNum", $pageNum.toString()).setPathInfo("resultsPerPage", $resultsPerPage.toString()))

-           <a href="$arrowLink"><img src="$staticLink.setPath("/images/icon_uparrow_on.gif")" width="13" height="8" alt="sort ascending" title="sort ascending" border="0" /></a>&#160;

-        #end $longName

-     #else

-        #set ($sortLink = $link.setPage("$scarabR.CurrentTemplate").setPathInfo("sortColumn", "$shortName").setPathInfo("sortPolarity", "$sortPolarity").setPathInfo("pageNum", $pageNum.toString()).setPathInfo("resultsPerPage", $resultsPerPage.toString()))

-        <a href="$sortLink">$longName</a>

-     #end

-#end

-

-#macro (sortWithSearch $shortName $longName $searchString $searchField)

-#if (!$resultsPerPage) #set ($resultsPerPage = 25) #end

-     #if ($sortColumn.equals($shortName))

-        #if ($sortPolarity.equals("desc"))

-           #set ($arrowLink = $link.setPage("$scarabR.CurrentTemplate").setPathInfo("sortPolarity", "asc").setPathInfo("sortColumn", "$shortName").setPathInfo("pageNum",$pageNum.toString()).setPathInfo("resultsPerPage", $resultsPerPage.toString()).setPathInfo("searchString", $searchString).setPathInfo("searchfield", $searchField))

-           <a href="$arrowLink"><img src="$staticLink.setPath("/images/icon_downarrow_on.gif")" width="13" height="8" alt="sort descending" title="sort descending" border="0" /></a>&#160;

-        #else

-           #set ($arrowLink = $link.setPage("$scarabR.CurrentTemplate").setPathInfo("sortPolarity", "desc").setPathInfo("sortColumn", "$shortName").setPathInfo("pageNum", $pageNum.toString()).setPathInfo("resultsPerPage", $resultsPerPage.toString()).setPathInfo("searchString", $searchString).setPathInfo("searchfield", $searchField))

-           <a href="$arrowLink"><img src="$staticLink.setPath("/images/icon_uparrow_on.gif")" width="13" height="8" alt="sort ascending" title="sort ascending" border="0" /></a>&#160;

-        #end $longName

-     #else

-        #set ($sortLink = $link.setPage("$scarabR.CurrentTemplate").setPathInfo("sortColumn", "$shortName").setPathInfo("sortPolarity", "$sortPolarity").setPathInfo("pageNum", $pageNum.toString()).setPathInfo("resultsPerPage", $resultsPerPage.toString()).setPathInfo("searchString", $searchString).setPathInfo("searchfield", $searchField))

-        <a href="$sortLink">$longName</a>

-     #end

-#end

-

-#**

- * Outputs information about issues that have been modified prior to

- * the latest suggested changes.  Expects $lastActivities to exist in the

- * context as given by the BaseModifyIssue action. 

- *#

-#macro (printCollisionInfo)

-#if ($lastActivities && !$lastActivities.isEmpty())

-  <p class="infomark"><em>

-  $l10n.LastActivity

-  </em></p>

-  #foreach ($obj in $lastActivities)

-    #set ($issue = $obj.get(0))

-    #set ($activitySet = $obj.get(1))

-    #set ($user = $scarabR.getUser($activitySet.CreatedBy))

-    <p>$l10n.format('IssueLastModifiedBy', "$issue.UniqueId")

-      <a href="mailto:$user.Email">$!user.Name</a> </p>

-    <ul>

-    #foreach ($activity in $activitySet.Activitys)

-      <li>$activity.getDescription($l10n)</li>

-    #end

-    </ul>

-  #end

-#end

-#end

-

-#macro (asterisk)

-<small>(</small><b class="asterisk">*</b> <small>$l10n.RequiredFields)</small>

-#end

-

-

-## ==============================================================================

-## [HD]Create a marker for required fields.

-## For conditioned fields the required attribute may vary dynamically.

-## Hence this method needs a way to determine the actual state.

-## Note: This method creates invisible markup when the rma is not required.

-## And it creates css ids along with the element. This will later be used

-## from javascript in order to dynamically enable/disable the "requiredMarker"

-## when the user selects options which cause an attribute to become required

-## ==============================================================================

+  | <a href="$nextLink">$l10n.PaginateNext</a>
+ #end
+ </span>
+#end
+
+#macro (paginateWithSearch $resultsPerPage $pageNum $sortColumn $sortPolarity $searchString $searchField $parameters)
+#set ($cancelTemplate = $data.Parameters.getString("$scarabG.Constant.CANCEL_TEMPLATE", "ViewIssue.vm"))
+ <p class="paginate">
+ #if($scarabR.PrevPage != 0)
+  #set ($prevLink = $link.setPathInfo("resultsperpage", "$resultsPerPage.toString()").addPathInfo("pageNum", "$scarabR.PrevPage").addPathInfo("sortColumn", "$sortColumn").addPathInfo("sortPolarity", "$sortPolarity").setPage($scarabR.getCurrentTemplate()).addPathInfo("searchString", $searchString).addPathInfo("searchField", $searchField).addPathInfo($scarabG.Constant.CANCEL_TEMPLATE, $cancelTemplate))
+ #foreach ($parameter in $parameters)
+   #set ($paramKey = $parameter.get(0))
+   #if ($paramKey.length() > 0)
+       #set ($dummy = $prevLink.addPathInfo($paramKey, $parameter.get(1)))
+   #end
+ #end
+  <a href="$prevLink">$l10n.PaginatePrevious</a> |
+ #end
+ $pageNum of $scarabR.NbrPages
+ #if ($scarabR.NextPage != 0)
+  #set ($nextLink = $link.setPathInfo("resultsperpage", "$resultsPerPage.toString()").addPathInfo("pageNum", "$scarabR.NextPage").addPathInfo("sortColumn", "$sortColumn").addPathInfo("sortPolarity", "$sortPolarity").setPage($scarabR.getCurrentTemplate()).addPathInfo("searchString", $searchString).addPathInfo("searchField", $searchField).addPathInfo($scarabG.Constant.CANCEL_TEMPLATE, $cancelTemplate))
+ 
+ #foreach ($parameter in $parameters)
+   #set ($paramKey = $parameter.get(0))
+   #if ($paramKey.length() > 0)
+     #set ($dummy = $nextLink.addPathInfo($paramKey, $parameter.get(1)))
+   #end
+ #end
+  | <a href="$nextLink">$l10n.PaginateNext</a>
+ #end
+ </p>
+#end
+
+## ---------------------------------------------------------------------------
+## Issue listing and reporting related macros
+## ---------------------------------------------------------------------------
+
+#macro (navigate)
+ #if ($scarabR.isIssuePartOfList())
+   <p class="paginate">
+  #set ($prevIssue=$scarabR.PrevIssue)
+  #if($prevIssue)
+   #set ($prevLink = $link.setPathInfo("id", "$prevIssue").setPage($scarabR.getCurrentTemplate()).addPathInfo("posInList", $scarabR.PrevIssuePosInList))
+   <a href="$prevLink">$l10n.PaginatePrevious</a> |
+  #end
+  $scarabR.IssuePosInList of $scarabR.CurrentSearchResultsSize
+  #set ($nextIssue=$scarabR.NextIssue)
+  #if ($nextIssue)
+   #set ($nextLink = $link.setPathInfo("id", "$nextIssue").setPage($scarabR.getCurrentTemplate()).addPathInfo("posInList", $scarabR.NextIssuePosInList))
+    | <a href="$nextLink">$l10n.PaginateNext</a>
+  #end
+  </p>
+ #end
+#end
+
+#macro (processQueryResults $action $listSize)
+<select name="next"
+        onchange="javascript:submitFormTo(this.form, '$action');">
+<option value="" selected="selected">$l10n.ProcessResults:</option>
+#set ($module = $scarabR.CurrentModule)
+#if ($user.hasPermission($scarabG.Permission.ISSUE__VIEW, $module))
+  #if ($listSize <= $scarabG.Constant.ISSUE_MAX_VIEW)
+    <option value="viewAll">$l10n.ViewAll</option>
+  #end
+    <option value="viewSelected">$l10n.ViewSelected</option>
+#end
+#if ($user.hasPermission($scarabG.Permission.ISSUE__ASSIGN, $module))
+  #if ($listSize <= $scarabG.Constant.ISSUE_MAX_ASSIGN)
+    <option value="assignAll">$l10n.AssignAll</option>
+  #end
+    <option value="assignSelected">$l10n.AssignSelected</option>
+#end
+#if ($user.hasPermission($scarabG.Permission.ISSUE__ENTER, $module))
+  #if ($listSize <= $scarabG.Constant.ISSUE_MAX_COPY)
+    <option value="copyAll">$l10n.CopyAll</option>
+  #end
+    <option value="copySelected">$l10n.CopySelected</option>
+#end
+#if ($user.hasPermission($scarabG.Permission.ISSUE__MOVE, $module))
+  #if ($listSize <= $scarabG.Constant.ISSUE_MAX_MOVE)
+    <option value="moveAll">$l10n.MoveAll</option>
+  #end
+    <option value="moveSelected">$l10n.MoveSelected</option>
+#end
+</select>
+<noscript>
+<input type="submit" name="$action" value="$l10n.Go" />
+</noscript>
+#end
+
+#macro (exportFormats $action)
+<select name="format"
+        onchange="javascript:submitFormTo(this.form, '$action');">
+<option value="" selected="selected">$l10n.ExportResultsTo</option>
+<option value="excel">$l10n.Excel</option>
+<option value="tsv">$l10n.TabSeparatedValues</option>
+##<option value="xml">XML</option>
+</select>
+<noscript>
+<input type="submit" name="$action" value="$l10n.Go" />
+</noscript>
+#end
+
+#* -------------------------------------------------------------------------
+$paramName - The name to use for the form field.
+
+$format - The current value for the form field which indicates
+selected the radio button.
+------------------------------------------------------------------------- *#
+#macro (exportFormatsRow $paramName $format)
+<tr>
+<th>$l10n.Format</th>
+<td>
+ <input type="radio" name="$paramName" value=""
+ #if ($!format == '')checked="checked"#end />$l10n.Web
+ <input type="radio" name="$paramName" value="excel"
+ #if ($format.equalsIgnoreCase('excel'))checked="checked"#end />$l10n.Excel
+ <input type="radio" name="$paramName" value="tsv"
+ #if ($format.equalsIgnoreCase('tsv'))checked="checked"#end
+ />$l10n.TabSeparatedValues
+ #* <input type="radio" name="$paramName" value="xml"
+ #if ($format.equalsIgnoreCase('xml'))checked="checked"#end />XML *#
+</td>
+</tr>
+#end
+
+#set ($autoresize = $scarabG.getTurbineConfiguration().getString("scarab.dhtml.autoresize_textarea").toLowerCase().equals("true"))
+
+#macro (textAreaSmall $key $value)
+ <textarea class="fullWidth" rows="2" wrap="virtual" name="$key">#if ($value)$value#end</textarea>
+#end
+
+#macro (textAreaMedium $key $value)
+ <textarea class="fullWidth" #if($autoresize) onblur="outTextArea(this)" onfocus="onTextArea(this)" #else rows="10" #end wrap="virtual" name="$key">#if ($value)$value#end</textarea>
+#end
+
+#macro (textAreaLarge $key $value)
+ <textarea class="fullWidth" #if($autoresize) onblur="outTextArea(this)" onfocus="onTextArea(this)"  #else rows="10" #end wrap="virtual" name="$key">#if ($value)$value#end</textarea>
+#end
+
+#macro (attributeCreatedBy $attribute)
+## FIXME: getUser() takes an Object param, not an int (the return type
+## of getCreatedBy()).  Post Beta milestone,
+## SCARAB_ATTRIBUTE.CREATED_BY needs to have its FK reference to
+## TURBINE_USER.USER_ID defined.
+#set ($creatorID = "0")
+#set ($creatorID = $attribute.CreatedBy)
+#if ($creatorID == "0")
+    Default
+#else
+  #set ($createdUser = $scarabR.getUser($attribute.CreatedBy))
+  <a href="mailTo:$createdUser.Email">$!createdUser.Name</a>
+#end
+#end
+
+#macro (userSort $shortName $longName $linkPage $parameters)
+  #if (!$resultsPerPage) #set ($resultsPerPage = 25) #end
+  #if ($sortColumn.equals($shortName))
+    #if ($sortPolarity.equals("desc"))
+      #set ($arrowLink = $link.setPage($linkPage).setPathInfo("sortColumn", "$shortName").setPathInfo("pageNum",$pageNum.toString()).setPathInfo("resultsPerPage", $resultsPerPage.toString()).setPathInfo("sortPolarity", "asc").setPathInfo("searchString", $searchString).setPathInfo("searchField", $searchField))
+      #foreach ($parameter in $parameters)
+        #set ($paramKey = $parameter.get(0))
+        #if ($paramKey.length() > 0)
+          #set ($dummy = $arrowLink.setPathInfo($paramKey, $parameter.get(1)))
+        #end
+      #end
+      <a href="$arrowLink"><img src="$staticLink.setPath("/images/icon_downarrow_on.gif")" width="13" height="8" alt="sort descending" title="sort descending" border="0" /></a>&#160;
+    #else
+      #set ($arrowLink = $link.setPage($linkPage).setPathInfo("sortPolarity", "desc").setPathInfo("sortColumn", "$shortName").setPathInfo("pageNum", $pageNum.toString()).setPathInfo("resultsPerPage", $resultsPerPage.toString()).setPathInfo("searchString", $searchString).setPathInfo("searchField", $searchField))
+      #foreach ($parameter in $parameters)
+        #set ($paramKey = $parameter.get(0))
+        #if ($paramKey.length() > 0)
+          #set ($dummy = $arrowLink.setPathInfo($paramKey, $parameter.get(1)))
+        #end
+      #end
+      <a href="$arrowLink"><img src="$staticLink.setPath("/images/icon_uparrow_on.gif")" width="13" height="8" alt="sort ascending" title="sort ascending" border="0" /></a>&#160;
+    #end $longName
+  #else
+    #set ($sortLink = $link.setPage($linkPage).setPathInfo("sortColumn", "$shortName").setPathInfo("sortPolarity", "$sortPolarity").setPathInfo("pageNum", $pageNum.toString()).setPathInfo("resultsPerPage", $resultsPerPage.toString()).setPathInfo("searchString", $searchString).setPathInfo("searchField", $searchField))
+    #foreach ($parameter in $parameters)
+        #set ($paramKey = $parameter.get(0))
+        #if ($paramKey.length() > 0)
+          #set ($dummy = $sortLink.setPathInfo($paramKey, $parameter.get(1)))
+        #end
+    #end
+    <a href="$sortLink">$longName</a>
+  #end
+#end
+
+#macro (sort $shortName $longName)
+#if (!$resultsPerPage) #set ($resultsPerPage = 25) #end
+     #if ($sortColumn.equals($shortName))
+        #if ($sortPolarity.equals("desc"))
+           #set ($arrowLink = $link.setPage("$scarabR.CurrentTemplate").setPathInfo("sortPolarity", "asc").setPathInfo("sortColumn", "$shortName").setPathInfo("pageNum",$pageNum.toString()).setPathInfo("resultsPerPage", $resultsPerPage.toString()))
+           <a href="$arrowLink"><img src="$staticLink.setPath("/images/icon_downarrow_on.gif")" width="13" height="8" alt="sort descending" title="sort descending" border="0" /></a>&#160;
+        #else
+           #set ($arrowLink = $link.setPage("$scarabR.CurrentTemplate").setPathInfo("sortPolarity", "desc").setPathInfo("sortColumn", "$shortName").setPathInfo("pageNum", $pageNum.toString()).setPathInfo("resultsPerPage", $resultsPerPage.toString()))
+           <a href="$arrowLink"><img src="$staticLink.setPath("/images/icon_uparrow_on.gif")" width="13" height="8" alt="sort ascending" title="sort ascending" border="0" /></a>&#160;
+        #end $longName
+     #else
+        #set ($sortLink = $link.setPage("$scarabR.CurrentTemplate").setPathInfo("sortColumn", "$shortName").setPathInfo("sortPolarity", "$sortPolarity").setPathInfo("pageNum", $pageNum.toString()).setPathInfo("resultsPerPage", $resultsPerPage.toString()))
+        <a href="$sortLink">$longName</a>
+     #end
+#end
+
+#macro (sortWithSearch $shortName $longName $searchString $searchField)
+#if (!$resultsPerPage) #set ($resultsPerPage = 25) #end
+     #if ($sortColumn.equals($shortName))
+        #if ($sortPolarity.equals("desc"))
+           #set ($arrowLink = $link.setPage("$scarabR.CurrentTemplate").setPathInfo("sortPolarity", "asc").setPathInfo("sortColumn", "$shortName").setPathInfo("pageNum",$pageNum.toString()).setPathInfo("resultsPerPage", $resultsPerPage.toString()).setPathInfo("searchString", $searchString).setPathInfo("searchfield", $searchField))
+           <a href="$arrowLink"><img src="$staticLink.setPath("/images/icon_downarrow_on.gif")" width="13" height="8" alt="sort descending" title="sort descending" border="0" /></a>&#160;
+        #else
+           #set ($arrowLink = $link.setPage("$scarabR.CurrentTemplate").setPathInfo("sortPolarity", "desc").setPathInfo("sortColumn", "$shortName").setPathInfo("pageNum", $pageNum.toString()).setPathInfo("resultsPerPage", $resultsPerPage.toString()).setPathInfo("searchString", $searchString).setPathInfo("searchfield", $searchField))
+           <a href="$arrowLink"><img src="$staticLink.setPath("/images/icon_uparrow_on.gif")" width="13" height="8" alt="sort ascending" title="sort ascending" border="0" /></a>&#160;
+        #end $longName
+     #else
+        #set ($sortLink = $link.setPage("$scarabR.CurrentTemplate").setPathInfo("sortColumn", "$shortName").setPathInfo("sortPolarity", "$sortPolarity").setPathInfo("pageNum", $pageNum.toString()).setPathInfo("resultsPerPage", $resultsPerPage.toString()).setPathInfo("searchString", $searchString).setPathInfo("searchfield", $searchField))
+        <a href="$sortLink">$longName</a>
+     #end
+#end
+
+#**
+ * Outputs information about issues that have been modified prior to
+ * the latest suggested changes.  Expects $lastActivities to exist in the
+ * context as given by the BaseModifyIssue action. 
+ *#
+#macro (printCollisionInfo)
+#if ($lastActivities && !$lastActivities.isEmpty())
+  <p class="infomark"><em>
+  $l10n.LastActivity
+  </em></p>
+  #foreach ($obj in $lastActivities)
+    #set ($issue = $obj.get(0))
+    #set ($activitySet = $obj.get(1))
+    #set ($user = $scarabR.getUser($activitySet.CreatedBy))
+    <p>$l10n.format('IssueLastModifiedBy', "$issue.UniqueId")
+      <a href="mailto:$user.Email">$!user.Name</a> </p>
+    <ul>
+    #foreach ($activity in $activitySet.Activitys)
+      <li>$activity.getDescription($l10n)</li>
+    #end
+    </ul>
+  #end
+#end
+#end
+
+#macro (asterisk)
+<small>(</small><b class="asterisk">*</b> <small>$l10n.RequiredFields)</small>
+#end
+
+
+## ==============================================================================
+## [HD]Create a marker for required fields.
+## For conditioned fields the required attribute may vary dynamically.
+## Hence this method needs a way to determine the actual state.
+## Note: This method creates invisible markup when the rma is not required.
+## And it creates css ids along with the element. This will later be used
+## from javascript in order to dynamically enable/disable the "requiredMarker"
+## when the user selects options which cause an attribute to become required
+## ==============================================================================
 #macro (drawRequiredMarkupAsNeeded $user $issue $attribute)
-

-  ## Here we take care about the conditionally required attribute 

-  ## AND the static required attributes:

-

+
+  ## Here we take care about the conditionally required attribute 
+  ## AND the static required attributes:
+
   #set ($rma        = $module.getRModuleAttribute($attribute, $issue.IssueType) )
   #set ($isRequired = $rma.Required )
   #if ($isRequired)
@@ -949,291 +967,291 @@
   #elseif ($rma.Conditions.size() > 0)
   #set ($isRequired = $issue.isRequiredAttributeFor($attribute, $user))
     #set ($visibility = "none")
-  #if  ($isRequired)

+  #if  ($isRequired)
       #set ($visibility = "inline")
-  #end

+  #end
     <b class="asterisk" id="conditional:${rma.DisplayValue}" style="display:$visibility;">*</b>
   #else
     ## atribute is neither required nor has it conditional attributres. Nothing TODO
-#end

-#end

+#end
+#end
+
+
+
+#macro (showAsterisk)
+<b class="asterisk">*</b>
+#end
+
+
+#macro (userList $mitList $includeAny $includeCommittedBy $parameters $activeOnly)
+#set ($userAttrs = $mitList.getCommonUserAttributes($activeOnly))
+#set ($modules = $mitList.Modules)
+
+
+## SORTING
+#set ($sortColumn = $data.Parameters.getString("sortColumn","username"))
+#set ($sortPolarity = $data.Parameters.getString("sortPolarity","asc"))
+
+## PAGINATION
+## if results exceed limit, get subset list
+#set ($resultsPerPage = $data.Parameters.getInt("resultsPerPage", 25))
+#set ($pageNum = $data.Parameters.getInt("pageNum", 1))
+
+## USER SEARCH
+<h3><a name="add">$l10n.Users</a></h3> 
+<div class="axial">
+
+<table border="0" cellspacing="2" cellpadding="3">
+  <tr>
+   <th>$l10n.FilterThisList</th>
+   <td><input type="text" name="searchString" value="$!searchString" />&nbsp;
+     <select name="searchField">
+      <option value="FullName" #if($searchField.equals("FullName")) selected="selected"#end>$l10n.FullName</option>
+      <option value="Username" #if($searchField.equals("Username")) selected="selected"#end>$l10n.Username</option>
+     </select>&nbsp;<input type="submit" name="eventSubmit_doRefresh" value="$l10n.Filter" /></td>
+  </tr>
+</table>
+</div>
+
+#if ($searchString && $searchString.length() > 0)
+    #set ($searchResults = $scarabR.getUserFilteredSearchResults($mitList, $pageNum, $resultsPerPage, $sortColumn, $sortPolarity, $includeCommittedBy))
+    #if ( $searchResults.getList().isEmpty())
+        <p class="infomark"><em>$l10n.NoUsersMatch</em></p>
+        #set ($searchResults = $scarabR.getUserSearchResults($mitList, $pageNum, $resultsPerPage, $sortColumn, $sortPolarity, $includeCommittedBy))
+    #end
+#else
+    #set ($searchResults = $scarabR.getUserSearchResults($mitList, $pageNum, $resultsPerPage, $sortColumn, $sortPolarity, $includeCommittedBy))
+#end 
+
+#set ($searchResultsSize = $searchResults.getTotalListSize())
+#set ($searchResultsList = $searchResults.getList())
+
+#set ($paginated = ($resultsPerPage > 0 && $searchResultsSize > $resultsPerPage))
+#if ($paginated)
+  #paginateWithSearch ($resultsPerPage $pageNum $sortColumn $sortPolarity $searchString $searchField $parameters)
+#end
+
+#if (!$searchResultsList || $searchResultsList.isEmpty()) 
+  <p><em>$l10n.NoUsersAvailable</em></p>
+#else
+
+  <table width="100%" border="1" cellspacing="2" cellpadding="3">
+   <tr>
+    <th nowrap="nowrap">$l10n.Select</th>
+  #set ($linkPage = $scarabG.replace($data.Target, '/', ','))
+
+    <th>#userSort ("username" "$l10n.Username" $linkPage $parameters)</th>
+    <th>#userSort ("name" "$l10n.FullName" $linkPage $parameters)</th>
+    <th>$l10n.Association</th>
+   </tr>
+   #foreach ($user in $searchResultsList)
+    #indexedRows($velocityCount)
+    <td><input type="checkbox" name="add_user" value="$user.UserId" /></td>
+    <td><a href="mailTo:$user.Email">$user.UserName</a></td>
+    <td>$user.Name</td>
+    <td><select name="user_attr_$user.UserId">
+    #if ($includeAny)
+       <option value="any">$l10n.Any</option>
+    #end
+    #if ($includeCommittedBy && $user.hasPermission($scarabG.Permission.ISSUE__ENTER, $modules))
+       <option value="created_by">$l10n.CreatedBy</option>
+    #end
+     #foreach ($userAttr in $userAttrs)
+      #if ($user.hasPermission($userAttr.Permission, $modules))
+       #set($userAttrName = $scarabR.getRModuleAttributeDisplayName($userAttr,$mitList))
+       <option value="$userAttr.AttributeId">$userAttrName</option>
+      #end
+     #end
+    </select></td>
+    </tr>
+  #end
+   </table>
+
+#if ($paginated)
+  #paginateWithSearch ($resultsPerPage $pageNum $sortColumn $sortPolarity $searchString $searchField $parameters)
+#end
+
+<div class="axial">
+  <table cellpadding="3" cellspacing="2" border="0">
+     <tr>
+       <th>$l10n.MaxPerPage</th>
+       <td>
+           #resultsPerPageRadioSelect($resultsPerPage false)
+           &#160;<input type="submit"  name="eventSubmit_doRefreshresultsperpage" value="$l10n.Refresh" />
+           <input type="hidden" name="oldResultsPerPage" value="$resultsPerPage" />
+       </td>
+     </tr>
+  </table>
+</div>
+
+## keep track of state of the list, resultsPerPage should come after the
+## chance to change it, because we will use the first value
+<input type="hidden" name="sortColumn" value="$sortColumn" />
+<input type="hidden" name="sortPolarity" value="$sortPolarity" />
+<input type="hidden" name="pageNum" value="$pageNum" />
+<input type="hidden" name="resultsPerPage" value="$resultsPerPage" />
+
+##end ## ends the if (!$searchResultsList || $searchResultsList.isEmpty()) statement
+#end ## ends the if (!$userAttrs || $userAttrs.isEmpty()) statement
+#end
+
 
+## ---------------------------------------------------------------------------
+## Date related macros
+## ---------------------------------------------------------------------------
+
+#macro(selectDay $defaultDay)
+ #foreach ($i in [1..31])
+  <option value="$i"#if("$defaultDay" == "$i") selected="selected"#end>$i</option>
+ #end
+#end
+
+#macro(selectHour $defaultHour)
+ #foreach ($i in [0..23])
+  <option value="$i"#if("$defaultHour" == "$i") selected="selected"#end>$i:00</option>
+ #end
+#end
+
+#macro(printMonth $i $name $defaultMonth)
+ <option value="$i"#if( $defaultMonth == $i ) selected="selected"#end>$name</option>
+#end
+
+#macro(selectMonth $defaultMonth) 
+ #printMonth(1 $l10n.January $defaultMonth)
+ #printMonth(2 $l10n.February $defaultMonth)
+ #printMonth(3 $l10n.March $defaultMonth)
+ #printMonth(4 $l10n.April $defaultMonth)
+ #printMonth(5 $l10n.May $defaultMonth)
+ #printMonth(6 $l10n.June $defaultMonth)
+ #printMonth(7 $l10n.July $defaultMonth)
+ #printMonth(8 $l10n.August $defaultMonth)
+ #printMonth(9 $l10n.September $defaultMonth)
+ #printMonth(10 $l10n.October $defaultMonth)
+ #printMonth(11 $l10n.November $defaultMonth)
+ #printMonth(12 $l10n.December $defaultMonth)
+#end
+
+#macro(selectYear $currentYear $selectedYear)
+ #set ($minYear = $selectedYear - 4)
+ #set ($maxYear = $selectedYear + 4)
+ #selectYear2($minYear $maxYear $selectedYear)
+#end
+
+#macro(selectYear2 $minYear $maxYear $selectedYear)
+ #foreach ($year in [$minYear..$maxYear])
+   <option value="$year"
+     #if("$selectedYear" == "$year")selected="selected"#end
+   >$year</option>
+ #end
+#end
+
+#* -------------------------------------------------------------------------
+Prints out a date entry form.
+------------------------------------------------------------------------- *#
+#macro(dateEntry $yearField $currentYear $selectedYear $monthField $selectedMonth $dayField $selectedDay $hourField $selectedHour)
+ <input name="$yearField" value="$selectedYear"></input> $l10n.YearMark
+ &nbsp;
+ <select name="$monthField">
+  #selectMonth($selectedMonth)
+ </select> $l10n.MonthMark
+ &nbsp;
+ <select name="$dayField">
+  #selectDay($selectedDay)
+ </select> $l10n.DayMark
+ &nbsp;-&nbsp;
+ <select name="$hourField">
+  #selectHour($selectedHour)
+ </select> $l10n.TimeMark
+#end
+
+## ---------------------------------------------------------------------------
+
+
+
+#macro(entryTemplateAndAttributes $issue $moduleAttributeGroups $buttonName $buttonEvent $showTemplates)
+#set ($module = $issue.Module)
+#set ($issueType = $issue.IssueType)
+
+#if ($moduleAttributeGroups.isEmpty())
+<h3>$title</h3>
+<p><em>$l10n.format('NoAttributesDefinedForIssueType',$issueType.getName())</em></p>
+#else
+
+#if ($showTemplates)
+#set ($allTemplates = $scarabR.getAllIssueTemplates($issueType))
+#if ($allTemplates.size() > 0)
+<h3>$l10n.format("ApplyTemplate", $module.getRModuleIssueType($issueType).DisplayName.toLowerCase())</h3>
+<div class="axial">
+ <table cellpadding="3" cellspacing="2" border="0">
+ <tr>
+ <th>$l10n.Templates</th>
+ <td>
+<select name="templateId"
+  onchange="javascript:submitFormTo(this.form, 'eventSubmit_doUsetemplates');">
+   <option value="">$l10n.Choose</option>
+#foreach ($template in $allTemplates)
+   <option value="$template.Issue.IssueId"#if ($template.IssueId.toString().equals($data.Parameters.getString("templateId"))) selected="selected"#end>$template.Name</option>
+#end
+</select>
+<noscript>
+&#160;
+<input type="submit" value="$l10n.Select" name="eventSubmit_doUsetemplates" />
+</noscript>
+&#160;
+$link.setPage("TemplateList.vm").setLabel($l10n.format("ViewAllTemplates", $module.getRModuleIssueType($issueType).DisplayName.toLowerCase()))
+ </td>
+ </tr>
+ </table>
+</div>
+#end
+#end
+
+
+<div class="functnbar">
+<input type="submit" value="$buttonName"  name="$buttonEvent" />&#160;
+<input type="reset" value="$l10n.Reset" name="eventSubmit_doRefresh" />
+</div>
+
+#set ($templateId = $data.Parameters.getString("templateId"))
+#if ($templateId && $templateId.trim().length() > 0)
+  #set ($templ = $scarabR.getIssueTemplate($templateId))
+  $user.setLastEnteredTemplate($templ)
+  <input type="hidden" name="templateId" value="$templateId"/>
+#else
+  $user.setLastEnteredIssueType($issueType)
+#end
 
-

-#macro (showAsterisk)

-<b class="asterisk">*</b>

-#end

-

-

-#macro (userList $mitList $includeAny $includeCommittedBy $parameters $activeOnly)

-#set ($userAttrs = $mitList.getCommonUserAttributes($activeOnly))

-#set ($modules = $mitList.Modules)

-

-

-## SORTING

-#set ($sortColumn = $data.Parameters.getString("sortColumn","username"))

-#set ($sortPolarity = $data.Parameters.getString("sortPolarity","asc"))

-

-## PAGINATION

-## if results exceed limit, get subset list

-#set ($resultsPerPage = $data.Parameters.getInt("resultsPerPage", 25))

-#set ($pageNum = $data.Parameters.getInt("pageNum", 1))

-

-## USER SEARCH

-<h3><a name="add">$l10n.Users</a></h3> 

-<div class="axial">

-

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

-  <tr>

-   <th>$l10n.FilterThisList</th>

-   <td><input type="text" name="searchString" value="$!searchString" />&nbsp;

-     <select name="searchField">

-      <option value="FullName" #if($searchField.equals("FullName")) selected="selected"#end>$l10n.FullName</option>

-      <option value="Username" #if($searchField.equals("Username")) selected="selected"#end>$l10n.Username</option>

-     </select>&nbsp;<input type="submit" name="eventSubmit_doRefresh" value="$l10n.Filter" /></td>

-  </tr>

-</table>

-</div>

-

-#if ($searchString && $searchString.length() > 0)

-    #set ($searchResults = $scarabR.getUserFilteredSearchResults($mitList, $pageNum, $resultsPerPage, $sortColumn, $sortPolarity, $includeCommittedBy))

-    #if ( $searchResults.getList().isEmpty())

-        <p class="infomark"><em>$l10n.NoUsersMatch</em></p>

-        #set ($searchResults = $scarabR.getUserSearchResults($mitList, $pageNum, $resultsPerPage, $sortColumn, $sortPolarity, $includeCommittedBy))

-    #end

-#else

-    #set ($searchResults = $scarabR.getUserSearchResults($mitList, $pageNum, $resultsPerPage, $sortColumn, $sortPolarity, $includeCommittedBy))

-#end 

-

-#set ($searchResultsSize = $searchResults.getTotalListSize())

-#set ($searchResultsList = $searchResults.getList())

-

-#set ($paginated = ($resultsPerPage > 0 && $searchResultsSize > $resultsPerPage))

-#if ($paginated)

-  #paginateWithSearch ($resultsPerPage $pageNum $sortColumn $sortPolarity $searchString $searchField $parameters)

-#end

-

-#if (!$searchResultsList || $searchResultsList.isEmpty()) 

-  <p><em>$l10n.NoUsersAvailable</em></p>

-#else

-

-  <table width="100%" border="1" cellspacing="2" cellpadding="3">

-   <tr>

-    <th nowrap="nowrap">$l10n.Select</th>

-  #set ($linkPage = $scarabG.replace($data.Target, '/', ','))

-

-    <th>#userSort ("username" "$l10n.Username" $linkPage $parameters)</th>

-    <th>#userSort ("name" "$l10n.FullName" $linkPage $parameters)</th>

-    <th>$l10n.Association</th>

-   </tr>

-   #foreach ($user in $searchResultsList)

-    #indexedRows($velocityCount)

-    <td><input type="checkbox" name="add_user" value="$user.UserId" /></td>

-    <td><a href="mailTo:$user.Email">$user.UserName</a></td>

-    <td>$user.Name</td>

-    <td><select name="user_attr_$user.UserId">

-    #if ($includeAny)

-       <option value="any">$l10n.Any</option>

-    #end

-    #if ($includeCommittedBy && $user.hasPermission($scarabG.Permission.ISSUE__ENTER, $modules))

-       <option value="created_by">$l10n.CreatedBy</option>

-    #end

-     #foreach ($userAttr in $userAttrs)

-      #if ($user.hasPermission($userAttr.Permission, $modules))

-       #set($userAttrName = $scarabR.getRModuleAttributeDisplayName($userAttr,$mitList))

-       <option value="$userAttr.AttributeId">$userAttrName</option>

-      #end

-     #end

-    </select></td>

-    </tr>

-  #end

-   </table>

-

-#if ($paginated)

-  #paginateWithSearch ($resultsPerPage $pageNum $sortColumn $sortPolarity $searchString $searchField $parameters)

-#end

-

-<div class="axial">

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

-     <tr>

-       <th>$l10n.MaxPerPage</th>

-       <td>

-           #resultsPerPageRadioSelect($resultsPerPage false)

-           &#160;<input type="submit"  name="eventSubmit_doRefreshresultsperpage" value="$l10n.Refresh" />

-           <input type="hidden" name="oldResultsPerPage" value="$resultsPerPage" />

-       </td>

-     </tr>

-  </table>

-</div>

-

-## keep track of state of the list, resultsPerPage should come after the

-## chance to change it, because we will use the first value

-<input type="hidden" name="sortColumn" value="$sortColumn" />

-<input type="hidden" name="sortPolarity" value="$sortPolarity" />

-<input type="hidden" name="pageNum" value="$pageNum" />

-<input type="hidden" name="resultsPerPage" value="$resultsPerPage" />

-

-##end ## ends the if (!$searchResultsList || $searchResultsList.isEmpty()) statement

-#end ## ends the if (!$userAttrs || $userAttrs.isEmpty()) statement

-#end

-

-

-## ---------------------------------------------------------------------------

-## Date related macros

-## ---------------------------------------------------------------------------

-

-#macro(selectDay $defaultDay)

- #foreach ($i in [1..31])

-  <option value="$i"#if("$defaultDay" == "$i") selected="selected"#end>$i</option>

- #end

-#end

-

-#macro(selectHour $defaultHour)

- #foreach ($i in [0..23])

-  <option value="$i"#if("$defaultHour" == "$i") selected="selected"#end>$i:00</option>

- #end

-#end

-

-#macro(printMonth $i $name $defaultMonth)

- <option value="$i"#if( $defaultMonth == $i ) selected="selected"#end>$name</option>

-#end

-

-#macro(selectMonth $defaultMonth) 

- #printMonth(1 $l10n.January $defaultMonth)

- #printMonth(2 $l10n.February $defaultMonth)

- #printMonth(3 $l10n.March $defaultMonth)

- #printMonth(4 $l10n.April $defaultMonth)

- #printMonth(5 $l10n.May $defaultMonth)

- #printMonth(6 $l10n.June $defaultMonth)

- #printMonth(7 $l10n.July $defaultMonth)

- #printMonth(8 $l10n.August $defaultMonth)

- #printMonth(9 $l10n.September $defaultMonth)

- #printMonth(10 $l10n.October $defaultMonth)

- #printMonth(11 $l10n.November $defaultMonth)

- #printMonth(12 $l10n.December $defaultMonth)

-#end

-

-#macro(selectYear $currentYear $selectedYear)

- #set ($minYear = $selectedYear - 4)

- #set ($maxYear = $selectedYear + 4)

- #selectYear2($minYear $maxYear $selectedYear)

-#end

-

-#macro(selectYear2 $minYear $maxYear $selectedYear)

- #foreach ($year in [$minYear..$maxYear])

-   <option value="$year"

-     #if("$selectedYear" == "$year")selected="selected"#end

-   >$year</option>

- #end

-#end

-

-#* -------------------------------------------------------------------------

-Prints out a date entry form.

-------------------------------------------------------------------------- *#

-#macro(dateEntry $yearField $currentYear $selectedYear $monthField $selectedMonth $dayField $selectedDay $hourField $selectedHour)

- <input name="$yearField" value="$selectedYear"></input> $l10n.YearMark

- &nbsp;

- <select name="$monthField">

-  #selectMonth($selectedMonth)

- </select> $l10n.MonthMark

- &nbsp;

- <select name="$dayField">

-  #selectDay($selectedDay)

- </select> $l10n.DayMark

- &nbsp;-&nbsp;

- <select name="$hourField">

-  #selectHour($selectedHour)

- </select> $l10n.TimeMark

-#end

-

-## ---------------------------------------------------------------------------

-

-

-

-#macro(entryTemplateAndAttributes $issue $moduleAttributeGroups $buttonName $buttonEvent $showTemplates)

-#set ($module = $issue.Module)

-#set ($issueType = $issue.IssueType)

-

-#if ($moduleAttributeGroups.isEmpty())

-<h3>$title</h3>

-<p><em>$l10n.format('NoAttributesDefinedForIssueType',$issueType.getName())</em></p>

-#else

-

-#if ($showTemplates)

-#set ($allTemplates = $scarabR.getAllIssueTemplates($issueType))

-#if ($allTemplates.size() > 0)

-<h3>$l10n.format("ApplyTemplate", $module.getRModuleIssueType($issueType).DisplayName.toLowerCase())</h3>

-<div class="axial">

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

- <tr>

- <th>$l10n.Templates</th>

- <td>

-<select name="templateId"

-  onchange="javascript:submitFormTo(this.form, 'eventSubmit_doUsetemplates');">

-   <option value="">$l10n.Choose</option>

-#foreach ($template in $allTemplates)

-   <option value="$template.Issue.IssueId"#if ($template.IssueId.toString().equals($data.Parameters.getString("templateId"))) selected="selected"#end>$template.Name</option>

-#end

-</select>

-<noscript>

-&#160;

-<input type="submit" value="$l10n.Select" name="eventSubmit_doUsetemplates" />

-</noscript>

-&#160;

-$link.setPage("TemplateList.vm").setLabel($l10n.format("ViewAllTemplates", $module.getRModuleIssueType($issueType).DisplayName.toLowerCase()))

- </td>

- </tr>

- </table>

-</div>

-#end

-#end

-

-

-<div class="functnbar">

-<input type="submit" value="$buttonName"  name="$buttonEvent" />&#160;

-<input type="reset" value="$l10n.Reset" name="eventSubmit_doRefresh" />

-</div>

-

-#set ($templateId = $data.Parameters.getString("templateId"))

-#if ($templateId && $templateId.trim().length() > 0)

-  #set ($templ = $scarabR.getIssueTemplate($templateId))

-  $user.setLastEnteredTemplate($templ)

-  <input type="hidden" name="templateId" value="$templateId"/>

-#else

-  $user.setLastEnteredIssueType($issueType)

-#end

-

   ## ===============================================================================
   ## The Attribute-groups area
   ## ===============================================================================
 
-<div class="axial">

-#foreach ($group in $moduleAttributeGroups)

+<div class="axial">
+#foreach ($group in $moduleAttributeGroups)
       #set ($attributes = $group.Attributes)
       #if ($attributes && !$attributes.isEmpty() && $group.isVisible4User($user))
-  <h4>$group.Name #asterisk()</h4>

-  <table cellpadding="3" cellspacing="2" border="0" width="100%">

+  <h4>$group.Name #asterisk()</h4>
+  <table cellpadding="3" cellspacing="2" border="0" width="100%">
     #set ($appendToNextLine = "")
           #set ($linecount = 0)
           #foreach ($att in $attributes)
-    #set ($rma = $module.getRModuleAttribute($att, $issueType))

-      #if ($rma.Active)

-        ## reset to a new $attVal in the event the issue/template does not 

-        ## have it defined 

-        #set ($attVal = $scarabR.getNewAttributeValue($att, $issue))

-        ## this may leave the previous value, if RHS is null

-        #set ($attVal = $issue.getAttributeValue($att))

-

-        #if (!$attVal.Attribute.isUserAttribute())

+    #set ($rma = $module.getRModuleAttribute($att, $issueType))
+      #if ($rma.Active)
+        ## reset to a new $attVal in the event the issue/template does not 
+        ## have it defined 
+        #set ($attVal = $scarabR.getNewAttributeValue($att, $issue))
+        ## this may leave the previous value, if RHS is null
+        #set ($attVal = $issue.getAttributeValue($att))
+
+        #if (!$attVal.Attribute.isUserAttribute())
                 #if ($att.AttributeType.ValidationKey)
-            #set ($field = $attVal.Attribute.AttributeType.ValidationKey)

+            #set ($field = $attVal.Attribute.AttributeType.ValidationKey)
                 #elseif ($att.isOptionAttribute())
-            #set ($field = "OptionId")

+            #set ($field = "OptionId")
           #elseif ($attVal.Attribute.AttributeType.Name == $scarabG.Constant.INTEGER)
             #set ($field = "NumericValue")
-          #else

-            #set ($field = "Value")

-          #end

+          #else
+            #set ($field = "Value")
+          #end
           
                 #set ($fieldSize = 0)
                 #set ($fieldSize = $!attVal.Attribute.FieldSize)
@@ -1251,7 +1269,7 @@
                 #set ($index = $rma.DisplayValue.indexOf("append:") + 7)
                 #if ($linecount > 0 && $index > 6)
                   #set ($displayValue = $rma.DisplayValue.substring($index))
-          #else

+          #else
                   #set ($displayValue = $rma.DisplayValue)
                 #end
 
@@ -1263,7 +1281,7 @@
                     #set ($display = false)
                   #end
                 #end
-          

+          
 
                 #if ($linecount > 0 && $index > 6)
                     #set ($isHidden =  !( $currentIssue.isRequiredAttributeFor($att, $user) || $rma.Visible ) )
@@ -1275,48 +1293,48 @@
                       </tr>
                     #end
                     #set ($linecount = $linecount + 1)
-          <tr>

+          <tr>
                       <th> 
                         <span style="white-space:nowrap;display:inline;margin-left:0px; margin-right:0px;width:95%;">#drawRequiredMarkupAsNeeded($user $currentIssue $att)$displayValue</span>
                         #if($fieldExtraHeader)
                           <pre>$fieldExtraHeader</pre>
                         #end
                       </th>
-            <td>

+            <td>
                     #set ($newline = false)
                 #end
                 <span style="display:inline;margin-left:0px; margin-right:10px;width:95%;">
 
                 #if ($att.isOptionAttribute())
-           #if ($templ)

-            #set ($templAttVal = $scarabR.getNewAttributeValue($att, $templ))

-            ## this may leave the previous value, if RHS is null

-            #set ($templAttVal = $templ.getAttributeValue($att))

-            #templateAttrValueLeafSelect ($attVal $templAttVal $field "" false)

-           #else

-            #attrValueLeafSelect ($attVal $field "" false $attVal.isRequired())

-           #end

-          #else

-           #if ($templ)

-            #set ($templAttVal = $scarabR.getNewAttributeValue($att, $templ))

-            ## this may leave the previous value, if RHS is null

-            #set ($templAttVal = $templ.getAttributeValue($att))

-            #if ($templAttVal.Value)

+           #if ($templ)
+            #set ($templAttVal = $scarabR.getNewAttributeValue($att, $templ))
+            ## this may leave the previous value, if RHS is null
+            #set ($templAttVal = $templ.getAttributeValue($att))
+            #templateAttrValueLeafSelect ($attVal $templAttVal $field "" false)
+           #else
+            #attrValueLeafSelect ($attVal $field "" false $attVal.isRequired())
+           #end
+          #else
+           #if ($templ)
+            #set ($templAttVal = $scarabR.getNewAttributeValue($att, $templ))
+            ## this may leave the previous value, if RHS is null
+            #set ($templAttVal = $templ.getAttributeValue($att))
+            #if ($templAttVal.Value)
               #templateAttrValueText ( $attVal $attVal $fieldSize $templAttVal )
-            #else

+            #else
                #attrValueText ( $attVal $attVal $fieldSize $fieldHint)
-            #end

-           #else

+            #end
+           #else
              #attrValueText ( $attVal $attVal $fieldSize $fieldHint)
-           #end

-          #end

-              #attrValueErrorMsg ($attVal $field)

+           #end
+          #end
+              #attrValueErrorMsg ($attVal $field)
                   #end
                       #end
-  #end

-  </table>

- #end

-#end

-</div>

+  #end
+  </table>
+ #end
+#end
+</div>
 #end  ## if
 #end  ## macro


------------------------------------------------------
http://scarab.tigris.org/ds/viewMessage.do?dsForumId=3577&dsMessageId=2967639