Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: akeneo-labs/ExcelConnectorBundle
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.6.0
Choose a base ref
...
head repository: akeneo-labs/ExcelConnectorBundle
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Mar 10, 2016

  1. Update README.md

    fitn committed Mar 10, 2016
    Copy the full SHA
    e729e2b View commit details
  2. Update README.md

    fitn committed Mar 10, 2016
    Copy the full SHA
    a3181b6 View commit details
  3. Merge pull request #39 from akeneo-labs/fitn-improve_doc

    Improve documentation
    fitn committed Mar 10, 2016
    Copy the full SHA
    30d8648 View commit details

Commits on Mar 21, 2016

  1. EX-22: Fix associations import

    fitn committed Mar 21, 2016
    Copy the full SHA
    ac16730 View commit details
  2. Merge pull request #42 from akeneo-labs/EX-22

    EX-22: Fix associations import
    fitn committed Mar 21, 2016
    Copy the full SHA
    715b5b9 View commit details
  3. EX-22: Fix associations import

    fitn committed Mar 21, 2016
    Copy the full SHA
    09315d9 View commit details
  4. Copy the full SHA
    1666f8e View commit details
  5. Merge pull request #43 from akeneo-labs/fix_association_import

    EX-22: Fix associations import
    fitn committed Mar 21, 2016
    Copy the full SHA
    e43fc9f View commit details

Commits on Mar 24, 2016

  1. Update CHANGELOG.md for 1.5

    fitn committed Mar 24, 2016
    Copy the full SHA
    cd994be View commit details
  2. Copy the full SHA
    7b25d06 View commit details
  3. Copy the full SHA
    12efdd4 View commit details
  4. Merge pull request #45 from akeneo-labs/rebase-1.5

    Rebase 1.5
    fitn committed Mar 24, 2016
    Copy the full SHA
    c8e1e17 View commit details
  5. Update CHANGELOG.md

    fitn committed Mar 24, 2016
    Copy the full SHA
    cf47e0c View commit details

Commits on Mar 29, 2016

  1. Copy the full SHA
    3b8b2aa View commit details
  2. update Travis config

    jmleroux committed Mar 29, 2016
    Copy the full SHA
    f162f3d View commit details

Commits on Mar 30, 2016

  1. Merge pull request #46 from akeneo-labs/EX20-family-export

    EX20: truncate family name when > 31 for worksheet title
    jmleroux committed Mar 30, 2016
    Copy the full SHA
    ebe3487 View commit details

Commits on Apr 16, 2016

  1. Copy the full SHA
    fdb14b9 View commit details
  2. Merge pull request #48 from akeneo-labs/EX-24

    EX-24: Accept numeric values for text attributes in import
    jmleroux committed Apr 16, 2016
    Copy the full SHA
    192f98c View commit details
  3. splits changelog

    jmleroux committed Apr 16, 2016
    Copy the full SHA
    e27457b View commit details
  4. Merge branch '1.5' into master

    Conflicts:
    	CHANGELOG.md
    	spec/Pim/Bundle/ExcelConnectorBundle/Excel/Builder/ExcelBuilderBehavior.php
    	spec/Pim/Bundle/ExcelConnectorBundle/Excel/Builder/ExcelBuilderSpec.php
    	spec/Pim/Bundle/ExcelConnectorBundle/Iterator/AttributeXlsxFileIteratorSpec.php
    	spec/Pim/Bundle/ExcelConnectorBundle/Iterator/XlsxFileIteratorBehavior.php
    	spec/Pim/Bundle/ExcelConnectorBundle/Reader/AbstractIteratorReaderSpec.php
    	spec/Pim/Bundle/ExcelConnectorBundle/Reader/FileIteratorReaderSpec.php
    jmleroux committed Apr 16, 2016
    Copy the full SHA
    beb7395 View commit details
  5. fix composer after merge 1.5

    jmleroux committed Apr 16, 2016
    Copy the full SHA
    309e95d View commit details
  6. fix changelog

    jmleroux committed Apr 16, 2016
    Copy the full SHA
    1669071 View commit details
  7. fix changelog 1.5

    jmleroux committed Apr 16, 2016
    Copy the full SHA
    860c872 View commit details
  8. Merge branch '1.5'

    Conflicts:
    	CHANGELOG.md
    jmleroux committed Apr 16, 2016
    Copy the full SHA
    b5798ad View commit details
  9. splits changelog

    Conflicts:
    	CHANGELOG.md
    jmleroux committed Apr 16, 2016
    Copy the full SHA
    469c18e View commit details
  10. Merge branch '1.5'

    Conflicts:
    	CHANGELOG-1.5.md
    jmleroux committed Apr 16, 2016
    Copy the full SHA
    b407111 View commit details
  11. changelog 1.6.2

    jmleroux committed Apr 16, 2016
    Copy the full SHA
    4a81ab2 View commit details
  12. Copy the full SHA
    7c9458b View commit details
  13. travis add PHP7

    jmleroux committed Apr 16, 2016
    Copy the full SHA
    3f2c0bb View commit details
  14. fix 1.5.4 changelog

    jmleroux committed Apr 16, 2016
    Copy the full SHA
    ac1870a View commit details
  15. Merge branch '1.5'

    jmleroux committed Apr 16, 2016
    Copy the full SHA
    a9e3bc4 View commit details

