Author: echatellier Date: 2014-06-02 20:45:22 +0200 (Mon, 02 Jun 2014) New Revision: 122 Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/122 Log: Rectaroring (retours kevin) Added: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/ContextAction.java trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MainAction.java trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/LdapAction.java trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/ldap-input.jsp Removed: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/Action.java trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/FakeLdapProvider.java trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/LdapProvider.java trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/LdapJob.java Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/UserService.java trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ValidationService.java trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/AbstractFaxToMailServiceTest.java trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MailFolderServiceTest.java trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java trunk/faxtomail-ui-web/src/main/resources/i18n/faxtomail-ui-web_fr_FR.properties trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java =================================================================== --- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java 2014-06-02 15:45:55 UTC (rev 121) +++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java 2014-06-02 18:45:22 UTC (rev 122) @@ -251,10 +251,6 @@ public String getLdapPassword() { return applicationConfig.getOption(FaxToMailConfigurationOption.LDAP_PASSWORD.getKey()); } - - public boolean isLdapMock() { - return applicationConfig.getOptionAsBoolean(FaxToMailConfigurationOption.LDAP_MOCK.getKey()); - } public String getInstanceUrl() { return applicationConfig.getOption(FaxToMailConfigurationOption.INSTANCE_URL.getKey()); Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java =================================================================== --- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java 2014-06-02 15:45:55 UTC (rev 121) +++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java 2014-06-02 18:45:22 UTC (rev 122) @@ -103,10 +103,6 @@ "faxtomail.ldap.password", "Mot de passe pour la connexion au serveur LDAP", null, String.class), - LDAP_MOCK( - "faxtomail.ldap.mock", - "Use mock ldap provider for test purpose", "false", Boolean.class), - // TRANSIENT CONFIG VERSION( "faxtomail.version", Deleted: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/Action.java =================================================================== --- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/Action.java 2014-06-02 15:45:55 UTC (rev 121) +++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/Action.java 2014-06-02 18:45:22 UTC (rev 122) @@ -1,40 +0,0 @@ -package com.franciaflex.faxtomail.persistence.entities; - -/* - * #%L - * FaxToMail :: Persistence - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2014 Franciaflex, Code Lutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -/** - * @author Kevin Morin (Code Lutin) - * @since x.x - */ -public enum Action { - - SAVE, - TRANSMIT, - PRINT, - ARCHIVE, - REPLY, - GROUP - -} Added: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/ContextAction.java =================================================================== --- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/ContextAction.java (rev 0) +++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/ContextAction.java 2014-06-02 18:45:22 UTC (rev 122) @@ -0,0 +1,36 @@ +package com.franciaflex.faxtomail.persistence.entities; + +/* + * #%L + * FaxToMail :: Persistence + * $Id: Action.java 48 2014-04-25 13:43:04Z echatellier $ + * $HeadURL: https://svn.codelutin.com/faxtomail/trunk/faxtomail-persistence/src/main/jav... $ + * %% + * Copyright (C) 2014 Franciaflex, Code Lutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +/** + * @author Kevin Morin (Code Lutin) + * @since x.x + */ +public enum ContextAction { + + CHANGE_PRIORITY, + AUTO_SAVE + +} Property changes on: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/ContextAction.java ___________________________________________________________________ Added: svn:mime-type + text/plain Copied: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MainAction.java (from rev 121, trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/Action.java) =================================================================== --- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MainAction.java (rev 0) +++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MainAction.java 2014-06-02 18:45:22 UTC (rev 122) @@ -0,0 +1,40 @@ +package com.franciaflex.faxtomail.persistence.entities; + +/* + * #%L + * FaxToMail :: Persistence + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2014 Franciaflex, Code Lutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +/** + * @author Kevin Morin (Code Lutin) + * @since x.x + */ +public enum MainAction { + + SAVE, + TRANSMIT, + PRINT, + ARCHIVE, + REPLY, + GROUP + +} Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo =================================================================== (Binary files differ) Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java =================================================================== --- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-06-02 15:45:55 UTC (rev 121) +++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-06-02 18:45:22 UTC (rev 122) @@ -33,7 +33,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.Writer; -import java.net.URL; import java.util.ArrayList; import java.util.Collection; import java.util.Date; @@ -41,7 +40,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Properties; import java.util.Set; import javax.activation.DataSource; Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java =================================================================== --- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-06-02 15:45:55 UTC (rev 121) +++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-06-02 18:45:22 UTC (rev 122) @@ -24,6 +24,26 @@ * #L% */ +import static org.nuiton.i18n.I18n.t; + +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; + +import org.apache.commons.lang3.RandomStringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.nuiton.decorator.Decorator; +import org.nuiton.jaxx.application.ApplicationTechnicalException; + import com.franciaflex.faxtomail.FaxToMailConfiguration; import com.franciaflex.faxtomail.persistence.entities.Client; import com.franciaflex.faxtomail.persistence.entities.DemandStatus; @@ -53,27 +73,6 @@ import com.google.common.collect.Lists; import com.google.common.collect.Sets; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.SystemUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.nuiton.decorator.Decorator; -import org.nuiton.jaxx.application.ApplicationTechnicalException; - -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Random; - -import static org.nuiton.i18n.I18n.t; - public class InitFaxToMailService extends FaxToMailServiceSupport { private static final Log log = LogFactory.getLog(InitFaxToMailService.class); Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java =================================================================== --- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java 2014-06-02 15:45:55 UTC (rev 121) +++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java 2014-06-02 18:45:22 UTC (rev 122) @@ -1,6 +1,8 @@ package com.franciaflex.faxtomail.services.service; +import java.util.ArrayList; import java.util.Collection; +import java.util.List; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; @@ -15,29 +17,69 @@ import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserImpl; import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserTopiaDao; import com.franciaflex.faxtomail.services.FaxToMailServiceSupport; -import com.franciaflex.faxtomail.services.service.ldap.FakeLdapProvider; -import com.franciaflex.faxtomail.services.service.ldap.LdapProvider; import com.franciaflex.faxtomail.services.service.ldap.LdapUser; +import com.unboundid.ldap.sdk.LDAPConnection; +import com.unboundid.ldap.sdk.LDAPException; +import com.unboundid.ldap.sdk.SearchResult; +import com.unboundid.ldap.sdk.SearchResultEntry; +import com.unboundid.ldap.sdk.SearchScope; public class LdapService extends FaxToMailServiceSupport { private static final Log log = LogFactory.getLog(LdapService.class); - protected LdapProvider ldapProvider; + /** + * Get ldap connection. + * + * @return + * @throws LDAPException + */ + protected LDAPConnection getLDAPConnection() throws LDAPException { + // host, port, username and password + return new LDAPConnection(getApplicationConfig().getLdapHost(), + getApplicationConfig().getLdapPort(), + getApplicationConfig().getLdapUser(), + getApplicationConfig().getLdapPassword()); + } - protected LdapProvider getLdapProvider() { - if (ldapProvider == null) { - FaxToMailConfiguration config = getApplicationConfig(); - if (config.isLdapMock()) { - ldapProvider = new FakeLdapProvider(); - if (log.isInfoEnabled()) { - log.info("Using fake ldap provider"); + /** + * Get all user from ldap. + * + * @return ldap users with group infos + */ + public Collection<LdapUser> getAllLdapUsers() { + Collection<LdapUser> results = new ArrayList<>(); + + // ldapsearch -h ldap.codelutin.home -b "ou=People,DC=codelutin,DC=home" "objectClass=posixGroup" + // ldapsearch -h ldap.codelutin.home -b "ou=People,DC=codelutin,DC=home" "objectClass=account" + String baseDN = "ou=People,DC=codelutin,DC=home"; + String filter = "(objectClass=account)"; + + LDAPConnection connection = null; + try { + connection = getLDAPConnection(); + if (connection.isConnected()) { + SearchResult searchResult = connection.search(baseDN, SearchScope.ONE, filter); + + List<SearchResultEntry> searchEntries = searchResult.getSearchEntries(); + for (SearchResultEntry searchEntry : searchEntries) { + LdapUser user = new LdapUser(); + user.setLogin(searchEntry.getAttributeValue("uid")); + user.setLogin(searchEntry.getAttributeValue("uid")); + user.setLogin(searchEntry.getAttributeValue("uid")); + + results.add(user); } - } else { - ldapProvider = new LdapProvider(config); } + } catch (LDAPException ex) { + throw new RuntimeException("Can't connect to ldap", ex); + } finally { + if (connection != null) { + connection.close(); + } } - return ldapProvider; + + return results; } /** @@ -55,7 +97,7 @@ } } - Collection<LdapUser> ldapUsers = getLdapProvider().getAllLdapUsers(); + Collection<LdapUser> ldapUsers = getAllLdapUsers(); FaxToMailUserTopiaDao faxtomailUserDao = getPersistenceContext().getFaxToMailUserDao(); FaxToMailUserGroupTopiaDao faxToMailUserGroupDao = getPersistenceContext().getFaxToMailUserGroupDao(); Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/UserService.java =================================================================== --- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/UserService.java 2014-06-02 15:45:55 UTC (rev 121) +++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/UserService.java 2014-06-02 18:45:22 UTC (rev 122) @@ -24,15 +24,15 @@ * #L% */ +import java.util.ArrayList; +import java.util.List; + import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser; import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup; import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroupTopiaDao; import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserTopiaDao; import com.franciaflex.faxtomail.services.FaxToMailServiceSupport; -import java.util.ArrayList; -import java.util.List; - /** * @author kmorin <kmorin@codelutin.com> * @since x.x Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ValidationService.java =================================================================== --- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ValidationService.java 2014-06-02 15:45:55 UTC (rev 121) +++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ValidationService.java 2014-06-02 18:45:22 UTC (rev 122) @@ -24,12 +24,13 @@ * #L% */ -import com.franciaflex.faxtomail.persistence.entities.Email; -import com.franciaflex.faxtomail.services.FaxToMailServiceSupport; import org.nuiton.validator.NuitonValidator; import org.nuiton.validator.NuitonValidatorFactory; import org.nuiton.validator.NuitonValidatorResult; +import com.franciaflex.faxtomail.persistence.entities.Email; +import com.franciaflex.faxtomail.services.FaxToMailServiceSupport; + /** * To validate some incoming data using nuiton-validators. * Deleted: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/FakeLdapProvider.java =================================================================== --- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/FakeLdapProvider.java 2014-06-02 15:45:55 UTC (rev 121) +++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/FakeLdapProvider.java 2014-06-02 18:45:22 UTC (rev 122) @@ -1,33 +0,0 @@ -package com.franciaflex.faxtomail.services.service.ldap; - -import java.util.Arrays; -import java.util.Collection; - -import com.unboundid.ldap.sdk.LDAPException; - -/** - * Fake ldap provider for test/demo purpose. - * - * @author Eric Chatellier - */ -public class FakeLdapProvider extends LdapProvider { - - @Override - public Collection<LdapUser> getAllLdapUsers() { - - LdapUser ldapUser1 = new LdapUser(); - ldapUser1.setLogin("user1"); - ldapUser1.addGroup("Groupe 1"); - - LdapUser ldapUser2 = new LdapUser(); - ldapUser2.setLogin("user2"); - ldapUser2.addGroup("Groupe 1"); - - LdapUser ldapUser3 = new LdapUser(); - ldapUser3.setLogin("user3"); - ldapUser3.addGroup("Groupe 2"); - - return Arrays.asList(ldapUser1, ldapUser2, ldapUser3); - } - -} Deleted: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/LdapProvider.java =================================================================== --- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/LdapProvider.java 2014-06-02 15:45:55 UTC (rev 121) +++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/LdapProvider.java 2014-06-02 18:45:22 UTC (rev 122) @@ -1,85 +0,0 @@ -package com.franciaflex.faxtomail.services.service.ldap; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import com.franciaflex.faxtomail.FaxToMailConfiguration; -import com.unboundid.ldap.sdk.LDAPConnection; -import com.unboundid.ldap.sdk.LDAPException; -import com.unboundid.ldap.sdk.SearchResult; -import com.unboundid.ldap.sdk.SearchResultEntry; -import com.unboundid.ldap.sdk.SearchScope; - -/** - * Real ldap provider. - * - * @author Eric Chatellier - */ -public class LdapProvider { - - protected FaxToMailConfiguration config; - - protected LdapProvider() { - - } - - public LdapProvider(FaxToMailConfiguration config) { - this(); - this.config = config; - } - - /** - * Get ldap connection. - * - * @return - * @throws LDAPException - */ - protected LDAPConnection getLDAPConnection() throws LDAPException { - // host, port, username and password - return new LDAPConnection(config.getLdapHost(), - config.getLdapPort(), - config.getLdapUser(), - config.getLdapPassword()); - } - - /** - * Get all user from ldap. - * - * @return ldap users with group infos - */ - public Collection<LdapUser> getAllLdapUsers() { - Collection<LdapUser> results = new ArrayList<>(); - - // ldapsearch -h ldap.codelutin.home -b "ou=People,DC=codelutin,DC=home" "objectClass=posixGroup" - // ldapsearch -h ldap.codelutin.home -b "ou=People,DC=codelutin,DC=home" "objectClass=account" - String baseDN = "ou=People,DC=codelutin,DC=home"; - String filter = "(objectClass=account)"; - - LDAPConnection connection = null; - try { - connection = getLDAPConnection(); - if (connection.isConnected()) { - SearchResult searchResult = connection.search(baseDN, SearchScope.ONE, filter); - - List<SearchResultEntry> searchEntries = searchResult.getSearchEntries(); - for (SearchResultEntry searchEntry : searchEntries) { - LdapUser user = new LdapUser(); - user.setLogin(searchEntry.getAttributeValue("uid")); - user.setLogin(searchEntry.getAttributeValue("uid")); - user.setLogin(searchEntry.getAttributeValue("uid")); - - results.add(user); - } - } - } catch (LDAPException ex) { - throw new RuntimeException("Can't connect to ldap", ex); - } finally { - if (connection != null) { - connection.close(); - } - } - - return results; - } -} Modified: trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/AbstractFaxToMailServiceTest.java =================================================================== --- trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/AbstractFaxToMailServiceTest.java 2014-06-02 15:45:55 UTC (rev 121) +++ trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/AbstractFaxToMailServiceTest.java 2014-06-02 18:45:22 UTC (rev 122) @@ -24,11 +24,13 @@ * #L% */ -import com.franciaflex.faxtomail.FaxToMailConfiguration; -import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaApplicationContext; -import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext; -import com.franciaflex.faxtomail.services.FaxToMailService; -import com.franciaflex.faxtomail.services.FaxToMailServiceContext; +import java.io.File; +import java.io.IOException; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.UUID; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.SystemUtils; @@ -38,13 +40,11 @@ import org.junit.After; import org.nuiton.util.FileUtil; -import java.io.File; -import java.io.IOException; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.UUID; +import com.franciaflex.faxtomail.FaxToMailConfiguration; +import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaApplicationContext; +import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext; +import com.franciaflex.faxtomail.services.FaxToMailService; +import com.franciaflex.faxtomail.services.FaxToMailServiceContext; public class AbstractFaxToMailServiceTest { Modified: trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MailFolderServiceTest.java =================================================================== --- trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MailFolderServiceTest.java 2014-06-02 15:45:55 UTC (rev 121) +++ trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MailFolderServiceTest.java 2014-06-02 18:45:22 UTC (rev 122) @@ -26,14 +26,14 @@ import java.io.IOException; -import com.franciaflex.faxtomail.persistence.entities.MailFolder; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import com.franciaflex.faxtomail.persistence.entities.MailFolder; + /** * @author Kevin Morin (Code Lutin) * @since x.x Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java =================================================================== --- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-06-02 15:45:55 UTC (rev 121) +++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-06-02 18:45:22 UTC (rev 122) @@ -33,14 +33,16 @@ import org.apache.commons.logging.LogFactory; import org.apache.struts2.convention.annotation.Result; -import com.franciaflex.faxtomail.persistence.entities.Action; import com.franciaflex.faxtomail.persistence.entities.Configuration; import com.franciaflex.faxtomail.persistence.entities.ConfigurationImpl; +import com.franciaflex.faxtomail.persistence.entities.ContextAction; import com.franciaflex.faxtomail.persistence.entities.EmailAccount; import com.franciaflex.faxtomail.persistence.entities.EtatAttente; +import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser; import com.franciaflex.faxtomail.persistence.entities.Field; import com.franciaflex.faxtomail.persistence.entities.MailFilter; import com.franciaflex.faxtomail.persistence.entities.MailFolder; +import com.franciaflex.faxtomail.persistence.entities.MainAction; import com.franciaflex.faxtomail.services.service.ConfigurationService; import com.franciaflex.faxtomail.services.service.MailFolderService; import com.franciaflex.faxtomail.services.service.ReferentielService; @@ -70,7 +72,7 @@ protected List<MailFilter> mailFilters; - protected List<String> groupNames; + protected List<FaxToMailUser> users; protected List<EmailAccount> emailAccounts; @@ -84,7 +86,7 @@ public String input() throws Exception { etatAttentes = referentielService.getAllEtatAttente(); mailFolders = mailFolderService.getRootMailFolders(); - groupNames = Collections.emptyList(); //FIXME: configurationService.getAllGroups(); + users = configurationService.getAllUsers(); emailAccounts = configurationService.getEmailAccounts(); mailFilters = configurationService.getMailFilters(); return INPUT; @@ -133,11 +135,15 @@ this.etatAttentes = getGson().fromJson(json, type); } - public Map<Action, String> getEtatAttenteActions() { - return getEnumAsMap(Action.values()); + public Map<MainAction, String> getMainActions() { + return getEnumAsMap(MainAction.values()); } - public Map<Field, String> getEtatAttenteFields() { + public Map<ContextAction, String> getContextActions() { + return getEnumAsMap(ContextAction.values()); + } + + public Map<Field, String> getFields() { return getEnumAsMap(Field.values()); } @@ -150,8 +156,8 @@ this.mailFolders = getGson().fromJson(json, type); } - public List<String> getGroupNames() { - return groupNames; + public List<FaxToMailUser> getUsers() { + return users; } public List<MailFilter> getMailFilters() { @@ -167,7 +173,7 @@ return emailAccounts; } - public void setEmailAccounts(String json) { + public void setEmailAccountsJson(String json) { Type type = new TypeToken<List<EmailAccount>>() {}.getType(); this.emailAccounts = getGson().fromJson(json, type); } Added: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/LdapAction.java =================================================================== --- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/LdapAction.java (rev 0) +++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/LdapAction.java 2014-06-02 18:45:22 UTC (rev 122) @@ -0,0 +1,57 @@ +package com.franciaflex.faxtomail.web.action.admin; + +/* + * #%L + * FaxToMail :: Web + * $Id: UserFolderAction.java 121 2014-06-02 15:45:55Z echatellier $ + * $HeadURL: https://svn.codelutin.com/faxtomail/trunk/faxtomail-ui-web/src/main/java/com... $ + * %% + * Copyright (C) 2014 Franciaflex, Code Lutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.struts2.convention.annotation.Result; + +import com.franciaflex.faxtomail.services.service.LdapService; +import com.franciaflex.faxtomail.web.FaxToMailActionSupport; + +public class LdapAction extends FaxToMailActionSupport { + + private static final Log log = LogFactory.getLog(LdapAction.class); + + protected LdapService ldapService; + + public void setLdapService(LdapService ldapService) { + this.ldapService = ldapService; + } + + @Override + @org.apache.struts2.convention.annotation.Action("ldap-input") + public String input() throws Exception { + return INPUT; + } + + @Override + @org.apache.struts2.convention.annotation.Action(results = { + @Result(type = "redirectAction", params = {"actionName", "ldap-input"})}) + public String execute() throws Exception { + ldapService.updateLdapData(); + return SUCCESS; + } +} Property changes on: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/LdapAction.java ___________________________________________________________________ Added: svn:mime-type + text/plain Deleted: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/LdapJob.java =================================================================== --- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/LdapJob.java 2014-06-02 15:45:55 UTC (rev 121) +++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/LdapJob.java 2014-06-02 18:45:22 UTC (rev 122) @@ -1,28 +0,0 @@ -package com.franciaflex.faxtomail.web.job; - -import org.quartz.JobExecutionContext; -import org.quartz.JobExecutionException; - -import com.franciaflex.faxtomail.services.FaxToMailServiceContext; -import com.franciaflex.faxtomail.services.service.LdapService; - -/** - * Ce job interroge périodiquement l'annuaire ldap pour mettre à jour la liste - * des comptes et des utilisateurs directement dans la base de données faxtomail. - * - * @author Eric Chatellier - */ -public class LdapJob extends AbstractFaxToMailJob { - - protected FaxToMailServiceContext serviceContext; - - @Override - public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { - serviceContext = getServiceContext(jobExecutionContext); - - LdapService ldapService = serviceContext.newService(LdapService.class); - ldapService.updateLdapData(); - - } - -} Modified: trunk/faxtomail-ui-web/src/main/resources/i18n/faxtomail-ui-web_fr_FR.properties =================================================================== --- trunk/faxtomail-ui-web/src/main/resources/i18n/faxtomail-ui-web_fr_FR.properties 2014-06-02 15:45:55 UTC (rev 121) +++ trunk/faxtomail-ui-web/src/main/resources/i18n/faxtomail-ui-web_fr_FR.properties 2014-06-02 18:45:22 UTC (rev 122) @@ -1,9 +1,5 @@ -com.franciaflex.faxtomail.persistence.entities.Action.ARCHIVE=Archiver -com.franciaflex.faxtomail.persistence.entities.Action.GROUP=Grouper -com.franciaflex.faxtomail.persistence.entities.Action.PRINT=Imprimer -com.franciaflex.faxtomail.persistence.entities.Action.REPLY=Repondre -com.franciaflex.faxtomail.persistence.entities.Action.SAVE=Sauver -com.franciaflex.faxtomail.persistence.entities.Action.TRANSMIT=Transfer +com.franciaflex.faxtomail.persistence.entities.ContextAction.AUTO_SAVE=Sauver automatiquement +com.franciaflex.faxtomail.persistence.entities.ContextAction.CHANGE_PRIORITY=Changer la priorité com.franciaflex.faxtomail.persistence.entities.Field.ARCHIVE_DATE=Date d'archive com.franciaflex.faxtomail.persistence.entities.Field.ATTACHMENT=Pièces jointes com.franciaflex.faxtomail.persistence.entities.Field.CLIENT=Client @@ -24,4 +20,10 @@ com.franciaflex.faxtomail.persistence.entities.Field.RECIPIENT=Destinataire com.franciaflex.faxtomail.persistence.entities.Field.SENDER=Expéditeur com.franciaflex.faxtomail.persistence.entities.Field.TAKEN_BY=Pris par +com.franciaflex.faxtomail.persistence.entities.MainAction.ARCHIVE=Archiver +com.franciaflex.faxtomail.persistence.entities.MainAction.GROUP=Grouper +com.franciaflex.faxtomail.persistence.entities.MainAction.PRINT=Imprimer +com.franciaflex.faxtomail.persistence.entities.MainAction.REPLY=Repondre +com.franciaflex.faxtomail.persistence.entities.MainAction.SAVE=Sauver +com.franciaflex.faxtomail.persistence.entities.MainAction.TRANSMIT=Déplacer faxtomail.email.projectReference.default= Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp =================================================================== --- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-06-02 15:45:55 UTC (rev 121) +++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-06-02 18:45:22 UTC (rev 122) @@ -46,12 +46,15 @@ <script type="text/javascript"> angular.module('ConfigurationModule', ['FaxToMail', 'ui.tree', 'ui.sortable', 'ui.select2.sortable']) .value('ConfigurationData', { + // enums + 'mainActions': <s:property value="toJson(mainActions)" escapeHtml="false"/>, + 'contextActions': <s:property value="toJson(contextActions)" escapeHtml="false"/>, + 'fields': <s:property value="toJson(fields)" escapeHtml="false"/>, + // datas 'etatAttentes' : <s:property value="toJson(etatAttentes)" escapeHtml="false"/>, - 'etatAttenteActions': <s:property value="toJson(etatAttenteActions)" escapeHtml="false"/>, - 'etatAttenteFields': <s:property value="toJson(etatAttenteFields)" escapeHtml="false"/>, 'mailFolders': <s:property value="toJson(mailFolders)" escapeHtml="false"/>, 'searchDisplayColumns': <s:property value="toJson(configuration.searchDisplayColumns)" escapeHtml="false"/>, - 'groupNames': <s:property value="toJson(groupNames)" escapeHtml="false"/>, + 'users': <s:property value="toJson(users)" escapeHtml="false"/>, 'mailFilters': <s:property value="toJson(mailFilters)" escapeHtml="false"/>, 'emailAccounts': <s:property value="toJson(emailAccounts)" escapeHtml="false"/> }); @@ -90,9 +93,6 @@ <s:textfield name="configuration.emailMaxSize" label="Taille maximale des email (en bits)"/> - - <s:checkbox name="configuration.rejectUnknownSender" - label="Refuser les mails dont l'email est inconnu de la base client"/> <!-- Il faut pouvoir configurer le dossier par défaut de déplacement en fonction des champs saisis sur la fiche (configuration sur statut, type de fiche, ...). Ce dossier n'est qu'une proposition que l'utilisateur peut modifier)--> @@ -119,14 +119,14 @@ <div class="col-md-7" ng-if="selectedEtatAttente"> <h3>Édition de l'état d'attente {{selectedEtatAttente.label}}</h3> Champs obligatoires pour l'état d'attente : - <label class="checkbox" ng-repeat="(etatAttenteField,label) in etatAttenteFields"> - <input type="checkbox" ng-checked="selectedEtatAttente.fields.indexOf(etatAttenteField) != -1" - ng-click="changeEtatAttenteField(etatAttenteField)"> {{label}} + <label class="checkbox" ng-repeat="(field,label) in fields"> + <input type="checkbox" ng-checked="selectedEtatAttente.fields.indexOf(field) != -1" + ng-click="changeEtatAttenteField(field)"> {{label}} </label> Actions autorisées pour l'état d'attente : - <label class="checkbox" ng-repeat="(etatAttenteAction,label) in etatAttenteActions"> - <input type="checkbox" ng-checked="selectedEtatAttente.actions.indexOf(etatAttenteAction) != -1" - ng-click="changeEtatAttenteAction(etatAttenteAction)"> {{label}} + <label class="checkbox" ng-repeat="(mainAction,label) in mainActions"> + <input type="checkbox" ng-checked="selectedEtatAttente.mainActions.indexOf(mainAction) != -1" + ng-click="changeEtatAttenteAction(mainAction)"> {{label}} </label> </div> <div class="col-md-7" ng-if="!selectedEtatAttente"> @@ -321,9 +321,9 @@ </div> <div id="collapse5" class="panel-collapse collapse"> <div class="panel-body"> - <label class="checkbox" ng-repeat="(etatAttenteAction,label) in etatAttenteActions"> - <input type="checkbox" ng-checked="selectedMailFolder.folderActions.indexOf(etatAttenteAction) != -1" - ng-click="changeFolderAction(etatAttenteAction)"> {{label}} + <label class="checkbox" ng-repeat="(contextAction,label) in contextActions"> + <input type="checkbox" ng-checked="selectedMailFolder.contextActions.indexOf(contextAction) != -1" + ng-click="changeFolderAction(contextAction)"> {{label}} </label> </div> </div> @@ -334,7 +334,7 @@ <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#collapse6"> - Configuration des colonnes a afficher + Configuration des colonnes à afficher </a> </h4> </div> @@ -396,6 +396,24 @@ </div> <div class="form-group"> + <label class="control-label">Refuser les mails dont l'email est inconnu de la base client</label><br /> + <label class="radio-inline"> + <input type="radio" name="rejectUnknownSenderField" + ng-model="selectedMailFolder.rejectUnknownSender" ng-value="true"> oui + </label> + <label class="radio-inline"> + <input type="radio" name="rejectUnknownSenderField" + ng-model="selectedMailFolder.rejectUnknownSender" ng-value="false"> non + </label> + <label class="radio-inline"> + <input type="radio" name="rejectUnknownSenderField" + ng-model="selectedMailFolder.rejectUnknownSender" ng-value="undefined"> valeur du noeud parent + </label> + </div> + + + + <div class="form-group"> <label for="ediFolderField">Dossier (FS) de dépôt des demandes EDI</label> <input type="text" class="form-control" id="ediFolderField" ng-model="selectedMailFolder.ediFolder"> </div> Added: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/ldap-input.jsp =================================================================== --- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/ldap-input.jsp (rev 0) +++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/ldap-input.jsp 2014-06-02 18:45:22 UTC (rev 122) @@ -0,0 +1,54 @@ +<%-- + #%L + FaxToMail :: Web + $Id: user-folder-input.jsp 121 2014-06-02 15:45:55Z echatellier $ + $HeadURL: https://svn.codelutin.com/faxtomail/trunk/faxtomail-ui-web/src/main/webapp/W... $ + %% + Copyright (C) 2014 Franciaflex, Code Lutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program. If not, see + <http://www.gnu.org/licenses/gpl-3.0.html>. + #L% + --%> +<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> +<!DOCTYPE html> +<%@taglib uri="/struts-tags" prefix="s" %> + +<html> + <head> + <title>Ldap</title> + <link rel="stylesheet" type="text/css" href="<s:url value='/css/faxtomail.css' />" /> + + <script type="text/javascript" src="<s:url value='/js/faxtomail.js' />"></script> + </head> + + <body> + + <div id="main-container" class="container"> + + <h1 class="page-header">Ldap</h1> + + <s:form id="main_form" action="ldap" method="post"> + + <button type="submit" class="btn btn-primary navbar-btn">Mettre à jour les groupes et utilisateurs LDAP</button> + + <nav class="navbar navbar-default navbar-fixed-bottom"> + <!-- <div class="container"> + <button type="submit" class="btn btn-primary navbar-btn pull-right">Valider</button> + </div> --> + </nav> + </s:form> + </div> + </body> +</html> Property changes on: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/ldap-input.jsp ___________________________________________________________________ Added: svn:mime-type + text/plain Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp =================================================================== --- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp 2014-06-02 15:45:55 UTC (rev 121) +++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp 2014-06-02 18:45:22 UTC (rev 122) @@ -27,7 +27,7 @@ <html> <head> - <title>Import</title> + <title>Dossiers mis en avant par utilisateur</title> <link rel="stylesheet" type="text/css" href="<s:url value='/webjars/select2/3.4.8/select2.css' />" /> <link rel="stylesheet" type="text/css" href="<s:url value='/css/faxtomail.css' />" /> @@ -55,7 +55,7 @@ <h1 class="page-header">Dossiers mis en avant par utilisateur</h1> - <s:form id="main_form" action="user-folder" method="post" enctype="multipart/form-data" ng-controller="UserFolderController"> + <s:form id="main_form" action="user-folder" method="post" ng-controller="UserFolderController"> <s:hidden name="userFoldersJson" value="{{userFolders}}" /> <table id='table-snapshot' class="table table-bordered"> Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp =================================================================== --- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2014-06-02 15:45:55 UTC (rev 121) +++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2014-06-02 18:45:22 UTC (rev 122) @@ -52,11 +52,13 @@ </div> <nav class="collapse navbar-collapse" role="navigation"> <ul class="nav navbar-nav"> - <li><a href="<s:url action='configuration-input' />"> + <li><a href="<s:url action='ldap-input' namespace="/admin" />"> + <span class="glyphicon glyphicon-retweet"></span> Ldap</a></li> + <li><a href="<s:url action='configuration-input' namespace="/admin" />"> <span class="glyphicon glyphicon-cog"></span> Configuration</a></li> - <li><a href="<s:url action='import-input' />"> + <li><a href="<s:url action='import-input' namespace="/admin" />"> <span class="glyphicon glyphicon-upload"></span> Import</a></li> - <li><a href="<s:url action='user-folder-input' />"> + <li><a href="<s:url action='user-folder-input' namespace="/admin" />"> <span class="glyphicon glyphicon-th-list"></span> Dossiers utilisateur</a></li> </ul> </nav> Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js =================================================================== --- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-02 15:45:55 UTC (rev 121) +++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-02 18:45:22 UTC (rev 122) @@ -27,16 +27,16 @@ */ FaxToMailModule.controller('ConfigurationController', ['$scope', '$http', 'ConfigurationData', function($scope, $http, ConfigurationData) { - //{Array} mail folders - $scope.mailFolders = ConfigurationData.mailFolders; //{Map} les actions possibles pour les etats d'attentes - $scope.etatAttenteActions = ConfigurationData.etatAttenteActions; + $scope.mainActions = ConfigurationData.mainActions; //{Map} les champs obligatoires possibles - $scope.etatAttenteFields = ConfigurationData.etatAttenteFields; + $scope.fields = ConfigurationData.fields; + //{Map} les actions contextuelles possibles pour les dossiers + $scope.contextActions = ConfigurationData.contextActions; //{Array} les etats d'attentes disponibles $scope.etatAttentes = ConfigurationData.etatAttentes; - // {Array} Liste des groupes ldap - $scope.groupNames = ConfigurationData.groupNames; + //{Array} mail folders + $scope.mailFolders = ConfigurationData.mailFolders; // method privée recursive pour retourner l'ensemble des dossiers var recursiveAddMailFolder = function(result, mailFolders) { @@ -103,24 +103,24 @@ }; // selection/deselection d'une action - $scope.changeEtatAttenteAction = function(etatAttenteAction) { + $scope.changeEtatAttenteAction = function(action) { - var index = $scope.selectedEtatAttente.actions.indexOf(etatAttenteAction); + var index = $scope.selectedEtatAttente.mainActions.indexOf(action); if (index != -1) { - $scope.selectedEtatAttente.actions.splice(index, 1); + $scope.selectedEtatAttente.mainActions.splice(index, 1); } else { - $scope.selectedEtatAttente.actions.push(etatAttenteAction); + $scope.selectedEtatAttente.mainActions.push(action); } }; // selection/deselection d'un champ - $scope.changeEtatAttenteField = function(etatAttenteField) { + $scope.changeEtatAttenteField = function(field) { - var index = $scope.selectedEtatAttente.fields.indexOf(etatAttenteField); + var index = $scope.selectedEtatAttente.fields.indexOf(field); if (index != -1) { $scope.selectedEtatAttente.fields.splice(index, 1); } else { - $scope.selectedEtatAttente.fields.push(etatAttenteField); + $scope.selectedEtatAttente.fields.push(field); } }; }]); @@ -177,7 +177,7 @@ angular.forEach($scope.selectedMailFolder.folderTableColumns, function(folderTableColumn) { $scope.folderTableColumns.push({ id: folderTableColumn, - label: $scope.etatAttenteFields[folderTableColumn] + label: $scope.fields[folderTableColumn] }); }); }; @@ -207,7 +207,7 @@ // fonction retournant l'ensemble des options disponibles $scope.getObjectsData = function(term, result) { var resultArray = []; - angular.forEach($scope.etatAttenteFields, function(label, field) { + angular.forEach($scope.fields, function(label, field) { resultArray.push({ id: field, label: label @@ -249,12 +249,12 @@ }; // selection/deselection d'une action possible du menu contextuel pour ce dossier - $scope.changeFolderAction = function(etatAttenteAction) { - var index = $scope.selectedMailFolder.folderActions.indexOf(etatAttenteAction); + $scope.changeFolderAction = function(contextAction) { + var index = $scope.selectedMailFolder.contextActions.indexOf(contextAction); if (index != -1) { - $scope.selectedMailFolder.folderActions.splice(index, 1); + $scope.selectedMailFolder.contextActions.splice(index, 1); } else { - $scope.selectedMailFolder.folderActions.push(etatAttenteAction); + $scope.selectedMailFolder.contextActions.push(contextAction); } }; }]); @@ -294,14 +294,14 @@ angular.forEach(ConfigurationData.searchDisplayColumns, function(searchDisplayColumn) { $scope.searchDisplayColumns.push({ id: searchDisplayColumn, - label: $scope.etatAttenteFields[searchDisplayColumn] + label: $scope.fields[searchDisplayColumn] }); }); // fonction retournant l'ensemble des options disponibles $scope.getObjectsData = function(term, result) { var resultArray = []; - angular.forEach($scope.etatAttenteFields, function(label, field) { + angular.forEach($scope.fields, function(label, field) { resultArray.push({ id: field, label: label