Permalink
Browse files

Version 2.0

  • Loading branch information...
Abhoryo committed Jun 15, 2012
1 parent 5217c18 commit c7973484ddd071e8da9b6262dddbf28a9b374a4a
Showing with 10,987 additions and 5,333 deletions.
  1. +5 −4 SorienDataGridBundle.php → APYDataGridBundle.php
  2. +68 −4 CHANGELOG.md
  3. +5 −3 DependencyInjection/{SorienDataGridExtension.php → APYDataGridExtension.php}
  4. +42 −42 DependencyInjection/Compiler/GridExtensionPass.php
  5. +0 −85 Form/GridTypeGuesser.php
  6. +4 −3 Grid/Action/DeleteMassAction.php
  7. +61 −8 Grid/Action/MassAction.php
  8. +17 −2 Grid/Action/MassActionInterface.php
  9. +36 −12 Grid/Action/RowAction.php
  10. +19 −4 Grid/Action/RowActionInterface.php
  11. +44 −9 Grid/Column/ActionsColumn.php
  12. +62 −10 Grid/Column/ArrayColumn.php
  13. +0 −27 Grid/Column/BlankColumn.php
  14. +23 −9 Grid/Column/BooleanColumn.php
  15. +748 −497 Grid/Column/Column.php
  16. +69 −42 Grid/Column/DateColumn.php
  17. +0 −48 Grid/Column/DateRangeColumn.php
  18. +69 −75 Grid/Column/DateTimeColumn.php
  19. +0 −184 Grid/Column/DateTimeRangeColumn.php
  20. +21 −11 Grid/Column/MassActionColumn.php
  21. +262 −0 Grid/Column/NumberColumn.php
  22. +0 −8 Grid/Column/PopulatableColumnInterface.php
  23. +0 −99 Grid/Column/RangeColumn.php
  24. +0 −68 Grid/Column/SelectColumn.php
  25. +0 −38 Grid/Column/SourceSelectColumn.php
  26. +53 −37 Grid/Column/TextColumn.php
  27. +25 −0 Grid/Column/TimeColumn.php
  28. +21 −40 Grid/Columns.php
  29. +27 −0 Grid/Export/CSVExport.php
  30. +79 −0 Grid/Export/DSVExport.php
  31. +49 −0 Grid/Export/ExcelExport.php
  32. +644 −0 Grid/Export/Export.php
  33. +28 −0 Grid/Export/JSONExport.php
  34. +29 −0 Grid/Export/PHPExcel2003Export.php
  35. +33 −0 Grid/Export/PHPExcel2007Export.php
  36. +73 −0 Grid/Export/PHPExcel5Export.php
  37. +33 −0 Grid/Export/PHPExcelHTMLExport.php
  38. +39 −0 Grid/Export/PHPExcelPDFExport.php
  39. +23 −0 Grid/Export/SCSVExport.php
  40. +27 −0 Grid/Export/TSVExport.php
  41. +43 −0 Grid/Export/XMLExport.php
  42. +10 −3 Grid/Filter.php
  43. +1,267 −1,280 Grid/Grid.php
  44. +68 −24 Grid/GridManager.php
  45. +32 −32 Grid/Helper/ColumnsIterator.php
  46. +38 −37 Grid/Mapping/Column.php
  47. +141 −158 Grid/Mapping/Driver/Annotation.php
  48. +22 −21 Grid/Mapping/Driver/DriverInterface.php
  49. +90 −92 Grid/Mapping/Metadata/Manager.php
  50. +104 −102 Grid/Mapping/Metadata/Metadata.php
  51. +57 −56 Grid/Mapping/Source.php
  52. +11 −6 Grid/Row.php
  53. +7 −15 Grid/Rows.php
  54. +0 −13 Grid/Source/DistinctFieldRepositoryInterface.php
  55. +391 −290 Grid/Source/Document.php
  56. +184 −117 Grid/Source/Entity.php
  57. +479 −128 Grid/Source/Source.php
  58. +112 −62 Grid/Source/Vector.php
  59. +1 −1 {Resources/meta → }/LICENSE
  60. +102 −49 README.md
  61. +47 −0 Resources/config/columns.xml
  62. +5 −77 Resources/config/services.xml
  63. +0 −164 Resources/doc/columns_configuration.md
  64. +59 −0 Resources/doc/columns_configuration/annotations/association_mapping.md
  65. +35 −0 Resources/doc/columns_configuration/annotations/column_annotation_class.md
  66. +62 −0 Resources/doc/columns_configuration/annotations/column_annotation_property.md
  67. +57 −0 Resources/doc/columns_configuration/annotations/dql_function.md
  68. +34 −0 Resources/doc/columns_configuration/annotations/source_annotation.md
  69. +59 −0 Resources/doc/columns_configuration/filters/create_filter.md
  70. +14 −0 Resources/doc/columns_configuration/filters/input_filter.md
  71. +77 −0 Resources/doc/columns_configuration/filters/select_filter.md
  72. +35 −0 Resources/doc/columns_configuration/types/array_column.md
  73. +26 −0 Resources/doc/columns_configuration/types/boolean_column.md
  74. +125 −0 Resources/doc/columns_configuration/types/create_column.md
  75. +17 −0 Resources/doc/columns_configuration/types/date_column.md
  76. +43 −0 Resources/doc/columns_configuration/types/datetime_column.md
  77. +53 −0 Resources/doc/columns_configuration/types/number_column.md
  78. +37 −0 Resources/doc/columns_configuration/types/text_column.md
  79. +7 −0 Resources/doc/columns_configuration/types/time_column.md
  80. +300 −0 Resources/doc/export/create_export.md
  81. +71 −0 Resources/doc/export/library-dependent_exports/PHPExcel/PHPExcel_HTML_export.md
  82. +75 −0 Resources/doc/export/library-dependent_exports/PHPExcel/PHPExcel_PDF_export.md
  83. +71 −0 Resources/doc/export/library-dependent_exports/PHPExcel/PHPExcel_excel2003_export.md
  84. +71 −0 Resources/doc/export/library-dependent_exports/PHPExcel/PHPExcel_excel2007_export.md
  85. +71 −0 Resources/doc/export/library-dependent_exports/PHPExcel/PHPExcel_excel5_export.md
  86. +22 −0 Resources/doc/export/library-dependent_exports/PHPExcel/PHPExcel_installation.md
  87. +56 −0 Resources/doc/export/native_exports/CSV_export.md
  88. +75 −0 Resources/doc/export/native_exports/DSV_export.md
  89. +46 −0 Resources/doc/export/native_exports/Excel_export.md
  90. +49 −0 Resources/doc/export/native_exports/JSON_export.md
  91. +56 −0 Resources/doc/export/native_exports/SCSV_export.md
  92. +54 −0 Resources/doc/export/native_exports/TSV_export.md
  93. +65 −0 Resources/doc/export/native_exports/XML_export.md
  94. +223 −0 Resources/doc/getting_started.md
  95. +0 −479 Resources/doc/grid_configuration.md
  96. +76 −0 Resources/doc/grid_configuration/add_actions_column.md
  97. +58 −0 Resources/doc/grid_configuration/add_column.md
  98. +19 −0 Resources/doc/grid_configuration/add_delete_mass_action.md
  99. +53 −0 Resources/doc/grid_configuration/add_mass_action.md
  100. +58 −0 Resources/doc/grid_configuration/add_row_action.md
  101. +82 −0 Resources/doc/grid_configuration/grid_response.md
  102. +73 −0 Resources/doc/grid_configuration/hide_show_columns.md
  103. +21 −0 Resources/doc/grid_configuration/manipulate_column.md
  104. +66 −0 Resources/doc/grid_configuration/manipulate_column_render_cell.md
  105. +65 −0 Resources/doc/grid_configuration/manipulate_query.md
  106. +82 −0 Resources/doc/grid_configuration/manipulate_rows_data.md
  107. +126 −0 Resources/doc/grid_configuration/multi_grid_manager.md
  108. +90 −0 Resources/doc/grid_configuration/set_data.md
  109. +74 −0 Resources/doc/grid_configuration/set_default_filters.md
  110. +44 −0 Resources/doc/grid_configuration/set_default_order.md
  111. +19 −0 Resources/doc/grid_configuration/set_default_page.md
  112. +28 −0 Resources/doc/grid_configuration/set_limits.md
  113. +26 −0 Resources/doc/grid_configuration/set_max_results.md
  114. +32 −0 Resources/doc/grid_configuration/set_prefix_titles.md
  115. +46 −0 Resources/doc/grid_configuration/set_separator_actions_column.md
  116. +44 −0 Resources/doc/grid_configuration/set_size_actions_column.md
  117. +117 −0 Resources/doc/grid_configuration/working_example.css
  118. +207 −0 Resources/doc/grid_configuration/working_example.md
  119. BIN Resources/doc/images/false.png
  120. BIN Resources/doc/images/screenshot_database.png
  121. BIN Resources/doc/images/screenshot_en.png
  122. BIN Resources/doc/images/screenshot_fr.png
  123. BIN Resources/doc/images/screenshot_full.png
  124. BIN Resources/doc/images/sort_down.gif
  125. BIN Resources/doc/images/sort_up.gif
  126. BIN Resources/doc/images/true.png
  127. +66 −66 Resources/doc/installation.md
  128. +0 −110 Resources/doc/multiple_grids.md
  129. +0 −87 Resources/doc/overriding_templates.md
  130. +83 −0 Resources/doc/source/document_source.md
  131. +78 −0 Resources/doc/source/entity_source.md
  132. +170 −0 Resources/doc/source/vector_source.md
  133. +90 −0 Resources/doc/summary.md
  134. +62 −0 Resources/doc/template/cell_rendering.md
  135. +31 −0 Resources/doc/template/filter_rendering.md
  136. 0 Resources/doc/template/overriding_internal_blocks.md
  137. +49 −0 Resources/doc/template/render_external_filters.md
  138. +75 −0 Resources/doc/template/render_the_grid.md
  139. +0 −121 Resources/doc/vector_configuration.md
  140. +122 −0 Resources/translations/messages.en.xliff
  141. +60 −0 Resources/translations/messages.fr.xliff
  142. +340 −224 Resources/views/blocks.html.twig
  143. +107 −125 Twig/DataGridExtension.php
  144. +121 −0 UPGRADE-2.0.md
  145. +33 −25 composer.json
