Scarab commit: svn commit: r10381 - branches/release/b21/src/webapp/WEB-INF/templates: macros viewIssue

[email protected]
Newsgroups gmane.comp.java.scarab.cvs
Message-ID <[email protected]>
Author: dabbous
Date: 2006-12-11 13:54:01-0800
New Revision: 10381

Modified:
   branches/release/b21/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm
   branches/release/b21/src/webapp/WEB-INF/templates/macros/MITListMacro.vm
   branches/release/b21/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab4Dep.vm

Log:
removed some very obvious velocity macro errors(bringing much less error messages in the logs)

Modified: branches/release/b21/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm
Url: http://scarab.tigris.org/source/browse/scarab/branches/release/b21/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm?view=diff&rev=10381&p1=branches/release/b21/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm&p2=branches/release/b21/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm&r1=10380&r2=10381
==============================================================================
--- branches/release/b21/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm	(original)
+++ branches/release/b21/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm	2006-12-11 13:54:01-0800
@@ -1,1129 +1,1129 @@
-#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 (attrValueLeafSelect $attrValue $optionFieldName $size $multiple $required)

-  #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)

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

-

-  #if ($count.trim() == "0" )

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

-      $newValues

-  #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==''))

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

-        #if ($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

-        <input type="hidden" name="$attrInput.get($optionFieldName).Key" value="$option.optionId"/>

-	  #end

-	  #if ($option.Active) 

-        $option.DisplayValue

-	  #else

-        [I] $option.DisplayValue

-      #end

-     #end

-   #end

-

-

-  #else

-

-

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

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

-  #if ($size.length() == 0 && (!$required || $newValues == '' ))

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

-  #end

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

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

-

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

-

-      #set ($selected = false)

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

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

-         #foreach ($value in $newValues)

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

-             #set ($selected=true)

-           #end

-         #end

-       #else

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

-           #set ($selected=true)

-         #end

-       #end

-      #end

-     

-	  #if($selected)

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

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

-		  #if ($option.Active) 

-        		$option.DisplayValue</option>

-		  #else

-        		[I] $option.DisplayValue</option>

-		  #end

-	  #elseif($option.Active)

-	    <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

-  #end

- </select>

- #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 $attrValue $size)

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

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

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

-        #else

-            #if ($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 id="dateAnchor$ref" name="dateAnchor$ref" href="javascript:;" onClick="calPopup.select(document.getElementById('$ref'),'dateAnchor$ref','$l10n.ShortDatePattern');return false;"><img src="$staticLink.setPath('/images/date.gif')" border="0"/></a>

-

-            #else

-               <input class="fullWidth" type="text" name="$attrInput.Value.Key" value="$!attrInput.Value"#if($size.length()) size="$size"#end />

-            #end

-        #end

-#end

-

-#macro (templateAttrValueText $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 (alert $text)

-   <p class="warningmark"><strong>$text</strong></p>

-#end

-

-#macro (confirm $text)

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

-#end

-

-#macro (info $text)

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

-#end

-

-#macro (alert $text)

-   <p class="warningmark"><strong>$l10n.Alert $text</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 (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

- <p 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()))

-  <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").setPathInfo("searchType", "$searchType").setPage($scarabR.getCurrentTemplate()))

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

- #end

- </p>

-#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)

- <p class="paginate">

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

- #if($prevIssue)

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

- #foreach ($prevNextId in $data.Parameters.getStrings("issueList"))

-    #set ($dummy = $prevLink.addPathInfo("issueList", $prevNextId))

- #end

-  <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()))

- #foreach ($prevNextId in $data.Parameters.getStrings("issueList"))

-    #set ($dummy = $nextLink.addPathInfo("issueList", $prevNextId))

- #end

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

- #end

- </p>

-#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

-

-#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))

-       <option value="$userAttr.AttributeId">$userAttr.Name</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

-

-<div class="axial">

-#foreach ($group in $moduleAttributeGroups)

- #if (!$group.Attributes.isEmpty())

-  <h4>$group.Name #asterisk()</h4>

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

-  #foreach ($att in $group.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())

-          #if ($attVal.Attribute.AttributeType.ValidationKey)

-            #set ($field = $attVal.Attribute.AttributeType.ValidationKey)

-          #elseif ($attVal.Attribute.AttributeType.Name == $scarabG.Constant.DROPDOWN_LIST)

-            #set ($field = "OptionId")

-          #else

-            #set ($field = "Value")

-          #end

-          <tr>

-            <th> #if ($attVal.isRequired()) #showAsterisk() #end 

-                 $attVal.RModuleAttribute.DisplayValue

-            </th>

-            <td>

-

-          #if ($attVal.Attribute.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)

-              #templateAttrValueText ( $attVal "70" $templAttVal )

-            #else

-               #attrValueText ( $attVal "70" )

-            #end

-           #else

-             #attrValueText ( $attVal "70" )

-           #end

-          #end

-              #attrValueErrorMsg ($attVal $field)

-            </td>

-          </tr>

-        #end

-      #end

-  #end

-  </table>

- #end

-#end

-</div>

-#end

-

-#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 (attrValueLeafSelect $attrValue $optionFieldName $size $multiple $required)
+  #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)
+  #set ( $count = "#AllowedTransitionsForOption ( $attrValue $optionFieldName $size $multiple )")
+
+  #if ($count.trim() == "0" )
+      <input type="hidden" name="$attrInput.get($optionFieldName).Key" value="$newValues"/>  
+      $newValues
+  #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 type="hidden" name="$attrInput.get($optionFieldName).Key" value="$newValues"/>
+        #if ($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
+        <input type="hidden" name="$attrInput.get($optionFieldName).Key" value="$option.optionId"/>
+	  #end
+	  #if ($option.Active) 
+        $option.DisplayValue
+	  #else
+        [I] $option.DisplayValue
+      #end
+     #end
+   #end
+
+
+  #else
+
+
+ <select name="$attrInput.get($optionFieldName).Key"
+  #if($size.length())size="$size"#end #if($multiple.equals("true"))multiple="multiple"#end>
+  #if ($size.length() == 0 && (!$required || $newValues == '' ))
+   <option value="">$l10n.Choose</option>
+  #end
+  #foreach ($option in $module.getOptionTree($attr, $issueType, false))
+    #set ($canMakeTransition = "#CanMakeTransitionForOption ($newValues $option $issue $multiple)")
+
+    #if ($canMakeTransition.trim()=="true")
+
+      #set ($selected = false)
+      #if ($newValues && $newValues.toString() != '')
+       #if ($multiple.equals("true"))
+         #foreach ($value in $newValues)
+           #if ($value.equals($option.OptionId))
+             #set ($selected=true)
+           #end
+         #end
+       #else
+         #if ($newValues.equals($option.OptionId))
+           #set ($selected=true)
+         #end
+       #end
+      #end
+     
+	  #if($selected)
+	    <option value="$option.OptionId"#selected($selected)>
+    	  #foreach ($i in [0..$option.Level])#if($i != 0)&nbsp;&nbsp;&nbsp;&nbsp;#end#end
+		  #if ($option.Active) 
+        		$option.DisplayValue</option>
+		  #else
+        		[I] $option.DisplayValue</option>
+		  #end
+	  #elseif($option.Active)
+	    <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
+  #end
+ </select>
+ #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 $attrValue $size)
+#set ($attrInput = $intake.AttributeValue.mapTo($attrValue))
+        #if ($attVal.Attribute.AttributeType.Name == "long-string")
+           #textAreaMedium("$attrInput.Value.Key" $attrInput.Value)
+        #else
+            #if ($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 id="dateAnchor$ref" name="dateAnchor$ref" href="javascript:;" onClick="calPopup.select(document.getElementById('$ref'),'dateAnchor$ref','$l10n.ShortDatePattern');return false;"><img src="$staticLink.setPath('/images/date.gif')" border="0"/></a>
+
+            #else
+               <input class="fullWidth" type="text" name="$attrInput.Value.Key" value="$!attrInput.Value"#if($size.length()) size="$size"#end />
+            #end
+        #end
+#end
+
+#macro (templateAttrValueText $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 (alert $text)
+   <p class="warningmark"><strong>$text</strong></p>
+#end
+
+#macro (confirm $text)
+   <p class="donemark"><em>$text</em></p>
+#end
+
+#macro (info $text)
+   <p class="infomark">$text</em></p>
+#end
+
+#macro (alert $text)
+   <p class="warningmark"><strong>$l10n.Alert $text</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 (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
+ <p 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()))
+  <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").setPathInfo("searchType", "$searchType").setPage($scarabR.getCurrentTemplate()))
+  | <a href="$nextLink">$l10n.PaginateNext</a>
+ #end
+ </p>
+#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)
+ <p class="paginate">
+#set ($prevIssue=$scarabR.PrevIssue)
+ #if($prevIssue)
+  #set ($prevLink = $link.setPathInfo("id", "$prevIssue").setPage($scarabR.getCurrentTemplate()))
+ #foreach ($prevNextId in $data.Parameters.getStrings("issueList"))
+    #set ($dummy = $prevLink.addPathInfo("issueList", $prevNextId))
+ #end
+  <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()))
+ #foreach ($prevNextId in $data.Parameters.getStrings("issueList"))
+    #set ($dummy = $nextLink.addPathInfo("issueList", $prevNextId))
+ #end
+  | <a href="$nextLink">$l10n.PaginateNext</a>
+ #end
+ </p>
+#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
+
+#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))
+       <option value="$userAttr.AttributeId">$userAttr.Name</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
+
+<div class="axial">
+#foreach ($group in $moduleAttributeGroups)
+ #if (!$group.Attributes.isEmpty())
+  <h4>$group.Name #asterisk()</h4>
+  <table cellpadding="3" cellspacing="2" border="0" width="100%">
+  #foreach ($att in $group.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())
+          #if ($attVal.Attribute.AttributeType.ValidationKey)
+            #set ($field = $attVal.Attribute.AttributeType.ValidationKey)
+          #elseif ($attVal.Attribute.AttributeType.Name == $scarabG.Constant.DROPDOWN_LIST)
+            #set ($field = "OptionId")
+          #else
+            #set ($field = "Value")
+          #end
+          <tr>
+            <th> #if ($attVal.isRequired()) #showAsterisk() #end 
+                 $attVal.RModuleAttribute.DisplayValue
+            </th>
+            <td>
+
+          #if ($attVal.Attribute.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)
+              #templateAttrValueText ( $attVal "70" $templAttVal )
+            #else
+               #attrValueText ( $attVal "70" )
+            #end
+           #else
+             #attrValueText ( $attVal "70" )
+           #end
+          #end
+              #attrValueErrorMsg ($attVal $field)
+            </td>
+          </tr>
+        #end
+      #end
+  #end
+  </table>
+ #end
+#end
+</div>
+#end
+
+#end

Modified: branches/release/b21/src/webapp/WEB-INF/templates/macros/MITListMacro.vm
Url: http://scarab.tigris.org/source/browse/scarab/branches/release/b21/src/webapp/WEB-INF/templates/macros/MITListMacro.vm?view=diff&rev=10381&p1=branches/release/b21/src/webapp/WEB-INF/templates/macros/MITListMacro.vm&p2=branches/release/b21/src/webapp/WEB-INF/templates/macros/MITListMacro.vm&r1=10380&r2=10381
==============================================================================
--- branches/release/b21/src/webapp/WEB-INF/templates/macros/MITListMacro.vm	(original)
+++ branches/release/b21/src/webapp/WEB-INF/templates/macros/MITListMacro.vm	2006-12-11 13:54:01-0800
@@ -63,7 +63,7 @@
       <select name="list_id" onclick="allit.checked=false" >
         <option value="">$displayText</option>
         #foreach ($list in $savedLists)
