// MERGE with trunk revision 7754
91
admin-dev/ajax-tab.php
Executable 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')));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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]))
|
||||
{
|
||||
|
||||
@@ -62,6 +62,12 @@ class AdminGenerator extends AdminTab
|
||||
<p>'.$this->l('Enable only if your server allows URL rewriting.').'</p>
|
||||
</div>
|
||||
<div class="clear"> </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"> </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.');
|
||||
}
|
||||
|
||||
@@ -159,9 +159,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').' '.$update['name'].'</a> !</h3></div>';
|
||||
elseif (!@ini_get('allow_url_fopen'))
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<p>'.$this->l('Update notification unavailable').'</p>';
|
||||
echo '<p> </p>';
|
||||
|
||||
@@ -425,11 +425,58 @@ 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');
|
||||
elseif ($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>';
|
||||
}
|
||||
|
||||
@@ -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) ?
|
||||
|
||||
@@ -171,15 +171,7 @@ 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($context->smarty);
|
||||
|
||||
/* Check required fields */
|
||||
foreach ($fields AS $field => $values)
|
||||
|
||||
@@ -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');
|
||||
@@ -2709,8 +2709,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 +2759,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 +2934,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)
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -266,6 +266,7 @@ class AdminThemes extends AdminPreferences
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
1798
admin-dev/tabs/AdminUpgrade.php
Executable 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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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;}
|
||||
|
||||
@@ -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;}
|
||||
|
||||
@@ -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;}
|
||||
|
||||
@@ -159,6 +159,8 @@ abstract class AdminTabCore
|
||||
protected $_includeVars = false;
|
||||
protected $_includeContainer = true;
|
||||
|
||||
public $ajax = false;
|
||||
|
||||
public static $tabParenting = array(
|
||||
'AdminProducts' => 'AdminCatalog',
|
||||
'AdminCategories' => 'AdminCatalog',
|
||||
@@ -233,6 +235,14 @@ abstract class AdminTabCore
|
||||
return str_replace('"', '"', ($addslashes ? addslashes($str) : stripslashes($str)));
|
||||
}
|
||||
|
||||
/**
|
||||
* ajaxDisplay is the default ajax return sytem
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function displayAjax()
|
||||
{
|
||||
}
|
||||
/**
|
||||
* Manage page display (form, list...)
|
||||
*/
|
||||
@@ -506,6 +516,24 @@ abstract class AdminTabCore
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* ajaxPreProcess is a method called in ajax-tab.php before displayConf().
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxPreProcess()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* ajaxProcess is the default handle method for request with ajax-tab.php
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxProcess()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage page processing
|
||||
*/
|
||||
@@ -1107,9 +1135,9 @@ abstract class AdminTabCore
|
||||
public function displayConf()
|
||||
{
|
||||
if ($conf = Tools::getValue('conf'))
|
||||
echo '<div class="conf">
|
||||
<img src="../img/admin/ok2.png" />
|
||||
'.$this->_conf[(int)($conf)].'
|
||||
echo '
|
||||
<div class="conf">
|
||||
<img src="../img/admin/ok2.png" alt="" /> '.$this->_conf[(int)($conf)].'
|
||||
</div>';
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ class AliasCore extends ObjectModel
|
||||
FROM `'._DB_PREFIX_.'alias`
|
||||
WHERE `search` LIKE \''.pSQL($search).'\'');
|
||||
}
|
||||
|
||||
|
||||
public function getAliases()
|
||||
{
|
||||
$aliases = Db::getInstance()->ExecuteS('
|
||||
|
||||
@@ -37,7 +37,7 @@ class AttachmentCore extends ObjectModel
|
||||
public $position;
|
||||
|
||||
protected $fieldsRequired = array('file', 'mime');
|
||||
protected $fieldsSize = array('file' => 40, 'mime' => 64, 'file_name' => 128);
|
||||
protected $fieldsSize = array('file' => 40, 'mime' => 128, 'file_name' => 128);
|
||||
protected $fieldsValidate = array('file' => 'isGenericName', 'mime' => 'isCleanHtml', 'file_name' => 'isGenericName');
|
||||
|
||||
protected $fieldsRequiredLang = array('name');
|
||||
|
||||
@@ -1232,7 +1232,10 @@ class CartCore extends ObjectModel
|
||||
{
|
||||
$moduleName = $carrier->external_module_name;
|
||||
$module = Module::getInstanceByName($moduleName);
|
||||
if (key_exists('id_carrier', $module))
|
||||
|
||||
if (Validate::isLoadedObject($module))
|
||||
{
|
||||
if (array_key_exists('id_carrier', $module))
|
||||
$module->id_carrier = $carrier->id;
|
||||
if($carrier->need_range)
|
||||
$shipping_cost = $module->getOrderShippingCost($this, $shipping_cost);
|
||||
@@ -1243,6 +1246,9 @@ class CartCore extends ObjectModel
|
||||
if ($shipping_cost === false)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
// Apply tax
|
||||
if (isset($carrierTax))
|
||||
@@ -1327,7 +1333,7 @@ class CartCore extends ObjectModel
|
||||
|
||||
$groups = Customer::getGroupsStatic($this->id_customer);
|
||||
|
||||
if (($discountObj->id_customer OR $discountObj->id_group) AND ($this->id_customer != $discountObj->id_customer AND !in_array($discountObj->id_group, $groups)))
|
||||
if (($discountObj->id_customer OR $discountObj->id_group) AND ((($this->id_customer != $discountObj->id_customer) OR ($this->id_customer == 0)) AND !in_array($discountObj->id_group, $groups)))
|
||||
{
|
||||
if (!$customer->isLogged())
|
||||
return Tools::displayError('You cannot use this voucher.').' - '.Tools::displayError('Please log in.');
|
||||
@@ -1699,6 +1705,8 @@ class CartCore extends ObjectModel
|
||||
{
|
||||
$carrier = new Carrier((int)$id_carrier, Configuration::get('PS_LANG_DEFAULT'));
|
||||
$shippingMethod = $carrier->getShippingMethod();
|
||||
if (!$carrier->range_behavior)
|
||||
return true;
|
||||
|
||||
if ($shippingMethod == Carrier::SHIPPING_METHOD_FREE)
|
||||
return true;
|
||||
|
||||
@@ -179,6 +179,16 @@ class CategoryCore extends ObjectModel
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ObjectModel::toggleStatus()
|
||||
*/
|
||||
public function toggleStatus()
|
||||
{
|
||||
$result = parent::toggleStatus();
|
||||
Module::hookExec('categoryUpdate');
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursive scan of subcategories
|
||||
*
|
||||
@@ -594,37 +604,19 @@ class CategoryCore extends ObjectModel
|
||||
* @param int $id_lang
|
||||
* @return array
|
||||
*/
|
||||
public static function getChildrenWithNbSelectedSubCatForProduct($id_parent, $id_product = 0, $ids_categories = null, $id_lang)
|
||||
public static function getChildrenWithNbSelectedSubCat($id_parent, $selectedCat, $id_lang)
|
||||
{
|
||||
$categories_product_str = '';
|
||||
if ($id_product)
|
||||
{
|
||||
$categories_product = Db::getInstance()->ExecuteS('
|
||||
SELECT `id_category`
|
||||
FROM `'._DB_PREFIX_.'category_product`
|
||||
WHERE `id_product` = '.(int)$id_product);
|
||||
if (sizeof($categories_product))
|
||||
foreach ($categories_product as $category_product)
|
||||
$categories_product_str .= $category_product['id_category'].',';
|
||||
}
|
||||
else
|
||||
{
|
||||
$categories_product = array();
|
||||
$categories_product_str = $ids_categories;
|
||||
}
|
||||
$categories_product_str = rtrim($categories_product_str, ',');
|
||||
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
|
||||
SELECT c.`id_category`, cl.`name`, IF((
|
||||
SELECT c.`id_category`, c.`level_depth`, cl.`name`, IF((
|
||||
SELECT COUNT(*)
|
||||
FROM `'._DB_PREFIX_.'category` c2
|
||||
WHERE c2.`id_parent` = c.`id_category`
|
||||
) > 0, 1, 0) AS has_children, '.($categories_product_str ? '(
|
||||
) > 0, 1, 0) AS has_children, '.($selectedCat ? '(
|
||||
SELECT count(c3.`id_category`)
|
||||
FROM `'._DB_PREFIX_.'category` c3
|
||||
WHERE c3.`nleft` > c.`nleft`
|
||||
AND c3.`nright` < c.`nright`
|
||||
AND c3.`id_category` IN ('.$categories_product_str.')
|
||||
AND c3.`id_category` IN ('.$selectedCat.')
|
||||
)' : '0').' AS nbSelectedSubCat
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.`id_category` = cl.`id_category`
|
||||
|
||||
198
classes/CompareProduct.php
Normal file
@@ -0,0 +1,198 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
class CompareProduct extends ObjectModel
|
||||
{
|
||||
public $id;
|
||||
|
||||
public $id_product;
|
||||
|
||||
public $id_guest;
|
||||
|
||||
public $id_customer;
|
||||
|
||||
public $date_add;
|
||||
|
||||
public $date_upd;
|
||||
|
||||
protected $fieldRequired = array(
|
||||
'id_product',
|
||||
'id_guest',
|
||||
'id_customer');
|
||||
|
||||
protected $fieldsValidate = array(
|
||||
'id_product' => 'isUnsignedInt',
|
||||
'id_guest' => 'isUnsignedInt',
|
||||
'id_customer' => 'isUnsignedInt'
|
||||
);
|
||||
|
||||
protected $table = 'compare_product';
|
||||
|
||||
protected $identifier = 'id_compare_product';
|
||||
|
||||
|
||||
/**
|
||||
* Get all compare products of the guest
|
||||
* @param int $id_guest
|
||||
* @return array
|
||||
*/
|
||||
public static function getGuestCompareProducts($id_guest)
|
||||
{
|
||||
$results = Db::getInstance()->ExecuteS('
|
||||
SELECT DISTINCT `id_product`
|
||||
FROM `'._DB_PREFIX_.'compare_product`
|
||||
WHERE `id_guest` = '.(int)($id_guest));
|
||||
|
||||
$compareProducts = null;
|
||||
|
||||
foreach($results as $result)
|
||||
$compareProducts[] = $result['id_product'];
|
||||
|
||||
return $compareProducts;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add a compare product for the guest
|
||||
* @param int $id_guest, int $id_product
|
||||
* @return boolean
|
||||
*/
|
||||
public static function addGuestCompareProduct($id_guest, $id_product)
|
||||
{
|
||||
return Db::getInstance()->Execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'compare_product` (`id_product`, `id_guest`, `date_add`, `date_upd`)
|
||||
VALUES ('.(int)($id_product).', '.(int)($id_guest).', NOW(), NOW())
|
||||
');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove a compare product for the guest
|
||||
* @param int $id_guest, int $id_product
|
||||
* @return boolean
|
||||
*/
|
||||
public static function removeGuestCompareProduct($id_guest, $id_product)
|
||||
{
|
||||
return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'compare_product` WHERE `id_guest` = '.(int)($id_guest).' AND `id_product` = '.(int)($id_product));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the number of compare products of the guest
|
||||
* @param int $id_guest
|
||||
* @return int
|
||||
*/
|
||||
public static function getGuestNumberProducts($id_guest)
|
||||
{
|
||||
return (int)(Db::getInstance()->getValue('
|
||||
SELECT count(`id_compare_product`)
|
||||
FROM `'._DB_PREFIX_.'compare_product`
|
||||
WHERE `id_guest` = '.(int)($id_guest)));;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get all comapare products of the customer
|
||||
* @param int $id_customer
|
||||
* @return array
|
||||
*/
|
||||
public static function getCustomerCompareProducts($id_customer)
|
||||
{
|
||||
$results = Db::getInstance()->ExecuteS('
|
||||
SELECT DISTINCT `id_product`
|
||||
FROM `'._DB_PREFIX_.'compare_product`
|
||||
WHERE `id_customer` = '.(int)($id_customer));
|
||||
|
||||
$compareProducts = null;
|
||||
|
||||
foreach($results as $result)
|
||||
$compareProducts[] = $result['id_product'];
|
||||
|
||||
return $compareProducts;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add a compare product for the customer
|
||||
* @param int $id_customer, int $id_product
|
||||
* @return boolean
|
||||
*/
|
||||
public static function addCustomerCompareProduct($id_customer, $id_product)
|
||||
{
|
||||
return Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'compare_product` (`id_product`, `id_customer`, `date_add`, `date_upd`) VALUES ('.(int)($id_product).', '.(int)($id_customer).', NOW(), NOW())');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove a compare product for the customer
|
||||
* @param int $id_customer, int $id_product
|
||||
* @return boolean
|
||||
*/
|
||||
public static function removeCustomerCompareProduct($id_customer, $id_product)
|
||||
{
|
||||
return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'compare_product` WHERE `id_customer` = '.(int)($id_customer).' AND `id_product` = '.(int)($id_product));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the number of compare products of the customer
|
||||
* @param int $id_customer
|
||||
* @return int
|
||||
*/
|
||||
public static function getCustomerNumberProducts($id_customer)
|
||||
{
|
||||
return (int)(Db::getInstance()->getValue('
|
||||
SELECT count(`id_compare_product`)
|
||||
FROM `'._DB_PREFIX_.'compare_product`
|
||||
WHERE `id_customer` = '.(int)($id_customer)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clean entries which are older than the period
|
||||
* @param string $period
|
||||
* @return void
|
||||
*/
|
||||
public static function cleanCompareProducts($period = 'week')
|
||||
{
|
||||
if ($period === 'week')
|
||||
$interval = '1 WEEK';
|
||||
elseif ($period === 'month')
|
||||
$interval = '1 MONTH';
|
||||
elseif ($period === 'year')
|
||||
$interval = '1 YEAR';
|
||||
else
|
||||
return;
|
||||
|
||||
if ($interval != null)
|
||||
{
|
||||
Db::getInstance()->Execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'compare_product`
|
||||
WHERE date_upd < DATE_SUB(NOW(), INTERVAL '.pSQL($interval).')');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,14 +20,14 @@
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 7040 $
|
||||
* @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
|
||||
*/
|
||||
|
||||
class ConfigurationTest
|
||||
class ConfigurationTestCore
|
||||
{
|
||||
static function check($tests)
|
||||
static function check($tests)
|
||||
{
|
||||
$res = array();
|
||||
foreach ($tests AS $key => $test)
|
||||
@@ -35,7 +35,7 @@ class ConfigurationTest
|
||||
return $res;
|
||||
}
|
||||
|
||||
static function run($ptr, $arg = 0)
|
||||
static function run($ptr, $arg = 0)
|
||||
{
|
||||
if (call_user_func(array('ConfigurationTest', 'test_'.$ptr), $arg))
|
||||
return ('ok');
|
||||
@@ -43,32 +43,32 @@ class ConfigurationTest
|
||||
}
|
||||
|
||||
// Misc functions
|
||||
static function test_phpversion()
|
||||
static function test_phpversion()
|
||||
{
|
||||
return version_compare(substr(phpversion(), 0, 3), '5.0', '>=');
|
||||
}
|
||||
|
||||
static function test_mysql_support()
|
||||
static function test_mysql_support()
|
||||
{
|
||||
return function_exists('mysql_connect');
|
||||
}
|
||||
|
||||
static function test_magicquotes()
|
||||
static function test_magicquotes()
|
||||
{
|
||||
return !ini_get('magic_quotes_gpc');
|
||||
}
|
||||
|
||||
static function test_upload()
|
||||
static function test_upload()
|
||||
{
|
||||
return ini_get('file_uploads');
|
||||
}
|
||||
|
||||
static function test_fopen()
|
||||
static function test_fopen()
|
||||
{
|
||||
return ini_get('allow_url_fopen');
|
||||
}
|
||||
|
||||
static function test_system($funcs)
|
||||
static function test_system($funcs)
|
||||
{
|
||||
foreach ($funcs AS $func)
|
||||
if (!function_exists($func))
|
||||
@@ -76,17 +76,17 @@ class ConfigurationTest
|
||||
return true;
|
||||
}
|
||||
|
||||
static function test_gd()
|
||||
static function test_gd()
|
||||
{
|
||||
return function_exists('imagecreatetruecolor');
|
||||
}
|
||||
|
||||
static function test_register_globals()
|
||||
static function test_register_globals()
|
||||
{
|
||||
return !ini_get('register_globals');
|
||||
}
|
||||
|
||||
static function test_gz()
|
||||
static function test_gz()
|
||||
{
|
||||
if (function_exists('gzencode'))
|
||||
return !(@gzencode('dd') === false);
|
||||
@@ -94,7 +94,7 @@ class ConfigurationTest
|
||||
}
|
||||
|
||||
// is_writable dirs
|
||||
static function test_dir($dir, $recursive = false)
|
||||
static function test_dir($dir, $recursive = false)
|
||||
{
|
||||
if (!file_exists($dir) OR !$dh = opendir($dir))
|
||||
return false;
|
||||
@@ -119,107 +119,112 @@ class ConfigurationTest
|
||||
}
|
||||
|
||||
// is_writable files
|
||||
static function test_file($file)
|
||||
static function test_file($file)
|
||||
{
|
||||
return (file_exists($file) AND is_writable($file));
|
||||
}
|
||||
|
||||
static function test_config_dir($dir)
|
||||
static function test_config_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir);
|
||||
}
|
||||
|
||||
static function test_sitemap($dir)
|
||||
static function test_sitemap($dir)
|
||||
{
|
||||
return self::test_file($dir);
|
||||
}
|
||||
|
||||
static function test_root_dir($dir)
|
||||
static function test_root_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir);
|
||||
}
|
||||
|
||||
static function test_log_dir($dir)
|
||||
static function test_log_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir);
|
||||
}
|
||||
|
||||
static function test_admin_dir($dir)
|
||||
static function test_admin_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir);
|
||||
}
|
||||
|
||||
static function test_img_dir($dir)
|
||||
static function test_img_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir, true);
|
||||
}
|
||||
|
||||
static function test_module_dir($dir)
|
||||
static function test_module_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir, true);
|
||||
}
|
||||
|
||||
static function test_tools_dir($dir)
|
||||
static function test_tools_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir);
|
||||
}
|
||||
|
||||
static function test_cache_dir($dir)
|
||||
static function test_cache_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir);
|
||||
}
|
||||
|
||||
static function test_tools_v2_dir($dir)
|
||||
static function test_tools_v2_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir);
|
||||
}
|
||||
|
||||
static function test_cache_v2_dir($dir)
|
||||
static function test_cache_v2_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir);
|
||||
}
|
||||
|
||||
static function test_download_dir($dir)
|
||||
static function test_download_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir);
|
||||
}
|
||||
|
||||
static function test_mails_dir($dir)
|
||||
static function test_mails_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir, true);
|
||||
}
|
||||
|
||||
static function test_translations_dir($dir)
|
||||
static function test_translations_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir, true);
|
||||
}
|
||||
|
||||
static function test_theme_lang_dir($dir)
|
||||
static function test_theme_lang_dir($dir)
|
||||
{
|
||||
if (!file_exists($dir))
|
||||
return true;
|
||||
return self::test_dir($dir, true);
|
||||
}
|
||||
|
||||
static function test_theme_cache_dir($dir)
|
||||
static function test_theme_cache_dir($dir)
|
||||
{
|
||||
if (!file_exists($dir))
|
||||
return true;
|
||||
return self::test_dir($dir, true);
|
||||
}
|
||||
|
||||
static function test_customizable_products_dir($dir)
|
||||
static function test_customizable_products_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir);
|
||||
}
|
||||
|
||||
static function test_virtual_products_dir($dir)
|
||||
static function test_virtual_products_dir($dir)
|
||||
{
|
||||
return self::test_dir($dir);
|
||||
}
|
||||
|
||||
static function test_mcrypt()
|
||||
static function test_mcrypt()
|
||||
{
|
||||
return function_exists('mcrypt_encrypt');
|
||||
}
|
||||
|
||||
static function test_dom()
|
||||
{
|
||||
return extension_loaded('Dom');
|
||||
}
|
||||
}
|
||||
118
classes/Helper.php
Executable file
@@ -0,0 +1,118 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO : move HTML code in template files
|
||||
*/
|
||||
|
||||
class HelperCore
|
||||
{
|
||||
public static $translationsKeysForAdminCategorieTree = array(
|
||||
'Home', 'selected', 'selecteds', 'Collapse All', 'Expand All', 'Check All', 'Uncheck All'
|
||||
);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $trads values of translations keys
|
||||
* For the moment, translation are not automatic
|
||||
* @param type $selected_cat array of selected categories
|
||||
* Format
|
||||
* Array
|
||||
(
|
||||
[0] => 1
|
||||
[1] => 2
|
||||
)
|
||||
* OR
|
||||
Array
|
||||
(
|
||||
[1] => Array
|
||||
(
|
||||
[id_category] => 1
|
||||
[name] => Home page
|
||||
[link_rewrite] => home
|
||||
)
|
||||
)
|
||||
* @param type $input_name name of input
|
||||
* @return string
|
||||
*/
|
||||
public static function renderAdminCategorieTree($trads, $selected_cat = array(), $input_name = 'categoryBox')
|
||||
{
|
||||
$html = '
|
||||
<script src="../js/jquery/treeview/jquery.treeview.js" type="text/javascript"></script>
|
||||
<script src="../js/jquery/treeview/jquery.treeview.async.js" type="text/javascript"></script>
|
||||
<script src="../js/jquery/treeview/jquery.treeview.edit.js" type="text/javascript"></script>
|
||||
<script src="../js/admin-categories-tree.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var inputName = "'.$input_name.'";
|
||||
var selectedCat = "'.implode(',', array_keys($selected_cat)).'";
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
var selectedLabel = \''.$trads['selected'].'\';
|
||||
var home = \''.$trads['Home'].'\';
|
||||
</script>
|
||||
<link type="text/css" rel="stylesheet" href="../css/jquery.treeview.css" />
|
||||
';
|
||||
|
||||
$html .= '
|
||||
<div style="background-color:#F4E6C9; width:99%;padding:5px 0 5px 5px;">
|
||||
<a href="#" id="collapse_all" >'.$trads['Collapse All'].'</a>
|
||||
- <a href="#" id="expand_all" >'.$trads['Expand All'].'</a>
|
||||
- <a href="#" id="check_all" >'.$trads['Check All'].'</a>
|
||||
- <a href="#" id="uncheck_all" >'.$trads['Uncheck All'].'</a>
|
||||
</div>
|
||||
';
|
||||
|
||||
$home_is_selected = false;
|
||||
foreach($selected_cat AS $cat)
|
||||
{
|
||||
if (is_array($cat))
|
||||
{
|
||||
if ($cat['id_category'] != 1)
|
||||
$html .= '<input type="hidden" name="'.$input_name.'[]" value="'.$cat['id_category'].'" >';
|
||||
else
|
||||
$home_is_selected = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($cat != 1)
|
||||
$html .= '<input type="hidden" name="'.$input_name.'[]" value="'.$cat.'" >';
|
||||
else
|
||||
$home_is_selected = true;
|
||||
}
|
||||
}
|
||||
$html .= '
|
||||
<ul id="categories-treeview" class="filetree">
|
||||
<li id="1" class="hasChildren">
|
||||
<span class="folder"> <input type="checkbox" name="'.$input_name.'[]" value="1" '.($home_is_selected ? 'checked' : '').' onclick="clickOnCategoryBox($(this));" /> '.$trads['Home'].'</span>
|
||||
<ul>
|
||||
<li><span class="placeholder"> </span></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>';
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
@@ -452,7 +452,17 @@ class ImageCore extends ObjectModel
|
||||
public function createImgFolder()
|
||||
{
|
||||
if (!file_exists(_PS_PROD_IMG_DIR_.$this->getImgFolder()))
|
||||
return @mkdir(_PS_PROD_IMG_DIR_.$this->getImgFolder(), 0755, true);
|
||||
{
|
||||
// Apparently sometimes mkdir cannot set the rights, and sometimes chmod can't. Trying both.
|
||||
$success = @mkdir(_PS_PROD_IMG_DIR_.$this->getImgFolder(), 0755, true)
|
||||
|| @chmod(_PS_PROD_IMG_DIR_.$this->getImgFolder(), 0755);
|
||||
|
||||
// Create an index.php file in the new folder
|
||||
if ($success
|
||||
&& !file_exists(_PS_PROD_IMG_DIR_.$this->getImgFolder().'index.php')
|
||||
&& file_exists($this->source_index))
|
||||
return @copy($this->source_index, _PS_PROD_IMG_DIR_.$this->getImgFolder().'index.php');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -511,6 +521,51 @@ class ImageCore extends ObjectModel
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function testFileSystem()
|
||||
{
|
||||
$safe_mode = ini_get('safe_mode');
|
||||
if ($safe_mode)
|
||||
return false;
|
||||
$folder1 = _PS_PROD_IMG_DIR_.'testfilesystem/';
|
||||
$test_folder = $folder1.'testsubfolder/';
|
||||
if (file_exists($test_folder))
|
||||
{
|
||||
@rmdir($test_folder);
|
||||
@rmdir($folder1);
|
||||
}
|
||||
if (file_exists($test_folder))
|
||||
return false;
|
||||
@mkdir($test_folder, 0755, true);
|
||||
@chmod($test_folder, 0755);
|
||||
if (!is_writeable($test_folder))
|
||||
return false;
|
||||
@rmdir($test_folder);
|
||||
@rmdir($folder1);
|
||||
if (file_exists($folder1))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the path where a product image should be created (without file format)
|
||||
*
|
||||
* @return string path
|
||||
*/
|
||||
public function getPathForCreation()
|
||||
{
|
||||
if (!$this->id)
|
||||
return false;
|
||||
if (Configuration::get('PS_LEGACY_IMAGES'))
|
||||
{
|
||||
if (!$this->id_product)
|
||||
return false;
|
||||
$path = $this->id_product.'-'.$this->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$path = $this->getImgPath();
|
||||
$this->createImgFolder();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,8 @@ class LanguageCore extends ObjectModel
|
||||
return ($resUpdateSQL AND Tools::generateHtaccess(dirname(__FILE__).'/../.htaccess',
|
||||
(int)(Configuration::get('PS_REWRITING_SETTINGS')),
|
||||
(int)(Configuration::get('PS_HTACCESS_CACHE_CONTROL')),
|
||||
Configuration::get('PS_HTACCESS_SPECIFIC')
|
||||
Configuration::get('PS_HTACCESS_SPECIFIC'),
|
||||
(int)Configuration::get('PS_HTACCESS_DISABLE_MULTIVIEWS')
|
||||
));
|
||||
}
|
||||
|
||||
@@ -118,7 +119,8 @@ class LanguageCore extends ObjectModel
|
||||
return (Tools::generateHtaccess(dirname(__FILE__).'/../.htaccess',
|
||||
(int)(Configuration::get('PS_REWRITING_SETTINGS')),
|
||||
(int)(Configuration::get('PS_HTACCESS_CACHE_CONTROL')),
|
||||
Configuration::get('PS_HTACCESS_SPECIFIC')
|
||||
Configuration::get('PS_HTACCESS_SPECIFIC'),
|
||||
(int)Configuration::get('PS_HTACCESS_DISABLE_MULTIVIEWS')
|
||||
));
|
||||
}
|
||||
|
||||
@@ -290,7 +292,8 @@ class LanguageCore extends ObjectModel
|
||||
|
||||
foreach($tables as $table)
|
||||
foreach($table as $t)
|
||||
$langTables[] = $t;
|
||||
if ($t != _DB_PREFIX_.'configuration_lang')
|
||||
$langTables[] = $t;
|
||||
|
||||
Db::getInstance()->Execute('SET @id_lang_default = (SELECT c.`value` FROM `'._DB_PREFIX_.'configuration` c WHERE c.`name` = \'PS_LANG_DEFAULT\' LIMIT 1)');
|
||||
$return = true;
|
||||
@@ -403,7 +406,8 @@ class LanguageCore extends ObjectModel
|
||||
return Tools::generateHtaccess(dirname(__FILE__).'/../.htaccess',
|
||||
(int)(Configuration::get('PS_REWRITING_SETTINGS')),
|
||||
(int)(Configuration::get('PS_HTACCESS_CACHE_CONTROL')),
|
||||
Configuration::get('PS_HTACCESS_SPECIFIC')
|
||||
Configuration::get('PS_HTACCESS_SPECIFIC'),
|
||||
(int)Configuration::get('PS_HTACCESS_DISABLE_MULTIVIEWS')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -426,7 +430,8 @@ class LanguageCore extends ObjectModel
|
||||
Tools::generateHtaccess(dirname(__FILE__).'/../.htaccess',
|
||||
(int)(Configuration::get('PS_REWRITING_SETTINGS')),
|
||||
(int)(Configuration::get('PS_HTACCESS_CACHE_CONTROL')),
|
||||
Configuration::get('PS_HTACCESS_SPECIFIC')
|
||||
Configuration::get('PS_HTACCESS_SPECIFIC'),
|
||||
(int)Configuration::get('PS_HTACCESS_DISABLE_MULTIVIEWS')
|
||||
);
|
||||
|
||||
return $result;
|
||||
@@ -566,7 +571,8 @@ class LanguageCore extends ObjectModel
|
||||
return Tools::generateHtaccess(dirname(__FILE__).'/../.htaccess',
|
||||
(int)(Configuration::get('PS_REWRITING_SETTINGS')),
|
||||
(int)(Configuration::get('PS_HTACCESS_CACHE_CONTROL')),
|
||||
Configuration::get('PS_HTACCESS_SPECIFIC')
|
||||
Configuration::get('PS_HTACCESS_SPECIFIC'),
|
||||
(int)Configuration::get('PS_HTACCESS_DISABLE_MULTIVIEWS')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@ class ManufacturerCore extends ObjectModel
|
||||
|
||||
protected $webserviceParameters = array(
|
||||
'fields' => array(
|
||||
'active' => array(),
|
||||
'link_rewrite' => array('getter' => 'getLink', 'setter' => false),
|
||||
),
|
||||
'associations' => array(
|
||||
@@ -374,16 +375,19 @@ class ManufacturerCore extends ObjectModel
|
||||
$ids = array();
|
||||
foreach ($id_addresses as $id)
|
||||
$ids[] = (int)$id['id'];
|
||||
Db::getInstance()->ExecuteS('
|
||||
$result1 = (Db::getInstance()->ExecuteS('
|
||||
UPDATE `'._DB_PREFIX_.'address`
|
||||
SET id_manufacturer = 0
|
||||
WHERE id_manufacturer = '.(int)$this->id.'
|
||||
AND deleted = 0');
|
||||
return (Db::getInstance()->ExecuteS('
|
||||
AND deleted = 0') !== false);
|
||||
$result2 = true;
|
||||
if (count($ids))
|
||||
$result2 = (Db::getInstance()->ExecuteS('
|
||||
UPDATE `'._DB_PREFIX_.'address`
|
||||
SET id_customer = 0, id_supplier = 0, id_manufacturer = '.(int)$this->id.'
|
||||
WHERE id_address IN('.implode(',', $ids).')
|
||||
AND deleted = 0') !== false);
|
||||
return ($result1 && $result2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -523,6 +523,11 @@ abstract class ModuleCore
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function configXmlStringFormat($string)
|
||||
{
|
||||
return str_replace('\'', '\\\'', Tools::htmlentitiesDecodeUTF8($string));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return available modules
|
||||
*
|
||||
@@ -567,12 +572,12 @@ abstract class ModuleCore
|
||||
$item->warning = '';
|
||||
foreach ($xml_module as $k => $v)
|
||||
$item->$k = (string) $v;
|
||||
$item->displayName = Module::findTranslation($xml_module->name, $xml_module->displayName, (string)$xml_module->name);
|
||||
$item->description = Module::findTranslation($xml_module->name, $xml_module->description, (string)$xml_module->name);
|
||||
$item->author = Module::findTranslation($xml_module->name, $xml_module->author, (string)$xml_module->name);
|
||||
$item->displayName = Module::findTranslation($xml_module->name, self::configXmlStringFormat($xml_module->displayName), (string)$xml_module->name);
|
||||
$item->description = Module::findTranslation($xml_module->name, self::configXmlStringFormat($xml_module->description), (string)$xml_module->name);
|
||||
$item->author = Module::findTranslation($xml_module->name, self::configXmlStringFormat($xml_module->author), (string)$xml_module->name);
|
||||
|
||||
if (isset($xml_module->confirmUninstall))
|
||||
$item->confirmUninstall = Module::findTranslation($xml_module->name, $xml_module->confirmUninstall, (string)$xml_module->name);
|
||||
$item->confirmUninstall = Module::findTranslation($xml_module->name, self::configXmlStringFormat($xml_module->confirmUninstall), (string)$xml_module->name);
|
||||
|
||||
$item->active = 0;
|
||||
$moduleList[$moduleListCursor] = $item;
|
||||
@@ -792,8 +797,22 @@ abstract class ModuleCore
|
||||
{
|
||||
$context = Context::getContext();
|
||||
$hookArgs = array('cookie' => $context->cookie, 'cart' => $context->cart);
|
||||
$billing = new Address((int)($context->cart->id_address_invoice));
|
||||
$output = '';
|
||||
|
||||
$result = self::getPaymentModules();
|
||||
|
||||
if ($result)
|
||||
foreach ($result AS $module)
|
||||
if (($moduleInstance = Module::getInstanceByName($module['name'])) AND is_callable(array($moduleInstance, 'hookpayment')))
|
||||
if (!$moduleInstance->currencies OR ($moduleInstance->currencies AND sizeof(Currency::checkPaymentCurrencies($moduleInstance->id))))
|
||||
$output .= call_user_func(array($moduleInstance, 'hookpayment'), $hookArgs);
|
||||
return $output;
|
||||
}
|
||||
|
||||
public static function getPaymentModules()
|
||||
{
|
||||
$context = Context::getContext();
|
||||
$billing = new Address($context->cart->id_address_invoice);
|
||||
$list = Context::getContext()->shop->getListOfID();
|
||||
$sql = 'SELECT DISTINCT h.`id_hook`, m.`name`, hm.`position`
|
||||
FROM `'._DB_PREFIX_.'module_country` mc
|
||||
@@ -810,13 +829,7 @@ abstract class ModuleCore
|
||||
AND hm.id_shop IN('.implode(', ', $list).')
|
||||
GROUP BY hm.id_hook, hm.id_module
|
||||
ORDER BY hm.`position`, m.`name` DESC';
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql);
|
||||
if ($result)
|
||||
foreach ($result AS $k => $module)
|
||||
if (($moduleInstance = Module::getInstanceByName($module['name'])) AND is_callable(array($moduleInstance, 'hookpayment')))
|
||||
if (!$moduleInstance->currencies OR ($moduleInstance->currencies AND sizeof(Currency::checkPaymentCurrencies($moduleInstance->id))))
|
||||
$output .= call_user_func(array($moduleInstance, 'hookpayment'), $hookArgs);
|
||||
return $output;
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1115,13 +1128,7 @@ abstract class ModuleCore
|
||||
|
||||
protected function _clearCache($template, $cacheId = NULL, $compileId = NULL)
|
||||
{
|
||||
$context = Context::getContext();
|
||||
/* Use Smarty 3 API calls */
|
||||
if (!Configuration::get('PS_FORCE_SMARTY_2')) /* PHP version > 5.1.2 */
|
||||
return $context->smarty->clearCache($template ? $this->_getApplicableTemplateDir($template).$template : NULL, $cacheId, $compileId);
|
||||
/* or keep a backward compatibility if PHP version < 5.1.2 */
|
||||
else
|
||||
return $context->smarty->clear_cache($template ? $this->_getApplicableTemplateDir($template).$template : NULL, $cacheId, $compileId);
|
||||
Tools::clearCache(Context::getContext()->smarty);
|
||||
}
|
||||
|
||||
protected function _generateConfigXml()
|
||||
|
||||
@@ -137,11 +137,19 @@ class MySQLCore extends Db
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DbCore::tryToConnect()
|
||||
* tryToConnect return 0 if the connection succeed and the database can be selected.
|
||||
* @since 1.4.4.0, the parameter $newDbLink (default true) has been added.
|
||||
*
|
||||
* @param string $server mysql server name
|
||||
* @param string $user mysql user
|
||||
* @param string $pwd mysql user password
|
||||
* @param string $db mysql database name
|
||||
* @param boolean $newDbLink if set to true, the function will not create a new link if one already exists.
|
||||
* @return integer
|
||||
*/
|
||||
static public function tryToConnect($server, $user, $pwd, $db)
|
||||
static public function tryToConnect($server, $user, $pwd, $db, $newDbLink = true)
|
||||
{
|
||||
if (!$link = @mysql_connect($server, $user, $pwd))
|
||||
if (!$link = @mysql_connect($server, $user, $pwd, $newDbLink))
|
||||
return 1;
|
||||
if (!@mysql_select_db($db, $link))
|
||||
return 2;
|
||||
|
||||
@@ -408,7 +408,7 @@ abstract class ObjectModelCore
|
||||
$fields = array();
|
||||
|
||||
if($this->id_lang == NULL)
|
||||
foreach (Language::getLanguages() as $language)
|
||||
foreach (Language::getLanguages(false) as $language)
|
||||
$this->makeTranslationFields($fields, $fieldsArray, $language['id_lang']);
|
||||
else
|
||||
$this->makeTranslationFields($fields, $fieldsArray, $this->id_lang);
|
||||
|
||||
@@ -293,7 +293,14 @@ class OrderCore extends ObjectModel
|
||||
/* Update order */
|
||||
$shippingDiff = $this->total_shipping - $cart->getOrderShippingCost();
|
||||
$this->total_products -= $productPriceWithoutTax;
|
||||
|
||||
// After upgrading from old version
|
||||
// total_products_wt is null
|
||||
// removing a product made order total negative
|
||||
// and don't recalculating totals (on getTotalProductsWithTaxes)
|
||||
if ($this->total_products_wt != 0)
|
||||
$this->total_products_wt -= $productPrice;
|
||||
|
||||
$this->total_shipping = $cart->getOrderShippingCost();
|
||||
|
||||
/* It's temporary fix for 1.3 version... */
|
||||
|
||||
@@ -105,7 +105,7 @@ abstract class PaymentModuleCore extends Module
|
||||
$order->id_customer = (int)($cart->id_customer);
|
||||
$order->id_address_invoice = (int)($cart->id_address_invoice);
|
||||
$order->id_address_delivery = (int)($cart->id_address_delivery);
|
||||
$vat_address = new Address((int)($order->id_address_delivery));
|
||||
$vat_address = new Address((int)($order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}));
|
||||
$order->id_currency = ($currency_special ? (int)($currency_special) : (int)($cart->id_currency));
|
||||
$order->id_lang = (int)($cart->id_lang);
|
||||
$order->id_cart = (int)($cart->id);
|
||||
|
||||
@@ -263,7 +263,7 @@ class ProductCore extends ObjectModel
|
||||
'out_of_stock' => array('required' => true),
|
||||
'new' => array(),
|
||||
'cache_default_attribute' => array(),
|
||||
'id_default_image' => array('getter' => 'getCoverWs', 'setter' => false, 'xlink_resource' => array('resourceName' => 'images', 'subResourceName' => 'products')),
|
||||
'id_default_image' => array('getter' => 'getCoverWs', 'setter' => 'setCoverWs', 'xlink_resource' => array('resourceName' => 'images', 'subResourceName' => 'products')),
|
||||
'id_default_combination' => array('getter' => 'getWsDefaultCombination', 'setter' => 'setWsDefaultCombination', 'xlink_resource' => array('resourceName' => 'combinations')),
|
||||
'position_in_category' => array('getter' => 'getWsPositionInCategory', 'setter' => false),
|
||||
'manufacturer_name' => array('getter' => 'getWsManufacturerName', 'setter' => false),
|
||||
@@ -285,6 +285,10 @@ class ProductCore extends ObjectModel
|
||||
'id' => array('required' => true),
|
||||
'id_feature_value' => array('required' => true, 'xlink_resource' => 'product_feature_values'),
|
||||
)),
|
||||
'tags' => array('resource' => 'tag',
|
||||
'fields' => array(
|
||||
'id' => array('required' => true),
|
||||
)),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -3336,6 +3340,21 @@ class ProductCore extends ObjectModel
|
||||
return $result['id_image'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Webservice setter : set virtual field id_default_image in category
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setCoverWs($id_image)
|
||||
{
|
||||
Db::getInstance()->ExecuteS('UPDATE `'._DB_PREFIX_.'image`
|
||||
SET `cover` = 0 WHERE `id_product` = '.(int)($this->id).'
|
||||
');
|
||||
Db::getInstance()->ExecuteS('UPDATE `'._DB_PREFIX_.'image`
|
||||
SET `cover` = 1 WHERE `id_product` = '.(int)($this->id).' AND `id_image` = '.(int)$id_image);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Webservice getter : get image ids of current product for association
|
||||
*
|
||||
@@ -3350,6 +3369,15 @@ class ProductCore extends ObjectModel
|
||||
ORDER BY `position`');
|
||||
}
|
||||
|
||||
public function getWsTags()
|
||||
{
|
||||
return Db::getInstance()->ExecuteS('
|
||||
SELECT `id_tag` as id
|
||||
FROM `'._DB_PREFIX_.'product_tag`
|
||||
WHERE `id_product` = '.(int)($this->id));
|
||||
}
|
||||
|
||||
|
||||
public function getWsManufacturerName()
|
||||
{
|
||||
return Manufacturer::getNameById((int)$this->id_manufacturer);
|
||||
|
||||
@@ -231,7 +231,12 @@ class SpecificPriceCore extends ObjectModel
|
||||
`id_country` IN(0, '.(int)($id_country).') AND
|
||||
`id_group` IN(0, '.(int)($id_group).') AND
|
||||
`from_quantity` = 1 AND
|
||||
(`from` = \'0000-00-00 00:00:00\' OR (\''.$beginning.'\' >= `from` AND \''.$ending.'\' <= `to`)) AND
|
||||
(
|
||||
(`from` = \'0000-00-00 00:00:00\' OR \''.$beginning.'\' >= `from`)
|
||||
AND
|
||||
(`to` = \'0000-00-00 00:00:00\' OR \''.$ending.'\' <= `to`)
|
||||
)
|
||||
AND
|
||||
`reduction` > 0
|
||||
', false);
|
||||
$ids_product = array();
|
||||
|
||||
@@ -1491,7 +1491,7 @@ class ToolsCore
|
||||
return Tools::getHttpHost();
|
||||
}
|
||||
|
||||
public static function generateHtaccess($path, $rewrite_settings, $cache_control, $specific = '')
|
||||
public static function generateHtaccess($path, $rewrite_settings, $cache_control, $specific = '', $disableMuliviews = false)
|
||||
{
|
||||
if (!$writeFd = @fopen($path, 'w'))
|
||||
return false;
|
||||
@@ -1531,7 +1531,8 @@ class ToolsCore
|
||||
$tab['RewriteRule'][$domain]['content']['^'.ltrim($uri['uri'], '/').'([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$'] = _PS_PROD_IMG_.'$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.jpg [L]';
|
||||
$tab['RewriteRule'][$domain]['content']['^'.ltrim($uri['uri'], '/').'([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$'] = _PS_PROD_IMG_.'$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.jpg [L]';
|
||||
|
||||
$tab['RewriteRule'][$domain]['content']['^'.ltrim($uri['uri'], '/').'c/([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$'] = 'img/c/$1$2.jpg [L]';
|
||||
$tab['RewriteRule']['content']['^c/([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$'] = 'img/c/$1$2.jpg [L]';
|
||||
$tab['RewriteRule']['content']['^c/([a-zA-Z-]+)/[a-zA-Z0-9-]+\.jpg$'] = 'img/c/$1.jpg [L]';
|
||||
|
||||
if ($multilang)
|
||||
{
|
||||
@@ -1591,9 +1592,13 @@ class ToolsCore
|
||||
fwrite($writeFd, $specific);
|
||||
// RewriteEngine
|
||||
fwrite($writeFd, "\n<IfModule mod_rewrite.c>\n");
|
||||
fwrite($writeFd, "\nRewriteEngine on\n\n");
|
||||
// fwrite($writeFd, $tab['RewriteRule']['comment']."\n");
|
||||
// Webservice needs apache_mod_rewrite in order to work
|
||||
|
||||
if ($disableMuliviews)
|
||||
fwrite($writeFd, "\n# Disable Multiviews\nOptions -Multiviews\n\n");
|
||||
|
||||
fwrite($writeFd, $tab['RewriteEngine']['comment']."\nRewriteEngine on\n\n");
|
||||
fwrite($writeFd, $tab['RewriteRule']['comment']."\n");
|
||||
// Webservice
|
||||
fwrite($writeFd, 'RewriteRule ^api/?(.*)$ '.__PS_BASE_URI__."webservice/dispatcher.php?url=$1 [QSA,L]\n");
|
||||
|
||||
fwrite($writeFd, "RewriteCond %{REQUEST_FILENAME} -s [OR]\nRewriteCond %{REQUEST_FILENAME} -l [OR]\nRewriteCond %{REQUEST_FILENAME} -d\nRewriteRule ^.*$ - [NC,L]\nRewriteRule ^.*\$ index.php [NC,L]\n");
|
||||
@@ -1990,6 +1995,19 @@ FileETag INode MTime Size
|
||||
{
|
||||
return str_replace(array("\r\n", "\r", "\n"), '<br />', $str);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear cache for Smarty
|
||||
*
|
||||
* @param objet $smarty
|
||||
*/
|
||||
public static function clearCache($smarty)
|
||||
{
|
||||
if (!Configuration::get('PS_FORCE_SMARTY_2'))
|
||||
$smarty->clearAllCache();
|
||||
else
|
||||
$smarty->clear_all_cache();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
138
classes/Upgrader.php
Normal file
@@ -0,0 +1,138 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
class UpgraderCore{
|
||||
const DEFAULT_CHECK_VERSION_DELAY_HOURS = 24;
|
||||
/**
|
||||
* link contains hte url where to download the file
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $needUpgrade = false;
|
||||
private $noRefresh = false;
|
||||
|
||||
public $version_name;
|
||||
public $version_num;
|
||||
public $link;
|
||||
public $autoupgrade;
|
||||
|
||||
public function __get($var)
|
||||
{
|
||||
if($var == 'needUpgrade')
|
||||
return $this->isLastVersion();
|
||||
}
|
||||
/**
|
||||
* we need to checkPSVersion when we use that class
|
||||
* @param boolean noRefresh if true, checkPSVersion will not refresh its information
|
||||
* @return object Upgrader
|
||||
*/
|
||||
public function __construct($noRefresh = false)
|
||||
{
|
||||
$this->noRefresh = (bool)$noRefresh;
|
||||
}
|
||||
|
||||
/**
|
||||
* downloadLast download the last version of PrestaShop and save it in $dest/$filename
|
||||
*
|
||||
* @param string $dest directory where to save the file
|
||||
* @param string $filename new filename
|
||||
* @return boolean
|
||||
*
|
||||
* @TODO ftp if copy is not possible (safe_mode for example)
|
||||
*/
|
||||
public function downloadLast($dest, $filename = 'prestashop.zip')
|
||||
{
|
||||
if (empty($this->link))
|
||||
$this->checkPSVersion();
|
||||
|
||||
if (@copy($this->link, realpath($dest).DIRECTORY_SEPARATOR.$filename))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
public function isLastVersion()
|
||||
{
|
||||
if (empty($this->link))
|
||||
$this->checkPSVersion();
|
||||
|
||||
return $this->needUpgrade;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* checkPSVersion ask to prestashop.com if there is a new version. return an array if yes, false otherwise
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function checkPSVersion($force = false)
|
||||
{
|
||||
if (empty($this->link))
|
||||
{
|
||||
$lastCheck = Configuration::get('PS_LAST_VERSION_CHECK');
|
||||
// if we use the autoupgrade process, we will never refresh it
|
||||
// except if no check has been done before
|
||||
if (!($this->autoUpgrade AND $lastCheck) AND ($force OR ($lastCheck < time() - (3600 * Upgrader::DEFAULT_CHECK_VERSION_DELAY_HOURS))) )
|
||||
{
|
||||
libxml_set_streams_context(stream_context_create(array('http' => array('timeout' => 3))));
|
||||
if ($feed = @simplexml_load_file('http://www.prestashop.com/xml/version.xml'))
|
||||
{
|
||||
$this->version_name = (string)$feed->version->name;
|
||||
$this->version_num = (string)$feed->version->num;
|
||||
$this->link = (string)$feed->download->link;
|
||||
$this->autoupgrade = (int)$feed->autoupgrade;
|
||||
$configLastVersion = array(
|
||||
'name' => $this->version_name,
|
||||
'num' => $this->version_num,
|
||||
'link' => $this->link,
|
||||
'autoupgrade' => $this->autoupgrade
|
||||
);
|
||||
Configuration::updateValue('PS_LAST_VERSION',serialize($configLastVersion));
|
||||
Configuration::updateValue('PS_LAST_VERSION_CHECK',time());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$lastVersionCheck = unserialize(Configuration::get('PS_LAST_VERSION'));
|
||||
$this->version_name = $lastVersionCheck['name'];
|
||||
$this->version_num = $lastVersionCheck['num'];
|
||||
$this->link = $lastVersionCheck['link'];
|
||||
$this->autoupgrade = $lastVersionCheck['autoupgrade'];
|
||||
}
|
||||
}
|
||||
// retro-compatibility :
|
||||
// return array(name,link) if you don't use the last version
|
||||
// false otherwise
|
||||
if (version_compare(_PS_VERSION_, $this->version_num, '<'))
|
||||
{
|
||||
$this->needUpgrade = true;
|
||||
return array('name' => $this->version_name, 'link' => $this->link);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1356,7 +1356,7 @@ class WebserviceRequestCore
|
||||
$this->setError(400, 'id is duplicate in request', 89);
|
||||
return false;
|
||||
}
|
||||
if ($xmlEntities->count() != count($ids))
|
||||
if (count($xmlEntities) != count($ids))
|
||||
{
|
||||
$this->setError(400, 'id is required when modifying a resource', 90);
|
||||
return false;
|
||||
|
||||
@@ -151,6 +151,11 @@ class CategoryControllerCore extends FrontController
|
||||
'thumbSceneSize' => Image::getSize('thumb_scene'),
|
||||
'homeSize' => Image::getSize('home')
|
||||
));
|
||||
|
||||
if (isset(self::$cookie->id_customer))
|
||||
self::$smarty->assign('compareProducts', CompareProduct::getCustomerCompareProducts((int)self::$cookie->id_customer));
|
||||
elseif (isset(self::$cookie->id_guest))
|
||||
self::$smarty->assign('compareProducts', CompareProduct::getGuestCompareProducts((int)self::$cookie->id_guest));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,23 +31,74 @@ class CompareControllerCore extends FrontController
|
||||
{
|
||||
parent::setMedia();
|
||||
$this->addCSS(_THEME_CSS_DIR_.'/comparator.css');
|
||||
|
||||
if (Configuration::get('PS_COMPARATOR_MAX_ITEM') > 0)
|
||||
Tools::addJS(_THEME_JS_DIR_.'products-comparison.js');
|
||||
}
|
||||
|
||||
public function preProcess()
|
||||
{
|
||||
parent::preProcess();
|
||||
|
||||
//Add or remove product with Ajax
|
||||
if (Tools::getValue('ajax') AND Tools::getValue('id_product') AND Tools::getValue('action'))
|
||||
{
|
||||
if (Tools::getValue('action') == 'add')
|
||||
{
|
||||
if (isset(self::$cookie->id_customer))
|
||||
{
|
||||
if(CompareProduct::getCustomerNumberProducts(self::$cookie->id_customer) < Configuration::get('PS_COMPARATOR_MAX_ITEM'))
|
||||
CompareProduct::addCustomerCompareProduct((int)self::$cookie->id_customer, (int)Tools::getValue('id_product'));
|
||||
else
|
||||
die('0');
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((isset(self::$cookie->id_guest) AND CompareProduct::getGuestNumberProducts(self::$cookie->id_guest) < Configuration::get('PS_COMPARATOR_MAX_ITEM')))
|
||||
CompareProduct::addGuestCompareProduct((int)self::$cookie->id_guest, (int)Tools::getValue('id_product'));
|
||||
else
|
||||
die('0');
|
||||
}
|
||||
}
|
||||
elseif (Tools::getValue('action') == 'remove')
|
||||
{
|
||||
if (isset(self::$cookie->id_customer))
|
||||
CompareProduct::removeCustomerCompareProduct((int)self::$cookie->id_customer, (int)Tools::getValue('id_product'));
|
||||
elseif (isset(self::$cookie->id_guest))
|
||||
CompareProduct::removeGuestCompareProduct((int)self::$cookie->id_guest, (int)Tools::getValue('id_product'));
|
||||
else
|
||||
die('0');
|
||||
}
|
||||
else
|
||||
die('0');
|
||||
|
||||
die('1');
|
||||
}
|
||||
}
|
||||
|
||||
public function process()
|
||||
{
|
||||
parent::process();
|
||||
|
||||
//Clean compare product table
|
||||
CompareProduct::cleanCompareProducts('week');
|
||||
|
||||
$hasProduct = false;
|
||||
$product_list = Tools::getValue('compare_product_list');
|
||||
$postProducts = isset($product_list) ? rtrim($product_list,'|') : '';
|
||||
|
||||
if (!Configuration::get('PS_COMPARATOR_MAX_ITEM'))
|
||||
return Tools::redirect('index.php?controller=404');
|
||||
|
||||
if ($postProducts)
|
||||
{
|
||||
if ($product_list = Tools::getValue('compare_product_list') AND $postProducts = (isset($product_list) ? rtrim($product_list,'|') : ''))
|
||||
$ids = array_unique(explode('|', $postProducts));
|
||||
elseif (isset(self::$cookie->id_customer))
|
||||
$ids = CompareProduct::getCustomerCompareProducts(self::$cookie->id_customer);
|
||||
elseif(isset(self::$cookie->id_guest))
|
||||
$ids = CompareProduct::getGuestCompareProducts(self::$cookie->id_guest);
|
||||
else
|
||||
$ids = null;
|
||||
|
||||
if ($ids)
|
||||
{
|
||||
if (sizeof($ids) > 0)
|
||||
{
|
||||
if (sizeof($ids) > Configuration::get('PS_COMPARATOR_MAX_ITEM'))
|
||||
|
||||
@@ -146,6 +146,7 @@ class OrderDetailControllerCore extends FrontController
|
||||
'messages' => Message::getMessagesByOrderId((int)($order->id)),
|
||||
'CUSTOMIZE_FILE' => _CUSTOMIZE_FILE_,
|
||||
'CUSTOMIZE_TEXTFIELD' => _CUSTOMIZE_TEXTFIELD_,
|
||||
'isRecyclable' => Configuration::get('PS_RECYCLABLE_PACK'),
|
||||
'use_tax' => Configuration::get('PS_TAX'),
|
||||
'group_use_tax' => (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC),
|
||||
'customizedDatas' => $customizedDatas));
|
||||
|
||||
@@ -360,7 +360,9 @@ class ParentOrderControllerCore extends FrontController
|
||||
$this->context->smarty->assign(array(
|
||||
'checked' => $this->_setDefaultCarrierSelection($carriers),
|
||||
'carriers' => $carriers,
|
||||
'default_carrier' => (int)(Configuration::get('PS_CARRIER_DEFAULT')),
|
||||
'default_carrier' => (int)(Configuration::get('PS_CARRIER_DEFAULT'))
|
||||
));
|
||||
self::$smarty->assign(array(
|
||||
'HOOK_EXTRACARRIER' => Module::hookExec('extraCarrier', array('address' => $address)),
|
||||
'HOOK_BEFORECARRIER' => Module::hookExec('beforeCarrier', array('carriers' => $carriers))
|
||||
));
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
class ProductControllerCore extends FrontController
|
||||
{
|
||||
protected $product;
|
||||
public $php_self = 'product.php';
|
||||
protected $canonicalURL;
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
@@ -49,11 +51,28 @@ class ProductControllerCore extends FrontController
|
||||
$this->addJS(_PS_JS_DIR_.'jquery/jquery.jqzoom.js');
|
||||
}
|
||||
}
|
||||
|
||||
public function canonicalRedirection()
|
||||
{
|
||||
// Automatically redirect to the canonical URL if the current in is the right one
|
||||
// $_SERVER['HTTP_HOST'] must be replaced by the real canonical domain
|
||||
if (Validate::isLoadedObject($this->product))
|
||||
{
|
||||
$canonicalURL = self::$link->getProductLink($this->product);
|
||||
if (!preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/', Tools::getProtocol().$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']))
|
||||
{
|
||||
header('HTTP/1.0 301 Moved');
|
||||
if (defined('_PS_MODE_DEV_') AND _PS_MODE_DEV_)
|
||||
die('[Debug] This page has moved<br />Please use the following URL instead: <a href="'.$canonicalURL.'">'.$canonicalURL.'</a>');
|
||||
Tools::redirectLink($canonicalURL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function preProcess()
|
||||
{
|
||||
if ($id_product = (int)Tools::getValue('id_product'))
|
||||
$this->product = new Product($id_product, true, $this->context->language->id, $this->id_current_shop);
|
||||
$this->product = new Product($id_product, true, $this->context->language->id);
|
||||
|
||||
if (!Validate::isLoadedObject($this->product))
|
||||
{
|
||||
@@ -61,42 +80,16 @@ class ProductControllerCore extends FrontController
|
||||
header('Status: 404 Not Found');
|
||||
}
|
||||
else
|
||||
{
|
||||
// Automatically redirect to the canonical URL if the current in is the right one
|
||||
// $_SERVER['HTTP_HOST'] must be replaced by the real canonical domain
|
||||
if (Validate::isLoadedObject($this->product))
|
||||
{
|
||||
$canonicalURL = $this->context->link->getProductLink($this->product);
|
||||
if (!preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/i', Tools::getProtocol().$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']))
|
||||
{
|
||||
header('HTTP/1.0 301 Moved');
|
||||
if (defined('_PS_MODE_DEV_') AND _PS_MODE_DEV_)
|
||||
die('[Debug] This page has moved<br />Please use the following URL instead: <a href="'.$canonicalURL.'">'.$canonicalURL.'</a>');
|
||||
Tools::redirectLink($canonicalURL);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->canonicalRedirection();
|
||||
|
||||
parent::preProcess();
|
||||
|
||||
if((int)(Configuration::get('PS_REWRITING_SETTINGS')))
|
||||
if ($id_product = (int)Tools::getValue('id_product'))
|
||||
{
|
||||
$rewrite_infos = Product::getUrlRewriteInformations((int)$id_product);
|
||||
|
||||
$default_rewrite = array();
|
||||
foreach ($rewrite_infos AS $infos)
|
||||
$default_rewrite[$infos['id_lang']] = $this->context->link->getProductLink((int)$id_product, $infos['link_rewrite'], $infos['category_rewrite'], $infos['ean13'], (int)$infos['id_lang']);
|
||||
|
||||
$this->context->smarty->assign('lang_rewrite_urls', $default_rewrite);
|
||||
}
|
||||
}
|
||||
|
||||
public function process()
|
||||
{
|
||||
parent::process();
|
||||
|
||||
if (!$id_product = (int)(Tools::getValue('id_product')) OR !Validate::isUnsignedId($id_product))
|
||||
if (!Validate::isLoadedObject($this->product))
|
||||
$this->errors[] = Tools::displayError('Product not found');
|
||||
else
|
||||
{
|
||||
@@ -105,7 +98,7 @@ class ProductControllerCore extends FrontController
|
||||
|| !file_exists(dirname(__FILE__).'/../'.Tools::getValue('ad').'/ajax.php')))
|
||||
{
|
||||
header('HTTP/1.1 404 page not found');
|
||||
$this->errors[] = Tools::displayError('Pproduct is no longer available.');
|
||||
$this->errors[] = Tools::displayError('Product is no longer available.');
|
||||
}
|
||||
elseif (!$this->product->checkAccess(isset($this->context->customer) ? $this->context->customer->id : 0))
|
||||
$this->errors[] = Tools::displayError('You do not have access to this product.');
|
||||
@@ -116,9 +109,6 @@ class ProductControllerCore extends FrontController
|
||||
if (!$this->product->active)
|
||||
$this->context->smarty->assign('adminActionDisplay', true);
|
||||
|
||||
/* rewrited url set */
|
||||
$rewrited_url = $this->context->link->getProductLink($this->product->id, $this->product->link_rewrite);
|
||||
|
||||
/* Product pictures management */
|
||||
require_once('images.inc.php');
|
||||
$this->context->smarty->assign('customizationFormTarget', Tools::safeOutput(urldecode($_SERVER['REQUEST_URI'])));
|
||||
@@ -152,16 +142,11 @@ class ProductControllerCore extends FrontController
|
||||
'pictures' => $pictures,
|
||||
'textFields' => $textFields));
|
||||
|
||||
$productPriceWithTax = Product::getPriceStatic($id_product, true, NULL, 6);
|
||||
if (Product::$_taxCalculationMethod == PS_TAX_INC)
|
||||
$productPriceWithTax = Tools::ps_round($productPriceWithTax, 2);
|
||||
|
||||
$productPriceWithoutEcoTax = (float)($productPriceWithTax - $this->product->ecotax);
|
||||
$configs = Configuration::getMultiple(array('PS_ORDER_OUT_OF_STOCK', 'PS_LAST_QTIES'));
|
||||
|
||||
/* Features / Values */
|
||||
$features = $this->product->getFrontFeatures($this->context->language->id);
|
||||
$attachments = $this->product->getAttachments($this->context->language->id);
|
||||
$attachments = ($this->product->cache_has_attachments) ? $this->product->getAttachments($this->context->language->id) : array();
|
||||
|
||||
/* Category */
|
||||
$category = false;
|
||||
@@ -169,13 +154,13 @@ class ProductControllerCore extends FrontController
|
||||
{
|
||||
if (isset($regs[2]) AND is_numeric($regs[2]))
|
||||
{
|
||||
if (Product::idIsOnCategoryId((int)($this->product->id), array('0' => array('id_category' => (int)($regs[2])))))
|
||||
$category = new Category((int)($regs[2]), (int)$this->context->cookie->id_lang);
|
||||
if (Product::idIsOnCategoryId($this->product->id, array('0' => array('id_category' => (int)$regs[2]))))
|
||||
$category = new Category($regs[2], $this->context->language->id);
|
||||
}
|
||||
elseif (isset($regs[5]) AND is_numeric($regs[5]))
|
||||
{
|
||||
if (Product::idIsOnCategoryId((int)($this->product->id), array('0' => array('id_category' => (int)($regs[5])))))
|
||||
$category = new Category((int)($regs[5]), (int)$this->context->cookie->id_lang);
|
||||
if (Product::idIsOnCategoryId($this->product->id, array('0' => array('id_category' => (int)$regs[5]))))
|
||||
$category = new Category($regs[5], $this->context->language->id);
|
||||
}
|
||||
}
|
||||
if (!$category)
|
||||
@@ -184,12 +169,13 @@ class ProductControllerCore extends FrontController
|
||||
if (isset($category) AND Validate::isLoadedObject($category))
|
||||
{
|
||||
$this->context->smarty->assign(array(
|
||||
'path' => Tools::getPath((int)$category->id, $this->product->name, true),
|
||||
'category' => $category,
|
||||
'subCategories' => $category->getSubCategories($this->context->language->id, true),
|
||||
'id_category_current' => (int)($category->id),
|
||||
'id_category_parent' => (int)($category->id_parent),
|
||||
'return_category_name' => Tools::safeOutput($category->name)));
|
||||
'path' => Tools::getPath((int)$category->id, $this->product->name, true),
|
||||
'category' => $category,
|
||||
'subCategories' => $category->getSubCategories($this->context->language->id, true),
|
||||
'id_category_current' => (int)($category->id),
|
||||
'id_category_parent' => (int)($category->id_parent),
|
||||
'return_category_name' => Tools::safeOutput($category->name),
|
||||
));
|
||||
}
|
||||
else
|
||||
$this->context->smarty->assign('path', Tools::getPath((int)$this->product->id_category_default, $this->product->name));
|
||||
@@ -197,7 +183,7 @@ class ProductControllerCore extends FrontController
|
||||
$this->context->smarty->assign('return_link', (isset($category->id) AND $category->id) ? Tools::safeOutput($this->context->link->getCategoryLink($category)) : 'javascript: history.back();');
|
||||
|
||||
$lang = Configuration::get('PS_LANG_DEFAULT');
|
||||
if (Pack::isPack((int)($this->product->id), (int)($lang)) AND !Pack::isInStock((int)($this->product->id), (int)($lang)))
|
||||
if (Pack::isPack($this->product->id) AND !Pack::isInStock((int)$this->product->id, $lang))
|
||||
$this->product->quantity = 0;
|
||||
|
||||
$id_customer = (isset($this->context->customer) ? (int)($this->context->customer->id) : 0);
|
||||
@@ -209,8 +195,13 @@ class ProductControllerCore extends FrontController
|
||||
$tax = (float)(Tax::getProductTaxRate((int)($this->product->id), $this->context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}));
|
||||
$this->context->smarty->assign('tax_rate', $tax);
|
||||
|
||||
$productPriceWithTax = Product::getPriceStatic($this->product->id, true, NULL, 6);
|
||||
if (Product::$_taxCalculationMethod == PS_TAX_INC)
|
||||
$productPriceWithTax = Tools::ps_round($productPriceWithTax, 2);
|
||||
$productPriceWithoutEcoTax = (float)($productPriceWithTax - $this->product->ecotax);
|
||||
|
||||
$ecotax_rate = (float) Tax::getProductEcotaxRate($this->context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')});
|
||||
$ecotaxTaxAmount = Tools::ps_round($this->product->ecotax, 2);
|
||||
$ecotaxTaxAmount = Tools::ps_round($this->product->ecotax, 2);
|
||||
if (Product::$_taxCalculationMethod == PS_TAX_INC && (int)Configuration::get('PS_TAX'))
|
||||
$ecotaxTaxAmount = Tools::ps_round($ecotaxTaxAmount * (1 + $ecotax_rate / 100), 2);
|
||||
|
||||
@@ -221,13 +212,13 @@ class ProductControllerCore extends FrontController
|
||||
'ecotax_tax_exc' => Tools::ps_round($this->product->ecotax, 2),
|
||||
'ecotaxTax_rate' => $ecotax_rate,
|
||||
'homeSize' => Image::getSize('home'),
|
||||
'product_manufacturer' => new Manufacturer((int)($this->product->id_manufacturer), Configuration::get('PS_LANG_DEFAULT')),
|
||||
'product_manufacturer' => new Manufacturer($this->product->id_manufacturer, $this->context->language->id),
|
||||
'token' => Tools::getToken(false),
|
||||
'productPriceWithoutEcoTax' => (float)($productPriceWithoutEcoTax),
|
||||
'productPriceWithoutEcoTax' => (float)$productPriceWithoutEcoTax,
|
||||
'features' => $features,
|
||||
'attachments' => $attachments,
|
||||
'allow_oosp' => $this->product->isAvailableWhenOutOfStock((int)($this->product->out_of_stock)),
|
||||
'last_qties' => (int)($configs['PS_LAST_QTIES']),
|
||||
'last_qties' => (int)Configuration::get('PS_LAST_QTIES'),
|
||||
'group_reduction' => $group_reduction,
|
||||
'col_img_dir' => _PS_COL_IMG_DIR_,
|
||||
));
|
||||
@@ -241,7 +232,7 @@ class ProductControllerCore extends FrontController
|
||||
'HOOK_PRODUCT_TAB_CONTENT' => Module::hookExec('productTabContent')
|
||||
));
|
||||
|
||||
$images = $this->product->getImages((int)$this->context->cookie->id_lang);
|
||||
$images = $this->product->getImages((int)$this->context->language->id);
|
||||
$productImages = array();
|
||||
foreach ($images AS $k => $image)
|
||||
{
|
||||
@@ -252,7 +243,7 @@ class ProductControllerCore extends FrontController
|
||||
$cover['id_image'] = (Configuration::get('PS_LEGACY_IMAGES') ? ($this->product->id.'-'.$image['id_image']) : $image['id_image']);
|
||||
$cover['id_image_only'] = (int)($image['id_image']);
|
||||
}
|
||||
$productImages[(int)($image['id_image'])] = $image;
|
||||
$productImages[(int)$image['id_image']] = $image;
|
||||
}
|
||||
if (!isset($cover))
|
||||
$cover = array('id_image' => $this->context->language->iso_code.'-default', 'legend' => 'No picture', 'title' => 'No picture');
|
||||
@@ -348,7 +339,7 @@ class ProductControllerCore extends FrontController
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'no_tax' => Tax::excludeTaxeOption() OR !Tax::getProductTaxRate((int)$this->product->id, $this->context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}),
|
||||
'customizationFields' => $this->product->getCustomizationFields($this->context->language->id)
|
||||
'customizationFields' => ($this->product->customizable) ? $this->product->getCustomizationFields($this->context->language->id) : false,
|
||||
));
|
||||
|
||||
// Pack management
|
||||
@@ -362,7 +353,7 @@ class ProductControllerCore extends FrontController
|
||||
'outOfStockAllowed' => (int)(Configuration::get('PS_ORDER_OUT_OF_STOCK')),
|
||||
'errors' => $this->errors,
|
||||
'categories' => Category::getHomeCategories($this->context->language->id),
|
||||
'have_image' => Product::getCover((int)(Tools::getValue('id_product'))),
|
||||
'have_image' => (isset($cover) ? (int)$cover['id_image'] : false),
|
||||
'tax_enabled' => Configuration::get('PS_TAX'),
|
||||
'display_qties' => (int)(Configuration::get('PS_DISPLAY_QTIES')),
|
||||
'display_ht' => !Tax::excludeTaxeOption(),
|
||||
@@ -383,7 +374,7 @@ class ProductControllerCore extends FrontController
|
||||
|
||||
public function pictureUpload(Product $product, Cart $cart)
|
||||
{
|
||||
if (!$fieldIds = $product->getCustomizationFieldIds())
|
||||
if (!$fieldIds = $this->product->getCustomizationFieldIds())
|
||||
return false;
|
||||
$authorizedFileFields = array();
|
||||
foreach ($fieldIds AS $fieldId)
|
||||
@@ -454,16 +445,15 @@ class ProductControllerCore extends FrontController
|
||||
foreach ($specificPrices AS $key => &$row)
|
||||
{
|
||||
$row['quantity'] = &$row['from_quantity'];
|
||||
if ($row['price'] != 0) // The price may be directly set
|
||||
// The price may be directly set
|
||||
if ($row['price'] != 0)
|
||||
{
|
||||
$cur_price = (Product::$_taxCalculationMethod == PS_TAX_EXC ? $row['price'] : $row['price'] * (1 + $taxRate / 100));
|
||||
|
||||
if ($row['reduction_type'] == 'amount')
|
||||
{
|
||||
$cur_price = Product::$_taxCalculationMethod == PS_TAX_INC ? $cur_price - $row['reduction'] : $cur_price - ($row['reduction'] / (1 + $taxRate / 100));
|
||||
} else {
|
||||
else
|
||||
$cur_price = $cur_price * ( 1 - ($row['reduction']));
|
||||
}
|
||||
|
||||
$row['real_value'] = $price - $cur_price;
|
||||
}
|
||||
@@ -481,4 +471,3 @@ class ProductControllerCore extends FrontController
|
||||
return $specificPrices;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
73
css/jquery.treeview.css
Executable file
@@ -0,0 +1,73 @@
|
||||
.treeview, .treeview ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.treeview ul {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.treeview .hitarea {
|
||||
background: url(../img/admin/jquery-treeview/treeview-default.gif) -64px -25px no-repeat;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
margin-left: -16px;
|
||||
float: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
/* fix for IE6 */
|
||||
* html .hitarea {
|
||||
display: inline;
|
||||
float:none;
|
||||
}
|
||||
|
||||
.treeview li {
|
||||
margin: 0;
|
||||
padding: 3px 0pt 3px 16px;
|
||||
}
|
||||
|
||||
.treeview a.selected {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
#treecontrol { margin: 1em 0; display: none; }
|
||||
|
||||
.treeview .hover { color: gray; cursor: pointer; }
|
||||
|
||||
.treeview li { background: url(../img/admin/jquery-treeview/treeview-default-line.gif) 0 0 no-repeat; }
|
||||
.treeview li.collapsable, .treeview li.expandable { background-position: 0 -176px; }
|
||||
|
||||
.treeview .expandable-hitarea { background-position: -80px -3px; }
|
||||
|
||||
.treeview li.last { background-position: 0 -1766px }
|
||||
.treeview li.lastCollapsable, .treeview li.lastExpandable { background-image: url(../img/admin/jquery-treeview/treeview-default.gif); }
|
||||
.treeview li.lastCollapsable { background-position: 0 -111px }
|
||||
.treeview li.lastExpandable { background-position: -32px -67px }
|
||||
|
||||
.treeview div.lastCollapsable-hitarea, .treeview div.lastExpandable-hitarea { background-position: 0; }
|
||||
|
||||
.treeview-red li { background-image: url(../img/admin/jquery-treeview/treeview-red-line.gif); }
|
||||
.treeview-red .hitarea, .treeview-red li.lastCollapsable, .treeview-red li.lastExpandable { background-image: url(../img/admin/jquery-treeview/treeview-red.gif); }
|
||||
|
||||
.treeview-black li { background-image: url(../img/admin/jquery-treeview/treeview-black-line.gif); }
|
||||
.treeview-black .hitarea, .treeview-black li.lastCollapsable, .treeview-black li.lastExpandable { background-image: url(../img/admin/jquery-treeview/treeview-black.gif); }
|
||||
|
||||
.treeview-gray li { background-image: url(../img/admin/jquery-treeview/treeview-gray-line.gif); }
|
||||
.treeview-gray .hitarea, .treeview-gray li.lastCollapsable, .treeview-gray li.lastExpandable { background-image: url(../img/admin/jquery-treeview/treeview-gray.gif); }
|
||||
|
||||
.treeview-famfamfam li { background-image: url(../img/admin/jquery-treeview/treeview-famfamfam-line.gif); }
|
||||
.treeview-famfamfam .hitarea, .treeview-famfamfam li.lastCollapsable, .treeview-famfamfam li.lastExpandable { background-image: url(../img/admin/jquery-treeview/treeview-famfamfam.gif); }
|
||||
|
||||
.treeview .placeholder {
|
||||
background: url(../img/admin/jquery-treeview/ajax-loader.gif) 0 0 no-repeat;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.filetree li { padding: 3px 0 2px 16px; }
|
||||
.filetree span.folder, .filetree span.file { padding: 1px 0 1px 16px; display: block; }
|
||||
.filetree span.folder { background: url(../img/admin/jquery-treeview/folder.gif) 0 0 no-repeat; }
|
||||
.filetree li.expandable span.folder { background: url(../img/admin/jquery-treeview/folder-closed.gif) 0 0 no-repeat; }
|
||||
.filetree span.file { background: url(../img/admin/jquery-treeview/file.gif) 0 0 no-repeat; }
|
||||
BIN
img/admin/ajax-loader-big.gif
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
img/admin/color_swatch.png
Normal file
|
After Width: | Height: | Size: 209 B |
BIN
img/admin/jquery-treeview/ajax-loader.gif
Executable file
|
After Width: | Height: | Size: 847 B |
BIN
img/admin/jquery-treeview/file.gif
Executable file
|
After Width: | Height: | Size: 110 B |
BIN
img/admin/jquery-treeview/folder-closed.gif
Executable file
|
After Width: | Height: | Size: 105 B |
BIN
img/admin/jquery-treeview/folder.gif
Executable file
|
After Width: | Height: | Size: 106 B |
BIN
img/admin/jquery-treeview/minus.gif
Executable file
|
After Width: | Height: | Size: 837 B |
BIN
img/admin/jquery-treeview/plus.gif
Executable file
|
After Width: | Height: | Size: 841 B |
BIN
img/admin/jquery-treeview/treeview-black-line.gif
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
img/admin/jquery-treeview/treeview-black.gif
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
img/admin/jquery-treeview/treeview-default-line.gif
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
img/admin/jquery-treeview/treeview-default.gif
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
img/admin/jquery-treeview/treeview-famfamfam-line.gif
Executable file
|
After Width: | Height: | Size: 807 B |
BIN
img/admin/jquery-treeview/treeview-famfamfam.gif
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
img/admin/jquery-treeview/treeview-gray-line.gif
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
img/admin/jquery-treeview/treeview-gray.gif
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
img/admin/jquery-treeview/treeview-red-line.gif
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
img/admin/jquery-treeview/treeview-red.gif
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
@@ -463,7 +463,9 @@ class GetVersionFromDb
|
||||
// List keys
|
||||
$struct[$virtualTable]['@keys'] = array();
|
||||
$sql = 'SHOW INDEX FROM ' . $table;
|
||||
foreach (Db::getInstance()->executeS($sql) as $rowIndex)
|
||||
$results = Db::getInstance()->executeS($sql);
|
||||
if($results)
|
||||
foreach ($results as $rowIndex)
|
||||
{
|
||||
$keyName = strtolower($rowIndex['Key_name']);
|
||||
$type = 'index';
|
||||
|
||||
@@ -28,9 +28,15 @@ class ToolsInstall
|
||||
{
|
||||
public static function checkDB ($srv, $login, $password, $name, $posted = true, $engine = false)
|
||||
{
|
||||
include_once(INSTALL_PATH.'/../classes/Validate.php');
|
||||
include_once(INSTALL_PATH.'/../classes/Db.php');
|
||||
include_once(INSTALL_PATH.'/../classes/MySQL.php');
|
||||
// Don't include theses files if classes are already defined
|
||||
if (!class_exists('Validate', false))
|
||||
include_once(INSTALL_PATH.'/../classes/Validate.php');
|
||||
|
||||
if (!class_exists('Db', false))
|
||||
include_once(INSTALL_PATH.'/../classes/Db.php');
|
||||
|
||||
if (!class_exists('MySQL', false))
|
||||
include_once(INSTALL_PATH.'/../classes/MySQL.php');
|
||||
|
||||
if($posted)
|
||||
{
|
||||
|
||||
@@ -73,6 +73,9 @@ function showStep(aStep, way)
|
||||
.removeClass("selected")
|
||||
.removeClass("finished");
|
||||
if (step < 6) {
|
||||
if (step == 5)
|
||||
$('#tabs li:nth-child(' + step + ')').addClass("finished");
|
||||
else
|
||||
$('#tabs li:nth-child(' + step + ')').addClass("selected");
|
||||
$('#tabs li:lt(' + (step - 1) + ')').addClass("finished");
|
||||
}
|
||||
@@ -106,7 +109,7 @@ function showStep(aStep, way)
|
||||
$('#tabs li:nth-child(1)').removeClass("selected").addClass("finished");
|
||||
$('#tabs li:nth-child(2)').removeClass("selected").addClass("finished");
|
||||
$('#tabs li:nth-child(3)').removeClass("selected").addClass("finished");
|
||||
$('#tabs li:nth-child(4)').addClass("selected").removeClass("finished");
|
||||
$('#tabs li:nth-child(4)').addClass("finished");
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -276,26 +279,26 @@ function verifyAndSetRequire(firsttime)
|
||||
for (i = 0; i < testListRequired.length; i++){
|
||||
result = testListRequired[i].getAttribute("result");
|
||||
$($("div#sheet_require"+isUpdate+" > ul#required"+isUpdate+" .required")[i])
|
||||
.removeClass( (result == "fail") ? "ok" : "fail" )
|
||||
.removeClass( (result == "fail") ? "okBlock" : "errorBlock" )
|
||||
.addClass(result);
|
||||
if (result == "fail") configIsOk = false;
|
||||
}
|
||||
|
||||
|
||||
testListOptional = testLists[1].getElementsByTagName('test');
|
||||
|
||||
for (i = 0; i < testListOptional.length; i++){
|
||||
result = testListOptional[i].getAttribute("result");
|
||||
$($("div#sheet_require"+isUpdate+" > ul#optional"+isUpdate+" li.optional")[i])
|
||||
.removeClass( (result == "fail") ? "ok" : "fail" )
|
||||
.removeClass( (result == "fail") ? "okBlock" : "errorBlock" )
|
||||
.addClass(result);
|
||||
}
|
||||
|
||||
if (!configIsOk) {
|
||||
$('#btNext').attr({'disabled':'disabled','class':'button little disabled'});
|
||||
$('h3#resultConfig'+isUpdate).html(txtConfigIsNotOk).slideDown('slow');
|
||||
$('h3#resultConfig'+isUpdate).html(txtConfigIsNotOk).removeClass('okBlock').addClass('errorBlock').slideDown('slow');
|
||||
$('h3#resultConfigHelper').show();
|
||||
$("div#sheet_require"+isUpdate+" > ul").slideDown("1500");
|
||||
$('#stepList_2 li:contains("Etape 2")').addClass('ko');
|
||||
} else {
|
||||
$("#btNext").removeAttr('disabled');
|
||||
$('#btNext').removeClass('disabled');
|
||||
@@ -305,9 +308,10 @@ function verifyAndSetRequire(firsttime)
|
||||
$("input#btNext").click();
|
||||
else
|
||||
{
|
||||
$('h3#resultConfig'+isUpdate).html(txtConfigIsOk).slideDown('slow');
|
||||
$('h3#resultConfig'+isUpdate).html(txtConfigIsOk).removeClass('errorBlock').addClass('okBlock').slideDown('slow');
|
||||
$('h3#resultConfigHelper').hide();
|
||||
$("div#sheet_require"+isUpdate+" > ul").slideDown("1500");
|
||||
$('#stepList_2 li:contains("Etape 2")').removeClass('ko');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -320,32 +324,38 @@ function verifyDbAccess ()
|
||||
//local verifications
|
||||
if($("#dbServer[value=]").length > 0)
|
||||
{
|
||||
$("#dbResultCheck").addClass("fail").removeClass("ok").removeClass('userInfos').html(txtDbServerEmpty).show('slow');
|
||||
$("#dbResultCheck").addClass("errorBlock").removeClass("okBlock").removeClass('infosBlock').html(txtDbServerEmpty).slideDown('slow');
|
||||
$('#stepList_3 li:contains("Etape 3")').addClass('ko');
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#dbResultCheck").removeClass("fail").removeClass("ok").removeClass('userInfos').html('');
|
||||
$("#dbResultCheck").removeClass("errorBlock").removeClass("okBlock").removeClass('infosBlock').html('');
|
||||
$('#stepList_3 li:contains("Etape 3")').removeClass('ko');
|
||||
}
|
||||
|
||||
if($("#dbLogin[value=]").length > 0)
|
||||
{
|
||||
$("#dbResultCheck").addClass("fail").removeClass("ok").removeClass('userInfos').html(txtDbLoginEmpty).show('slow');
|
||||
$("#dbResultCheck").addClass("errorBlock").removeClass("okBlock").removeClass('infosBlock').html(txtDbLoginEmpty).slideDown('slow');
|
||||
$('#stepList_3 li:contains("Etape 3")').addClass('ko');
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#dbResultCheck").removeClass("fail").removeClass("ok").removeClass('userInfos').html('');
|
||||
$("#dbResultCheck").removeClass("errorBlock").removeClass("okBlock").removeClass('infosBlock').html('');
|
||||
$('#stepList_3 li:contains("Etape 3")').removeClass('ko');
|
||||
}
|
||||
|
||||
if($("#dbName[value=]").length > 0)
|
||||
{
|
||||
$("#dbResultCheck").addClass("fail").removeClass("ok").removeClass('userInfos').html(txtDbNameEmpty).show('slow');
|
||||
$("#dbResultCheck").addClass("errorBlock").removeClass("okBlock").removeClass('infosBlock').html(txtDbNameEmpty).slideDown('slow');
|
||||
$('#stepList_3 li:contains("Etape 3")').addClass('ko');
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#dbResultCheck").removeClass("fail").removeClass("ok").removeClass('userInfos').html('');
|
||||
$("#dbResultCheck").removeClass("errorBlock").removeClass("okBlock").removeClass('infosBlock').html('');
|
||||
$('#stepList_3 li:contains("Etape 3")').removeClass('ko');
|
||||
}
|
||||
|
||||
//external verifications and sets
|
||||
@@ -367,21 +377,23 @@ function verifyDbAccess ()
|
||||
if (ret.getAttribute("result") == "ok")
|
||||
{
|
||||
$("#dbResultCheck")
|
||||
.addClass("ok")
|
||||
.removeClass("fail")
|
||||
.addClass("okBlock")
|
||||
.removeClass("errorBlock")
|
||||
.html(txtError[23])
|
||||
.show('slow');
|
||||
.slideDown('slow');
|
||||
$("#dbCreateResultCheck")
|
||||
.hide('slow');
|
||||
.slideUp('slow');
|
||||
$('#stepList_3 li:contains("Etape 3")').removeClass('ko');
|
||||
} else
|
||||
{
|
||||
$("#dbResultCheck")
|
||||
.addClass("fail")
|
||||
.removeClass("ok")
|
||||
.addClass("errorBlock")
|
||||
.removeClass("okBlock")
|
||||
.html(txtError[parseInt(ret.getAttribute("error"))])
|
||||
.show('slow');
|
||||
.slideDown('slow');
|
||||
$("#dbCreateResultCheck")
|
||||
.hide('slow');
|
||||
.slideUp('slow');
|
||||
$('#stepList_3 li:contains("Etape 3")').addClass('ko');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -416,11 +428,12 @@ function createDB()
|
||||
action_ret = ret.getElementsByTagName('action')[0];
|
||||
} catch (e) {
|
||||
$("#dbCreateResultCheck")
|
||||
.addClass("fail")
|
||||
.removeClass("ok")
|
||||
.removeClass('userInfos')
|
||||
.addClass("errorBlock")
|
||||
.removeClass("okBlock")
|
||||
.removeClass('infosBlock')
|
||||
.html(ret)
|
||||
.show();
|
||||
$('#stepList_3 li:contains("Etape 3")').addClass('ko');
|
||||
return;
|
||||
}
|
||||
if (action_ret.getAttribute("result") == "ok")
|
||||
@@ -452,9 +465,9 @@ function createDB()
|
||||
if (action_ret.getAttribute("error") == "11")
|
||||
{
|
||||
$("#dbCreateResultCheck")
|
||||
.addClass("fail")
|
||||
.removeClass("ok")
|
||||
.removeClass('userInfos')
|
||||
.addClass("errorBlock")
|
||||
.removeClass("okBlock")
|
||||
.removeClass('infosBlock')
|
||||
.html(
|
||||
txtError[11]+ "<br />\'"+
|
||||
action_ret.getAttribute("sqlQuery") + "\'<br/>"+
|
||||
@@ -465,12 +478,13 @@ function createDB()
|
||||
else
|
||||
{
|
||||
$("#dbCreateResultCheck")
|
||||
.addClass("fail")
|
||||
.removeClass("ok")
|
||||
.removeClass('userInfos')
|
||||
.addClass("errorBlock")
|
||||
.removeClass("okBlock")
|
||||
.removeClass('infosBlock')
|
||||
.html(txtError[parseInt(action_ret.getAttribute("error"))])
|
||||
.show();
|
||||
}
|
||||
$('#stepList_3 li:contains("Etape 3")').addClass('ko');
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -482,29 +496,27 @@ function verifyMail()
|
||||
//local verifications
|
||||
if ($("#testEmail[value=]").length > 0)
|
||||
{
|
||||
$("#mailResultCheck").addClass("fail").removeClass("ok").removeClass('userInfos').html(txtError[0]);
|
||||
$("#mailResultCheck").addClass("errorBlock").removeClass("okBlock").removeClass('infosBlock').html(txtError[0]);
|
||||
return false;
|
||||
}
|
||||
else if (!verifMailREGEX.test( $("#testEmail").val() ))
|
||||
{
|
||||
$("#mailResultCheck").addClass("fail").removeClass("ok").removeClass('userInfos').html(txtError[3]);
|
||||
$("#mailResultCheck").addClass("errorBlock").removeClass("okBlock").removeClass('infosBlock').html(txtError[3]);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (smtpChecked)
|
||||
{
|
||||
//local verifications
|
||||
if($("#smtpSrv[value=]").length > 0)
|
||||
{
|
||||
$("#mailResultCheck").addClass("fail").removeClass("ok").removeClass('userInfos').html(txtSmtpSrvEmpty);
|
||||
$("#mailResultCheck").addClass("errorBlock").removeClass("okBlock").removeClass('infosBlock').html(txtSmtpSrvEmpty);
|
||||
smtpIsOk = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//external verifications and sets
|
||||
$.ajax(
|
||||
{
|
||||
@@ -528,13 +540,13 @@ function verifyMail()
|
||||
|
||||
if (ret.getAttribute("result") == "ok")
|
||||
{
|
||||
$("#mailResultCheck").addClass("ok").removeClass("fail").removeClass('userInfos').html(mailSended);
|
||||
$("#mailResultCheck").addClass("okBlock").removeClass("errorBlock").removeClass('infosBlock').html(mailSended);
|
||||
mailIsOk = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
mailIsOk = false;
|
||||
$("#mailResultCheck").addClass("fail").removeClass("ok").removeClass('userInfos').html(txtError[26]);
|
||||
$("#mailResultCheck").addClass("errorBlock").removeClass("okBlock").removeClass('infosBlock').html(txtError[26]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -559,13 +571,13 @@ function uploadLogo ()
|
||||
{
|
||||
if(data.error != '')
|
||||
{
|
||||
$("#resultInfosLogo").html( txtError[parseInt(data.error)] ).addClass("fail").show();
|
||||
$("#resultInfosLogo").html( txtError[parseInt(data.error)] ).addClass("errorBlock").show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).attr('src', ps_base_uri + 'img/logo.jpg?' + (new Date()))
|
||||
$(this).show('slow');
|
||||
$("#resultInfosLogo").html("").removeClass("fail").hide();
|
||||
$("#resultInfosLogo").html("").removeClass("errorBlock").hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -573,7 +585,7 @@ function uploadLogo ()
|
||||
error: function (data, status, e)
|
||||
{
|
||||
$("#uploadedImage").attr('src', ps_base_uri + 'img/logo.jpg?' + (new Date()));
|
||||
$("#resultInfosLogo").html("").addClass("fail");
|
||||
$("#resultInfosLogo").html("").addClass("errorBlock");
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -621,7 +633,7 @@ function ajaxRefreshField(nthField, idResultField, fieldsList, inputId)
|
||||
{
|
||||
$("#"+idResultField)
|
||||
.html( txtError[parseInt(fieldsList[nthField].getAttribute("error"))] )
|
||||
.addClass("fail")
|
||||
.addClass("errorBlock")
|
||||
.show("slow");
|
||||
if (validShopInfos)
|
||||
$("#"+inputId).focus();
|
||||
@@ -631,7 +643,7 @@ function ajaxRefreshField(nthField, idResultField, fieldsList, inputId)
|
||||
{
|
||||
$("#"+idResultField)
|
||||
.html("")
|
||||
.removeClass("fail")
|
||||
.removeClass("errorBlock")
|
||||
.show("slow");
|
||||
return true;
|
||||
}
|
||||
@@ -651,7 +663,7 @@ function verifyShopInfos()
|
||||
$.ajax(
|
||||
{
|
||||
url: "model.php",
|
||||
async: false,
|
||||
async: true,
|
||||
cache: false,
|
||||
data:
|
||||
"method=checkShopInfos"+
|
||||
@@ -676,9 +688,7 @@ function verifyShopInfos()
|
||||
"&smtpPort="+ encodeURIComponent($("input#smtpPort").val())+
|
||||
"&smtpEnc="+ encodeURIComponent($("select#smtpEnc option:selected").val())+
|
||||
"&mailSubject="+ encodeURIComponent(mailSubject)+
|
||||
"&isoCodeLocalLanguage="+isoCodeLocalLanguage
|
||||
,
|
||||
|
||||
"&isoCodeLocalLanguage="+isoCodeLocalLanguage,
|
||||
success: function(ret)
|
||||
{
|
||||
fieldsList = ret.getElementsByTagName('shopConfig')[0].getElementsByTagName('field');
|
||||
@@ -702,6 +712,7 @@ function verifyShopInfos()
|
||||
$('#endFirstName').html($('input#infosFirstname').val());
|
||||
$('#endName').html($('input#infosName').val());
|
||||
$('#endEmail').html($('input#infosEmail').val());
|
||||
showStep(5);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -719,14 +730,14 @@ function autoCheckField(idField, idResultSpan, typeVerif)
|
||||
{
|
||||
$(idResultSpan)
|
||||
.show("slow")
|
||||
.addClass("fail")
|
||||
.addClass("errorBlock")
|
||||
.html(txtError[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$(idResultSpan)
|
||||
.hide("slow")
|
||||
.removeClass("fail")
|
||||
.removeClass("errorBlock")
|
||||
.html("");
|
||||
}
|
||||
}
|
||||
@@ -741,14 +752,14 @@ function autoCheckField(idField, idResultSpan, typeVerif)
|
||||
{
|
||||
$(idResultSpan)
|
||||
.show("slow")
|
||||
.addClass("fail")
|
||||
.addClass("errorBlock")
|
||||
.html(txtError[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$(idResultSpan)
|
||||
.hide("slow")
|
||||
.removeClass("fail")
|
||||
.removeClass("errorBlock")
|
||||
.html("");
|
||||
}
|
||||
}
|
||||
@@ -763,14 +774,14 @@ function autoCheckField(idField, idResultSpan, typeVerif)
|
||||
{
|
||||
$(idResultSpan)
|
||||
.show("slow")
|
||||
.addClass("fail")
|
||||
.addClass("errorBlock")
|
||||
.html(txtError[47]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$(idResultSpan)
|
||||
.hide("slow")
|
||||
.removeClass("fail")
|
||||
.removeClass("errorBlock")
|
||||
.html("");
|
||||
}
|
||||
}
|
||||
@@ -785,14 +796,14 @@ function autoCheckField(idField, idResultSpan, typeVerif)
|
||||
{
|
||||
$(idResultSpan)
|
||||
.show("slow")
|
||||
.addClass("fail")
|
||||
.addClass("errorBlock")
|
||||
.html(txtError[48]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$(idResultSpan)
|
||||
.hide("slow")
|
||||
.removeClass("fail")
|
||||
.removeClass("errorBlock")
|
||||
.html("");
|
||||
}
|
||||
}
|
||||
@@ -841,8 +852,7 @@ function doUpgrade()
|
||||
url: "model.php",
|
||||
cache: false,
|
||||
data:
|
||||
"method=doUpgrade&customModule=" + customModule+ ""
|
||||
,
|
||||
"method=doUpgrade&customModule=" + customModule+ "",
|
||||
success: function(ret)
|
||||
{
|
||||
var ret;
|
||||
@@ -859,18 +869,19 @@ function doUpgrade()
|
||||
{
|
||||
requests = ret.getElementsByTagName('request');
|
||||
$("#updateLog").empty();
|
||||
|
||||
$("#updateLog").hide();
|
||||
$(requests).each(function()
|
||||
{
|
||||
$("#updateLog").append("<div class='request'>" + $(this).children("sqlQuery").text() + "</div><br/>");
|
||||
var html = "<div class='request'>" + $(this).children("sqlQuery").text();
|
||||
if($(this).attr("result") == "fail")
|
||||
{
|
||||
countSqlError++;
|
||||
$("#updateLog").append("<span class='fail'>(" + $(this).children("sqlNumberError").text() + ") " + $(this).children("sqlMsgError").text() + "</span><br/>");
|
||||
html += "<br /><span class='fail'>(" + $(this).children("sqlNumberError").text() + ") " + $(this).children("sqlMsgError").text() + "</span><br style='clear:both;'/>";
|
||||
}
|
||||
$("#updateLog").append(html+"</div><br/>");
|
||||
});
|
||||
if (ret.getAttribute("error") == "34")
|
||||
$("#txtErrorUpdateSQL").html(txtError[35]+" "+countSqlError+" "+txtError[36]);
|
||||
$("#txtErrorUpdateSQL").html(txtError[35]+" "+countSqlError+" "+txtError[36]).show();
|
||||
showStep(9);
|
||||
}
|
||||
else
|
||||
@@ -905,29 +916,18 @@ $(document).ready(
|
||||
$("#container").show();
|
||||
|
||||
//ajax animation
|
||||
$("#loader").ajaxStart(
|
||||
$("#loaderSpace").ajaxStart(
|
||||
function()
|
||||
{
|
||||
$(this).fadeIn();
|
||||
$("#btNext[disabled!=1], #btBack[disabled!=1]").attr("disabled", "disabled").addClass("disabled").addClass("lockedForAjax");
|
||||
$(this).fadeIn('slow');
|
||||
$(this).children('div').fadeIn('slow');
|
||||
}
|
||||
);
|
||||
$("#loader").ajaxComplete(
|
||||
$("#loaderSpace").ajaxComplete(
|
||||
function(e, xhr, settings)
|
||||
{
|
||||
$(this).fadeOut();
|
||||
if (!errorOccured)
|
||||
{
|
||||
$(".lockedForAjax").removeAttr("disabled").removeClass("disabled").removeClass("lockedForAjax");
|
||||
if (step == 1)
|
||||
$("#btNext[disabled!=1], #btBack[disabled!=1]").attr("disabled", "disabled").addClass("disabled").addClass("lockedForAjax");
|
||||
if (step == 6)
|
||||
{
|
||||
$('#btNext, #btBack').removeAttr('disabled').removeClass('disabled');
|
||||
if (!$('#btDisclaimerOk').is(':checked'))
|
||||
$("#btNext[disabled!=1]").attr("disabled", "disabled").addClass("disabled").addClass("lockedForAjax");
|
||||
}
|
||||
}
|
||||
$(this).fadeOut('slow');
|
||||
$(this).children('div').fadeOut('slow');
|
||||
errorOccured = false;
|
||||
}
|
||||
);
|
||||
@@ -950,6 +950,7 @@ $(document).ready(
|
||||
);
|
||||
|
||||
//set SMTP pannels states
|
||||
$("div#mailSMTPParam").hide();
|
||||
$("#set_stmp").bind("click",
|
||||
function()
|
||||
{
|
||||
@@ -958,13 +959,10 @@ $(document).ready(
|
||||
case 0 :
|
||||
$("div#mailSMTPParam").slideUp('slow');
|
||||
smtpChecked = false;
|
||||
$("#mailResultCheck").addClass("userInfos").removeClass("ok").removeClass('fail').html("");
|
||||
break;
|
||||
|
||||
case 1 :
|
||||
$("div#mailSMTPParam").slideDown('slow');
|
||||
smtpChecked = true;
|
||||
$("#mailResultCheck").addClass("userInfos").removeClass("ok").removeClass('fail').html("");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
BIN
install-dev/img/ajax-loader.gif
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
install-dev/img/bg-contentTitle.png
Executable file
|
After Width: | Height: | Size: 215 B |
BIN
install-dev/img/bg-input-text.png
Executable file
|
After Width: | Height: | Size: 141 B |
BIN
install-dev/img/bg-li-headerLinks.png
Executable file
|
After Width: | Height: | Size: 233 B |
BIN
install-dev/img/bg-li-tabs-finished.png
Executable file
|
After Width: | Height: | Size: 298 B |
BIN
install-dev/img/bg-li-tabs.png
Executable file
|
After Width: | Height: | Size: 139 B |
BIN
install-dev/img/bg-phone_block.png
Executable file
|
After Width: | Height: | Size: 1006 B |
BIN
install-dev/img/bg_blockInfoEnd.png
Executable file
|
After Width: | Height: | Size: 218 B |
BIN
install-dev/img/bg_bt_blockInfoEnd.png
Executable file
|
After Width: | Height: | Size: 885 B |
BIN
install-dev/img/bg_li_stepList.png
Executable file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
install-dev/img/bg_li_title.png
Executable file
|
After Width: | Height: | Size: 204 B |
BIN
install-dev/img/bg_loaderSpace.png
Executable file
|
After Width: | Height: | Size: 109 B |
BIN
install-dev/img/bg_moduleTable_th.png
Executable file
|
After Width: | Height: | Size: 262 B |
BIN
install-dev/img/bt - Copie.png
Executable file
|
After Width: | Height: | Size: 772 B |
BIN
install-dev/img/bt-dsbl - Copie.png
Executable file
|
After Width: | Height: | Size: 474 B |
|
Before Width: | Height: | Size: 474 B After Width: | Height: | Size: 248 B |
|
Before Width: | Height: | Size: 752 B After Width: | Height: | Size: 251 B |
|
Before Width: | Height: | Size: 772 B After Width: | Height: | Size: 251 B |
BIN
install-dev/img/bt_off.png
Executable file
|
After Width: | Height: | Size: 251 B |
BIN
install-dev/img/bt_off_hover.png
Executable file
|
After Width: | Height: | Size: 251 B |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 4.3 KiB |
BIN
install-dev/img/pict_error.png
Executable file
|
After Width: | Height: | Size: 450 B |
BIN
install-dev/img/pict_h3_infos.png
Executable file
|
After Width: | Height: | Size: 453 B |
BIN
install-dev/img/pict_ok.png
Executable file
|
After Width: | Height: | Size: 374 B |
BIN
install-dev/img/visu_boBlock.png
Executable file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
install-dev/img/visu_foBlock.png
Executable file
|
After Width: | Height: | Size: 11 KiB |
@@ -245,18 +245,30 @@ if ($lm->getIncludeTradFilename())
|
||||
</div>
|
||||
|
||||
<div id="container">
|
||||
<div id="header" class="clearfix">
|
||||
<ul id="headerLinks">
|
||||
<li class="lnk_forum"><a href="http://www.prestashop.com/forums/" target="_blank"><?php echo lang('Forum'); ?></a></li>
|
||||
<li class="lnk_blog last"><a href="http://www.prestashop.com/blog/"><?php echo lang('Blog'); ?></a></li>
|
||||
<?php if ((isset($_GET['language']) AND $_GET['language'] == 1) OR $lm->getIsoCodeSelectedLang() == 'fr'): ?>
|
||||
<li id="phone_block" class="last">
|
||||
<div><?php echo '<span>'.lang('Contact us!').'</span><br />'.lang('+33 (0)1.40.18.30.04'); ?></div>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
|
||||
<div id="PrestaShopLogo">PrestaShop</div>
|
||||
|
||||
<div id="infosSup">
|
||||
<div class="installerVersion" id="installerVersion-<?php echo $lm->getIsoCodeSelectedLang()?>">PrestaShop <?php echo INSTALL_VERSION.'<br />'.lang('Installer'); ?></div>
|
||||
<div class="updaterVersion" id="updaterVersion-<?php echo $lm->getIsoCodeSelectedLang()?>">PrestaShop <?php echo INSTALL_VERSION.'<br />'.lang('Updater'); ?></div>
|
||||
</div>
|
||||
</div><!-- /end header -->
|
||||
|
||||
<div id="loaderSpace">
|
||||
<div id="loader"> </div>
|
||||
</div>
|
||||
</div><!-- /end loaderSpace -->
|
||||
|
||||
<div id="leftpannel">
|
||||
<h1>
|
||||
<div id="PrestaShopLogo"> </div>
|
||||
<div class="installerVersion" id="installerVersion-<?php echo $lm->getIsoCodeSelectedLang()?>">PrestaShop <?php echo INSTALL_VERSION.'<br />'.lang('Installer'); ?></div>
|
||||
<div class="updaterVersion" id="updaterVersion-<?php echo $lm->getIsoCodeSelectedLang()?>">PrestaShop <?php echo INSTALL_VERSION.'<br />'.lang('Updater'); ?></div>
|
||||
</h1>
|
||||
|
||||
<ol id="tabs"><li> </li></ol>
|
||||
|
||||
<div id="help">
|
||||
@@ -265,27 +277,28 @@ if ($lm->getIncludeTradFilename())
|
||||
<div class="content">
|
||||
<p class="title"><?php echo lang('Need help?'); ?></p>
|
||||
<p class="title_down"><?php echo lang('All tips and advice about PrestaShop'); ?></p>
|
||||
|
||||
<ul>
|
||||
<li><img src="img/puce.gif" alt="" /> <a href="http://www.prestashop.com/forums/" target="_blank"><?php echo lang('Forum'); ?></a><br class="clear" /></li>
|
||||
<li><img src="img/puce.gif" alt="" /> <a href="http://www.prestashop.com/blog/"><?php echo lang('Blog'); ?></a><br class="clear" /></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ((isset($_GET['language']) AND $_GET['language'] == 1) OR $lm->getIsoCodeSelectedLang() == 'fr'): ?>
|
||||
<p id="phone_block">
|
||||
<?php echo '<span>'.lang('A question about PrestaShop or issues during installation or upgrade? Call us!').'</span><br /><img src="img/phone.png" style="vertical-align: middle;" alt="" /> '.lang('+33 (0)1.40.18.30.04'); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div><!-- /end help -->
|
||||
</div><!-- /end leftpannel -->
|
||||
|
||||
|
||||
<div id="sheets">
|
||||
|
||||
<div class="sheet shown" id="sheet_lang">
|
||||
<h2><?php echo lang('Welcome')?></h2>
|
||||
<h3><?php echo lang('Welcome to the PrestaShop '.INSTALL_VERSION.' Installer.')?><br /><?php echo lang('Please allow 5-15 minutes to complete the installation process.')?></h3>
|
||||
<div class="contentTitle">
|
||||
<h1><?php echo lang('Welcome')?></h1>
|
||||
|
||||
<ul id="stepList_1" class="stepList clearfix">
|
||||
<li>Etape 1</li>
|
||||
<li>Etape 2</li>
|
||||
<li>Etape 3</li>
|
||||
<li>Etape 4</li>
|
||||
<li>Etape 5</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h2><?php echo lang('Welcome to the PrestaShop '.INSTALL_VERSION.' Installer.')?></h2>
|
||||
<p><?php echo lang('Please allow 5-15 minutes to complete the installation process.')?></p>
|
||||
<p><?php echo lang('The PrestaShop Installer will do most of the work in just a few clicks.')?><br /><?php echo lang('However, you must know how to do the following manually:')?></p>
|
||||
<ul>
|
||||
<li><?php echo lang('Set permissions on folders & subfolders using Terminal or an FTP client')?></li>
|
||||
@@ -296,7 +309,7 @@ if ($lm->getIncludeTradFilename())
|
||||
<?php echo lang('For more information, please consult our') ?> <a href="http://www.prestashop.com/wiki/Getting_Started/"><?php echo lang('online documentation') ?></a>.
|
||||
</p>
|
||||
|
||||
<h3><?php echo lang('Choose the installer language:')?></h3>
|
||||
<h2><?php echo lang('Choose the installer language:')?></h2>
|
||||
<form id="formSetInstallerLanguage" action="<?php $_SERVER['REQUEST_URI']; ?>" method="get">
|
||||
<ul id="langList" style="line-height: 20px;">
|
||||
<?php foreach ($lm->getAvailableLangs() as $lang): ?>
|
||||
@@ -314,7 +327,7 @@ if ($lm->getIncludeTradFilename())
|
||||
<?php echo lang('Prestashop and community offers over 40 different languages for free download on'); ?> <a href="http://www.prestashop.com" target="_blank">http://www.prestashop.com</a>
|
||||
</p>
|
||||
|
||||
<h3><?php echo lang('Installation method')?></h3>
|
||||
<h2><?php echo lang('Installation method')?></h2>
|
||||
<form id="formSetMethod" action="<?php $_SERVER['REQUEST_URI']; ?>" method="post">
|
||||
<p><input <?php echo (!($oldversion AND !$tooOld AND !$sameVersions AND !$installOfOldVersion)) ? 'checked="checked"' : '' ?> type="radio" value="install" name="typeInstall" id="typeInstallInstall"/><label for="typeInstallInstall"><?php echo lang('Installation : complete install of the PrestaShop Solution')?></label></p>
|
||||
<p <?php echo ($oldversion AND !$tooOld AND !$sameVersions AND !$installOfOldVersion) ? '' : 'class="disabled"'; ?>><input <?php echo ($oldversion AND !$tooOld AND !$sameVersions AND !$installOfOldVersion) ? 'checked="checked"' : 'disabled="disabled"'; ?> type="radio" value="upgrade" name="typeInstall" id="typeInstallUpgrade"/><label <?php echo ($oldversion === false) ? 'class="disabled"' : ''; ?> for="typeInstallUpgrade"><?php echo lang('Upgrade: get the latest stable version!')?> <?php echo ($oldversion === false) ? lang('(no old version detected)') : ("(".( ($tooOld) ? lang('the already installed version detected is too old, no more update available') : ($installOfOldVersion ? lang('the already installed version detected is too recent, no update available') : lang('installed version detected').' : '.$oldversion )).")") ?></label></p>
|
||||
@@ -353,11 +366,20 @@ if ($lm->getIncludeTradFilename())
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="sheet" id="sheet_require">
|
||||
<div class="sheet clearfix" id="sheet_require">
|
||||
<div class="contentTitle">
|
||||
<h1><?php echo lang('System and permissions')?></h1>
|
||||
|
||||
<h2><?php echo lang('System and permissions')?></h2>
|
||||
<ul id="stepList_2" class="stepList clearfix">
|
||||
<li class="ok">Etape 1</li>
|
||||
<li>Etape 2</li>
|
||||
<li>Etape 3</li>
|
||||
<li>Etape 4</li>
|
||||
<li>Etape 5</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h3><?php echo lang('Required set-up. Please verify the following checklist items are true.')?></h3>
|
||||
<h2><?php echo lang('Required set-up. Please verify the following checklist items are true.')?></h2>
|
||||
|
||||
<p>
|
||||
<?php echo lang('If you have any questions, please visit our '); ?>
|
||||
@@ -366,7 +388,7 @@ if ($lm->getIncludeTradFilename())
|
||||
<a href="http://www.prestashop.com/forums/" target="_blank"><?php echo lang('Community Forum'); ?></a><?php echo lang('.'); ?>
|
||||
</p>
|
||||
|
||||
<h3 id="resultConfig" style="font-size: 20px; text-align: center; padding: 0px; display: none;"></h3>
|
||||
<h3 id="resultConfig"></h3>
|
||||
<ul id="required">
|
||||
<li class="title"><?php echo lang('PHP parameters:')?></li>
|
||||
<li class="required"><?php echo lang('PHP 5.0 or later installed')?></li>
|
||||
@@ -407,13 +429,24 @@ if ($lm->getIncludeTradFilename())
|
||||
|
||||
</div>
|
||||
|
||||
<div class="sheet" id="sheet_db">
|
||||
<h2><?php echo lang('Database configuration')?></h2>
|
||||
<div class="sheet clearfix" id="sheet_db">
|
||||
<div class="contentTitle">
|
||||
<h1><?php echo lang('Database configuration')?></h1>
|
||||
|
||||
<p><?php echo lang('Configure your database by filling out the following fields:')?></p>
|
||||
<ul id="stepList_3" class="stepList clearfix">
|
||||
<li class="ok">Etape 1</li>
|
||||
<li class="ok">Etape 2</li>
|
||||
<li>Etape 3</li>
|
||||
<li>Etape 4</li>
|
||||
<li>Etape 5</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="dbPart">
|
||||
<h2><?php echo lang('Configure your database by filling out the following fields:')?></h2>
|
||||
<p><?php echo lang('You have to create a database, help available in readme_en.txt'); ?></p>
|
||||
<form id="formCheckSQL" class="aligned" action="<?php $_SERVER['REQUEST_URI']; ?>" onsubmit="verifyDbAccess(); return false;" method="post">
|
||||
<h3 style="padding:0;margin:0;"><?php echo lang('You have to create a database, help available in readme_en.txt'); ?></h3>
|
||||
<p style="margin-top: 15px;">
|
||||
<p class="first" style="margin-top: 15px;">
|
||||
<label for="dbServer"><?php echo lang('Server:')?> </label>
|
||||
<input size="25" class="text" type="text" id="dbServer" value="localhost"/>
|
||||
</p>
|
||||
@@ -436,27 +469,32 @@ if ($lm->getIncludeTradFilename())
|
||||
<option value="MyISAM">MyISAM</option>
|
||||
</select>
|
||||
</p>
|
||||
<p class="last">
|
||||
<label for="db_prefix"><?php echo lang('Tables prefix:')?></label>
|
||||
<input class="text" type="text" id="db_prefix" value="ps_"/>
|
||||
</p>
|
||||
<p class="aligned">
|
||||
<input id="btTestDB" class="button" type="submit" value="<?php echo lang('Verify now!')?>"/>
|
||||
</p>
|
||||
<p id="dbResultCheck"></p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="dbTableParam">
|
||||
<form action="#" method="post" onsubmit="createDB(); return false;">
|
||||
<p><label for="db_prefix"><?php echo lang('Tables prefix:')?> </label><input class="text" type="text" id="db_prefix" value="ps_"/></p>
|
||||
<h2><?php echo lang('Installation type')?></h2>
|
||||
<p id="dbModeSetter" style="line-height: 20px;">
|
||||
<input value="lite" type="radio" name="db_mode" id="db_mode_simple" style="vertical-align: middle;" /><label for="db_mode_simple"><?php echo lang('Simple mode: Basic installation')?> <span style="color: #CC0000; font-weight: bold;"><?php echo lang('(FREE)'); ?></span></label><br />
|
||||
<input value="full" type="radio" name="db_mode" checked="checked" id="db_mode_complet" style="vertical-align: middle;" /><label for="db_mode_complet"><?php echo lang('Full mode: includes').' <b>'.lang('100+ additional modules').'</b> '.lang('and demo products'); ?> <span style="color: #CC0000; font-weight: bold;"><?php echo lang('(FREE too!)'); ?></span></label>
|
||||
<input value="lite" type="radio" name="db_mode" id="db_mode_simple" style="vertical-align: middle;" /> <label for="db_mode_simple"><?php echo lang('Simple mode: Basic installation')?> <span><?php echo lang('(FREE)'); ?></span></label><br />
|
||||
<input value="full" type="radio" name="db_mode" checked="checked" id="db_mode_complet" style="vertical-align: middle;" /> <label for="db_mode_complet"><?php echo lang('Full mode: includes').' <b>'.lang('100+ additional modules').'</b> '.lang('and demo products'); ?> <span><?php echo lang('(FREE too!)'); ?></span></label>
|
||||
</p>
|
||||
</form>
|
||||
<p id="dbCreateResultCheck"></p>
|
||||
</div>
|
||||
|
||||
<div id="mailPart">
|
||||
<h2><?php echo lang('E-mail delivery set-up')?></h2>
|
||||
|
||||
<p>
|
||||
<p id="configsmtp">
|
||||
<input type="checkbox" id="set_stmp" style="vertical-align: middle;" /><label for="set_stmp"><?php echo lang('Configure SMTP manually (advanced users only)'); ?></label><br/>
|
||||
<span class="userInfos"><?php echo lang('By default, the PHP \'mail()\' function is used'); ?></span>
|
||||
</p>
|
||||
@@ -478,7 +516,7 @@ if ($lm->getIncludeTradFilename())
|
||||
|
||||
<p>
|
||||
<label for="smtpPort"><?php echo lang('Port:'); ?></label>
|
||||
<input type="text" size="5" id="smtpPort" value="25" />
|
||||
<input type="text" size="5" id="smtpPort" value="25" class="text" />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -494,27 +532,41 @@ if ($lm->getIncludeTradFilename())
|
||||
</form>
|
||||
</div>
|
||||
<p>
|
||||
<input class="text" id="testEmail" type="text" size="15" value="<?php echo lang('enter@your.email'); ?>"></input>
|
||||
<input id="btVerifyMail" class="button" type="submit" value="<?php echo lang('Send me a test email!'); ?>"></input>
|
||||
<input class="text" id="testEmail" type="text" size="15" value="<?php echo lang('enter@your.email'); ?>" />
|
||||
<input id="btVerifyMail" class="button" type="submit" value="<?php echo lang('Send me a test email!'); ?>" />
|
||||
</p>
|
||||
|
||||
<p id="mailResultCheck" class="userInfos"></p>
|
||||
<p id="mailResultCheck"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sheet" id="sheet_infos">
|
||||
<div class="sheet clearfix" id="sheet_infos">
|
||||
<form action="<?php $_SERVER['REQUEST_URI']; ?>" method="post" onsubmit="return false;" enctype="multipart/form-data">
|
||||
<div class="contentTitle">
|
||||
<h1><?php echo lang('Shop configuration')?></h1>
|
||||
|
||||
<h2><?php echo lang('Shop configuration'); ?></h2>
|
||||
<ul id="stepList_4" class="stepList clearfix">
|
||||
<li class="ok">Etape 1 ok</li>
|
||||
<li class="ok">Etape 2 ok</li>
|
||||
<li class="ok">Etape 3 ok</li>
|
||||
<li>Etape 4</li>
|
||||
<li>Etape 5</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h3><?php echo lang('Merchant info'); ?></h3>
|
||||
<div id="infosShopBlock">
|
||||
<h2><?php echo lang('Merchant info'); ?></h2>
|
||||
<div class="field">
|
||||
<label for="infosShop" class="aligned"><?php echo lang('Shop name:'); ?> </label><input class="text required" type="text" id="infosShop" value=""/><br/>
|
||||
<label for="infosShop" class="aligned"><?php echo lang('Shop name:'); ?> </label>
|
||||
<span class="contentinput">
|
||||
<input class="text required" type="text" id="infosShop" value=""/> <sup class="required">*</sup>
|
||||
</span>
|
||||
<span id="resultInfosShop" class="result aligned"></span>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="infosActivity" class="aligned"><?php echo lang('Main activity:'); ?></label>
|
||||
<select id="infosActivity" style="border:1px solid #D41958">
|
||||
<span class="contentinput">
|
||||
<select id="infosActivity">
|
||||
<option value="0"><?php echo lang('-- Please choose your main activity --'); ?></option>
|
||||
<option value="1"><?php echo lang('Adult'); ?></option>
|
||||
<option value="2"><?php echo lang('Animals and Pets'); ?></option>
|
||||
@@ -538,64 +590,96 @@ if ($lm->getIncludeTradFilename())
|
||||
<option value="20"><?php echo lang('Travel'); ?></option>
|
||||
<option value="0"><?php echo lang('Other activity...'); ?></option>
|
||||
</select>
|
||||
</span>
|
||||
<p class="userInfos aligned"><?php echo lang('This information isn\'t required, it will be used for statistical purposes. This information doesn\'t change anything in your store.'); ?></p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="infosCountry" class="aligned"><?php echo lang('Default country:'); ?></label>
|
||||
<select id="infosCountry" style="width:175px;border:1px solid #D41958">
|
||||
<span class="contentinput">
|
||||
<select id="infosCountry">
|
||||
</select>
|
||||
</span>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="infosTimezone" class="aligned"><?php echo lang('Shop\'s timezone:'); ?></label>
|
||||
<select id="infosTimezone" style="width:175px;border:1px solid #D41958">
|
||||
<span class="contentinput">
|
||||
<select id="infosTimezone">
|
||||
</select>
|
||||
</span>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="infosLogo" class="aligned logo"><?php echo lang('Shop logo'); ?> : </label>
|
||||
<span class="contentinput">
|
||||
<p id="alignedLogo"><img id="uploadedImage" src="<?php echo PS_BASE_URI ?>img/logo.jpg" alt="Logo" /></p>
|
||||
</span>
|
||||
<p class="userInfos aligned"><?php echo lang('recommended dimensions: 230px X 75px'); ?></p>
|
||||
|
||||
<span id="inputFileLogo" class="contentinput">
|
||||
<input type="file" onchange="uploadLogo()" name="fileToUpload" id="fileToUpload"/>
|
||||
</span>
|
||||
<span id="resultInfosLogo" class="result"></span>
|
||||
<p class="userInfos aligned"><?php echo lang('recommended dimensions: 230px X 75px'); ?></p>
|
||||
<p id="alignedLogo"><img id="uploadedImage" src="<?php echo PS_BASE_URI ?>img/logo.jpg" alt="Logo" /></p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="catalogMode" class="aligned"><?php echo lang('Catalog mode:'); ?></label>
|
||||
<span class="contentinput">
|
||||
<input type="radio" name="catalogMode" id="catalogMode_1" value="1" />
|
||||
<label for="catalogMode_1"><?php echo lang('Yes'); ?></label>
|
||||
<label for="catalogMode_1" class="radiolabel"><?php echo lang('Yes'); ?></label>
|
||||
<input type="radio" name="catalogMode" id="catalogMode_0" value="0" checked="checked"/>
|
||||
<label for="catalogMode_0"><?php echo lang('No'); ?></label>
|
||||
<label for="catalogMode_0" class="radiolabel"><?php echo lang('No'); ?></label>
|
||||
</span>
|
||||
<p class="userInfos aligned"><?php echo lang('If you activate this feature, all purchase features will be disabled. You can activate this feature later in your back office'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="infosFirstname" class="aligned"><?php echo lang('First name:'); ?> </label><input class="text required" type="text" id="infosFirstname"/><br/>
|
||||
<label for="infosFirstname" class="aligned"><?php echo lang('First name:'); ?> </label>
|
||||
<span class="contentinput">
|
||||
<input class="text required" type="text" id="infosFirstname"/> <sup class="required">*</sup>
|
||||
</span>
|
||||
<span id="resultInfosFirstname" class="result aligned"></span>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="infosName" class="aligned"><?php echo lang('Last name:'); ?> </label><input class="text required" type="text" id="infosName"/><br/>
|
||||
<label for="infosName" class="aligned"><?php echo lang('Last name:'); ?> </label>
|
||||
<span class="contentinput">
|
||||
<input class="text required" type="text" id="infosName"/> <sup class="required">*</sup>
|
||||
</span>
|
||||
<span id="resultInfosName" class="result aligned"></span>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="infosEmail" class="aligned"><?php echo lang('E-mail address:'); ?> </label><input type="text" class="text required" id="infosEmail"/><br/>
|
||||
<label for="infosEmail" class="aligned"><?php echo lang('E-mail address:'); ?> </label>
|
||||
<span class="contentinput">
|
||||
<input type="text" class="text required" id="infosEmail"/> <sup class="required">*</sup>
|
||||
</span>
|
||||
<span id="resultInfosEmail" class="result aligned"></span>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="infosPassword" class="aligned"><?php echo lang('Shop password:'); ?> </label><input autocomplete="off" type="password" class="text required" id="infosPassword"/><br/>
|
||||
<label for="infosPassword" class="aligned"><?php echo lang('Shop password:'); ?> </label>
|
||||
<span class="contentinput">
|
||||
<input autocomplete="off" type="password" class="text required" id="infosPassword"/> <sup class="required">*</sup>
|
||||
</span>
|
||||
<span id="resultInfosPassword" class="result aligned"></span>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="aligned" for="infosPasswordRepeat"><?php echo lang('Re-type to confirm:'); ?> </label><input type="password" autocomplete="off" class="text required" id="infosPasswordRepeat"/><br/>
|
||||
<label class="aligned" for="infosPasswordRepeat"><?php echo lang('Re-type to confirm:'); ?> </label>
|
||||
<span class="contentinput">
|
||||
<input type="password" autocomplete="off" class="text required" id="infosPasswordRepeat"/> <sup class="required">*</sup>
|
||||
</span>
|
||||
<span id="resultInfosPasswordRepeat" class="result aligned"></span>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<div class="field" id="contentInfosNotification">
|
||||
<span class="contentinput">
|
||||
<input type="checkbox" id="infosNotification" class="aligned" style="vertical-align: middle;" /><label for="infosNotification"><?php echo lang('Receive notifications by e-mail'); ?></label><br/>
|
||||
<span id="resultInfosNotification" class="result aligned"></span>
|
||||
</span>
|
||||
|
||||
<p class="userInfos aligned"><?php echo lang('If you check this box and your mail configuration is wrong, your installation might be blocked. If so, please uncheck the box to go to the next step.'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="benefitsBlock">
|
||||
<!-- Partner Modules -->
|
||||
<?php
|
||||
if (!isset($_GET['language']))
|
||||
@@ -603,11 +687,7 @@ if ($lm->getIncludeTradFilename())
|
||||
?>
|
||||
<link href="../css/jquery.fancybox-1.3.4.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
<script src="../js/jquery/jquery.fancybox-1.3.4.js" type="text/javascript"></script>
|
||||
<style>
|
||||
.installModuleList { display: none; }
|
||||
.installModuleList.selected { display: block; }
|
||||
</style>
|
||||
<script>
|
||||
<script type="text/javascript">
|
||||
var moduleChecked = new Array();
|
||||
$(document).ready(function() {
|
||||
$('#infosCountry').change(function() {
|
||||
@@ -662,6 +742,14 @@ if ($lm->getIncludeTradFilename())
|
||||
foreach ($p->prechecked as $country_iso_code)
|
||||
$modulesPrechecked[trim($p->key)][trim($country_iso_code)] = 1;
|
||||
}
|
||||
echo '<table cellpadding="0" callspacing="0" border="0" class="moduleTable">
|
||||
<tr>
|
||||
<th style="width: 30px;"></th>
|
||||
<th style="width: 100px;">Modules</th>
|
||||
<th style="padding: 12px; width: 430px;">Avantages</th>
|
||||
</tr>
|
||||
</table>
|
||||
';
|
||||
|
||||
foreach ($modulesHelpInstall as $country_iso_code => $modulesList)
|
||||
{
|
||||
@@ -669,21 +757,20 @@ if ($lm->getIncludeTradFilename())
|
||||
foreach ($modulesList as $module)
|
||||
{
|
||||
echo '
|
||||
<table style="border: 1px solid #CCC; padding: 5px; width: 650px">
|
||||
<table cellpadding="0" callspacing="0" border="0" class="moduleTable">
|
||||
<tr>
|
||||
<td style="width: 100px; text-align: center;"><img src="'.$modulesDescription[$module]['logo'].'" alt="'.$modulesDescription[$module]['name'].'" title="'.$modulesDescription[$module]['name'].'">'.(isset($modulesDescription[$module]['more']) ? $modulesDescription[$module]['more'] : '').'</td>
|
||||
<td style="padding-left: 15px; width: 430px;">
|
||||
'.$modulesDescription[$module]['description'].'
|
||||
</td>
|
||||
<td style="text-align: center; width: 30px; background: #FFF;">
|
||||
<span style="padding: 3px 4px 6px 2px; background: none repeat scroll 0pt 0pt #7EB423;">
|
||||
<td valign="top" style="text-align: center; padding-top:10px; width: 30px; background: #FFF;">
|
||||
<span style="padding: 12px 4px 6px 2px;">
|
||||
<input type="checkbox" id="preInstallModules_'.$country_iso_code.'_'.$module.'" value="'.$module.'" class="'.$module.' preInstallModules_'.$country_iso_code.'" style="vertical-align: middle;" />
|
||||
</span>
|
||||
</td>
|
||||
<td valign="top" style="width: 100px; text-align: center;"><img src="'.$modulesDescription[$module]['logo'].'" alt="'.$modulesDescription[$module]['name'].'" title="'.$modulesDescription[$module]['name'].'">'.(isset($modulesDescription[$module]['more']) ? $modulesDescription[$module]['more'] : '').'</td>
|
||||
<td style="padding: 15px; width: 430px;">
|
||||
'.$modulesDescription[$module]['description'].'
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="3"><div id="divForm_'.$country_iso_code.'_'.$module.'"> </div></td></tr>
|
||||
</table>
|
||||
<br />';
|
||||
<tr><td colspan="3"><div id="divForm_'.$country_iso_code.'_'.$module.'"> </div></td></tr></table>
|
||||
';
|
||||
echo "<script>
|
||||
moduleChecked['".$country_iso_code.'_'.$module."'] = 0;
|
||||
$(document).ready(function() {
|
||||
@@ -745,7 +832,6 @@ if ($lm->getIncludeTradFilename())
|
||||
});
|
||||
});";
|
||||
}
|
||||
|
||||
echo "</script>";
|
||||
}
|
||||
echo '</div>';
|
||||
@@ -754,13 +840,8 @@ if ($lm->getIncludeTradFilename())
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- Partner Modules -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--<h3><?php echo lang('Shop\'s languages'); ?></h3>
|
||||
<p class="userInfos"><?php echo lang('Select the different languages available for your shop'); ?></p>-->
|
||||
<div id="availablesLanguages" style=" float:left; text-align: center; display:none;">
|
||||
@@ -798,31 +879,44 @@ if ($lm->getIncludeTradFilename())
|
||||
<?php }} ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div id="resultEnd">
|
||||
<span id="resultInfosSQL" class="result"></span>
|
||||
<span id="resultInfosLanguages" class="result"></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="sheet" id="sheet_end" style="padding:0">
|
||||
<div style="padding:1em">
|
||||
<h2><?php echo lang('PrestaShop is ready!'); ?></h2>
|
||||
<h3><?php echo lang('Your installation is finished!'); ?></h3>
|
||||
<div class="sheet clearfix" id="sheet_end">
|
||||
|
||||
<div class="contentTitle">
|
||||
<h1><?php echo lang('PrestaShop is ready!'); ?></h1>
|
||||
|
||||
<ul id="stepList_5" class="stepList clearfix">
|
||||
<li class="ok">Etape 1 ok</li>
|
||||
<li class="ok">Etape 2 ok</li>
|
||||
<li class="ok">Etape 3 ok</li>
|
||||
<li class="ok">Etape 4 ok</li>
|
||||
<li class="ok">Etape 5</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="clearfix">
|
||||
<h2><?php echo lang('Your installation is finished!'); ?></h2>
|
||||
<p><?php echo lang('You have just installed and configured PrestaShop as your online shop solution. We wish you all the best with the success of your online shop.'); ?></p>
|
||||
<p><?php echo lang('Here are your shop information. You can modify them once logged in.'); ?></p>
|
||||
<table id="resultInstall" cellspacing="0">
|
||||
<tr>
|
||||
<td class="label"><?php echo lang('Shop name:'); ?></td>
|
||||
<td id="endShopName" class="resultEnd"> </td>
|
||||
<table cellpadding="0" cellspacing="0" border="0" id="resultInstall" width="620">
|
||||
<tr class="odd">
|
||||
<td width="220" class="label"><?php echo lang('Shop name:'); ?></td>
|
||||
<td width="400" id="endShopName" class="resultEnd"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><?php echo lang('First name:'); ?></td>
|
||||
<td id="endFirstName" class="resultEnd"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="odd">
|
||||
<td class="label"><?php echo lang('Last name:'); ?></td>
|
||||
<td id="endName" class="resultEnd"> </td>
|
||||
</tr>
|
||||
@@ -831,23 +925,26 @@ if ($lm->getIncludeTradFilename())
|
||||
<td id="endEmail" class="resultEnd"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<h3><?php echo lang('WARNING: For more security, you must delete the \'install\' folder and readme files (readme_fr.txt, readme_en.txt, readme_es.txt, readme_de.txt, readme_it.txt, CHANGELOG).'); ?></h3>
|
||||
|
||||
<a href="../admin" id="access" class="BO" target="_blank">
|
||||
<span class="title"><?php echo lang('Back Office'); ?></span>
|
||||
<span class="description"><?php echo lang('Manage your store with your back office. Manage your orders and customers, add modules, change your theme, etc...'); ?></span>
|
||||
<span class="message"><?php echo lang('Manage your store'); ?></span>
|
||||
</a>
|
||||
<a href="../" id="access" class="FO" target="_blank">
|
||||
<span class="title"><?php echo lang('Front Office'); ?></span>
|
||||
<span class="description"><?php echo lang('Find your store as your future customers will see!'); ?></span>
|
||||
<span class="message"><?php echo lang('Discover your store'); ?></span>
|
||||
</a>
|
||||
<h3 class="infosBlock"><?php echo lang('WARNING: For more security, you must delete the \'install\' folder and readme files (readme_fr.txt, readme_en.txt, readme_es.txt, readme_de.txt, readme_it.txt, CHANGELOG).'); ?></h3>
|
||||
|
||||
<div id="boBlock" class="blockInfoEnd clearfix">
|
||||
<img src="img/visu_boBlock.png" />
|
||||
<h3><?php echo lang('Back Office'); ?></h3>
|
||||
<p class="description"><?php echo lang('Manage your store with your back office. Manage your orders and customers, add modules, change your theme, etc...'); ?></p>
|
||||
<a href="../admin" id="access" class="BO" target="_blank"><span><?php echo lang('Manage your store'); ?></span></a>
|
||||
</div>
|
||||
<div id="foBlock" class="blockInfoEnd last clearfix">
|
||||
<img src="img/visu_foBlock.png" />
|
||||
<h3><?php echo lang('Front Office'); ?></h3>
|
||||
<p class="description"><?php echo lang('Find your store as your future customers will see!'); ?></p>
|
||||
<a href="../" id="access" class="FO" target="_blank"><span><?php echo lang('Discover your store'); ?></span></a>
|
||||
</div>
|
||||
|
||||
<div id="resultEnd"></div>
|
||||
</div>
|
||||
<?php
|
||||
if (@fsockopen('addons.prestashop.com', 80, $errno, $errst, 3)): ?>
|
||||
|
||||
<iframe src="http://addons.prestashop.com/psinstall.php?lang=<?php echo $lm->getIsoCodeSelectedLang()?>" scrolling="no" id="prestastore">
|
||||
<p>Your browser does not support iframes.</p>
|
||||
</iframe>
|
||||
@@ -856,9 +953,18 @@ if ($lm->getIncludeTradFilename())
|
||||
|
||||
</div>
|
||||
|
||||
<div class="sheet" id="sheet_disclaimer">
|
||||
<h2><?php echo lang('Disclaimer'); ?></h2>
|
||||
<h3><?php echo lang('Warning: a manual backup is HIGHLY recommended before continuing!'); ?></h3>
|
||||
<div class="sheet clearfix" id="sheet_disclaimer">
|
||||
<div class="contentTitle">
|
||||
<h1><?php echo lang('Disclaimer'); ?></h1>
|
||||
|
||||
<ul id="stepList_6" class="stepList clearfix">
|
||||
<li class="ok">Etape 1</li>
|
||||
<li>Etape 2</li>
|
||||
<li>Etape 3</li>
|
||||
<li>Etape 4</li>
|
||||
</ul>
|
||||
</div>
|
||||
<h2><?php echo lang('Warning: a manual backup is HIGHLY recommended before continuing!'); ?></h2>
|
||||
<p><?php echo lang('Please backup the database and application files.'); ?></p>
|
||||
<p><?php echo lang('When your files and database are saving in an other support, please certify that your shop is really backed up.'); ?><br /><br /></p>
|
||||
|
||||
@@ -879,7 +985,7 @@ if ($lm->getIncludeTradFilename())
|
||||
$(document).ready(function() {
|
||||
$.ajax({
|
||||
url: 'xml/getNonNativeModules.php',
|
||||
async: false,
|
||||
async: true,
|
||||
dataType: "json",
|
||||
success: function (json)
|
||||
{
|
||||
@@ -962,20 +1068,20 @@ if ($lm->getIncludeTradFilename())
|
||||
if (sizeof($upgradeFiles))
|
||||
{
|
||||
echo '
|
||||
<table cellpadding="5" border="1" style="font-size: 11px; margin-top: 10px;">
|
||||
<table cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<th>'.lang('Upgrade file').'</th>
|
||||
<th style="width: 100px;">'.lang('Modifications to process').'</th>
|
||||
<th style="text-align: right;">'.lang('Modifications to process').'</th>
|
||||
</tr>';
|
||||
|
||||
uasort($upgradeFiles, 'sortnatversion');
|
||||
$totalInstructions = 0;
|
||||
foreach ($upgradeFiles AS $file)
|
||||
{
|
||||
echo '<tr><td style="'.($file['is_major'] ? 'font-weight: bold;' : 'padding-left: 12px;').'">v'.$file['version'].($file['is_major'] ? ' '.lang('(major)') : '').'</td><td style="text-align: right; padding-right: 5px;">'.(int)$file['instructions'].'</td></tr>';
|
||||
echo '<tr><td style="'.($file['is_major'] ? 'font-weight: bold;' : '').'">v'.$file['version'].($file['is_major'] ? ' '.lang('(major)') : '').'</td><td style="text-align: right;">'.(int)$file['instructions'].'</td></tr>';
|
||||
$totalInstructions += (int)$file['instructions'];
|
||||
}
|
||||
echo '<tr style="font-weight: bold;"><td>'.lang('TOTAL').'</td><td style="text-align: right; padding-right: 5px;">'.(int)$totalInstructions.'</td></tr>';
|
||||
echo '<tr style="font-weight: bold;"><td>'.lang('TOTAL').'</td><td style="text-align: right;">'.(int)$totalInstructions.'</td></tr>';
|
||||
echo '
|
||||
</table>';
|
||||
|
||||
@@ -983,7 +1089,7 @@ if ($lm->getIncludeTradFilename())
|
||||
$minutes = (int)($upgradeTime / 60);
|
||||
$seconds = (int)($upgradeTime - ($minutes * 60));
|
||||
|
||||
echo '<p><img src="../img/admin/time.gif" alt="" style="vertical-align: middle;" /> '.lang('Estimated time to complete the').' '.(int)$totalInstructions.' '.lang('modifications:').' <b style="font-size: 14px;">'.(int)$minutes.' '.($minutes > 1 ? lang('minutes') : lang('minute')).' '.(int)$seconds.' '.($seconds > 1 ? lang('seconds') : lang('second')).'</b><br />
|
||||
echo '<p><img src="../img/admin/time.gif" alt="" style="vertical-align: absmiddle;" /> '.lang('Estimated time to complete the').' '.(int)$totalInstructions.' '.lang('modifications:').' <b style="font-size: 14px;">'.(int)$minutes.' '.($minutes > 1 ? lang('minutes') : lang('minute')).' '.(int)$seconds.' '.($seconds > 1 ? lang('seconds') : lang('second')).'</b><br />
|
||||
<i style="font-size: 11px;">'.lang('Depending on your server and the size of your shop').'</i></p>';
|
||||
|
||||
if ($majorReleases > 1)
|
||||
@@ -1011,7 +1117,7 @@ if ($lm->getIncludeTradFilename())
|
||||
<br />
|
||||
<h2>'.lang('Hosting parameters').'</h2>
|
||||
<p>'.lang('PrestaShop tries to automatically set the best settings for your server in order the update to be successful.').'</p>
|
||||
<table cellpadding="5" border="1" style="font-size: 11px;">
|
||||
<table cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<th>'.lang('PHP parameter').'</th>
|
||||
<th>'.lang('Description').'</th>
|
||||
@@ -1028,28 +1134,32 @@ if ($lm->getIncludeTradFilename())
|
||||
<td style="text-align: right;">'.ini_get('memory_limit').'</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="font-weight: bold; background: '.$color.'; color: #000; padding: 10px; border: 1px solid #999; margin-top: 10px;">';
|
||||
<div class="infosBlock">';
|
||||
|
||||
if ($color == '#D9F2D0')
|
||||
echo '<img src="../img/admin/ok.gif" alt="" style="vertical-align: middle;" /> '.lang('All your settings seem to be OK, go for it!');
|
||||
echo '<img src="../img/admin/ok.gif" alt="" style="vertical-align: absmiddle;" /> '.lang('All your settings seem to be OK, go for it!');
|
||||
elseif ($color == '#FFDEB7')
|
||||
echo '<img src="../img/admin/warning.gif" alt="" style="vertical-align: middle;" /> '.lang('Beware, your settings look correct but are not optimal, if you encounter problems (upgrade too long, memory error...), please ask your hosting provider to increase the values of these parameters (max_execution_time & memory_limit).');
|
||||
echo '<img src="../img/admin/warning.gif" alt="" style="vertical-align: absmiddle;" /> '.lang('Beware, your settings look correct but are not optimal, if you encounter problems (upgrade too long, memory error...), please ask your hosting provider to increase the values of these parameters (max_execution_time & memory_limit).');
|
||||
elseif ($color == '#FAE2E3')
|
||||
echo '<img src="../img/admin/error2.png" alt="" style="vertical-align: middle;" /> '.lang('We strongly recommend that you inform your hosting provider to modify the settings before process to the update.');
|
||||
|
||||
echo '
|
||||
</div><br />';
|
||||
|
||||
echo '<img src="../img/admin/error2.png" alt="" style="vertical-align: absmiddle;" /> '.lang('We strongly recommend that you inform your hosting provider to modify the settings before process to the update.');
|
||||
echo '</div>';
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sheet" id="sheet_require_update">
|
||||
<div class="sheet clearfix" id="sheet_require_update">
|
||||
<div class="contentTitle">
|
||||
<h1><?php echo lang('System and permissions')?></h1>
|
||||
|
||||
<h2><?php echo lang('System and permissions'); ?></h2>
|
||||
|
||||
<h3><?php echo lang('Required set-up. Please verify the following checklist items are true.'); ?></h3>
|
||||
<ul id="stepList_7" class="stepList clearfix">
|
||||
<li class="ok">Etape 1 ok</li>
|
||||
<li class="ok">Etape 2 ok</li>
|
||||
<li>Etape 3</li>
|
||||
<li>Etape 4</li>
|
||||
</ul>
|
||||
</div>
|
||||
<h2><?php echo lang('Required set-up. Please verify the following checklist items are true.'); ?></h2>
|
||||
|
||||
<p>
|
||||
<?php echo lang('If you have any questions, please visit our '); ?>
|
||||
@@ -1058,7 +1168,7 @@ if ($lm->getIncludeTradFilename())
|
||||
<a href="http://www.prestashop.com/forums/" target="_blank"><?php echo lang('Community Forum'); ?></a><?php echo lang('.'); ?>
|
||||
</p>
|
||||
|
||||
<h3 id="resultConfig_update" style="font-size: 20px; text-align: center; padding: 0px; display: none;"></h3>
|
||||
<h3 id="resultConfig_update"></h3>
|
||||
<ul id="required_update">
|
||||
<li class="title"><?php echo lang('PHP parameters:')?></li>
|
||||
<li class="required"><?php echo lang('PHP 5.0 or later installed')?></li>
|
||||
@@ -1099,21 +1209,44 @@ if ($lm->getIncludeTradFilename())
|
||||
|
||||
</div>
|
||||
|
||||
<div class="sheet" id="sheet_updateErrors">
|
||||
<h2><?php echo lang('Error!'); ?></h2>
|
||||
<div class="sheet clearfix" id="sheet_updateErrors">
|
||||
<div class="contentTitle">
|
||||
<h1><?php echo lang('Error!'); ?></h1>
|
||||
|
||||
<ul id="stepList_8" class="stepList clearfix">
|
||||
<li class="ok">Etape 1 ok</li>
|
||||
<li class="ok">Etape 2 ok</li>
|
||||
<li class="ko">Etape 3</li>
|
||||
<li>Etape 4</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h3><?php echo lang('One or more errors have occurred, you can find more informations below or in the log/installation.log file.'); ?></h3>
|
||||
<p id="resultUpdate"></p>
|
||||
<p id="detailsError"></p>
|
||||
|
||||
<p id="resultUpdate" class="errorBlock"></p>
|
||||
<br />
|
||||
<p id="detailsError" class="infosBlock"><?php echo lang('No more informations'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="sheet" id="sheet_end_update" style="padding:0px;">
|
||||
<div style="padding:1em;">
|
||||
<div class="sheet clearfix" id="sheet_end_update">
|
||||
<div>
|
||||
<div class="contentTitle">
|
||||
<h1><?php echo lang('Your update is completed!'); ?></h1>
|
||||
<h3><?php echo lang('Your shop version is now').' '.INSTALL_VERSION; ?></h3>
|
||||
<p class="fail" id="txtErrorUpdateSQL"></p>
|
||||
<p><a href="javascript:showUpdateLog()"><?php echo lang('view the log'); ?></a></p>
|
||||
|
||||
<ul id="stepList_7" class="stepList clearfix">
|
||||
<li class="ok">Etape 1 ok</li>
|
||||
<li class="ok">Etape 2 ok</li>
|
||||
<li class="ok">Etape 3</li>
|
||||
<li class="ok">Etape 4</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="okBlock">
|
||||
<?php echo lang('Your shop version is now').' '.INSTALL_VERSION; ?>
|
||||
</div>
|
||||
<p class="errorBlock" id="txtErrorUpdateSQL" style="display:none;"></p>
|
||||
<p style="padding-bottom: 5px;"><a href="javascript:showUpdateLog()"><?php echo lang('view the log'); ?></a></p>
|
||||
<div id="updateLog"></div>
|
||||
<p><?php echo lang('You have just updated and configured PrestaShop as your online shop solution. We wish you all the best with the success of your online shop.'); ?></p><br />
|
||||
<p><?php echo lang('You have just updated and configured PrestaShop as your online shop solution. We wish you all the best with the success of your online shop.'); ?></p>
|
||||
|
||||
<?php
|
||||
|
||||
@@ -1121,19 +1254,23 @@ if ($lm->getIncludeTradFilename())
|
||||
{
|
||||
echo '
|
||||
<h2>'.lang('New features in PrestaShop v').INSTALL_VERSION.'</h2>
|
||||
<iframe style="width: 595px; margin-top: 5px; padding: 5px; border: 1px solid #BBB;" src="http://features.prestashop.com/lang/'.$lm->getIsoCodeSelectedLang().'/version/'.INSTALL_VERSION.'">
|
||||
<iframe style="width: 638px; margin-top: 5px; padding: 5px; border: 1px solid #BBB;" src="http://features.prestashop.com/lang/'.$lm->getIsoCodeSelectedLang().'/version/'.INSTALL_VERSION.'">
|
||||
<p>Your browser does not support iframes.</p>
|
||||
</iframe>';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<h3 style="margin-top: 15px;"><?php echo lang('WARNING: For more security, you must delete the \'install\' folder and readme files (readme_fr.txt, readme_en.txt, readme_es.txt, readme_de.txt, readme_it.txt, CHANGELOG).'); ?></h3>
|
||||
<a href="../" id="access_update" target="_blank">
|
||||
<span class="title"><?php echo lang('Front Office'); ?></span>
|
||||
<span class="description"><?php echo lang('Find your store as your future customers will see!'); ?></span>
|
||||
<span class="message"><?php echo lang('Discover your store'); ?></span>
|
||||
</a>
|
||||
<div class="infosBlock">
|
||||
<?php echo lang('WARNING: For more security, you must delete the \'install\' folder and readme files (readme_fr.txt, readme_en.txt, readme_es.txt, readme_de.txt, readme_it.txt, CHANGELOG).'); ?>
|
||||
</div>
|
||||
|
||||
<div id="foBlock" class="blockInfoEnd clearfix">
|
||||
<img src="img/visu_foBlock.png" />
|
||||
<h3><?php echo lang('Front Office'); ?></h3>
|
||||
<p class="description"><?php echo lang('Find your store as your future customers will see!'); ?></p>
|
||||
<a href="../" id="access" class="FO" target="_blank"><span><?php echo lang('Discover your store'); ?></span></a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if (@fsockopen('addons.prestashop.com', 80, $errno, $errst, 3)): ?>
|
||||
|
||||
@@ -177,8 +177,8 @@ $_LANG['Did you know?'] = 'Le saviez-vous ?';
|
||||
$_LANG['Prestashop and community offers over 40 different languages for free download on'] = 'Prestashop et sa communauté propose plus de 40 langues différentes en téléchargement gratuit sur';
|
||||
$_LANG['Default country:'] = 'Pays par défaut :';
|
||||
$_LANG['Shop\'s timezone:'] = 'Fuseau horaire de la boutique :';
|
||||
$_LANG['Your configuration is valid, click next to continue!'] = 'Votre configuration est valide,<br />cliquez sur suivant pour continuer !';
|
||||
$_LANG['Your configuration is invalid. Please fix the issues below:'] = 'Votre configuration n\'est pas valide,<br />merci de corriger ces problèmes :';
|
||||
$_LANG['Your configuration is valid, click next to continue!'] = 'Votre configuration est valide, cliquez sur suivant pour continuer !';
|
||||
$_LANG['Your configuration is invalid. Please fix the issues below:'] = 'Votre configuration n\'est pas valide, merci de corriger ces problèmes :';
|
||||
$_LANG['You have to create a database, help available in readme_en.txt'] = 'Vous devez au préalable créer une base de données (aide disponible dans le fichier readme.txt)';
|
||||
$_LANG['If you check this box and your mail configuration is wrong, your installation might be blocked. If so, please uncheck the box to go to the next step.'] = 'Cette option peut être bloquante si votre configuration e-mail est erronée, merci de la désactiver si vous ne pouvez pas passer à l\'étape suivante.';
|
||||
$_LANG['Mcrypt is available (recommended)'] = 'Mcrypt est disponible (recommandé)';
|
||||
|
||||
39
install-dev/php/alter_productcomments_guest_index.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
function alter_productcomments_guest_index()
|
||||
{
|
||||
Configuration::loadConfiguration();
|
||||
$productcomments = Module::getInstanceByName('productcomments');
|
||||
if (!$productcomments->id)
|
||||
return;
|
||||
|
||||
DB::getInstance()->Execute('
|
||||
ALTER TABLE `'._DB_PREFIX_.'product_comment` DROP INDEX `id_guest`,
|
||||
ADD INDEX `id_guest` USING BTREE(`id_guest`);');
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ CREATE TABLE `PREFIX_attachment` (
|
||||
`id_attachment` int(10) unsigned NOT NULL auto_increment,
|
||||
`file` varchar(40) NOT NULL,
|
||||
`file_name` varchar(128) NOT NULL,
|
||||
`mime` varchar(64) NOT NULL,
|
||||
`mime` varchar(128) NOT NULL,
|
||||
PRIMARY KEY (`id_attachment`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
@@ -290,6 +290,16 @@ CREATE TABLE `PREFIX_cms_category_lang` (
|
||||
KEY `category_name` (`name`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `PREFIX_compare_product` (
|
||||
`id_compare_product` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_guest` int(10) unsigned NOT NULL,
|
||||
`id_customer` int(10) unsigned NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_compare_product`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `PREFIX_configuration` (
|
||||
`id_configuration` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_group_shop` INT(11) UNSIGNED DEFAULT NULL,
|
||||
|
||||
@@ -712,8 +712,8 @@ INSERT INTO `PREFIX_tab` (`id_tab`, `class_name`, `id_parent`, `position`) VALUE
|
||||
(53, 'AdminBackup', 9, 8),(57, 'AdminCMSContent', 9, 9),(64, 'AdminGenerator', 9, 10),(43, 'AdminSearch', -1, 0),(69, 'AdminInformation', 9, 11),
|
||||
(70, 'AdminPerformance', 8, 11),(71, 'AdminCustomerThreads', 29, 4),(72, 'AdminWebservice', 9, 12),(73, 'AdminStockMvt', 1, 9),
|
||||
(80, 'AdminAddonsCatalog', 7, 1),(81, 'AdminAddonsMyAccount', 7, 2),(83, 'AdminThemes', 7, 3),(84, 'AdminGeolocation', 8, 12),
|
||||
(85, 'AdminTaxRulesGroup', 4, 3),(86, 'AdminLogs', 9, 13), (87, 'AdminCounty', 5, 4),(88,'AdminHome',-1,0),(89,'AdminShop', 0, 11), (90,'AdminGroupShop', 89, 1),
|
||||
(91, 'AdminShopUrl', 89, 2);
|
||||
(85, 'AdminTaxRulesGroup', 4, 3),(86, 'AdminLogs', 9, 13), (87, 'AdminCounty', 5, 4),(88,'AdminHome',-1,0),(89,'AdminUpgrade',9,14),(90,'AdminShop', 0, 11), (91,'AdminGroupShop', 90, 1),
|
||||
(92, 'AdminShopUrl', 90, 2);
|
||||
|
||||
INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) (SELECT 1, id_tab, 1, 1, 1, 1 FROM PREFIX_tab);
|
||||
|
||||
@@ -730,11 +730,11 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(1, 61, 'Search Engines'),(1, 62, 'Referrers'),(1, 63, 'Groups'),(1, 64, 'Generators'),(1, 65, 'Shopping Carts'),(1, 66, 'Tags'),(1, 67, 'Search'),
|
||||
(1, 68, 'Attachments'),(1, 69, 'Configuration Information'),(1, 70, 'Performance'),(1, 71, 'Customer Service'),(1, 72, 'Webservice'),(1, 73, 'Stock Movements'),
|
||||
(1, 80, 'Modules & Themes Catalog'),(1, 81, 'My Account'),(1, 82, 'Stores'),(1, 83, 'Themes'),(1, 84, 'Geolocation'),(1, 85, 'Tax Rules'),(1, 86, 'Log'),
|
||||
(1, 87, 'Counties'),(1, 88, 'Home'), (1, 89, 'Shops'), (1, 90, 'Group Shops'), (1, 91, 'Shop Urls');
|
||||
(1, 87, 'Counties'),(1, 88, 'Home'), (1, 89, 'Upgrade'),(1, 90, 'Shops'), (1, 91, 'Group Shops'), (1, 92, 'Shop Urls');
|
||||
|
||||
INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(2, 1, 'Catalogue'),(2, 2, 'Clients'),(2, 3, 'Commandes'),(2, 4, 'Paiement'),(2, 5, 'Transport'),
|
||||
(2, 6, 'Stats'),(2, 7, 'Modules'),(2, 8, 'Préférences'),(2, 9, 'Outils'),(2, 10, 'Fabricants'),(2, 11, 'Attributs et groupes'),(2, 12, 'Adresses'),(2, 13, 'Statuts'),
|
||||
(2, 6, 'Stats'),(2, 7, 'Modules'),(2, 8, 'Préférences'),(2, 9, 'Outils'),(2, 10, 'Marques'),(2, 11, 'Attributs et groupes'),(2, 12, 'Adresses'),(2, 13, 'Statuts'),
|
||||
(2, 14, 'Bons de réduction'),(2, 15, 'Devises'),(2, 16, 'Taxes'),(2, 17, 'Transporteurs'),(2, 18, 'Pays'),(2, 19, 'Zones'),(2, 20, 'Tranches de prix'),
|
||||
(2, 21, 'Tranches de poids'),(2, 22, 'Positions'),(2, 23, 'Base de données'),(2, 24, 'Emails'),(2, 26, 'Images'),(2, 27, 'Produits'),(2, 28, 'Contacts'),
|
||||
(2, 29, 'Employés'),(2, 30, 'Profils'),(2, 31, 'Permissions'),(2, 32, 'Langues'),(2, 33, 'Traductions'),(2, 34, 'Fournisseurs'),(2, 35, 'Onglets'),
|
||||
@@ -745,7 +745,7 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(2, 62, 'Sites affluents'),(2, 63, 'Groupes'),(2, 64, 'Générateurs'),(2, 65, 'Paniers'),(2, 66, 'Tags'),(2, 67, 'Recherche'),
|
||||
(2, 68, 'Documents joints'),(2, 69, 'Informations'),(2, 70, 'Performances'),(2, 71, 'SAV'),(2, 72, 'Service web'),(2, 73, 'Mouvements de Stock'),
|
||||
(2, 80, 'Catalogue de modules et thèmes'),(2, 81, 'Mon compte'),(2, 82, 'Magasins'),(2, 83, 'Thèmes'),(2, 84, 'Géolocalisation'),(2, 85, 'Règles de taxes'),(2, 86, 'Log'),
|
||||
(2, 87, 'Comtés'),(2,88,'Accueil'), (2, 89, 'Boutiques'), (2, 90, 'Groupes de boutique'), (2, 91, 'URLs de boutique');
|
||||
(2, 87, 'Comtés'),(2,88,'Accueil'),(2, 89, 'Mise à jour'), (2, 90, 'Boutiques'), (2, 91, 'Groupes de boutique'), (2, 92, 'URLs de boutique');
|
||||
|
||||
INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(3, 1, 'Catálogo'),(3, 2, 'Clientes'),(3, 3, 'Pedidos'),(3, 4, 'Pago'),(3, 5, 'Transporte'),
|
||||
@@ -758,8 +758,8 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(3, 49, 'Vales'),(3, 51, 'Configuración'),(3, 52, 'Subcampos'),(3, 53, 'Copia de seguridad'),(3, 54, 'Mensajes de Orden'),
|
||||
(3, 55, 'Albaranes de entrega'),(3, 56, 'SEO & URLs'),(3, 57, 'CMS'),(3, 58, 'Mapeo de la imagen'),(3, 59, 'Mensajes del cliente'),(3, 60, 'Rastreo'),
|
||||
(3, 61, 'Motores de búsqueda'),(3, 62, 'Referido'),(3, 63, 'Grupos'),(3, 64, 'Generadores'),(3, 65, 'Carritos'),(3, 66, 'Etiquetas'),(3, 67, 'Búsqueda'),(3, 68, 'Adjuntos'),
|
||||
(3, 69, 'Informations'),(3, 70, 'Rendimiento'),(3, 72, 'Web service'),(3, 71, 'Servicio al cliente'),(3, 73, 'Movimiento de Stock'), (3, 82, 'Tiendas'),(3, 83, 'Temas'),(3, 84, 'Geolocalización'),(3, 85, 'Reglas de Impuestos'),(3, 86, 'Log'),
|
||||
(3, 87, 'Condados'),(3,88,'Home'), (3, 89, 'Shops'), (3, 90, 'Group Shops'), (3, 91, 'Shop Urls');
|
||||
(3, 69, 'Informaciones'),(3, 70, 'Rendimiento'),(3, 72, 'Web service'),(3, 71, 'Servicio al cliente'),(3, 73, 'Movimiento de Stock'), (3, 82, 'Tiendas'),(3, 83, 'Temas'),(3, 84, 'Geolocalización'),(3, 85, 'Reglas de Impuestos'),(3, 86, 'Log'),
|
||||
(3, 87, 'Condados'),(3,88,'Home'),(3, 89, 'Mejorar'), (3, 90, 'Shops'), (3, 91, 'Group Shops'), (3, 92, 'Shop Urls');
|
||||
|
||||
INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(4, 1, 'Katalog'),(4, 2, 'Kunden'),(4, 3, 'Bestellungen'),(4, 4, 'Zahlung'),
|
||||
@@ -774,7 +774,7 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(4, 61, 'Suchmaschinen'),(4, 62, 'Referrer'),(4, 63, 'Gruppen'),(4, 64, 'Generatoren'),(4, 65, 'Warenkörbe'),(4, 66, 'Tags'),(4, 67, 'Suche'),
|
||||
(4, 68, 'Anhänge'),(4, 69, 'Konfigurationsinformationen'),(4, 70, 'Leistung'),(4, 71, 'Kundenservice'),(4, 72, 'Webservice'),(4, 73, 'Lagerbewegungen'),
|
||||
(4, 80, 'Module und Themenkatalog'),(4, 81, 'Mein Konto'),(4, 82, 'Shops'),(4, 83, 'Themen'),(4, 84, 'Geotargeting'),(4, 85, 'Steuerregeln'),(4, 86, 'Log'),
|
||||
(4,87,'Counties'),(4,88,'Home'), (4, 89, 'Shops'), (4, 90, 'Group Shops'), (4, 91, 'Shop Urls');
|
||||
(4,87,'Counties'),(4,88,'Home'),(4, 89, 'Upgrade'), (4, 90, 'Shops'), (4, 91, 'Group Shops'), (4, 92, 'Shop Urls');
|
||||
|
||||
INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(5, 1, 'Catalogo'),(5, 2, 'Clienti'),(5, 3, 'Ordini'),(5, 4, 'Pagamento'),
|
||||
@@ -789,7 +789,7 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(5, 61, 'Motori di ricerca'),(5, 62, 'Referenti'),(5, 63, 'Gruppi'),(5, 64, 'Generatori'),(5, 65, 'Carrelli shopping'),(5, 66, 'Tag'),(5, 67, 'Cerca'),
|
||||
(5, 68, 'Allegati'),(5, 69, 'Informazioni di configurazione'),(5, 70, 'Performance'),(5, 71, 'Servizio clienti'),(5, 72, 'Webservice'),(5, 73, 'Movimenti magazzino'),
|
||||
(5, 80, 'Moduli & Temi catalogo'),(5, 81, 'Il mio Account'),(5, 82, 'Negozi'),(5, 83, 'Temi'),(5, 84, 'Geolocalizzazione'),(5, 85, 'Regimi fiscali'),(5, 86, 'Log'),
|
||||
(5,87,'Counties'),(5,88,'Home'), (5, 89, 'Shops'), (5, 90, 'Group Shops'), (5, 91, 'Shop Urls');
|
||||
(5,87,'Counties'),(5,88,'Home'),(5, 89, 'Aggiornamento'), (5, 90, 'Shops'), (5, 91, 'Group Shops'), (5, 92, 'Shop Urls');
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_tab_lang` (`id_tab`, `id_lang`, `name`)
|
||||
(SELECT `id_tab`, id_lang, (SELECT tl.`name`
|
||||
|
||||