tim-connector: Hide Tim sync UI in order edition if Tim is not activated

Like in the case of JIRA, the Tim synchronization UI in the project edition will
only appear if Tim connector is activated.

FEA: ItEr77S16JiraAndTimConnectorContributionIntegration
This commit is contained in:
Manuel Rego Casasnovas 2013-02-13 13:45:47 +01:00
parent ab41d205cd
commit 04f3138b82
2 changed files with 27 additions and 28 deletions

View file

@ -100,9 +100,9 @@ public class TimSynchronizationController extends GenericForwardComposer {
}
}
public boolean isTimDeactivated() {
public boolean isTimActivated() {
AppProperties appProperties = appPropertiesDAO.findByMajorIdAndName(
"Tim", "Activated");
return !appProperties.getPropertyValue().equalsIgnoreCase("Y");
return appProperties.getPropertyValue().equalsIgnoreCase("Y");
}
}

View file

@ -17,39 +17,38 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<vbox id="${arg.id}"
apply="org.libreplan.web.orders.TimSynchronizationController" width="100%">
<groupbox style="margin-top: 5px" closable="false">
<caption label="${i18n:_('Tim sync information')}" />
<separator spacing="10px"/>
<hbox width="100%">
<separator spacing="10px" width="100%"/>
<grid fixedLayout="true" hflex="1">
<columns>
<column width="200px" />
<column />
</columns>
<rows>
<row>
<label value="${i18n:_('Tim last sync')}"/>
<hbox>
<groupbox id="${arg.id}"
apply="org.libreplan.web.orders.TimSynchronizationController"
style="margin-top: 5px" closable="false"
visible="@{timSynchronizationController.timActivated}">
<caption label="${i18n:_('Tim sync information')}" />
<separator spacing="10px"/>
<hbox width="100%">
<separator spacing="10px" width="100%"/>
<grid fixedLayout="true" hflex="1">
<columns>
<column width="200px" />
<column />
</columns>
<rows>
<row>
<label value="${i18n:_('Tim last sync')}"/>
<hbox>
<label id="labelLastSyncDate" value=""/>
<separator bar="false" spacing="15px" orient="vertical"/>
<label id="labelProductCode" value=""/>
</hbox>
</row>
<row>
<label value="${i18n:_('Tim product code')}"/>
<hbox>
</hbox>
</row>
<row>
<label value="${i18n:_('Tim product code')}"/>
<hbox>
<textbox id="txtProductCode" value=""
width="350px"/>
<button label="${i18n:_('Export to Tim')}" id="exportToTimButton" disabled="@{timSynchronizationController.timDeactivated}"
<button label="${i18n:_('Export to Tim')}" id="exportToTimButton"
onClick="timSynchronizationController.startExportToTim()" />
</hbox>
</hbox>
</row>
</rows>
</grid>
</hbox>
</groupbox>
</vbox>
</groupbox>