-          <option value="$list.QueryKey"#if($list.QueryKeyfoo == $data.Parameters.getString("list_id", "")) selected="selected"#end>$list.Name</option>
+          <option value="$list.QueryKey"#if($list.QueryKeyfoo && $list.QueryKeyfoo == $data.Parameters.getString("list_id", "")) selected="selected"#end>$list.Name</option>
         #end
       </select>
     #end

Modified: branches/release/b21/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab4Dep.vm
Url: http://scarab.tigris.org/source/browse/scarab/branches/release/b21/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab4Dep.vm?view=diff&rev=10381&p1=branches/release/b21/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab4Dep.vm&p2=branches/release/b21/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab4Dep.vm&r1=10380&r2=10381
==============================================================================
--- branches/release/b21/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab4Dep.vm	(original)
+++ branches/release/b21/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab4Dep.vm	2006-12-11 13:54:01-0800
@@ -1,443 +1,443 @@
-## - alreadyExplored contains every issue that has been explored for blocking 

-##   children to avoid redundant information.

-## - alreadyListed contains the issues displayed *in the current branch* of 

-##   the tree to avoid looping.

-##

-

-#set ($alreadyExplored = [])

-#set ($counter = 0)

-

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

-####   macros

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

-

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

-## macro listBlockingIssues

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

-#macro (listBlockingIssues $blockingIssues $alreadyListed)

-#set ($nop = $alreadyExplored.add($bi.UniqueId))

-<ul class="blockingtree">

-  #foreach ($bi in $blockingIssues)

-  #set ($notlisted= !$alreadyListed.contains($bi.UniqueId))

-    #if (!$alreadyListed.contains($bi.UniqueId))

-      #set ($nop = $alreadyListed.add($bi.UniqueId))

-      #if ($bi.Module != $module)

-        #set ($blockText = "$bi.UniqueId: $bi.defaultText ($bi.IssueType.Name/$bi.Module.Name)")

-      #else

-        #set ($blockText = "$bi.UniqueId: $bi.defaultText ($bi.IssueType.Name)")

-      #end

-	  #if ($bi.UniqueId == $currentIssue.UniqueId)

-        <li>$blockText</li>

-      #else

-        <li>$link.setPage("ViewIssue.vm").addPathInfo("id", $bi.UniqueId).setLabel($blockText)</li>

-        #if ($bi.isBlocked() && !$alreadyExplored.contains($bi.UniqueId))

-          #listBlockingIssues($bi $bi.BlockingIssues $alreadyListed)

-        #end

-      #end

-      #set ($nop = $alreadyListed.remove($bi.UniqueId))

-    #end

-  #end

-</ul>

-#end

-

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

-## macro verboseDependency

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

-#macro (verboseDependency $name $blockingStatus)

-  #if ($name == "blocking" && $blockingStatus == "IsBlocked")

-    $l10n.DependsOn

-  #elseif ($name == "blocking" && $blockingStatus == "Blocks")

-    $l10n.PrerequisiteFor

-  #elseif ($name == "duplicate")

-    $l10n.DuplicateIssue

-  #elseif ($name == "non-blocking")

-    $l10n.NonBlocking

-  #end

-#end

-

-

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

-## macro doIndent

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

-#macro (doIndent $level)

-  #set ($sublevel = $level - 1)

-  #if ($level > 0)

-   &nbsp;&nbsp;&nbsp;#doIndent ( $sublevel )

-  #end

-#end

-

-## macro addBackground

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

-#macro (addBackground $blockingStatus $status)

-  #if ($status.equals(""))

-    

-  #else

-    #if($status.equals($blockingStatus)) style="background:#FE9292"

-    #else style="background:#C0FE92"

-    #end

-  #end

-#end

-

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

-## macro relationTable

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

-#macro (relationTable $thisIssue $indentLevel $entries $blockers $blockingStatus)

-      #set ($allBlockersDisplayed = true)

-      #foreach ($depend in $entries)

-

-         #set ($status="")      

-         #if ($depend.TypeId == 1 && $indentLevel==0)

-           #set ($isDependant=false)

-           ##depend:$depend.UniqueId 

-           #foreach ($bi in $blockers)

-             ##bi:$bi.UniqueId

-             #if ($bi.UniqueId.equals($depend.UniqueId))

-               #set ($notlisted= !$alreadyListed.contains($bi.UniqueId))                

-               #if ($notlisted)

-                 #set ($status="$blockingStatus")

-                 #set ($nop = $alreadyListed.add($bi.UniqueId))

-                 #set ($allBlockersDisplayed = false)

-                 #set ($isDependant=true)

-               #end

-             #end

-           #end

-           #if ($isDependant==false && !$blockingStatus.equals(""))

-             #set ($status= "Not$blockingStatus")

-           #end

-         #end

-      

-        <tr>

-          #set ($dependGroup = $intake.Depend.mapTo($depend))

-

-          #if ($indentLevel == 0)

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

-          #end

-          #indexedRows($counter)

-          

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

-          ## Selection checkbox

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

-          #if ($canEdit)

-            <td #addBackground("$blockingStatus" "$status") >

-              #if ( !$blockingStatus.equals("ddd_IsBlocked") && $indentLevel == 0 && $scarabR.hasPermission($scarabG.Permission.ISSUE__EDIT, $thisIssue.Module) )

-               #booleanCheckbox($dependGroup.Selected)

-              #else

-                &nbsp;

-              #end

-            </td>

-          #end

-

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

-          ## Dependency type

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

-          <td nowrap="nowrap" #addBackground("$blockingStatus" "$status")>

-              ##$thisIssue.getDependency($depend).TypeId): 

-              #foreach ($dependType in $thisIssue.AllDependencyTypes)

-                #if ($dependType.DependTypeId == $thisIssue.getDependency($depend).TypeId)

-                  #verboseDependency($dependType.Name $blockingStatus)

-                #end

-              #end

-          </td>

-          

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

-          ## The dependency status

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

-          <td nowrap="nowrap" #addBackground("$blockingStatus" "$status")>

-            #if (!$status.equals(""))$l10n.get($status)#end

-          </td>

-

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

-          ## related Issues IssueId plus Hyperlink

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

-          <td nowrap="nowrap" #addBackground("$blockingStatus" "$status")>

-            #if ($scarabR.hasPermission($scarabG.Permission.ISSUE__VIEW, $depend.Module))

-              #doIndent ($indentLevel)

-              $link.setPage("ViewIssue.vm").addPathInfo("id", $depend.UniqueId).setLabel("$depend.UniqueId")

-            #else

-              $l10n.PrivateIssue

-            #end

-          </td>

-

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

-          ## The short text of the parent issue

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

-          <td width="100%" #addBackground("$blockingStatus" "$status")>

-            #if ($scarabR.hasPermission($scarabG.Permission.ISSUE__VIEW, $depend.Module))

-              $depend.defaultText

-            #else

-              $l10n.PrivateIssue

-            #end

-          </td>

-          

-        </tr>

-        

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

-        ## Dependency tree of all issues that block this issue

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

-        #if ($blockingStatus.equals("IsBlocked") && !$allBlockersDisplayed)

-          #set ( $prerequisites = $depend.getPrerequisiteIssues())

-          #if (!$prerequisites.isEmpty())

-            #set ( $blockers = $depend.getBlockingIssues())

-            #set ( $nextLevel = $indentLevel + 1 )

-            #relationTable ($depend $nextLevel $prerequisites $blockers "IsBlocked" )

-          #end

-        #end

-      #end

-      <tr><td colspan="5" style="height:3px;"></td></tr>

-#end

-

-#if (1 > 1)

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

-####   active blocking information

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

-

-<h3 onClick=smartToggleVisibility('blocking')><img name="blocking.state" src="$staticLink.setPath($iconCollapse)"/>$l10n.BlockingInformation</h3>

-<div id='blocking'>

-  <div class="colbar">$l10n.BlockingExplanation</div>

-  <div class="axial">

-    <table cellpadding="3"

-           cellspacing="2" 

-           border="0" 

-           width="100%">

-

-      <tr>

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

-        <td colspan="2">

-          #if ($currentIssue.isBlocked())

-            <div class="blockedmark"><em>$l10n.IssueCurrentlyBlocked</em></div>

-          #else

-            #if ($currentIssue.isBlockingAnyIssue())

-              <div class="blockingmark"><em>$l10n.IssueDoesBlockOtherIssues</em></div>

-            #else

-              <div class="notblockedmark"><em>$l10n.IssueNotBlocked</em></div>

-            #end

-          #end<br/>

-        </td>

-      </tr>

-

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

-      ##   Issues which block this Issue

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

-

-      #if ($currentIssue.isBlocked())

-        <tr>

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

-          <td>

-            $currentIssue.UniqueId: $currentIssue.DefaultText

-            #set ($listedIssues = [])

-            #listBlockingIssues($currentIssue $currentIssue.BlockingIssues $listedIssues)

-          </td>

-        </tr>

-      #end

-

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

-      ##   Issues which are blocked by this Issue

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

-

-      <tr>

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

-        <td nowrap>

-          #if ($currentIssue.isBlockingAnyIssue())

-            #foreach ($bi in $currentIssue.BlockedIssues)

-              #if ($bi.Module != $module)

-                #set ($blockText = "$bi.UniqueId: $bi.defaultText ($bi.IssueType.Name / $bi.Module.Name)")

-              #else

-                #set ($blockText = "$bi.UniqueId: $bi.defaultText ($bi.IssueType.Name)")

-              #end

-              $link.setPage("ViewIssue.vm").addPathInfo("id", $bi.UniqueId).setLabel($blockText)<br/>

-            #end

-          #else

-           <em>$l10n.IssueDoesNotBlockOtherIssues</em>

-          #end

-        </td>

-      </tr>

-    </table>

-  </div>

-</div>

-#end

-

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

-####   dependencies

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

-

-<h3 onClick=smartToggleVisibility('dependencies')><img name="dependencies.state" src="$staticLink.setPath($iconCollapse)"/>$l10n.format("RelationsNavi", $numDependencies)</h3>

-<div id='dependencies'>

-  #if ($numDependencies > 0)

-

-    #set ($issueChildren = $currentIssue.Children)

-    #set ($issueParents = $currentIssue.Parents)

-

-    #set ($issueCanBlockList     = $currentIssue.getDependantIssues())

-    #set ($issueBlockableByList  = $currentIssue.getPrerequisiteIssues())

-    #set ($blockedIssues         = $currentIssue.getBlockedIssues())

-    #set ($blockingIssues        = $currentIssue.getBlockingIssues())

-    #set ($issueRelatedList      = $currentIssue.getRelatedIssues())

-    #set ($issueDuplicatesList   = $currentIssue.getDuplicateIssues())

-

-    #set ($isEmpty = $issueBlockableByList.isEmpty() && $issueCanBlockList.isEmpty() && $issueRelatedList.isEmpty() && $issueDuplicatesList.isEmpty() )

-

-    <table width="100%" 

-           cellspacing="2" 

-           cellpadding="3"

-           sstyle="margin-left:2px; margin-right:2px;" >

-

-      <tr>