Commits on May 13, 2016

  1. Copy the full SHA
    c6aaac8 View commit details

Commits on Jun 21, 2016

  1. Merge pull request #50 from dimitri-koenig/bugfix/49-istrue-assert

    Replaced deprecated \True assert check with \IsTrue
    fitn authored Jun 21, 2016
    Copy the full SHA
    0e8f678 View commit details

Commits on Jul 22, 2016

  1. Copy the full SHA
    3a3ac64 View commit details

Commits on Jul 25, 2016

  1. Merge pull request #52 from mickaelandrieu/patch-1

    updated PHP CS Fixer to new organization
    fitn authored Jul 25, 2016
    Copy the full SHA
    3fe7dc3 View commit details

Commits on Sep 11, 2016

  1. Deprecated for PIM >= 1.7

    jmleroux authored Sep 11, 2016
    Copy the full SHA
    d88558b View commit details

Commits on Sep 30, 2016

  1. Fix typo

    fitn authored Sep 30, 2016
    Copy the full SHA
    3924524 View commit details

Commits on Feb 21, 2017

  1. Copy the full SHA
    69bbaec View commit details
  2. Copy the full SHA
    a3d084e View commit details
25 changes: 16 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
language: php
sudo: false

php:
- "5.4"
- "5.5"
- "5.6"
- 5.4
- 5.5
- 5.6
- 7.0

# Allow to use container infrastructure
sudo: false
matrix:
allow_failures:
- php: 7.0

cache:
directories:
- $HOME/.composer/cache
- $HOME/.composer/cache/files

before_script:
- phpenv config-add travis.php.ini
before_install:
- echo "memory_limit=3G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- phpenv config-rm xdebug.ini
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config

install:
- composer self-update --no-interaction
- composer update --no-interaction --no-scripts
- composer update --no-interaction --no-scripts --prefer-dist

script:
- ./bin/phpspec run
45 changes: 45 additions & 0 deletions ArrayConverter/Flat/Product/ValueConverter/TextConverter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

namespace Pim\Bundle\ExcelConnectorBundle\ArrayConverter\Flat\Product\ValueConverter;

use Pim\Component\Connector\ArrayConverter\Flat\Product\FieldSplitter;
use Pim\Component\Connector\ArrayConverter\Flat\Product\ValueConverter\AbstractValueConverter;

/**
* Converts text value into structured one.
*
* @author Yohan Blain <yohan.blain@akeneo.com>
* @copyright 2016 Akeneo SAS (http://www.akeneo.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class TextConverter extends AbstractValueConverter
{
/**
* @param FieldSplitter $fieldSplitter
* @param array $supportedFieldType
*/
public function __construct(FieldSplitter $fieldSplitter, array $supportedFieldType)
{
parent::__construct($fieldSplitter);

$this->supportedFieldType = $supportedFieldType;
}

/**
* {@inheritdoc}
*/
public function convert(array $attributeFieldInfo, $value)
{
if ('' !== $value) {
$data = (string) $value;
} else {
$data = null;
}

return [$attributeFieldInfo['attribute']->getCode() => [[
'locale' => $attributeFieldInfo['locale_code'],
'scope' => $attributeFieldInfo['scope_code'],
'data' => $data,
]]];
}
}
11 changes: 11 additions & 0 deletions CHANGELOG-1.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# CHANGELOG 1.2

