git export management

This commit is contained in:
David 2018-02-20 11:46:34 +01:00
parent 88d1284171
commit 0c1e1a7b21
4 changed files with 77 additions and 4 deletions

1
.gitignore vendored
View File

@ -120,5 +120,6 @@ modules/product_vouchers/*.csv
modules/labelgenerate/img/*
modules/purchaseguide/img/*
!modules/purchaseguide/img/index.php
modules/ant_wp/export/*
/.user.ini

View File

@ -1,7 +1,7 @@
<?php
require_once(PS_ADMIN_DIR . '/helpers/HelperFormBootstrap.php');
include_once(_PS_ROOT_DIR_.'/modules/ant_wp/GenerateWp.php');
require_once PS_ADMIN_DIR . '/helpers/HelperFormBootstrap.php';
include_once _PS_ROOT_DIR_.'/modules/ant_wp/GenerateWp.php';
require_once _PS_PHPEXCEL_DIR_.'Classes/PHPExcel.php';
require_once _PS_PHPEXCEL_DIR_.'Classes/PHPExcel/IOFactory.php';
@ -487,7 +487,7 @@ class AdminAntWp extends AdminTab
$wp->excludedProducts = $exclude_ids;
$wp->generate($params, $timer_table, $callStartTime);
$filename = str_replace(' ', '_', $filename);
$wp->objWriter->save(__DIR__ .'/'.$filename.'.xlsx');
$wp->objWriter->save(__DIR__ .'/export/'.$filename.'.xlsx');
$timer_table_formatted = implode('<br>', $timer_table);
$duplicated_formatted = '';
if (!empty($this->report[self::DUPLICATED_REFS])) {
@ -500,7 +500,7 @@ class AdminAntWp extends AdminTab
if($debug){
$debug_output = $duplicated_formatted.'<p style="font-size: 6px"><br>Timers : <br>'.$timer_table_formatted.'</p>';
}
$this->_html .= HelperFormBootstrap::displaySuccess('Génération complète <br><a class="btn btn-primary btn-xs" href="../modules/ant_wp/'.$filename.'.xlsx" download="'.$filename.'.xlsx">Télécharger le XLS</a>'.
$this->_html .= HelperFormBootstrap::displaySuccess('Génération complète <br><a class="btn btn-primary btn-xs" href="../modules/ant_wp/export/'.$filename.'.xlsx" download="'.$filename.'.xlsx">Télécharger le XLS</a>'.
'<br>Produits trouvés : '.$product_found.'<br>Produits nouveaux : '.$new_products. $debug_output);
} else {
$this->_html .= HelperFormBootstrap::displayErrors($this->l('Veuillez charger un fichier correct !'));

View File

@ -0,0 +1,36 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 7233 $
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

36
modules/ant_wp/index.php Normal file
View File

@ -0,0 +1,36 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 7233 $
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;