@@ -3,19 +3,20 @@
/*
* This file is part of the DataGridBundle.
*
- * (c) Stanislav Turza <sorien@mail.com>
+ * (c) Abhoryo <abhoryo@free.fr>
+ * (c) Stanislav Turza
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
-namespace Sorien\DataGridBundle;
+namespace APY\DataGridBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Sorien\DataGridBundle\DependencyInjection\Compiler\GridExtensionPass;
+use APY\DataGridBundle\DependencyInjection\Compiler\GridExtensionPass;
-class SorienDataGridBundle extends Bundle
+class APYDataGridBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
View
@@ -1,3 +1,68 @@
+`16 Jun 2012`
+
+ * [Bundle] Push the actuel master branch into the new 1.0 branch. The master branch is now the version 2.0 of this bundle.
+
+**New in 2.0:** See [UPGRADE-2.0.md](UPGRADE-2.0) documentation.
+
+ * [BC Break][Bundle] Change the namespace of the bundle
+ * [BC Break][Filters] Add operator selector feature with a default operator
+ * [Filters] Add operators Equals, Not equal to, Lower than, Lower than or equal to, Greater than, Greater than or equal to, Between exclusive, Between inclusive, Contains, Not contains, Starts with, Ends with, Is not defined, Is defined,
+ * [Filters] Add annotation and php support for the operator selector feature and for the default operator
+ * [BC Break][Columns] Remove range, select and sourceselect columns (Include now in all columns with the filter attribute)
+ * [Annotations][Filters] Add an attribute to define the type of the filter (input, select)
+ * [Select filter] Populate select filters from the query result or the source
+ * [Annotations][Select filter] Add an attribute to define the source values of the select filter (From values, the source or the query)
+ * [Annotations][Filters] Add range feature implemented in input and select filter type with the operators between.
+ * [BC Break][Grid::initFilter] Grid::initFilter rename to setDefaultFilters
+ * [BC Break][Grid::initOrder] Grid::initOrder rename to setDefaultOrder
+ * [Columns] Add a way to change the data junction of the filters of a column
+ * [Mass action] Add templates for massaction filter and cell
+ * [Mass action] Add additional parameters passed to the callback
+ * [Columns] Add number column (decimal, money, percent, duration, scientific, spell out)
+ * [Export] Add export feature
+ * [Export] Add DSV, CSV, SCSV, TSV, XML, Excel (with PHPExcel library) and html (with PHPExcel library) exports.
+ * [Grid::setLimits] Add support for a simple array to define limits (e.g. $grid->setLimits(5, 10);)
+ * [BC Break][Sources] Source::setCallBack rename to manipulateRow and manipulateQuery and the first argument is removed
+ * [BC Break][Columns] Column::setCallBack rename to manipulateRenderCell
+ * [Row action] Add addRouteParameters method on rowAction class
+ * [Row action] rowAction::setRouteParameters allows string
+ * [BC Break][Grid::gridResponse] Grid::gridResponse rename to Grid::getGridResponse
+ * [BC Break][Grid::gridManagerResponse] GridManager::gridManagerResponse rename to GridManager::getGridManagerResponse
+ * [Grid::getGridResponse] The view parameters and the view name in Grid::getGridResponse can be set in reverse order to match the Template::render function.
+ * [Grid::getGridResponse] Add array('grid' => $grid) automatically in view parameters with Grid::getGridResponse
+ * [Grid::getGridManagerResponse] GridManager::getGridManagerResponse can be set in reverse order to match the Template::render function.
+ * [Grid::getGridManagerResponse] Add array('grid1' => $grid1, 'grid2' => $grid2, ...) automatically in view parameters with GridManager::getGridManagerResponse
+ * [DQL Functions] Manage a simple parameter for dql aggregate functions (e.g. vars.var:CountIf:3)
+ * [Entity source] Implement setMaxResults feature
+ * [Document source] Implement setMaxResults feature
+ * [Document source] Add all filters with operators
+ * [Document source] Add populate select filters feature
+ * [Vector source] Implement setMaxResults feature
+ * [Vector source] Add guess typing
+ * [Vector source] Add all filters with operators
+ * [Vector source] Add guess type sorting
+ * [Vector source] Add populate select filters feature
+ * [Grid::setData] Implement setMaxResults feature
+ * [Grid::setData] Add all filters with operators
+ * [Grid::setData] Add guess type sorting
+ * [Grid::setData] Add populate select filters feature
+ * [Template] Add some css classes
+ * [Template] Show 'false' in the grid if value === false in boolean column because a false value isn't show in twig)
+ * [Template] Add width attribute on filter th tag too.
+ * [ActionsColumn] Add the method Grid::setActionsColumnSize to set the size of the actions column
+ * [ActionsColumn] Add the method Grid::setActionsColumnSeparator to set the separator of the actions column
+ * [Filter] Disallow url filtering if the column is not filterable
+ * [Sort] Disallow url sorting if the column is not sortable
+ * [Limit] Disallow url limit if the value is not in the limits selector
+ * [Bundle] Update composer
+ * [Bundle] Clean and optimize code
+ * [Bundle] Follow Code Standard of Symfony2
+ * [Docs] Rework the whole documentation with the new features.
+
+`25 May 2012`
+
+ * XMLHttpRequest force the persistence mode
+
`15 May 2012`
* Allow using controllers as services in mass actions (lstrojny)
@@ -44,7 +109,7 @@
* [BC Break] Show a message instead of an empty grid
* Add a way to pass twig variables to override blocks
-
+
`30 Apr 2012`
* Add array Column for Entity sources
@@ -54,7 +119,7 @@
* Add initOrder method
* Add show and hide columns methods
* Fix render bloc ids and manipulate row field ids with mapping fields.
-
+
`29 Apr 2012`
* Add Vector source
@@ -94,8 +159,7 @@
`8 Apr 2012`
- * as far as symfony 2.0 lacks of some important features and 2.1dev is heavily unstable with too many changes every day (which causes too many problems form my company) i've decided to stop using symfony2 for my future projects it basically means that i'll no longer support this bundle, Abhoryo and nurikabe have rights to merge any PR for this bundle
-
+ * as far as symfony 2.0 lacks of some important features and 2.1dev is heavily unstable with too many changes every day (which causes too many problems form my company) i've decided to stop using symfony2 for my future projects it basically means that i'll no longer support this bundle, Abhoryo and nurikabe have rights to merge any PR for this bundle
`20 Oct 2011`
@@ -3,24 +3,26 @@
/*
* This file is part of the DataGridBundle.
*
- * (c) Stanislav Turza <sorien@mail.com>
+ * (c) Abhoryo <abhoryo@free.fr>
+ * (c) Stanislav Turza
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
-namespace Sorien\DataGridBundle\DependencyInjection;
+namespace APY\DataGridBundle\DependencyInjection;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\Config\FileLocator;
-class SorienDataGridExtension extends Extension
+class APYDataGridExtension extends Extension
{
public function load(array $config, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
+ $loader->load('columns.xml');
}
}
@@ -1,42 +1,42 @@
-<?php
-
-/*
- * This file is part of the DataGridBundle.
- *
- * (c) Stanislav Turza <sorien@mail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Sorien\DataGridBundle\DependencyInjection\Compiler;
-
-use Symfony\Component\DependencyInjection\Reference;
-use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
-
-class GridExtensionPass implements CompilerPassInterface
-{
- public function process(ContainerBuilder $container)
- {
- if (false === $container->hasDefinition('grid')) {
- return;
- }
-
- $definition = $container->getDefinition('grid');
-
- // Extensions must always be registered before everything else.
- // For instance, global variable definitions must be registered
- // afterward. If not, the globals from the extensions will never
- // be registered.
- $calls = $definition->getMethodCalls();
- $definition->setMethodCalls(array());
-
- foreach ($container->findTaggedServiceIds('grid.column.extension') as $id => $attributes)
- {
- $definition->addMethodCall('addColumnExtension', array(new Reference($id)));
- }
-
- $definition->setMethodCalls(array_merge($definition->getMethodCalls(), $calls));
- }
-}
+<?php
+
+/*
+ * This file is part of the DataGridBundle.
+ *
+ * (c) Abhoryo <abhoryo@free.fr>
+ * (c) Stanislav Turza
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace APY\DataGridBundle\DependencyInjection\Compiler;
+
+use Symfony\Component\DependencyInjection\Reference;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
+
+class GridExtensionPass implements CompilerPassInterface
+{
+ public function process(ContainerBuilder $container)
+ {
+ if (false === $container->hasDefinition('grid')) {
+ return;
+ }
+
+ $definition = $container->getDefinition('grid');
+
+ // Extensions must always be registered before everything else.
+ // For instance, global variable definitions must be registered
+ // afterward. If not, the globals from the extensions will never
+ // be registered.
+ $calls = $definition->getMethodCalls();
+ $definition->setMethodCalls(array());
+
+ foreach ($container->findTaggedServiceIds('grid.column.extension') as $id => $attributes) {
+ $definition->addMethodCall('addColumnExtension', array(new Reference($id)));
+ }
+
+ $definition->setMethodCalls(array_merge($definition->getMethodCalls(), $calls));
+ }
+}
View
@@ -1,85 +0,0 @@
-<?php
-
-/*
- * This file is part of the DataGridBundle.
- *
- * (c) Stanislav Turza <sorien@mail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Sorien\DataGridBundle\Form;
-
-use Symfony\Component\Form\FormTypeGuesserInterface;
-use Symfony\Component\Form\Guess\Guess;
-use Symfony\Component\Form\Guess\TypeGuess;
-use Symfony\Component\Form\Guess\ValueGuess;
-
-class GridTypeGuesser implements FormTypeGuesserInterface
-{
- /**
- * @var \Sorien\DataGridBundle\Grid\Mapping\Metadata\Manager;
- */
- protected $manager;
-
- /**
- * @var \Sorien\DataGridBundle\Grid\Mapping\Metadata\Metadata
- */
- protected $metadata;
-
- /**
- * @param $manager
- */
- public function __construct($manager)
- {
- $this->manager = $manager;
- }
-
- public function guessType($class, $property)
- {
- $metadata = $this->manager->getMetadata($class);
-
- if ($metadata->hasFieldMapping($property))
- {
- $params = $metadata->getFieldMapping($property);
- switch ($metadata->getFieldMappingType($property))
- {
-// case 'text':
-// if (isset($params['title']) && $params['title'] != '') // && strpos($params['id'], '.') === false
-// {
-// return new TypeGuess('text', array('label' => $params['title']), Guess::LOW_CONFIDENCE);
-// }
-// break;
- case 'select':
- if (!empty($params['values']))
- {
- return new TypeGuess('choice', array('choices' => $params['values']), Guess::HIGH_CONFIDENCE);
- }
- break;
- case 'boolean':
- return new TypeGuess('choice', array('choices' => array('1'=>'true','0'=>'false')), Guess::HIGH_CONFIDENCE);
- break;
- default:
- return null;
- }
- }
- }
-
- public function guessRequired($class, $property)
- {
- }
-
- public function guessMaxLength($class, $property)
- {
- }
-
- public function guessMinLength($class, $property)
- {
- }
-
- protected function isMappedClass($class)
- {
- return ;
- }
-}
@@ -3,21 +3,22 @@
/*
* This file is part of the DataGridBundle.
*
- * (c) Stanislav Turza <sorien@mail.com>
+ * (c) Abhoryo <abhoryo@free.fr>
+ * (c) Stanislav Turza
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
-namespace Sorien\DataGridBundle\Grid\Action;
+namespace APY\DataGridBundle\Grid\Action;
class DeleteMassAction extends MassAction
{
/**
* Default DeleteMassAction constructor
*
* @param boolean $confirm Show confirm message if true
- * @return \Sorien\DataGridBundle\Grid\Action\MassAction
+ * @return \APY\DataGridBundle\Grid\Action\MassAction
*/
public function __construct($confirm = false)
{
Oops, something went wrong.

0 comments on commit c797348

Please sign in to comment.