## 1.2.0 (2014-05-14)
- Added support for Akeneo Spreadsheet parser

## 1.1.0 (2014-04-16)
- Added Office XML 2003 export
- Compatibility with version 1.1 of Akeneo PIM

## 1.1.0 (2014-03-07)
- Initial release.
13 changes: 13 additions & 0 deletions CHANGELOG-1.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# CHANGELOG 1.3

## 1.3.2 (2014-09-25)
- Added compatibility with PIM CE 1.2.6

## 1.3.1 (2014-09-22)
- Fixed write count for homogeneous CSV writer

## 1.3.0 (2014-09-11)
- Added SpreadsheetReader, for compatibility with all formats supported by Akeneo Spreadsheet parser
- Compatibility with version 1.2 of Akeneo PIM CE
- Removed content type constraint on readers
- pim_excel_connector.reader.xls_init service was renamed pim_excel_connector.reader.xls
16 changes: 16 additions & 0 deletions CHANGELOG-1.4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# CHANGELOG 1.4

## 1.4.1 (2015-10-13)
### Bug fix
- EX-17: Allow init import and product import having numeric identifier

### BC break
- Inject `pim_catalog.repository.attribute` inside `pim_excel_connector.reader.spreadsheet` with `setAttributeRepository` method

## 1.4.0 (2015-03-17)
- Made compatible with PIM CE 1.3.x
- Updated the init file from fixtures:
- Removed default_value and usable_as_grid_column from attributes and family tab
- Corrected the codes for wysywig_enabled and available_locales in the attributes and family tab
- Removed the is_default column from the options tab
- Removed garbage characters
28 changes: 28 additions & 0 deletions CHANGELOG-1.5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# CHANGELOG 1.5

## 1.5.4

### Improvement
- EX-24: allow import numeric values for text and textarea attributes


## 1.5.2

### Bug fix
- EX-22: Fix associations in product import

### Improvement
- The product XLSX import don't rely anymore to the deprecated import services


## 1.5.1 (2015-10-13)

### Bug fix
- EX-17: Allow init import and product import having numeric identifier

### BC break
- Inject `pim_catalog.repository.attribute` inside `pim_excel_connector.reader.spreadsheet` with `setAttributeRepository` method


## 1.5.0 (2015-10-07)
- Migrate bundle to AkeneoLabs
16 changes: 16 additions & 0 deletions CHANGELOG-1.6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# CHANGELOG 1.6

## 1.6.2
### Improvement
- EX-24: allow import numeric values for text and textarea attributes

## 1.6.1
### Bug fix
- EX-22: Fix associations in product import

### Improvement
- The product XLSX import don't rely anymore to the deprecated import services

## 1.6.0
### Features
- Compatibility with Akeneo PIM 1.5
48 changes: 0 additions & 48 deletions CHANGELOG.md

This file was deleted.

1 change: 1 addition & 0 deletions DependencyInjection/PimExcelConnectorExtension.php
Original file line number Diff line number Diff line change
@@ -31,5 +31,6 @@ public function load(array $configs, ContainerBuilder $container)
$loader->load('excel.yml');
$loader->load('processors.yml');
$loader->load('serializer.yml');
$loader->load('array_converters.yml');
}
}
20 changes: 11 additions & 9 deletions Excel/Builder/AbstractExcelBuilder.php
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@

namespace Pim\Bundle\ExcelConnectorBundle\Excel\Builder;

use PHPExcel;
use PHPExcel_Worksheet;
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
@@ -22,7 +24,7 @@ abstract class AbstractExcelBuilder implements ExcelBuilderInterface
/** @var array */
protected $options;

/** @var \PHPExcel */
/** @var PHPExcel */
protected $xls;

/** @var boolean */
@@ -36,7 +38,7 @@ public function __construct(array $options = array())
$resolver = new OptionsResolver();
$this->setDefaultOptions($resolver);
$this->options = $resolver->resolve($options);
$this->xls = new \PHPExcel();
$this->xls = new PHPExcel();
}

