Author: kmorin Date: 2014-10-20 11:16:45 +0200 (Mon, 20 Oct 2014) New Revision: 680 Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/680 Log: - refs #5939 Page web de recherche des ?\195?\169l?\195?\169ments archiv?\195?\169s - refs #5940 Page web de d?\195?\169tail d'un ?\195?\169l?\195?\169ment archiv?\195?\169 Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/ArchiveSearchAction.java trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/archive-search-input.jsp trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/demand-detail.jsp trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp trunk/faxtomail-ui-web/src/main/webapp/css/demand-detail.css Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/ArchiveSearchAction.java =================================================================== --- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/ArchiveSearchAction.java 2014-10-17 13:20:48 UTC (rev 679) +++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/ArchiveSearchAction.java 2014-10-20 09:16:45 UTC (rev 680) @@ -54,6 +54,7 @@ protected String commandQuotationNb; protected String company; protected List<Email> results; + protected String singleResultId; protected Map<MailField, String> tableMailFields; public void setEmailService(EmailService emailService) { @@ -75,17 +76,29 @@ } @Override - @Action("archive-search") + @Action(value = "archive-search", + results = { + @Result(name="detail", + type="redirectAction", + params = {"actionName", "demand-detail", "id", "%{singleResultId}"}) + }) public String execute() throws Exception { + String result = INPUT; if (commandQuotationNb != null && company != null) { results = new ArrayList<>(emailService.searchArchives(commandQuotationNb, company)); - List<MailField> mailFields = configurationService.getSearchDisplayColumns(); - if (CollectionUtils.isEmpty(mailFields)) { - mailFields = Lists.newArrayList(MailField.getTableFields()); + if (results.size() == 1) { + singleResultId = results.get(0).getTopiaId(); + result = "detail"; + + } else { + List<MailField> mailFields = configurationService.getSearchDisplayColumns(); + if (CollectionUtils.isEmpty(mailFields)) { + mailFields = Lists.newArrayList(MailField.getTableFields()); + } + tableMailFields = getEnumAsMap(mailFields.toArray(new MailField[mailFields.size()])); } - tableMailFields = getEnumAsMap(mailFields.toArray(new MailField[mailFields.size()])); } - return INPUT; + return result; } public String getCommandQuotationNb() { @@ -112,6 +125,10 @@ this.results = results; } + public String getSingleResultId() { + return singleResultId; + } + public Map<MailField, String> getTableMailFields() { return tableMailFields; } Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/archive-search-input.jsp =================================================================== --- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/archive-search-input.jsp 2014-10-17 13:20:48 UTC (rev 679) +++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/archive-search-input.jsp 2014-10-20 09:16:45 UTC (rev 680) @@ -14,7 +14,7 @@ <h1 class="page-header">Recherche d'archives</h1> - <s:form id="main_form" action="archive-search" method="post" theme="simple"> + <s:form id="main_form" action="archive-search" method="get" theme="simple"> <s:actionmessage/> <s:actionerror/> Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/demand-detail.jsp =================================================================== --- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/demand-detail.jsp 2014-10-17 13:20:48 UTC (rev 679) +++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/demand-detail.jsp 2014-10-20 09:16:45 UTC (rev 680) @@ -16,7 +16,7 @@ <body> - <div id="main-container" class="container" ng-app="DemandDetailModule" ng-controller="DemandDetailController"> + <div id="main-container" class="container-fluid" ng-app="DemandDetailModule" ng-controller="DemandDetailController"> <s:if test="demand != null"> <!-- groupe | réponses | historique | pj --> <nav class="navbar navbar-default" role="navigation"> @@ -143,134 +143,143 @@ </div><!-- /.container-fluid --> </nav> - <dl class="dl-horizontal large-dl"> - <dt>Reçu le</dt> - <dd><s:property value="demand.receptionDate" /></dd> - <dt>Émetteur</dt> - <dd><s:property value="demand.sender" /></dd> - <dt>Objet</dt> - <dd><s:property value="demand.object" /></dd> - <dt>Client (marque)</dt> - <dd><s:if test="demand.client != null"><s:property value="demand.client.code" /> (<s:property value="demand.client.brand" />)</s:if></dd> - <dt>Type</dt> - <dd><s:text name="%{decorate(demand.demandType)}" /></dd> - <dt>Priorité</dt> - <dd><s:text name="%{decorate(demand.priority)}" /></dd> - <dt>Référence chantier</dt> - <dd><s:property value="demand.projectReference" /></dd> - <dt>Notre référence</dt> - <dd><s:property value="demand.companyReference" /></dd> - <dt>État d'attente</dt> - <dd><s:text name="%{decorate(demand.waitingState)}" /></dd> - </dl> + <div class="container-fluid"> + <div class="row"> + <div class="col-md-6 col-lg-6"> + <dl class="dl-horizontal large-dl"> + <dt>Reçu le</dt> + <dd><s:text name="%{decorate(demand.receptionDate)}" /></dd> + <dt>Émetteur</dt> + <dd><s:property value="demand.sender" /></dd> + <dt>Objet</dt> + <dd><s:property value="demand.object" /></dd> + <dt>Client (marque)</dt> + <dd><s:if test="demand.client != null"><s:property value="demand.client.code" /> (<s:property value="demand.client.brand" />)</s:if></dd> + <dt>Type</dt> + <dd><s:text name="%{decorate(demand.demandType)}" /></dd> + <dt>Priorité</dt> + <dd><s:text name="%{decorate(demand.priority)}" /></dd> + <dt>Référence chantier</dt> + <dd><s:property value="demand.projectReference" /></dd> + <dt>Notre référence</dt> + <dd><s:property value="demand.companyReference" /></dd> + <dt>État d'attente</dt> + <dd><s:text name="%{decorate(demand.waitingState)}" /></dd> + <dt>Status</dt> + <dd><s:text name="%{decorate(demand.demandStatus)}" /></dd> + <dt>Pris par</dt> + <dd><s:text name="%{decorate(demand.takenBy)}" /></dd> + </dl> - <dl class="dl-horizontal large-dl"> - <s:if test="demand.firstOpeningDate != null"> - <dt>Première ouverture</dt> - <dd>par <s:text name="%{decorateUser(demand.firstOpeningUser)}" /> le <s:text name="%{decorate(demand.firstOpeningDate)}" /></dd> - </s:if> - <s:if test="demand.lastModificationDate != null"> - <dt>Dernière modification</dt> - <dd>par <s:text name="%{decorateUser(demand.lastModificationUser)}" /> le <s:text name="%{decorate(demand.lastModificationDate)}" /></dd> - </s:if> - <s:if test="demand.lastAttachmentOpeningInFolderDate != null"> - <dt>Dernière ouverture de pièce jointe</dt> - <dd>par <s:text name="%{decorateUser(demand.lastAttachmentOpeningInFolderUser)}" /> le <s:text name="%{decorate(demand.lastAttachmentOpeningInFolderDate)}" /></dd> - </s:if> - </dl> + <dl class="dl-horizontal large-dl"> + <s:if test="demand.firstOpeningDate != null"> + <dt>Première ouverture</dt> + <dd>par <s:text name="%{decorateUser(demand.firstOpeningUser)}" /> le <s:text name="%{decorate(demand.firstOpeningDate)}" /></dd> + </s:if> + <s:if test="demand.lastModificationDate != null"> + <dt>Dernière modification</dt> + <dd>par <s:text name="%{decorateUser(demand.lastModificationUser)}" /> le <s:text name="%{decorate(demand.lastModificationDate)}" /></dd> + </s:if> + <s:if test="demand.lastAttachmentOpeningInFolderDate != null"> + <dt>Dernière ouverture de pièce jointe</dt> + <dd>par <s:text name="%{decorateUser(demand.lastAttachmentOpeningInFolderUser)}" /> le <s:text name="%{decorate(demand.lastAttachmentOpeningInFolderDate)}" /></dd> + </s:if> + </dl> - <s:if test="demand.sizeRangeRow() > 0"> - <table class="table table-bordered"> - <thead> - <tr> - <th title="Gamme">Gamme</th> - <th title="N° commande / devis">N° commande / devis</th> - <th title="Quantité de devis">Qté devis</th> - <th title="Quantité de produits">Qté produits</th> - <th title="Quantité de SAV">Qté SAV</th> - </tr> - </thead> - <tbody> - <s:iterator value="demand.rangeRow" var="row"> - <tr> - <td title="<s:text name="%{decorate(#row.range)}" />"><s:text name="%{decorate(#row.range)}" /></td> - <td title="<s:property value="#row.commandNumber"/>"><s:property value="#row.commandNumber"/></td> - <td title="<s:property value="#row.quotationQuantity"/>"><s:property value="#row.quotationQuantity"/></td> - <td title="<s:property value="#row.productQuantity"/>"><s:property value="#row.productQuantity"/></td> - <td title="<s:property value="#row.savQuantity"/>"><s:property value="#row.savQuantity"/></td> - </tr> - </s:iterator> - </tbody> - <tfoot> - <tr> - <th>Total</th> - <th></th> - <th><s:property value="quotationTotal"/></th> - <th><s:property value="productTotal"/></th> - <th><s:property value="savTotal"/></th> - </tr> - </tfoot> - </table> - </s:if> + <s:if test="demand.sizeRangeRow() > 0"> + <table class="table table-bordered"> + <thead> + <tr> + <th title="Gamme">Gamme</th> + <th title="N° commande / devis">N° commande / devis</th> + <th title="Quantité de devis">Qté devis</th> + <th title="Quantité de produits">Qté produits</th> + <th title="Quantité de SAV">Qté SAV</th> + </tr> + </thead> + <tbody> + <s:iterator value="demand.rangeRow" var="row"> + <tr> + <td title="<s:text name="%{decorate(#row.range)}" />"><s:text name="%{decorate(#row.range)}" /></td> + <td title="<s:property value="#row.commandNumber"/>"><s:property value="#row.commandNumber"/></td> + <td title="<s:property value="#row.quotationQuantity"/>"><s:property value="#row.quotationQuantity"/></td> + <td title="<s:property value="#row.productQuantity"/>"><s:property value="#row.productQuantity"/></td> + <td title="<s:property value="#row.savQuantity"/>"><s:property value="#row.savQuantity"/></td> + </tr> + </s:iterator> + </tbody> + <tfoot> + <tr> + <th>Total</th> + <th></th> + <th><s:property value="quotationTotal"/></th> + <th><s:property value="productTotal"/></th> + <th><s:property value="savTotal"/></th> + </tr> + </tfoot> + </table> + </s:if> + </div> - <dl class="dl-horizontal large-dl"> - <dt>À</dt> - <dd><s:property value="emailUIModel.toRecipients" /></dd> - <dt>Copie à</dt> - <dd><s:property value="emailUIModel.ccRecipients" /></dd> - <dt>Sujet</dt> - <dd><s:property value="emailUIModel.subject" /></dd> - <dt>Contenu de l'email reçu</dt> - <dd class="well well-sm"><s:property value="emailUIModel.content" escapeHtml="false"/></dd> - <dt>Message</dt> - <dd><s:text name="%{decorate(demand.comment)}" /> - </dl> - - </s:if> - - - <div class="modal fade" id="replyModal" - tabindex="-1" role="dialog" - aria-labelledby="replyModalLabel" aria-hidden="true"> - - <div class="modal-dialog modal-lg"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal"> - <span aria-hidden="true">×</span><span class="sr-only">Close</span> - </button> - <h4 class="modal-title" id="replyModalLabel">{{currentReply.subject}}</h4> - </div> - <div class="modal-body"> - <dl class="dl-horizontal"> - <dt>De</dt> - <dd>{{currentReply.sender}}</dd> + <div class="col-md-6 col-lg-6"> + <dl class="dl-horizontal large-dl"> <dt>À</dt> - <dd>{{currentReply.toRecipients}}</dd> + <dd><s:property value="emailUIModel.toRecipients" /></dd> <dt>Copie à</dt> - <dd>{{currentReply.ccRecipients}}</dd> - <dt>Copie cachée à</dt> - <dd>{{currentReply.bccRecipients}}</dd> + <dd><s:property value="emailUIModel.ccRecipients" /></dd> <dt>Sujet</dt> - <dd>{{currentReply.subject}}</dd> + <dd><s:property value="emailUIModel.subject" /></dd> + <dt>Contenu de l'email reçu</dt> + <dd class="well well-sm"><s:property value="emailUIModel.content" escapeHtml="false"/></dd> + <dt>Message</dt> + <dd><s:text name="%{decorate(demand.comment)}" /> </dl> - <p class="well" ng-bind-html="currentReply.content"></p> - <div> - Pièces jointes - <ul> - <li ng-repeat="attachment in currentReply.attachments"> - <a href="reply-attachment-download.action?id={{currentReply.id}}&index={{$index}}" title="Ouvrir la pive jointe">{{attachment.filename}}</a> - </li> - </ul> + </div> + </div> + </div> + + <div class="modal fade" id="replyModal" + tabindex="-1" role="dialog" + aria-labelledby="replyModalLabel" aria-hidden="true"> + + <div class="modal-dialog modal-lg"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal"> + <span aria-hidden="true">×</span><span class="sr-only">Close</span> + </button> + <h4 class="modal-title" id="replyModalLabel">{{currentReply.subject}}</h4> </div> + <div class="modal-body"> + <dl class="dl-horizontal"> + <dt>De</dt> + <dd>{{currentReply.sender}}</dd> + <dt>À</dt> + <dd>{{currentReply.toRecipients}}</dd> + <dt>Copie à</dt> + <dd>{{currentReply.ccRecipients}}</dd> + <dt>Copie cachée à</dt> + <dd>{{currentReply.bccRecipients}}</dd> + <dt>Sujet</dt> + <dd>{{currentReply.subject}}</dd> + </dl> + <p class="well" ng-bind-html="currentReply.content"></p> + <div> + Pièces jointes + <ul> + <li ng-repeat="attachment in currentReply.attachments"> + <a href="reply-attachment-download.action?id={{currentReply.id}}&index={{$index}}" title="Ouvrir la pive jointe">{{attachment.filename}}</a> + </li> + </ul> + </div> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal">Fermer</button> + </div> </div> - <div class="modal-footer"> - <button type="button" class="btn btn-default" data-dismiss="modal">Fermer</button> - </div> </div> </div> - </div> - + </s:if> </div> </body> </html> \ No newline at end of file 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-10-17 13:20:48 UTC (rev 679) +++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2014-10-20 09:16:45 UTC (rev 680) @@ -48,7 +48,7 @@ <!-- navbar --> <header class="navbar navbar-inverse navbar-static-top" role="banner"> - <div class="container"> + <div class="container-fluid"> <div class="navbar-header"> <a href="<s:url value='/' />" class="navbar-brand">FaxToMail</a> </div> Modified: trunk/faxtomail-ui-web/src/main/webapp/css/demand-detail.css =================================================================== --- trunk/faxtomail-ui-web/src/main/webapp/css/demand-detail.css 2014-10-17 13:20:48 UTC (rev 679) +++ trunk/faxtomail-ui-web/src/main/webapp/css/demand-detail.css 2014-10-20 09:16:45 UTC (rev 680) @@ -14,6 +14,10 @@ margin-right: 10px; } +.dl-horizontal dt { + text-align: left; +} + .large-dl dt { width: 235px; }
participants (1)
-
kmorin@users.forge.codelutin.com