-        #if ($canEdit)

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

-        #end

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

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

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

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

-      </tr>

-

-

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

-      ## List of issues blockable By this issue

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

-

-      #if ($issueBlockableByList.isEmpty() && !$canEdit)

-        ##<tr><td colspan="5">$l10n.NoDependencies (blockables)</td></tr>

-      #elseif(!$issueBlockableByList.isEmpty())

-        #relationTable ( $currentIssue 0 $issueBlockableByList $blockingIssues "IsBlocked" )

-      #end

-  

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

-      ## List of issues from which this issue can be blocked 

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

-

-      #if ($issueCanBlockList.isEmpty() && !$canEdit)

-        ##<tr><td colspan="5">$l10n.NoDependencies (blockers)</td></tr>

-      #elseif(!$issueCanBlockList.isEmpty())

-        #relationTable ( $currentIssue 0 $issueCanBlockList $blockedIssues "Blocks" )

-      #end

-

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

-      ## List of related issues  

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

-

-      #if ($issueRelatedList.isEmpty() && !$canEdit)

-        ##<tr><td colspan="5">$l10n.NoDependencies (related)</td></tr>

-      #elseif(!$issueRelatedList.isEmpty())

-        #relationTable ( $currentIssue 0 $issueRelatedList 0 "")

-      #end

-

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

-      ## List of duplicate issues  

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

-

-      #if ($issueDuplicatesList.isEmpty() && !$canEdit)

-        ##<tr><td colspan="5">$l10n.NoDependencies (duplicates)</td></tr>

-      #elseif(!$issueDuplicatesList.isEmpty())

-        #relationTable ( $currentIssue 0 $issueDuplicatesList 0 "")

-      #end

-    </table>

-

-    #if ($canEdit)

-      <div class="functnbar4">

-        <input type="submit" value="$l10n.ModifyRelations"  name="eventSubmit_doSavedependencychanges" />

-        #set ($newDependGroup = $intake.Depend.setKey("modifyDep$currentIssue.QueryKey"))

-        ## dependency type

-

-        <select name="modifyDepTo" class="select">

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

-          <option                     value="remove" >$l10n.RemoveRelation</option>

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

-            <option value="$dependType.DependTypeId">#verboseDependency($dependType.Name "IsBlocked")</option>

-            #if ($dependType.Name.equals("blocking"))

-              <option value="-$dependType.DependTypeId">#verboseDependency($dependType.Name "Blocks")</option>

-            #end

-          #end

-        </select>

-      </div>

-    #end

-  ##else

-  ##  <div class="functnbar3"></div>

-  #end

-

-

-

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

-  ####   "Add Dependency" form

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

-

-  #if ($canEdit)

-   <h4>$l10n.AddRelationTitle</h4>

-   <div class="axial">

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

-      <tr>

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

-        <td colspan=2>

-          ## current issue

-          $currentIssue.UniqueId

-

-          #set ($newDependGroup = $intake.Depend.setKey("newDep$currentIssue.QueryKey"))

-          ## issue to be entered

-          <input type="hidden" name="$newDependGroup.ObservedId.Key" value="$currentIssue.IssueId" />

-          ## dependency type

-          <select name="$newDependGroup.TypeId.Key" class="select">

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

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

-              #set ($selected = false)

-              #if ($dependType.DependTypeId.toString().equals($newDependGroup.TypeId.toString()))

-                #set ($selected = true)

-              #end

-              <option#selected($selected) value="-$dependType.DependTypeId">#verboseDependency($dependType.Name "IsBlocked")</option>

-              #if ($dependType.Name.equals("blocking"))

-                <option value="$dependType.DependTypeId">#verboseDependency($dependType.Name "Blocks")</option>

-              #end

-            #end

-          </select>

-

-          $l10n.RelatedIssue 

-

-          <input type="text"  name="$newDependGroup.ObserverUniqueId.Key" value = "$!newDependGroup.ObserverUniqueId"  title="$l10n.PleaseEnterIssueID"/>

-    

-          ## Error messages

-          #set ($idMessage = $newDependGroup.ObserverUniqueId.Message.toString())

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

-            <p class="warningmark"><em>$idMessage</em></p>

-          #end

-          #set ($typeMessage = $newDependGroup.TypeId.Message.toString())

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

-            <p class="warningmark"><em>$typeMessage</em></p>

-          #end

-         </td>

-      </tr>

-      <tr>

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

-        <td colspan="3">

-          #textAreaMedium("$newDependGroup.Description.Key" "$newDependGroup.Description")

-          #fieldErrorMsg($newDependGroup.Description "")

-        </td>

-      </tr>

-    </table>

-   </div>

-  #end

-

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

-  ####   Footer

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