/**
@@ -90,10 +92,10 @@ protected function getWorksheet(array $data)
/**
* Creates a worksheet with the given name
*
* @param type $name
* @param array $data
* @param string $name
* @param array $data
*
* @return \PHPExcelWorksheet
* @return PHPExcel_Worksheet
*/
protected function createWorksheet($name, array $data)
{
@@ -118,10 +120,10 @@ protected function cleanup()
/**
* Writes labels for the submitted data
*
* @param \PHPExcel_Worksheet $worksheet
* @param PHPExcel_Worksheet $worksheet
* @param array $data
*/
protected function writeLabels(\PHPExcel_Worksheet $worksheet, array $data)
protected function writeLabels(PHPExcel_Worksheet $worksheet, array $data)
{
$worksheetName = $worksheet->getTitle();
$missing = array_diff(array_keys($data), $this->labels[$worksheetName]);
@@ -136,10 +138,10 @@ protected function writeLabels(\PHPExcel_Worksheet $worksheet, array $data)
/**
* Writes a row of values
*
* @param \PHPExcel_Worksheet $worksheet
* @param PHPExcel_Worksheet $worksheet
* @param array $data An array of values with column indexes as keys
*/
protected function writeValues(\PHPExcel_Worksheet $worksheet, array $data)
protected function writeValues(PHPExcel_Worksheet $worksheet, array $data)
{
$worksheetName = $worksheet->getTitle();
$row = $this->rowIndexes[$worksheetName];
8 changes: 7 additions & 1 deletion Excel/Builder/ProductFamilyExcelBuilder.php
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@

namespace Pim\Bundle\ExcelConnectorBundle\Excel\Builder;

use PHPExcel_Shared_String;

/**
* Excel builder for products, with one tab per family
*
@@ -16,6 +18,10 @@ class ProductFamilyExcelBuilder extends AbstractExcelBuilder
*/
protected function getWorksheetName(array $data)
{
return $data['family'];
$worksheetName = $data['family'];
if (PHPExcel_Shared_String::CountCharacters($worksheetName) > 31) {
$worksheetName = PHPExcel_Shared_String::Substring($worksheetName, 0, 31);
}
return $worksheetName;
}
}
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@

![alt text](./Resources/doc/pictures/akeneo_excel.png "")

**DEPRECATED**: this bundle is not compatible with the latest Akeneo PIM. Starting from 1.6 PIM version, you should use [ExcelInitBundle](https://github.com/akeneo/ExcelInitBundle) instead.

This bundle adds support of Excel XSLX files as a source for initializing catalog structure and import/export of products for [Akeneo PIM](https://github.com/akeneo/pim-community-standard).

## Requirements
@@ -23,7 +25,7 @@ This bundle adds support of Excel XSLX files as a source for initializing catalo
From your application root:

```bash
$ php composer.phar require --prefer-dist akeneo-labs/excel-connector-bundle:1.6.*
php composer.phar require --prefer-dist akeneo-labs/excel-connector-bundle:1.6.*
```

Enable the bundle in the `app/AppKernel.php` file in the `registerBundles()` method:
@@ -36,12 +38,11 @@ Enable the bundle in the `app/AppKernel.php` file in the `registerBundles()` met
]
```

Then clean the cache and reinstall the assets:
Now let's clean your cache and dump your assets:

```bash
php app/console cache:clear --env=prod

php app/console pim:install:assets --env=prod
php app/console pim:installer:assets --env=prod
```

## Documentation
@@ -51,7 +52,7 @@ Then clean the cache and reinstall the assets:
See [Resources/doc/Getting started](./Resources/doc/Getting-started.rst) for more details on how to set your catalog structure
using the [init.xslx](./Resources/fixtures/minimal/init.xlsx) file.

See [Resources/doc folder](./Resources/doc/Home.rst) for more details on how to set your catalog structur
See [Resources/doc folder](./Resources/doc/Home.rst) for more details on how to set your catalog structure

### Supported file

12 changes: 12 additions & 0 deletions Reader/AbstractIteratorReader.php
Original file line number Diff line number Diff line change
@@ -66,12 +66,24 @@ public function read()

/**
* Resets the state of the reader
*
* @deprecated will be remove in 1.7. Use initialize method instead.
*/
public function reset()
{
$this->iterator = null;
}

/**
* Initializes the iterator allowing to use the same service in two successive steps
*
* {@inheritdoc}
*/
public function initialize()
{
$this->iterator = null;
}

/**
* Converts an entity numerical identifier ('sku' for products,
* 'code' for other entities) into string to allow import.
Loading