// MERGE with 1.4 r7770

This commit is contained in:
rMalie
2011-07-28 09:20:57 +00:00
parent 60b07cacb9
commit c17e7c236d
968 changed files with 26082 additions and 3937 deletions
+91
View File
@@ -0,0 +1,91 @@
<?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$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
define('_PS_ADMIN_DIR_', getcwd());
define('PS_ADMIN_DIR', _PS_ADMIN_DIR_); // Retro-compatibility
include(_PS_ADMIN_DIR_.'/../config/config.inc.php');
include(_PS_ADMIN_DIR_.'/functions.php');
include(_PS_ADMIN_DIR_.'/init.php');
if (empty($tab) and !sizeof($_POST))
{
$tab = 'AdminHome';
$_POST['tab'] = 'AdminHome';
$_POST['token'] = Tools::getAdminTokenLite($tab);
}
if ($id_tab = checkingTab($tab))
{
$isoUser = Language::getIsoById(intval($cookie->id_lang));
if (Validate::isLoadedObject($adminObj))
{
$adminObj->ajax = true;
if ($adminObj->checkToken())
{
// the differences with index.php is here
$adminObj->ajaxPreProcess();
$action = Tools::getValue('action');
// no need to use displayConf() here
if (!empty($action) AND method_exists($adminObj, 'ajaxProcess'.Tools::toCamelCase($action)) )
$adminObj->{'ajaxProcess'.Tools::toCamelCase($action)}();
else
$adminObj->ajaxProcess();
// @TODO We should use a displayAjaxError
$adminObj->displayErrors();
if (!empty($action) AND method_exists($adminObj, 'displayAjax'.Tools::toCamelCase($action)) )
$adminObj->{'displayAjax'.$action}();
else
$adminObj->displayAjax();
}
else
{
// If this is an XSS attempt, then we should only display a simple, secure page
ob_clean();
// ${1} in the replacement string of the regexp is required, because the token may begin with a number and mix up with it (e.g. $17)
$url = preg_replace('/([&?]token=)[^&]*(&.*)?$/', '${1}'.$adminObj->token.'$2', $_SERVER['REQUEST_URI']);
if (false === strpos($url, '?token=') AND false === strpos($url, '&token='))
$url .= '&token='.$adminObj->token;
// we can display the correct url
// die(Tools::jsonEncode(array(translate('Invalid security token'),$url)));
die(Tools::jsonEncode(translate('Invalid security token')));
}
}
}
+5 -5
View File
@@ -30,8 +30,6 @@ include(PS_ADMIN_DIR.'/../config/config.inc.php');
/* Getting cookie or logout */
require_once(dirname(__FILE__).'/init.php');
require_once(PS_ADMIN_DIR.'/tabs/AdminCounty.php');
$context = Context::getContext();
if (isset($_GET['changeParentUrl']))
@@ -491,12 +489,12 @@ if (Tools::isSubmit('saveImportMatchs'))
if (Tools::isSubmit('deleteImportMatchs'))
{
Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'import_match` WHERE id_import_match = '.pSQL(Tools::getValue('idImportMatchs')));
Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'import_match` WHERE `id_import_match` = '.(int)Tools::getValue('idImportMatchs'));
}
if (Tools::isSubmit('loadImportMatchs'))
{
$return = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'import_match` WHERE id_import_match = '.pSQL(Tools::getValue('idImportMatchs')));
$return = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'import_match` WHERE `id_import_match` = '.(int)Tools::getValue('idImportMatchs'));
die('{"id" : "'.$return[0]['id_import_match'].'", "matchs" : "'.$return[0]['match'].'", "skip" : "'.$return[0]['skip'].'"}');
}
@@ -508,6 +506,8 @@ if (Tools::isSubmit('toggleScreencast'))
if (Tools::isSubmit('ajaxAddZipCode') OR Tools::isSubmit('ajaxRemoveZipCode'))
{
require_once(PS_ADMIN_DIR.'/tabs/AdminCounty.php');
$zipcodes = Tools::getValue('zipcodes');
$id_county = (int)Tools::getValue('id_county');
@@ -688,7 +688,7 @@ if (Tools::isSubmit('getAdminHomeElement'))
if (Tools::isSubmit('getChildrenCategories') && Tools::getValue('id_category_parent'))
{
$children_categories = Category::getChildrenWithNbSelectedSubCatForProduct(Tools::getValue('id_category_parent'), Tools::getValue('id_product', 0), Tools::getValue('post_selected_cat', null), $cookie->id_lang);
$children_categories = Category::getChildrenWithNbSelectedSubCat(Tools::getValue('id_category_parent'), Tools::getValue('selectedCat', array()), $cookie->id_lang);
die(Tools::jsonEncode($children_categories));
}
+36
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$
* @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
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$
* @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;
@@ -31,7 +31,11 @@ eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^
//media.js end
//ajaxfileupload start
jQuery.extend({ createUploadIframe: function(id, uri)
{ var frameId = 'jUploadFrame' + id; if(window.ActiveXObject) { var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />'); if(typeof uri== 'boolean'){ io.src = 'javascript:false';}
{ var frameId = 'jUploadFrame' + id; if(window.ActiveXObject) {
var io = document.createElement('iframe');
io.setAttribute('id', frameId);
io.setAttribute('name', frameId);
if(typeof uri== 'boolean'){ io.src = 'javascript:false';}
else if(typeof uri== 'string'){ io.src = uri;}
}
else { var io = document.createElement('iframe'); io.id = frameId; io.name = frameId;}
@@ -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$
* @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;
@@ -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$
* @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;
@@ -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$
* @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;
@@ -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$
* @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;
@@ -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$
* @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
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$
* @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;
@@ -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$
* @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;
@@ -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$
* @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;
@@ -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$
* @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;
@@ -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$
* @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;
@@ -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$
* @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;
@@ -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$
* @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;
@@ -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$
* @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;
@@ -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$
* @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;
@@ -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$
* @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
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$
* @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;
+4 -5
View File
@@ -82,7 +82,7 @@ function rewriteSettingsFile($baseUrls = NULL, $theme = NULL, $arrayDB = NULL)
$defines['_PS_CACHING_SYSTEM_'] = _PS_CACHING_SYSTEM_;
$defines['_PS_CACHE_ENABLED_'] = _PS_CACHE_ENABLED_;
$defines['_DB_NAME_'] = (($arrayDB AND isset($arrayDB['_DB_NAME_'])) ? $arrayDB['_DB_NAME_'] : _DB_NAME_);
$defines['_MYSQL_ENGINE_'] = _MYSQL_ENGINE_;
$defines['_MYSQL_ENGINE_'] = (($arrayDB AND isset($arrayDB['_MYSQL_ENGINE_'])) ? $arrayDB['_MYSQL_ENGINE_'] : _MYSQL_ENGINE_);
$defines['_DB_SERVER_'] = (($arrayDB AND isset($arrayDB['_DB_SERVER_'])) ? $arrayDB['_DB_SERVER_'] : _DB_SERVER_);
$defines['_DB_USER_'] = (($arrayDB AND isset($arrayDB['_DB_USER_'])) ? $arrayDB['_DB_USER_'] : _DB_USER_);
$defines['_DB_PREFIX_'] = (($arrayDB AND isset($arrayDB['_DB_PREFIX_'])) ? $arrayDB['_DB_PREFIX_'] : _DB_PREFIX_);
@@ -207,10 +207,9 @@ function createDir($path, $rights)
function checkPSVersion()
{
libxml_set_streams_context(stream_context_create(array('http' => array('timeout' => 3))));
if ($feed = @simplexml_load_file('http://www.prestashop.com/xml/version.xml') AND _PS_VERSION_ < $feed->version->num)
return array('name' => $feed->version->name, 'link' => $feed->download->link);
return false;
$upgrader = new Upgrader();
return $upgrader->checkPSVersion();
}
function translate($string)
+1 -1
View File
@@ -52,7 +52,7 @@ if (empty($tab) and !sizeof($_POST))
? '<a href="?tab='.$item['class_name'].'&token='.Tools::getAdminToken($item['class_name'].intval($item['id_tab']).intval($cookie->id_employee)).'">'
: '').'
'.$item['name'].((sizeof($tabs) - 1 > $key) ? '</a>' : '');
// @TODO : a way to desactivate this feature
echo'<script type="text/javascript">
$(function() {
-3
View File
@@ -28,9 +28,6 @@
ob_start();
$timerStart = microtime(true);
$context = Context::getContext();
$context->cookie = $cookie;
if (isset($_GET['logout']))
$cookie->logout();
+1 -1
View File
@@ -64,7 +64,7 @@ if (isset($_POST['Submit']))
$errors[] = Tools::displayError('An error occurred during your password change.');
else
{
Mail::Send((int)$id_lang, 'password', Mail::l('Your new admin password'), array('{email}' => $employee->email, '{lastname}' => $employee->lastname, '{firstname}' => $employee->firstname, '{passwd}' => $pwd), $employee->email, $employee->firstname.' '.$employee->lastname);
if(Mail::Send((int)$id_lang, 'password', Mail::l('Your new admin password'), array('{email}' => $employee->email, '{lastname}' => $employee->lastname, '{firstname}' => $employee->firstname, '{passwd}' => $pwd), $employee->email, $employee->firstname.' '.$employee->lastname))
$confirmation = 'ok';
}
}
+3 -3
View File
@@ -349,7 +349,7 @@ class AdminAddresses extends AdminTab
{
echo '
<label>'.$this->l('Address').' (2):</label>
<label>'.$this->l('Address').' (2)</label>
<div class="margin-form">
<input type="text" size="33" name="address2" value="'.htmlentities($this->getFieldValue($obj, 'address2'), ENT_COMPAT, 'UTF-8').'" />
</div>';
@@ -480,8 +480,8 @@ class AdminAddresses extends AdminTab
$selectedCountry = ($tmp_addr && $tmp_addr->id_country) ? $tmp_addr->id_country :
(int)(Configuration::get('PS_COUNTRY_DEFAULT'));
$inv_adr_fields = AddressFormat::getOrderedAddressFields($selectedCountry);
$dlv_adr_fields = AddressFormat::getOrderedAddressFields($selectedCountry);
$inv_adr_fields = AddressFormat::getOrderedAddressFields($selectedCountry, false, true);
$dlv_adr_fields = AddressFormat::getOrderedAddressFields($selectedCountry, false, true);
$inv_all_fields = array();
$dlv_all_fields = array();
-1
View File
@@ -59,7 +59,6 @@ class AdminAliases extends AdminTab
if (!sizeof($this->_errors))
{
Alias::deleteAliases($search);
foreach ($aliases AS $alias)
{
$obj = new Alias(NULL, trim($alias), trim($search));
+37
View File
@@ -29,6 +29,9 @@ include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php');
class AdminAttachments extends AdminTab
{
private $_productAttachements = array();
public function __construct()
{
$this->table = 'attachment';
@@ -128,4 +131,38 @@ class AdminAttachments extends AdminTab
</fieldset>
</form>';
}
public function getList($id_lang, $orderBy = NULL, $orderWay = NULL, $start = 0, $limit = NULL)
{
parent::getList((int)$id_lang, $orderBy, $orderWay, $start, $limit);
if(sizeof($this->_list))
$this->_productAttachements = Attachment::getProductAttached((int)$id_lang, $this->_list);
}
protected function _displayDeleteLink($token = NULL, $id)
{
global $currentIndex;
$_cacheLang['Delete'] = $this->l('Delete');
$_cacheLang['DeleteItem'] = $this->l('Delete item #', __CLASS__, TRUE, FALSE);
if (isset($this->_productAttachements[$id]))
{
$productList = '';
foreach($this->_productAttachements[$id] as $product)
$productList .= $product.', ';
}
echo '
<script>
function confirmProductAttached(productList)
{
if (confirm(\''.$_cacheLang['DeleteItem'].$id.'\'))
return confirm(\''.$this->l('This attachment is used by the following products:').'\r\n\' + productList);
return false;
}
</script>
<a href="'.$currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'"
onclick="'.(isset($this->_productAttachements[$id]) ? 'return confirmProductAttached(\''.$productList.'\')' : 'return confirm(\''.$_cacheLang['DeleteItem'].$id.' ?'.(!is_null($this->specificConfirmDelete) ? '\r'.rtrim($this->specificConfirmDelete, ', ') : '').'\')' ).'">
<img src="../img/admin/delete.gif" alt="'.$_cacheLang['Delete'].'" title="'.$_cacheLang['Delete'].'" /></a>';
}
}
+1 -1
View File
@@ -241,7 +241,7 @@ class AdminBackup extends AdminTab
if (preg_match('/^([\d]+-[a-z\d]+)\.sql(\.gz|\.bz2)?$/', $file, $matches) == 0)
continue;
$timestamp = (int)($matches[1]);
$date = date('Y-m-d h:i:s', $timestamp);
$date = date('Y-m-d H:i:s', $timestamp);
$age = time() - $timestamp;
if ($age < 3600)
$age = '< 1 '.$this->l('hour');
+9 -1
View File
@@ -131,9 +131,17 @@ class AdminCarriers extends AdminTab
<label>'.$this->l('Zone').'</label>
<div class="margin-form">';
$carrier_zones = $obj->getZones();
$carrier_zones_ids = array();
if (is_array($carrier_zones))
foreach($carrier_zones as $carrier_zone)
$carrier_zones_ids[] = $carrier_zone['id_zone'];
$zones = Zone::getZones(false);
foreach ($zones AS $zone)
echo '<input type="checkbox" id="zone_'.$zone['id_zone'].'" name="zone_'.$zone['id_zone'].'" value="true" '.(Tools::getValue('zone_'.$zone['id_zone'], (is_array($carrier_zones) AND in_array(array('id_carrier' => $obj->id, 'id_zone' => $zone['id_zone'], 'name' => $zone['name'], 'active' => $zone['active']), $carrier_zones))) ? ' checked="checked"' : '').'><label class="t" for="zone_'.$zone['id_zone'].'">&nbsp;<b>'.$zone['name'].'</b></label><br />';
echo '<input type="checkbox" id="zone_'.$zone['id_zone'].'" name="zone_'.$zone['id_zone'].'" value="true" '.
Tools::getValue('zone_'.$zone['id_zone'], (in_array($zone['id_zone'], $carrier_zones_ids) ? ' checked="checked"' : '')).'>
<label class="t" for="zone_'.$zone['id_zone'].'"> <b>'.$zone['name'].'</b></label><br />';
echo '<p>'.$this->l('The zone in which this carrier is to be used').'</p>
</div>
<label>'.$this->l('Group access').'</label>
-18
View File
@@ -111,15 +111,6 @@ class AdminCatalog extends AdminTab
}
$this->attributeGenerator->postProcess();
}
elseif (isset($_GET['imageresize']))
{
if (!isset($this->imageResize))
{
include_once(PS_ADMIN_DIR.'/tabs/AdminImageResize.php');
$this->imageResize = new AdminImageResize();
}
$this->imageResize->postProcess();
}
$this->adminProducts->postProcess($this->token);
}
@@ -158,15 +149,6 @@ class AdminCatalog extends AdminTab
}
$this->attributeGenerator->displayForm();
}
elseif (isset($_GET['imageresize']))
{
if (!isset($this->imageResize))
{
include_once(PS_ADMIN_DIR.'/tabs/AdminImageResize.php');
$this->imageResize = new AdminImageResize();
}
$this->imageResize->displayForm();
}
elseif (!isset($_GET['editImage']))
{
$home = false;
+1 -31
View File
@@ -100,36 +100,6 @@ class AdminCategories extends AdminTab
}
}
}
/* Change object statuts (active, inactive) */
elseif (isset($_GET['status']) AND Tools::getValue($this->identifier))
{
if ($this->tabAccess['edit'] === '1')
{
if (Validate::isLoadedObject($object = $this->loadObject()))
{
if ($object->toggleStatus())
{
$target = '';
if (($id_category = (int)(Tools::getValue('id_category'))) AND Tools::getValue('id_product'))
$target = '&id_category='.(int)($id_category);
else
{
$referrer = Tools::secureReferrer($_SERVER['HTTP_REFERER']);
if (preg_match('/id_category=(\d+)/', $referrer, $matches))
$target = '&id_category='.(int)($matches[1]);
}
Module::hookExec('categoryUpdate');
Tools::redirectAdmin(self::$currentIndex.'&conf=5'.$target.'&token='.Tools::getValue('token'));
}
else
$this->_errors[] = Tools::displayError('An error occurred while updating status.');
}
else
$this->_errors[] = Tools::displayError('An error occurred while updating status for object.').' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
}
else
$this->_errors[] = Tools::displayError('You do not have permission to edit here.');
}
/* Delete object */
elseif (isset($_GET['delete'.$this->table]))
{
@@ -259,7 +229,7 @@ class AdminCategories extends AdminTab
foreach ($this->_languages AS $language)
echo '
<div class="lang_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').'; float: left;">
<textarea name="description_'.$language['id_lang'].'" rows="5" cols="40">'.htmlentities($this->getFieldValue($obj, 'description', (int)($language['id_lang'])), ENT_COMPAT, 'UTF-8').'</textarea>
<textarea name="description_'.$language['id_lang'].'" rows="10" cols="100">'.htmlentities($this->getFieldValue($obj, 'description', (int)($language['id_lang'])), ENT_COMPAT, 'UTF-8').'</textarea>
</div>';
echo ' <p class="clear"></p>
</div>
+1 -1
View File
@@ -83,7 +83,7 @@ class AdminContact extends AdminPreferences
'PS_SHOP_PHONE' => 'phone');
$this->_fieldsShop = array();
$orderedFields = AddressFormat::getOrderedAddressFields(Configuration::get('PS_SHOP_COUNTRY_ID'));
$orderedFields = AddressFormat::getOrderedAddressFields(Configuration::get('PS_SHOP_COUNTRY_ID'), false, true);
foreach($orderedFields as $lineFields)
if (($patterns = explode(' ', $lineFields)))
+19 -7
View File
@@ -129,24 +129,32 @@ class AdminCustomerThreads extends AdminTab
'{messages}' => $output,
'{employee}' => $currentEmployee->firstname.' '.$currentEmployee->lastname,
'{comment}' => stripslashes($_POST['message_forward']));
Mail::Send($context->language->id, 'forward_msg', Mail::l('Fwd: Customer message'), $params,
if (Mail::Send($context->language->id, 'forward_msg', Mail::l('Fwd: Customer message'), $params,
$employee->email, $employee->firstname.' '.$employee->lastname,
$currentEmployee->email, $currentEmployee->firstname.' '.$currentEmployee->lastname);
$currentEmployee->email, $currentEmployee->firstname.' '.$currentEmployee->lastname,
NULL, NULL, _PS_MAIL_DIR_, true))
{
$cm->message = $this->l('Message forwarded to').' '.$employee->firstname.' '.$employee->lastname."\n".$this->l('Comment:').' '.$_POST['message_forward'];
$cm->add();
}
}
elseif (($email = Tools::getValue('email')) AND Validate::isEmail($email))
{
$params = array(
'{messages}' => $output,
'{employee}' => $currentEmployee->firstname.' '.$currentEmployee->lastname,
'{comment}' => stripslashes($_POST['message_forward']));
Mail::Send($context->language->id, 'forward_msg', Mail::l('Fwd: Customer message'), $params,
if (Mail::Send((int)($cookie->id_lang), 'forward_msg', Mail::l('Fwd: Customer message'), $params,
$email, NULL,
$currentEmployee->email, $currentEmployee->firstname.' '.$currentEmployee->lastname);
$currentEmployee->email, $currentEmployee->firstname.' '.$currentEmployee->lastname,
NULL, NULL, _PS_MAIL_DIR_, true))
{
$cm->message = $this->l('Message forwarded to').' '.$email."\n".$this->l('Comment:').' '.$_POST['message_forward'];
$cm->add();
}
}
else
echo '<div class="alert error">'.Tools::displayError('Email invalid.').'</div>';
}
@@ -173,9 +181,13 @@ class AdminCustomerThreads extends AdminTab
'{reply}' => Tools::nl2br(Tools::getValue('reply_message')),
'{link}' => Tools::url($context->link->getPageLink('contact', true), 'id_customer_thread='.(int)($ct->id).'&token='.$ct->token),
);
Mail::Send($ct->id_lang, 'reply_msg', Mail::l('An answer to your message is available'), $params, Tools::getValue('msg_email'), NULL, NULL, NULL, $fileAttachment);
$ct->status = 'closed';
$ct->update();
if (Mail::Send($ct->id_lang, 'reply_msg', Mail::l('An answer to your message is available'),
$params, Tools::getValue('msg_email'), NULL, NULL, NULL, $fileAttachment, NULL,
_PS_MAIL_DIR_, true))
{
$ct->status = 'closed';
$ct->update();
}
Tools::redirectAdmin(self::$currentIndex.'&id_customer_thread='.(int)$id_customer_thread.'&viewcustomer_thread&token='.Tools::getValue('token'));
}
else
+5
View File
@@ -82,6 +82,11 @@ class AdminDb extends AdminPreferences
$tables_engine[$table['Name']] = $table['Engine'];
$engineType = pSQL(Tools::getValue('engineType'));
/* Datas are not saved in database but in config/settings.inc.php */
$settings = array('_MYSQL_ENGINE_' => $engineType);
rewriteSettingsFile(NULL, NULL, $settings);
foreach ($_POST['tablesBox'] AS $table)
{
if ($engineType == $tables_engine[$table])
+2 -2
View File
@@ -81,8 +81,8 @@ class AdminEmails extends AdminPreferences
<fieldset class="width2" style="margin-top: 10px;">
<legend><img src="../img/admin/email.gif" alt="" /> '.$this->l('Test your e-mail configuration').'</legend>
<script type="text/javascript">
var textMsg = "'.$this->l('This is a test message, your server is now available to send email').'";
var textSubject = "'.$this->l('Test message - Prestashop').'";
var textMsg = "'.urlencode($this->l('This is a test message, your server is now available to send email')).'";
var textSubject = "'.urlencode($this->l('Test message - Prestashop')).'";
var textSendOk = "'.$this->l('Mail is sent').'";
var textSendError= "'.$this->l('Error: please check your configuration').'";
var errorMail = "'.$this->l('This email address is wrong!').'";
+8 -1
View File
@@ -62,6 +62,12 @@ class AdminGenerator extends AdminTab
<p>'.$this->l('Enable only if your server allows URL rewriting.').'</p>
</div>
<div class="clear">&nbsp;</div>
<label for="imageCacheControl">'.$this->l('Disable apache multiviews').'</label>
<div class="margin-form">
<input type="checkbox" name="PS_HTACCESS_DISABLE_MULTIVIEWS" id="PS_HTACCESS_CACHE_CONTROL" value="1" '.(Configuration::get('PS_HTACCESS_DISABLE_MULTIVIEWS') == 1 ? 'checked="checked"' : '').' />
<p>'.$this->l('Enable this option only if you have problems with some pages URL rewriting.').'</p>
</div>
<div class="clear">&nbsp;</div>
<label for="specific_configuration">'.$this->l('Specific configuration').'</label>
<div class="margin-form">
<textarea rows="10" class="width3" id="specific_configuration" name="ps_htaccess_specific">'.Configuration::get('PS_HTACCESS_SPECIFIC').'</textarea>
@@ -112,8 +118,9 @@ class AdminGenerator extends AdminTab
{
Configuration::updateValue('PS_HTACCESS_CACHE_CONTROL', (int)Tools::getValue('PS_HTACCESS_CACHE_CONTROL'));
Configuration::updateValue('PS_REWRITING_SETTINGS', (int)Tools::getValue('PS_REWRITING_SETTINGS'));
Configuration::updateValue('PS_HTACCESS_DISABLE_MULTIVIEWS', (int)Tools::getValue('PS_HTACCESS_DISABLE_MULTIVIEWS'));
Configuration::updateValue('PS_HTACCESS_SPECIFIC', Tools::getValue('ps_htaccess_specific'), true);
if (Tools::generateHtaccess($this->_htFile, Configuration::get('PS_REWRITING_SETTINGS'), Configuration::get('PS_HTACCESS_CACHE_CONTROL'), Tools::getValue('ps_htaccess_specific')))
if (Tools::generateHtaccess($this->_htFile, Configuration::get('PS_REWRITING_SETTINGS'), Configuration::get('PS_HTACCESS_CACHE_CONTROL'), Tools::getValue('ps_htaccess_specific'), Tools::getValue('PS_HTACCESS_DISABLE_MULTIVIEWS')))
Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token);
$this->_errors[] = $this->l('Cannot write into file:').' <b>'.$this->_htFile.'</b><br />'.$this->l('Please check write permissions.');
}
+4 -2
View File
@@ -207,7 +207,7 @@ class AdminGroups extends AdminTab
$customers = $obj->getCustomers(false, $from, $customersPerPage);
echo '<tr>
echo '<table><tr>
<form method="post" action="'.Tools::htmlentitiesUTF8($_SERVER['REQUEST_URI']).'">
<td style="vertical-align: bottom;"><span style="float: left; height:30px">';
@@ -235,7 +235,9 @@ class AdminGroups extends AdminTab
echo ' </select> / '.$nbCustomers.' result(s)
</span><span class="clear"></span></td>
</form>
</tr>';
</tr>
</table>
<div class="clear"></div>';
// Pagination End
echo '<table cellspacing="0" cellpadding="0" class="table widthfull">
+9 -2
View File
@@ -94,6 +94,7 @@ class AdminHome extends AdminTab
if ($rewrite + $htaccessOptimized + $smartyOptimized + $cccOptimized + $shopEnabled + $htaccessAfterUpdate + $indexRebuiltAfterUpdate != 14)
{
echo '
<div class="admin-box1">
<h5>'.$this->l('A good beginning...')
@@ -146,6 +147,8 @@ class AdminHome extends AdminTab
</ul>
</div>';
}
}
public function display()
{
$context = Context::getContext();
@@ -159,9 +162,13 @@ class AdminHome extends AdminTab
<h1>'.$this->l('Dashboard').'</h1>
<hr style="background-color: #812143;color: #812143;" />
<br />';
if (@ini_get('allow_url_fopen') AND $update = checkPSVersion())
if (@ini_get('allow_url_fopen'))
{
$upgrade = new Upgrader();
if($update = $upgrade->checkPSVersion())
echo '<div class="warning warn" style="margin-bottom:30px;"><h3>'.$this->l('New PrestaShop version available').' : <a style="text-decoration: underline;" href="'.$update['link'].'" target="_blank">'.$this->l('Download').'&nbsp;'.$update['name'].'</a> !</h3></div>';
elseif (!@ini_get('allow_url_fopen'))
}
else
{
echo '<p>'.$this->l('Update notification unavailable').'</p>';
echo '<p>&nbsp;</p>';
-99
View File
@@ -1,99 +0,0 @@
<?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: 7310 $
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
class AdminImageResize extends AdminTab
{
public function postProcess()
{
$context = Context::getContext();
if (isset($_POST['resize']))
{
$imagesTypes = ImageType::getImagesTypes('products');
$sourceFile['tmp_name'] = _PS_IMG_DIR_.'/p/'.Tools::getValue('id_product').'-'.Tools::getValue('id_image').'.jpg';
foreach ($imagesTypes AS $k => $imageType)
if (!imageCut
($sourceFile,
_PS_IMG_DIR_.'p/'.Tools::getValue('id_product').'-'.Tools::getValue('id_image').'-'.stripslashes($imageType['name']).'.jpg',
$imageType['width'],
$imageType['height'],
'jpg',
$_POST[$imageType['id_image_type'].'_x1'],
$_POST[$imageType['id_image_type'].'_y1']))
$this->_errors = Tools::displayError('An error occurred while copying image.').' '.stripslashes($imageType['name']);
// Save and stay on same form
if (Tools::getValue('saveandstay') == 'on')
Tools::redirectAdmin(self::$currentIndex.'&id_product='.Tools::getValue('id_product').'&id_category='.(int)(Tools::getValue('id_category')).'&addproduct&conf=4&tabs=1&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)$context->employee->id));
// Default behavior (save and back)
Tools::redirectAdmin(self::$currentIndex.'&id_category='.(int)(Tools::getValue('id_category')).'&conf='.(int)(Tools::getValue('conf')).'&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)$context->employee->id));
} else
parent::postProcess();
}
public function displayForm($isMainTab = true)
{
$context = Context::getContext();
parent::displayForm();
$imagesTypes = ImageType::getImagesTypes();
$imageObj = new Image(Tools::getValue('id_image'));
echo '
<script type="text/javascript" src="../js/cropper/prototype.js"></script>
<script type="text/javascript" src="../js/cropper/scriptaculous.js"></script>
<script type="text/javascript" src="../js/cropper/builder.js"></script>
<script type="text/javascript" src="../js/cropper/dragdrop.js"></script>
<script type="text/javascript" src="../js/cropper/cropper.js"></script>
<script type="text/javascript" src="../js/cropper/loader.js"></script>
<form enctype="multipart/form-data" method="post" action="'.self::$currentIndex.'&imageresize&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)$context->employee->id).'">
<input type="hidden" name="id_product" value="'.Tools::getValue('id_product').'" />
<input type="hidden" name="id_category" value="'.Tools::getValue('id_category').'" />
<input type="hidden" name="saveandstay" value="'.Tools::getValue('submitAddAndStay').'" />
<input type="hidden" name="conf" value="'.(Tools::getValue('toconf')).'" />
<input type="hidden" name="imageresize" value="imageresize" />
<input type="hidden" name="id_image" value="'.Tools::getValue('id_image').'" />
<fieldset>
<legend><img src="../img/admin/picture.gif" />'.$this->l('Image resize').'</legend>
'.$this->l('Using your mouse, define which area of the image is to be used for generating each type of thumbnail.').'
<br /><br />
<img src="'._THEME_PROD_DIR_.$imageObj->getExistingImgPath().'.jpg" id="testImage">
<label for="imageChoice">'.$this->l('Thumbnails format').'</label>
<div class="margin-form"">
<select name="imageChoice" id="imageChoice">';
foreach ($imagesTypes AS $type)
echo '<option value="../img/p/'.$imageObj->getExistingImgPath().'.jpg|'.$type['width'].'|'.$type['height'].'|'.$type['id_image_type'].'">'.$type['name'].'</option>';
echo ' </select>
<input type="submit" class="button" style="margin-left : 40px;" name="resize" value="'.$this->l(' Save all ').'" />
</div>';
foreach ($imagesTypes AS $type)
echo '
<input type="hidden" name="'.$type['id_image_type'].'_x1" id="'.$type['id_image_type'].'_x1" value="0" />
<input type="hidden" name="'.$type['id_image_type'].'_y1" id="'.$type['id_image_type'].'_y1" value="0" />
<input type="hidden" name="'.$type['id_image_type'].'_x2" id="'.$type['id_image_type'].'_x2" value="0" />
<input type="hidden" name="'.$type['id_image_type'].'_y2" id="'.$type['id_image_type'].'_y2" value="0" />';
echo ' </fieldset>
</form>';
}
}
+104 -13
View File
@@ -50,6 +50,7 @@ class AdminImages extends AdminTab
public function displayList()
{
parent::displayList();
$this->displayImagePreferences();
$this->displayRegenerate();
$this->displayMoveImages();
}
@@ -66,7 +67,34 @@ class AdminImages extends AdminTab
else
$this->_errors[] = Tools::displayError('You do not have permission to edit here.');
}elseif (Tools::getValue('submitMoveImages'.$this->table))
$this->_moveImagesToNewFileSystem();
{
if ($this->tabAccess['edit'] === '1')
{
if($this->_moveImagesToNewFileSystem())
Tools::redirectAdmin($currentIndex.'&conf=25'.'&token='.$this->token);
}
else
$this->_errors[] = Tools::displayError('You do not have permission to edit here.');
}elseif (Tools::getValue('submitImagePreferences'))
{
if ($this->tabAccess['edit'] === '1')
{
if ((int)Tools::getValue('PS_JPEG_QUALITY') < 0
|| (int)Tools::getValue('PS_JPEG_QUALITY') > 100)
$this->_errors[] = Tools::displayError('Incorrect value for JPEG image quality.');
elseif ((int)Tools::getValue('PS_PNG_QUALITY') < 0
|| (int)Tools::getValue('PS_PNG_QUALITY') > 9)
$this->_errors[] = Tools::displayError('Incorrect value for PNG image quality.');
elseif (!Configuration::updateValue('PS_IMAGE_QUALITY', Tools::getValue('PS_IMAGE_QUALITY'))
|| !Configuration::updateValue('PS_JPEG_QUALITY', Tools::getValue('PS_JPEG_QUALITY'))
|| !Configuration::updateValue('PS_PNG_QUALITY', Tools::getValue('PS_PNG_QUALITY')))
$this->_errors[] = Tools::displayError('Unknown error.');
else
Tools::redirectAdmin($currentIndex.'&token='.Tools::getValue('token').'&conf=4');
}
else
$this->_errors[] = Tools::displayError('You do not have permission to edit here.');
}
else
parent::postProcess();
}
@@ -177,11 +205,13 @@ class AdminImages extends AdminTab
);
echo '
<h2 class="space">'.$this->l('Regenerate thumbnails').'</h2>
'.$this->l('Regenerates thumbnails for all existing product images').'.<br /><br />';
'.$this->l('Regenerates thumbnails for all existing product images').'.<br /><br /><div class="width4">';
$this->displayWarning($this->l('Please be patient, as this can take several minutes').'<br />'.$this->l('Be careful! Manually generated thumbnails will be erased by automatically generated thumbnails.'));
echo '
echo '</div>
<form action="'.self::$currentIndex.'&token='.$this->token.'" method="post">
<fieldset class="width2">
<fieldset class="width4">
<legend><img src="../img/admin/picture.gif" /> '.$this->l('Regenerate thumbnails').'</legend><br />
<label>'.$this->l('Select image').'</label>
<div class="margin-form">
@@ -229,6 +259,8 @@ class AdminImages extends AdminTab
*/
private function _deleteOldImages($dir, $type, $product = false)
{
if (!is_dir($dir))
return false;
$toDel = scandir($dir);
foreach ($toDel AS $d)
foreach ($type AS $imageType)
@@ -260,6 +292,8 @@ class AdminImages extends AdminTab
// Regenerate images
private function _regenerateNewImages($dir, $type, $productsImages = false)
{
if (!is_dir($dir))
return false;
$errors = false;
$toRegen = scandir($dir);
if (!$productsImages)
@@ -331,17 +365,19 @@ class AdminImages extends AdminTab
{
$productsImages = Image::getAllImages();
foreach ($productsImages AS $k => $image)
{
$imageObj = new Image($image['id_image']);
if (file_exists($dir.$imageObj->getExistingImgPath().'.jpg'))
foreach ($result AS $k => $module)
{
if ($moduleInstance = Module::getInstanceByName($module['name']) AND is_callable(array($moduleInstance, 'hookwatermark')))
call_user_func(array($moduleInstance, 'hookwatermark'), array('id_image' => $image['id_image'], 'id_product' => $image['id_product']));
call_user_func(array($moduleInstance, 'hookwatermark'), array('id_image' => $imageObj->id, 'id_product' => $imageObj->id_product));
if (time() - $this->start_time > $this->max_execution_time - 4) // stop 4 seconds before the tiemout, just enough time to process the end of the page on a slow server
return 'timeout';
}
}
}
}
private function _regenerateThumbnails($type = 'all', $deleteOldImages = false)
{
@@ -401,12 +437,18 @@ class AdminImages extends AdminTab
*/
public function displayMoveImages()
{
$safe_mode = ini_get('safe_mode');
echo '
<br /><h2 class="space">'.$this->l('Move images').'</h2>'.
$this->l('A new storage system for product images is now used by PrestaShop. It offers better performance if your shop has a very large number of products.').'<br />'.
'<br />
'<br />';
if($safe_mode)
echo $this->displayWarning('PrestaShop has detected that your server configuration is not compatible with the new storage system (directive "safe_mode" is activated). You should continue to use the actual system.');
else
echo '
<form action="'.self::$currentIndex.'&token='.$this->token.'" method="post">
<fieldset class="width3">
<fieldset class="width4">
<legend><img src="../img/admin/picture.gif" /> '.$this->l('Move images').'</legend><br />'.
$this->l('You can choose to keep your images stored in the previous system - nothing wrong with that.').'<br />'.
$this->l('You can also decide to move your images to the new storage system: in this case, click on the "Move images" button below. Please be patient, as this can take several minutes.').
@@ -425,11 +467,60 @@ class AdminImages extends AdminTab
*/
private function _moveImagesToNewFileSystem()
{
ini_set('max_execution_time', $this->max_execution_time); // ini_set may be disabled, we need the real value
$this->max_execution_time = (int)ini_get('max_execution_time');
$result = Image::moveToNewFileSystem($this->max_execution_time);
if ($result === 'timeout')
$this->_errors[] = Tools::displayError('Not all images have been moved, server timed out before finishing. Click on \"Move images\" again to resume moving images');
Tools::redirectAdmin(self::$currentIndex.'&conf=25'.'&token='.$this->token);
if (!Image::testFileSystem())
$this->_errors[] = Tools::displayError('Error: your server configuration is not compatible with the new image system. No images were moved');
else
{
ini_set('max_execution_time', $this->max_execution_time); // ini_set may be disabled, we need the real value
$this->max_execution_time = (int)ini_get('max_execution_time');
$result = Image::moveToNewFileSystem($this->max_execution_time);
if ($result === 'timeout')
$this->_errors[] = Tools::displayError('Not all images have been moved, server timed out before finishing. Click on \"Move images\" again to resume moving images');
else if ($result === false)
$this->_errors[] = Tools::displayError('Error: some or all images could not be moved.');
}
return (sizeof($this->_errors) > 0 ? false : true);
}
/**
* Display the block for moving images
*/
public function displayImagePreferences()
{
global $currentIndex;
echo '<br />
<form action="'.$currentIndex.'&token='.$this->token.'" method="post">
<fieldset class="width4">
<legend><img src="../img/admin/picture.gif" /> '.$this->l('Images').'</legend>'.'
<p>'.$this->l('JPEG images have a small file size and standard quality. PNG images have a bigger file size, a higher quality and support transparency. Note that in all cases the image files will have the .jpg extension.').'
<br /><br />'.$this->l('WARNING: This feature may not be compatible with your theme or with some modules. In particular, PNG mode is not compatible with the Watermark module. If you encounter any issue, turn it off by selecting "Use JPEG".').'</p>
<br />
<label>'.$this->l('Image quality').' </label>
<div class="margin-form">
<input type="radio" value="jpg" name="PS_IMAGE_QUALITY" id="PS_IMAGE_QUALITY_0" '.(Configuration::get('PS_IMAGE_QUALITY') == 'jpg' ? 'checked="checked"' : '').' />
<label class="t" for="PS_IMAGE_QUALITY_0">'.$this->l('Use JPEG').'</label>
<br />
<input type="radio" value="png" name="PS_IMAGE_QUALITY" id="PS_IMAGE_QUALITY_1" '.(Configuration::get('PS_IMAGE_QUALITY') == 'png' ? 'checked="checked"' : '').' />
<label class="t" for="PS_IMAGE_QUALITY_1">'.$this->l('Use PNG only if the base image is in PNG format').'</label>
<br />
<input type="radio" value="png_all" name="PS_IMAGE_QUALITY" id="PS_IMAGE_QUALITY_2" '.(Configuration::get('PS_IMAGE_QUALITY') == 'png_all' ? 'checked="checked"' : '').' />
<label class="t" for="PS_IMAGE_QUALITY_2">'.$this->l('Use PNG for all images').'</label>
</div>
<br />
<label for="PS_JPEG_QUALITY">'.$this->l('JPEG quality').'</label>
<div class="margin-form">
<input type="text" name="PS_JPEG_QUALITY" id="PS_JPEG_QUALITY" value="'.(int)Configuration::get('PS_JPEG_QUALITY').'" size="3" />
<p>'.$this->l('Ranges from 0 (worst quality, smallest file) to 100 (best quality, biggest file)').'</p>
</div>
<label for="PS_PNG_QUALITY">'.$this->l('PNG quality').'</label>
<div class="margin-form">
<input type="text" name="PS_PNG_QUALITY" id="PS_PNG_QUALITY" value="'.(int)Configuration::get('PS_PNG_QUALITY').'" size="3" />
<p>'.$this->l('Ranges from 9 (worst quality, smallest file) to 0 (best quality, biggest file)').'</p>
</div>
<div class="margin-form">
<input type="submit" value="'.$this->l(' Save ').'" name="submitImagePreferences" class="button" />
</div>
</fieldset>
</form>';
}
}
+101 -42
View File
@@ -27,7 +27,8 @@
include_once(PS_ADMIN_DIR.'/../images.inc.php');
@ini_set('max_execution_time', 0);
define('MAX_LINE_SIZE', 4096);
// No max line limit since the lines can be more than 4096. Performance impact is not significant.
define('MAX_LINE_SIZE', 0);
define('UNFRIENDLY_ERROR', false); // Used for validatefields diying without user friendly error or not
@@ -93,7 +94,10 @@ class AdminImport extends AdminTab
'ecotax' => array('label' => $this->l('Ecotax')),
'quantity' => array('label' => $this->l('Quantity')),
'weight' => array('label' => $this->l('Weight')),
'default_on' => array('label' => $this->l('Default'))
'default_on' => array('label' => $this->l('Default')),
'image_position' => array('label' => $this->l('Image position'),
'help' => $this->l('Position of the product image to use for this combination. If you use this field, leave image URL empty.')),
'image_url' => array('label' => $this->l('Image URL')),
);
self::$default_values = array(
@@ -164,6 +168,9 @@ class AdminImport extends AdminTab
'link_rewrite' => array('label' => $this->l('URL rewritten')),
'available_now' => array('label' => $this->l('Text when in-stock')),
'available_later' => array('label' => $this->l('Text if back-order allowed')),
'available_for_order' => array('label' => $this->l('Available for order')),
'date_add' => array('label' => $this->l('Date add product')),
'show_price' => array('label' => $this->l('Show price')),
'image' => array('label' => $this->l('Image URLs (x,y,z...)')),
'delete_existing_images' => array(
'label' => $this->l('Delete existing images (0 = no, 1 = yes)'),
@@ -190,6 +197,8 @@ class AdminImport extends AdminTab
'online_only' => 0,
'condition' => 'new',
'shop' => Configuration::get('PS_SHOP_DEFAULT'),
'date_add' => date('Y-m-d H:i:s'),
'condition' => 'new',
);
break;
@@ -286,6 +295,15 @@ class AdminImport extends AdminTab
parent::__construct();
}
private static function rewindBomAware($handle)
{
// A rewind wrapper that skip BOM signature wrongly
rewind($handle);
if (($bom = fread($handle,3)) != "\xEF\xBB\xBF") {
rewind($handle);
}
}
private static function getBoolean($field)
{
return (boolean)$field;
@@ -300,11 +318,18 @@ class AdminImport extends AdminTab
private static function split($field)
{
if (empty($field))
return array();
$separator = ((is_null(Tools::getValue('multiple_value_separator')) OR trim(Tools::getValue('multiple_value_separator')) == '' ) ? ',' : Tools::getValue('multiple_value_separator'));
$tab = explode($separator, $field);
$res = array_map('strval', $tab);
$res = array_map('trim', $tab);
$temp = tmpfile();
fwrite($temp,$field);
rewind($temp);
$tab = fgetcsv($temp, MAX_LINE_SIZE, $separator);
fclose($temp);
if (empty($tab) || (!is_array($tab)))
return array();
return $tab;
}
private static function createMultiLangField($field)
@@ -409,22 +434,7 @@ class AdminImport extends AdminTab
return true;
}
public static function fgetcsv($handle, $lenght, $delimiter)
{
if (feof($handle))
return false;
$line = fgets($handle, $lenght);
if ($line === false)
return false;
$tmpTab = explode($delimiter, $line);
foreach ($tmpTab AS &$row)
if (preg_match ('/^".*"$/Uims',$row))
$row = trim($row, '"');
return $tmpTab;
}
static public function array_walk(&$array, $funcname, &$user_data = false)
public static function array_walk(&$array, $funcname, &$user_data = false)
{
if (!is_callable($funcname)) return false;
@@ -434,8 +444,6 @@ class AdminImport extends AdminTab
return true;
}
/**
* copyImg copy an image located in $url and save it in a path
* according to $entity->$id_entity .
@@ -457,8 +465,7 @@ class AdminImport extends AdminTab
default:
case 'products':
$imageObj = new Image($id_image);
$imageObj->createImgFolder();
$path = _PS_PROD_IMG_DIR_.$imageObj->getImgPath();
$path = $imageObj->getPathForCreation();
break;
case 'categories':
$path = _PS_CAT_IMG_DIR_.(int)($id_entity);
@@ -609,16 +616,14 @@ class AdminImport extends AdminTab
$product = new Product();
self::setEntityDefaultValues($product);
self::array_walk($info, array('AdminImport', 'fillInfo'), $product);
$trg_id = (int)$product->id_tax_rules_group;
if ($product->id_tax_rules_group == 0 || !Validate::isLoadedObject(new TaxRulesGroup($trg_id)))
$this->_addProductWarning('id_tax_rules_group', $product->id_tax_rules_group, Tools::displayError('Invalid tax rule group ID, you first need a group with this ID.'));
else
if ((int)$product->id_tax_rules_group != 0)
{
if(Validate::isLoadedObject(new TaxRulesGroup($product->id_tax_rules_group)))
$product->tax_rate = TaxRulesGroup::getTaxesRate((int)$product->id_tax_rules_group, Configuration::get('PS_COUNTRY_DEFAULT'), 0, 0);
else
$this->_addProductWarning('id_tax_rules_group', $product->id_tax_rules_group, Tools::displayError('Invalid tax rule group ID, you first need a group with this ID.'));
}
if (isset($product->manufacturer) AND is_numeric($product->manufacturer) AND Manufacturer::manufacturerExists((int)($product->manufacturer)))
$product->id_manufacturer = (int)($product->manufacturer);
elseif (isset($product->manufacturer) AND is_string($product->manufacturer) AND !empty($product->manufacturer))
@@ -724,6 +729,7 @@ class AdminImport extends AdminTab
$product->id_category_default = isset($product->id_category[0]) ? (int)($product->id_category[0]) : '';
$link_rewrite = (is_array($product->link_rewrite) && count($product->link_rewrite)) ? $product->link_rewrite[$defaultLanguageId] : '';
$valid_link = Validate::isLinkRewrite($link_rewrite);
if ((isset($product->link_rewrite[$defaultLanguageId]) AND empty($product->link_rewrite[$defaultLanguageId])) OR !$valid_link)
@@ -756,8 +762,13 @@ class AdminImport extends AdminTab
}
// If no id_product or update failed
if (!$res)
{
if (isset($product->date_add) && $product->date_add != '')
$res = $product->add(false);
else
$res = $product->add();
}
}
// If both failed, mysql error
if (!$res)
{
@@ -889,6 +900,7 @@ class AdminImport extends AdminTab
public function attributeImport()
{
global $cookie;
$defaultLanguage = Configuration::get('PS_LANG_DEFAULT');
$groups = array();
foreach (AttributeGroup::getAttributesGroups($defaultLanguage) AS $group)
@@ -909,8 +921,47 @@ class AdminImport extends AdminTab
$info = array_map('trim', $info);
self::setDefaultValues($info);
$product = new Product((int)($info['id_product']), false, $defaultLanguage);
$id_product_attribute = $product->addProductAttribute((float)($info['price']), (float)($info['weight']), 0, (float)($info['ecotax']), (int)($info['quantity']), null, strval($info['reference']), strval($info['supplier_reference']), strval($info['ean13']), (int)($info['default_on']), strval($info['upc']));
$id_image = null;
if (isset($info['image_url']) && $info['image_url'])
{
$productHasImages = (bool)Image::getImages((int)($cookie->id_lang), (int)($product->id));
$url = $info['image_url'];
$image = new Image();
$image->id_product = (int)($product->id);
$image->position = Image::getHighestPosition($product->id) + 1;
$image->cover = (!$productHasImages) ? true : false;
$image->legend = self::createMultiLangField($product->name);
if (($fieldError = $image->validateFields(UNFRIENDLY_ERROR, true)) === true AND ($langFieldError = $image->validateFieldsLang(UNFRIENDLY_ERROR, true)) === true AND $image->add())
{
if (!self::copyImg($product->id, $image->id, $url))
$this->_warnings[] = Tools::displayError('Error copying image: ').$url;
else
$id_image = array($image->id);
}
else
{
$this->_warnings[] = $image->legend[$defaultLanguageId].(isset($image->id_product) ? ' ('.$image->id_product.')' : '').' '.Tools::displayError('Cannot be saved');
$this->_errors[] = ($fieldError !== true ? $fieldError : '').($langFieldError !== true ? $langFieldError : '').mysql_error();
}
} elseif (isset($info['image_position']) && $info['image_position'])
{
$images = $product->getImages($defaultLanguage);
if ($images)
foreach ($images as $row)
if($row['position'] == (int)$info['image_position'])
{
$id_image = array($row['id_image']);
break;
}
if (!$id_image)
$this->_warnings[] = Tools::displayError('No image found for combination with id_product = '.$product->id.' and image position = '.(int)$info['image_position'].'.');
}
$id_product_attribute = $product->addProductAttribute((float)($info['price']), (float)($info['weight']), 0, (float)($info['ecotax']), (int)($info['quantity']), $id_image, strval($info['reference']), strval($info['supplier_reference']), strval($info['ean13']), (int)($info['default_on']), strval($info['upc']));
foreach (explode($fsep, $info['options']) as $option)
{
list($group, $attribute) = array_map('trim', explode(':', $option));
@@ -1291,8 +1342,6 @@ class AdminImport extends AdminTab
if (preg_match('/^\..*|index\.php/i', $filename))
unset($filesToImport[$k]);
unset($filename);
if (sizeof($filesToImport))
{
echo '
<div class="space">
<form id="preview_import" action="'.self::$currentIndex.'&token='.$this->token.'" method="post" style="display:inline" enctype="multipart/form-data" class="clear" onsubmit="if ($(\'#truncate\').get(0).checked) {if (confirm(\''.$this->l('Are you sure you want to delete', __CLASS__, true, false).'\' + \' \' + $(\'#entity > option:selected\').text().toLowerCase() + \''.$this->l('?', __CLASS__, true, false).'\')){this.submit();} else {return false;}}">
@@ -1309,7 +1358,10 @@ class AdminImport extends AdminTab
echo'>'.$entity.'</option>';
}
echo ' </select>
</div>
</div>';
if (sizeof($filesToImport))
{
echo '
<label class="clear">'.$this->l('Select your .CSV file:').' </label>
<div class="margin-form">
<select name="csv">';
@@ -1346,6 +1398,16 @@ class AdminImport extends AdminTab
<div>
'.$this->l('Note that the category import does not support categories of the same name').'
</div>
';
}
else
echo '
<div class="warn">
'.$this->l('No CSV file is available, please upload one file above.').'<br /><br />
'.$this->l('You can get many informations about CSV import at:').' <a href="http://www.prestashop.com/wiki/Troubleshooting_6/" target="_blank">http://www.prestashop.com/wiki/Troubleshooting_6/</a><br /><br />
'.$this->l('More about CSV format at: ').' <a href="http://en.wikipedia.org/wiki/Comma-separated_values" target="_blank">http://en.wikipedia.org/wiki/Comma-separated_values</a>
</div>';
echo '
</fieldset>
</form>
<fieldset style="display: inline; float: right; margin-left: 20px;">
@@ -1380,7 +1442,6 @@ class AdminImport extends AdminTab
if (Tools::getValue('entity'))
echo' <script type="text/javascript">$("select#entity").change();</script>';
}
}
public function utf8_encode_array($array)
{
@@ -1396,7 +1457,7 @@ class AdminImport extends AdminTab
private function getNbrColumn($handle, $glue)
{
$tmp = fgetcsv($handle, MAX_LINE_SIZE, $glue);
fseek($handle, 0);
self::rewindBomAware($handle);
return sizeof($tmp);
}
@@ -1415,14 +1476,12 @@ class AdminImport extends AdminTab
{
$handle = fopen(dirname(__FILE__).'/../import/'.strval(preg_replace('/\.{2,}/', '.',Tools::getValue('csv'))), 'r');
/* No BOM allowed */
$bom = fread($handle, 3);
if ($bom != '\xEF\xBB\xBF')
rewind($handle);
if (!$handle)
die(Tools::displayError('Cannot read the CSV file'));
self::rewindBomAware($handle);
for ($i = 0; $i < (int)(Tools::getValue('skip')); ++$i)
$line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator', ';'));
return $handle;
@@ -1468,7 +1527,7 @@ class AdminImport extends AdminTab
echo '</tr>';
}
echo '</table>';
fseek($handle, 0);
self::rewindBomAware($handle);
}
public function displayCSV()
+8
View File
@@ -350,6 +350,14 @@ class AdminLanguages extends AdminTab
<input type="file" name="no-picture" /> <sup>*</sup>
<p>'.$this->l('Image displayed when "no picture found"').'</p>
</div>
<label>'.$this->l('Is RTL language:').' </label>
<div class="margin-form">
<input type="radio" name="is_rtl" id="is_rtl_on" value="1" '.(($this->getFieldValue($obj, 'is_rtl')) ? 'checked="checked" ' : '').'/>
<label class="t" for="is_rtl_on"> <img src="../img/admin/enabled.gif" alt="'.$this->l('Enabled').'" title="'.$this->l('Yes').'" /></label>
<input type="radio" name="is_rtl" id="active_off" value="0" '.((!$this->getFieldValue($obj, 'is_rtl')) ? 'checked="checked" ' : '').'/>
<label class="t" for="is_rtl_off"> <img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('No').'" /></label>
<p>'.$this->l('To active if this language is a right to left language').' '.$this->l('(Experimental: your theme must be compliant with RTL language)').'</p>
</div>
<label>'.$this->l('Status:').' </label>
<div class="margin-form">
<input type="radio" name="active" id="active_on" value="1" '.((!$obj->id OR $this->getFieldValue($obj, 'active')) ? 'checked="checked" ' : '').'/>
+6 -2
View File
@@ -93,9 +93,13 @@ class AdminLocalization extends AdminPreferences
<label>'.$this->l('Localization pack you want to import:').'</label>
<div class="margin-form">
<select id="iso_localization_pack" name="iso_localization_pack">';
$localization_packs = @simplexml_load_file('http://www.prestashop.com/rss/localization.xml');
$localization_packs = Tools::simplexml_load_file('http://www.prestashop.com/rss/localization.xml');
if (!$localization_packs)
$localization_packs = simplexml_load_file(dirname(__FILE__).'/../../localization/localization.xml');
{
$localizationFile = dirname(__FILE__).'/../../localization/localization.xml';
if (file_exists($localizationFile))
$localization_packs = simplexml_load_file($localizationFile);
}
if ($localization_packs)
foreach($localization_packs->pack as $pack)
echo '<option value="'.$pack->iso.'">'.$pack->name.'</option>';
+1
View File
@@ -46,6 +46,7 @@ class AdminManufacturers extends AdminTab
$countries = Country::getCountries($context->language->id);
foreach ($countries AS $country)
$this->countriesArray[$country['id_country']] = $country['name'];
$this->fieldsDisplayAddresses = array(
'id_address' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
'm!manufacturer_name' => array('title' => $this->l('Manufacturer'), 'width' => 100),
+7 -6
View File
@@ -747,9 +747,9 @@ class AdminModules extends AdminTab
}
return false;
});
'.(!$goto ? '': '$(\'#'.$goto.'_content\').slideToggle( function (){
'.(!$goto ? '': 'if ($(\'#'.$goto.'_content\').length > 0) $(\'#'.$goto.'_content\').slideToggle( function (){
$(\'#'.$goto.'_img\').attr(\'src\', \'../img/admin/less.png\');
'.(!$goto ? '' : '$.scrollTo($("#modgo_'.Tools::getValue('module_name').'"), 300 ,
'.(!$goto ? '' : 'if ($("#modgo_'.Tools::getValue('module_name').'").length > 0) $.scrollTo($("#modgo_'.Tools::getValue('module_name').'"), 300 ,
{onAfter:function(){
$("#modgo_'.Tools::getValue('module_name').'").fadeTo(100, 0, function (){
$(this).fadeTo(100, 0, function (){
@@ -875,18 +875,19 @@ class AdminModules extends AdminTab
$return = '';
$href = self::$currentIndex.'&token='.$this->token.'&module_name='.
urlencode($module->name).'&tab_module='.$module->tab;
if ($module->id)
$return .= '<a class="action_module" '.($module->active && method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('desactive', $href).'"' : '').' href="'.self::$currentIndex.'&token='.$this->token.'&module_name='.urlencode($module->name).'&'.($module->active ? 'enable=0' : 'enable=1').'&tab_module='.$module->tab.'&module_name='.urlencode($module->name).'" '.((Tools::isMultiShopActivated()) ? 'title="'.htmlspecialchars($module->active ? $this->l('Disable this module') : $this->l('Enable this module for all shops')).'"' : '').'>'.($module->active ? $this->l('Disable') : $this->l('Enable')).'</a>&nbsp;&nbsp;';
if ($module->id AND $module->active)
$return .= '<a class="action_module" '.(method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('reset', $href).'"' : '').' href="'.self::$currentIndex.'&token='.$this->token.'&module_name='.urlencode($module->name).'&reset&tab_module='.$module->tab.'&module_name='.urlencode($module->name).'">'.$this->l('Reset').'</a>&nbsp;&nbsp;';
if ($module->id AND (method_exists($module, 'getContent') OR (isset($module->is_configurable) AND $module->is_configurable) OR Tools::isMultiShopActivated()))
$return .= '<a class="action_module" '.(method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('configure', $href).'"' : '').' href="'.self::$currentIndex.'&configure='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.urlencode($module->name).'">'.$this->l('Configure').'</a>&nbsp;&nbsp;';
$return .= '<a class="action_module" '.(method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('delete', $href).'"' : '').' onclick="return confirm(\''.$this->l('This action will permanently remove the module from the server. Are you sure you want to do this ?').'\');" href="'.self::$currentIndex.'&deleteModule='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.urlencode($module->name).'">'.$this->l('Delete').'</a>&nbsp;&nbsp;';
$hrefDelete = self::$currentIndex.'&deleteModule='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.urlencode($module->name);
$return .= '<a class="action_module" '.(method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('delete', $hrefDelete).'"' : '').' onclick="return confirm(\''.$this->l('This action will permanently remove the module from the server. Are you sure you want to do this ?').'\');" href="'.$hrefDelete.'">'.$this->l('Delete').'</a>&nbsp;&nbsp;';
return $return;
}
+17 -10
View File
@@ -96,7 +96,9 @@ class AdminOrders extends AdminTab
'{lastname}' => $customer->lastname,
'{id_order}' => (int)($order->id)
);
@Mail::Send((int)($order->id_lang), 'in_transit', Mail::l('Package in transit'), $templateVars, $customer->email, $customer->firstname.' '.$customer->lastname);
@Mail::Send((int)($order->id_lang), 'in_transit', Mail::l('Package in transit'), $templateVars,
$customer->email, $customer->firstname.' '.$customer->lastname, NULL, NULL, NULL, NULL,
_PS_MAIL_DIR_, true);
}
}
else
@@ -120,13 +122,13 @@ class AdminOrders extends AdminTab
$order = new Order((int)$order->id);
$carrier = new Carrier((int)($order->id_carrier), (int)($order->id_lang));
$templateVars = array();
if ($history->id_order_state == _PS_OS_SHIPPING_ AND $order->shipping_number)
if ($history->id_order_state == Configuration::get('PS_OS_SHIPPING') AND $order->shipping_number)
$templateVars = array('{followup}' => str_replace('@', $order->shipping_number, $carrier->url));
elseif ($history->id_order_state == _PS_OS_CHEQUE_)
elseif ($history->id_order_state == Configuration::get('PS_OS_CHEQUE'))
$templateVars = array(
'{cheque_name}' => (Configuration::get('CHEQUE_NAME') ? Configuration::get('CHEQUE_NAME') : ''),
'{cheque_address_html}' => (Configuration::get('CHEQUE_ADDRESS') ? nl2br(Configuration::get('CHEQUE_ADDRESS')) : ''));
elseif ($history->id_order_state == _PS_OS_BANKWIRE_)
elseif ($history->id_order_state == Configuration::get('PS_OS_BANKWIRE'))
$templateVars = array(
'{bankwire_owner}' => (Configuration::get('BANK_WIRE_OWNER') ? Configuration::get('BANK_WIRE_OWNER') : ''),
'{bankwire_details}' => (Configuration::get('BANK_WIRE_DETAILS') ? nl2br(Configuration::get('BANK_WIRE_DETAILS')) : ''),
@@ -182,7 +184,9 @@ class AdminOrders extends AdminTab
if (Validate::isLoadedObject($order))
{
$varsTpl = array('{lastname}' => $customer->lastname, '{firstname}' => $customer->firstname, '{id_order}' => $message->id_order, '{message}' => (Configuration::get('PS_MAIL_TYPE') == 2 ? $message->message : Tools::nl2br($message->message)));
if (@Mail::Send((int)($order->id_lang), 'order_merchant_comment', Mail::l('New message regarding your order'), $varsTpl, $customer->email, $customer->firstname.' '.$customer->lastname))
if (@Mail::Send((int)($order->id_lang), 'order_merchant_comment',
Mail::l('New message regarding your order'), $varsTpl, $customer->email,
$customer->firstname.' '.$customer->lastname, NULL, NULL, NULL, NULL, _PS_MAIL_DIR_, true))
Tools::redirectAdmin(self::$currentIndex.'&id_order='.$id_order.'&vieworder&conf=11'.'&token='.$this->token);
}
}
@@ -319,7 +323,9 @@ class AdminOrders extends AdminTab
else
{
Module::hookExec('orderSlip', array('order' => $order, 'productList' => $full_product_list, 'qtyList' => $full_quantity_list));
@Mail::Send((int)($order->id_lang), 'credit_slip', Mail::l('New credit slip regarding your order'), $params, $customer->email, $customer->firstname.' '.$customer->lastname);
@Mail::Send((int)$order->id_lang, 'credit_slip', Mail::l('New credit slip regarding your order', $order->id_lang),
$params, $customer->email, $customer->firstname.' '.$customer->lastname, NULL, NULL, NULL, NULL,
_PS_MAIL_DIR_, true);
}
}
@@ -333,7 +339,9 @@ class AdminOrders extends AdminTab
$currency = $context->currency;
$params['{voucher_amount}'] = Tools::displayPrice($voucher->value, $currency, false);
$params['{voucher_num}'] = $voucher->name;
@Mail::Send((int)($order->id_lang), 'voucher', Mail::l('New voucher regarding your order'), $params, $customer->email, $customer->firstname.' '.$customer->lastname);
@Mail::Send((int)($order->id_lang), 'voucher', Mail::l('New voucher regarding your order'),
$params, $customer->email, $customer->firstname.' '.$customer->lastname, NULL, NULL, NULL,
NULL, _PS_MAIL_DIR_, true);
}
}
}
@@ -589,7 +597,7 @@ class AdminOrders extends AdminTab
if (sizeof($sources))
{
echo '<br />
<fieldset style="width: 400px;"><legend><img src="../img/admin/tab-stats.gif" /> '.$this->l('Sources').'</legend><ul '.(sizeof($sources) > 3 ? 'style="overflow-y: scroll; height: 200px"' : '').'>';
<fieldset style="width: 400px;"><legend><img src="../img/admin/tab-stats.gif" /> '.$this->l('Sources').'</legend><ul '.(sizeof($sources) > 3 ? 'style="height: 200px; overflow-y: scroll; width: 360px;"' : '').'>';
foreach ($sources as $source)
echo '<li>
'.Tools::displayDate($source['date_add'], $context->language->id, true).'<br />
@@ -865,7 +873,7 @@ class AdminOrders extends AdminTab
<form action="'.$_SERVER['REQUEST_URI'].'&token='.$this->token.'" method="post" onsubmit="if (getE(\'visibility\').checked == true) return confirm(\''.$this->l('Do you want to send this message to the customer?', __CLASS__, true, false).'\');">
<fieldset style="width: 400px;">
<legend style="cursor: pointer;" onclick="$(\'#message\').slideToggle();$(\'#message_m\').slideToggle();return false"><img src="../img/admin/email_edit.gif" /> '.$this->l('New message').'</legend>
<div id="message_m" style="display: '.(Tools::getValue('message') ? 'none' : 'block').'">
<div id="message_m" style="display: '.(Tools::getValue('message') ? 'none' : 'block').'; overflow: auto; width: 400px;">
<a href="#" onclick="$(\'#message\').slideToggle();$(\'#message_m\').slideToggle();return false"><b>'.$this->l('Click here').'</b> '.$this->l('to add a comment or send a message to the customer').'</a>
</div>
<div id="message" style="display: '.(Tools::getValue('message') ? 'block' : 'none').'">
@@ -949,7 +957,6 @@ class AdminOrders extends AdminTab
'avoid' => array()
//'avoid' => array('address2')
);
return AddressFormat::generateAddress($addressDelivery, $patternRules, '<br />');
}
+1 -1
View File
@@ -183,7 +183,7 @@ class AdminPayment extends AdminTab
if ($nameId == 'country' && isset($module->limited_countries) &&
count($module->limited_countries))
{
if (in_array($item['iso_code'], $module->limited_countries))
if (in_array(strtoupper($item['iso_code']), array_map('strtoupper', $module->limited_countries)))
echo '<input type="checkbox" name="'.$module->name.'_'.
$nameId.'[]" value="'.$item['id_'.$nameId].'"'.
(in_array($item['id_'.$nameId.''], $value) ?
+4 -10
View File
@@ -72,7 +72,6 @@ class AdminPreferences extends AdminTab
);
foreach (CMS::listCms($context->language->id) as $cms_file)
$cms_tab[] = array('id' => $cms_file['id_cms'], 'name' => $cms_file['meta_title']);
$this->_fieldsGeneral = array(
'PS_SHOP_ENABLE' => array('title' => $this->l('Enable Shop'), 'desc' => $this->l('Activate or deactivate your shop. Deactivate your shop while you perform maintenance on it. Please note that the webservice will not be disabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'),
'PS_MAINTENANCE_IP' => array('title' => $this->l('Maintenance IP'), 'desc' => $this->l('IP addresses allowed to access the Front Office even if shop is disabled. Use a comma to separate them (e.g., 42.24.4.2,127.0.0.1,99.98.97.96)'), 'validation' => 'isGenericName', 'type' => 'maintenance_ip', 'size' => 30, 'default' => ''),
@@ -80,6 +79,8 @@ class AdminPreferences extends AdminTab
'PS_COOKIE_CHECKIP' => array('title' => $this->l('Check IP on the cookie'), 'desc' => $this->l('Check the IP address of the cookie in order to avoid your cookie being stolen'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0', 'visibility' => Shop::CONTEXT_ALL),
'PS_TOKEN_ENABLE' => array('title' => $this->l('Increase Front Office security'), 'desc' => $this->l('Enable or disable token on the Front Office in order to improve PrestaShop security'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0', 'visibility' => Shop::CONTEXT_ALL),
'PS_HELPBOX' => array('title' => $this->l('Back Office help boxes'), 'desc' => $this->l('Enable yellow help boxes which are displayed under form fields in the Back Office'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL),
'PS_COOKIE_LIFETIME_FO' => array('title' => $this->l('Lifetime of the Front Office cookie'), 'desc' => $this->l('Indicate the number of hours'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'default' => '480', 'visibility' => Shop::CONTEXT_ALL),
'PS_COOKIE_LIFETIME_BO' => array('title' => $this->l('Lifetime of the Back Office cookie'), 'desc' => $this->l('Indicate the number of hours'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'default' => '480', 'visibility' => Shop::CONTEXT_ALL),
'PS_ORDER_PROCESS_TYPE' => array('title' => $this->l('Order process type'), 'desc' => $this->l('You can choose the order process type as either standard (5 steps) or One Page Checkout'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $order_process_type, 'identifier' => 'value'),
'PS_GUEST_CHECKOUT_ENABLED' => array('title' => $this->l('Enable guest checkout'), 'desc' => $this->l('Your guest can make an order without registering'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'),
'PS_CONDITIONS' => array('title' => $this->l('Terms of service'), 'desc' => $this->l('Require customers to accept or decline terms of service before processing the order'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'js' => array('on' => 'onchange="changeCMSActivationAuthorization()"', 'off' => 'onchange="changeCMSActivationAuthorization()"')),
@@ -171,15 +172,8 @@ class AdminPreferences extends AdminTab
{
$context = Context::getContext();
$languages = Language::getLanguages(false);
if (!Configuration::get('PS_FORCE_SMARTY_2'))
{
$files = scandir(_PS_THEME_DIR_);
foreach ($files AS $file)
if (!preg_match('/^\..*/', $file))
$context->smarty->clearCache($file);
}
else
$context->smarty->clear_all_cache();
Tools::clearCache($smarty);
/* Check required fields */
foreach ($fields AS $field => $values)
+92 -36
View File
@@ -248,7 +248,7 @@ class AdminProducts extends AdminTab
$attachment->file = $uniqid;
$attachment->mime = $_FILES['attachment_file']['type'];
$attachment->file_name = pSQL($_FILES['attachment_file']['name']);
if (empty($attachment->mime) OR Tools::strlen($attachment->mime) > 64)
if (empty($attachment->mime) OR Tools::strlen($attachment->mime) > 128)
$this->_errors[] = Tools::displayError('Invalid file extension');
if (!Validate::isGenericName($attachment->file_name))
$this->_errors[] = Tools::displayError('Invalid file name');
@@ -306,7 +306,7 @@ class AdminProducts extends AdminTab
else
{
Hook::addProduct($product);
Search::indexation(false);
Search::indexation(false, $product->id);
Tools::redirectAdmin(self::$currentIndex.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&conf=19&token='.($token ? $token : $this->token));
}
}
@@ -745,7 +745,7 @@ class AdminProducts extends AdminTab
if (!$specificPrice->add())
$this->_errors = Tools::displayError('An error occurred while updating the specific price.');
else
Tools::redirectAdmin(self::$currentIndex.'&id_product='.$id_product.'&add'.$this->table.'&tabs=2&conf=3&token='.($token ? $token : $this->token));
Tools::redirectAdmin(self::$currentIndex.(Tools::getValue('id_category') ? '&id_category='.Tools::getValue('id_category') : '').'&id_product='.$id_product.'&add'.$this->table.'&tabs=2&conf=3&token='.($token ? $token : $this->token));
}
}
else
@@ -765,7 +765,7 @@ class AdminProducts extends AdminTab
if (!$specificPrice->delete())
$this->_errors[] = Tools::displayError('An error occurred while deleting the specific price');
else
Tools::redirectAdmin(self::$currentIndex.'&id_product='.$obj->id.'&add'.$this->table.'&tabs=2&conf=1&token='.($token ? $token : $this->token));
Tools::redirectAdmin(self::$currentIndex.(Tools::getValue('id_category') ? '&id_category='.Tools::getValue('id_category') : '').'&id_product='.$obj->id.'&add'.$this->table.'&tabs=2&conf=1&token='.($token ? $token : $this->token));
}
}
else
@@ -787,7 +787,7 @@ class AdminProducts extends AdminTab
elseif (!SpecificPrice::setSpecificPriority((int)($obj->id), $priorities))
$this->_errors[] = Tools::displayError('An error occurred while setting priorities.');
else
Tools::redirectAdmin(self::$currentIndex.'&id_product='.$obj->id.'&add'.$this->table.'&tabs=2&conf=4&token='.($token ? $token : $this->token));
Tools::redirectAdmin(self::$currentIndex.(Tools::getValue('id_category') ? '&id_category='.Tools::getValue('id_category') : '').'&id_product='.$obj->id.'&add'.$this->table.'&tabs=2&conf=4&token='.($token ? $token : $this->token));
}
/* Customization management */
elseif (Tools::isSubmit('submitCustomizationConfiguration'))
@@ -1015,9 +1015,9 @@ class AdminProducts extends AdminTab
throw new Exception(Tools::displayError('Image format not recognized, allowed formats are: .gif, .jpg, .png'));
}
if (!$image->createImgFolder())
if (!$new_path = $image->getPathForCreation())
throw new Exception(Tools::displayError('An error occurred during new folder creation'));
if (!imageResize($subdir.$file, _PS_PROD_IMG_DIR_.$image->getImgPath().'.jpg'))
if (!imageResize($subdir.$file, $new_path.'.'.$image->image_format))
{
$image->delete();
throw new Exception(Tools::displayError('An error occurred while resizing image.'));
@@ -1060,17 +1060,18 @@ class AdminProducts extends AdminTab
else
{
$image = new Image($id_image);
if (!(Configuration::get('PS_LEGACY_IMAGES') && file_exists(_PS_PROD_IMG_DIR_.$id_product.'-'.$id_image.'.jpg')))
$image->createImgFolder();
if (!$new_path = $image->getPathForCreation())
$this->_errors[] = Tools::displayError('An error occurred during new folder creation');
if (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($_FILES['image_product']['tmp_name'], $tmpName))
$this->_errors[] = Tools::displayError('An error occurred during the image upload');
elseif (!imageResize($tmpName, _PS_PROD_IMG_DIR_.$image->getExistingImgPath().'.'.$image->image_format))
elseif (!imageResize($tmpName, $new_path.'.'.$image->image_format))
$this->_errors[] = Tools::displayError('An error occurred while copying image.');
elseif($method == 'auto')
{
$imagesTypes = ImageType::getImagesTypes('products');
foreach ($imagesTypes AS $k => $imageType)
if (!imageResize($tmpName, _PS_PROD_IMG_DIR_.$image->getExistingImgPath().'-'.stripslashes($imageType['name']).'.'.$image->image_format, $imageType['width'], $imageType['height'], $image->image_format))
if (!imageResize($tmpName, $new_path.'-'.stripslashes($imageType['name']).'.'.$image->image_format, $imageType['width'], $imageType['height'], $image->image_format))
$this->_errors[] = Tools::displayError('An error occurred while copying image:').' '.stripslashes($imageType['name']);
}
@@ -1187,9 +1188,9 @@ class AdminProducts extends AdminTab
$this->_errors[] = Tools::displayError('An error occurred while adding tags.');
elseif ($id_image = $this->addProductImage($object, Tools::getValue('resizer')))
{
$currentIndex .= '&image_updated='.(int)(Tools::getValue('id_image'));
$currentIndex .= '&image_updated='.(int)Tools::getValue('id_image');
Hook::updateProduct($object);
Search::indexation(false);
Search::indexation(false, $object->id);
if (Tools::getValue('resizer') == 'man' && isset($id_image) AND is_int($id_image) AND $id_image)
Tools::redirectAdmin(self::$currentIndex.'&id_product='.$object->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&edit='.strval(Tools::getValue('productCreated')).'&id_image='.$id_image.'&imageresize&toconf=4&submitAddAndStay='.((Tools::isSubmit('submitAdd'.$this->table.'AndStay') OR Tools::getValue('productCreated') == 'on') ? 'on' : 'off').'&token='.(($token ? $token : $this->token)));
@@ -1202,7 +1203,11 @@ class AdminProducts extends AdminTab
$admin_dir = dirname($_SERVER['PHP_SELF']);
$admin_dir = substr($admin_dir, strrpos($admin_dir,'/') + 1);
$token = Tools::encrypt('PreviewProduct'.$object->id);
$preview_url .= $object->active ? '' : '?adtoken='.$token.'&ad='.$admin_dir;
if(strpos($preview_url, '?') === false)
$preview_url .= '?';
else
$preview_url .= '&';
$preview_url .= 'adtoken='.$token.'&ad='.$admin_dir;
}
Tools::redirectAdmin($preview_url);
} else if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') OR ($id_image AND $id_image !== true)) // Save and stay on same form
@@ -1243,18 +1248,18 @@ class AdminProducts extends AdminTab
elseif ($id_image = $this->addProductImage($object))
{
Hook::addProduct($object);
Search::indexation(false);
Search::indexation(false, $object->id);
// Save and preview
if (Tools::isSubmit('submitAddProductAndPreview'))
{
$preview_url = ($context->link->getProductLink($this->getFieldValue($object, 'id'), $this->getFieldValue($object, 'link_rewrite', $context->language->id), Category::getLinkRewrite($this->getFieldValue($object, 'id_category_default'), $context->language->id)));
if (!$obj->active)
if (!$object->active)
{
$admin_dir = dirname($_SERVER['PHP_SELF']);
$admin_dir = substr($admin_dir, strrpos($admin_dir,'/') + 1);
$token = Tools::encrypt('PreviewProduct'.$object->id);
$preview_url .= $object->active ? '' : '?adtoken='.$token.'&ad='.$admin_dir;
$preview_url .= '&adtoken='.$token.'&ad='.$admin_dir;
}
Tools::redirectAdmin($preview_url);
@@ -1729,7 +1734,7 @@ class AdminProducts extends AdminTab
<td class="cell border">'.$period.'</td>
<td class="cell border">'.$specificPrice['from_quantity'].'</th>
<td class="cell border"><b>'.Tools::displayPrice(Tools::ps_round((float)($this->_getFinalPrice($specificPrice, (float)($obj->price), $taxRate)), 2), $current_specific_currency).'</b></td>
<td class="cell border"><a href="'.self::$currentIndex.'&id_product='.(int)(Tools::getValue('id_product')).'&updateproduct&deleteSpecificPrice&id_specific_price='.(int)($specificPrice['id_specific_price']).'&token='.Tools::getValue('token').'"><img src="../img/admin/delete.gif" alt="'.$this->l('Delete').'" /></a></td>
<td class="cell border"><a href="'.self::$currentIndex.(Tools::getValue('id_category') ? '&id_category='.Tools::getValue('id_category') : '').'&id_product='.(int)(Tools::getValue('id_product')).'&updateproduct&deleteSpecificPrice&id_specific_price='.(int)($specificPrice['id_specific_price']).'&token='.Tools::getValue('token').'"><img src="../img/admin/delete.gif" alt="'.$this->l('Delete').'" /></a></td>
</tr>';
$i++;
}
@@ -2610,6 +2615,11 @@ class AdminProducts extends AdminTab
</td>
</tr>
<tr><td colspan="2" style="padding-bottom:5px;"><hr style="width:100%;" /></td></tr>';
if ((int)Configuration::get('PS_STOCK_MANAGEMENT'))
{
if (!$has_attribute)
{
if ($obj->id)
@@ -2662,6 +2672,12 @@ class AdminProducts extends AdminTab
<div class="hint clear" style="display: block;width: 70%;">'.$this->l('You used combinations, for this reason you can\'t edit your stock quantity here, but in the Combinations tab').'</div>
</td>
</tr>';
}
else
echo '<tr>
<td colspan="2">'.$this->l('The stock management is disabled').'</td>
</tr>';
echo '
<tr><td colspan="2" style="padding-bottom:5px;"><hr style="width:100%;" /></td></tr>
<tr>
@@ -2709,8 +2725,48 @@ class AdminProducts extends AdminTab
<br /><input type="radio" name="out_of_stock" id="out_of_stock_3" value="2" '.($this->getFieldValue($obj, 'out_of_stock') == 2 ? 'checked="checked"' : '').'/> <label for="out_of_stock_3" class="t" id="label_out_of_stock_3">'.$this->l('Default:').' <i>'.$this->l(((int)(Configuration::get('PS_ORDER_OUT_OF_STOCK')) ? 'Allow orders' : 'Deny orders')).'</i> ('.$this->l('as set in').' <a href="index.php?tab=AdminPPreferences&token='.Tools::getAdminToken('AdminPPreferences'.(int)(Tab::getIdFromClassName('AdminPPreferences')).(int)$context->employee->id).'" onclick="return confirm(\''.$this->l('Are you sure you want to delete entered product information?', __CLASS__, true, false).'\');">'.$this->l('Preferences').'</a>)</label>
</td>
</tr>
<tr><td colspan="2" style="padding-bottom:5px;"><hr style="width:100%;" /></td></tr>
<tr id="tr_categories"></tr>
<tr>
<td colspan="2" style="padding-bottom:5px;">
<hr style="width:100%;" />
</td>
</tr>
<tr>
<td class="col-left"><label for="id_category_default" class="t">'.$this->l('Default category:').'</label></td>
<td>
<div id="no_default_category" style="color: red;font-weight: bold;display: none;">'.$this->l('Please check a category in order to select the default category.').'</div>
<script>var post_selected_cat;</script>';
if (Tools::isSubmit('categoryBox'))
{
$postCat = Tools::getValue('categoryBox');
$selectedCat = Category::getSimpleCategories($this->_defaultFormLanguage, false, true, 'AND c.`id_category` IN ('.(empty($postCat) ? '1' : implode(',', $postCat)).')');
echo '<script>post_selected_cat = \''.implode(',', $postCat).'\';</script>';
}
if ($obj->id)
$selectedCat = Product::getProductCategoriesFull($obj->id, $this->_defaultFormLanguage);
else if(!Tools::isSubmit('categoryBox'))
$selectedCat[] = array('id_category' => 1, 'name' => $this->l('Home'));
echo '<select id="id_category_default" name="id_category_default">';
foreach($selectedCat AS $cat)
echo '<option value="'.$cat['id_category'].'" '.($obj->id_category_default == $cat['id_category'] ? 'selected' : '').'>'.$cat['name'].'</option>';
echo '</select>
</td>
</tr>
<tr id="tr_categories">
<td colspan="2">
';
// Translations are not automatic for the moment ;)
$trads = array(
'Home' => $this->l('Home'),
'selected' => $this->l('selected'),
'Collapse All' => $this->l('Collapse All'),
'Expand All' => $this->l('Expand All'),
'Check All' => $this->l('Check All'),
'Uncheck All' => $this->l('Uncheck All')
);
echo Helper::renderAdminCategorieTree($trads, $selectedCat).'
</td>
</tr>
<tr><td colspan="2" style="padding-bottom:5px;"><hr style="width:100%;" /></td></tr>
<tr><td colspan="2">
<span onclick="$(\'#seo\').slideToggle();" style="cursor: pointer"><img src="../img/admin/arrow.gif" alt="'.$this->l('SEO').'" title="'.$this->l('SEO').'" style="float:left; margin-right:5px;"/>'.$this->l('Click here to improve product\'s rank in search engines (SEO)').'</span><br />
@@ -2719,7 +2775,7 @@ class AdminProducts extends AdminTab
<tr>
<td class="col-left">'.$this->l('Meta title:').'</td>
<td class="translatable">';
foreach ($this->_languages as $language)
foreach ($this->_languages AS $language)
echo ' <div class="lang_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').'; float: left;">
<input size="55" type="text" id="meta_title_'.$language['id_lang'].'" name="meta_title_'.$language['id_lang'].'"
value="'.htmlentities($this->getFieldValue($obj, 'meta_title', $language['id_lang']), ENT_COMPAT, 'UTF-8').'" />
@@ -2894,18 +2950,10 @@ class AdminProducts extends AdminTab
<script type="text/javascript" src="'.__PS_BASE_URI__.'js/tinymce.inc.js"></script>
<script type="text/javascript">
toggleVirtualProduct(getE(\'is_virtual_good\'));
unitPriceWithTax(\'unit\');';
unitPriceWithTax(\'unit\');
</script>';
$categoryBox = Tools::getValue('categoryBox', array());
echo '
$(function() {
$.ajax({
type: \'POST\',
url: \'ajax_category_list.php\',
data: \''.(sizeof($categoryBox) > 0 ? 'categoryBox='.serialize($categoryBox).'&' : '').'id_product='.$obj->id.'&id_category_default='.($this->getFieldValue($obj, 'id_category_default') ? $this->getFieldValue($obj, 'id_category_default') : Tools::getValue('id_category', 1)).'&id_category='.(int)(Tools::getValue('id_category')).'&token='.$this->token.'\',
async : true,
success: function(msg) { $(\'#tr_categories\').replaceWith(msg); }
});
});</script>';
}
function displayFormImages($obj, $token = NULL)
@@ -3128,6 +3176,7 @@ class AdminProducts extends AdminTab
$attributeJs[$attribute['id_attribute_group']][$attribute['id_attribute']] = $attribute['name'];
$currency = $context->currency;
$attributes_groups = AttributeGroup::getAttributesGroups($context->language->id);
$default_country = new Country((int)Configuration::get('PS_COUNTRY_DEFAULT'));
$images = Image::getImages($context->language->id, $obj->id);
@@ -3667,11 +3716,18 @@ class AdminProducts extends AdminTab
private function addPackItem()
{
return '
function addPackItem()
{
if ($(\'#curPackItemId\').val() == \'\' || $(\'#curPackItemName\').val() == \'\') return false;
if ($(\'#curPackItemId\').val() == \'\' || $(\'#curPackItemName\').val() == \'\')
{
alert(\''.$this->l('Thanks to select at least one product.').'\');
return false;
}
else if ($(\'#curPackItemId\').val() == \'\' || $(\'#curPackItemQty\').val() == \'\')
{
alert(\''.$this->l('Thanks to set a quantity to add a product.').'\');
return false;
}
var lineDisplay = $(\'#curPackItemQty\').val()+ \'x \' +$(\'#curPackItemName\').val();
@@ -3685,7 +3741,7 @@ class AdminProducts extends AdminTab
$(\'#inputPackItems\').val($(\'#inputPackItems\').val() + line + \'-\');
$(\'#divPackItems\').html(divContent);
$(\'#namePackItems\').val($(\'#namePackItems\').val() + lineDisplay + \'¤\');
$(\'#namePackItems\').val($(\'#namePackItems\').val() + lineDisplay + \'¤\');
$(\'#curPackItemId\').val(\'\');
$(\'#curPackItemName\').val(\'\');
+6 -3
View File
@@ -91,6 +91,7 @@ class AdminReturn extends AdminTab
if (($id_order_return = (int)(Tools::getValue('id_order_return'))) AND Validate::isUnsignedId($id_order_return))
{
$orderReturn = new OrderReturn($id_order_return);
$order = new Order($orderReturn->id_order);
$customer = new Customer($orderReturn->id_customer);
$orderReturn->state = (int)(Tools::getValue('state'));
if ($orderReturn->save())
@@ -100,9 +101,11 @@ class AdminReturn extends AdminTab
'{lastname}' => $customer->lastname,
'{firstname}' => $customer->firstname,
'{id_order_return}' => $id_order_return,
'{state_order_return}' => $orderReturnState->name[(int)(Configuration::get('PS_LANG_DEFAULT'))]);
Mail::Send(clan, 'order_return_state', Mail::l('Your order return state has changed'), $vars, $customer->email, $customer->firstname.' '.$customer->lastname);
Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token);
'{state_order_return}' => (isset($orderReturnState->name[(int)$order->id_lang]) ? $orderReturnState->name[(int)$order->id_lang] : $orderReturnState->name[(int)Configuration::get('PS_LANG_DEFAULT')]));
Mail::Send((int)$order->id_lang, 'order_return_state', Mail::l('Your order return state has changed', $order->id_lang),
$vars, $customer->email, $customer->firstname.' '.$customer->lastname, NULL, NULL, NULL,
NULL, _PS_MAIL_DIR_, true);
Tools::redirectAdmin($currentIndex.'&conf=4&token='.$this->token);
}
}
else
+4 -7
View File
@@ -57,17 +57,14 @@ class AdminSearchConf extends AdminPreferences
parent::__construct();
}
public function postProcess()
{
if (isset($_POST['submitSearch'.$this->table]))
{
if ($this->tabAccess['edit'] === '1')
$this->_postConfig($this->_fieldsSearch);
else
$this->_errors[] = Tools::displayError('You do not have permission to edit here.');
{ if ($this->tabAccess['edit'] === '1') $this->_postConfig($this->_fieldsSearch); else $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); }
if (isset($_POST['submitWeight'.$this->table]))
{ if ($this->tabAccess['edit'] === '1') $this->_postConfig($this->_fieldsWeight); else $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); }
}
}
public function display()
{
+6
View File
@@ -112,6 +112,11 @@ class AdminStores extends AdminTab
if ((int)($country->contains_states) AND !$id_state)
$this->_errors[] = Tools::displayError('An address located in a country containing states must have a state selected.');
$latitude = (int)(Tools::getValue('latitude'));
$longitude = (int)(Tools::getValue('longitude'));
if(empty($latitude) OR empty($longitude))
$this->_errors[] = Tools::displayError('Latitude and longitude are required.');
/* Check zip code */
if ($country->need_zip_code)
{
@@ -227,6 +232,7 @@ class AdminStores extends AdminTab
<label>'.$this->l('Latitude / Longitude:').'</label>
<div class="margin-form">
<input type="text" size="8" maxlength="10" name="latitude" value="'.htmlentities($this->getFieldValue($obj, 'latitude'), ENT_COMPAT, 'UTF-8').'" onKeyUp="javascript:this.value = this.value.replace(/,/g, \'.\');" /> / <input type="text" size="8" maxlength="10" name="longitude" value="'.htmlentities($this->getFieldValue($obj, 'longitude'), ENT_COMPAT, 'UTF-8').'" onKeyUp="javascript:this.value = this.value.replace(/,/g, \'.\');" />
<sup>*</sup>
<p class="clear">'.$this->l('Store coords, eg. 45.265469 / -47.226478').'</p>
</div>
<label>'.$this->l('Phone:').'</label>
+2 -1
View File
@@ -252,8 +252,9 @@ class AdminTaxRulesGroup extends AdminTab
<td>'.$this->renderTaxesSelect($id_lang, $id_tax, array('class' => 'tax_'.$id_zone, 'id' => 'tax_'.$country['id_country'].'_0', 'name' => 'tax_'.$country['id_country'].'_0' )).'</td>
</tr>
';
if ($country['contains_states'])
if ($country['contains_states']) {
$html .= $this->renderStates($tax_rules, (int)$id_zone, (int)$country['id_country'], (int)$id_lang);
}
$i++;
}
+19 -1
View File
@@ -41,12 +41,16 @@ class AdminTaxes extends AdminTab
'rate' => array('title' => $this->l('Rate'), 'align' => 'center', 'suffix' => '%', 'width' => 50),
'active' => array('title' => $this->l('Enabled'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false));
$ecotax_desc = '';
if (Configuration::get('PS_USE_ECOTAX'))
$ecotax_desc = $this->l('If you disable the ecotax, the ecotax for all your products will be set to 0');
$this->optionTitle = $this->l('Tax options');
$this->_fieldsOptions = array(
'PS_TAX' => array('title' => $this->l('Enable tax:'), 'desc' => $this->l('Select whether or not to include tax on purchases'), 'cast' => 'intval', 'type' => 'bool'),
'PS_TAX_DISPLAY' => array('title' => $this->l('Display tax in cart:'), 'desc' => $this->l('Select whether or not to display tax on a distinct line in the cart'), 'cast' => 'intval', 'type' => 'bool'),
'PS_TAX_ADDRESS_TYPE' => array('title' => $this->l('Base on:'), 'cast' => 'pSQL', 'type' => 'select', 'list' => array(array('name' => $this->l('Invoice Address'), 'id' => 'id_address_invoice'), array('name' => $this->l('Delivery Address'), 'id' => 'id_address_delivery')), 'identifier' => 'id'),
'PS_USE_ECOTAX' => array('title' => $this->l('Use ecotax'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'),
'PS_USE_ECOTAX' => array('title' => $this->l('Use ecotax'), 'desc' => $ecotax_desc, 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'),
);
if (Configuration::get('PS_USE_ECOTAX'))
@@ -181,5 +185,19 @@ class AdminTaxes extends AdminTab
<img src="../img/admin/'.($value ? 'enabled.gif' : 'disabled.gif').'"
alt="'.($value ? $this->l('Enabled') : $this->l('Disabled')).'" title="'.($value ? $this->l('Enabled') : $this->l('Disabled')).'" /></a>';
}
public function updateOptionPsUseEcotax($value)
{
$old_value = (int)Configuration::get('PS_USE_ECOTAX');
if ($old_value != $value)
{
// Reset ecotax
if ($value == 0)
Product::resetEcoTax();
Configuration::updateValue('PS_USE_ECOTAX', (int)$value);
}
}
}
+4 -2
View File
@@ -34,13 +34,13 @@ class AdminThemes extends AdminPreferences
* @since 1.4.0.11, check theme compatibility 1.4
* @static
*/
static public $check_features_version = '1.4';
public static $check_features_version = '1.4';
/** $check_features is a multidimensional array used to check [theme]/config.xml values,
* and also checks prestashop current configuration if not match.
* @static
*/
static public $check_features = array(
public static $check_features = array(
'ccc' => array( // feature key name
'attributes' => array(
'available' => array(
@@ -261,11 +261,13 @@ class AdminThemes extends AdminPreferences
*/
public function postProcess()
{
global $smarty;
// new check compatibility theme feature (1.4) :
$val = Tools::getValue('PS_THEME');
Configuration::updateValue('PS_IMG_UPDATE_TIME', time());
if (!empty($val) AND !$this->_isThemeCompatible($val)) // don't submit if errors
unset($_POST['submitThemes'.$this->table]);
Tools::clearCache($smarty);
parent::postProcess();
}
}
+3 -3
View File
@@ -157,7 +157,7 @@ class AdminTranslations extends AdminTab
}
}
if ($bool)
Tools::redirectLink(self::$currentIndex.'&conf=14&token='.$this->token);
Tools::redirectAdmin(self::$currentIndex.'&conf=14&token='.$this->token);
$this->_errors[] = $this->l('a part of the data has been copied but some language files could not be found or copied');
}
@@ -1715,7 +1715,7 @@ class AdminTranslations extends AdminTab
{
if ($module{0} != '.' AND is_dir($root_dir.$module))
{
@include_once($root_dir.$module.'/'.$lang.'.php');
@include($root_dir.$module.'/'.$lang.'.php');
self::getModuleTranslations($is_default);
$this->recursiveGetModuleFiles($root_dir.$module.'/', $array_files, $module, $root_dir.$module.'/'.$lang.'.php', $is_default);
}
@@ -1891,7 +1891,7 @@ class AdminTranslations extends AdminTab
*
* @return array
*/
static public function getThemesList()
public static function getThemesList()
{
$dir = opendir(_PS_ALL_THEMES_DIR_);
while ($folder = readdir($dir))
+1798
View File
File diff suppressed because it is too large Load Diff
+9 -1
View File
@@ -37,7 +37,6 @@ class AdminWebservice extends AdminTab
$this->lang = false;
$this->edit = true;
$this->delete = true;
$this->id_lang_default = Configuration::get('PS_LANG_DEFAULT');
$this->fieldsDisplay = array(
@@ -93,6 +92,13 @@ class AdminWebservice extends AdminTab
$warnings[] = $this->l('If possible, it is preferable to use SSL (https) for webservice calls, as it avoids the security issues of type "man in the middle".');
$this->displayWarning($warnings);
foreach ($this->_list as $k => $item)
if ($item['is_module'] && $item['class_name'] && $item['module_name'] &&
($instance = Module::getInstanceByName($item['module_name'])) &&
!$instance->useNormalPermissionBehaviour())
unset($this->_list[$k]);
parent::displayList();
}
public function displayForm($isMainTab = true)
@@ -221,6 +227,8 @@ echo '
{
if (Tools::getValue('key') && strlen(Tools::getValue('key')) < 32)
$this->_errors[] = Tools::displayError($this->l('Key length must be 32 character long'));
if (WebserviceKey::keyExists(Tools::getValue('key')) && !Tools::getValue('id_webservice_account'))
$this->_errors[] = Tools::displayError($this->l('Key already exists'));
return parent::postProcess();
}
+36
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$
* @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;
+7
View File
@@ -59,3 +59,10 @@ a.action_module{color: #488C40;text-decoration: underline;}
a.header_module_toggle{font-weight: bold;color: #812143;display:block;}
a.module_toggle_all{color:#FFF;text-decoration:none;display:inherit;}
.nbr_module{float:right;margin-right:10px;font-style:italic;font-size:12px;color: #812143;}
.autoupgradeSteps div { line-height: 30px; }
.upgradestep { margin-right: 5px;padding-left: 10px; padding-right: 5px;}
#upgradeNow.stepok, .autoupgradeSteps a.stepok { background-image: url("../img/admin/enabled.gif");background-position: left center;background-repeat: no-repeat;padding-left: 15px;}
#upgradeNow {-moz-border-bottom-colors: none;-moz-border-image: none;-moz-border-left-colors: none;-moz-border-right-colors: none;-moz-border-top-colors: none;border-color: #FFF6D3 #DFD5AF #DFD5AF #FFF6D3;border-right: 1px solid #DFD5AF;border-style: solid;border-width: 1px;color: #268CCD;font-size: medium;padding: 5px;}
.button-autoupgrade {-moz-border-bottom-colors: none;-moz-border-image: none;-moz-border-left-colors: none;-moz-border-right-colors: none;-moz-border-top-colors: none;border-color: #FFF6D3 #DFD5AF #DFD5AF #FFF6D3;border-right: 1px solid #DFD5AF;border-style: solid;border-width: 1px;color: #268CCD;font-size: medium;padding: 5px;}
.processing {overflow: auto;}
+36
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$
* @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
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$
* @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;
+8 -1
View File
@@ -53,4 +53,11 @@ select {border: 1px solid #E0D0B1}
a.action_module{color: #268CCD;text-decoration: underline;}
a.header_module_toggle{font-weight: bold;color: #268CCD;display:block;}
a.module_toggle_all{color: #268CCD;}
.nbr_module{float:right;margin-right:10px;font-style:italic;font-size:12px;color: #268CCD;}
.nbr_module{float:right;margin-right:10px;font-style:italic;font-size:12px;color: #268CCD;}
.autoupgradeSteps div { line-height: 30px; }
.upgradestep { margin-right: 5px;padding-left: 10px; padding-right: 5px;}
#upgradeNow.stepok, .autoupgradeSteps a.stepok { background-image: url("../img/admin/enabled.gif");background-position: left center;background-repeat: no-repeat;padding-left: 15px;}
#upgradeNow {-moz-border-bottom-colors: none;-moz-border-image: none;-moz-border-left-colors: none;-moz-border-right-colors: none;-moz-border-top-colors: none;border-color: #FFF6D3 #DFD5AF #DFD5AF #FFF6D3;border-right: 1px solid #DFD5AF;border-style: solid;border-width: 1px;color: #268CCD;font-size: medium;padding: 5px;}
.button-autoupgrade {-moz-border-bottom-colors: none;-moz-border-image: none;-moz-border-left-colors: none;-moz-border-right-colors: none;-moz-border-top-colors: none;border-color: #FFF6D3 #DFD5AF #DFD5AF #FFF6D3;border-right: 1px solid #DFD5AF;border-style: solid;border-width: 1px;color: #268CCD;font-size: medium;padding: 5px;}
.processing {overflow: auto;}
+36
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$
* @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;
+6
View File
@@ -57,3 +57,9 @@ a.header_module_toggle{font-weight: bold;color: #268CCD;display:block;}
a.module_toggle_all{color: #268CCD;}
.nbr_module{float:right;margin-right:10px;font-style:italic;font-size:12px;color: #268CCD;}
.autoupgradeSteps div { line-height: 30px; }
.upgradestep { margin-right: 5px;padding-left: 10px; padding-right: 5px;}
#upgradeNow.stepok, .autoupgradeSteps a.stepok { background-image: url("../img/admin/enabled.gif");background-position: left center;background-repeat: no-repeat;padding-left: 15px;}
#upgradeNow {-moz-border-bottom-colors: none;-moz-border-image: none;-moz-border-left-colors: none;-moz-border-right-colors: none;-moz-border-top-colors: none;border-color: #FFF6D3 #DFD5AF #DFD5AF #FFF6D3;border-right: 1px solid #DFD5AF;border-style: solid;border-width: 1px;color: #268CCD;font-size: medium;padding: 5px;}
.button-autoupgrade {-moz-border-bottom-colors: none;-moz-border-image: none;-moz-border-left-colors: none;-moz-border-right-colors: none;-moz-border-top-colors: none;border-color: #FFF6D3 #DFD5AF #DFD5AF #FFF6D3;border-right: 1px solid #DFD5AF;border-style: solid;border-width: 1px;color: #268CCD;font-size: medium;padding: 5px;}
.processing {overflow: auto;}
+36
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$
* @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
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$
* @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
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$
* @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;