ItEr49S04ValidacionEProbasFuncionaisItEr48S04: [Bug #359] Allowing see data of predefined (immutable) advance types.
This commit is contained in:
parent
282bb44548
commit
67c9aa462e
5 changed files with 28 additions and 8 deletions
|
|
@ -260,4 +260,8 @@ public class AdvanceTypeCRUDController extends GenericForwardComposer {
|
|||
save();
|
||||
}
|
||||
|
||||
public boolean isImmutable() {
|
||||
return advanceTypeModel.isImmutable();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public class AdvanceTypeModel implements IAdvanceTypeModel {
|
|||
@Transactional(readOnly = true)
|
||||
public void prepareForEdit(AdvanceType advanceType) {
|
||||
Validate.notNull(advanceType);
|
||||
checkCanBeModified(advanceType);
|
||||
// checkCanBeModified(advanceType);
|
||||
this.advanceType = getFromDB(advanceType);
|
||||
}
|
||||
|
||||
|
|
@ -176,4 +176,12 @@ public class AdvanceTypeModel implements IAdvanceTypeModel {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isImmutable() {
|
||||
if (advanceType == null) {
|
||||
return false;
|
||||
}
|
||||
return advanceType.isImmutable();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,4 +123,6 @@ public interface IAdvanceTypeModel {
|
|||
void setPercentage(Boolean percentage);
|
||||
|
||||
Boolean getPercentage();
|
||||
|
||||
boolean isImmutable();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,11 +34,13 @@
|
|||
<rows>
|
||||
<row>
|
||||
<label value="${i18n:_('Unit name')}" />
|
||||
<textbox value="@{controller.advanceType.unitName}" constraint="@{controller.distinctNames}" width="300px"/>
|
||||
<textbox value="@{controller.advanceType.unitName}" constraint="@{controller.distinctNames}" width="300px"
|
||||
disabled="@{controller.immutable}" />
|
||||
</row>
|
||||
<row>
|
||||
<label value="${i18n:_('Active')}" />
|
||||
<checkbox checked="@{controller.advanceType.active}"/>
|
||||
<checkbox checked="@{controller.advanceType.active}"
|
||||
disabled="@{controller.immutable}" />
|
||||
</row>
|
||||
<row>
|
||||
<label value="${i18n:_('Default max value')}" />
|
||||
|
|
@ -49,7 +51,8 @@
|
|||
<row>
|
||||
<label value="${i18n:_('Precision')}" />
|
||||
<decimalbox id="precision" scale="4"
|
||||
value = "@{controller.advanceType.unitPrecision}" constraint = "@{controller.lessThanDefaultMaxValue}"/>
|
||||
value = "@{controller.advanceType.unitPrecision}" constraint = "@{controller.lessThanDefaultMaxValue}"
|
||||
disabled="@{controller.immutable}" />
|
||||
</row>
|
||||
<row>
|
||||
<label value="${i18n:_('Type')}" />
|
||||
|
|
@ -57,7 +60,8 @@
|
|||
</row>
|
||||
<row>
|
||||
<label value="${i18n:_('Percentage')}" />
|
||||
<checkbox id="percentage" checked="@{controller.percentage}" />
|
||||
<checkbox id="percentage" checked="@{controller.percentage}"
|
||||
disabled="@{controller.immutable}" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
|
@ -67,10 +71,12 @@
|
|||
|
||||
<button onClick="controller.saveAndExit();"
|
||||
label="${arg.save_button_label}"
|
||||
sclass="save-button global-action"/>
|
||||
sclass="save-button global-action"
|
||||
disabled="@{controller.immutable}" />
|
||||
<button onClick="controller.saveAndContinue();"
|
||||
label="${arg.save_and_continue_button_label}"
|
||||
sclass="save-button global-action"/>
|
||||
sclass="save-button global-action"
|
||||
disabled="@{controller.immutable}" />
|
||||
<button onClick="controller.cancel();"
|
||||
label="${arg.cancel_button_label}"
|
||||
sclass="cancel-button global-action" />
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
<hbox>
|
||||
<button sclass="icono" image="/common/img/ico_editar1.png"
|
||||
hoverImage="/common/img/ico_editar.png"
|
||||
tooltiptext="${i18n:_('Edit')}" disabled="@{advanceType.immutable}" onClick="controller.goToEditForm(self.parent.parent.value);">
|
||||
tooltiptext="${i18n:_('Edit')}" onClick="controller.goToEditForm(self.parent.parent.value);">
|
||||
</button>
|
||||
<button sclass="icono" image="/common/img/ico_borrar1.png"
|
||||
hoverImage="/common/img/ico_borrar.png"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue