Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes XLSX typos #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/11-FileFormats.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ printed JSON. Such files also make also prefectly valid import candidates:
Microsoft Excel
---------------

XSLX, the Microsoft Excel 2007+ format is supported since v1.1.0.
XLSX, the Microsoft Excel 2007+ format is supported since v1.1.0.


XML - Extensible Markup Language
Expand Down
18 changes: 9 additions & 9 deletions library/Fileshipper/ProvidedHook/Director/ImportSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ public static function addSettingsFormFields(QuickForm $form)
static::addCsvElements($form);
break;

case 'xslx':
static::addXslxElements($form, $filename);
case 'xlsx':
static::addXlsxElements($form, $filename);
break;
}

Expand Down Expand Up @@ -220,7 +220,7 @@ protected static function addCsvElements(QuickForm $form)
* @param $filename
* @throws \Zend_Form_Exception
*/
protected static function addXslxElements(QuickForm $form, $filename)
protected static function addXlsxElements(QuickForm $form, $filename)
{
$form->addElement('select', 'worksheet_addressing', array(
'label' => $form->translate('Choose worksheet'),
Expand All @@ -238,7 +238,7 @@ protected static function addXslxElements(QuickForm $form, $filename)
$addressing = $form->getSentOrObjectSetting('worksheet_addressing');
switch ($addressing) {
case 'by_name':
$file = static::loadXslxFile($filename);
$file = static::loadXlsxFile($filename);
$names = $file->getSheetNames();
$names = array_combine($names, $names);
$form->addElement('select', 'worksheet_name', array(
Expand Down Expand Up @@ -296,8 +296,8 @@ protected function fetchFile($basedir, $file, $format)
return $this->readJsonFile($filename);
case 'csv':
return $this->readCsvFile($filename);
case 'xslx':
return $this->readXslxFile($filename);
case 'xlsx':
return $this->readXlsxFile($filename);
case 'xml':
libxml_disable_entity_loader(true);
return $this->readXmlFile($filename);
Expand All @@ -313,7 +313,7 @@ protected function fetchFile($basedir, $file, $format)
* @param $filename
* @return Workbook
*/
protected static function loadXslxFile($filename)
protected static function loadXlsxFile($filename)
{
return new Workbook($filename);
}
Expand All @@ -322,7 +322,7 @@ protected static function loadXslxFile($filename)
* @param $filename
* @return array
*/
protected function readXslxFile($filename)
protected function readXlsxFile($filename)
{
$xlsx = new Workbook($filename);
if ($this->getSetting('worksheet_addressing') === 'by_name') {
Expand Down Expand Up @@ -525,7 +525,7 @@ protected static function listAvailableFormats(QuickForm $form)
);

if (class_exists('\\ZipArchive')) {
$formats['xslx'] = $form->translate('XSLX (Microsoft Excel 2007+)');
$formats['xlsx'] = $form->translate('XLSX (Microsoft Excel 2007+)');
}

if (function_exists('simplexml_load_file')) {
Expand Down