+## - alreadyExplored contains every issue that has been explored for blocking 
+##   children to avoid redundant information.
+## - alreadyListed contains the issues displayed *in the current branch* of 
+##   the tree to avoid looping.
+##
+
+#set ($alreadyExplored = [])
+#set ($counter = 0)
+
+################################################################################
+####   macros
+################################################################################
+
+## ===========================================
+## macro listBlockingIssues
+## ===========================================
+#macro (listBlockingIssues $blockingIssues $alreadyListed)
+#set ($nop = $alreadyExplored.add($bi.UniqueId))
+<ul class="blockingtree">
+  #foreach ($bi in $blockingIssues)
+  #set ($notlisted= !$alreadyListed.contains($bi.UniqueId))
+    #if (!$alreadyListed.contains($bi.UniqueId))
+      #set ($nop = $alreadyListed.add($bi.UniqueId))
+      #if ($bi.Module != $module)
+        #set ($blockText = "$bi.UniqueId: $bi.defaultText ($bi.IssueType.Name/$bi.Module.Name)")
+      #else
+        #set ($blockText = "$bi.UniqueId: $bi.defaultText ($bi.IssueType.Name)")
+      #end
+	  #if ($bi.UniqueId == $currentIssue.UniqueId)
+        <li>$blockText</li>
+      #else
+        <li>$link.setPage("ViewIssue.vm").addPathInfo("id", $bi.UniqueId).setLabel($blockText)</li>
+        #if ($bi.isBlocked() && !$alreadyExplored.contains($bi.UniqueId))
+          #listBlockingIssues($bi.BlockingIssues $alreadyListed)
+        #end
+      #end
+      #set ($nop = $alreadyListed.remove($bi.UniqueId))
+    #end
+  #end
+</ul>
+#end
+
+## ===========================================
+## macro verboseDependency
+## ===========================================
+#macro (verboseDependency $name $blockingStatus)
+  #if ($name == "blocking" && $blockingStatus == "IsBlocked")
+    $l10n.DependsOn
+  #elseif ($name == "blocking" && $blockingStatus == "Blocks")
+    $l10n.PrerequisiteFor
+  #elseif ($name == "duplicate")
+    $l10n.DuplicateIssue
+  #elseif ($name == "non-blocking")
+    $l10n.NonBlocking
+  #end
+#end
+
+
+## ===========================================
+## macro doIndent
+## ===========================================
+#macro (doIndent $level)
+  #set ($sublevel = $level - 1)
+  #if ($level > 0)
+   &nbsp;&nbsp;&nbsp;#doIndent ( $sublevel )
+  #end
+#end
+
+## macro addBackground
+## ===========================================
+#macro (addBackground $blockingStatus $status)
+  #if ($status.equals(""))
+    
+  #else
+    #if($status.equals($blockingStatus)) style="background:#FE9292"
+    #else style="background:#C0FE92"
+    #end
+  #end
+#end
+
+## ===========================================
+## macro relationTable
+## ===========================================
+#macro (relationTable $thisIssue $indentLevel $entries $blockers $blockingStatus)
+      #set ($allBlockersDisplayed = true)
+      #foreach ($depend in $entries)
+
+         #set ($status="")      
+         #if ($depend.TypeId == 1 && $indentLevel==0)
+           #set ($isDependant=false)
+           ##depend:$depend.UniqueId 
+           #foreach ($bi in $blockers)
+             ##bi:$bi.UniqueId
+             #if ($bi.UniqueId.equals($depend.UniqueId))
+               #set ($notlisted= !$alreadyListed.contains($bi.UniqueId))                
+               #if ($notlisted)
+                 #set ($status="$blockingStatus")
+                 #set ($nop = $alreadyListed.add($bi.UniqueId))
+                 #set ($allBlockersDisplayed = false)
+                 #set ($isDependant=true)
+               #end
+             #end
+           #end
+           #if ($isDependant==false && !$blockingStatus.equals(""))
+             #set ($status= "Not$blockingStatus")
+           #end
+         #end
+      
+        <tr>
+          #set ($dependGroup = $intake.Depend.mapTo($depend))
+
+          #if ($indentLevel == 0)
+            #set ($counter = $counter + 1)
+          #end
+          #indexedRows($counter)
+          
+          ## ------------------
+          ## Selection checkbox
+          ## ------------------
+          #if ($canEdit)
+            <td #addBackground("$blockingStatus" "$status") >
+              #if ( !$blockingStatus.equals("ddd_IsBlocked") && $indentLevel == 0 && $scarabR.hasPermission($scarabG.Permission.ISSUE__EDIT, $thisIssue.Module) )
+               #booleanCheckbox($dependGroup.Selected)
+              #else
+                &nbsp;
+              #end
+            </td>
+          #end
+
+          ## ---------------
+          ## Dependency type
+          ## ---------------          
+          <td nowrap="nowrap" #addBackground("$blockingStatus" "$status")>
+              ##$thisIssue.getDependency($depend).TypeId): 
+              #foreach ($dependType in $thisIssue.AllDependencyTypes)
+                #if ($dependType.DependTypeId == $thisIssue.getDependency($depend).TypeId)
+                  #verboseDependency($dependType.Name $blockingStatus)
+                #end
+              #end
+          </td>
+          
+          ## -------------------------------------
+          ## The dependency status
+          ## -------------------------------------
+          <td nowrap="nowrap" #addBackground("$blockingStatus" "$status")>
+            #if (!$status.equals(""))$l10n.get($status)#end
+          </td>
+
+          ## -------------------------------------
+          ## related Issues IssueId plus Hyperlink
+          ## -------------------------------------
+          <td nowrap="nowrap" #addBackground("$blockingStatus" "$status")>
+            #if ($scarabR.hasPermission($scarabG.Permission.ISSUE__VIEW, $depend.Module))
+              #doIndent ($indentLevel)
+              $link.setPage("ViewIssue.vm").addPathInfo("id", $depend.UniqueId).setLabel("$depend.UniqueId")
+            #else
+              $l10n.PrivateIssue
+            #end
+          </td>
+
+          ## ----------------------------------
+          ## The short text of the parent issue
+          ## ----------------------------------
+          <td width="100%" #addBackground("$blockingStatus" "$status")>
+            #if ($scarabR.hasPermission($scarabG.Permission.ISSUE__VIEW, $depend.Module))
+              $depend.defaultText
+            #else
+              $l10n.PrivateIssue
+            #end
+          </td>
+          
+        </tr>
+        
+        ## --------------------------------------------------------
+        ## Dependency tree of all issues that block this issue
+        ## --------------------------------------------------------
+        #if ($blockingStatus.equals("IsBlocked") && !$allBlockersDisplayed)
+          #set ( $prerequisites = $depend.getPrerequisiteIssues())
+          #if (!$prerequisites.isEmpty())
+            #set ( $blockers = $depend.getBlockingIssues())
+            #set ( $nextLevel = $indentLevel + 1 )
+            #relationTable ($depend $nextLevel $prerequisites $blockers "IsBlocked" )
+          #end
+        #end
+      #end
+      <tr><td colspan="5" style="height:3px;"></td></tr>
+#end
+
+#if (1 > 1)
+################################################################################
+####   active blocking information
+################################################################################
+
+<h3 onClick=smartToggleVisibility('blocking')><img name="blocking.state" src="$staticLink.setPath($iconCollapse)"/>$l10n.BlockingInformation</h3>
+<div id='blocking'>
+  <div class="colbar">$l10n.BlockingExplanation</div>
+  <div class="axial">
+    <table cellpadding="3"
+           cellspacing="2" 
+           border="0" 
+           width="100%">
+
+      <tr>
+        <th>$l10n.BlockedStatus</th>
+        <td colspan="2">
+          #if ($currentIssue.isBlocked())
+            <div class="blockedmark"><em>$l10n.IssueCurrentlyBlocked</em></div>
+          #else
+            #if ($currentIssue.isBlockingAnyIssue())
+              <div class="blockingmark"><em>$l10n.IssueDoesBlockOtherIssues</em></div>
+            #else
+              <div class="notblockedmark"><em>$l10n.IssueNotBlocked</em></div>
+            #end
+          #end<br/>
+        </td>
+      </tr>
+
+      ##-------------------------------------------------------
+      ##   Issues which block this Issue
+      ##-------------------------------------------------------
+
+      #if ($currentIssue.isBlocked())
+        <tr>
+          <th>$l10n.IssueBlockingTree</th>
+          <td>
+            $currentIssue.UniqueId: $currentIssue.DefaultText
+            #set ($listedIssues = [])
+            #listBlockingIssues($currentIssue.BlockingIssues $listedIssues)
+          </td>
+        </tr>
+      #end
+
+      ##------------------------------------------------------
+      ##   Issues which are blocked by this Issue
+      ##------------------------------------------------------
+
+      <tr>
+        <th>$l10n.IssuesBlockedByThisOne</th>
+        <td nowrap>
+          #if ($currentIssue.isBlockingAnyIssue())
+            #foreach ($bi in $currentIssue.BlockedIssues)
+              #if ($bi.Module != $module)
+                #set ($blockText = "$bi.UniqueId: $bi.defaultText ($bi.IssueType.Name / $bi.Module.Name)")
+              #else
+                #set ($blockText = "$bi.UniqueId: $bi.defaultText ($bi.IssueType.Name)")
+              #end
+              $link.setPage("ViewIssue.vm").addPathInfo("id", $bi.UniqueId).setLabel($blockText)<br/>
+            #end
+          #else
+           <em>$l10n.IssueDoesNotBlockOtherIssues</em>
+          #end
+        </td>
+      </tr>
+    </table>
+  </div>
+</div>
+#end
+
+################################################################################
+####   dependencies
+################################################################################
+
+<h3 onClick=smartToggleVisibility('dependencies')><img name="dependencies.state" src="$staticLink.setPath($iconCollapse)"/>$l10n.format("RelationsNavi", $numDependencies)</h3>
+<div id='dependencies'>
+  #if ($numDependencies > 0)
+
+    #set ($issueChildren = $currentIssue.Children)
+    #set ($issueParents = $currentIssue.Parents)
+
+    #set ($issueCanBlockList     = $currentIssue.getDependantIssues())
+    #set ($issueBlockableByList  = $currentIssue.getPrerequisiteIssues())
+    #set ($blockedIssues         = $currentIssue.getBlockedIssues())
+    #set ($blockingIssues        = $currentIssue.getBlockingIssues())
+    #set ($issueRelatedList      = $currentIssue.getRelatedIssues())
+    #set ($issueDuplicatesList   = $currentIssue.getDuplicateIssues())
+
+    #set ($isEmpty = $issueBlockableByList.isEmpty() && $issueCanBlockList.isEmpty() && $issueRelatedList.isEmpty() && $issueDuplicatesList.isEmpty() )
+
+    <table width="100%" 
+           cellspacing="2" 
+           cellpadding="3"
+           sstyle="margin-left:2px; margin-right:2px;" >
+
+      <tr>
+        #if ($canEdit)
+          <th nowrap="nowrap">$l10n.Select</th>
+        #end
+        <th nowrap="nowrap" >$l10n.DependencyType</th>
+        <th nowrap="nowrap" >$l10n.BlockedStatus</th>
+        <th nowrap="nowrap" >$l10n.IssueId</th>     
+        <th nowrap="nowrap" >$l10n.Summary</th>
+      </tr>
+
+
+      #####################################################
+      ## List of issues blockable By this issue
+      #####################################################
+
+      #if ($issueBlockableByList.isEmpty() && !$canEdit)
+        ##<tr><td colspan="5">$l10n.NoDependencies (blockables)</td></tr>
+      #elseif(!$issueBlockableByList.isEmpty())
+        #relationTable ( $currentIssue 0 $issueBlockableByList $blockingIssues "IsBlocked" )
+      #end
+  
+      #####################################################
+      ## List of issues from which this issue can be blocked 
+      #####################################################
+
+      #if ($issueCanBlockList.isEmpty() && !$canEdit)
+        ##<tr><td colspan="5">$l10n.NoDependencies (blockers)</td></tr>
+      #elseif(!$issueCanBlockList.isEmpty())
+        #relationTable ( $currentIssue 0 $issueCanBlockList $blockedIssues "Blocks" )
+      #end
+
+      #####################################################
+      ## List of related issues  
+      #####################################################
+
+      #if ($issueRelatedList.isEmpty() && !$canEdit)
+        ##<tr><td colspan="5">$l10n.NoDependencies (related)</td></tr>
+      #elseif(!$issueRelatedList.isEmpty())
+        #relationTable ( $currentIssue 0 $issueRelatedList 0 "")
+      #end
+
+      #####################################################
+      ## List of duplicate issues  
+      #####################################################
+
+      #if ($issueDuplicatesList.isEmpty() && !$canEdit)
+        ##<tr><td colspan="5">$l10n.NoDependencies (duplicates)</td></tr>
+      #elseif(!$issueDuplicatesList.isEmpty())
+        #relationTable ( $currentIssue 0 $issueDuplicatesList 0 "")
+      #end
+    </table>
+
+    #if ($canEdit)
+      <div class="functnbar4">
+        <input type="submit" value="$l10n.ModifyRelations"  name="eventSubmit_doSavedependencychanges" />
+        #set ($newDependGroup = $intake.Depend.setKey("modifyDep$currentIssue.QueryKey"))
+        ## dependency type
+
+        <select name="modifyDepTo" class="select">
+          <option selected="selected" value="" >$l10n.ChooseRelation</option>
+          <option                     value="remove" >$l10n.RemoveRelation</option>
+          #foreach ($dependType in $currentIssue.AllDependencyTypes)
+            <option value="$dependType.DependTypeId">#verboseDependency($dependType.Name "IsBlocked")</option>
+            #if ($dependType.Name.equals("blocking"))
+              <option value="-$dependType.DependTypeId">#verboseDependency($dependType.Name "Blocks")</option>
+            #end
+          #end
+        </select>
+      </div>
+    #end
+  ##else
+  ##  <div class="functnbar3"></div>
+  #end
+
+
+
+  ################################################################################
+  ####   "Add Dependency" form
+  ################################################################################
+
+  #if ($canEdit)
+   <h4>$l10n.AddRelationTitle</h4>
+   <div class="axial">
+    <table border="0" cellspacing="2" cellpadding="3">
+      <tr>
+        <th>$l10n.NewRelation</th>
+        <td colspan=2>
+          ## current issue
+          $currentIssue.UniqueId
+
+          #set ($newDependGroup = $intake.Depend.setKey("newDep$currentIssue.QueryKey"))
+          ## issue to be entered
+          <input type="hidden" name="$newDependGroup.ObservedId.Key" value="$currentIssue.IssueId" />
+          ## dependency type
+          <select name="$newDependGroup.TypeId.Key" class="select">
+            <option value="">$l10n.ChooseRelation</option>
+            #foreach ($dependType in $currentIssue.AllDependencyTypes)
+              #set ($selected = false)
+              #if ($dependType.DependTypeId.toString().equals($newDependGroup.TypeId.toString()))
+                #set ($selected = true)
+              #end
+              <option#selected($selected) value="-$dependType.DependTypeId">#verboseDependency($dependType.Name "IsBlocked")</option>
+              #if ($dependType.Name.equals("blocking"))
+                <option value="$dependType.DependTypeId">#verboseDependency($dependType.Name "Blocks")</option>
+              #end
+            #end
+          </select>
+
+          $l10n.RelatedIssue 
+
+          <input type="text"  name="$newDependGroup.ObserverUniqueId.Key" value = "$!newDependGroup.ObserverUniqueId"  title="$l10n.PleaseEnterIssueID"/>
+    
+          ## Error messages
+          #set ($idMessage = $newDependGroup.ObserverUniqueId.Message.toString())
+          #if ($idMessage.length() > 0)
+            <p class="warningmark"><em>$idMessage</em></p>
+          #end
+          #set ($typeMessage = $newDependGroup.TypeId.Message.toString())
+          #if ($typeMessage.length() > 0)
+            <p class="warningmark"><em>$typeMessage</em></p>
+          #end
+         </td>
+      </tr>
+      <tr>
+        <th>$l10n.Reason</th>
+        <td colspan="3">
+          #textAreaMedium("$newDependGroup.Description.Key" "$newDependGroup.Description")
+          #fieldErrorMsg($newDependGroup.Description "")
+        </td>
+      </tr>
+    </table>
+   </div>
+  #end
+
+  ################################################################################
+  ####   Footer
+  ################################################################################
 
   #if ($canEdit)
     <div class="functnbar3">
       <input type="submit" value="$l10n.AddRelationButton"  name="eventSubmit_doSavenewdependencies" />&nbsp;
     </div>
   #end
-

-</div>

-

-<div id="go.tooltip" class="scarab-tooltip">

-    This issue ($currentIssue.UniqueId) is currently NOT blocked by the issue mentioned right to this icon.

-</div>

-

-<div id="stop.tooltip" class="scarab-tooltip">

-    This issue ($currentIssue.UniqueId) is currently blocked by the the issue mentioned right to this icon.

-</div>

-

-<div id="blocking.tooltip" class="scarab-tooltip">

-    This issue ($currentIssue.UniqueId) is currently blocking the other issue mentioned in the next column.

-</div>

-<div id="nonblocking.tooltip" class="scarab-tooltip">

-    This issue ($currentIssue.UniqueId) is currently NOT blocking the other issue mentioned in the next column.

-</div>

+
+</div>
+
+<div id="go.tooltip" class="scarab-tooltip">
+    This issue ($currentIssue.UniqueId) is currently NOT blocked by the issue mentioned right to this icon.
+</div>
+
+<div id="stop.tooltip" class="scarab-tooltip">
+    This issue ($currentIssue.UniqueId) is currently blocked by the the issue mentioned right to this icon.
+</div>
+
+<div id="blocking.tooltip" class="scarab-tooltip">
+    This issue ($currentIssue.UniqueId) is currently blocking the other issue mentioned in the next column.
+</div>
+<div id="nonblocking.tooltip" class="scarab-tooltip">
+    This issue ($currentIssue.UniqueId) is currently NOT blocking the other issue mentioned in the next column.
+</div>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.