Faxtomail-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- 1934 discussions
r138 - in trunk: faxtomail-persistence/src/main/xmi faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service
by echatellier@users.forge.codelutin.com 05 Jun '14
by echatellier@users.forge.codelutin.com 05 Jun '14
05 Jun '14
Author: echatellier
Date: 2014-06-05 17:57:29 +0200 (Thu, 05 Jun 2014)
New Revision: 138
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/138
Log:
Fix tree saving when adding and deleting nodes
Modified:
trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties
===================================================================
--- trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties 2014-06-05 14:47:30 UTC (rev 137)
+++ trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties 2014-06-05 15:57:29 UTC (rev 138)
@@ -60,6 +60,7 @@
com.franciaflex.faxtomail.persistence.entities.AttachmentFile.attribute.content.tagvalue.notNull=true
# MailFolder
+com.franciaflex.faxtomail.persistence.entities.MailFolder.class.tagvalue.naturalIdMutable=true
com.franciaflex.faxtomail.persistence.entities.MailFolder.attribute.parent.tagvalue.naturalId=true
com.franciaflex.faxtomail.persistence.entities.MailFolder.attribute.parent.tagvalue.notNull=false
com.franciaflex.faxtomail.persistence.entities.MailFolder.attribute.name.tagvalue.naturalId=true
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java 2014-06-05 14:47:30 UTC (rev 137)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java 2014-06-05 15:57:29 UTC (rev 138)
@@ -35,6 +35,7 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.persistence.TopiaEntities;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
import org.nuiton.util.pagination.PaginationParameter;
@@ -48,6 +49,7 @@
import com.franciaflex.faxtomail.persistence.entities.MailFolderTopiaDao;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
/**
* @author kmorin <kmorin(a)codelutin.com>
@@ -92,28 +94,37 @@
return new ArrayList<MailFolder>(dao.forTopiaIdIn(ids).findAll());
}
- public void saveMailFolders(Collection<MailFolder> mailFolders) {
- saveMailFolders(null, mailFolders);
+ public void saveMailFolders(Collection<MailFolder> newMailFolders) {
+ // get current folders
+ MailFolderTopiaDao dao = getPersistenceContext().getMailFolderDao();
+ List<MailFolder> mailFolders = dao.findAll();
+ Map<String, MailFolder> mailFolderMap = new HashMap<>(Maps.uniqueIndex(mailFolders, TopiaEntities.getTopiaIdFunction()));
+
+ // recursive update
+ saveMailFolders(dao, mailFolderMap, null, newMailFolders);
+
+ // if map is not empty after recursive iteration, remaining folder must be deleted
+ dao.deleteAll(mailFolderMap.values());
+
getPersistenceContext().commit();
}
- protected Collection<MailFolder> saveMailFolders(MailFolder parent, Collection<MailFolder> mailFolders) {
+ protected Collection<MailFolder> saveMailFolders(MailFolderTopiaDao dao, Map<String, MailFolder> mailFolderMap,
+ MailFolder parent, Collection<MailFolder> mailFolders) {
+
+ Collection<MailFolder> result = Lists.newArrayList();
if (mailFolders == null) {
- return null;
+ return result;
}
- Collection<MailFolder> result = Lists.newArrayList();
- MailFolderTopiaDao dao = getPersistenceContext().getMailFolderDao();
- //TopiaIdFactory factory = getPersistenceContext().getTopiaIdFactory();
Binder<MailFolder, MailFolder> binderMailFolder = BinderFactory.newBinder(MailFolder.class);
for (MailFolder mailFolder : mailFolders) {
- Collection<MailFolder> children = saveMailFolders(mailFolder, mailFolder.getChildren());
MailFolder currentMailFolder;
if (StringUtils.isBlank(mailFolder.getTopiaId()) || mailFolder.getTopiaId().startsWith("new_")) {
currentMailFolder = new MailFolderImpl();
} else {
- currentMailFolder = dao.findByTopiaId(mailFolder.getTopiaId());
+ currentMailFolder = mailFolderMap.remove(mailFolder.getTopiaId());
}
binderMailFolder.copyExcluding(mailFolder, currentMailFolder,
@@ -123,18 +134,19 @@
MailFolder.PROPERTY_CHILDREN,
MailFolder.PROPERTY_PARENT);
- currentMailFolder.setChildren(children);
currentMailFolder.setParent(parent);
- if (mailFolder.isPersisted()) {
- currentMailFolder = dao.update(currentMailFolder);
- } else {
+ if (!currentMailFolder.isPersisted()) {
currentMailFolder = dao.create(currentMailFolder);
}
+
+ Collection<MailFolder> children = saveMailFolders(dao, mailFolderMap, currentMailFolder, mailFolder.getChildren());
+ currentMailFolder.setChildren(children);
+ dao.update(currentMailFolder);
+
result.add(currentMailFolder);
}
-
- getPersistenceContext().commit();
+
return result;
}
1
0
r137 - in trunk/faxtomail-ui-web/src/main: java/com/franciaflex/faxtomail/web/action/admin webapp/WEB-INF/content/admin webapp/js
by echatellier@users.forge.codelutin.com 05 Jun '14
by echatellier@users.forge.codelutin.com 05 Jun '14
05 Jun '14
Author: echatellier
Date: 2014-06-05 16:47:30 +0200 (Thu, 05 Jun 2014)
New Revision: 137
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/137
Log:
refs #4662: Modification du formuaire des comptes mails
Modified:
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
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-05 13:48:35 UTC (rev 136)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-06-05 14:47:30 UTC (rev 137)
@@ -25,6 +25,7 @@
*/
import java.lang.reflect.Type;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -35,6 +36,7 @@
import com.franciaflex.faxtomail.persistence.entities.Configuration;
import com.franciaflex.faxtomail.persistence.entities.DemandType;
import com.franciaflex.faxtomail.persistence.entities.EmailAccount;
+import com.franciaflex.faxtomail.persistence.entities.EmailProtocol;
import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.FolderAction;
@@ -198,4 +200,12 @@
public Map<MailField, String> getMailFields() {
return getEnumAsMap(MailField.values());
}
+
+ public Map<EmailProtocol, Integer> getEmailProtocolPorts() {
+ Map<EmailProtocol, Integer> result = new LinkedHashMap<>();
+ for (EmailProtocol protocol : EmailProtocol.values()) {
+ result.put(protocol, protocol.getDefaultPort());
+ }
+ return result;
+ }
}
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-05 13:48:35 UTC (rev 136)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-06-05 14:47:30 UTC (rev 137)
@@ -50,6 +50,7 @@
'mailActions': <s:property value="toJson(mailActions)" escapeHtml="false"/>,
'folderActions': <s:property value="toJson(folderActions)" escapeHtml="false"/>,
'mailFields': <s:property value="toJson(mailFields)" escapeHtml="false"/>,
+ 'emailProtocolPorts': <s:property value="toJson(emailProtocolPorts)" escapeHtml="false"/>,
// datas
'configuration': <s:property value="toJson(configuration)" escapeHtml="false"/>,
'etatAttentes': <s:property value="toJson(etatAttentes)" escapeHtml="false"/>,
@@ -421,13 +422,11 @@
</table>
<div class="form-inline" ng-form="addAddressForm" role="form">
- <div class="form-group has-feedback"
+ <div class="form-group"
ng-class="{'has-error': addAddressForm.address.$dirty && addAddressForm.address.$invalid,
'has-success': addAddressForm.address.$dirty && addAddressForm.address.$valid}">
<label for="newAddressField" class="control-label">Nouvelle adresse : </label>
<input id="newAddressField" class="form-control" name="address" type="email" ng-model="newReplyAddress" placeholder="nom.prenom(a)franciaflex.fr" />
- <span class="glyphicon glyphicon-ok form-control-feedback" ng-if="addAddressForm.address.$dirty && addAddressForm.address.$valid"></span>
- <span class="glyphicon glyphicon-remove form-control-feedback" ng-if="addAddressForm.address.$dirty && addAddressForm.address.$invalid"></span>
</div>
<a class="btn btn-success btn-xs" ng-click="addReplyAddress()" ng-disabled="!newReplyAddress">
<span class="glyphicon glyphicon-ok"></span>
@@ -461,13 +460,11 @@
</table>
<div class="form-inline" ng-form="addDomainForm" role="form">
- <div class="form-group has-feedback"
+ <div class="form-group"
ng-class="{'has-error': addDomainForm.domain.$dirty && addDomainForm.domain.$invalid,
'has-success': addDomainForm.domain.$dirty && addDomainForm.domain.$valid}">
<label for="newDomainField" class="control-label">Nouveau domaine : </label>
<input id="newDomainField" class="form-control" type="text" name="domain" ng-model="newReplyDomain" placeholder="franciaflex.fr" />
- <span class="glyphicon glyphicon-ok form-control-feedback" ng-if="addDomainForm.domain.$dirty && addDomainForm.domain.$valid"></span>
- <span class="glyphicon glyphicon-remove form-control-feedback" ng-if="addDomainForm.domain.$dirty && addDomainForm.domain.$invalid"></span>
</div>
<a class="btn btn-success btn-xs" ng-click="addReplyDomain()" ng-disabled="!newReplyDomain">
<span class="glyphicon glyphicon-ok"></span>
@@ -692,6 +689,7 @@
<tr>
<th>Protocole</th>
<th>Serveur</th>
+ <th>Port</th>
<th>Utilisateur</th>
<th>Mot de passe</th>
<th/>
@@ -701,6 +699,7 @@
<tr ng-repeat="emailAccount in emailAccounts">
<td>{{emailAccount.protocol}}</td>
<td>{{emailAccount.host}}</td>
+ <td>{{emailAccount.port}}</td>
<td>{{emailAccount.login}}</td>
<td>{{emailAccount.password}}</td>
<td>
@@ -711,25 +710,33 @@
</tbody>
</table>
- <div class="form" role="form">
- <div class="form-group">
- <label>Protocole:
- <input type="text" class="form-control" ng-model="newAccount.protocol"></label>
+ <div class="form row" role="form" ng-form="addEmailAccountForm">
+ <div class="form-group col-xs-1">
+ <label for="emailAccountProtocol" class="control-label">Protocole:</label>
+ <!-- <input type="text" class="form-control" ng-model="newAccount.protocol" /> -->
+ <select id="emailAccountProtocol" ng-model="newAccount.protocol" ng-options="protocol as protocol for (protocol, port) in emailProtocolPorts"></select>
</div>
- <div class="form-group">
- <label>Serveur:
- <input type="text" class="form-control" ng-model="newAccount.host"></label>
+ <div class="form-group col-xs-4">
+ <label for="emailAccountHost" class="control-label">Serveur:</label>
+ <input id="emailAccountHost" name="newAccountHost" type="text" class="form-control" ng-model="newAccount.host" ng-minlength="1" />
</div>
- <div class="form-group">
- <label>Utilisateur:
- <input type="text" class="form-control" ng-model="newAccount.login"></label>
+ <div class="form-group col-xs-1"
+ ng-class="{'has-error': addEmailAccountForm.newAccountPort.$dirty && addEmailAccountForm.newAccountPort.$invalid,
+ 'has-success': addEmailAccountForm.newAccountPort.$dirty && addEmailAccountForm.newAccountPort.$valid}">
+ <label for="emailAccountPort" class="control-label">Port:</label>
+ <input id="emailAccountPort" name="newAccountPort" type="text" class="form-control" ng-model="newAccount.port" ng-pattern="/^\d+$/" ng-minlength="1" />
</div>
- <div class="form-group">
- <label>Mot de passe:
- <input type="text" class="form-control" ng-model="newAccount.password"></label>
+ <div class="form-group col-xs-2">
+ <label for="emailAccountUser" class="control-label">Utilisateur:</label>
+ <input id="emailAccountUser" type="text" class="form-control" ng-model="newAccount.login"/>
</div>
- <div class="form-group">
- <button type="button" class="btn btn-success" ng-disabled="!newAccount.protocol || !newAccount.host" ng-click="addEmailAccount()">
+ <div class="form-group col-xs-2">
+ <label for="emailAccountPassword" class="control-label">Mot de passe:</label>
+ <input id="emailAccountPassword" type="text" class="form-control" ng-model="newAccount.password">
+ </div>
+ <div class="form-group col-xs-1">
+ <br />
+ <button type="button" class="btn btn-success" ng-disabled="!newAccount.host || !newAccount.port || addEmailAccountForm.$invalid" ng-click="addEmailAccount()">
<i class="glyphicon glyphicon-plus"></i> Ajouter
</button>
</div>
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-05 13:48:35 UTC (rev 136)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-05 14:47:30 UTC (rev 137)
@@ -482,10 +482,12 @@
/**
* Email accounts controller.
*/
-ConfigurationModule.controller('ConfigurationEmailAccountsController', ['$scope', '$http', 'ConfigurationData',
- function($scope, $http, ConfigurationData) {
+ConfigurationModule.controller('ConfigurationEmailAccountsController', ['$scope', '$window', 'ConfigurationData',
+ function($scope, $window, ConfigurationData) {
//{Array} Email accounts
$scope.emailAccounts = ConfigurationData.emailAccounts;
+ //{Array} Port par défaut des protocols
+ $scope.emailProtocolPorts = ConfigurationData.emailProtocolPorts;
//{Object} New accout empty object
$scope.newAccount = {};
@@ -493,10 +495,21 @@
$scope.addEmailAccount = function() {
$scope.emailAccounts.push($scope.newAccount);
$scope.newAccount = {};
+ $scope.addEmailAccountForm.$setPristine();
};
// suppression d'un compte
$scope.removeEmailAccount = function(index) {
- $scope.emailAccounts.splice(index, 1);
+ if ($window.confirm("Êtes-vous sûr de vouloir supprimer ce compte email ?")) {
+ $scope.emailAccounts.splice(index, 1);
+ }
};
+
+ // selection d'un protocol
+ $scope.$watch("newAccount.protocol", function(newValue, oldValue) {
+ // auto remplissage du port par defaut
+ if (newValue && ((oldValue && $scope.newAccount.port == $scope.emailProtocolPorts[oldValue]) || !$scope.newAccount.port)) {
+ $scope.newAccount.port = $scope.emailProtocolPorts[newValue];
+ }
+ });
}]);
1
0
r136 - in trunk: faxtomail-persistence/src/main/xmi faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin faxtomail-ui-web/src/main/webapp/js
by echatellier@users.forge.codelutin.com 05 Jun '14
by echatellier@users.forge.codelutin.com 05 Jun '14
05 Jun '14
Author: echatellier
Date: 2014-06-05 15:48:35 +0200 (Thu, 05 Jun 2014)
New Revision: 136
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/136
Log:
refs #4662: Ajout des domaines de r?\195?\169ponse
Modified:
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
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/js/configuration.js
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
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-05 12:42:57 UTC (rev 135)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-06-05 13:48:35 UTC (rev 136)
@@ -248,7 +248,7 @@
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse0">
- Liste des chargés de clientèle
+ Généralité
</a>
</h4>
</div>
@@ -414,13 +414,65 @@
</a>
</td>
</tr>
+ <tr ng-if="!selectedMailFolder.replyAddresses || selectedMailFolder.replyAddresses.length == 0">
+ <td colspan="2" class="emptyTable">Aucune adresse définie</td>
+ </tr>
</tbody>
</table>
- Nouveau : <input type="email" ng-model="newReplyAddress" placeholder="nom.prenom(a)franciaflex.fr" />
- <a class="btn btn-success btn-xs" ng-click="addReplyAddress()" ng-disabled="!newReplyAddress">
- <span class="glyphicon glyphicon-ok"></span>
- </a>
+ <div class="form-inline" ng-form="addAddressForm" role="form">
+ <div class="form-group has-feedback"
+ ng-class="{'has-error': addAddressForm.address.$dirty && addAddressForm.address.$invalid,
+ 'has-success': addAddressForm.address.$dirty && addAddressForm.address.$valid}">
+ <label for="newAddressField" class="control-label">Nouvelle adresse : </label>
+ <input id="newAddressField" class="form-control" name="address" type="email" ng-model="newReplyAddress" placeholder="nom.prenom(a)franciaflex.fr" />
+ <span class="glyphicon glyphicon-ok form-control-feedback" ng-if="addAddressForm.address.$dirty && addAddressForm.address.$valid"></span>
+ <span class="glyphicon glyphicon-remove form-control-feedback" ng-if="addAddressForm.address.$dirty && addAddressForm.address.$invalid"></span>
+ </div>
+ <a class="btn btn-success btn-xs" ng-click="addReplyAddress()" ng-disabled="!newReplyAddress">
+ <span class="glyphicon glyphicon-ok"></span>
+ </a>
+ </div>
+
+ <br />
+
+ <table class="table table-bordered">
+ <thead>
+ <tr>
+ <th>Nom de domaine</th>
+ <th>Action</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr ng-repeat="replyDomain in selectedMailFolder.replyDomains track by $index">
+ <td>
+ <span class="glyphicon glyphicon-globe"></span>
+ {{replyDomain}}</td>
+ <td>
+ <a class="pull-right btn btn-danger btn-xs" ng-click="removeReplyDomain($index)">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a>
+ </td>
+ </tr>
+ <tr ng-if="!selectedMailFolder.replyDomains || selectedMailFolder.replyDomains.length == 0">
+ <td colspan="2" class="emptyTable">Aucune domaine défini</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <div class="form-inline" ng-form="addDomainForm" role="form">
+ <div class="form-group has-feedback"
+ ng-class="{'has-error': addDomainForm.domain.$dirty && addDomainForm.domain.$invalid,
+ 'has-success': addDomainForm.domain.$dirty && addDomainForm.domain.$valid}">
+ <label for="newDomainField" class="control-label">Nouveau domaine : </label>
+ <input id="newDomainField" class="form-control" type="text" name="domain" ng-model="newReplyDomain" placeholder="franciaflex.fr" />
+ <span class="glyphicon glyphicon-ok form-control-feedback" ng-if="addDomainForm.domain.$dirty && addDomainForm.domain.$valid"></span>
+ <span class="glyphicon glyphicon-remove form-control-feedback" ng-if="addDomainForm.domain.$dirty && addDomainForm.domain.$invalid"></span>
+ </div>
+ <a class="btn btn-success btn-xs" ng-click="addReplyDomain()" ng-disabled="!newReplyDomain">
+ <span class="glyphicon glyphicon-ok"></span>
+ </a>
+ </div>
</div>
</div>
</div>
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-05 12:42:57 UTC (rev 135)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp 2014-06-05 13:48:35 UTC (rev 136)
@@ -35,6 +35,7 @@
<script type="text/javascript" src="<s:url value='/webjars/angularjs/1.2.16/angular.min.js' />"></script>
<script type="text/javascript" src="<s:url value='/js/select2sortable.js' />"></script>
<script type="text/javascript" src="<s:url value='/webjars/angular-ui-bootstrap/0.11.0/ui-bootstrap.min.js' />"></script>
+ <script type="text/javascript" src="<s:url value='/webjars/angular-ui-bootstrap/0.11.0/ui-bootstrap-tpls.min.js' />"></script>
<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>
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-05 12:42:57 UTC (rev 135)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-05 13:48:35 UTC (rev 136)
@@ -234,6 +234,8 @@
$scope.newCustomerResponsible;
// {String} add new customer responsible form value
$scope.newReplyAddress;
+ // {String} add new domain form value
+ $scope.newReplyDomain;
// {Array} Colonnes selectionnées pour le dossier courant
$scope.folderTableColumns;
@@ -286,9 +288,12 @@
if (!$scope.selectedMailFolder.replyAddresses) {
$scope.selectedMailFolder.replyAddresses = [];
}
- if (!$scope.selectedMailFolder.contextActions) {
- $scope.selectedMailFolder.contextActions = [];
+ if (!$scope.selectedMailFolder.replyDomains) {
+ $scope.selectedMailFolder.replyDomains = [];
}
+ if (!$scope.selectedMailFolder.folderActions) {
+ $scope.selectedMailFolder.folderActions = [];
+ }
if (!$scope.selectedMailFolder.folderTableColumns) {
$scope.selectedMailFolder.folderTableColumns = [];
}
@@ -343,13 +348,26 @@
$scope.addReplyAddress = function() {
$scope.selectedMailFolder.replyAddresses.push($scope.newReplyAddress);
delete $scope.newReplyAddress;
+ $scope.addAddressForm.$setPristine();
};
// remove customer responsible
$scope.removeReplyAddress = function(index) {
$scope.selectedMailFolder.replyAddresses.splice(index, 1);
};
+
+ // add reply domain
+ $scope.addReplyDomain = function() {
+ $scope.selectedMailFolder.replyDomains.push($scope.newReplyDomain);
+ delete $scope.newReplyDomain;
+ $scope.addDomainForm.$setPristine();
+ };
+ // remove customer responsible
+ $scope.removeReplyDomain = function(index) {
+ $scope.selectedMailFolder.replyDomains.splice(index, 1);
+ };
+
// add reply address
$scope.addWriteRightUser = function() {
$scope.selectedMailFolder.writeRightUsers.push($scope.newWriteRightUser);
1
0
r135 - in trunk: . faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service faxtomail-ui-web faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin faxtomail-ui-web/src/main/webapp/js
by echatellier@users.forge.codelutin.com 05 Jun '14
by echatellier@users.forge.codelutin.com 05 Jun '14
05 Jun '14
Author: echatellier
Date: 2014-06-05 14:42:57 +0200 (Thu, 05 Jun 2014)
New Revision: 135
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/135
Log:
refs #4662: Suppression des dossiers vides
Modified:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java
trunk/faxtomail-ui-web/pom.xml
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
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/js/configuration.js
trunk/faxtomail-ui-web/src/main/webapp/js/faxtomail.js
trunk/pom.xml
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java 2014-06-05 10:03:08 UTC (rev 134)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java 2014-06-05 12:42:57 UTC (rev 135)
@@ -343,4 +343,23 @@
return findAll(query.toString(), args);
}
+
+ /**
+ * Retounre le nombre d'email par dossier.
+ *
+ * @return le nombre d'email par dossier
+ */
+ public Map<String, Long> getMailCountByFolder() {
+ String query = "SELECT mailFolder.topiaId, count(*) FROM " + Email.class.getName() + " group by mailFolder.topiaId";
+
+ Map<String, Long> result = new HashMap<>();
+
+ List<Object[]> queryResuts = findAll(query);
+ for (Object[] queryResut : queryResuts) {
+ String mailFolder = (String)queryResut[0];
+ Long count = (Long)queryResut[1];
+ result.put(mailFolder, count);
+ }
+ return result;
+ }
}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java 2014-06-05 10:03:08 UTC (rev 134)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java 2014-06-05 12:42:57 UTC (rev 135)
@@ -35,11 +35,11 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.nuiton.topia.persistence.TopiaIdFactory;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
import org.nuiton.util.pagination.PaginationParameter;
+import com.franciaflex.faxtomail.persistence.entities.EmailTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
import com.franciaflex.faxtomail.persistence.entities.MailFilter;
import com.franciaflex.faxtomail.persistence.entities.MailFilterTopiaDao;
@@ -157,7 +157,6 @@
Collection<EtatAttente> etatAttentes = folder.getEtatAttente();
if (CollectionUtils.isEmpty(etatAttentes)) {
etatAttentes = parentEtatAttente;
-
} else {
parentEtatAttente = etatAttentes;
}
@@ -178,4 +177,17 @@
}
+ /**
+ * Retourne une map avec les identifiants des {@code mailFolder}s et le nombre de mails qu'ils
+ * contiennent pour pouvoir empecher la suppression.
+ * Seulement pour les dossiers qui ont au moins un email.
+ *
+ * @return le nombre de mail par dossier
+ */
+ public Map<String, Long> getMailFoldersUsage() {
+ EmailTopiaDao dao = getPersistenceContext().getEmailDao();
+ Map<String, Long> result = dao.getMailCountByFolder();
+ return result;
+ }
+
}
Modified: trunk/faxtomail-ui-web/pom.xml
===================================================================
--- trunk/faxtomail-ui-web/pom.xml 2014-06-05 10:03:08 UTC (rev 134)
+++ trunk/faxtomail-ui-web/pom.xml 2014-06-05 12:42:57 UTC (rev 135)
@@ -237,6 +237,11 @@
<groupId>org.nuiton.js</groupId>
<artifactId>nuiton-js-angular-ui-tree</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.webjars</groupId>
+ <artifactId>angular-ui-bootstrap</artifactId>
+ </dependency>
<dependency>
<groupId>org.webjars</groupId>
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-05 10:03:08 UTC (rev 134)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-06-05 12:42:57 UTC (rev 135)
@@ -71,6 +71,8 @@
protected List<MailFolder> mailFolders;
+ protected Map<String, Long> mailFoldersUsage;
+
protected List<MailFilter> mailFilters;
protected List<FaxToMailUser> users;
@@ -88,6 +90,7 @@
etatAttentes = referentielService.getAllEtatAttente();
demandTypes = referentielService.getAllDemandType();
mailFolders = mailFolderService.getRootMailFolders();
+ mailFoldersUsage = mailFolderService.getMailFoldersUsage();
users = configurationService.getAllUsers();
emailAccounts = configurationService.getEmailAccounts();
mailFilters = configurationService.getMailFilters();
@@ -170,7 +173,11 @@
Type type = new TypeToken<List<MailFilter>>() {}.getType();
this.mailFilters = getGson().fromJson(json, type);
}
-
+
+ public Map<String, Long> getMailFoldersUsage() {
+ return mailFoldersUsage;
+ }
+
public List<EmailAccount> getEmailAccounts() {
return emailAccounts;
}
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-05 10:03:08 UTC (rev 134)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-06-05 12:42:57 UTC (rev 135)
@@ -37,6 +37,8 @@
<script type="text/javascript" src="<s:url value='/js/select2sortable.js' />"></script>
<script type="text/javascript" src="<s:url value='/nuiton-js-angular-ui-tree/angular-ui-tree.js' />"></script>
<script type="text/javascript" src="<s:url value='/webjars/angular-ui-sortable/0.12.2/sortable.min.js' />"></script>
+ <script type="text/javascript" src="<s:url value='/webjars/angular-ui-bootstrap/0.11.0/ui-bootstrap.min.js' />"></script>
+ <script type="text/javascript" src="<s:url value='/webjars/angular-ui-bootstrap/0.11.0/ui-bootstrap-tpls.min.js' />"></script>
<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>
@@ -53,6 +55,7 @@
'etatAttentes': <s:property value="toJson(etatAttentes)" escapeHtml="false"/>,
'demandTypes': <s:property value="toJson(demandTypes)" escapeHtml="false"/>,
'mailFolders': <s:property value="toJson(mailFolders)" escapeHtml="false"/>,
+ 'mailFoldersUsage': <s:property value="toJson(mailFoldersUsage)" escapeHtml="false"/>,
'searchDisplayColumns': <s:property value="toJson(configuration.searchDisplayColumns)" escapeHtml="false"/>,
'users': <s:property value="toJson(users)" escapeHtml="false"/>,
'mailFilters': <s:property value="toJson(mailFilters)" escapeHtml="false"/>,
@@ -218,9 +221,11 @@
<a class="btn btn-success btn-xs" data-nodrag ng-click="toggle(this)" ng-disabled="!mailFolder.children || mailFolder.children.length == 0">
<span class="glyphicon" ng-class="{'glyphicon-chevron-right': !collapsed, 'glyphicon-chevron-down': collapsed}"></span>
</a>
- {{mailFolder.name}}
+ {{mailFolder.name}} <span class="badge">{{mailFolder.$cumulativeCount}}</span>
<a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="newSubFolder(this)" style="margin-left: 8px;"><span class="glyphicon glyphicon-plus"></span></a>
- <a class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="remove(this)" ng-if="!mailFolder.topiaId"><span class="glyphicon glyphicon-remove"></span></a>
+ <a class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteFolder(this)" ng-disabled="mailFolder.$cumulativeCount > 0"
+ tooltip="{{mailFolder.$cumulativeCount > 0 && 'Ce dossier contient ' + mailFolder.$cumulativeCount + ' demandes !'|| 'Supprimer ce dossier'}}">
+ <span class="glyphicon glyphicon-remove"></span></a>
</div>
<ol ui-tree-nodes="options" ng-model="mailFolder.children" ng-class="{hidden: !collapsed}">
<li ng-repeat="mailFolder in mailFolder.children" ui-tree-node ng-include="'nodes_renderer.html'">
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-05 10:03:08 UTC (rev 134)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp 2014-06-05 12:42:57 UTC (rev 135)
@@ -34,6 +34,7 @@
<script type="text/javascript" src="<s:url value='/webjars/select2/3.4.8/select2_locale_fr.js' />"></script>
<script type="text/javascript" src="<s:url value='/webjars/angularjs/1.2.16/angular.min.js' />"></script>
<script type="text/javascript" src="<s:url value='/js/select2sortable.js' />"></script>
+ <script type="text/javascript" src="<s:url value='/webjars/angular-ui-bootstrap/0.11.0/ui-bootstrap.min.js' />"></script>
<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>
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-05 10:03:08 UTC (rev 134)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-05 12:42:57 UTC (rev 135)
@@ -41,12 +41,15 @@
$scope.demandTypes = ConfigurationData.demandTypes;
//{Array} mail folders
$scope.mailFolders = ConfigurationData.mailFolders;
+ // {Map} Mail folder usage
+ $scope.mailFoldersUsage = ConfigurationData.mailFoldersUsage;
//{Map<MailFolder id, Array<MailFolder>>} liste des
$scope.flatMailFolders;
// method privée recursive pour retourner l'ensemble des dossiers en les modifiant pour ajouter
// des metadata (full path from root, and root node instance)
var recursiveAddMailFolder = function(result, mailFolders, rootFolder, prefix) {
+ var cumulativeCount = 0;
if (mailFolders) {
angular.forEach(mailFolders, function(mailFolder) {
@@ -56,11 +59,22 @@
// ha la la, modify input object again :(
// use $ from this, even not recommended because angular exlude those fields when jsonify
mailFolder.$rootFolder = rootFolder;
+
+ //
+ var folderCount = 0;
+ if ($scope.mailFoldersUsage.hasOwnProperty(mailFolder.topiaId)) {
+ folderCount += $scope.mailFoldersUsage[mailFolder.topiaId];
+ }
result.push(mailFolder);
- recursiveAddMailFolder(result, mailFolder.children, rootFolder, mailFolder.$fullPath);
+ folderCount += recursiveAddMailFolder(result, mailFolder.children, rootFolder, mailFolder.$fullPath);
+
+ // et on modifie encore (tant qu'on a commencé !!!)
+ mailFolder.$cumulativeCount = folderCount;
+ cumulativeCount += folderCount;
});
}
+ return cumulativeCount;
};
// update $scope.flatMailFolders when $scope.mailFolders changes
@@ -69,7 +83,8 @@
$scope.flatMailFolders = {};
angular.forEach($scope.mailFolders, function(mailFolder) {
$scope.flatMailFolders[mailFolder.topiaId] = [];
- recursiveAddMailFolder($scope.flatMailFolders[mailFolder.topiaId], mailFolder.children, mailFolder, mailFolder.name);
+ var cumulativeCount = recursiveAddMailFolder($scope.flatMailFolders[mailFolder.topiaId], mailFolder.children, mailFolder, mailFolder.name);
+ mailFolder.$cumulativeCount = cumulativeCount;
});
};
$scope._updateFlatMailFolders();
@@ -209,8 +224,10 @@
/**
* Mail folder tab controller.
*/
-ConfigurationModule.controller('ConfigurationTreeController', ['$scope', '$http', '$window', 'ConfigurationData',
- function($scope, $http, $window, ConfigurationData) {
+ConfigurationModule.controller('ConfigurationTreeController', ['$scope', '$window', 'ConfigurationData',
+ function($scope, $window, ConfigurationData) {
+ // {Array} Users
+ $scope.users = ConfigurationData.users;
// {Object} selected mail folder
$scope.selectedMailFolder;
// {String} add new customer responsible form value
@@ -219,8 +236,6 @@
$scope.newReplyAddress;
// {Array} Colonnes selectionnées pour le dossier courant
$scope.folderTableColumns;
- // {Array} Users
- $scope.users = ConfigurationData.users;
// creation d'un nouveau noeud racine
$scope.newRoot = function() {
@@ -253,6 +268,13 @@
}
};
+ // suppression d'un dossier
+ $scope.deleteFolder = function(scope) {
+ if ($window.confirm("Êtes-vous sûr de vouloir supprimer ce dossier ?")) {
+ scope.remove(scope);
+ }
+ };
+
// edit mail folder
$scope.editMailFolder = function(mailFolder) {
$scope.selectedMailFolder = mailFolder;
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/faxtomail.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/faxtomail.js 2014-06-05 10:03:08 UTC (rev 134)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/faxtomail.js 2014-06-05 12:42:57 UTC (rev 135)
@@ -38,4 +38,4 @@
}
/** Mail faxtomail application module. */
-var FaxToMailModule = angular.module('FaxToMail', []);
+var FaxToMailModule = angular.module('FaxToMail', ['ui.bootstrap']);
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-06-05 10:03:08 UTC (rev 134)
+++ trunk/pom.xml 2014-06-05 12:42:57 UTC (rev 135)
@@ -535,9 +535,16 @@
<version>0.12.2</version>
<scope>runtime</scope>
</dependency>
-
+
<dependency>
<groupId>org.webjars</groupId>
+ <artifactId>angular-ui-bootstrap</artifactId>
+ <version>0.11.0-2</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.1.1-1</version>
<scope>runtime</scope>
1
0
r134 - trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin
by echatellier@users.forge.codelutin.com 05 Jun '14
by echatellier@users.forge.codelutin.com 05 Jun '14
05 Jun '14
Author: echatellier
Date: 2014-06-05 12:03:08 +0200 (Thu, 05 Jun 2014)
New Revision: 134
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/134
Log:
Ajout des cases d?\195?\169placement et cr?\195?\169ation dans le dossier
Modified:
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
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-05 09:43:43 UTC (rev 133)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-06-05 10:03:08 UTC (rev 134)
@@ -238,6 +238,108 @@
<h3>Édition du dossier {{selectedMailFolder.name}}</h3>
<div class="panel-group" id="accordion">
+ <!-- Général -->
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <h4 class="panel-title">
+ <a data-toggle="collapse" data-parent="#accordion" href="#collapse0">
+ Liste des chargés de clientèle
+ </a>
+ </h4>
+ </div>
+ <div id="collapse0" class="panel-collapse collapse in">
+ <div class="panel-body">
+ <div class="form-group">
+ <label class="control-label">Autoriser le déplacement de demandes vers ce dossier ?</label><br />
+ <label class="radio-inline">
+ <input type="radio"
+ ng-model="selectedMailFolder.allowMoveDemandIntoFolder" ng-value="true"> oui
+ </label>
+ <label class="radio-inline">
+ <input type="radio"
+ ng-model="selectedMailFolder.allowMoveDemandIntoFolder" ng-value="false"> non
+ </label>
+ <label class="radio-inline">
+ <input type="radio"
+ ng-model="selectedMailFolder.allowMoveDemandIntoFolder" ng-value="undefined"> valeur du noeud parent
+ </label>
+ </div>
+ <div class="form-group">
+ <label class="control-label">Autoriser la création de demandes dans ce dossier ?</label><br />
+ <label class="radio-inline">
+ <input type="radio"
+ ng-model="selectedMailFolder.allowCreateDemandIntoFolder" ng-value="true"> oui
+ </label>
+ <label class="radio-inline">
+ <input type="radio"
+ ng-model="selectedMailFolder.allowCreateDemandIntoFolder" ng-value="false"> non
+ </label>
+ <label class="radio-inline">
+ <input type="radio"
+ ng-model="selectedMailFolder.allowCreateDemandIntoFolder" ng-value="undefined"> valeur du noeud parent
+ </label>
+ </div>
+ <div class="form-group">
+ <label class="control-label">L'action imprimer est-elle équivalente à "prendre"</label><br />
+ <label class="radio-inline">
+ <input type="radio"
+ ng-model="selectedMailFolder.printActionEqualTakeAction" ng-value="true"> oui
+ </label>
+ <label class="radio-inline">
+ <input type="radio"
+ ng-model="selectedMailFolder.printActionEqualTakeAction" ng-value="false"> non
+ </label>
+ <label class="radio-inline">
+ <input type="radio"
+ ng-model="selectedMailFolder.printActionEqualTakeAction" ng-value="undefined"> valeur du noeud parent
+ </label>
+ </div>
+
+ <div class="form-group">
+ <label class="control-label">Ouvrir une pièce jointe sans prendre, met-il la ligne en orange ?</label><br />
+ <label class="radio-inline">
+ <input type="radio"
+ ng-model="selectedMailFolder.openAttachmentReportNoTaken" ng-value="true"> oui
+ </label>
+ <label class="radio-inline">
+ <input type="radio"
+ ng-model="selectedMailFolder.openAttachmentReportNoTaken" ng-value="false"> non
+ </label>
+ <label class="radio-inline">
+ <input type="radio"
+ ng-model="selectedMailFolder.openAttachmentReportNoTaken" ng-value="undefined"> valeur du noeud parent
+ </label>
+ </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"
+ ng-model="selectedMailFolder.rejectUnknownSender" ng-value="true"> oui
+ </label>
+ <label class="radio-inline">
+ <input type="radio"
+ ng-model="selectedMailFolder.rejectUnknownSender" ng-value="false"> non
+ </label>
+ <label class="radio-inline">
+ <input type="radio"
+ 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>
+
+ <div class="form-group">
+ <label for="faxDomainField">Domaines des fax</label>
+ <input type="text" class="form-control" id="faxDomainField" ng-model="selectedMailFolder.faxDomain">
+ </div>
+ </div>
+ </div>
+ </div>
+
<!-- Liste des chargés de clientèle -->
<div class="panel panel-default">
<div class="panel-heading">
@@ -447,64 +549,6 @@
</div>
</div>
</div>
-
- <div class="form-group">
- <label class="control-label">L'action imprimer est-elle équivalente à "prendre"</label><br />
- <label class="radio-inline">
- <input type="radio" name="printActionEqualTakeActionField"
- ng-model="selectedMailFolder.printActionEqualTakeAction" ng-value="true"> oui
- </label>
- <label class="radio-inline">
- <input type="radio" name="printActionEqualTakeActionField"
- ng-model="selectedMailFolder.printActionEqualTakeAction" ng-value="false"> non
- </label>
- <label class="radio-inline">
- <input type="radio" name="printActionEqualTakeActionField"
- ng-model="selectedMailFolder.printActionEqualTakeAction" ng-value="undefined"> valeur du noeud parent
- </label>
- </div>
-
- <div class="form-group">
- <label class="control-label">Ouvrir une pièce jointe sans prendre, met-il la ligne en orange ?</label><br />
- <label class="radio-inline">
- <input type="radio" name="openAttachmentReportNoTakenField"
- ng-model="selectedMailFolder.openAttachmentReportNoTaken" ng-value="true"> oui
- </label>
- <label class="radio-inline">
- <input type="radio" name="openAttachmentReportNoTakenField"
- ng-model="selectedMailFolder.openAttachmentReportNoTaken" ng-value="false"> non
- </label>
- <label class="radio-inline">
- <input type="radio" name="openAttachmentReportNoTakenField"
- ng-model="selectedMailFolder.openAttachmentReportNoTaken" ng-value="undefined"> valeur du noeud parent
- </label>
- </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>
-
- <div class="form-group">
- <label for="faxDomainField">Domaines des fax</label>
- <input type="text" class="form-control" id="faxDomainField" ng-model="selectedMailFolder.faxDomain">
- </div>
</div>
</div>
</div>
1
0
r133 - in trunk/faxtomail-ui-web/src/main/webapp: WEB-INF/content/admin js
by echatellier@users.forge.codelutin.com 05 Jun '14
by echatellier@users.forge.codelutin.com 05 Jun '14
05 Jun '14
Author: echatellier
Date: 2014-06-05 11:43:43 +0200 (Thu, 05 Jun 2014)
New Revision: 133
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/133
Log:
Display full node path in select.
Remove binding on methods.
Filter mail filters by root mail folders.
Modified:
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
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-05 07:32:18 UTC (rev 132)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-06-05 09:43:43 UTC (rev 133)
@@ -50,14 +50,14 @@
'mailFields': <s:property value="toJson(mailFields)" escapeHtml="false"/>,
// datas
'configuration': <s:property value="toJson(configuration)" escapeHtml="false"/>,
- 'etatAttentes' : <s:property value="toJson(etatAttentes)" escapeHtml="false"/>,
- 'demandTypes' : <s:property value="toJson(demandTypes)" escapeHtml="false"/>,
+ 'etatAttentes': <s:property value="toJson(etatAttentes)" escapeHtml="false"/>,
+ 'demandTypes': <s:property value="toJson(demandTypes)" escapeHtml="false"/>,
'mailFolders': <s:property value="toJson(mailFolders)" escapeHtml="false"/>,
'searchDisplayColumns': <s:property value="toJson(configuration.searchDisplayColumns)" 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"/>
- });
+ });
</script>
</head>
@@ -69,7 +69,7 @@
<s:form id="main_form" action="configuration" method="post" ng-controller="ConfigurationController">
- <s:hidden name="activeTab"/>
+ <!--<s:hidden name="activeTab"/>-->
<ul id="tabs" class="nav nav-tabs">
<li class="active"><a href="#tabs-general" data-toggle="tab">Général</a></li>
@@ -512,38 +512,52 @@
<div id="tabs-filters" class="tab-pane" ng-controller="ConfigurationFilterController">
<input type="hidden" name="mailFiltersJson" value="{{mailFilters}}" />
- <table class="table table-hover table-bordered">
- <thead>
- <tr>
- <th>Filtre</th>
- <th>Dossier</th>
- <th/>
- </tr>
- </thead>
- <tbody ui-sortable ng-model="mailFilters">
- <tr ng-repeat="mailFilter in mailFilters">
- <td>{{mailFilter.expression}}</td>
- <td>{{mailFilter.mailFolder.name}}</td>
- <td><a class="btn btn-danger btn-xs" ng-click="removeFilter($index)">
- <span class="glyphicon glyphicon-remove"></span>
- </a></td>
- </tr>
- </tbody>
- </table>
- <div role="form">
- <div class="form-group">
- <label for="filterField">Filtre</label>
- <input type="text" class="form-control" id="folderField" ng-model="newFilter.expression">
+ <div class="panel panel-default">
+ <div class="panel-heading" ng-repeat-start="mailFolder in mailFolders">
+ <h4 class="panel-title">
+ <a data-toggle="collapse" data-parent="#accordion" href="#mailFilerAccordion{{$index}}">
+ Filtre du dossier {{mailFolder.name}}
+ </a>
+ </h4>
</div>
- <div class="form-group">
- <label for="folderField">Dossier</label>
- <select class="form-control" ng-model="newFilter.mailFolder" ng-options="mailFolder.name for mailFolder in flatMailFolders()"></select>
+ <div id="mailFilerAccordion{{$index}}" class="panel-collapse collapse" ng-repeat-end>
+ <div class="panel-body">
+ <table class="table table-hover table-bordered">
+ <thead>
+ <tr>
+ <th>Filtre</th>
+ <th>Dossier</th>
+ <th/>
+ </tr>
+ </thead>
+ <tbody ui-sortable ng-model="mailFilters">
+ <tr ng-repeat="mailFilter in mailFilters|filter:subFolderFilter(mailFolder)">
+ <td>{{mailFilter.expression}}</td>
+ <td>{{mailFilter.mailFolder.$fullPath}}</td>
+ <td><a class="btn btn-danger btn-xs" ng-click="removeFilter(mailFilter)">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a></td>
+ </tr>
+ </tbody>
+ </table>
+
+ <div role="form">
+ <div class="form-group">
+ <label for="filterField">Filtre</label>
+ <input type="text" class="form-control" id="folderField" ng-model="newFilter.expression">
+ </div>
+ <div class="form-group">
+ <label for="folderField">Dossier</label>
+ <select class="form-control" ng-model="newFilter.mailFolder" ng-options="mailFolder.$fullPath for mailFolder in flatMailFolders[mailFolder.topiaId]"></select>
+ </div>
+ </div>
+ <button type="button" class="btn btn-success" ng-disabled="!newFilter.expression || !newFilter.mailFolder" ng-click="addNewFilter()">
+ <i class="glyphicon glyphicon-plus"></i> Ajouter
+ </button>
+ </div>
</div>
</div>
- <button type="button" class="btn btn-success" ng-disabled="!newFilter.expression || !newFilter.mailFolder" ng-click="addNewFilter()">
- <i class="glyphicon glyphicon-plus"></i> Ajouter
- </button>
</div>
<div id="tabs-search" class="tab-pane" ng-controller="ConfigurationSearchController">
@@ -561,7 +575,7 @@
<caption>Aperçu</caption>
<thead>
<tr>
- <th ng-repeat="etatAttenteField in searchDisplayColumns">{{etatAttenteFields[etatAttenteField.id]}}</th>
+ <th ng-repeat="etatAttenteField in searchDisplayColumns">{{mailFields[etatAttenteField.id]}}</th>
</tr>
</thead>
</table>
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-05 07:32:18 UTC (rev 132)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-05 09:43:43 UTC (rev 133)
@@ -41,23 +41,38 @@
$scope.demandTypes = ConfigurationData.demandTypes;
//{Array} mail folders
$scope.mailFolders = ConfigurationData.mailFolders;
+ //{Map<MailFolder id, Array<MailFolder>>} liste des
+ $scope.flatMailFolders;
- // method privée recursive pour retourner l'ensemble des dossiers
- var recursiveAddMailFolder = function(result, mailFolders) {
+ // method privée recursive pour retourner l'ensemble des dossiers en les modifiant pour ajouter
+ // des metadata (full path from root, and root node instance)
+ var recursiveAddMailFolder = function(result, mailFolders, rootFolder, prefix) {
if (mailFolders) {
angular.forEach(mailFolders, function(mailFolder) {
+
+ // warning modify input object :(
+ // use $ from this, even not recommended because angular exlude those fields when jsonify
+ mailFolder.$fullPath = prefix + "/" + mailFolder.name;
+ // ha la la, modify input object again :(
+ // use $ from this, even not recommended because angular exlude those fields when jsonify
+ mailFolder.$rootFolder = rootFolder;
+
result.push(mailFolder);
- recursiveAddMailFolder(result, mailFolder.children);
+ recursiveAddMailFolder(result, mailFolder.children, rootFolder, mailFolder.$fullPath);
});
}
};
- // Retourne l'ensemble de l'arbre des dossiers "à plat"
- $scope.flatMailFolders = function() {
- var flatMailFolders = [];
- recursiveAddMailFolder(flatMailFolders, $scope.mailFolders);
- return flatMailFolders;
+ // update $scope.flatMailFolders when $scope.mailFolders changes
+ $scope._updateFlatMailFolders = function() {
+ console.log("Update flatMailFolders map");
+ $scope.flatMailFolders = {};
+ angular.forEach($scope.mailFolders, function(mailFolder) {
+ $scope.flatMailFolders[mailFolder.topiaId] = [];
+ recursiveAddMailFolder($scope.flatMailFolders[mailFolder.topiaId], mailFolder.children, mailFolder, mailFolder.name);
+ });
};
+ $scope._updateFlatMailFolders();
}]);
/**
@@ -217,12 +232,27 @@
children: []
};
$scope.mailFolders.push(newRoot);
+ $scope._updateFlatMailFolders(); // update flat map
// edition automatique
$scope.editMailFolder(newRoot);
};
};
+ // new sub folder
+ $scope.newSubFolder = function(scope) {
+ var nodeData = scope.$modelValue;
+ var name = $window.prompt("Nom du nouveau noeud ? ");
+ if (name) {
+ nodeData.children.push({
+ topiaId: "new_" + guid(),
+ name: name,
+ children: []
+ });
+ $scope._updateFlatMailFolders(); // update flat map
+ }
+ };
+
// edit mail folder
$scope.editMailFolder = function(mailFolder) {
$scope.selectedMailFolder = mailFolder;
@@ -264,19 +294,6 @@
}
}, true);
- // new sub folder
- $scope.newSubFolder = function(scope) {
- var nodeData = scope.$modelValue;
- var name = $window.prompt("Nom du nouveau noeud ? ");
- if (name) {
- nodeData.children.push({
- topiaId: "new_" + guid(),
- name: name,
- children: []
- });
- }
- };
-
// fonction retournant l'ensemble des options disponibles
$scope.getObjectsData = function(term, result) {
var resultArray = [];
@@ -346,13 +363,29 @@
/**
* Mail filter tab controller.
*/
-ConfigurationModule.controller('ConfigurationFilterController', ['$scope', '$http', 'ConfigurationData',
- function($scope, $http, ConfigurationData) {
+ConfigurationModule.controller('ConfigurationFilterController', ['$scope', '$window', 'ConfigurationData',
+ function($scope, $window, ConfigurationData) {
//{Array} Current mail filter list
$scope.mailFilters = ConfigurationData.mailFilters;
//{Object} New accout empty filter
$scope.newFilter = {};
+ // replace filter instance with mailFolder filter instance to use same objects
+ angular.forEach($scope.mailFilters, function(filter) {
+ // root folder
+ angular.forEach($scope.mailFolders, function(mailFolder) {
+ if (mailFolder.topiaId == filter.mailFolder.topiaId) {
+ filter.mailFolder = mailFolder;
+ } else {
+ angular.forEach($scope.flatMailFolders[mailFolder.topiaId], function(subFolder) {
+ if (subFolder.topiaId == filter.mailFolder.topiaId) {
+ filter.mailFolder = subFolder;
+ }
+ });
+ }
+ });
+ });
+
// add new filter action
$scope.addNewFilter = function() {
$scope.mailFilters.push($scope.newFilter);
@@ -360,19 +393,29 @@
// clear form
$scope.newFilter = {};
};
-
+
// remove filter
- $scope.removeFilter = function(index) {
- $scope.mailFilters.splice(index, 1);
+ $scope.removeFilter = function(filter) {
+ if ($window.confirm("Êtes-vous sûr de vouloir supprimer ce filter ?")) {
+ var index = $scope.mailFilters.indexOf(filter);
+ $scope.mailFilters.splice(index, 1);
+ }
};
+
+ // define angular filter used to group mailFilters by rootFolders
+ $scope.subFolderFilter = function(mailFolder) {
+ return function(item) {
+ return item.mailFolder == mailFolder || item.mailFolder.$rootFolder == mailFolder;
+ };
+ };
}]);
/**
* Search tab controller.
*/
-ConfigurationModule.controller('ConfigurationSearchController', ['$scope', '$http', 'ConfigurationData',
- function($scope, $http, ConfigurationData) {
+ConfigurationModule.controller('ConfigurationSearchController', ['$scope', 'ConfigurationData',
+ function($scope, ConfigurationData) {
//{Array} Options actuelle
$scope.searchDisplayColumns = [];
angular.forEach(ConfigurationData.searchDisplayColumns, function(searchDisplayColumn) {
1
0
Author: echatellier
Date: 2014-06-05 09:32:18 +0200 (Thu, 05 Jun 2014)
New Revision: 132
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/132
Log:
Update angular ui tree
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-06-04 14:53:59 UTC (rev 131)
+++ trunk/pom.xml 2014-06-05 07:32:18 UTC (rev 132)
@@ -560,7 +560,7 @@
<dependency>
<groupId>org.nuiton.js</groupId>
<artifactId>nuiton-js-angular-ui-tree</artifactId>
- <version>2.0.6-1</version>
+ <version>2.1.4-1</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
1
0
r131 - in trunk/faxtomail-ui-web/src/main/webapp: WEB-INF/content/admin js
by echatellier@users.forge.codelutin.com 04 Jun '14
by echatellier@users.forge.codelutin.com 04 Jun '14
04 Jun '14
Author: echatellier
Date: 2014-06-04 16:53:59 +0200 (Wed, 04 Jun 2014)
New Revision: 131
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/131
Log:
refs #4662: Correction des actions contextuel des dossiers
Modified:
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
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-04 14:43:27 UTC (rev 130)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-06-04 14:53:59 UTC (rev 131)
@@ -406,9 +406,9 @@
</div>
<div id="collapse5" class="panel-collapse collapse">
<div class="panel-body">
- <label class="checkbox" ng-repeat="(contextMailAction,label) in contextMailActions">
- <input type="checkbox" ng-checked="selectedMailFolder.contextActions.indexOf(contextMailAction) != -1"
- ng-click="changeFolderAction(contextMailAction)"> {{label}}
+ <label class="checkbox" ng-repeat="(folderAction,label) in folderActions">
+ <input type="checkbox" ng-checked="selectedMailFolder.folderActions.indexOf(folderAction) != -1"
+ ng-click="changeFolderAction(folderAction)"> {{label}}
</label>
</div>
</div>
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-04 14:43:27 UTC (rev 130)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-04 14:53:59 UTC (rev 131)
@@ -249,7 +249,7 @@
angular.forEach($scope.selectedMailFolder.folderTableColumns, function(folderTableColumn) {
$scope.folderTableColumns.push({
id: folderTableColumn,
- label: $scope.fields[folderTableColumn]
+ label: $scope.mailFields[folderTableColumn]
});
});
};
@@ -333,12 +333,12 @@
};
// selection/deselection d'une action possible du menu contextuel pour ce dossier
- $scope.changeFolderAction = function(mailAction) {
- var index = $scope.selectedMailFolder.contextActions.indexOf(mailAction);
+ $scope.changeFolderAction = function(folderAction) {
+ var index = $scope.selectedMailFolder.folderActions.indexOf(folderAction);
if (index != -1) {
- $scope.selectedMailFolder.contextActions.splice(index, 1);
+ $scope.selectedMailFolder.folderActions.splice(index, 1);
} else {
- $scope.selectedMailFolder.contextActions.push(mailAction);
+ $scope.selectedMailFolder.folderActions.push(folderAction);
}
};
}]);
1
0
04 Jun '14
Author: echatellier
Date: 2014-06-04 16:43:27 +0200 (Wed, 04 Jun 2014)
New Revision: 130
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/130
Log:
Mise ?\195?\160 jour topia/eugene.
ref #4662: Rectaring etatAttente, action, type de document, champs obligatoires
Added:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailProtocol.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/FolderAction.java
Modified:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailAction.java
trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/EmailAccountImportModel.java
trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/AbstractFaxToMailServiceTest.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailApplicationListener.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java
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/job/MailFilterJob.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/css/faxtomail.css
trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
trunk/pom.xml
Added: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailProtocol.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailProtocol.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailProtocol.java 2014-06-04 14:43:27 UTC (rev 130)
@@ -0,0 +1,44 @@
+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%
+ */
+
+public enum EmailProtocol {
+
+ POP3(110),
+ POP3S(995),
+ IMAP(143),
+ IMAPS(993);
+
+ private int port;
+
+ private EmailProtocol(int port) {
+ this.port = port;
+ }
+
+ public int getDefaultPort() {
+ return port;
+ }
+
+}
Property changes on: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailProtocol.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/FolderAction.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/FolderAction.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/FolderAction.java 2014-06-04 14:43:27 UTC (rev 130)
@@ -0,0 +1,35 @@
+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 FolderAction {
+
+ COMPUTE_RANGE,
+ NEW_DEMANDE
+}
Property changes on: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/FolderAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailAction.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailAction.java 2014-06-04 08:08:56 UTC (rev 129)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailAction.java 2014-06-04 14:43:27 UTC (rev 130)
@@ -30,20 +30,10 @@
*/
public enum MailAction {
- SAVE(false),
- TRANSMIT(false),
- PRINT(true),
- ARCHIVE(true),
- REPLY(true),
- GROUP(false);
-
- protected boolean contextuable;
-
- private MailAction(boolean contextuable) {
- this.contextuable = contextuable;
- }
-
- public boolean isContextuable() {
- return contextuable;
- }
+ SAVE,
+ TRANSMIT,
+ PRINT,
+ ARCHIVE,
+ REPLY,
+ GROUP
}
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties
===================================================================
--- trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties 2014-06-04 08:08:56 UTC (rev 129)
+++ trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties 2014-06-04 14:43:27 UTC (rev 130)
@@ -48,7 +48,10 @@
com.franciaflex.faxtomail.persistence.entities.EmailAccount.attribute.host.tagvalue.naturalId=true
com.franciaflex.faxtomail.persistence.entities.EmailAccount.attribute.login.tagvalue.naturalId=true
+# ExtensionCommand
+com.franciaflex.faxtomail.persistence.entities.ExtensionCommand.attribute.extension.tagvalue.naturalId=true
+
# Attachment
com.franciaflex.faxtomail.persistence.entities.Attachment.attribute.originalFile.tagvalue.notNull=true
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java 2014-06-04 08:08:56 UTC (rev 129)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java 2014-06-04 14:43:27 UTC (rev 130)
@@ -77,7 +77,7 @@
/**
* Save configuration.
*
- * @param config cufiguration to save
+ * @param config configuration to save
*/
public void saveConfiguration(Configuration config) {
ConfigurationTopiaDao dao = getPersistenceContext().getConfigurationDao();
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielService.java 2014-06-04 08:08:56 UTC (rev 129)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielService.java 2014-06-04 14:43:27 UTC (rev 130)
@@ -45,6 +45,7 @@
import com.franciaflex.faxtomail.persistence.entities.Client;
import com.franciaflex.faxtomail.persistence.entities.ClientTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.DemandType;
+import com.franciaflex.faxtomail.persistence.entities.DemandTypeImpl;
import com.franciaflex.faxtomail.persistence.entities.DemandTypeTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.EmailAccount;
import com.franciaflex.faxtomail.persistence.entities.EmailAccountTopiaDao;
@@ -129,6 +130,38 @@
getPersistenceContext().commit();
}
+ public void saveDemandTypes(List<DemandType> demandTypes) {
+ Binder<DemandType, DemandType> binderDemandType = BinderFactory.newBinder(DemandType.class);
+ DemandTypeTopiaDao demandTypeDAO = getPersistenceContext().getDemandTypeDao();
+
+ List<DemandType> allDemandType = getAllDemandType();
+ Map<String, DemandType> allDemandTypeIndex = new HashMap<>(Maps.uniqueIndex(allDemandType, TopiaEntities.getTopiaIdFunction()));
+ for (DemandType demandType : demandTypes) {
+ // get current etat attente
+ DemandType currentDemandType;
+ if (StringUtils.isBlank(demandType.getTopiaId()) || demandType.getTopiaId().startsWith("new_")) {
+ currentDemandType = new DemandTypeImpl();
+ } else {
+ currentDemandType = allDemandTypeIndex.remove(demandType.getTopiaId());
+ }
+
+ // copy
+ binderDemandType.copyExcluding(demandType, currentDemandType,
+ EtatAttente.PROPERTY_TOPIA_ID,
+ EtatAttente.PROPERTY_TOPIA_CREATE_DATE,
+ EtatAttente.PROPERTY_TOPIA_VERSION);
+
+ // persist
+ if (currentDemandType.isPersisted()) {
+ demandTypeDAO.update(currentDemandType);
+ } else {
+ demandTypeDAO.create(currentDemandType);
+ }
+ }
+
+ getPersistenceContext().commit();
+ }
+
public List<Client> getAllClients() {
ClientTopiaDao dao = getPersistenceContext().getClientDao();
return new ArrayList<>(dao.findAll());
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/EmailAccountImportModel.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/EmailAccountImportModel.java 2014-06-04 08:08:56 UTC (rev 129)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/EmailAccountImportModel.java 2014-06-04 14:43:27 UTC (rev 130)
@@ -24,8 +24,13 @@
* #L%
*/
+import java.text.ParseException;
+
import com.franciaflex.faxtomail.persistence.entities.EmailAccount;
import com.franciaflex.faxtomail.persistence.entities.EmailAccountImpl;
+import com.franciaflex.faxtomail.persistence.entities.EmailProtocol;
+
+import org.nuiton.csv.ValueParser;
import org.nuiton.csv.ext.AbstractImportModel;
/**
@@ -37,8 +42,25 @@
public EmailAccountImportModel(char separator) {
super(separator);
- newMandatoryColumn("protocol", EmailAccount.PROPERTY_PROTOCOL);
+ newMandatoryColumn("protocol", EmailAccount.PROPERTY_PROTOCOL, new ValueParser<EmailProtocol>() {
+
+ @Override
+ public EmailProtocol parse(String value) throws ParseException {
+ EmailProtocol protocol = EmailProtocol.valueOf(value.toUpperCase());
+ return protocol;
+ }
+
+ });
newMandatoryColumn("host", EmailAccount.PROPERTY_HOST);
+ newMandatoryColumn("port", EmailAccount.PROPERTY_PORT, new ValueParser<Integer>() {
+
+ @Override
+ public Integer parse(String value) throws ParseException {
+ Integer result = Integer.valueOf(value);
+ return result;
+ }
+
+ });
newMandatoryColumn("user", EmailAccount.PROPERTY_LOGIN);
newMandatoryColumn("password", EmailAccount.PROPERTY_PASSWORD);
}
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-04 08:08:56 UTC (rev 129)
+++ trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/AbstractFaxToMailServiceTest.java 2014-06-04 14:43:27 UTC (rev 130)
@@ -148,13 +148,13 @@
log.trace("closing transaction " + persistenceContext);
}
- persistenceContext.closeContext();
+ persistenceContext.close();
if (log.isTraceEnabled()) {
log.trace("closing transaction " + applicationContext);
}
- applicationContext.closeContext();
+ applicationContext.close();
File lockFile = new File(databaseRefFile, "h2data.lock.db");
@@ -226,7 +226,7 @@
log.trace("closing transaction " + openedTransaction);
}
- openedTransaction.closeContext();
+ openedTransaction.close();
}
@@ -236,7 +236,7 @@
log.trace("closing transaction " + applicationContext);
}
- applicationContext.closeContext();
+ applicationContext.close();
}
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java 2014-06-04 08:08:56 UTC (rev 129)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java 2014-06-04 14:43:27 UTC (rev 130)
@@ -91,7 +91,7 @@
public void close() {
if (topiaApplicationContext != null) {
- topiaApplicationContext.closeContext();
+ topiaApplicationContext.close();
}
}
@@ -142,7 +142,7 @@
initExtranetService.init();
- persistenceContext.closeContext();
+ persistenceContext.close();
}
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailApplicationListener.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailApplicationListener.java 2014-06-04 08:08:56 UTC (rev 129)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailApplicationListener.java 2014-06-04 14:43:27 UTC (rev 130)
@@ -52,6 +52,8 @@
protected FaxToMailApplicationContext applicationContext;
+ protected Scheduler scheduler;
+
@Override
public void contextInitialized(ServletContextEvent sce) {
@@ -88,11 +90,6 @@
.withIdentity("faxToMailJobs", "ediManagementJob")
.build();
- JobDetail ldapJob = JobBuilder.newJob(EDIManagementJob.class)
- .usingJobData(data)
- .withIdentity("faxToMailJobs", "ldapJob")
- .build();
-
try {
// schedule mail job (toutes les 20 minutes)
@@ -103,7 +100,7 @@
.build();
Scheduler scheduler = new StdSchedulerFactory().getScheduler();
- scheduler.start();
+ //scheduler.start();
scheduler.scheduleJob(mailFilteringJob, trigger);
// schedule EDI job (toutes les 5 heures)s
@@ -113,20 +110,12 @@
.withSchedule(CronScheduleBuilder.cronSchedule("* 0/5 * * * ?"))
.build();
- scheduler = new StdSchedulerFactory().getScheduler();
- scheduler.start();
+ //scheduler = new StdSchedulerFactory().getScheduler();
+ //scheduler.start();
scheduler.scheduleJob(ediManagementJob, trigger);
- // schedule ldap job (toutes les heures à 0 minute)
- trigger = TriggerBuilder
- .newTrigger()
- .withIdentity("ldapManagement", "ldapManagementTrigger")
- .withSchedule(CronScheduleBuilder.cronSchedule("0 * * * * ?"))
- .build();
-
- scheduler = new StdSchedulerFactory().getScheduler();
+ // start scheduler
scheduler.start();
- scheduler.scheduleJob(ldapJob, trigger);
log.debug("schedulers launched");
@@ -140,9 +129,23 @@
public void contextDestroyed(ServletContextEvent sce) {
if (log.isInfoEnabled()) {
- log.info("stop FaxToMail web ui");
+ if (log.isInfoEnabled()) {
+ log.info("Stopping quartz sheduler");
+ }
}
+ try {
+ scheduler.shutdown();
+ } catch (SchedulerException e) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't stop quartz", e);
+ }
+ }
+
+ if (log.isInfoEnabled()) {
+ log.info("Closing web ui application context");
+ }
+
applicationContext.close();
}
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java 2014-06-04 08:08:56 UTC (rev 129)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java 2014-06-04 14:43:27 UTC (rev 130)
@@ -139,7 +139,7 @@
} finally {
- serviceContext.getPersistenceContext().closeContext();
+ serviceContext.getPersistenceContext().close();
}
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-04 08:08:56 UTC (rev 129)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-06-04 14:43:27 UTC (rev 130)
@@ -33,10 +33,11 @@
import org.apache.struts2.convention.annotation.Result;
import com.franciaflex.faxtomail.persistence.entities.Configuration;
-import com.franciaflex.faxtomail.persistence.entities.ConfigurationImpl;
+import com.franciaflex.faxtomail.persistence.entities.DemandType;
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.FolderAction;
import com.franciaflex.faxtomail.persistence.entities.MailField;
import com.franciaflex.faxtomail.persistence.entities.MailFilter;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
@@ -66,6 +67,8 @@
protected List<EtatAttente> etatAttentes;
+ protected List<DemandType> demandTypes;
+
protected List<MailFolder> mailFolders;
protected List<MailFilter> mailFilters;
@@ -76,17 +79,19 @@
@Override
public void prepare() throws Exception {
- configuration = configurationService.getConfiguration();
+
}
@Override
@org.apache.struts2.convention.annotation.Action("configuration-input")
public String input() throws Exception {
etatAttentes = referentielService.getAllEtatAttente();
+ demandTypes = referentielService.getAllDemandType();
mailFolders = mailFolderService.getRootMailFolders();
users = configurationService.getAllUsers();
emailAccounts = configurationService.getEmailAccounts();
mailFilters = configurationService.getMailFilters();
+ configuration = configurationService.getConfiguration();
return INPUT;
}
@@ -98,6 +103,7 @@
configurationService.saveConfiguration(configuration);
referentielService.saveEtatAttente(etatAttentes);
+ referentielService.saveDemandTypes(demandTypes);
mailFolderService.saveMailFolders(mailFolders);
configurationService.saveMailFilters(mailFilters);
configurationService.saveEmailAccounts(emailAccounts);
@@ -118,12 +124,13 @@
}
public Configuration getConfiguration() {
- if (configuration == null) {
- return new ConfigurationImpl(); // just pour eviter les traces struts
- }
return configuration;
}
+ public void setConfigurationJson(String json) {
+ this.configuration = getGson().fromJson(json, Configuration.class);
+ }
+
public List<EtatAttente> getEtatAttentes() {
return etatAttentes;
}
@@ -133,18 +140,14 @@
this.etatAttentes = getGson().fromJson(json, type);
}
- public Map<MailAction, String> getMailActions() {
- return getEnumAsMap(MailAction.values());
+ public List<DemandType> getDemandTypes() {
+ return demandTypes;
}
-
- public Map<MailAction, String> getContextMailActions() {
- // FIXME add filter on isContextual
- return getEnumAsMap(MailAction.ARCHIVE, MailAction.PRINT, MailAction.REPLY);
+
+ public void setDemandTypesJson(String json) {
+ Type type = new TypeToken<List<DemandType>>() {}.getType();
+ this.demandTypes = getGson().fromJson(json, type);
}
-
- public Map<MailField, String> getMailFields() {
- return getEnumAsMap(MailField.values());
- }
public List<MailFolder> getMailFolders() {
return mailFolders;
@@ -176,4 +179,16 @@
Type type = new TypeToken<List<EmailAccount>>() {}.getType();
this.emailAccounts = getGson().fromJson(json, type);
}
+
+ public Map<MailAction, String> getMailActions() {
+ return getEnumAsMap(MailAction.values());
+ }
+
+ public Map<FolderAction, String> getFolderActions() {
+ return getEnumAsMap(FolderAction.values());
+ }
+
+ public Map<MailField, String> getMailFields() {
+ return getEnumAsMap(MailField.values());
+ }
}
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java 2014-06-04 08:08:56 UTC (rev 129)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java 2014-06-04 14:43:27 UTC (rev 130)
@@ -57,6 +57,7 @@
import com.franciaflex.faxtomail.persistence.entities.Client;
import com.franciaflex.faxtomail.services.service.ClientService;
+
import org.apache.commons.io.Charsets;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
@@ -73,6 +74,7 @@
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.EmailAccount;
import com.franciaflex.faxtomail.persistence.entities.EmailImpl;
+import com.franciaflex.faxtomail.persistence.entities.EmailProtocol;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.services.DecoratorService;
import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
@@ -99,7 +101,7 @@
Collection<EmailAccount> emailAccounts = configurationService.getEmailAccounts();
for (EmailAccount account : emailAccounts) {
- if ("pop3".equals(account.getProtocol().toLowerCase())) {
+ if (account.getProtocol() == EmailProtocol.POP3) {
checkEmailsOnPop3(account);
}
}
@@ -114,6 +116,7 @@
properties.setProperty("mail.store.protocol", "pop3");
properties.setProperty("mail.pop3.host", account.getHost());
properties.setProperty("mail.pop3.user", account.getLogin());
+ properties.setProperty("mail.pop3.port", String.valueOf(account.getPort()));
Session session = Session.getInstance(properties);
Store store = null;
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-04 08:08:56 UTC (rev 129)
+++ trunk/faxtomail-ui-web/src/main/resources/i18n/faxtomail-ui-web_fr_FR.properties 2014-06-04 14:43:27 UTC (rev 130)
@@ -1,3 +1,5 @@
+com.franciaflex.faxtomail.persistence.entities.FolderAction.COMPUTE_RANGE=Calculer les quantités par gamme
+com.franciaflex.faxtomail.persistence.entities.FolderAction.NEW_DEMANDE=Créer une nouvelle demande
com.franciaflex.faxtomail.persistence.entities.MailAction.ARCHIVE=Archiver
com.franciaflex.faxtomail.persistence.entities.MailAction.GROUP=Grouper
com.franciaflex.faxtomail.persistence.entities.MailAction.PRINT=Imprimer
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-04 08:08:56 UTC (rev 129)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-06-04 14:43:27 UTC (rev 130)
@@ -46,10 +46,12 @@
ConfigurationModule.value('ConfigurationData', {
// enums
'mailActions': <s:property value="toJson(mailActions)" escapeHtml="false"/>,
- 'contextMailActions': <s:property value="toJson(contextMailActions)" escapeHtml="false"/>,
+ 'folderActions': <s:property value="toJson(folderActions)" escapeHtml="false"/>,
'mailFields': <s:property value="toJson(mailFields)" escapeHtml="false"/>,
// datas
+ 'configuration': <s:property value="toJson(configuration)" escapeHtml="false"/>,
'etatAttentes' : <s:property value="toJson(etatAttentes)" escapeHtml="false"/>,
+ 'demandTypes' : <s:property value="toJson(demandTypes)" escapeHtml="false"/>,
'mailFolders': <s:property value="toJson(mailFolders)" escapeHtml="false"/>,
'searchDisplayColumns': <s:property value="toJson(configuration.searchDisplayColumns)" escapeHtml="false"/>,
'users': <s:property value="toJson(users)" escapeHtml="false"/>,
@@ -65,13 +67,14 @@
<h1 class="page-header">Configuration</h1>
- <s:form id="main_form" action="configuration" ng-controller="ConfigurationController">
+ <s:form id="main_form" action="configuration" method="post" ng-controller="ConfigurationController">
<s:hidden name="activeTab"/>
<ul id="tabs" class="nav nav-tabs">
<li class="active"><a href="#tabs-general" data-toggle="tab">Général</a></li>
- <li><a href="#tabs-wait" data-toggle="tab">États d'attente</a></li>
+ <li><a href="#tabs-etatAttente" data-toggle="tab">États d'attente</a></li>
+ <li><a href="#tabs-demandType" data-toggle="tab">Types de demandes</a></li>
<li><a href="#tabs-tree" data-toggle="tab">Arborescence</a></li>
<li><a href="#tabs-filters" data-toggle="tab">Filtres de mail</a></li>
<li><a href="#tabs-search" data-toggle="tab">Recherche</a></li>
@@ -79,25 +82,62 @@
</ul>
<div class="tab-content active" ng-controller="ConfigurationMiscController">
+ <input type="hidden" name="configurationJson" value="{{configuration}}" />
<div id="tabs-general" class="tab-pane active">
<!-- Général -->
-
- <s:textfield name="configuration.convertToPdfCommand"
- label="Ligne de commande de conversion de fichier X en pdf"/>
-
- <s:textfield name="configuration.openAttachmentCommand"
- label="Ligne de commande d'ouverture de fichier non TXT, TIFF, JPEG, PDF"/>
-
- <s:textfield name="configuration.emailMaxSize"
- label="Taille maximale des email (en bits)"/>
-
- <!-- 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)-->
-
+ <div class="form-group">
+ <label class="control-label" for="configurationEmailMaxSizeField">Taille maximale des email (en bits)</label>
+ <input type="text" id="configurationEmailMaxSizeField" class="form-control" ng-model="configuration.emailMaxSize" />
+ </div>
+
+ <table class="table table-bordered">
+ <caption>Commande de traitement des extensions de pièces jointes</caption>
+ <thead>
+ <tr>
+ <th>Extension</th>
+ <th>Commandes</th>
+ <th>Suppr.</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr ng-repeat="extensionCommand in configuration.extensionCommands">
+ <td class="col-xs-2">
+ <div class="form-group">
+ <input type="text" class="form-control" ng-model="extensionCommand.extension" size="5" placeholder="jpg" required>
+ </div>
+ </td>
+ <td>
+ <div class="form-group">
+ <label for="convertToToPdfField">Conversion en pdf :</label>
+ <input id="convertToToPdfField" type="email" class="form-control" ng-model="extensionCommand.convertToPdfCommand" placeholder="" />
+ </div>
+ <div class="form-group">
+ <label for="openAttachmentCommandField">Ouverture :</label>
+ <input id="openAttachmentCommandField" type="email" class="form-control" ng-model="extensionCommand.openAttachmentCommand" placeholder="" />
+ </div>
+ </td>
+ <td>
+ <a class="pull-right btn btn-danger btn-xs " ng-click="deleteExtensionRow($index)" title="Supprimer l'extension">
+ <span class="glyphicon glyphicon-remove"></span></a>
+ </td>
+ </tr>
+ <tr ng-if="!configuration.extensionCommands || configuration.extensionCommands.length == 0">
+ <td colspan="3" class="emptyTable">Aucune extension définie</td>
+ </tr>
+ </tbody>
+ <tfoot>
+ <tr>
+ <td colspan="3">
+ <a class="pull-right btn btn-success btn-xs" ng-click="addExtensionRow()" >
+ <span class="glyphicon glyphicon-plus"></span> Ajouter une ligne</a>
+ </td>
+ </tr>
+ </tfoot>
+ </table>
</div>
- <div id="tabs-wait" class="tab-pane" ng-controller="ConfigurationWaitController">
+ <div id="tabs-etatAttente" class="tab-pane" ng-controller="ConfigurationEtatAttenteController">
<input type="hidden" name="etatAttentesJson" value="{{etatAttentes}}" />
<div class="row">
@@ -116,15 +156,16 @@
<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="(mailField,label) in mailFields">
- <input type="checkbox" ng-checked="selectedEtatAttente.fields.indexOf(mailField) != -1"
- ng-click="changeEtatAttenteField(mailField)"> {{label}}
+ Actions autorisées lorsque la demande est <strong>valide</strong> :
+ <label class="checkbox" ng-repeat="(mailAction,label) in mailActions">
+ <input type="checkbox" ng-checked="selectedEtatAttente.validFormDisabledActions.indexOf(mailAction) == -1"
+ ng-click="changeEtatAttenteValidAction(mailAction)"> {{label}}
</label>
- Actions autorisées pour l'état d'attente :
+
+ Actions autorisées lorsque la demande est <strong>invalide</strong> :
<label class="checkbox" ng-repeat="(mailAction,label) in mailActions">
- <input type="checkbox" ng-checked="selectedEtatAttente.mailActions.indexOf(mailAction) != -1"
- ng-click="changeEtatAttenteAction(mailAction)"> {{label}}
+ <input type="checkbox" ng-checked="selectedEtatAttente.invalidFormDisabledActions.indexOf(mailAction) == -1"
+ ng-click="changeEtatAttenteInvalidAction(mailAction)"> {{label}}
</label>
</div>
<div class="col-md-7" ng-if="!selectedEtatAttente">
@@ -133,6 +174,38 @@
</div>
</div>
+
+ <div id="tabs-demandType" class="tab-pane" ng-controller="ConfigurationDemandTypeController">
+ <input type="hidden" name="demandTypesJson" value="{{demandTypes}}" />
+
+ <div class="row">
+ <div class="col-md-4">
+ <h3>Type de document <input type="button" class="btn btn-success btn-xs pull-right" value="Nouveau" ng-click="newDemandType()" /></h3>
+ <table class="table table-hover">
+ <tbody>
+ <tr ng-repeat="demandType in demandTypes"
+ ng-class="{'info' : demandType == selectedDemandType}"
+ ng-click="editDemandType(demandType)">
+ <td>{{demandType.label}}</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+
+ <div class="col-md-7" ng-if="selectedDemandType">
+ <h3>Édition du type de document {{selectedDemandType.label}}</h3>
+ Champs obligatoires pour le type de document :
+ <label class="checkbox" ng-repeat="(mailField,label) in mailFields">
+ <input type="checkbox" ng-checked="selectedDemandType.fields.indexOf(mailField) != -1"
+ ng-click="changeDemandTypeField(mailField)"> {{label}}
+ </label>
+ </div>
+ <div class="col-md-7" ng-if="!selectedDemandType">
+ <em>Sélectionnez un type de document.</em>
+ </div>
+ </div>
+
+ </div>
<div id="tabs-tree" class="tab-pane" ng-controller="ConfigurationTreeController">
<input type="hidden" name="mailFoldersJson" value="{{mailFolders}}" />
Modified: trunk/faxtomail-ui-web/src/main/webapp/css/faxtomail.css
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/css/faxtomail.css 2014-06-04 08:08:56 UTC (rev 129)
+++ trunk/faxtomail-ui-web/src/main/webapp/css/faxtomail.css 2014-06-04 14:43:27 UTC (rev 130)
@@ -34,6 +34,11 @@
margin-bottom: 25px;
}
+.emptyTable {
+ text-align: center;
+ font-style: italic;
+}
+
.angular-ui-tree-handle {
background: #f8faff;
border: 1px solid #dae2ea;
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-04 08:08:56 UTC (rev 129)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-04 14:43:27 UTC (rev 130)
@@ -34,9 +34,11 @@
//{Map} les champs obligatoires possibles
$scope.mailFields = ConfigurationData.mailFields;
//{Map} les actions contextuelles possibles pour les dossiers
- $scope.contextMailActions = ConfigurationData.contextMailActions;
+ $scope.folderActions = ConfigurationData.folderActions;
//{Array} les etats d'attentes disponibles
$scope.etatAttentes = ConfigurationData.etatAttentes;
+ //{Array} les types de documents
+ $scope.demandTypes = ConfigurationData.demandTypes;
//{Array} mail folders
$scope.mailFolders = ConfigurationData.mailFolders;
@@ -61,15 +63,31 @@
/**
* Misc tab controller.
*/
-ConfigurationModule.controller('ConfigurationMiscController', ['$scope', '$http', 'ConfigurationData',
- function($scope, $http, ConfigurationData) {
+ConfigurationModule.controller('ConfigurationMiscController', ['$scope', '$http', '$window', 'ConfigurationData',
+ function($scope, $http, $window, ConfigurationData) {
+ //{Object} L'object configuration
+ $scope.configuration = ConfigurationData.configuration;
+
+ // Ajout d'une nouvelle ligne vide d'extension
+ $scope.addExtensionRow = function() {
+ if (!$scope.configuration.extensionCommands) {
+ $scope.configuration.extensionCommands = [];
+ }
+ $scope.configuration.extensionCommands.push({});
+ };
+ // suppression d'un ligne
+ $scope.deleteExtensionRow = function(index) {
+ if ($window.confirm("Êtes-vous sûr de vouloir supprimer cette extension ?")) {
+ $scope.configuration.extensionCommands.splice(index, 1);
+ }
+ };
}]);
/**
* Etat attente tab controller.
*/
-ConfigurationModule.controller('ConfigurationWaitController', ['$scope', '$http', '$window', 'ConfigurationData',
+ConfigurationModule.controller('ConfigurationEtatAttenteController', ['$scope', '$http', '$window', 'ConfigurationData',
function($scope, $http, $window, ConfigurationData) {
//{Object} etat d'attente selectionné
@@ -80,11 +98,11 @@
$scope.selectedEtatAttente = etatAttente;
// initialize le tableau d'action si vide
- if (!$scope.selectedEtatAttente.mainActions) {
- $scope.selectedEtatAttente.mainActions = [];
+ if (!$scope.selectedEtatAttente.invalidFormDisabledActions) {
+ $scope.selectedEtatAttente.invalidFormDisabledActions = [];
}
- if (!$scope.selectedEtatAttente.fields) {
- $scope.selectedEtatAttente.fields = [];
+ if (!$scope.selectedEtatAttente.validFormDisabledActions) {
+ $scope.selectedEtatAttente.validFormDisabledActions = [];
}
};
@@ -105,28 +123,74 @@
};
// selection/deselection d'une action
- $scope.changeEtatAttenteAction = function(action) {
-
- var index = $scope.selectedEtatAttente.mailActions.indexOf(action);
+ $scope.changeEtatAttenteValidAction = function(action) {
+ var index = $scope.selectedEtatAttente.validFormDisabledActions.indexOf(action);
if (index != -1) {
- $scope.selectedEtatAttente.mailActions.splice(index, 1);
+ $scope.selectedEtatAttente.validFormDisabledActions.splice(index, 1);
} else {
- $scope.selectedEtatAttente.mailActions.push(action);
+ $scope.selectedEtatAttente.validFormDisabledActions.push(action);
}
};
+ // selection/deselection d'une action
+ $scope.changeEtatAttenteInvalidAction = function(action) {
+ var index = $scope.selectedEtatAttente.invalidFormDisabledActions.indexOf(action);
+ if (index != -1) {
+ $scope.selectedEtatAttente.invalidFormDisabledActions.splice(index, 1);
+ } else {
+ $scope.selectedEtatAttente.invalidFormDisabledActions.push(action);
+ }
+ };
+}]);
+
+
+/**
+ * Demand type tab controller.
+ */
+ConfigurationModule.controller('ConfigurationDemandTypeController', ['$scope', '$http', '$window', 'ConfigurationData',
+ function($scope, $http, $window, ConfigurationData) {
+ //{Object} demand type selectionné
+ $scope.selectedDemandType;
+
+ // edition d'un type de demande
+ $scope.editDemandType = function(demandType) {
+ $scope.selectedDemandType = demandType;
+
+ // initialize le tableau d'action si vide
+ if (!$scope.selectedDemandType.fields) {
+ $scope.selectedDemandType.fields = [];
+ }
+ };
+
+ // ajout d'un nouvel etat d'attente
+ $scope.newDemandType = function() {
+ var label = $window.prompt("Nom du nouveau type de document ?");
+ if (label) {
+ // auto select new etat
+ var newDemandType = {
+ topiaId : "new_" + guid(),
+ label: label
+ };
+ $scope.demandTypes.push(newDemandType);
+
+ // auto select
+ $scope.editDemandType(newDemandType);
+ }
+ };
+
// selection/deselection d'un champ
- $scope.changeEtatAttenteField = function(mailField) {
+ $scope.changeDemandTypeField = function(mailField) {
- var index = $scope.selectedEtatAttente.fields.indexOf(mailField);
+ var index = $scope.selectedDemandType.fields.indexOf(mailField);
if (index != -1) {
- $scope.selectedEtatAttente.fields.splice(index, 1);
+ $scope.selectedDemandType.fields.splice(index, 1);
} else {
- $scope.selectedEtatAttente.fields.push(mailField);
+ $scope.selectedDemandType.fields.push(mailField);
}
};
}]);
+
/**
* Mail folder tab controller.
*/
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-06-04 08:08:56 UTC (rev 129)
+++ trunk/pom.xml 2014-06-04 14:43:27 UTC (rev 130)
@@ -100,12 +100,12 @@
<nuitonCsvVersion>3.0-rc-2</nuitonCsvVersion>
<nuitonDecoratorVersion>3.0-alpha-3</nuitonDecoratorVersion>
<nuitonUpdaterVersion>3.0-alpha-2</nuitonUpdaterVersion>
- <nuitonUtilsVersion>3.0-SNAPSHOT</nuitonUtilsVersion>
+ <nuitonUtilsVersion>3.0-rc-3</nuitonUtilsVersion>
<nuitonValidatorVersion>3.0-rc-1</nuitonValidatorVersion>
<nuitonWebVersion>1.16</nuitonWebVersion>
- <eugeneVersion>2.9</eugeneVersion>
- <topiaVersion>3.0-SNAPSHOT</topiaVersion>
+ <eugeneVersion>2.10</eugeneVersion>
+ <topiaVersion>3.0-beta-5</topiaVersion>
<hibernateVersion>4.3.5.Final</hibernateVersion>
<h2Version>1.3.176</h2Version>
1
0
r129 - in trunk: faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin faxtomail-ui-web/src/main/webapp/js
by echatellier@users.forge.codelutin.com 04 Jun '14
by echatellier@users.forge.codelutin.com 04 Jun '14
04 Jun '14
Author: echatellier
Date: 2014-06-04 10:08:56 +0200 (Wed, 04 Jun 2014)
New Revision: 129
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/129
Log:
Refactoring angularjs.
Affichage des groupes ldap dans l'interface
Modified:
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java
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/ldap-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
trunk/faxtomail-ui-web/src/main/webapp/js/user-folder.js
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java 2014-06-03 15:42:28 UTC (rev 128)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java 2014-06-04 08:08:56 UTC (rev 129)
@@ -43,11 +43,12 @@
import com.franciaflex.faxtomail.persistence.entities.EmailAccountImpl;
import com.franciaflex.faxtomail.persistence.entities.EmailAccountTopiaDao;
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.persistence.entities.MailFilter;
import com.franciaflex.faxtomail.persistence.entities.MailFilterTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
-import com.franciaflex.faxtomail.persistence.entities.MailFolderTopiaDao;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
import com.google.common.collect.Maps;
@@ -177,7 +178,7 @@
public List<FaxToMailUser> getAllUsers() {
FaxToMailUserTopiaDao faxToMailUserDao = getPersistenceContext().getFaxToMailUserDao();
- return faxToMailUserDao.forAll().setOrderByArguments(FaxToMailUser.PROPERTY_FIRST_NAME, FaxToMailUser.PROPERTY_LAST_NAME).findAll();
+ return faxToMailUserDao.forAll().setOrderByArguments(FaxToMailUser.PROPERTY_FIRST_NAME, FaxToMailUser.PROPERTY_LAST_NAME).find(0, 50);
}
public void saveUserFolders(Map<String, Collection<MailFolder>> userFolders) {
@@ -200,4 +201,9 @@
getPersistenceContext().commit();
}
+
+ public List<FaxToMailUserGroup> getAllGroups() {
+ FaxToMailUserGroupTopiaDao faxToMailUserGroupDao = getPersistenceContext().getFaxToMailUserGroupDao();
+ return faxToMailUserGroupDao.forAll().setOrderByArguments(FaxToMailUserGroup.PROPERTY_FULL_PATH).findAll();
+ }
}
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java 2014-06-03 15:42:28 UTC (rev 128)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java 2014-06-04 08:08:56 UTC (rev 129)
@@ -36,6 +36,7 @@
import org.apache.struts2.convention.annotation.Result;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.services.service.ConfigurationService;
import com.franciaflex.faxtomail.services.service.MailFolderService;
@@ -54,6 +55,8 @@
protected List<FaxToMailUser> users;
+ protected List<FaxToMailUserGroup> groups;
+
protected Map<String, Collection<MailFolder>> userFolders;
public void setConfigurationService(ConfigurationService configurationService) {
@@ -69,11 +72,12 @@
public String input() throws Exception {
mailFolders = mailFolderService.getAllMailFolders();
users = configurationService.getAllUsers();
-
- userFolders = new HashMap<>();
+ groups = configurationService.getAllGroups();
+
+ /*userFolders = new HashMap<>();
for (FaxToMailUser user : users) {
userFolders.put(user.getTopiaId(), CollectionUtils.emptyIfNull(user.getAffectedFolders()));
- }
+ }*/
return INPUT;
}
@@ -85,15 +89,19 @@
configurationService.saveUserFolders(userFolders);
return SUCCESS;
}
-
+
public List<MailFolder> getMailFolders() {
return mailFolders;
}
-
+
public List<FaxToMailUser> getUsers() {
return users;
}
-
+
+ public List<FaxToMailUserGroup> getGroups() {
+ return groups;
+ }
+
public Map<String, Collection<MailFolder>> getUserFolders() {
return userFolders;
}
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-03 15:42:28 UTC (rev 128)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-06-04 08:08:56 UTC (rev 129)
@@ -28,11 +28,9 @@
<html>
<head>
<title>Configuration</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='/nuiton-js-angular-ui-tree/angular-ui-tree.css' />" />
-
- <link rel="stylesheet" type="text/css" href="<s:url value='/css/faxtomail.css' />" />
-
<script type="text/javascript" src="<s:url value='/webjars/select2/3.4.8/select2.min.js' />"></script>
<script type="text/javascript" src="<s:url value='/webjars/select2/3.4.8/select2_locale_fr.js' />"></script>
<script type="text/javascript" src="<s:url value='/webjars/angularjs/1.2.16/angular.min.js' />"></script>
@@ -40,12 +38,12 @@
<script type="text/javascript" src="<s:url value='/nuiton-js-angular-ui-tree/angular-ui-tree.js' />"></script>
<script type="text/javascript" src="<s:url value='/webjars/angular-ui-sortable/0.12.2/sortable.min.js' />"></script>
+ <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>
<script type="text/javascript" src="<s:url value='/js/configuration.js' />"></script>
<script type="text/javascript">
- angular.module('ConfigurationModule', ['FaxToMail', 'ui.tree', 'ui.sortable', 'ui.select2.sortable'])
- .value('ConfigurationData', {
+ ConfigurationModule.value('ConfigurationData', {
// enums
'mailActions': <s:property value="toJson(mailActions)" escapeHtml="false"/>,
'contextMailActions': <s:property value="toJson(contextMailActions)" escapeHtml="false"/>,
@@ -367,7 +365,7 @@
<caption>Aperçu</caption>
<thead>
<tr>
- <th ng-repeat="etatAttenteField in folderTableColumns">{{etatAttenteFields[etatAttenteField.id]}}</th>
+ <th ng-repeat="etatAttenteField in folderTableColumns">{{mailFields[etatAttenteField.id]}}</th>
</tr>
</thead>
</table>
Modified: 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 2014-06-03 15:42:28 UTC (rev 128)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/ldap-input.jsp 2014-06-04 08:08:56 UTC (rev 129)
@@ -29,8 +29,6 @@
<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>
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-03 15:42:28 UTC (rev 128)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp 2014-06-04 08:08:56 UTC (rev 129)
@@ -28,22 +28,22 @@
<html>
<head>
<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' />" />
-
<script type="text/javascript" src="<s:url value='/webjars/select2/3.4.8/select2.min.js' />"></script>
<script type="text/javascript" src="<s:url value='/webjars/select2/3.4.8/select2_locale_fr.js' />"></script>
<script type="text/javascript" src="<s:url value='/webjars/angularjs/1.2.16/angular.min.js' />"></script>
<script type="text/javascript" src="<s:url value='/js/select2sortable.js' />"></script>
+ <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>
<script type="text/javascript" src="<s:url value='/js/user-folder.js' />"></script>
<script type="text/javascript">
- angular.module('UserFolderModule', ['FaxToMail', 'ui.select2.sortable'])
- .value('UserFolderData', {
+ UserFolderModule.value('UserFolderData', {
'mailFolders': <s:property value="toJson(mailFolders)" escapeHtml="false"/>,
'users': <s:property value="toJson(users)" escapeHtml="false"/>,
+ 'groups': <s:property value="toJson(groups)" escapeHtml="false"/>,
'userFolders': <s:property value="toJson(userFolders)" escapeHtml="false"/>
});
</script>
@@ -58,6 +58,12 @@
<s:form id="main_form" action="user-folder" method="post" ng-controller="UserFolderController">
<s:hidden name="userFoldersJson" value="{{userFolders}}" />
+ <div class="form-group">
+ <label>Groupe :
+ <select ng-model="selectedGroup" ng-options="group as group.fullPath for group in groups"></select>
+ </label>
+ </div>
+
<table id='table-snapshot' class="table table-bordered">
<thead>
<tr>
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-03 15:42:28 UTC (rev 128)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-04 08:08:56 UTC (rev 129)
@@ -22,10 +22,12 @@
* #L%
*/
+var ConfigurationModule = angular.module('ConfigurationModule', ['FaxToMail', 'ui.tree', 'ui.sortable', 'ui.select2.sortable']);
+
/**
* Global configuration controller.
*/
-FaxToMailModule.controller('ConfigurationController', ['$scope', '$http', 'ConfigurationData',
+ConfigurationModule.controller('ConfigurationController', ['$scope', '$http', 'ConfigurationData',
function($scope, $http, ConfigurationData) {
//{Map} les actions possibles pour les etats d'attentes
$scope.mailActions = ConfigurationData.mailActions;
@@ -59,7 +61,7 @@
/**
* Misc tab controller.
*/
-FaxToMailModule.controller('ConfigurationMiscController', ['$scope', '$http', 'ConfigurationData',
+ConfigurationModule.controller('ConfigurationMiscController', ['$scope', '$http', 'ConfigurationData',
function($scope, $http, ConfigurationData) {
}]);
@@ -67,7 +69,7 @@
/**
* Etat attente tab controller.
*/
-FaxToMailModule.controller('ConfigurationWaitController', ['$scope', '$http', '$window', 'ConfigurationData',
+ConfigurationModule.controller('ConfigurationWaitController', ['$scope', '$http', '$window', 'ConfigurationData',
function($scope, $http, $window, ConfigurationData) {
//{Object} etat d'attente selectionné
@@ -128,7 +130,7 @@
/**
* Mail folder tab controller.
*/
-FaxToMailModule.controller('ConfigurationTreeController', ['$scope', '$http', '$window', 'ConfigurationData',
+ConfigurationModule.controller('ConfigurationTreeController', ['$scope', '$http', '$window', 'ConfigurationData',
function($scope, $http, $window, ConfigurationData) {
// {Object} selected mail folder
$scope.selectedMailFolder;
@@ -214,7 +216,7 @@
// fonction retournant l'ensemble des options disponibles
$scope.getObjectsData = function(term, result) {
var resultArray = [];
- angular.forEach($scope.fields, function(label, field) {
+ angular.forEach($scope.mailFields, function(label, field) {
resultArray.push({
id: field,
label: label
@@ -280,7 +282,7 @@
/**
* Mail filter tab controller.
*/
-FaxToMailModule.controller('ConfigurationFilterController', ['$scope', '$http', 'ConfigurationData',
+ConfigurationModule.controller('ConfigurationFilterController', ['$scope', '$http', 'ConfigurationData',
function($scope, $http, ConfigurationData) {
//{Array} Current mail filter list
$scope.mailFilters = ConfigurationData.mailFilters;
@@ -305,7 +307,7 @@
/**
* Search tab controller.
*/
-FaxToMailModule.controller('ConfigurationSearchController', ['$scope', '$http', 'ConfigurationData',
+ConfigurationModule.controller('ConfigurationSearchController', ['$scope', '$http', 'ConfigurationData',
function($scope, $http, ConfigurationData) {
//{Array} Options actuelle
$scope.searchDisplayColumns = [];
@@ -333,7 +335,7 @@
/**
* Email accounts controller.
*/
-FaxToMailModule.controller('ConfigurationEmailAccountsController', ['$scope', '$http', 'ConfigurationData',
+ConfigurationModule.controller('ConfigurationEmailAccountsController', ['$scope', '$http', 'ConfigurationData',
function($scope, $http, ConfigurationData) {
//{Array} Email accounts
$scope.emailAccounts = ConfigurationData.emailAccounts;
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/user-folder.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/user-folder.js 2014-06-03 15:42:28 UTC (rev 128)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/user-folder.js 2014-06-04 08:08:56 UTC (rev 129)
@@ -22,10 +22,12 @@
* #L%
*/
+var UserFolderModule = angular.module('UserFolderModule', ['FaxToMail', 'ui.select2.sortable']);
+
/**
* Global configuration controller.
*/
-FaxToMailModule.controller('UserFolderController', ['$scope', '$http', 'UserFolderData',
+UserFolderModule.controller('UserFolderController', ['$scope', '$http', 'UserFolderData',
function($scope, $http, UserFolderData) {
//{Array} mail folders
$scope.mailFolders = UserFolderData.mailFolders;
@@ -33,6 +35,8 @@
$scope.users = UserFolderData.users;
//{Map} Topia id : mailFolders
$scope.userFolders = UserFolderData.userFolders;
+ //{Array} Group list
+ $scope.groups = UserFolderData.groups;
// method privée recursive pour retourner l'ensemble des dossiers
var recursiveAddMailFolder = function(result, mailFolders) {
1
0