Author: bpoussin Date: 2013-06-30 00:55:21 +0200 (Sun, 30 Jun 2013) New Revision: 354 Url: http://chorem.org/projects/chorem/repository/revisions/354 Log: Report Budget: - on peut demande a ne voir que certain profondeur - on peut exporter en ascii le tableau que l'on voit Added: trunk/chorem-entities/src/main/java/com/ trunk/chorem-entities/src/main/java/com/inamik/ trunk/chorem-entities/src/main/java/com/inamik/utils/ trunk/chorem-entities/src/main/java/com/inamik/utils/AbstractTableFormatter.java trunk/chorem-entities/src/main/java/com/inamik/utils/SimpleTableFormatter.java trunk/chorem-entities/src/main/java/com/inamik/utils/TableFormatter.java Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/DashboardAction.java trunk/chorem-webmotion/src/main/resources/mapping trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardBudget.jsp Added: trunk/chorem-entities/src/main/java/com/inamik/utils/AbstractTableFormatter.java =================================================================== --- trunk/chorem-entities/src/main/java/com/inamik/utils/AbstractTableFormatter.java (rev 0) +++ trunk/chorem-entities/src/main/java/com/inamik/utils/AbstractTableFormatter.java 2013-06-29 22:55:21 UTC (rev 354) @@ -0,0 +1,455 @@ +/* + * iNamik TableFormatter for Java + * Copyright (C) 2005-2012 David Farrell (davidpfarrell@yahoo.com) + * + * Licensed under MIT or GPLv3, see LICENSE.txt + */ +package com.inamik.utils; + +import java.util.ArrayList; +import java.util.List; + +/** + * AbstractTableFormatter + * Created on Oct 26, 2005 + * @author Dave + */ +public abstract class AbstractTableFormatter implements TableFormatter +{ + protected class CellData + { + private List lines; + private int align; + private int valign; + private CellData() { super(); } + public CellData(int align, int valign) + { + this(); + this.lines = new ArrayList(); + this.align = align; + this.valign = valign; + } + public void addLine(String text) { lines.add(text); } + public int getLineCount() { return lines.size(); } + public List getLines () { return new ArrayList(lines); } + public int getAlign () { return align; } + public int getVAlign() { return valign; } + }; + + private int columnCount = 0; + + private List maxColWidths = new ArrayList(); + private List maxRowHeights = new ArrayList(); + + private List tableData = new ArrayList(); + + /** + * Constructor + */ + protected AbstractTableFormatter() + { + super(); + } + + /* + * (non-Javadoc) + * @see com.inamik.utils.TableFormatter#addLine() + */ + public final TableFormatter addLine() + { + return addLine(null); + } + + /* + * (non-Javadoc) + * @see com.inamik.utils.TableFormatter#addLine(java.lang.String) + */ + public final TableFormatter addLine(String text) + { + if (tableData.size() <= 0) + { + throw new IllegalStateException("tableData.size()"); + } + + // Get current (last) row + List row = (List)tableData.get(tableData.size() - 1); + + if (row.size() <= 0) + { + throw new IllegalStateException("Cannot addLine() to empty row. Use nextCell() first."); + } + + CellData cell = (CellData)row.get(row.size() - 1); + + // Add line to cell + cell.addLine(text); + + // + // Update max column width + // + + if (maxColWidths.size() != columnCount) + { + throw new IllegalStateException("maxColWidths.size()"); + } + + int currentCol = row.size() - 1; + + int maxColWidth = ((Integer)maxColWidths.get(currentCol)).intValue(); + + if (text != null && text.length() > maxColWidth) + { + maxColWidths.set(currentCol, new Integer(text.length())); + } + + // + // Update max row height + // + + if (maxRowHeights.size() != tableData.size()) + { + throw new IllegalStateException("maxRowHeights.size()"); + } + + int currentRow = tableData.size() - 1; + + int maxRowHeight = ((Integer)maxRowHeights.get(currentRow)).intValue(); + + if (cell.getLineCount() > maxRowHeight) + { + maxRowHeights.set(currentRow, new Integer(cell.getLineCount())); + } + + return this; + } + + /* + * (non-Javadoc) + * @see com.inamik.utils.TableFormatter#nextCell() + */ + public final TableFormatter nextCell() + { + return nextCell(ALIGN_DEFAULT, VALIGN_DEFAULT); + } + + /* + * (non-Javadoc) + * @see com.inamik.utils.TableFormatter#nextCell(int, int) + */ + public final TableFormatter nextCell(int align, int valign) + { + if ( + (align != ALIGN_DEFAULT) + && (align != ALIGN_LEFT ) + && (align != ALIGN_CENTER ) + && (align != ALIGN_RIGHT ) + ) + { + throw new IllegalArgumentException("align"); + } + + if ( + (valign != VALIGN_DEFAULT) + && (valign != VALIGN_TOP ) + && (valign != VALIGN_CENTER ) + && (valign != VALIGN_BOTTOM ) + ) + { + throw new IllegalArgumentException("valign"); + } + + if (tableData.size() <= 0) + { + throw new IllegalStateException("tableData.size()"); + } + + List row = (List)tableData.get(tableData.size() - 1); + + CellData cell = new CellData(align, valign); + + row.add(cell); + + // Update column count + if (row.size() > columnCount) + { + // Should only be off by 1 + if ((row.size() - 1) != columnCount) + { + throw new IllegalStateException("columnCount"); + } + + columnCount = row.size(); + + maxColWidths.add(new Integer(0)); + } + + return this; + } + + /* + * (non-Javadoc) + * @see com.inamik.utils.TableFormatter#nextRow() + */ + public final TableFormatter nextRow() + { + tableData.add(new ArrayList(columnCount)); + + maxRowHeights.add(new Integer(0)); + + return this; + } + + /* + * (non-Javadoc) + * @see com.inamik.utils.TableFormatter#getColumnCount() + */ + public int getColumnCount() + { + return columnCount; + } + + /* + * (non-Javadoc) + * @see com.inamik.utils.TableFormatter#getRowCount() + */ + public final int getRowCount() + { + if (tableData.size() <= 0) + { + throw new IllegalStateException("tableData.size()"); + } + + return tableData.size(); + } + + /* + * (non-Javadoc) + * @see com.inamik.utils.TableFormatter#getColumnWidth(int) + */ + public final int getColumnWidth(int columnIndex) + { + if (columnIndex < 0 || columnIndex >= columnCount) + { + throw new IllegalArgumentException("columnIndex"); + } + + return ((Integer)maxColWidths.get(columnIndex)).intValue(); + } + + /* + * (non-Javadoc) + * @see com.inamik.utils.TableFormatter#getRowHeight(int) + */ + public final int getRowHeight(int rowIndex) + { + if (rowIndex < 0 || rowIndex >= tableData.size()) + { + throw new IllegalArgumentException("rowIndex"); + } + + return ((Integer)maxRowHeights.get(rowIndex)).intValue(); + } + + /* + * (non-Javadoc) + * @see com.inamik.utils.TableFormatter#getFormattedCell(int, int) + */ + public final String[] getFormattedCell(int rowIndex, int columnIndex) + { + if (rowIndex < 0 || rowIndex >= tableData.size()) + { + throw new IllegalArgumentException("rowIndex"); + } + + if (columnIndex < 0 || columnIndex >= columnCount) + { + throw new IllegalArgumentException("columnIndex"); + } + + List lines; + int align; + int valign; + + int cellWidth = getColumnWidth(columnIndex); + int cellHeight = getRowHeight(rowIndex); + + List row = (List)tableData.get(rowIndex); + + // Is there a cell at the specified row/col? + if (row.size() > columnIndex) + { + CellData cell = (CellData)row.get(columnIndex); + + lines = cell.getLines(); + align = cell.getAlign(); + valign = cell.getVAlign(); + } + else + { + lines = new ArrayList(); + align = ALIGN_DEFAULT; + valign = VALIGN_DEFAULT; + } + + int vpadding = cellHeight - lines.size(); + + int topPad; + int bottomPad; + + switch (valign) + { + case VALIGN_CENTER : + { + int carry = vpadding % 2; + + vpadding = vpadding - carry; + + topPad = bottomPad = vpadding / 2; + + bottomPad += carry; + + break; + } + case VALIGN_BOTTOM: + { + topPad = vpadding; + bottomPad = 0; + break; + } + // Deafault - Top + default : + { + topPad = 0; + bottomPad = vpadding; + break; + } + } + + List result = new ArrayList(cellHeight); + + for (int i = 0; i < topPad; ++i) + { + result.add(getFormattedLine("", cellWidth, align)); + } + + for (int i = 0; i < lines.size(); ++i) + { + result.add(getFormattedLine((String)lines.get(i), cellWidth, align)); + } + + for (int i = 0; i < bottomPad; ++i) + { + result.add(getFormattedLine("", cellWidth, align)); + } + + if (result.size() != cellHeight) + { + throw new IllegalStateException("result.size()"); + } + + return (String[])result.toArray(new String[result.size()]); + } + + /** + * getFormattedLine + */ + private final String getFormattedLine(String text, int lineLength, int align) + { + if (text == null) + { + text = ""; + } + + int padding = lineLength - text.length(); + + int leftPad; + int rightPad; + + switch (align) + { + case ALIGN_CENTER : + { + int carry = padding % 2; + + padding = padding - carry; + + leftPad = rightPad = padding / 2; + + rightPad += carry; + + break; + } + case ALIGN_RIGHT : + { + leftPad = padding; + rightPad = 0; + break; + } + // Deafault - Left + default : + { + leftPad = 0; + rightPad = padding; + break; + } + } + + StringBuffer result = new StringBuffer(); + + for (int i = 0; i < leftPad; ++i) + { + result.append(' '); + } + + result.append(text); + + for (int i = 0; i < rightPad; ++i) + { + result.append(' '); + } + + return result.toString(); + } + + /* + * (non-Javadoc) + * @see com.inamik.utils.TableFormatter#getTableWidth() + */ + public int getTableWidth() + { + if (maxColWidths.size() != getColumnCount()) + { + throw new IllegalStateException("maxColWidths.size()"); + } + + int width = 0; + + for (int i = 0; i < columnCount; ++i) + { + width += ((Integer)maxColWidths.get(i)).intValue(); + } + + return width; + } + + /* + * (non-Javadoc) + * @see com.inamik.utils.TableFormatter#getTableHeight() + */ + public int getTableHeight() + { + if (maxRowHeights.size() != getRowCount()) + { + throw new IllegalStateException("maxRowHeights.size()"); + } + + int height = 0; + + for (int i = 0, size = maxRowHeights.size(); i < size; i++) + { + height += ((Integer)maxRowHeights.get(i)).intValue(); + } + + return height; + } +} Property changes on: trunk/chorem-entities/src/main/java/com/inamik/utils/AbstractTableFormatter.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/chorem-entities/src/main/java/com/inamik/utils/SimpleTableFormatter.java =================================================================== --- trunk/chorem-entities/src/main/java/com/inamik/utils/SimpleTableFormatter.java (rev 0) +++ trunk/chorem-entities/src/main/java/com/inamik/utils/SimpleTableFormatter.java 2013-06-29 22:55:21 UTC (rev 354) @@ -0,0 +1,243 @@ +/* + * iNamik TableFormatter for Java + * Copyright (C) 2005-2012 David Farrell (davidpfarrell@yahoo.com) + * + * Licensed under MIT or GPLv3, see LICENSE.txt + */ +package com.inamik.utils; + +import java.util.ArrayList; +import java.util.List; + +/** + * SimpleTableFormatter + * Created on Oct 18, 2005 + * @author Dave + */ +public final class SimpleTableFormatter extends AbstractTableFormatter implements TableFormatter +{ + private boolean border = false; + + /** + * Constructor + */ + public SimpleTableFormatter() + { + super(); + } + + /** + * Constructor + * @param border Print rows/tables with borders + */ + public SimpleTableFormatter(boolean border) + { + this(); + + this.border = border; + } + + /* + * (non-Javadoc) + * @see com.inamik.utils.TableFormatter#getTableWidth() + */ + public int getTableWidth() + { + int width = super.getTableWidth(); + + if (border == true) + { + width += 2; + + if (getColumnCount() > 1) + { + width += getColumnCount() - 1; + } + } + + return width; + } + + /* + * (non-Javadoc) + * @see com.inamik.utils.TableFormatter#getTableHeight() + */ + public int getTableHeight() + { + int height = super.getTableHeight(); + + if (border == true) + { + height += 2; + + if (getRowCount() > 1) + { + height += getRowCount() - 1; + } + } + + return height; + } + + /* + * (non-Javadoc) + * @see com.inamik.utils.TableFormatter#getFormattedRow(int) + */ + public String[] getFormattedRow(int rowIndex) + { + if (rowIndex < 0 || rowIndex >= getRowCount()) + { + throw new IllegalArgumentException("rowIndex"); + } + + int cellHeight = getRowHeight(rowIndex); + + List rowLines = new ArrayList(cellHeight); + + for (int i = 0; i < cellHeight; ++i) + { + StringBuffer buffer = new StringBuffer(); + + if (border == true) + { + buffer.append('|'); + } + + rowLines.add(buffer); + } + + if (rowLines.size() != cellHeight) + { + throw new IllegalStateException("rowLines.size()"); + } + + for (int columnIndex = 0, columnCount = getColumnCount(); columnIndex < columnCount; ++columnIndex) + { + String[] cell = getFormattedCell(rowIndex, columnIndex); + + if (cell.length != cellHeight) + { + throw new IllegalStateException("cell.size()"); + } + + for (int i = 0; i < cellHeight; ++i) + { + StringBuffer buffer = (StringBuffer)rowLines.get(i); + + if (columnIndex > 0) + { + if (border == true) + { + buffer.append('|'); + } +// else +// { +// buffer.append(' '); +// } + } + + buffer.append(cell[i]); + } + } + + if (border == true) + { + for (int i = 0; i < cellHeight; ++i) + { + StringBuffer buffer = (StringBuffer)rowLines.get(i); + + buffer.append('|'); + } + } + + if (rowLines.size() != cellHeight) + { + throw new IllegalStateException("rowLines.size()"); + } + + List result = new ArrayList(cellHeight); + + for (int i = 0; i < cellHeight; ++i) + { + StringBuffer buffer = (StringBuffer)rowLines.get(i); + + result.add(buffer.toString()); + } + + if (result.size() != cellHeight) + { + throw new IllegalStateException("result.size()"); + } + + return (String[])result.toArray(new String[result.size()]); + } + + /* + * (non-Javadoc) + * @see com.inamik.utils.TableFormatter#getFormattedTable() + */ + public String[] getFormattedTable() + { + List result = new ArrayList(); + + String borderText = null; + + if (border == true) + { + borderText = getFormattedBorder(); + result.add(borderText); + } + + for (int rowIndex = 0, rowCount = getRowCount(); rowIndex < rowCount; ++rowIndex) + { + if (rowIndex > 0) + { + if (border == true) + { + result.add(borderText); + } + } + + String[] row = getFormattedRow(rowIndex); + + for (int i = 0, size=row.length; i < size; ++i) + { + result.add(row[i]); + } + } + + if (border == true) + { + result.add(borderText); + } + + return (String[])result.toArray(new String[result.size()]); + } + + /** + * getFormattedBorder + */ + private String getFormattedBorder() + { + StringBuffer result = new StringBuffer(); + + result.append('+'); + + for (int columnIndex = 0, columnCount = getColumnCount(); columnIndex < columnCount; ++columnIndex) + { + if (columnIndex > 0) + { + result.append('+'); + } + + for (int i = 0; i < getColumnWidth(columnIndex); ++i) + { + result.append('-'); + } + } + + result.append('+'); + + return result.toString(); + } +} Property changes on: trunk/chorem-entities/src/main/java/com/inamik/utils/SimpleTableFormatter.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/chorem-entities/src/main/java/com/inamik/utils/TableFormatter.java =================================================================== --- trunk/chorem-entities/src/main/java/com/inamik/utils/TableFormatter.java (rev 0) +++ trunk/chorem-entities/src/main/java/com/inamik/utils/TableFormatter.java 2013-06-29 22:55:21 UTC (rev 354) @@ -0,0 +1,40 @@ +/* + * iNamik TableFormatter for Java + * Copyright (C) 2005-2012 David Farrell (davidpfarrell@yahoo.com) + * + * Licensed under MIT or GPLv3, see LICENSE.txt + */ +package com.inamik.utils; + +/** + * TableFormatter + * Created on Oct 18, 2005 + * @author Dave + */ +public interface TableFormatter +{ + static final int ALIGN_DEFAULT = 0; + static final int ALIGN_LEFT = 1; + static final int ALIGN_CENTER = 2; + static final int ALIGN_RIGHT = 3; + + static final int VALIGN_DEFAULT = 4; + static final int VALIGN_TOP = 5; + static final int VALIGN_CENTER = 6; + static final int VALIGN_BOTTOM = 7; + + TableFormatter nextRow(); + TableFormatter nextCell(); + TableFormatter nextCell(int align, int valign); + TableFormatter addLine(); + TableFormatter addLine(String text); + int getColumnCount(); + int getRowCount(); + int getColumnWidth(int columnIndex); + int getRowHeight(int rowIndex); + int getTableWidth(); + int getTableHeight(); + String[] getFormattedCell(int rowIndex, int columnIndex); + String[] getFormattedRow(int rowIndex); + String[] getFormattedTable(); +} Property changes on: trunk/chorem-entities/src/main/java/com/inamik/utils/TableFormatter.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/DashboardAction.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/DashboardAction.java 2013-06-29 22:54:31 UTC (rev 353) +++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/DashboardAction.java 2013-06-29 22:55:21 UTC (rev 354) @@ -23,17 +23,26 @@ package org.chorem.webmotion.actions; +import com.inamik.utils.SimpleTableFormatter; +import com.inamik.utils.TableFormatter; +import java.io.InputStream; +import java.io.Reader; +import java.io.StringReader; +import java.text.DecimalFormat; +import java.text.NumberFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Collection; import java.util.Date; import java.util.HashMap; +import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.TreeMap; import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.io.input.ReaderInputStream; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateUtils; @@ -819,7 +828,7 @@ /** * Prévisionnel entre deux dates en fonction des factures */ - public Render budget(ChoremClient client, Date start, Date end, String query) { + public Render budget(ChoremClient client, Integer depth, Date start, Date end, String query, String type) { if (log.isDebugEnabled()) { log.debug(String.format( "budget for period '%s' to '%s' with filter '%s'", @@ -978,13 +987,87 @@ data.add(false, i); } + if (depth != null) { + // on supprime les profondeurs non demandees + Category lastCategory = null; + for (Iterator<WikittyQueryResultTreeNode<Category>> i=data.getCategoriesTree().iterator(); i.hasNext();) { + WikittyQueryResultTreeNode<Category> c = i.next(); + if (c.getLevel() <= depth) { + lastCategory = c.getUserObject(); + } else { + i.remove(); + for (String d : data.getDates()) { + Category currentCategory = c.getUserObject(); + double s = data.getAmount(d, currentCategory); + data.addAmount(d, lastCategory, s); + for (FinancialTransaction invoice : data.getInvoices(d, currentCategory)) { + data.addInvoice(d, lastCategory, invoice); + } + } + } + } + } + if (log.isDebugEnabled()) { log.debug("budget data\n\t dates: " + data.getDates() + "\n\t rootTree: " + rootCategory + "\n\t categoriesTree: " + categoriesTree); } - return renderView("dashboardBudget.jsp", "companyId", companyId, - "data", data); + + if ("ascii".equalsIgnoreCase(type)) { + InputStream out = computeAsciiTable(data); + return renderDownload(out, "budget.txt", "text/plain"); + } else { + return renderView("dashboardBudget.jsp", "companyId", companyId, + "data", data); + } } + protected InputStream computeAsciiTable(BudgetData data) { + NumberFormat currency = new DecimalFormat("#0.00"); + + TableFormatter tf = new SimpleTableFormatter(true); + + tf.nextRow(); + tf.nextCell(TableFormatter.ALIGN_CENTER, TableFormatter.VALIGN_DEFAULT) + .addLine("Category"); + for (String d : data.getDates()) { + tf.nextCell(TableFormatter.ALIGN_CENTER, TableFormatter.VALIGN_DEFAULT) + .addLine(d); + } + for (WikittyQueryResultTreeNode<Category> c : data.getCategoriesTree()) { + + tf.nextRow().nextCell(TableFormatter.ALIGN_LEFT, TableFormatter.VALIGN_DEFAULT) + .addLine(StringUtils.repeat(" ", c.getLevel()) + c.getUserObject()); + for (String d : data.getDates()) { + tf.nextCell(TableFormatter.ALIGN_RIGHT, TableFormatter.VALIGN_DEFAULT) + .addLine(currency.format(data.getAmount(d, c.getUserObject()))); + } + } + tf.nextRow().nextCell().addLine("Sorties"); + for (String d : data.getDates()) { + tf.nextCell(TableFormatter.ALIGN_RIGHT, TableFormatter.VALIGN_DEFAULT) + .addLine(currency.format(data.getDebt(d))); + } + tf.nextRow().nextCell().addLine("Entrées"); + for (String d : data.getDates()) { + tf.nextCell(TableFormatter.ALIGN_RIGHT, TableFormatter.VALIGN_DEFAULT) + .addLine(currency.format(data.getIncome(d))); + } + tf.nextRow().nextCell().addLine("Total"); + for (String d : data.getDates()) { + tf.nextCell(TableFormatter.ALIGN_RIGHT, TableFormatter.VALIGN_DEFAULT) + .addLine(currency.format(data.getTotal(d))); + } + tf.nextRow().nextCell().addLine("Total cumulé"); + for (String d : data.getDates()) { + tf.nextCell(TableFormatter.ALIGN_RIGHT, TableFormatter.VALIGN_DEFAULT) + .addLine(currency.format(data.getFinances(d))); + } + + String s = StringUtils.join(tf.getFormattedTable(), "\n"); + Reader reader = new StringReader(s); + return new ReaderInputStream(reader); + } + /** * Permet de collecter et representer les donnees pour le budget */ Modified: trunk/chorem-webmotion/src/main/resources/mapping =================================================================== --- trunk/chorem-webmotion/src/main/resources/mapping 2013-06-29 22:54:31 UTC (rev 353) +++ trunk/chorem-webmotion/src/main/resources/mapping 2013-06-29 22:55:21 UTC (rev 354) @@ -10,7 +10,8 @@ * /wikitty-json/* DecoratorFilter.decorate wmDecoratorNo=true * /fragment/* DecoratorFilter.decorate wmDecoratorNo=true * /sales/funnel/json/* DecoratorFilter.decorate wmDecoratorNo=true -* /project/json/* DecoratorFilter.decorate wmDecoratorNo=true +* /project/json/* DecoratorFilter.decorate wmDecoratorNo=true +* /ascii/* DecoratorFilter.decorate wmDecoratorNo=true GET /* DecoratorFilter.decorate * /* AuthenticationFilter.check ##### @@ -52,6 +53,7 @@ * /admin/{method} action:AdminAction.{method} * /contact view:contact.jsp * /report view:report.jsp +* /ascii/budget action:DashboardAction.budget type=ascii,report=budget * /hr view:hr.jsp * /hr/vacationRequest/edit/{id} action:HrAction.editVacationRequest * /hr/vacationDiv/{ids} action:HrAction.editVacationDiv Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardBudget.jsp =================================================================== --- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardBudget.jsp 2013-06-29 22:54:31 UTC (rev 353) +++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardBudget.jsp 2013-06-29 22:55:21 UTC (rev 354) @@ -23,10 +23,34 @@ <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <%@ taglib uri="/WEB-INF/wikitty.tld" prefix="w"%> <h1>Budget</h1> +<form> + <input type="hidden" name="report" value="${report}"/> + <input type="hidden" name="useDate" value="${useDate}" /> + <c:if test="${useDate != 'false'}"> + <input type="hidden" name="start" value="${fn:escapeXml(start)}"/> + <input type="hidden" name="end" value="${fn:escapeXml(end)}"/> + </c:if> + <input type="hidden" name="query" value="${fn:escapeXml(query)}"/> + + profondeur <input type="text" name="depth" value="${depth}"/> + <input type="submit" class="btn"/> +</form> + + <c:url var="asciireport" value="/ascii/budget"> + <c:param name="useDate" value="${useDate}"/> + <c:param name="start" value="${start}"/> + <c:param name="end" value="${end}"/> + <c:param name="query" value="${query}"/> + <c:param name="depth" value="${depth}"/> + </c:url> + + <a href="${asciireport}">export ascii</a> + <table class="table table-striped table-bordered table-condensed"> <thead> <tr>