Author: echatellier Date: 2014-05-30 13:07:02 +0200 (Fri, 30 May 2014) New Revision: 112 Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/112 Log: Refactoring de l'interface de configuration/folder/input Added: 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/user-folder-input.jsp trunk/faxtomail-ui-web/src/main/webapp/css/faxtomail.css trunk/faxtomail-ui-web/src/main/webapp/js/user-folder.js Removed: trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css 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/WEB-INF/content/admin/import-input.jsp trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js Modified: trunk/faxtomail-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-05-30 10:02:38 UTC (rev 111) +++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-05-30 11:07:02 UTC (rev 112) @@ -98,6 +98,7 @@ configurationService.saveConfiguration(configuration); referentielService.saveEtatAttente(etatAttentes); mailFolderService.saveMailFolders(mailFolders); + configurationService.saveMailFilters(mailFilters); return result; } @@ -150,4 +151,22 @@ public List<String> getGroupNames() { return groupNames; } + + public List<MailFilter> getMailFilters() { + return mailFilters; + } + + public void setMailFiltersJson(String json) { + Type type = new TypeToken<List<MailFilter>>() {}.getType(); + this.mailFilters = getGson().fromJson(json, type); + } + + public List<EmailAccount> getEmailAccounts() { + return emailAccounts; + } + + public void setEmailAccounts(String json) { + Type type = new TypeToken<List<EmailAccount>>() {}.getType(); + this.emailAccounts = getGson().fromJson(json, type); + } } Added: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java =================================================================== --- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java (rev 0) +++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java 2014-05-30 11:07:02 UTC (rev 112) @@ -0,0 +1,86 @@ +package com.franciaflex.faxtomail.web.action.admin; + +/* + * #%L + * FaxToMail :: Web + * $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% + */ + +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.struts2.convention.annotation.Result; + +import com.franciaflex.faxtomail.persistence.entities.MailFolder; +import com.franciaflex.faxtomail.services.service.ConfigurationService; +import com.franciaflex.faxtomail.services.service.MailFolderService; +import com.franciaflex.faxtomail.services.service.ReferentielService; +import com.franciaflex.faxtomail.web.FaxToMailActionSupport; + +public class UserFolderAction extends FaxToMailActionSupport { + + private static final Log log = LogFactory.getLog(UserFolderAction.class); + + protected ConfigurationService configurationService; + + protected MailFolderService mailFolderService; + + protected List<MailFolder> mailFolders; + + protected List<String> groupNames; + + public void setConfigurationService(ConfigurationService configurationService) { + this.configurationService = configurationService; + } + + public void setMailFolderService(MailFolderService mailFolderService) { + this.mailFolderService = mailFolderService; + } + + @Override + @org.apache.struts2.convention.annotation.Action("user-folder-input") + public String input() throws Exception { + mailFolders = mailFolderService.getAllMailFolders(); + groupNames = configurationService.getAllGroups(); + return INPUT; + } + + @Override + @org.apache.struts2.convention.annotation.Action(results = { + @Result(type = "redirectAction", params = {"actionName", "user-folder-input"})}) + public String execute() throws Exception { + String result = super.execute(); + + return result; + } + + public List<MailFolder> getMailFolders() { + return mailFolders; + } + + public List<String> getGroupNames() { + return groupNames; + } +} Property changes on: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native 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-05-30 10:02:38 UTC (rev 111) +++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-05-30 11:07:02 UTC (rev 112) @@ -30,18 +30,21 @@ <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/configuration.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> <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='/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.select2.sortable']) + angular.module('ConfigurationModule', ['FaxToMail', 'ui.tree', 'ui.sortable', 'ui.select2.sortable']) .value('ConfigurationData', { 'etatAttentes' : <s:property value="toJson(etatAttentes)" escapeHtml="false"/>, 'etatAttenteActions': <s:property value="toJson(etatAttenteActions)" escapeHtml="false"/>, @@ -49,118 +52,102 @@ 'mailFolders': <s:property value="toJson(mailFolders)" escapeHtml="false"/>, 'searchDisplayColumns': <s:property value="toJson(configuration.searchDisplayColumns)" escapeHtml="false"/>, 'groupNames': <s:property value="toJson(groupNames)" escapeHtml="false"/>, + 'mailFilters': <s:property value="toJson(mailFilters)" escapeHtml="false"/>, 'emailAccounts': <s:property value="toJson(emailAccounts)" escapeHtml="false"/> }); </script> </head> <body> - <div ng-app="ConfigurationModule"> - <!-- navbar --> - <header class="navbar navbar-inverse navbar-static-top" role="banner"> - <div class="container"> - <div class="navbar-header"> - <a href="<s:url value='/' />" class="navbar-brand">FaxToMail</a> - </div> - <nav class="collapse navbar-collapse" role="navigation"> - <ul class="nav navbar-nav"> - <li class="active"><a href="<s:url action='configuration-input' />"> - <span class="glyphicon glyphicon-cog"></span> Configuration</a></li> - <li><a href="<s:url action='import-input' />"> - <span class="glyphicon glyphicon-upload"></span> Import</a></li> - </ul> - </nav> - </div> - </header> - <div id="main-container" class="container"> - - <h1 class="page-header">Configuration</h1> - - <s:form id="main_form" action="configuration" ng-controller="ConfigurationController"> + <div id="main-container" class="container" ng-app="ConfigurationModule"> - <s:hidden name="activeTab"/> + <h1 class="page-header">Configuration</h1> - <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-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> - <li><a href="#tabs-ldap" data-toggle="tab">Groupes lDAP</a></li> - </ul> - - <div class="tab-content active" ng-controller="ConfigurationMiscController"> - - <div id="tabs-general" class="tab-pane active"> - <!-- Général --> - - <s:checkbox name="configuration.sendAknowledgement" - label="Envoyer directement l'accusé de réception si demandé par l'expéditeur"/> - - <s:checkbox name="configuration.rejectUnknownSender" - label="Refuser les mails dont l'email est inconnu de la base client" - cssClass="margin-bottom25"/> - - <s:textfield name="configuration.convertToPdfCommand" - label="Ligne de commande de conversion de fichier X en pdf" - cssClass="span12"/> - - <s:textfield name="configuration.openAttachmentCommand" - label="Ligne de commande d'ouverture de fichier non TXT, TIFF, JPEG, PDF" - cssClass="span12"/> - - <!-- 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> - - <div id="tabs-wait" class="tab-pane" ng-controller="ConfigurationWaitController"> - <input type="hidden" name="etatAttentesJson" value="{{etatAttentes}}" /> + <s:form id="main_form" action="configuration" ng-controller="ConfigurationController"> - <div class="row"> - <div class="col-md-4"> - <table class="table table-hover"> - <thead> - <tr> - <th>État d'attente</th> - </tr> - </thead> - <tbody> - <tr ng-repeat="etatAttente in etatAttentes" - ng-class="{'info' : etatAttente == selectedEtatAttente}" - ng-click="editEtatAttente(etatAttente)"> - <td>{{etatAttente.label}}</td> - </tr> - </tbody> - </table> - </div> + <s:hidden name="activeTab"/> - <div class="col-md-7" ng-if="selectedEtatAttente"> - Champs obligatoires pour l'état d'attente <strong>{{selectedEtatAttente.label}}</strong>: - <label class="checkbox" ng-repeat="(etatAttenteField,label) in etatAttenteFields"> - <input type="checkbox" ng-checked="selectedEtatAttente.fields.indexOf(etatAttenteField) != -1" - ng-click="changeEtatAttenteField(etatAttenteField)"> {{label}} - </label> - Actions autorisées pour l'état d'attente <strong>{{selectedEtatAttente.label}}</strong>: - <label class="checkbox" ng-repeat="(etatAttenteAction,label) in etatAttenteActions"> - <input type="checkbox" ng-checked="selectedEtatAttente.actions.indexOf(etatAttenteAction) != -1" - ng-click="changeEtatAttenteAction(etatAttenteAction)"> {{label}} - </label> - </div> - <div class="col-md-7" ng-if="!selectedEtatAttente"> - <em>Sélectionnez un état d'attente.</em> - </div> + <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-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> + <li><a href="#tabs-mailaccounts" data-toggle="tab">Comptes mail</a></li> + </ul> + + <div class="tab-content active" ng-controller="ConfigurationMiscController"> + + <div id="tabs-general" class="tab-pane active"> + <!-- Général --> + + <s:checkbox name="configuration.sendAknowledgement" + label="Envoyer directement l'accusé de réception si demandé par l'expéditeur"/> + + <s:checkbox name="configuration.rejectUnknownSender" + label="Refuser les mails dont l'email est inconnu de la base client" + cssClass="margin-bottom25"/> + + <s:textfield name="configuration.convertToPdfCommand" + label="Ligne de commande de conversion de fichier X en pdf" + cssClass="span12"/> + + <s:textfield name="configuration.openAttachmentCommand" + label="Ligne de commande d'ouverture de fichier non TXT, TIFF, JPEG, PDF" + cssClass="span12"/> + + <!-- 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> + + <div id="tabs-wait" class="tab-pane" ng-controller="ConfigurationWaitController"> + <input type="hidden" name="etatAttentesJson" value="{{etatAttentes}}" /> + + <div class="row"> + <div class="col-md-4"> + <table class="table table-hover"> + <thead> + <tr> + <th>État d'attente</th> + </tr> + </thead> + <tbody> + <tr ng-repeat="etatAttente in etatAttentes" + ng-class="{'info' : etatAttente == selectedEtatAttente}" + ng-click="editEtatAttente(etatAttente)"> + <td>{{etatAttente.label}}</td> + </tr> + </tbody> + </table> </div> - + + <div class="col-md-7" ng-if="selectedEtatAttente"> + Champs obligatoires pour l'état d'attente <strong>{{selectedEtatAttente.label}}</strong>: + <label class="checkbox" ng-repeat="(etatAttenteField,label) in etatAttenteFields"> + <input type="checkbox" ng-checked="selectedEtatAttente.fields.indexOf(etatAttenteField) != -1" + ng-click="changeEtatAttenteField(etatAttenteField)"> {{label}} + </label> + Actions autorisées pour l'état d'attente <strong>{{selectedEtatAttente.label}}</strong>: + <label class="checkbox" ng-repeat="(etatAttenteAction,label) in etatAttenteActions"> + <input type="checkbox" ng-checked="selectedEtatAttente.actions.indexOf(etatAttenteAction) != -1" + ng-click="changeEtatAttenteAction(etatAttenteAction)"> {{label}} + </label> + </div> + <div class="col-md-7" ng-if="!selectedEtatAttente"> + <em>Sélectionnez un état d'attente.</em> + </div> </div> - - <div id="tabs-tree" class="tab-pane" ng-controller="ConfigurationTreeController"> - <input type="hidden" name="mailFoldersJson" value="{{mailFolders}}" /> - <div class="row"> - <div class="col-md-4"> - <script type="text/ng-template" id="nodes_renderer.html"> + </div> + + <div id="tabs-tree" class="tab-pane" ng-controller="ConfigurationTreeController"> + <input type="hidden" name="mailFoldersJson" value="{{mailFolders}}" /> + + <div class="row"> + <div class="col-md-4"> + <script type="text/ng-template" id="nodes_renderer.html"> <div ui-tree-handle ng-click="editMailFolder(mailFolder)" ng-class="{'bg-warning' : mailFolder == selectedMailFolder}"> <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> @@ -174,13 +161,13 @@ </li> </ol> </script> - <div ui-tree="options" data-drag-enabled="false"> - <ol ui-tree-nodes="" ng-model="mailFolders" id="tree-root"> - <li ng-repeat="mailFolder in mailFolders" ui-tree-node ng-include="'nodes_renderer.html'"></li> - </ol> - </div> + <div ui-tree="options" data-drag-enabled="false"> + <ol ui-tree-nodes="" ng-model="mailFolders" id="tree-root"> + <li ng-repeat="mailFolder in mailFolders" ui-tree-node ng-include="'nodes_renderer.html'"></li> + </ol> </div> - + </div> + <div class="col-md-8" ng-show="selectedMailFolder"> <div class="panel-group" id="accordion"> @@ -397,87 +384,88 @@ </div> </div> </div> - </div> + </div> - <div id="tabs-filters" class="tab-pane" ng-controller="ConfigurationFilterController"> - <table class="table table-hover table-bordered"> - <thead> - <tr> - <th>Filtre</th> - <th>Dossier</th> - </tr> - </thead> - <tbody> - <tr ng-repeat="mailFilter in allMailFilters()"> - <td>{{mailFilter.expression}}</td> - <td>{{mailFilter.fmMailFolder.name}}</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="selectedFilter"> - </div> - <div class="form-group"> - <label for="folderField">Dossier</label> - <select class="form-control" ng-model="selectedFolder" ng-options="mailFolder.name for mailFolder in flatMailFolders()"></select> - </div> + <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> + </tr> + </thead> + <tbody ui-sortable ng-model="mailFilters"> + <tr ng-repeat="mailFilter in mailFilters"> + <td>{{mailFilter.expression}}</td> + <td>{{mailFilter.mailFolder.name}}</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="selectedFilter"> </div> - <button type="button" class="btn btn-success" ng-disabled="!selectedFilter || !selectedFolder" ng-click="addNewFilter()"> - <i class="glyphicon glyphicon-plus"></i>Ajouter - </button> + <div class="form-group"> + <label for="folderField">Dossier</label> + <select class="form-control" ng-model="selectedFolder" ng-options="mailFolder.name for mailFolder in flatMailFolders()"></select> + </div> </div> + <button type="button" class="btn btn-success" ng-disabled="!selectedFilter || !selectedFolder" ng-click="addNewFilter()"> + <i class="glyphicon glyphicon-plus"></i>Ajouter + </button> + </div> - <div id="tabs-search" class="tab-pane" ng-controller="ConfigurationSearchController"> - <input type="hidden" name="configuration.searchDisplayColumns" value="{{searchDisplayColumn.id}}" ng-repeat="searchDisplayColumn in searchDisplayColumns"/> + <div id="tabs-search" class="tab-pane" ng-controller="ConfigurationSearchController"> + <input type="hidden" name="configuration.searchDisplayColumns" value="{{searchDisplayColumn.id}}" ng-repeat="searchDisplayColumn in searchDisplayColumns"/> - <div class="control-group"> - <label class="control-label" for="tableColumns">Champs à afficher dans le tableau (l'ordre peut être changé en faisant un glisser/déposer sur les champs)</label> + <div class="control-group"> + <label class="control-label" for="tableColumns">Champs à afficher dans le tableau (l'ordre peut être changé en faisant un glisser/déposer sur les champs)</label> - <div class="controls"> - <input type="hidden" ui-select2-sortable ng-model="searchDisplayColumns" simple-query="getObjectsData" multiple sortable> - </div> + <div class="controls"> + <input type="hidden" ui-select2-sortable ng-model="searchDisplayColumns" simple-query="getObjectsData" multiple sortable> + </div> - <div> - <table id='table-snapshot' class="table table-bordered"> - <caption>Aperçu</caption> - <thead> - <tr> - <th ng-repeat="etatAttenteField in searchDisplayColumns">{{etatAttenteFields[etatAttenteField.id]}}</th> - </tr> - </thead> - </table> - </div> + <div> + <table id='table-snapshot' class="table table-bordered"> + <caption>Aperçu</caption> + <thead> + <tr> + <th ng-repeat="etatAttenteField in searchDisplayColumns">{{etatAttenteFields[etatAttenteField.id]}}</th> + </tr> + </thead> + </table> </div> - </div> - - <div id="tabs-ldap" class="tab-pane" ng-controller="ConfigurationLdapController"> - <table id='table-snapshot' class="table table-bordered"> - <caption>Dossiers mis en avant</caption> - <thead> - <tr> - <th>Dossier</th> - <th ng-repeat="groupName in groupNames">{{groupName}}</th> - </tr> - </thead> - <tbody ng-repeat="mailFolder in flatMailFolders()"> - <th>{{mailFolder.name}}</th> - <td ng-repeat="groupName in groupNames"> - <input type="checkbox" /> - </td> - </tbody> - </table> - </div> + </div> </div> - <nav class="navbar navbar-default navbar-fixed-bottom"> - <div class="container"> - <button type="submit" class="btn btn-primary navbar-btn pull-right">Valider</button> - </div> - </nav> - </s:form> - </div> - </div> + + <div id="tabs-mailaccounts" class="tab-pane" ng-controller="ConfigurationEmailAccountsController"> + <table id='table-snapshot' class="table table-bordered"> + <thead> + <tr> + <th>Protocole</th> + <th>Serveur</th> + <th>Utilisateur</th> + <th>Mot de passe</th> + </tr> + </thead> + <tbody ng-repeat="emailAccount in emailAccounts"> + <td>{{emailAccount.protocol}}</td> + <td>{{emailAccount.host}}</td> + <td>{{emailAccount.login}}</td> + <td>{{emailAccount.password}}</td> + </tbody> + </table> + </div> + </div> + <nav class="navbar navbar-default navbar-fixed-bottom"> + <div class="container"> + <button type="submit" class="btn btn-primary navbar-btn pull-right">Valider</button> + </div> + </nav> + </s:form> + </div> </body> </html> Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/import-input.jsp =================================================================== --- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/import-input.jsp 2014-05-30 10:02:38 UTC (rev 111) +++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/import-input.jsp 2014-05-30 11:07:02 UTC (rev 112) @@ -28,71 +28,53 @@ <html> <head> <title>Import</title> - <link rel="stylesheet" type="text/css" href="<s:url value='/css/configuration.css' />" /> + <link rel="stylesheet" type="text/css" href="<s:url value='/css/faxtomail.css' />" /> </head> <body> - <div> - <!-- navbar --> - <header class="navbar navbar-inverse navbar-static-top" role="banner"> - <div class="container"> - <div class="navbar-header"> - <a href="<s:url value='/' />" class="navbar-brand">FaxToMail</a> - </div> - <nav class="collapse navbar-collapse" role="navigation"> - <ul class="nav navbar-nav"> - <li><a href="<s:url action='configuration-input' />"> - <span class="glyphicon glyphicon-cog"></span> Configuration</a></li> - <li class="active"><a href="<s:url action='import-input' />"> - <span class="glyphicon glyphicon-upload"></span> Import</a></li> - </ul> - </nav> - </div> - </header> - <div id="main-container" class="container"> - - <h1 class="page-header">Import</h1> - - <s:form id="main_form" action="import" method="post" enctype="multipart/form-data"> + <div id="main-container" class="container"> - <div class="form-group"> - <label for="clientField">Fichier client</label> - <input type="file" id="clientField" name="clientFile"> - <p class="help-block">Format du fichier csv : <code>Id_Correspondance;Societe;Nom;Caracteristique1;Caracteristique2;Caracteristique3;Client_Top;Numero_Fax;Adresse_Mail;Code_Client;Objet_Message;Destination</code></p> + <h1 class="page-header">Import</h1> + + <s:form id="main_form" action="import" method="post" enctype="multipart/form-data"> + + <div class="form-group"> + <label for="clientField">Fichier client</label> + <input type="file" id="clientField" name="clientFile"> + <p class="help-block">Format du fichier csv : <code>Id_Correspondance;Societe;Nom;Caracteristique1;Caracteristique2;Caracteristique3;Client_Top;Numero_Fax;Adresse_Mail;Code_Client;Objet_Message;Destination</code></p> + </div> + + <div class="form-group"> + <label for="etatAttenteField">Fichier état d'attente</label> + <input type="file" id="etatAttenteField" name="etatAttenteFile"> + <p class="help-block">Format du fichier csv : <code>etatattente</code></p> + </div> + + <div class="form-group"> + <label for="demandTypeField">Fichier types de demande</label> + <input type="file" id="demandTypeField" name="demandTypeFile"> + <p class="help-block">Format du fichier csv : <code>demandetype</code></p> + </div> + + <div class="form-group"> + <label for="rangeField">Fichier gamme</label> + <input type="file" id="rangeField" name="rangeFile"> + <p class="help-block">Format du fichier csv : <code>gamme</code></p> + </div> + + <div class="form-group"> + <label for="priorityField">Fichier priorite</label> + <input type="file" id="priorityField" name="priorityFile"> + <p class="help-block">Format du fichier csv : <code>priorite</code></p> + </div> + + <nav class="navbar navbar-default navbar-fixed-bottom"> + <div class="container"> + <button type="submit" class="btn btn-primary navbar-btn pull-right">Valider</button> </div> - - <div class="form-group"> - <label for="etatAttenteField">Fichier état d'attente</label> - <input type="file" id="etatAttenteField" name="etatAttenteFile"> - <p class="help-block">Format du fichier csv : <code>etatattente</code></p> - </div> - - <div class="form-group"> - <label for="demandTypeField">Fichier types de demande</label> - <input type="file" id="demandTypeField" name="demandTypeFile"> - <p class="help-block">Format du fichier csv : <code>demandetype</code></p> - </div> - - <div class="form-group"> - <label for="rangeField">Fichier gamme</label> - <input type="file" id="rangeField" name="rangeFile"> - <p class="help-block">Format du fichier csv : <code>gamme</code></p> - </div> - - <div class="form-group"> - <label for="priorityField">Fichier priorite</label> - <input type="file" id="priorityField" name="priorityFile"> - <p class="help-block">Format du fichier csv : <code>priorite</code></p> - </div> - - <nav class="navbar navbar-default navbar-fixed-bottom"> - <div class="container"> - <button type="submit" class="btn btn-primary navbar-btn pull-right">Valider</button> - </div> - </nav> - </s:form> - </div> + </nav> + </s:form> </div> </body> </html> Added: 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 (rev 0) +++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp 2014-05-30 11:07:02 UTC (rev 112) @@ -0,0 +1,81 @@ +<%-- + #%L + FaxToMail :: Web + $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% + --%> +<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> +<!DOCTYPE html> +<%@taglib uri="/struts-tags" prefix="s" %> + +<html> + <head> + <title>Import</title> + <link rel="stylesheet" type="text/css" href="<s:url value='/css/faxtomail.css' />" /> + + <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/faxtomail.js' />"></script> + <script type="text/javascript" src="<s:url value='/js/user-folder.js' />"></script> + + <script type="text/javascript"> + angular.module('UserFolderModule', ['FaxToMail']) + .value('UserFolderData', { + 'mailFolders': <s:property value="toJson(mailFolders)" escapeHtml="false"/>, + 'groupNames': <s:property value="toJson(groupNames)" escapeHtml="false"/> + }); + </script> + </head> + + <body> + + <div id="main-container" class="container" ng-app="UserFolderModule"> + + <h1 class="page-header">Import</h1> + + <s:form id="main_form" action="import" method="post" enctype="multipart/form-data" ng-controller="UserFolderController"> + + <table id='table-snapshot' class="table table-bordered"> + <caption>Dossiers mis en avant par utilisateur</caption> + <thead> + <tr> + <th>Utilisateur</th> + <th>Dossiers</th> + </tr> + </thead> + <tbody> + <tr ng-repeat="groupName in groupNames"> + <th>{{groupName}}</th> + <td> + <input type="text" /> + </td> + </tr> + </tbody> + </table> + + <nav class="navbar navbar-default navbar-fixed-bottom"> + <div class="container"> + <button type="submit" class="btn btn-primary navbar-btn pull-right">Valider</button> + </div> + </nav> + </s:form> + </div> + </body> +</html> Property changes on: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp =================================================================== --- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2014-05-30 10:02:38 UTC (rev 111) +++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2014-05-30 11:07:02 UTC (rev 112) @@ -43,6 +43,26 @@ <s:actionerror theme="bootstrap"/> <s:actionmessage theme="bootstrap"/> <s:fielderror theme="bootstrap"/> + + <!-- navbar --> + <header class="navbar navbar-inverse navbar-static-top" role="banner"> + <div class="container"> + <div class="navbar-header"> + <a href="<s:url value='/' />" class="navbar-brand">FaxToMail</a> + </div> + <nav class="collapse navbar-collapse" role="navigation"> + <ul class="nav navbar-nav"> + <li><a href="<s:url action='configuration-input' />"> + <span class="glyphicon glyphicon-cog"></span> Configuration</a></li> + <li><a href="<s:url action='import-input' />"> + <span class="glyphicon glyphicon-upload"></span> Import</a></li> + <li><a href="<s:url action='user-folder-input' />"> + <span class="glyphicon glyphicon-th-list"></span> Dossiers utilisateur</a></li> + </ul> + </nav> + </div> + </header> + <decorator:body/> </div> </div> Deleted: trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css =================================================================== --- trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css 2014-05-30 10:02:38 UTC (rev 111) +++ trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css 2014-05-30 11:07:02 UTC (rev 112) @@ -1,60 +0,0 @@ -/* - * #%L - * FaxToMail :: Web - * $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% - */ - -.full-width { - width: 100%; -} - -.tab-content { - padding-bottom: 70px; -} - -.page-header { - margin-bottom: 25px; -} - -.angular-ui-tree-handle { - background: #f8faff; - border: 1px solid #dae2ea; - color: #7c9eb2; - padding: 10px 10px; - cursor:default; -} - -.select2-container { - width: 100%; -} - -.angular-ui-tree-handle.bg-warning { - background: #fcf8e3; -} - -.angular-ui-tree-handle:hover { - color: #438eb9; - background: #f4f6f7; - border-color: #dce2e8; -} -.angular-ui-tree-handle.bg-warning:hover { - background: #fcf8e3; -} \ No newline at end of file Copied: trunk/faxtomail-ui-web/src/main/webapp/css/faxtomail.css (from rev 111, trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css) =================================================================== --- trunk/faxtomail-ui-web/src/main/webapp/css/faxtomail.css (rev 0) +++ trunk/faxtomail-ui-web/src/main/webapp/css/faxtomail.css 2014-05-30 11:07:02 UTC (rev 112) @@ -0,0 +1,64 @@ +/* + * #%L + * FaxToMail :: Web + * $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% + */ + +.full-width { + width: 100%; +} + +.tab-content { + padding-bottom: 70px; +} + +.page-header { + margin-bottom: 25px; +} + +.angular-ui-tree-handle { + background: #f8faff; + border: 1px solid #dae2ea; + color: #7c9eb2; + padding: 10px 10px; + cursor:default; +} + +.select2-container { + width: 100%; +} + +.angular-ui-tree-handle.bg-warning { + background: #fcf8e3; +} + +.angular-ui-tree-handle:hover { + color: #438eb9; + background: #f4f6f7; + border-color: #dce2e8; +} +.angular-ui-tree-handle.bg-warning:hover { + background: #fcf8e3; +} + +.ui-sortable { + cursor:move; +} \ No newline at end of file Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js =================================================================== --- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-05-30 10:02:38 UTC (rev 111) +++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-05-30 11:07:02 UTC (rev 112) @@ -243,40 +243,20 @@ */ FaxToMailModule.controller('ConfigurationFilterController', ['$scope', '$http', 'ConfigurationData', function($scope, $http, ConfigurationData) { + //{Array} Current mail filter list + $scope.mailFilters = ConfigurationData.mailFilters; //{String} input filter in add form $scope.selectedFilter; //{Object} selected folder in add form $scope.selectedFolder; - - // FIXME in binding sur une methode c'est pas terrible - $scope.allMailFilters = function() { - var mailFilters = []; - angular.forEach($scope.flatMailFolders(), function(mailFolder) { - if (mailFolder.filters) { - //mailFilters = mailFilters.concat(mailFolder.filters); - angular.forEach(mailFolder.filters, function(mailFilter) { - - // ca c'est pas propre, on modifie l'object original pour affichage - mailFilter.fmMailFolder = {name:mailFolder.name}; - mailFilters.push(mailFilter); - }); - } else { - mailFolder.filters = []; - } - }); - return mailFilters; - }; - // add new filter action $scope.addNewFilter = function() { var filter = { expression: $scope.selectedFilter, - fmMailFolder: { - name: $scope.selectedFolder.name - } + mailFolder: $scope.selectedFolder }; - $scope.selectedFolder.filters.push(filter); + $scope.mailFilters.push(filter); // clear form delete $scope.selectedFilter; @@ -314,9 +294,10 @@ /** - * Ldap tab controller. + * Email accounts controller. */ -FaxToMailModule.controller('ConfigurationLdapController', ['$scope', '$http', 'ConfigurationData', +FaxToMailModule.controller('ConfigurationEmailAccountsController', ['$scope', '$http', 'ConfigurationData', function($scope, $http, ConfigurationData) { - + //{Array} Email accounts + $scope.emailAccounts = ConfigurationData.emailAccounts; }]); Added: trunk/faxtomail-ui-web/src/main/webapp/js/user-folder.js =================================================================== --- trunk/faxtomail-ui-web/src/main/webapp/js/user-folder.js (rev 0) +++ trunk/faxtomail-ui-web/src/main/webapp/js/user-folder.js 2014-05-30 11:07:02 UTC (rev 112) @@ -0,0 +1,51 @@ +/* + * #%L + * FaxToMail :: Web + * $Id: configuration.js 107 2014-05-30 08:55:55Z echatellier $ + * $HeadURL: https://svn.codelutin.com/faxtomail/trunk/faxtomail-ui-web/src/main/webapp/j... $ + * %% + * 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% + */ + +/** + * Global configuration controller. + */ +FaxToMailModule.controller('UserFolderController', ['$scope', '$http', 'UserFolderData', + function($scope, $http, UserFolderData) { + //{Array} mail folders + $scope.mailFolders = UserFolderData.mailFolders; + // {Array} Liste des groupes ldap + $scope.groupNames = UserFolderData.groupNames; + + // method privée recursive pour retourner l'ensemble des dossiers + var recursiveAddMailFolder = function(result, mailFolders) { + if (mailFolders) { + angular.forEach(mailFolders, function(mailFolder) { + result.push(mailFolder); + recursiveAddMailFolder(result, mailFolder.children); + }); + } + }; + + // Retourne l'ensemble de l'arbre des dossiers "à plat" + $scope.flatMailFolders = function() { + var flatMailFolders = []; + recursiveAddMailFolder(flatMailFolders, $scope.mailFolders); + return flatMailFolders; + }; +}]);