Jean-Francois Leveque

Simplification page

......@@ -106,11 +106,11 @@ public class UpdateUserBean {
}
public String prepareUpdate(int userId) {
ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
Logger logger = LoggerFactory.getLogger(UpdateUserBean.class);
logger.info("prepareUpdate");
logger.info("userId ="+userId);
this.userId = userId;
if (userId != 0) {
User user = userService.findUserById(userId);
if (user != null) {
......@@ -123,6 +123,7 @@ public class UpdateUserBean {
firstName = user.getFirstName();
lastName = user.getLastName();
nickName = user.getNickName();
password = user.getPassword();
presentation = user.getPresentation();
roles = user.getRoles();
if (roles == null) {
......@@ -137,6 +138,10 @@ public class UpdateUserBean {
}
public String update() {
Logger logger = LoggerFactory.getLogger(UpdateUserBean.class);
logger.info("update");
logger.info("userId ="+userId);
User user = userService.findUserById(userId);
user.setActivated(activated);
user.setAnonymous(anonymous);
......@@ -155,6 +160,7 @@ public class UpdateUserBean {
userService.updateUser(user);
return "success";
}
public String getFirstName() {
return firstName;
}
......
......@@ -79,6 +79,10 @@
<from-outcome>cancel</from-outcome>
<to-view-id>/listUsers.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/listUsers.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/listUsers.xhtml</from-view-id>
......
......@@ -90,7 +90,7 @@
</td>
<td colspan="2"><!--<rich:editor id="text" value="#{updateUserBean.presentation}" configuration="article-editor"/>--></td>
</tr>
<!--
<ui:remove>
<ui:fragment rendered="#{updateUserBean.userId != 0}">
<tr>
<td colspan="3" class="taCenter">
......@@ -109,7 +109,7 @@
</td>
</tr>
</ui:fragment>
-->
</ui:remove>
<tr>
<td><h:outputLabel for="criticProvider">Archives de critiques ?</h:outputLabel></td>
<td><h:selectBooleanCheckbox id="criticProvider" value="#{updateUserBean.criticProvider}"/></td>
......@@ -133,11 +133,11 @@
</table>
</h:form>
</p:panel>
<ui:remove>
<p:panel headerClass="colDroite" bodyClass="colTexte" label="Import d'anciennes donnes"
switchType="ajax" opened="true" rendered="#{updateUserBean.userId != 0}">
<h:form>
<!-- <s:validateAll>-->
<!--<s:validateAll>-->
<p>
La prsente section est destine raffecter des critiques, des commentaires ou des
articles posts dans le Grog v1 par cet utilisateur. N'effectuez cette opration qu'en
......@@ -173,6 +173,7 @@
<!--</s:validateAll>-->
</h:form>
</p:panel>
</ui:remove>
<!--
<h:form rendered="#{updateUserBean.userId != 0}">
<h3>Dlgations</h3>
......