Scarab commit: svn commit: r11325 - branches/scarab_11079_legacy_with_ant_maven1/src/webapp/WEB-INF/templates: macros viewIssue
[email protected] Tue, 23 Apr 2013 07:41:18 -0700 (PDT)
| Newsgroups | gmane.comp.java.scarab.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: dabbous
Date: 2013-04-23 07:41:18-0700
New Revision: 11325
Modified:
branches/scarab_11079_legacy_with_ant_maven1/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm
branches/scarab_11079_legacy_with_ant_maven1/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab1.vm
Log:
fix: readonly & mandantory fields would stop issue save even if readonly attributes are set
Modified: branches/scarab_11079_legacy_with_ant_maven1/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm
Url: http://scarab.tigris.org/source/browse/scarab/branches/scarab_11079_legacy_with_ant_maven1/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm?view=diff&pathrev=11325&r1=11324&r2=11325
==============================================================================
--- branches/scarab_11079_legacy_with_ant_maven1/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm (original)
+++ branches/scarab_11079_legacy_with_ant_maven1/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm 2013-04-23 07:41:18-0700
@@ -78,7 +78,7 @@
$displayValue
#end
-#macro (attrValueLeafSelect $attrValue $optionFieldName $size $multiple $required)
+#macro (attrValueLeafSelect $attrValue $optionFieldName $size $multiple $required $editable)
#set ($attrInput = $intake.AttributeValue.mapTo($attrValue))
#set ($attr = $attrValue.Attribute)
#set ($attributeType = $attr.AttributeType)
@@ -147,7 +147,8 @@
#set ($dummy = $attributeTreePopupHelper.add($attributeTreePopup) )
#elseif ($attributeClassName == "ComboBoxAttribute")
-
+
+ #if ($editable)
<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 == '' ))
@@ -191,7 +192,28 @@
#end
#end
</select>
+ #else
+ #set ($optionid="")
+ #foreach ($option in $module.getOptionTree($attr, $issueType, false))
+ #if ($newValues && $newValues.toString() != '')
+ #if ($multiple.equals("true"))
+ #foreach ($value in $newValues)
+ #if ($value.equals($option.OptionId))
+ #set ($optionid=$option.OptionId)
+ #end
+ #end
+ #else
+ #if ($newValues.equals($option.OptionId))
+ #set ($optionid=$option.OptionId)
+ #end
+ #end
+ #end
+ #end
+ #if ($optionid != "")
+ <input type="hidden" name="$attrInput.get($optionFieldName).Key" value ="$optionid" />
+ #end
+ #end
#end
#end
Modified: branches/scarab_11079_legacy_with_ant_maven1/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab1.vm
Url: http://scarab.tigris.org/source/browse/scarab/branches/scarab_11079_legacy_with_ant_maven1/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab1.vm?view=diff&pathrev=11325&r1=11324&r2=11325
==============================================================================
--- branches/scarab_11079_legacy_with_ant_maven1/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab1.vm (original)
+++ branches/scarab_11079_legacy_with_ant_maven1/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab1.vm 2013-04-23 07:41:18-0700
@@ -122,7 +122,7 @@
#end
<span style="display:inline;margin-left:0px; margin-right:10px;">
#if ($att.isOptionAttribute())
- #attrValueLeafSelect ($attVal $field "" false $attVal.isRequired())
+ #attrValueLeafSelect ($attVal $field "" false $attVal.isRequired() $userCanEditGroup)
#attrValueErrorMsg ($attVal $field)
#elseif ($att.isIntegerAttribute())
#attrValueText($attVal $attrInput.NumericValue $fieldSize $fieldHint)
@@ -147,7 +147,7 @@
#else
<span id="${displayValue}:Container" #if ($isHidden) style="display:none;" #else style="display:inline;" #end>
#end
- <span class="displayValue" style="white-space:nowrap;display:inline;margin-left:0px; margin-right:20px;">$displayValue</span>
+ <span class="displayValue" style="white-space:nowrap;display:inline;margin-left:0px; margin-right:20px;">#drawRequiredMarkupAsNeeded($user $currentIssue $att)$displayValue</span>
#if ($currentRow==0)
</th>
<td colspan="$colspan">
@@ -159,7 +159,7 @@
#end
<tr>
<th class="displayLabel">
- <span style="white-space:nowrap;display:inline;margin-left:0px; margin-right:0px;">$displayValue</span>
+ <span style="white-space:nowrap;display:inline;margin-left:0px; margin-right:20px;">#drawRequiredMarkupAsNeeded($user $currentIssue $att)$displayValue</span>
#if($fieldExtraHeader && $fieldExtraHeader.size()>0)
<pre>$fieldExtraHeader</pre>
#end
@@ -169,6 +169,7 @@
#end
<span style="display:inline;margin-left:0px; margin-right:10px;">
#if ($att.isOptionAttribute())
+ #attrValueLeafSelect ($attVal $field "" false $attVal.isRequired() $userCanEditGroup)
#if (!$attVal.AttributeOption)
#else
------------------------------------------------------
http://scarab.tigris.org/ds/viewMessage.do?dsForumId=3577&dsMessageId=3054041